fab-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fab-user] fabric cannot get root readonly directory with sudo


From: cruxpot
Subject: [Fab-user] fabric cannot get root readonly directory with sudo
Date: Tue, 9 Feb 2016 14:34:33 -0600

This is with fabric 1.10.2-1 on a debian linux platform. When I do a get operation a sudo user with root privs, I can get a single file that is root read-only such as /etc/shadow. I can also get world-readable directories that are world readable. However, if I try to retrieve an entire directory that is root read-only, I get a null result returned from get.

Here is the line of code that causes the issue. I have tried this with both temp_dir set to a /tmp/subdir and not setting temp_dir at all.

getresult = get(remote_path=self.getfile, local_path=os.path.join(self.output_path, subdir), use_sudo=True, temp_dir=self.dirname)

values:
localpath: './folder' , remotepath: '/root', temp_dir: '/tmp/DkoK8aMM'

returned getresult value: '[]'

If I retrieve folder /root/* with the glob instead, I get this error:
Fatal error: get() encountered an exception while downloading '/root/*'

Underlying exception:
Permission denied

This only happens on root read-only directories and I am positive my sudo is set up correctly as I can run remote commands such as 'id' and I see it is as root. user is in the wheel group. and like I said I can get root read-only single files without an issue; only directories are problematic. 


Is this a bug? I suppose I could do a workaround by copying files manually to a tmp directory and then doing a chown and getting them but I thought the temp_dir option was supposed to do this for me.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]