Permalink
Browse files

tmpfiles: fstat() works with fd opened with O_PATH since Linux 3.6

  • Loading branch information...
fbuihuu committed Mar 2, 2018
1 parent 774f79b commit 56114d45d01fe3e4938e31549ad7c0bd19b9cf42
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/tmpfiles/tmpfiles.c
@@ -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)) {

0 comments on commit 56114d4

Please sign in to comment.