-
Notifications
You must be signed in to change notification settings - Fork 307
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
bare-user files are always executable (0755 perms) #907
Comments
Some discussion on list about this https://mail.gnome.org/archives/ostree-list/2017-June/msg00011.html Honestly, I don't know why we use |
Having every object in a bare-user repo (and checkouts) be executable is ugly. I can't think of a good reason to do that. So make the committed mode semantics mirror that for user-mode checkouts; we strip suid/sgid bits. However, we also do ensure that the written files are read/writable by the owning user, since otherwise we couldn't do anything to them. I'm not aware of any real use cases for non-readable/non-writable by owner files in ostree. Closes: ostreedev#907
PR in #908 - does that make sense to you? |
Well, sort of :) First, yes now that I have understood a bit more the purpose of "bare-user" mode is for users to run software in these checkouts inside containers, it makes sense for this use case to strip the suid bits, and certainly this part was previously missing for hardlink user mode checkouts of "bare-user" repositories. Second, I'm not sure it's necessary to force read-write for user onto the mode bits. Probably there are two opposing things to consider here:
Anyway, seems to me that the chance of these bits not already being present at commit time are astronomically low, on my system for example:
Not sure what these files are for, also not sure what it buys us to force them to be read-write. |
Note: Another more appropriate invocation of find (find any files which either do not have S_IRUSR or do not have S_IWUSR) On my system for instance, there is a huge amount of results from git repositories which store the objects as read-only even for the regular user, since those are never expected to change this seems like a reasonable mode. |
As I am a bit worried about the SUID situation and how I will be able to create filesystem images which do contain setuid binaries, from inside bubblewrap sandboxes based on user mode checkouts that do not contain setuid binaries (which seems a problem I wont be able to escape without horrible hacks like yocto's pseudo or debian's fakeroot)... I would like to ask that this line in #908:
At least be changed to simply be:
If the concern is only about setuid & setgid binaries being owned by the checking out user (which is a valid concern, but something I think a user might want to live with for some use cases), then I dont see why we should further be forcing read/write permissions on these files. |
Ignore I think the notion I had of requiring writablity came from directories; see this Red Hat bugzilla. Oh wait, the rationale for user-writable is in the comment - we need it to write xattrs. However, |
Having every object in a bare-user repo (and checkouts) be executable is ugly. I can't think of a good reason to do that; they should only be executable if their input is. This does for `bare-user` what we did for `bare-user-only` in ostreedev#909 It's also a stronger version of what we do with `checkout -U` in suppressing suid - here we also strip world-writable files and the sticky bit (even though that's meaningless today, it might not be in the future). Closes: ostreedev#907
With bare repository this is not an issue, but with bare-user and user mode checkouts, my expectation is that permissions are not munged, only file ownership is left to the active user.
This test case exhibits some strange behavior:
The text was updated successfully, but these errors were encountered: