Open julienlavergne opened 2 years ago
This should definitely work as expected; this part of the codebase hasn't been touched in a very long time; here's the attempted normalisation:
The files.*
facts all output octal values so would be good to have the above function also convert other variants such as your example.
This should definitely work as expected; this part of the codebase hasn't been touched in a very long time; here's the attempted normalisation:
Do you mean that the existing code should be enough to have my example working ?
Do you mean that the existing code should be enough to have my example working ?
If/once #830 is resolved it should work, but that is required first to normalise the different mode style.
Updating this issue to reflect the need to parse non integer mode values for comparison with fact data to fix this. Currently mode must be an octal value for changes to be calculated correctly; otherwise chmod will always be executed.
Will first show a warning for this and document it. Actually doing the normalise is quite complex because it requires knowing the default values from umask.
Describe the bug
When using
files.directory
withmode="u=rwx,g=rwx,o=rwx"
, the operation will always perform a chmod on the existing directory, even though the permissions are correct. This is due to the fact that we compare the current permissions777
to the requested modeu=rwx,g=rwx,o=rwx
, which are different strings.To Reproduce
Expected behavior
We should be able to see that
777
andu=rwx,g=rwx,o=rwx
are the same.Meta
v2.1