Page MenuHomeFreeBSD

D25905.id75230.diff
No OneTemporary

D25905.id75230.diff

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

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)

Event Timeline