Skip to content

Commit 120db64

Browse files
committed
sysusers: New stub crate
Signed-off-by: Colin Walters <[email protected]>
1 parent 8ca5e49 commit 120db64

File tree

4 files changed

+65
-1
lines changed

4 files changed

+65
-1
lines changed

Cargo.lock

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ members = [
88
"blockdev",
99
"xtask",
1010
"tests-integration",
11-
"tmpfiles"
11+
"tmpfiles",
12+
"sysusers",
1213
]
1314
resolver = "2"
1415

sysusers/Cargo.toml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[package]
2+
name = "bootc-sysusers"
3+
version = "0.1.0"
4+
license = "MIT OR Apache-2.0"
5+
edition = "2021"
6+
publish = false
7+
8+
[dependencies]
9+
camino = { workspace = true }
10+
fn-error-context = { workspace = true }
11+
cap-std-ext = { version = "4" }
12+
thiserror = { workspace = true }
13+
tempfile = { workspace = true }
14+
bootc-utils = { path = "../utils" }
15+
rustix = { workspace = true }
16+
uzers = "0.12"
17+
18+
[dev-dependencies]
19+
anyhow = { workspace = true }
20+
indoc = { workspace = true }
21+
similar-asserts = { workspace = true }
22+
23+
[lints]
24+
workspace = true

sysusers/src/lib.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//! Parse and generate systemd sysusers.d entries.
2+
// SPDX-License-Identifier: Apache-2.0 OR MIT
3+
4+
use std::path::PathBuf;
5+
6+
use thiserror::Error;
7+
8+
/// An error when translating tmpfiles.d.
9+
#[derive(Debug, Error)]
10+
#[allow(missing_docs)]
11+
pub enum Error {
12+
#[error("I/O error: {0}")]
13+
Io(#[from] std::io::Error),
14+
#[error("I/O error on {path}: {err}")]
15+
PathIo { path: PathBuf, err: std::io::Error },
16+
}
17+
18+
/// The type of Result.
19+
pub type Result<T> = std::result::Result<T, Error>;
20+
21+
#[cfg(test)]
22+
mod tests {}

0 commit comments

Comments
 (0)