pyinfra-dev / pyinfra

pyinfra turns Python code into shell commands and runs them on your servers. Execute ad-hoc commands and write declarative operations. Target SSH servers, local machine and Docker containers. Fast and scales from one server to thousands.
https://pyinfra.com
MIT License
3.85k stars 374 forks source link

mode parameter does not support other mode than read/write/exec #830

Closed julienlavergne closed 1 year ago

julienlavergne commented 2 years ago

Describe the bug

According to chmod man page, there is other bits that can be set on files and directories. https://www.man7.org/linux/man-pages/man1/chmod.1.html

Today, when those bits are set, pyinfra convert the mode to the integer 0 because it cannot recognize a valid conversion between the mode as a string and the integer value.

To Reproduce

use mode=1777" or mode="u=rwx,g=rwxs,o=rwx", or anything that makes use of those additional bits.

Expected behavior

Support for all bits in the mode parameter.

Meta

v2.1

Fizzadar commented 1 year ago

I have fixed the parsing of the extra bits in https://github.com/Fizzadar/pyinfra/commit/a6045a98385f6dd0bcbb0e7ffcb106f74f222712, released just now in v2.5.2. Will use the other issue for tracking normalisation of non integer values for mode.