[PATCH 10/15] misc: Make *[ug]id16 support optional

Rob Landley rob at landley.net
Tue Dec 20 16:50:04 UTC 2005


On Tuesday 20 December 2005 09:46, Zdenek Pavlas wrote:
> Matt Mackall wrote:
> > On Wed, Nov 16, 2005 at 07:21:30AM -0600, Rob Landley wrote:
> >>Is there an easy way to make sure our programs aren't using these?  (If I
> >>build a new system from source with busybox and uclibc, how do I know if
> >> I can disable this?)
> >
> > These should only be found in legacy binaries, ie 5+ years old.
>
> Not true, unfortunately.  To make uClibc work with linux-tiny
> and [ug]id16 disabled one has to apply patches like this.
> uClibc probably assumes 16 bit __kernel_[ug]id_t and uses
> legacy syscalls exclusively.

They've been fixing that.  Working with linux-tiny is definitely something 
uClibc is interested in.  When you say "patches like this", do you have a 
complete list or is there something we could grep for?

> --- uClibc-0.9.28/libc/sysdeps/linux/common/chown.c
> +++ uclibc/libc/sysdeps/linux/common/chown.c
> @@ -10,16 +10,11 @@
>   #include "syscalls.h"
>   #include <unistd.h>
>
> -#define __NR___syscall_chown __NR_chown
> +#define __NR___syscall_chown __NR_chown32
>   static inline _syscall3(int, __syscall_chown, const char *, path,
>                  __kernel_uid_t, owner, __kernel_gid_t, group);
>
>   int chown(const char *path, uid_t owner, gid_t group)
>   {
> -       if (((owner + 1) > (uid_t) ((__kernel_uid_t) - 1U))
> -               || ((group + 1) > (gid_t) ((__kernel_gid_t) - 1U))) {
> -               __set_errno(EINVAL);
> -               return -1;
> -       }
>          return (__syscall_chown(path, owner, group));
>   }

Rob
-- 
Steve Ballmer: Innovation!  Inigo Montoya: You keep using that word.
I do not think it means what you think it means.



More information about the uClibc mailing list