mirror of
https://github.com/troglobit/finit.git
synced 2026-09-30 13:02:37 +07:00
tmpfiles: fix L+ to replace non-directory entries
The L+ type should replace existing entries with a symlink. Previously, rmrf() was always called which is only appropriate for directories. Now we check if the path is a directory first, and use erase() for files and symlinks.
This commit is contained in:
+4
-1
@@ -568,7 +568,10 @@ static void tmpfiles(char *line)
|
||||
if (!strc) {
|
||||
if (type[1] != '+')
|
||||
break;
|
||||
rmrf(path);
|
||||
if (fisdir(path))
|
||||
rmrf(path);
|
||||
else
|
||||
erase(path);
|
||||
}
|
||||
mkparent(path, 0755);
|
||||
if (!arg) {
|
||||
|
||||
Reference in New Issue
Block a user