mirror of
https://github.com/troglobit/finit.git
synced 2026-10-19 11:09:35 +00: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:
1 parent
6bf35513c3
commit
7459ede806
1 file changed
+4
-1
+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