Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump to cap-std-ext 2.0, use rustix directly #474

Merged
merged 1 commit into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ chrono = "0.4.19"
olpc-cjson = "0.1.1"
clap = { version= "3.2", features = ["derive"] }
clap_mangen = { version = "0.1", optional = true }
cap-std-ext = "1.0"
cap-std-ext = "2.0"
cap-tempfile = "1.0"
flate2 = { features = ["zlib"], default_features = false, version = "1.0.20" }
fn-error-context = "0.2.0"
Expand All @@ -35,6 +35,7 @@ openssl = "0.10.33"
ostree = { features = ["v2022_5", "cap-std-apis"], version = "0.18.0" }
pin-project = "1.0"
regex = "1.5.4"
rustix = { version = "0.37.19", features = ["fs", "process"] }
serde = { features = ["derive"], version = "1.0.125" }
serde_json = "1.0.64"
tar = "0.4.38"
Expand Down
2 changes: 1 addition & 1 deletion lib/src/commit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use camino::Utf8Path;
use cap_std::fs::Dir;
use cap_std_ext::cap_std;
use cap_std_ext::dirext::CapStdExtDirExt;
use cap_std_ext::rustix::fs::MetadataExt;
use rustix::fs::MetadataExt;
use std::borrow::Cow;
use std::convert::TryInto;
use std::path::Path;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/container/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ impl ManifestDiff {
pub fn merge_default_container_proxy_opts(
config: &mut containers_image_proxy::ImageProxyConfig,
) -> Result<()> {
let user = cap_std_ext::rustix::process::getuid()
let user = rustix::process::getuid()
.is_root()
.then_some(isolation::DEFAULT_UNPRIVILEGED_USER);
merge_default_container_proxy_opts_with_isolation(config, user)
Expand Down
2 changes: 1 addition & 1 deletion lib/src/container/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ impl ImageImporter {
let repo = self.repo;
let state = crate::tokio_util::spawn_blocking_cancellable_flatten(
move |cancellable| -> Result<Box<LayeredImageState>> {
use cap_std_ext::rustix::fd::AsRawFd;
use rustix::fd::AsRawFd;

let cancellable = Some(cancellable);
let repo = &repo;
Expand Down
1 change: 0 additions & 1 deletion lib/src/globals.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! Global functions.

use super::Result;
use cap_std_ext::rustix;
use once_cell::sync::OnceCell;
use ostree::glib;
use std::fs::File;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/ima.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use crate::objgv::*;
use anyhow::{Context, Result};
use camino::Utf8PathBuf;
use cap_std_ext::rustix::fd::BorrowedFd;
use fn_error_context::context;
use gio::glib;
use gio::prelude::*;
Expand All @@ -14,6 +13,7 @@ use glib::Variant;
use gvariant::aligned_bytes::TryAsAligned;
use gvariant::{gv, Marker, Structure};
use ostree::gio;
use rustix::fd::BorrowedFd;
use std::collections::{BTreeMap, HashMap};
use std::ffi::CString;
use std::fs::File;
Expand Down
2 changes: 1 addition & 1 deletion lib/src/integrationtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ fn test_proxy_auth() -> Result<()> {
std::fs::write(authpath, "{}")?;
let mut c = ImageProxyConfig::default();
merge(&mut c)?;
if cap_std_ext::rustix::process::getuid().is_root() {
if rustix::process::getuid().is_root() {
assert!(c.auth_data.is_some());
} else {
assert_eq!(c.authfile.unwrap().as_path(), authpath,);
Expand Down
1 change: 0 additions & 1 deletion lib/src/selinux.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! SELinux-related helper APIs.

use anyhow::Result;
use cap_std_ext::rustix;
use fn_error_context::context;
use std::path::Path;

Expand Down
Loading