Merge branch 'linux-have-mlslabel' into refs/top-bases/linux-zfs-branch
This commit is contained in:
commit
bda31592bf
|
@ -906,6 +906,7 @@ zfs_valid_proplist(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl,
|
|||
|
||||
case ZFS_PROP_MLSLABEL:
|
||||
{
|
||||
#ifdef HAVE_MLSLABEL
|
||||
/*
|
||||
* Verify the mlslabel string and convert to
|
||||
* internal hex label string.
|
||||
|
@ -955,7 +956,12 @@ badlabel:
|
|||
(void) zfs_error(hdl, EZFS_BADPROP, errbuf);
|
||||
m_label_free(new_sl); /* OK if null */
|
||||
goto error;
|
||||
|
||||
#else
|
||||
zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
|
||||
"mlslabels are unsupported"));
|
||||
(void) zfs_error(hdl, EZFS_BADPROP, errbuf);
|
||||
goto error;
|
||||
#endif /* HAVE_MLSLABEL */
|
||||
}
|
||||
|
||||
case ZFS_PROP_MOUNTPOINT:
|
||||
|
@ -2016,6 +2022,7 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen,
|
|||
|
||||
case ZFS_PROP_MLSLABEL:
|
||||
{
|
||||
#ifdef HAVE_MLSLABEL
|
||||
m_label_t *new_sl = NULL;
|
||||
char *ascii = NULL; /* human readable label */
|
||||
|
||||
|
@ -2049,6 +2056,10 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen,
|
|||
|
||||
(void) strlcpy(propbuf, ascii, proplen);
|
||||
free(ascii);
|
||||
#else
|
||||
(void) strlcpy(propbuf,
|
||||
getprop_string(zhp, prop, &source), proplen);
|
||||
#endif /* HAVE_MLSLABEL */
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -339,6 +339,7 @@ zfs_secpolicy_write_perms(const char *name, const char *perm, cred_t *cr)
|
|||
static int
|
||||
zfs_set_slabel_policy(const char *name, char *strval, cred_t *cr)
|
||||
{
|
||||
#ifdef HAVE_MLSLABEL
|
||||
char ds_hexsl[MAXNAMELEN];
|
||||
bslabel_t ds_sl, new_sl;
|
||||
boolean_t new_default = FALSE;
|
||||
|
@ -426,6 +427,9 @@ out_check:
|
|||
if (needed_priv != -1)
|
||||
return (PRIV_POLICY(cr, needed_priv, B_FALSE, EPERM, NULL));
|
||||
return (0);
|
||||
#else
|
||||
return ENOTSUP;
|
||||
#endif /* HAVE_MLSLABEL */
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in New Issue