ostree/tests/installed
Colin Walters ed15723cd1 lib/commit: Fix hardlink checkout commit with bare-user + mod xattrs
This is more subtle fallout from:
https://github.com/ostreedev/ostree/pull/1170
AKA commit: 8fe4536257

Before, if we found a devino cache hit, we'd use it unconditionally.

Recall that `bare-user` repositories are very special in that they're the only
mode where the on disk state ("physical state") is not the "real" state. The
latter is stored in the `user.ostreemeta` xattr. (`bare-user` repos are also
highly special in that symlinks are regular files physically, but that's not
immediately relevant here).

Since we now have `bare-user-only` for the "pure unprivileged container" case,
`bare-user` should just be used for "OS builds" which have nonzero uids (and
possibly SELinux labels etc.)

In an experimental tool I'm writing "skopeo2ostree" which imports OCI images
into refs, then squashes them together into a single final commit, we lost the
the `81` group ID for `/usr/libexec/dbus-1/dbus-daemon-launch-helper`.

This happened because the commit code was loading the "physical" disk state,
where the uid/gid are zero because that's the uid I happened to be using. We
didn't just directly do the link speedup because I was using `--selinux-policy`
which caused the xattrs to change, which caused us to re-commit objects from the
physical state.

The unit test I added actually doesn't quite trigger this, but I left
it because "why not".  Really testing this requires the installed test
which uses SELinux policy from `/`.

The behavior without this fix looks like:

```
-00755 0 0     12 { [(b'user.ostreemeta', [byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x81, 0xed]), (b'security.selinux', b'system_u:object_r:lib_t:s0')] } /usr/lib/dbus-daemon-helper
```

which was obviously totally broken - we shouldn't be picking up the
`user.ostreemeta` xattr and actually committing it of course.

Closes: #1297
Approved by: jlebon
2017-10-23 17:02:28 +00:00
..
README.md tests/installed: New installed, privileged tests using Fedora AH 2017-04-25 15:15:06 +00:00
fah-prep.sh tests,ci: Move "test-basic" (bare mode) to installed test 2017-09-27 13:13:14 +00:00
itest-bare-root.sh tests: For installed, s/test-/itest-/ to avoid in-tree name clashes 2017-05-09 15:08:26 +00:00
itest-bare-unit.sh tests/installed: also run test-basic-c 2017-09-30 00:05:07 +00:00
itest-bare-user-root.sh lib/commit: Fix hardlink checkout commit with bare-user + mod xattrs 2017-10-23 17:02:28 +00:00
itest-bareuser-nouserxattrs.sh lib/repo: Immediately error creating bare-user repo on tmpfs 2017-07-06 14:31:37 +00:00
itest-deploy-selinux.sh checkout: Don't set dir mtime to 0 when doing a force copy checkout 2017-07-07 15:01:51 +00:00
itest-label-selinux.sh commit: filter out selinux label before commit 2017-08-31 12:07:46 +00:00
itest-pull-space.sh lib/repo: Add min-free-space-percent option, default 3% 2017-07-04 16:15:11 +00:00
itest-pull.sh lib/commit: Add a copy fastpath for imports 2017-09-26 16:50:41 +00:00
itest-remotes.sh Add a notion of "physical" sysroot, use for remote writing 2017-07-18 18:58:06 +00:00
libinsttest.sh tests: Migrate test-pull-many.sh to installed on FAH 2017-05-09 15:08:26 +00:00
libtest-core.sh tests/installed: New installed, privileged tests using Fedora AH 2017-04-25 15:15:06 +00:00
run.sh tests: For installed, s/test-/itest-/ to avoid in-tree name clashes 2017-05-09 15:08:26 +00:00

README.md

This suite of tests is currently run from redhat-ci; they're intended to run as root.