Skip to content

bin/commit: Add --selinux-policy option - #1114

Closed
cgwalters wants to merge 2 commits into
ostreedev:masterfrom
cgwalters:commit-selinux-label
Closed

cgwalters wants to merge 2 commits into
ostreedev:masterfrom
cgwalters:commit-selinux-label

Conversation

@cgwalters

Copy link
Copy Markdown
Member

This was really straightforward to implement, and is useful
for dev/test scenarios mainly like we have in rpm-ostree at least.

Closes: #1113

This was really straightforward to implement, and is useful
for dev/test scenarios mainly like we have in rpm-ostree at least.

Closes: ostreedev#1113

@jlebon jlebon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice! Just a minor nit.

Comment thread src/ostree/ot-builtin-commit.c Outdated
glnx_fd_close int rootfs_dfd = -1;
if (!glnx_opendirat (AT_FDCWD, opt_selinux_policy, TRUE, &rootfs_dfd, error))
{
glnx_prefix_error (error, "selinux-policy: ");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: trailing : .

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Arg, I meant to type g_prefix_error() since this is still old style code. Thanks for catching it.

@jlebon

jlebon commented Aug 25, 2017

Copy link
Copy Markdown
Member

@rh-atomic-bot r+ 27add7d

@rh-atomic-bot

Copy link
Copy Markdown

⌛ Testing commit 27add7d with merge 91dbe15...

rh-atomic-bot pushed a commit that referenced this pull request Aug 25, 2017
This was really straightforward to implement, and is useful
for dev/test scenarios mainly like we have in rpm-ostree at least.

Closes: #1113

Closes: #1114
Approved by: jlebon
@rh-atomic-bot

Copy link
Copy Markdown

💔 Test failed - status-atomicjenkins

@cgwalters

Copy link
Copy Markdown
Member Author

FAIL: libostree/test-remote-gpg-import.sh.test (Child process exited with code 1)

Interesting, must be a flake, but haven't seen it before.

@rh-atomic-bot retry

@rh-atomic-bot

Copy link
Copy Markdown

⌛ Testing commit 27add7d with merge 5e30bbd...

@rh-atomic-bot

Copy link
Copy Markdown

☀️ Test successful - status-atomicjenkins
Approved by: jlebon
Pushing 5e30bbd to master...

jlebon added a commit to jlebon/ostree that referenced this pull request Aug 30, 2017
The new --selinux-policy added in [0] exposed a subtle issue in the way
we handle labeling during commit. The CI system in rpm-ostree hit this
when trying to make use of it[1].

Basically, because of the way we use a GVariant to represent xattrs, if
a file to be committed already has an SELinux label, the xattr object
ends up with *two* label entries. This of course throws off fsck later
on, since the checksum will have gone over both entries, even though the
on-disk file will only have a single label (in which the second entry
wins).

I confirmed that the `fsck` added in the installed test fails without
the rest of this patch.

[0] ostreedev#1114
[1] coreos/rpm-ostree#953
rh-atomic-bot pushed a commit that referenced this pull request Aug 31, 2017
The new --selinux-policy added in [0] exposed a subtle issue in the way
we handle labeling during commit. The CI system in rpm-ostree hit this
when trying to make use of it[1].

Basically, because of the way we use a GVariant to represent xattrs, if
a file to be committed already has an SELinux label, the xattr object
ends up with *two* label entries. This of course throws off fsck later
on, since the checksum will have gone over both entries, even though the
on-disk file will only have a single label (in which the second entry
wins).

I confirmed that the `fsck` added in the installed test fails without
the rest of this patch.

[0] #1114
[1] coreos/rpm-ostree#953

Closes: #1121
Approved by: cgwalters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants