Skip to content
This repository was archived by the owner on Dec 26, 2020. It is now read-only.

fix sftp_umask; store as literal not octal #317

Merged
merged 1 commit into from
Jul 28, 2020
Merged

Conversation

aqw
Copy link
Contributor

@aqw aqw commented Jul 28, 2020

Numbers with leading zeros need to be quoted in Ansible, otherwise they are interpreted as octal. Which the templating happily writes out in... decimal.

In this case, sftp_umask 0027 was ending up as 23 in sshd.conf.

On a Debian Buster system, fixing this did not result in a change in the default umask applied, so I assume that internal-sftp ignored '23' and fell back to 0027 as its default (as is the case on Debian). Other distros/systems with alternate defaults will likely experience a change in behavior.

Numbers with leading zeros need to be quoted in Ansible, otherwise they
are interpreted as octal. Which the templating happily writes out in...
decimal.

In this case, sftp_umask 0027 was ending up as 23 in sshd.conf.

Signed-off-by: Alex Waite <alex@waite.eu>
@schurzi schurzi merged commit 9b14f64 into dev-sec:master Jul 28, 2020
@schurzi
Copy link
Contributor

schurzi commented Jul 28, 2020

thanks for spotting this 👍

@rndmh3ro rndmh3ro added patch and removed minor labels Jul 28, 2020
@aqw
Copy link
Contributor Author

aqw commented Jul 28, 2020

Thanks for the merge!

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants