Skip to content

Commit

Permalink
Merge pull request #208 from kmehant/disable-chg-usr
Browse files Browse the repository at this point in the history
Disable setting users when not root
  • Loading branch information
TomasTomecek authored Nov 26, 2019
2 parents 8f7dd79 + e71dde1 commit 7ed0cc2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ansible_bender/builders/buildah_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ def configure_buildah_container(container_name, working_dir=None, env_vars=None,
for k, v in annotations.items():
config_args += ["--annotation", "%s=%s" % (k, v)]
if user:
if os.getuid() != 0:
logger.warning(
"CHANGING USER IN ROOTLESS MODE IS DISCOURAGED, "
"USE IT ONLY WHEN YOU KNOW WHAT YOU'RE DOING, "
"YOU'VE BEEN WARNED"
)
config_args += ["--user", user]
if cmd:
config_args += ["--cmd", cmd]
Expand Down

0 comments on commit 7ed0cc2

Please sign in to comment.