Skip to content

Commit

Permalink
Swap chmod/chown to fix wildcard expansion error (#61)
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
danielahlin authored Jul 18, 2022
1 parent 6e6eb6d commit dd57b8c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions images/daos-server-image.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ build {
inline = [
"sudo mkdir -p /var/daos/",
"sudo mv /tmp/cert_gen /var/daos/",
"sudo chown -R root:root /var/daos/cert_gen",
"sudo chmod +x /var/daos/cert_gen/*.sh"
"sudo chmod +x /var/daos/cert_gen/*.sh",
"sudo chown -R root:root /var/daos/cert_gen"
]
}
}

0 comments on commit dd57b8c

Please sign in to comment.