Fix password file permission

Invalid permission makes file unreadable by owner if he is not root.

Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
Sergey Orlov authored and Rob Crittenden committed 2020-08-05 18:33:22 -04:00
1 parent 61db3527e3
commit 07341990d9
1 file changed
+1 -1
+1 -1
View File
@@ -34,7 +34,7 @@ class IPAOpenSSHTransport(OpenSSHTransport):
elif self.host.ssh_password:
password_file = os.path.join(self.control_dir.path, "password")
with open(password_file, "w") as f:
os.fchmod(f.fileno(), 600)
os.fchmod(f.fileno(), 0o600)
f.write(self.host.ssh_password)
f.write("\n")
argv = ["sshpass", f"-f{password_file}"] + argv