Skip to content

Commit

Permalink
use umask instead of chmod
Browse files Browse the repository at this point in the history
  • Loading branch information
stephdl committed Sep 29, 2023
1 parent 5cfc979 commit 7b86302
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 2 additions & 4 deletions imageroot/actions/create-task/20configure
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@ DELETE={delete}
DELETEFOLDER={delete_folder}
EXCLUDE={exclude}
"""
os.umask(0o77)

f = open("./imapsync/"+local_user+".env", "w", encoding="utf-8")
f.write(user_env)
f.close()

os.chmod("./imapsync/"+local_user+".env", 0o600)

f = open("./imapsync/"+local_user+".pwd", "w", encoding="utf-8")
f.write(remote_password)
f.close()

os.chmod("./imapsync/"+local_user+".pwd", 0o600)
3 changes: 1 addition & 2 deletions imageroot/bin/reveal-master-secret
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ response = agent.tasks.run(f"module/{mail_id}", action='reveal-master-credential
agent.assert_exp(response['exit_code'] == 0)
vmail_password = response['output']['password']

os.umask(0o77)
f = open("./imapsync/vmail.pwd", "w", encoding="utf-8")
f.write(vmail_password)
f.close()

os.chmod("./imapsync/vmail.pwd", 0o600)

0 comments on commit 7b86302

Please sign in to comment.