This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: A patch for setresuid.


1. -1 is special and is allowed by the system call. In fact, seteuid
   in glibc passes -1 to setresuid.
2. uid_t is unsigned long int and __kernel_uid_t is unsigned short int.
   So (uid_t) -1 == 0xffffffff and (__kernel_uid_t) -1 == 0xffff. As
   the result (uid_t) (__kernel_uid_t) -1 == (uid_t) 0xffff. It !=
   (uid_t) -1 == 0xffffffff. setresuid always returns EINVAL if
   any of uids is -1. That breaks any programs which uses seteuid or
   setresuid. I was wondering why you didn't see it.

   	
-- 
H.J. Lu (hjl@gnu.org)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]