No need to open() anything in that case, hence don't.
assert(i);
assert(path);
+ if (!i->mode_set && !i->uid_set && !i->gid_set)
+ goto shortcut;
+
/* We open the file with O_PATH here, to make the operation
* somewhat atomic. Also there's unfortunately no fchmodat()
* with AT_SYMLINK_NOFOLLOW, hence we emulate it here via
}
log_full_errno(level, errno, "Adjusting owner and mode for %s failed: %m", path);
-
return r;
}
fd = safe_close(fd);
+shortcut:
return label_fix(path, false, false);
}