[PATCH] start-stop-daemon cannot set gid

Luciano Miguel Ferreira Rocha strange at nsk.no-ip.org
Mon Feb 26 15:00:31 PST 2007


On Mon, Feb 26, 2007 at 11:45:37PM +0100, Denis Vlasenko wrote:
> On Monday 26 February 2007 14:51, Thaddeus Ternes wrote:
> > On 2006/7/16, I posted a patch that added chuid support to
> > start-stop-daemon.  See this thread for the original patch:
> > 
> > http://busybox.net/lists/busybox/2006-July/023212.html
> > 
> > I'm including a modification of that patch to add chgid support as
> > well.  The syntax is a bit different the previous proposed patch on
> > this thread, but it may be of interest to some.
> 
> If there is a "standard" start-stop-daemon (I suppose there is,
> but I don't use Debian, so I don't know for sure), it's better
> to match it, I think.
> 
> With the patch Natanael just tested, bbox ssd supports:
> 
> --chuid <user>[:[<group>]]
> or
> --chuid :<group>
> 
> Does this match "standard"? If not, I will gladly take
> patches which fix that...
> --

man page:

 -g|--group group|gid
        Change to group or gid when starting the process.

 -c|--chuid username|uid
        Change to this username/uid before starting the process. You can
        also  specify a group by appending a :, then the group or gid in
        the same way as you would for the `chown' command  (user:group).
        When  using  this  option  you must realize that the primary and
        supplemental groups are set as well, even if the --group  option
        is  not  specified.   The --group option is only for groups that
        the user isn't normally a member  of  (like  adding  per/process
        group membership for generic users like nobody).

According to source code, username is mandatory (otherwise getpwnam will
fail and cause the process to terminate).

-- 
lfr
0/0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://busybox.net/lists/busybox/attachments/20070226/368453bd/attachment-0001.pgp 


More information about the busybox mailing list