Module Name:    src
Committed By:   jruoho
Date:           Mon Apr  4 01:49:45 UTC 2011

Modified Files:
        src/tests/syscall: t_access.c

Log Message:
Check for getuid(2) == 0.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/syscall/t_access.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/syscall/t_access.c
diff -u src/tests/syscall/t_access.c:1.1 src/tests/syscall/t_access.c:1.2
--- src/tests/syscall/t_access.c:1.1	Sun Apr  3 16:12:46 2011
+++ src/tests/syscall/t_access.c	Mon Apr  4 01:49:45 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: t_access.c,v 1.1 2011/04/03 16:12:46 jruoho Exp $ */
+/* $NetBSD: t_access.c,v 1.2 2011/04/04 01:49:45 jruoho Exp $ */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: t_access.c,v 1.1 2011/04/03 16:12:46 jruoho Exp $");
+__RCSID("$NetBSD: t_access.c,v 1.2 2011/04/04 01:49:45 jruoho Exp $");
 
 #include <errno.h>
 #include <fcntl.h>
@@ -55,6 +55,9 @@
 	size_t i;
 	int fd;
 
+	if (getuid() == 0)
+		return;
+
 	fd = open(path, O_RDONLY | O_CREAT);
 
 	if (fd < 0)

Reply via email to