Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/setresuid
In directory sc8-pr-cvs1:/tmp/cvs-serv31099/testcases/kernel/syscalls/setresuid
Applied patch from Erik Andersen:
The current setre*id ltp tests check vs an invalid user with uid
999999. The number 999999 is greater than the value of an
unsigned short, which is the type provided by both the 2.4.x and
2.6.x kernels for __kernel_uid_t (include/asm/posix_types.h).
There is no guarantee whether the C library happens to be using
getuid32 or just the plain old getuid syscall under the hood.
With uClibc (which currently uses an unsigned short for uid_t
and gid_t), supplying a uid of 999999 causes the setre*id tests
to return EINVAL (since it would overflow an unsigned short)
when then causes ltp to FAIL (it is expecting an EPERM).
I think the attached patch should be applied. to remove
assumptions about the width of a uid_t and gid_t, and should work
just fine, regardless of whether a 32bit or 16 bit uid_t and
gid_t are in use.
RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/setresuid/setresuid03.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- setresuid03.c 27 Mar 2003 20:52:37 -0000 1.4
+++ setresuid03.c 5 Jan 2004 20:04:39 -0000 1.5
@@ -76,7 +76,7 @@
extern int setresuid(uid_t, uid_t, uid_t);
int neg_one = -1;
-int inval_user = 999999;
+int inval_user = (USHRT_MAX-2);
/* flag to tell parent if child passed or failed. */
int flag = 0;