sysroot: Add an API to initialize with mountns
authorColin Walters <walters@verbum.org>
Mon, 21 Nov 2022 20:16:04 +0000 (15:16 -0500)
committerColin Walters <walters@verbum.org>
Tue, 22 Nov 2022 13:45:13 +0000 (08:45 -0500)
commit599ffefe7f069712d54f63f67e4a6f92570c554e
tree7d3a79a87ede87708d79172502a26e5c8db0061f
parent9d652be3b18d5899d3aa36868551dc5af5ceef2e
sysroot: Add an API to initialize with mountns

This lowers down into the C library some logic we
have in the binary/app logic, in prep for having more Rust-native
CLI code in https://github.com/ostreedev/ostree-rs-ext/pull/412

Basically we want to *ensure* a mount namespace by invoking
`unshare()` if necessary, instead of requiring our callers
to do this dance.

This also helps fix e.g.
Closes: https://github.com/ostreedev/ostree/issues/2769
apidoc/ostree-sections.txt
src/libostree/libostree-devel.sym
src/libostree/ostree-sysroot.c
src/libostree/ostree-sysroot.h
src/ostree/ot-main.c