Page MenuHomeFreeBSD

D54786.diff
No OneTemporary

D54786.diff

diff --git a/lib/libc/posix1e/mac.conf b/lib/libc/posix1e/mac.conf
--- a/lib/libc/posix1e/mac.conf
+++ b/lib/libc/posix1e/mac.conf
@@ -12,6 +12,7 @@
default_labels file ?biba,?lomac,?mls,?sebsd
default_labels ifnet ?biba,?lomac,?mls,?sebsd
+default_labels jail ?
default_labels process ?biba,?lomac,?mls,?partition,?sebsd
default_labels socket ?biba,?lomac,?mls
diff --git a/lib/libjail/jail.c b/lib/libjail/jail.c
--- a/lib/libjail/jail.c
+++ b/lib/libjail/jail.c
@@ -1436,18 +1436,21 @@
int error;
error = mac_prepare_type(pmac, "jail");
+ if (error != 0 && errno == ENOENT) {
+ /*
+ * We special-case the scenario where a system has a custom
+ * mac.conf(5) that doesn't include a jail entry -- just let
+ * an empty label slide.
+ */
+ error = mac_prepare(pmac, "?");
+ }
if (error != 0) {
int serrno = errno;
free(jp->jp_value);
jp->jp_value = NULL;
- if (serrno == ENOENT) {
- snprintf(jail_errmsg, sizeof(jail_errmsg),
- "jail_get: no mac.conf(5) jail config");
- } else {
- strerror_r(serrno, jail_errmsg, JAIL_ERRMSGLEN);
- }
+ strerror_r(serrno, jail_errmsg, JAIL_ERRMSGLEN);
errno = serrno;
return (-1);
}

File Metadata

Mime Type
text/plain
Expires
Tue, Jan 20, 8:29 PM (11 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27774639
Default Alt Text
D54786.diff (1 KB)

Event Timeline