Skip to content

Commit abf7eae

Browse files
committed
Drop gvariant dependency
It isn't an actively maintained crate and our usage is tiny and not performance sensitive enough to warrant the zero-copy it entails. Just motivated by doing a pass over our dependencies. Signed-off-by: Colin Walters <[email protected]>
1 parent 2d0512c commit abf7eae

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

Cargo.lock

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

lib/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ clap_mangen = { version = "0.2.20", optional = true }
2626
cap-std-ext = { workspace = true, features = ["fs_utf8"] }
2727
hex = "^0.4.3"
2828
fn-error-context = { workspace = true }
29-
gvariant = "0.5.0"
3029
indicatif = "0.17.8"
3130
libc = { workspace = true }
3231
liboverdrop = "0.1.0"

lib/src/lsm.rs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ use cap_std_ext::cap_std::fs::{Metadata, MetadataExt};
1919
#[cfg(feature = "install")]
2020
use cap_std_ext::dirext::CapStdExtDirExt;
2121
use fn_error_context::context;
22-
#[cfg(feature = "install")]
23-
use gvariant::{aligned_bytes::TryAsAligned, Marker, Structure};
2422
use ostree_ext::gio;
2523
use ostree_ext::ostree;
2624
use rustix::fd::AsFd;
@@ -177,12 +175,12 @@ pub(crate) fn selinux_set_permissive(permissive: bool) -> Result<()> {
177175
#[cfg(feature = "install")]
178176
/// Check if the ostree-formatted extended attributes include a security.selinux value.
179177
pub(crate) fn xattrs_have_selinux(xattrs: &ostree::glib::Variant) -> bool {
180-
let v = xattrs.data_as_bytes();
181-
let v = v.try_as_aligned().unwrap();
182-
let v = gvariant::gv!("a(ayay)").cast(v);
183-
for xattr in v.iter() {
184-
let k = xattr.to_tuple().0;
185-
if k == SELINUX_XATTR {
178+
let n = xattrs.n_children();
179+
for i in 0..n {
180+
let child = xattrs.child_value(i);
181+
let key = child.child_value(0);
182+
let key = key.data_as_bytes();
183+
if key == SELINUX_XATTR {
186184
return true;
187185
}
188186
}

0 commit comments

Comments
 (0)