[Dnsmasq-discuss] Compile time error - prctl
Daniele
sturia at tiscali.it
Sun Jan 13 15:21:47 GMT 2013
Hi Simon,
thanks for your feedback about prctl. On the router for which I'm
compiling the only existing user is root, so the user=root in the
dnsmasq.conf was already set, otherwise dnsmasq wouldn't even have
started. Given what you say, it should be working just fine since
changing user is not allowed by the box itself.
About compilation, this is what I set
#define NO_LARGEFILE
#define NO_IPV6
#define NO_TFTP
#define NO_DHCP6
#define NO_SCRIPT
and the binary got around 230KB. Still big for the limited amount of non
volatile memory of my router (around 400KB) but small enough to fit in
there. Considering it's a fully functional DHCP+DNS server well.. great
job, thanks :)
cheers
daniele
Il 13/01/2013 13:36, Simon Kelley ha scritto:
> On 12/01/13 16:38, Daniele wrote:
>> Hi there,
>> I'm trying to compile dnsmasq for my router running mipsel+busybox (it's
>> an AR7 based box). I'm compiling under Ubuntu 12 and the toolchain
>> should be working fine since I succesfully compiled other programs.
>> Compiling works file for all the components (cache.c, util.c, etc..) but
>> the process stops at this stage
>>
>> mipsel-uclibc-gcc -o dnsmasq cache.o rfc1035.o util.o option.o
>> forward.o network.o dnsmasq.o dhcp.o lease.o rfc2131.o netlink.o dbus.o
>> bpf.o helper.o tftp.o log.o conntrack.o dhcp6.o rfc3315.o dhcp-common.o
>> outpacket.o radv.o slaac.o
>>
>> With the following error:
>> dnsmasq.o: In function `main':
>> dnsmasq.c:(.text+0x235c): undefined reference to `prctl'
>> dnsmasq.c:(.text+0x3b14): undefined reference to `prctl'
>>
>> I investigated a bit, and found this thread
>> http://comments.gmane.org/gmane.network.dns.dnsmasq.general/1162
>>
>> so I dumbly entered the code, commented the two prctl calls and
>> succesfully compiled.
>>
>> The binary looks to be working so far, but I'd like to understand a bit
>> more what I'm missing by having commented those calls.
>
> One of the calls is not going to give you a problem - it just turns on
> core dumps in debug mode. The other one might - it's part of the
> process of drop most root privileges but keeping just enough
> capabilities to work. If you have problems then running with user=root
> will fix them, at the expense of notionally less security.
>
>>
>> second point: with uclibc, I get binary around 200 kB. Are there any
>> tricks to make it lighter at compile time? ie, I don't use DNS
>> functionalities, just DHCP.. is there any possiblity to disable the
>> compilation of the DNS modules?
> DNS is the one thing that you can't omit, but there is a load of
> modules you can. see src/config.h for details. DHCP6, TFTP and SCRIPT
> are obvious ones to go for.
>
>
> Cheers,
>
> Simon.
>
>>
>> thanks
>> daniele
>>
>>
>> _______________________________________________
>> Dnsmasq-discuss mailing list
>> Dnsmasq-discuss at lists.thekelleys.org.uk
>> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>>
>
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>
More information about the Dnsmasq-discuss
mailing list