From: Lennart Poettering Date: Wed, 24 Mar 2021 13:19:04 +0000 (+0100) Subject: mount-util: generate failure if bind_remount_one_with_mountinfo() is called on non... X-Git-Tag: v249-rc1~502^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0338df47cfaeb023c7c2eaf6b698060fd133157b;p=thirdparty%2Fsystemd.git mount-util: generate failure if bind_remount_one_with_mountinfo() is called on non-existing path --- diff --git a/src/shared/mount-util.c b/src/shared/mount-util.c index f226dc1aa68..13f202d7e7d 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) {