Skip to content

Commit

Permalink
Merge pull request #590 from cgwalters/012-backports
Browse files Browse the repository at this point in the history
012 backports
  • Loading branch information
jmarrero authored Jan 24, 2024
2 parents 7c3f8b8 + b88ec5c commit 46b5272
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
10 changes: 5 additions & 5 deletions lib/src/container/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,11 @@ impl TryFrom<&str> for Transport {
}

impl Transport {
const OCI_STR: &str = "oci";
const OCI_ARCHIVE_STR: &str = "oci-archive";
const CONTAINERS_STORAGE_STR: &str = "containers-storage";
const LOCAL_DIRECTORY_STR: &str = "dir";
const REGISTRY_STR: &str = "registry";
const OCI_STR: &'static str = "oci";
const OCI_ARCHIVE_STR: &'static str = "oci-archive";
const CONTAINERS_STORAGE_STR: &'static str = "containers-storage";
const LOCAL_DIRECTORY_STR: &'static str = "dir";
const REGISTRY_STR: &'static str = "registry";

/// Retrieve an identifier that can then be re-parsed from [`Transport::try_from::<&str>`].
pub fn serializable_name(&self) -> &'static str {
Expand Down
6 changes: 3 additions & 3 deletions lib/src/container/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,9 @@ fn timestamp_of_manifest_or_config(

impl ImageImporter {
/// The metadata key used in ostree commit metadata to serialize
const CACHED_KEY_MANIFEST_DIGEST: &str = "ostree-ext.cached.manifest-digest";
const CACHED_KEY_MANIFEST: &str = "ostree-ext.cached.manifest";
const CACHED_KEY_CONFIG: &str = "ostree-ext.cached.config";
const CACHED_KEY_MANIFEST_DIGEST: &'static str = "ostree-ext.cached.manifest-digest";
const CACHED_KEY_MANIFEST: &'static str = "ostree-ext.cached.manifest";
const CACHED_KEY_CONFIG: &'static str = "ostree-ext.cached.config";

/// Create a new importer.
#[context("Creating importer")]
Expand Down
6 changes: 5 additions & 1 deletion lib/src/isolation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,14 @@ pub(crate) fn unprivileged_subprocess(binary: &str, user: &str) -> Command {
return Command::new(binary);
}
let mut cmd = Command::new("setpriv");
// Clear some strategic environment variables that may cause the containers/image stack
// to look in the wrong places for things.
cmd.env_remove("HOME");
cmd.env_remove("XDG_DATA_DIR");
cmd.env_remove("USER");
cmd.args([
"--no-new-privs",
"--init-groups",
"--reset-env",
"--reuid",
user,
"--bounding-set",
Expand Down

0 comments on commit 46b5272

Please sign in to comment.