Skip to content
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

bug in nhc_job_find_users() leading to misjudgment of illegal process #119

Open
taleintervenor opened this issue Nov 18, 2022 · 0 comments
Assignees
Labels
Milestone

Comments

@taleintervenor
Copy link

nhc/scripts/lbnl_job.nhc: function nhc_job_find_users()

if [[ "${JOBUSERS[*]//$JOBUSER}" = "${JOBUSERS[*]}" ]]; then
     JOBUSERS[${#JOBUSERS[*]}]="$JOBUSER"
fi

I can not understand why using variable substitution to check element exist in array. The trick seem to be quite meaningless and will cause misjudgement when one element is substring of another. For example:
2 user bob and bob_01 both have running jobs on a node, and nhc execute check_ps_unauth_users . When bob is checked after bob_01 , this code will think bob already exist in array and thus not count it as authorized user.

@mej mej self-assigned this Dec 23, 2022
@mej mej added the bug label Dec 23, 2022
@mej mej added this to the 1.4.4 Release milestone Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants