diff options
| author | Daniel Golle | 2020-07-13 23:40:20 +0000 |
|---|---|---|
| committer | Daniel Golle | 2020-07-13 23:40:20 +0000 |
| commit | 8d5208f044ba9c8cd871f8cea9719fc699604a49 (patch) | |
| tree | 1227229a8d0d00cb0dfa5ba4d65d0f07321e237d | |
| parent | b2230e4ff28b29472d0a232fee5d9f4168390b52 (diff) | |
| download | procd-8d5208f044ba9c8cd871f8cea9719fc699604a49.tar.gz | |
jail: fix false return in case of nofail mount
In some cases mounts could still fail eventhough 'nofail' was set.
Make sure to always return successfull also in those cases.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
| -rw-r--r-- | jail/fs.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -98,7 +98,7 @@ static int do_mount(const char *root, const char *source, const char *target, co fd = creat(new, 0644); if (fd == -1) { ERROR("creat(%s) failed: %m\n", new); - return -1; + return error; } close(fd); } @@ -106,13 +106,14 @@ static int do_mount(const char *root, const char *source, const char *target, co if (mountflags & MS_BIND) { if (mount(source, new, filesystemtype, MS_BIND, optstr)) { ERROR("failed to mount -B %s %s: %m\n", source, new); + return error; } mountflags |= MS_REMOUNT; } if (mount(source, new, filesystemtype, mountflags, optstr)) { ERROR("failed to mount %s %s: %m\n", source, new); - return -1; + return error; } DEBUG("mount %s%s %s (%s)\n", (mountflags & MS_BIND)?"-B ":"", source, new, |