-
Notifications
You must be signed in to change notification settings - Fork 305
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
DAOS-15288 client: Verify user/group for daos_cont_set_owner #14290
Conversation
- Ensure the requested user/group exists before setting it. - Add a second API, daos_cont_set_owner_no_check(), for the case where the new owner/group can't be verified locally. - Modify daos_test to verify both check and no_check cases. - Add --no-check flag to daos cont set-owner. Required-githooks: true Features: container security Signed-off-by: Kris Jacque <[email protected]>
Ticket title is 'DAOS contianer set-owner behaves differently between posix and non-posix containers' |
Test stage Functional on EL 8.8 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14290/1/execution/node/1198/log |
Features: container security Required-githooks: true Signed-off-by: Kris Jacque <[email protected]>
Test stage Functional on EL 8.8 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14290/2/execution/node/1173/log |
Feature: container security
Test stage Functional on EL 8.8 completed with status UNSTABLE. https://build.hpdd.intel.com/job/daos-stack/job/daos//view/change-requests/job/PR-14290/3/testReport/ |
Also fix existing test to ensure user names are created on all client nodes. Required-githooks: true Signed-off-by: Kris Jacque <[email protected]>
Features: container security
Test stage Functional Hardware Medium Verbs Provider completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14290/4/execution/node/1454/log |
Test failure is an existing issue on master: https://daosio.atlassian.net/issues/DAOS-15124 |
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.
ftest LGTM
Features: container security Required-githooks: true Signed-off-by: Kris Jacque <[email protected]>
Required-githooks: true Signed-off-by: Kris Jacque <[email protected]>
Features: container security
Features: container security Required-githooks: true Signed-off-by: Kris Jacque <[email protected]>
Test stage NLT on EL 8.8 completed with status FAILURE. https://build.hpdd.intel.com/job/daos-stack/job/daos/job/PR-14290/6/display/redirect |
Test stage Functional on EL 8.8 completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14290/7/execution/node/1184/log |
Features: container security Required-githooks: true Signed-off-by: Kris Jacque <[email protected]>
Features: container security Allow-unstable-test: true
Features: container security
Test stage Python Bandit check completed with status FAILURE. https://build.hpdd.intel.com//job/daos-stack/job/daos/view/change-requests/job/PR-14290/14/execution/node/145/log |
* | ||
* \return 0 on success, errno code on failure. | ||
*/ | ||
int | ||
dfs_cont_set_owner(daos_handle_t coh, d_string_t user, d_string_t group); | ||
dfs_cont_set_owner(daos_handle_t coh, d_string_t user, uid_t uid, d_string_t group, gid_t gid); |
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.
just a side comment for other reviewers, since this was added in master (not in 2.4.2) this is fine, no API breakage.
src/client/dfs/cont.c
Outdated
static bool | ||
is_uid_invalid(uid_t uid) | ||
{ | ||
return uid == (uid_t)-1; | ||
} | ||
|
||
static bool | ||
is_gid_invalid(gid_t gid) | ||
{ | ||
return gid == (gid_t)-1; | ||
} | ||
|
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.
just curious why have a function call and not do the == in the if condition below directly?
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.
I thought it communicated more clearly what -1 indicated. Figured the compiler will end up inlining this anyway during optimization.
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.
I just made a change to explicitly inline it.
Features: container security Required-githooks: true Signed-off-by: Kris Jacque <[email protected]>
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.
Go changes LGTM.
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.
ftest LGTM. Just nits. thanks for the updates!
:avocado: tags=DaosContainerOwnerTest | ||
:avocado: tags=test_container_set_owner_no_check_non_posix |
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.
nit - it's preferred to put these on one line
:avocado: tags=DaosContainerOwnerTest | |
:avocado: tags=test_container_set_owner_no_check_non_posix | |
:avocado: tags=DaosContainerOwnerTest,test_container_set_owner_no_check_non_posix |
:avocado: tags=DaosContainerOwnerTest | ||
:avocado: tags=test_container_set_owner_no_check_posix |
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.
nit
:avocado: tags=DaosContainerOwnerTest | |
:avocado: tags=test_container_set_owner_no_check_posix | |
:avocado: tags=DaosContainerOwnerTest,test_container_set_owner_no_check_posix |
Required-githooks: true
Features: container security
Before requesting gatekeeper:
Features:
(orTest-tag*
) commit pragma was used or there is a reason documented that there are no appropriate tags for this PR.Gatekeeper: