[libvirt] [PATCH] Add '+' to uid/gid printing for label processing

John Ferlan jferlan at redhat.com
Tue Oct 29 18:52:50 UTC 2013


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.

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 src/security/security_dac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/security/security_dac.c b/src/security/security_dac.c
index 019c789..cb7d322 100644
--- a/src/security/security_dac.c
+++ b/src/security/security_dac.c
@@ -60,7 +60,7 @@ virSecurityDACSetUserAndGroup(virSecurityManagerPtr mgr,
     priv->user = user;
     priv->group = group;
 
-    if (virAsprintf(&priv->baselabel, "%u:%u",
+    if (virAsprintf(&priv->baselabel, "+%u:+%u",
                     (unsigned int) user,
                     (unsigned int) group) < 0)
         return -1;
@@ -1064,7 +1064,7 @@ virSecurityDACGenLabel(virSecurityManagerPtr mgr,
         }
         break;
     case VIR_DOMAIN_SECLABEL_DYNAMIC:
-        if (virAsprintf(&seclabel->label, "%u:%u",
+        if (virAsprintf(&seclabel->label, "+%u:+%u",
                         (unsigned int) priv->user,
                         (unsigned int) priv->group) < 0)
             return rc;
-- 
1.8.3.1




More information about the libvir-list mailing list