-
Notifications
You must be signed in to change notification settings - Fork 348
libarchive: Always ensure we have a label #2452
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -599,6 +599,25 @@ ostree_sepolicy_get_label (OstreeSePolicy *self, | |
| return TRUE; | ||
| } | ||
|
|
||
| // If policy doesn't specify a label, try a fallback. | ||
| gboolean | ||
| _ostree_sepolicy_require_label (OstreeSePolicy *policy, const char *relpath, | ||
| guint32 unix_mode, char **out_label, | ||
| GCancellable *cancellable, GError **error) | ||
| { | ||
| char *label = NULL; | ||
| if (!ostree_sepolicy_get_label (policy, relpath, unix_mode, &label, cancellable, error)) | ||
| return FALSE; | ||
| if (!label) | ||
| { | ||
| if (!ostree_sepolicy_get_label (policy, "/usr/share/some-generic-thing", unix_mode, &label, cancellable, error)) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think a more appropriate thing to do here would be to keep going up from
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure. In the case of this
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it should be safe to trust the policy. E.g.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we call this |
||
| return FALSE; | ||
| } | ||
| *out_label = label; | ||
| return TRUE; | ||
| } | ||
|
|
||
|
|
||
| /** | ||
| * ostree_sepolicy_restorecon: | ||
| * @self: Self | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should become an
assertnow, I guess?