Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F141247996
D25905.id75230.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D25905.id75230.diff
View Options
Index: sbin/fsck_msdosfs/Makefile
===================================================================
--- sbin/fsck_msdosfs/Makefile
+++ sbin/fsck_msdosfs/Makefile
@@ -9,7 +9,7 @@
MAN= fsck_msdosfs.8
SRCS= main.c check.c boot.c fat.c dir.c fsutil.c
-CFLAGS+= -I${FSCK} -DHAVE_LIBUTIL_H
+CFLAGS+= -I${FSCK} -DHAVE_LIBUTIL_H -DHAVE_CAPSICUM
LIBADD= util
.include <bsd.prog.mk>
Index: sbin/fsck_msdosfs/check.c
===================================================================
--- sbin/fsck_msdosfs/check.c
+++ sbin/fsck_msdosfs/check.c
@@ -33,6 +33,9 @@
"$FreeBSD$";
#endif /* not lint */
+#ifdef HAVE_CAPSICUM
+#include<capsicum_helpers.h>
+#endif
#ifdef HAVE_LIBUTIL_H
#include <libutil.h>
#endif
@@ -78,6 +81,19 @@
return 8;
}
+#ifdef HAVE_CAPSICUM
+ /*
+ * Here we enter capability mode. Further down access to global
+ * namespaces (e.g filesystem) is restricted (see capsicum(4)).
+ * We must connect(2) our socket before this point.
+ */
+
+ if (caph_enter() < 0) {
+ fprintf(stderr, "caph_enter_casper: %s\n", strerror(errno));
+ exit(1);
+ }
+#endif
+
if (readboot(dosfs, &boot) == FSFATAL) {
close(dosfs);
printf("\n");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 4, 12:20 AM (6 h, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27477898
Default Alt Text
D25905.id75230.diff (1 KB)
Attached To
Mode
D25905: Capsicumize fsck_msdosfs
Attached
Detach File
Event Timeline
Log In to Comment