[PATCH] support for find -user

Natanael Copa natanael.copa at gmail.com
Fri Feb 2 07:09:50 UTC 2007


On Thu, 2007-02-01 at 23:36 +0100, Denis Vlasenko wrote:
> On Wednesday 31 January 2007 21:55, Natanael Copa wrote:
> > The attatched patch adds support for option -user. The arg to -user can
> > be either username or uid.
> >
> > Would be nice if it could be committed.
> > Thanks!
> 
> +                       ap->uid = bb_strtoul(arg1, (char **)NULL, 10);
> 
> Why you use *strtoul* and then assign it to unsigned *int*?

You are right. The uid type should ofcourse be uid_t and not int.

The xuname2uid() returns a long (why not uid_t?) so i think I could use
strtol() instead of bb_strtou().

> Why cast?

When I was looking for a atoi with error detection in libbb I found that
the atoi man-page states that the atoi behaviour is the same as

              strtol(nptr, (char **)NULL, 10);

The cast comes from there.

Sorry for the type confusion. New patch is attatched.

> Otherwise looks ok, applying...

Thanks!

> --
> vda
-------------- next part --------------
A non-text attachment was scrubbed...
Name: find-uid_t.patch
Type: text/x-patch
Size: 886 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20070202/bddb1e2f/attachment-0002.bin 


More information about the busybox mailing list