Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/setreuid
In directory sc8-pr-cvs1:/tmp/cvs-serv31099/testcases/kernel/syscalls/setreuid
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/setreuid/setreuid06.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- setreuid06.c 27 Mar 2003 20:56:04 -0000 1.4
+++ setreuid06.c 5 Jan 2004 20:04:39 -0000 1.5
@@ -53,7 +53,7 @@
-#define INVAL_USER 999999
+#define INVAL_USER (USHRT_MAX-2)
char *TCID = "setreuid06";
int TST_TOTAL = 1;