Skip to content

Commit ae3b538

Browse files
croissanneallisonkarlitskaya
authored andcommitted
cfsctl: add insecure option
Allows cfsctl operations with fs-verity disabled. Signed-off-by: Sanne Raymaekers <[email protected]>
1 parent 3e08695 commit ae3b538

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ pub struct App {
2727
#[clap(long, group = "repopath")]
2828
system: bool,
2929

30+
/// Sets the repository to insecure before running any operation and
31+
/// prepend '?' to the composefs kernel command line when writing
32+
/// boot entry.
33+
#[clap(long)]
34+
insecure: bool,
35+
3036
#[clap(subcommand)]
3137
cmd: Command,
3238
}
@@ -160,7 +166,7 @@ async fn main() -> Result<()> {
160166

161167
let args = App::parse();
162168

163-
let repo: Repository<Sha256HashValue> = (if let Some(path) = &args.repo {
169+
let mut repo: Repository<Sha256HashValue> = (if let Some(path) = &args.repo {
164170
Repository::open_path(CWD, path)
165171
} else if args.system {
166172
Repository::open_system()
@@ -172,6 +178,8 @@ async fn main() -> Result<()> {
172178
Repository::open_user()
173179
})?;
174180

181+
repo.set_insecure(args.insecure);
182+
175183
match args.cmd {
176184
Command::Transaction => {
177185
// just wait for ^C

0 commit comments

Comments
 (0)