Unhardcode user IDs
This commit is contained in:
parent
fa0bf056d0
commit
ea34b7b08c
3 changed files with 14 additions and 4 deletions
5
Cargo.lock
generated
5
Cargo.lock
generated
|
|
@ -635,9 +635,9 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libc"
|
name = "libc"
|
||||||
version = "0.2.174"
|
version = "0.2.178"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776"
|
checksum = "37c93d8daa9d8a012fd8ab92f088405fb202ea0b6ab73ee2482ae66af4f42091"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "linux-raw-sys"
|
name = "linux-raw-sys"
|
||||||
|
|
@ -1026,6 +1026,7 @@ dependencies = [
|
||||||
"clap",
|
"clap",
|
||||||
"eyre",
|
"eyre",
|
||||||
"futures",
|
"futures",
|
||||||
|
"libc",
|
||||||
"rand",
|
"rand",
|
||||||
"rustix",
|
"rustix",
|
||||||
"sidebus-common",
|
"sidebus-common",
|
||||||
|
|
|
||||||
|
|
@ -18,3 +18,4 @@ rustix = { version = "1.0.8", features = ["fs"] }
|
||||||
url = "2.5.4"
|
url = "2.5.4"
|
||||||
rand = "0.9.2"
|
rand = "0.9.2"
|
||||||
futures = "0.3.31"
|
futures = "0.3.31"
|
||||||
|
libc = "0.2.178"
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,14 @@ struct BrokerCli {
|
||||||
/// Unix socket path to listen on for the VM bus
|
/// Unix socket path to listen on for the VM bus
|
||||||
#[clap(long)]
|
#[clap(long)]
|
||||||
unix_path: Option<PathBuf>,
|
unix_path: Option<PathBuf>,
|
||||||
|
|
||||||
|
/// The user ID for the appvm user inside of the guest
|
||||||
|
#[clap(long, default_value = "1337")]
|
||||||
|
guest_uid: u32,
|
||||||
|
|
||||||
|
/// The group ID for the appvm group inside of the guest
|
||||||
|
#[clap(long, default_value = "1337")]
|
||||||
|
guest_gid: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn new_hosted_bus() -> eyre::Result<(
|
async fn new_hosted_bus() -> eyre::Result<(
|
||||||
|
|
@ -129,9 +137,9 @@ async fn main() -> eyre::Result<()> {
|
||||||
"--socket-path",
|
"--socket-path",
|
||||||
cli.runtime_dir.join("fs.sock").to_str().unwrap(),
|
cli.runtime_dir.join("fs.sock").to_str().unwrap(),
|
||||||
"--uid-map",
|
"--uid-map",
|
||||||
":1000:1001:1:",
|
&format!(":{}:{}:1:", cli.guest_uid, unsafe { libc::getuid() }),
|
||||||
"--gid-map",
|
"--gid-map",
|
||||||
":100:100:1:",
|
&format!(":{}:{}:1:", cli.guest_gid, unsafe { libc::getgid() }),
|
||||||
"--log-level",
|
"--log-level",
|
||||||
"debug",
|
"debug",
|
||||||
])
|
])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue