[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH] proposal to enforce correct system account creation in
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2009-04-22 21:38:44
Message-ID: 200904222338.44215.vda.linux () googlemail ! com
[Download RAW message or body]

On Wednesday 22 April 2009 08:55, Tito wrote:
> > I'm concerned that it adds bloat, _unconditionally_.
> > Can you put not-so-critical features in a separate
> > CONFIG_FEATURE_xxx option (or reuse CONFIG_DESKTOP
> > if you think we already have too many of them)?
> 
> Hi,
> I reeeeally think we have to much of them, for example
> 
> ENABLE_FEATURE_ADDUSER_LONG_OPTIONS
> ENABLE_FEATURE_ADDGROUP_LONG_OPTIONS
> 
> which could be moved to GETOPT_LONG.
> 
> OTOH for this specific feature about enforcing sane
> system user and groups creation i would prefer
> to have it always enabled to stay on the safe side.
> You are right that it adds a little in size but
> we saved a lot with the "*: unify concurrent-safe update of /etc/{passwd,group,[g]shadow}"
> patch (Total: -301 bytes) so the balance is still -120 bytes.
> 
> > 
> >  	opt_complementary = "-1:?2";
> > -	if (getopt32(argv, "g:", &group)) {
> > -		gid = xatoul_range(group, 0, ((unsigned long)(gid_t)ULONG_MAX) >> 1);
> > +	getopt32(argv, "g:S", &group);
> > +	if (option_mask32 & OPT_GID) {
> > +		gid = xatoul_range(group, 0, UINT_MAX);
> > 
> > 
> > I bet this will be smaller:
> > 
> >         opts = getopt32
> > 	if (opt & OPT_GID) ...
> > 
> > 
> > Also, you can use  opt_complementary = "-1:?2:+g" and
> > getopt32(argv, "g:", &gid),
> > then getopt32 will do numeric parsing for you.
> > (gid _must_ be int or unsigned int for it to work).
> > 
> > --
> > vda
> 
> I will take a look a that ASAP, maybe a later separate patch
> for addgroup and probably adduser would be easier
> for me tough.

Applied with some fixes. Please test current svn.
(For example, test that "shadowless" system
does not make busybox annoy user about missing /etc/[g]shadow)
--
vda
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic