Date: Thu, 29 Jan 2009 21:11:30 GMT From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 156887 for review Message-ID: <200901292111.n0TLBUaa046182@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=156887 Change 156887 by rwatson@rwatson_freebsd_capabilities on 2009/01/29 21:10:55 Test pdfork, pdgetpid, pdkill in capability mode. Affected files ... .. //depot/projects/trustedbsd/capabilities/src/tools/regression/security/cap_test/cap_test_syscalls.c#4 edit Differences ... ==== //depot/projects/trustedbsd/capabilities/src/tools/regression/security/cap_test/cap_test_syscalls.c#4 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$P4: //depot/projects/trustedbsd/capabilities/src/tools/regression/security/cap_test/cap_test_syscalls.c#3 $"); +__FBSDID("$P4: //depot/projects/trustedbsd/capabilities/src/tools/regression/security/cap_test/cap_test_syscalls.c#4 $"); #include <sys/param.h> #include <sys/capability.h> @@ -186,9 +186,6 @@ pid = fork(); if (pid >= 0) { if (pid == 0) { - /* - * Not much to be done except print... - */ exit(0); } else if (pid > 0) { warnx("test_syscalls:fork succeeded"); @@ -324,6 +321,23 @@ close(fd); } + pid = pdfork(&fd); + if (pid < 0) + warn("test_syscalls:pdfork %d", errno); + else if (pid == 0) { + sleep(1); + exit(0); + } else { + if (pdgetpid(fd, &wpid) == 0) { + if (pid != wpid) + warnx("test_syscalls:pdgetpid wrong pid"); + } else + warn("test_syscalls:pdgetpid %d", errno); + if (pdkill(fd, 0) < 0) + warn("test_syscalls:pdkill %d", errno); + close(fd); + } + if (pipe(fd2) == 0) { close(fd2[0]); close(fd2[1]);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901292111.n0TLBUaa046182>