]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf: remove faulty flags
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 11 Jun 2020 15:30:00 +0000 (17:30 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 11 Jun 2020 15:34:40 +0000 (17:34 +0200)
If we set O_RDWR we won't be able to open directories and if we set O_PATH we
won't be able to chown.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/conf.c

index 5cbca60006d8a2d59d14815c10117278850d5379..115555cd10f57b0dadd39abfed8e21754e2f7650 100644 (file)
@@ -4526,7 +4526,7 @@ int userns_exec_mapped_root(const char *path, int path_fd,
                return log_error(-1, "No gid mapping for container root");
 
        if (path_fd < 0) {
-               fd = open(path, O_RDWR | O_CLOEXEC | O_NOCTTY | O_PATH);
+               fd = open(path, O_CLOEXEC | O_NOCTTY);
                if (fd < 0)
                        return log_error_errno(-errno, errno, "Failed to open \"%s\"", path);
                target_fd = fd;