svn commit: r249300 - user/pho/stress2/testcases/syscall

Peter Holm pho at FreeBSD.org
Tue Apr 9 08:30:27 UTC 2013


Author: pho
Date: Tue Apr  9 08:30:27 2013
New Revision: 249300
URL: http://svnweb.freebsd.org/changeset/base/249300

Log:
  Make sure that this test is not run as root.

Modified:
  user/pho/stress2/testcases/syscall/syscall.c

Modified: user/pho/stress2/testcases/syscall/syscall.c
==============================================================================
--- user/pho/stress2/testcases/syscall/syscall.c	Tue Apr  9 08:29:27 2013	(r249299)
+++ user/pho/stress2/testcases/syscall/syscall.c	Tue Apr  9 08:30:27 2013	(r249300)
@@ -70,6 +70,8 @@ setup(int nb __unused)
 	int i;
 	struct rlimit rl;
 
+	if (geteuid() == 0)
+		_exit(1);	/* Do not run as root */
 	umask(0);
 	sprintf(path,"%s.%05d", getprogname(), getpid());
 	(void)mkdir(path, 0770);


More information about the svn-src-user mailing list