PERFORCE change 178362 for review
Jonathan Anderson
jona at FreeBSD.org
Mon May 17 03:48:45 UTC 2010
http://p4web.freebsd.org/@@178362?ac=10
Change 178362 by jona at jona-belle-freebsd8 on 2010/05/17 03:48:27
Added regression test case: fcntl(x) should fail with ENOTCAPABLE (rather than EBADF) when x does not have CAP_FCNTL
Affected files ...
.. //depot/projects/trustedbsd/capabilities/src/tools/regression/security/cap_test/cap_test_fcntl.c#2 edit
Differences ...
==== //depot/projects/trustedbsd/capabilities/src/tools/regression/security/cap_test/cap_test_fcntl.c#2 (text+ko) ====
@@ -29,7 +29,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$P4: //depot/projects/trustedbsd/capabilities/src/tools/regression/security/cap_test/cap_test_fcntl.c#1 $");
+__FBSDID("$P4: //depot/projects/trustedbsd/capabilities/src/tools/regression/security/cap_test/cap_test_fcntl.c#2 $");
#include <sys/types.h>
#include <sys/capability.h>
@@ -101,6 +101,13 @@
else if(fcntl(files[i].fd, F_GETFL, 0) == -1)
warnx("Error calling fcntl('%s', F_GETFL)", files[i].name);
+
+ else if (fcntl(cap_new(files[i].fd, 0), F_GETFL, 0) == -1)
+ {
+ if(errno != ENOTCAPABLE)
+ warn("fcntl('%s', F_GETFL) failed, but errno"
+ " != ENOTCAPABLE", files[i].name);
+ }
}
}
More information about the p4-projects
mailing list