Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178373605
D7982.1796611088.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
790 B
Referenced Files
None
Subscribers
None
D7982.1796611088.diff
View Options
Index: head/usr.bin/primes/primes.c
===================================================================
--- head/usr.bin/primes/primes.c
+++ head/usr.bin/primes/primes.c
@@ -61,6 +61,7 @@
* validation check: there are 664579 primes between 0 and 10^7
*/
+#include <sys/capsicum.h>
#include <ctype.h>
#include <err.h>
#include <errno.h>
@@ -70,6 +71,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <nl_types.h>
#include <unistd.h>
#include "primes.h"
@@ -99,6 +101,12 @@
int ch;
char *p;
+ /* Cache NLS data, for strerror, for err(3), before cap_enter. */
+ (void)catopen("libc", NL_CAT_LOCALE);
+
+ if (cap_enter() < 0 && errno != ENOSYS)
+ err(1, "cap_enter");
+
while ((ch = getopt(argc, argv, "h")) != -1)
switch (ch) {
case 'h':
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Dec 7, 2:38 AM (13 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42269933
Default Alt Text
D7982.1796611088.diff (790 B)
Attached To
Mode
D7982: primes: trivially capsicumize
Attached
Detach File
Event Timeline