]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virSecurityDACSetOwnershipInternal: Drop dead code
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 3 Jun 2021 12:33:00 +0000 (14:33 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 17 Jun 2021 13:49:02 +0000 (15:49 +0200)
The virSecurityDACSetOwnershipInternal() function accepts two
arguments (among others): @path and @src. The idea being that in
some cases @path is NULL and @src is not and then @path is filled
from @src->path. However, this is done in both callers already
(because of seclabel remembering/recall). Therefore, this code in
virSecurityDACSetOwnershipInternal() is dead, effectively.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/security/security_dac.c

index b6323a7df1187b8770015cb7807cdb5a24a19683..e2a6461375986af56d3865bee8f54ae104de6cda 100644 (file)
@@ -688,15 +688,8 @@ virSecurityDACSetOwnershipInternal(const virSecurityDACData *priv,
     } else {
         struct stat sb;
 
-        if (!path) {
-            if (!src || !src->path)
-                return 0;
-
-            if (!virStorageSourceIsLocalStorage(src))
-                return 0;
-
-            path = src->path;
-        }
+        if (!path)
+            return 0;
 
         if (stat(path, &sb) < 0) {
             virReportSystemError(errno, _("unable to stat: %s"), path);