Skip to content

Commit dcfc752

Browse files
committed
status: Use prepare_for_write instead of require_root
This prevents /sysroot from switching to being persistently mounted as rw. Signed-off-by: Chris Kyrouac <[email protected]>
1 parent 790e7c8 commit dcfc752

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/src/status.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ pub(crate) async fn status(opts: super::cli::StatusOpts) -> Result<()> {
305305
let host = if !Utf8Path::new("/run/ostree-booted").try_exists()? {
306306
Default::default()
307307
} else {
308-
crate::cli::require_root()?;
308+
crate::cli::prepare_for_write().await?;
309309
let sysroot = super::cli::get_locked_sysroot().await?;
310310
let booted_deployment = sysroot.booted_deployment();
311311
let (_deployments, host) = get_status(&sysroot, booted_deployment.as_ref())?;

tests/integration/playbooks/check-system.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,13 @@
133133
shell: findmnt -r -o OPTIONS -n /sysroot | awk -F "," '{print $1}'
134134
register: result_sysroot_mount_status
135135

136-
- name: /sysroot should be mount with rw permission
136+
- name: /sysroot should be mount with ro permission
137137
block:
138138
- assert:
139139
that:
140-
- result_sysroot_mount_status.stdout == "rw"
141-
fail_msg: "/sysroot is not mounted with rw permission"
142-
success_msg: "/sysroot is mounted with rw permission"
140+
- result_sysroot_mount_status.stdout == "ro"
141+
fail_msg: "/sysroot is not mounted with ro permission"
142+
success_msg: "/sysroot is mounted with ro permission"
143143
always:
144144
- set_fact:
145145
total_counter: "{{ total_counter | int + 1 }}"

0 commit comments

Comments
 (0)