]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
security: Document @restore member of transaction list
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 15 Feb 2019 10:23:29 +0000 (11:23 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 3 Jul 2019 06:36:03 +0000 (08:36 +0200)
Both DAC and SELinux drivers support transactions. Each item on
the transaction list consists of various variables and @restore
is one of them. Document it so that as the list of variables grow
it's easier to spot which variable does what.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/security/security_dac.c
src/security/security_selinux.c

index 300c383dd5d82b2bb1dc64d296040a90af3a1a05..c19421fa8f9f1eddd8b66af3394d0155fad0db70 100644 (file)
@@ -79,7 +79,7 @@ struct _virSecurityDACChownItem {
     const virStorageSource *src;
     uid_t uid;
     gid_t gid;
-    bool restore;
+    bool restore; /* Whether current operation is 'set' or 'restore' */
 };
 
 typedef struct _virSecurityDACChownList virSecurityDACChownList;
@@ -155,8 +155,11 @@ virSecurityDACChownListFree(void *opaque)
  * @src: disk source to chown
  * @uid: user ID
  * @gid: group ID
+ * @restore: if current operation is set or restore
  *
  * Appends an entry onto transaction list.
+ * The @restore should be true if the operation is restoring
+ * seclabel and false otherwise.
  *
  * Returns: 1 in case of successful append
  *          0 if there is no transaction enabled
index ff54d47e23831380c699271f50641940a38fc151..38f4e3afd83ae09f004ac674c95915ab96d1b572 100644 (file)
@@ -82,7 +82,7 @@ struct _virSecuritySELinuxContextItem {
     char *path;
     char *tcon;
     bool optional;
-    bool restore;
+    bool restore; /* Whether current operation is 'set' or 'restore' */
 };
 
 typedef struct _virSecuritySELinuxContextList virSecuritySELinuxContextList;
@@ -168,8 +168,11 @@ virSecuritySELinuxContextListFree(void *opaque)
  * @path: Path to chown
  * @tcon: target context
  * @optional: true if setting @tcon is optional
+ * @restore: if current operation is set or restore
  *
  * Appends an entry onto transaction list.
+ * The @restore should be true if the operation is restoring
+ * seclabel and false otherwise.
  *
  * Returns: 1 in case of successful append
  *          0 if there is no transaction enabled