-
Notifications
You must be signed in to change notification settings - Fork 851
Add CAP_CHOWN to permitted capability set #12908
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
base: master
Are you sure you want to change the base?
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 | ||||
|---|---|---|---|---|---|---|
|
|
@@ -273,7 +273,7 @@ RestrictCapabilities() | |||||
| cap_t caps_orig = cap_get_proc(); | ||||||
|
|
||||||
| // Capabilities we need. | ||||||
| cap_value_t perm_list[] = {CAP_NET_ADMIN, CAP_NET_BIND_SERVICE, CAP_IPC_LOCK, CAP_DAC_OVERRIDE, CAP_FOWNER}; | ||||||
| cap_value_t perm_list[] = {CAP_NET_ADMIN, CAP_NET_BIND_SERVICE, CAP_IPC_LOCK, CAP_DAC_OVERRIDE, CAP_FOWNER, CAP_CHOWN}; | ||||||
bryancall marked this conversation as resolved.
Show resolved
Hide resolved
bryancall marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
| static int const PERM_CAP_COUNT = sizeof(perm_list) / sizeof(*perm_list); | ||||||
| cap_value_t eff_list[] = {CAP_NET_ADMIN, CAP_NET_BIND_SERVICE, CAP_IPC_LOCK}; | ||||||
| static int const EFF_CAP_COUNT = sizeof(eff_list) / sizeof(*eff_list); | ||||||
|
|
@@ -436,7 +436,7 @@ void | |||||
| ElevateAccess::acquirePrivilege(unsigned priv_mask) | ||||||
| { | ||||||
| unsigned cap_count = 0; | ||||||
| cap_value_t cap_list[3]; | ||||||
| cap_value_t cap_list[4]; | ||||||
| cap_t new_cap_state; | ||||||
|
|
||||||
| Dbg(dbg_ctl_privileges, "[acquirePrivilege] level= %x", level); | ||||||
|
|
@@ -463,6 +463,11 @@ ElevateAccess::acquirePrivilege(unsigned priv_mask) | |||||
| ++cap_count; | ||||||
| } | ||||||
|
|
||||||
| if (priv_mask & ElevateAccess::CHOWN_PRIVILEGE) { | ||||||
| cap_list[cap_count] = CAP_CHOWN; | ||||||
| ++cap_count; | ||||||
| } | ||||||
|
|
||||||
| ink_release_assert(cap_count <= sizeof(cap_list)); | ||||||
|
||||||
| ink_release_assert(cap_count <= sizeof(cap_list)); | |
| ink_release_assert(cap_count <= sizeof(cap_list) / sizeof(cap_list[0])); |
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.
The
CHOWN_PRIVILEGEentry is not aligned to the same column as the other enum values. All previous entries use column-aligned spacing before=to keep the values visually aligned (e.g.,FILE_PRIVILEGE = 0x1u,OWNER_PRIVILEGE = 0x8u), butCHOWN_PRIVILEGE = 0x10uhas only a single space before=, breaking the alignment pattern.