ifconfig
Rob Landley
rob at landley.net
Tue Aug 22 23:33:42 UTC 2006
On Tuesday 22 August 2006 1:29 pm, Mo, Vincent wrote:
> Can someone explain if it's possible to change the IP address of an
> interface when issuing ifconfig as a non root user? I've tried SUID
> root on busybox and it doesn't work. And I've tried doing a su -c
> 'ifconfig eth1 10.0.0.2' and it doesn't work. The 1st method returns
> "SIOCSIFADDR: Permission denied " and the 2nd method doesn't return any
> errors, instead, a new shell is created and the ip address remains the
> same.
Sigh, we need a real sudo. (It's on my todo list!)
The problem is that busybox is supposed to have the suid bit on it so it can
handle commands like "su", and when it detects that the suid bit has been
used to elevate priviledges (I.E. the uid and euid don't match) it drops
those priviledges again before running most applets.
Two easy ways to work around this:
1) Build a separate ifconfig that has "settings->general
configuration->support for suid/gid handling" switched off. (You could do
make allnoconfig, then make menuconfig and switch on just the applet you
want, then build it and "mv busybox ifconfig" when you're done.)
2) Enable the option below that, "Runtime SUID/SGID configuration" and read up
on how to configure /etc/busybox.conf. (I've never used it. I want to make
a _real_ sudo command instead.)
Rob
--
Never bet against the cheap plastic solution.
More information about the busybox
mailing list