call halt/reboot as user

Rob Landley rob at landley.net
Fri Jan 7 10:36:39 UTC 2011


On Friday 07 January 2011 02:09:29 Arno Steffen wrote:
> 2011/1/6 Rob Landley <rob at landley.net>:
> > On Monday 03 January 2011 04:25:42 Arno Steffen wrote:
> >> Happy NY to all of you!
> >> I do have two questions:
> >>
> >> 1) I want normal user give the permission to reboot or halt the system.
> >> With current implemented busybox it is not allowes - I just get a NO.
> >>
> >> I already changed the link from /sbin/reboot to /bin/reboot or changed
> >> permission, but this doesn't help.
> >>
> >> 2) when user is logged in, I can't change to root, as login command
> >> can only be run as superuser.
> >> How can I change the user?
> >
> > Set the suid bit on your busybox binary, and enable CONFIG_FEATURE_SUID
> > and CONFIG_FEATURE_SUID_CONFIG.  Then read the menuconfig help for
> > CONFIG_FEATURE_SUID_CONFIG.  (It's under busybox settings -> general
> > configuration.)
> >
> > Rob
> > --
> > GPLv3: as worthy a successor as The Phantom Menace, as timely as Duke
> > Nukem Forever, and as welcome as New Coke.
>
> Thanks all for your help!
> This works fine for me. The only trouble I have now, I can use it only
> if it is compiled for a full blown desktop.

CONFIG_DESKTOP is a symbol that Denys put in, which has no real systematic 
meaning I can detect.  It seems to mean "stuff we can theoretically remove but 
which is too trivial to give its own config symbol".  It doesn't have any 
obvious connection to desktop systems other than the name.

That said, CONFIG_FEATURE_SUID_CONFIG _does_ have its own config symbol, so not 
working in the absence of CONFIG_DESKTOP sounds like a bug.

> Otherwise I get an hang up while booting:
> request_module: runaway loop modprobe binfmt-464c ?!?

That sounds very bug-like to me.  However, I don't see what this has to do 
with CONFIG_FEATURE_SUID_CONFIG above.  Are you saying your system won't 
_boot_ with a busybox compiled without CONFIG_DESKTOP?  What happens if you 
switch off CONFIG_DESKTOP _and_ CONFIG_FEATURE_SUID (and don't set the suid 
bit)?

Trying to figure out if CONFIG_FEATURE_SUID gets damaged in the absence of 
CONFIG_DESKTOP, or if it's modprobe or something going strange...

Rob
-- 
GPLv3: as worthy a successor as The Phantom Menace, as timely as Duke Nukem 
Forever, and as welcome as New Coke.


More information about the busybox mailing list