Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148416166
D25905.id75208.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
802 B
Referenced Files
None
Subscribers
None
D25905.id75208.diff
View Options
Index: sbin/fsck_msdosfs/check.c
===================================================================
--- sbin/fsck_msdosfs/check.c
+++ sbin/fsck_msdosfs/check.c
@@ -33,6 +33,8 @@
"$FreeBSD$";
#endif /* not lint */
+#include<capsicum_helpers.h>
+
#ifdef HAVE_LIBUTIL_H
#include <libutil.h>
#endif
@@ -62,6 +64,18 @@
printf("** %s", fname);
dosfs = open(fname, rdonly ? O_RDONLY : O_RDWR, 0);
+
+ /*
+ * 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);
+ }
+
if (dosfs < 0 && !rdonly) {
dosfs = open(fname, O_RDONLY, 0);
if (dosfs >= 0)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Mar 18, 5:27 PM (13 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29917768
Default Alt Text
D25905.id75208.diff (802 B)
Attached To
Mode
D25905: Capsicumize fsck_msdosfs
Attached
Detach File
Event Timeline
Log In to Comment