[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ltp-cvs
Subject:    [Ltp-cvs] ltp/testcases/kernel/syscalls/setreuid setreuid06.c,1.4,1.5
From:       robbiew () users ! sourceforge ! net
Date:       2004-01-05 20:04:41
Message-ID: E1Adaxt-00087e-00 () sc8-pr-cvs1 ! sourceforge ! net
[Download RAW message or body]

Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/setreuid
In directory sc8-pr-cvs1:/tmp/cvs-serv31099/testcases/kernel/syscalls/setreuid

Modified Files:
	setreuid06.c 
Log Message:
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.
=================================


Index: setreuid06.c
===================================================================
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 @@
 #include "test.h"
 #include "usctest.h"
 
-#define INVAL_USER	999999	
+#define INVAL_USER		 (USHRT_MAX-2)
 
 char *TCID = "setreuid06";
 int TST_TOTAL = 1;




-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
Ltp-cvs mailing list
Ltp-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-cvs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic