community.general/lib/ansible/plugins
Toshio Kuratomi fcd6d7010d Fixup perms dont rely on privileged user named root (#15482)
* Don't rely on username to check for root privileges

The SSH username isn't a reliable way to check if we've got root privileges on
the remote system (think "toor" on FreeBSD). Because of this check, Ansible
previously tried to use the fallback solutions for granting file access (ACLs,
world-readable files) even on systems where it had root privileges when the
remote username didn't match the literal string "root".

Instead of running checks on the username, just try using `chmod` in any case
and fall back to the previous "non-root" solution when that fails.

* Fail if we are root and changing ownership failed

Since this code is security sensitive we document exactly the expected
permissions of the temporary files once this function has run.  That way
if a flaw is found in one end-result we know more precisely what scenarios
are affected and which are not.
2016-04-22 08:40:34 -07:00
..
action Fixup perms dont rely on privileged user named root (#15482) 2016-04-22 08:40:34 -07:00
cache Expand tilde after expanding vars 2016-04-05 22:27:07 -07:00
callback On change in diff-mode we don't need to see file content in task output 2016-04-01 18:03:51 +02:00
connection Merge pull request #14400 from d3matt/FIX/paramiko_lecture 2016-04-19 13:31:17 -04:00
filter adds two new regex filters for use in playbooks (#14696) 2016-04-14 14:54:03 -04:00
inventory Bundle a new version of python-six for compatibility along with some code to make it easy for distributions to override the bunndled copy if they have a new enough version. 2015-10-16 08:21:28 -07:00
lookup Use to_bytes and to_str instead of str as str is unsafe. 2016-04-04 12:57:32 -07:00
shell Use /var/tmp is user set remote_tmp below /var/tmp. 2016-04-11 21:03:13 -07:00
strategy Merge pull request #15455 from chemikadze/devel 2016-04-19 02:50:27 -04:00
test Reverse boilerplate order because from __future__ must be the first code in the file 2016-03-24 20:08:39 -07:00
vars Making the switch to v2 2015-05-03 21:47:26 -05:00
__init__.py Remove workaround for fixed bug. (#15340) 2016-04-10 09:24:54 -07:00