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

Swap chmod/chown to fix wildcard expansion error #61

Merged
merged 1 commit into from
Jul 18, 2022

Conversation

danielahlin
Copy link
Contributor

If

"sudo chmod +x /var/daos/cert_gen/*.sh"

is executed after

"sudo chown -R root:root /var/daos/cert_gen"

then there is no guarantee that the /var/daos/cert_gen/.sh part is properly expanded. This is because expansion is performed by the shell invoking sudo and not by the command which is run under sudo. If the invoking shell does not have x permission on /var/daos/cert_gen then chmod will be passed the literal string "/var/daos/cert_gen/.sh" which it will assume to be a valid path, which it is not.

Signed-off-by: Daniel Ahlin [email protected]

 If

"sudo chmod +x /var/daos/cert_gen/*.sh"

is executed after

"sudo chown -R root:root /var/daos/cert_gen"

then there is no guarantee that the /var/daos/cert_gen/*.sh part is properly expanded. This is because expansion is performed by the shell invoking sudo and not by the command which is run under sudo. If the invoking shell does not have x permission on /var/daos/cert_gen then chmod will be passed the literal string "/var/daos/cert_gen/*.sh" which it will assume to be a valid path, which it is not.



Signed-off-by: Daniel Ahlin <[email protected]>
@markaolson markaolson merged commit dd57b8c into daos-stack:develop Jul 18, 2022
@markaolson
Copy link
Contributor

Thank you Daniel!

markaolson pushed a commit that referenced this pull request Jul 18, 2022
If

"sudo chmod +x /var/daos/cert_gen/*.sh"

is executed after

"sudo chown -R root:root /var/daos/cert_gen"

then there is no guarantee that the /var/daos/cert_gen/*.sh part is properly expanded. This is because expansion is performed by the shell invoking sudo and not by the command which is run under sudo. If the invoking shell does not have x permission on /var/daos/cert_gen then chmod will be passed the literal string "/var/daos/cert_gen/*.sh" which it will assume to be a valid path, which it is not.

Signed-off-by: Daniel Ahlin <[email protected]>
mark-olson pushed a commit that referenced this pull request Dec 8, 2022
If

"sudo chmod +x /var/daos/cert_gen/*.sh"

is executed after

"sudo chown -R root:root /var/daos/cert_gen"

then there is no guarantee that the /var/daos/cert_gen/*.sh part is properly expanded. This is because expansion is performed by the shell invoking sudo and not by the command which is run under sudo. If the invoking shell does not have x permission on /var/daos/cert_gen then chmod will be passed the literal string "/var/daos/cert_gen/*.sh" which it will assume to be a valid path, which it is not.

Signed-off-by: Daniel Ahlin <[email protected]>
Signed-off-by: Mark A. Olson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants