mirror of
https://github.com/troglobit/finit.git
synced 2026-11-23 20:11:44 +00:00
tmpfiles: no warning for a d entry on a link to a directory
A d entry for a path that is a link to a directory warned that mode
and owner could not be set:
d /var/lock 0755
Here /var/lock is a link to /run/lock. The link is not followed, on
purpose, and the open fails.
That is not an error, leave the directory alone without a warning.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
3 files changed
+11
-3
No files matched your search
+3
-1
@@ -1603,7 +1603,9 @@ static void tmpfiles(char *line)
|
||||
mkparent(path, 0755);
|
||||
omask = umask(0);
|
||||
rc = makedir(path, perm.mode ?: 0755);
|
||||
if (!rc && perm_path(path, &perm, strc, O_RDONLY | O_DIRECTORY))
|
||||
/* A link to a directory is not followed, and nothing to warn about */
|
||||
if (!rc && perm_path(path, &perm, strc, O_RDONLY | O_DIRECTORY) &&
|
||||
!(errno == ENOTDIR && !lstat(path, &ast) && S_ISLNK(ast.st_mode)))
|
||||
warn("Failed setting mode/owner on %s", path);
|
||||
umask(omask);
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user