Skip to content

Commit

Permalink
importer: Drop non-root files in CPIO check
Browse files Browse the repository at this point in the history
rpm upstream did
rpm-software-management/rpm@0f95733

The file metadata is still duplicated in the header, and *that*
seems unlikely to change soon.  So we can just safely drop
this "sanity check".

Closes: coreos#4437
  • Loading branch information
cgwalters committed Jun 9, 2023
1 parent 953bddd commit 8420d46
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions rust/src/importer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,16 +346,9 @@ fn tweak_imported_file_info(file_info: &FileInfo, ro_executables: bool) {
#[context("Analyzing {}", path)]
fn import_filter(
path: &str,
file_info: &FileInfo,
_file_info: &FileInfo,
skip_extraneous: bool,
) -> Result<RepoCommitFilterResult> {
// Sanity check that RPM isn't using CPIO id fields.
let uid = file_info.attribute_uint32("unix::uid");
let gid = file_info.attribute_uint32("unix::gid");
if uid != 0 || gid != 0 {
bail!("Unexpected non-root owned path (marked as {}:{})", uid, gid);
}

// Skip some empty lock files, they are known to cause problems:
// https://github.com/projectatomic/rpm-ostree/pull/1002
if path.starts_with("/usr/etc/selinux") && path.ends_with(".LOCK") {
Expand Down

0 comments on commit 8420d46

Please sign in to comment.