diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-03-24 14:19:04 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-05-07 11:58:55 +0200 |
commit | 3e4099b090301707ed55d56e7ea6a91bf3910b48 (patch) | |
tree | 2fc9a4e161bfefdc4dc9f57a71b0a1a2caf9f656 | |
parent | f67154881de61d436bd95312bd015314f613c922 (diff) | |
download | systemd-3e4099b090301707ed55d56e7ea6a91bf3910b48.tar.gz |
mount-util: generate failure if bind_remount_one_with_mountinfo() is called on non-existing path
(cherry picked from commit 0338df47cfaeb023c7c2eaf6b698060fd133157b)
-rw-r--r-- | src/shared/mount-util.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/shared/mount-util.c b/src/shared/mount-util.c index f226dc1aa6..13f202d7e7 100644 --- a/src/shared/mount-util.c +++ b/src/shared/mount-util.c @@ -376,8 +376,12 @@ int bind_remount_one_with_mountinfo( return r; fs = mnt_table_find_target(table, path, MNT_ITER_FORWARD); - if (!fs) + if (!fs) { + if (laccess(path, F_OK) < 0) /* Hmm, it's not in the mount table, but does it exist at all? */ + return -errno; + return -EINVAL; /* Not a mount point we recognize */ + } opts = mnt_fs_get_vfs_options(fs); if (opts) { |