From 07341990d962643e421ec1e7f6dd027cf428e0dc Mon Sep 17 00:00:00 2001 From: Sergey Orlov Date: Wed, 5 Aug 2020 16:37:05 +0200 Subject: [PATCH] Fix password file permission Invalid permission makes file unreadable by owner if he is not root. Reviewed-By: Alexander Bokovoy --- ipatests/pytest_ipa/integration/transport.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ipatests/pytest_ipa/integration/transport.py b/ipatests/pytest_ipa/integration/transport.py index 0b9f7eec4..d55e72ddb 100644 --- a/ipatests/pytest_ipa/integration/transport.py +++ b/ipatests/pytest_ipa/integration/transport.py @@ -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