mirror of
https://github.com/systemd/systemd.git
synced 2024-10-28 20:25:38 +03:00
mount-util: use UMOUNT_NOFOLLOW in recursive umounter
When we only want to unmount mount points below some path then it is against our interest to follow symlinks. Hence don't.
This commit is contained in:
parent
e49ee28522
commit
827ea52125
@ -58,8 +58,8 @@ int umount_recursive(const char *prefix, int flags) {
|
||||
if (!path_startswith(path, prefix))
|
||||
continue;
|
||||
|
||||
if (umount2(path, flags) < 0) {
|
||||
r = log_debug_errno(errno, "Failed to umount %s: %m", path);
|
||||
if (umount2(path, flags | UMOUNT_NOFOLLOW) < 0) {
|
||||
log_debug_errno(errno, "Failed to umount %s, ignoring: %m", path);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -70,7 +70,6 @@ int umount_recursive(const char *prefix, int flags) {
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
} while (again);
|
||||
|
||||
return n;
|
||||
|
Loading…
Reference in New Issue
Block a user