mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-10 23:07:44 +00:00
Add '+' to uid/gid printing for label processing
To ensure proper processing by virGetUserID() and virGetGroupID() of a uid/gid add a "+" prior to the uid/gid to denote it's really a uid/gid for the label.
This commit is contained in:
parent
8e7f57a7b8
commit
aa42bb1700
@ -60,7 +60,7 @@ virSecurityDACSetUserAndGroup(virSecurityManagerPtr mgr,
|
|||||||
priv->user = user;
|
priv->user = user;
|
||||||
priv->group = group;
|
priv->group = group;
|
||||||
|
|
||||||
if (virAsprintf(&priv->baselabel, "%u:%u",
|
if (virAsprintf(&priv->baselabel, "+%u:+%u",
|
||||||
(unsigned int) user,
|
(unsigned int) user,
|
||||||
(unsigned int) group) < 0)
|
(unsigned int) group) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -1064,7 +1064,7 @@ virSecurityDACGenLabel(virSecurityManagerPtr mgr,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case VIR_DOMAIN_SECLABEL_DYNAMIC:
|
case VIR_DOMAIN_SECLABEL_DYNAMIC:
|
||||||
if (virAsprintf(&seclabel->label, "%u:%u",
|
if (virAsprintf(&seclabel->label, "+%u:+%u",
|
||||||
(unsigned int) priv->user,
|
(unsigned int) priv->user,
|
||||||
(unsigned int) priv->group) < 0)
|
(unsigned int) priv->group) < 0)
|
||||||
return rc;
|
return rc;
|
||||||
|
Loading…
Reference in New Issue
Block a user