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

archive: store the override xattr with the inode type #2183

Merged
merged 6 commits into from
Dec 9, 2024

Conversation

giuseppe
Copy link
Member

Closes: #2174

Copy link
Contributor

openshift-ci bot commented Nov 29, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@giuseppe
Copy link
Member Author

related fuse-overlayfs change: containers/fuse-overlayfs#434

@giuseppe giuseppe force-pushed the extend-override-xattr branch 4 times, most recently from 3e313eb to f5153fb Compare December 2, 2024 09:01
@giuseppe giuseppe marked this pull request as ready for review December 2, 2024 09:04
@giuseppe giuseppe force-pushed the extend-override-xattr branch from f5153fb to 18c73a2 Compare December 2, 2024 09:52
Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK conceptually, but there seems even more to be done.

  • symbolic links are now not handled consistently.
  • check.go interprets force_mask; it needs to be taught about this
  • Doesn’t the code in overlay.Driver.create around creating diff need to also set os.ModeDir now?
  • The parser in pkg/archive.remapIDs seems to need updating (preferably consolidate all parsers to one function)

(It gets confusing… if only the OS had separate types for “permission bits” and “the full mode including a ModeType.)

pkg/archive/archive.go Outdated Show resolved Hide resolved
pkg/chunked/storage_linux.go Outdated Show resolved Hide resolved
pkg/idtools/idtools.go Show resolved Hide resolved
@@ -436,7 +507,7 @@ func SafeChown(name string, uid, gid int) error {
}
}
}
value := Stat{IDPair{uid, gid}, mode}
value := Stat{IDPair{uid, gid}, mode, 0, 0}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to handle file types?

@@ -464,7 +535,7 @@ func SafeLchown(name string, uid, gid int) error {
}
}
}
value := Stat{IDPair{uid, gid}, mode}
value := Stat{IDPair{uid, gid}, mode, 0, 0}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to handle file types?

pkg/idtools/idtools.go Outdated Show resolved Hide resolved
@giuseppe giuseppe force-pushed the extend-override-xattr branch from 18c73a2 to 054a550 Compare December 3, 2024 23:43
@giuseppe giuseppe force-pushed the extend-override-xattr branch 4 times, most recently from 98ff561 to b2ddf4f Compare December 4, 2024 15:23
@giuseppe
Copy link
Member Author

giuseppe commented Dec 4, 2024

pushed a new version, and verified manually both partial pulls and with regular pulls

Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK to the symlink semantics change.

Note also the outstanding items in the top-level review comment in #2183 (review) .

pkg/idtools/idtools.go Outdated Show resolved Hide resolved
pkg/chunked/storage_linux.go Show resolved Hide resolved
pkg/chunked/storage_linux_test.go Outdated Show resolved Hide resolved
pkg/idtools/idtools.go Outdated Show resolved Hide resolved
pkg/idtools/idtools_test.go Outdated Show resolved Hide resolved
pkg/idtools/idtools_test.go Outdated Show resolved Hide resolved
@giuseppe giuseppe force-pushed the extend-override-xattr branch from b2ddf4f to 6a69308 Compare December 5, 2024 15:43
Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don’t SafeChown/SafeLchown still need a bit of an update?

pkg/idtools/idtools_test.go Outdated Show resolved Hide resolved
@giuseppe giuseppe force-pushed the extend-override-xattr branch 2 times, most recently from c11fa65 to 45adba0 Compare December 5, 2024 20:55
@giuseppe
Copy link
Member Author

giuseppe commented Dec 5, 2024

Don’t SafeChown/SafeLchown still need a bit of an update?

I've changed them further. I don't really know how they are used on darwin. I see the same data is also set on the file itself.

@mtrmac
Copy link
Collaborator

mtrmac commented Dec 5, 2024

IIRC the general idea has been to allow unprivileged macOS users to extract volumes, but I’d need to look up the git history to confirm.

@giuseppe giuseppe force-pushed the extend-override-xattr branch from 45adba0 to 89b73d0 Compare December 5, 2024 21:01
Copy link
Collaborator

@mtrmac mtrmac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM otherwise.

pkg/idtools/idtools_test.go Outdated Show resolved Hide resolved
@giuseppe giuseppe force-pushed the extend-override-xattr branch from 89b73d0 to 84e7502 Compare December 6, 2024 07:50
@giuseppe
Copy link
Member Author

giuseppe commented Dec 9, 2024

@rhatdan PTAL

@rhatdan
Copy link
Member

rhatdan commented Dec 9, 2024

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Dec 9, 2024
@openshift-merge-bot openshift-merge-bot bot merged commit ae5f850 into containers:main Dec 9, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Setting shared xattr fails on images with named pipes
3 participants