diff options
author | Scott Moser <smoser@ubuntu.com> | 2011-10-30 17:17:03 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2011-10-30 17:17:03 -0400 |
commit | 25824d2007e062f32a7bf3c502eaf9b8f2bf4c15 (patch) | |
tree | 9a70da85e6faf0265386dac0ce7ea08d01ece44c /cloudinit/SshUtil.py | |
parent | 6d9f6dfcf7e28f398b426c18ca36adeec24f8061 (diff) | |
download | vyos-cloud-init-25824d2007e062f32a7bf3c502eaf9b8f2bf4c15.tar.gz vyos-cloud-init-25824d2007e062f32a7bf3c502eaf9b8f2bf4c15.zip |
Restore created files' selinux contexts
This adds a restorecon_if_possible method which uses selinux
python module, and uses that for files modified in /etc.
taken from
git://pkgs.fedoraproject.org/cloud-init.git
commit 87f33190f43d2b26cced4597e7298835024466c2
Author: Garrett Holmstrom <gholms@fedoraproject.org>
Patch3: cloud-init-0.6.2-filecontext.patch
Diffstat (limited to 'cloudinit/SshUtil.py')
-rw-r--r-- | cloudinit/SshUtil.py | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/cloudinit/SshUtil.py b/cloudinit/SshUtil.py index bc699a61..fdd3bb27 100644 --- a/cloudinit/SshUtil.py +++ b/cloudinit/SshUtil.py @@ -147,6 +147,7 @@ def setup_user_keys(keys, user, key_prefix, log=None): util.write_file(authorized_keys, content, 0600) os.chown(authorized_keys, pwent.pw_uid, pwent.pw_gid) + util.restorecon_if_possible(ssh_dir, recursive=True) os.umask(saved_umask) |