]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
tmpfiles: fstat() works with fd opened with O_PATH since Linux 3.6
authorFranck Bui <fbui@suse.com>
Fri, 2 Mar 2018 15:25:56 +0000 (16:25 +0100)
committerFranck Bui <fbui@suse.com>
Mon, 5 Mar 2018 18:00:11 +0000 (19:00 +0100)
src/tmpfiles/tmpfiles.c

index 42d85a39283a7467f06c174c7757329f2e64d602..dba31526719bb5e11778b9d1c4afd11a42568130 100644 (file)
@@ -814,7 +814,7 @@ static int path_set_perms(Item *i, const char *path) {
                 return r;
         }
 
-        if (fstatat(fd, "", &st, AT_EMPTY_PATH) < 0)
+        if (fstat(fd, &st) < 0)
                 return log_error_errno(errno, "Failed to fstat() file %s: %m", path);
 
         if (hardlink_vulnerable(&st)) {
@@ -1003,7 +1003,7 @@ static int path_set_acls(Item *item, const char *path) {
         if (fd < 0)
                 return log_error_errno(errno, "Adjusting ACL of %s failed: %m", path);
 
-        if (fstatat(fd, "", &st, AT_EMPTY_PATH) < 0)
+        if (fstat(fd, &st) < 0)
                 return log_error_errno(errno, "Failed to fstat() file %s: %m", path);
 
         if (hardlink_vulnerable(&st)) {