-
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
lib/repo: For bare-user, make repo modes mirror checkout user-mode #908
Conversation
Oh, interesting. So this started failing in
For @alexlarsson - do you want ostree to preserve suid files in |
No that sounds pretty bad. We probably want to strip setuid in bare-user-only repos (i.e. lose fidelity for such objects). |
These are both just bad ideas. See also ostreedev/ostree#908
I wrote flatpak/flatpak#837 - let's discuss this there. |
For the flatpak use case where bare-user-only was introduced, we actually don't want to support s{u,g} id files in particular. Actually, I can't think of a reason to have anything outside of the `0755 i.e. (u=rwx,g=rx,o=rx)` mask, so that's what we do here. This will have the effect of treating existing `bare-user-only` repositories as corrupted if they have files outside of that mask, but I think we should do this now; most of the flatpak users will still be on `bare-user`, and we haven't changed the semantics of that mode yet. Note that in this patch we will also *reject* file content that doesn't match this. This is somewhat asymmetric, since we aren't similarly rejecting e.g. directory metadata. But, this will close off the biggest source of the problem for flatpak (setuid binaries). See: ostreedev#908 See: flatpak/flatpak#837
For the flatpak use case where bare-user-only was introduced, we actually don't want to support s{u,g} id files in particular. Actually, I can't think of a reason to have anything outside of the `0755 i.e. (u=rwx,g=rx,o=rx)` mask, so that's what we do here. This will have the effect of treating existing `bare-user-only` repositories as corrupted if they have files outside of that mask, but I think we should do this now; most of the flatpak users will still be on `bare-user`, and we haven't changed the semantics of that mode yet. Note that in this patch we will also *reject* file content that doesn't match this. This is somewhat asymmetric, since we aren't similarly rejecting e.g. directory metadata. But, this will close off the biggest source of the problem for flatpak (setuid binaries). See: #908 See: flatpak/flatpak#837 Closes: #909 Approved by: alexlarsson
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
5fb31fd
to
5f31f90
Compare
Argh, running into |
☀️ Test successful - status-atomicjenkins |
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: #907