forked from ungleich-public/cdist
Merge branch 'hotfix/stat-explorer' into 'master'
Hotfix: Fix incorrect interpretation of --mode strings with leading 0s as octal See merge request ungleich-public/cdist!911
This commit is contained in:
commit
5d0f6caef7
2 changed files with 6 additions and 2 deletions
|
@ -99,7 +99,9 @@ case "$state_should" in
|
|||
|
||||
# format mode in four digits => same as stat returns
|
||||
if [ "$attribute" = mode ]; then
|
||||
value_should=$(printf '%04u' "${value_should}")
|
||||
# Convert to four-digit octal number (printf interprets
|
||||
# strings with leading 0s as octal!)
|
||||
value_should=$(printf '%04o' "0${value_should}")
|
||||
fi
|
||||
|
||||
if [ "$set_attributes" = 1 ] || [ "$value_should" != "$value_is" ]; then
|
||||
|
|
|
@ -70,7 +70,9 @@ case "$state_should" in
|
|||
|
||||
# format mode in four digits => same as stat returns
|
||||
if [ "$attribute" = mode ]; then
|
||||
value_should=$(printf '%04u' "${value_should}")
|
||||
# Convert to four-digit octal number (printf interprets
|
||||
# strings with leading 0s as octal!)
|
||||
value_should=$(printf '%04o' "0${value_should}")
|
||||
fi
|
||||
|
||||
value_is="$(get_current_value "$attribute" "$value_should")"
|
||||
|
|
Loading…
Reference in a new issue