#21 Set permissions in octal mode for sshpass to read the file
Merged 4 years ago by mrniranjan. Opened 4 years ago by mrniranjan.
mrniranjan/python-pytest-multihost sshpass_perm_fix  into  master

@@ -380,7 +380,7 @@ 

          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', password_file] + argv

Signed-off-by: Niranjan M.R mrniranjan@redhat.com
Setting permissions to 600 sets the file permissions to "---x-wx--T."
causing the sshpass to not have permission to read the password file.

This patch sets the read write permissions in octal mode.

Metadata Update from @mrniranjan:
- Request assigned

4 years ago

Metadata Update from @mrniranjan:
- Request assigned

4 years ago

Pull-Request has been merged by mrniranjan

4 years ago
Metadata