New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

put() with use_sudo=True incorrectly formats file access modes #310

Closed
bitprophet opened this Issue Aug 19, 2011 · 2 comments

Comments

Projects
None yet
1 participant
@bitprophet
Member

bitprophet commented Aug 19, 2011

Description

If you specify both use_sudo=True and an explicit file mode using the mode kwarg, Fabric fails with an incorrectly formatted call to chmod.

put("test.py", "/bin/test.py", use_sudo=True, mode=0755)

The bug is in this relatively recent code:

if use_sudo:
    with hide('everything'):
        sudo('chmod %s \"%s\"' % (lmode, remote_path))
else:
        self.ftp.chmod(remote_path, lmode)

The file mode is being formatted using %s meaning it is printed as a decimal. It should be printed with %o, for octal.


Originally submitted by **** (adamjernst) on 2011-03-10 at 12:09pm EST


Closed as Done on 2011-03-22 at 08:47pm EDT

@ghost ghost assigned bitprophet Aug 19, 2011

@bitprophet

This comment has been minimized.

Show comment
Hide comment
@bitprophet

bitprophet Aug 19, 2011

Member

Jeff Forcier (bitprophet) posted:


Thanks, good catch.


on 2011-03-10 at 01:49pm EST

Member

bitprophet commented Aug 19, 2011

Jeff Forcier (bitprophet) posted:


Thanks, good catch.


on 2011-03-10 at 01:49pm EST

@bitprophet

This comment has been minimized.

Show comment
Hide comment
@bitprophet

bitprophet Aug 19, 2011

Member

Jeff Forcier (bitprophet) posted:


Applied in changeset commit:5afe16faab754b91da1af08ce7e9d61f1fe94a5f.


on 2011-03-22 at 08:47pm EDT

Member

bitprophet commented Aug 19, 2011

Jeff Forcier (bitprophet) posted:


Applied in changeset commit:5afe16faab754b91da1af08ce7e9d61f1fe94a5f.


on 2011-03-22 at 08:47pm EDT

@bitprophet bitprophet closed this Aug 19, 2011

richid pushed a commit to richid/fabric that referenced this issue Aug 1, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment