Skip to content

Commit

Permalink
prepare-root: Fail if sysroot-ns already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
ruihe774 committed Dec 19, 2024
1 parent 7f2cb24 commit 622444b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/switchroot/ostree-prepare-root.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ main (int argc, char *argv[])
* and unmount sysroot in the root mount namespace to make it invisible.
*/
const char *sysroot_ns = OTCORE_RUN_OSTREE_PRIVATE "/sysroot-ns";
glnx_autofd int ns_fd = open (sysroot_ns, O_WRONLY | O_CREAT, 0);
glnx_autofd int ns_fd = open (sysroot_ns, O_RDONLY | O_CREAT | O_EXCL | O_CLOEXEC, 0);
if (ns_fd < 0)
err (EXIT_FAILURE, "failed to create %s", sysroot_ns);

Expand Down

0 comments on commit 622444b

Please sign in to comment.