mirror of
https://github.com/ostreedev/ostree.git
synced 2025-01-03 05:18:24 +03:00
prepare-root: Fail if sysroot-ns already exists
This commit is contained in:
parent
6626f51e13
commit
3dc167e2ee
@ -735,7 +735,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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user