From 20b67c6e5983a3d9cd5acfc9c6d407778179af93 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 25 Oct 2011 22:38:18 +0200 Subject: [PATCH] bug #847: Login files are created with 0600 permissions --- src/authm_mad/remotes/ssh/ssh_auth.rb | 2 ++ src/authm_mad/remotes/x509/x509_auth.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/authm_mad/remotes/ssh/ssh_auth.rb b/src/authm_mad/remotes/ssh/ssh_auth.rb index 2885f39da0..a1b72eef16 100644 --- a/src/authm_mad/remotes/ssh/ssh_auth.rb +++ b/src/authm_mad/remotes/ssh/ssh_auth.rb @@ -86,6 +86,8 @@ class SshAuth file.write(proxy) file.close + File.chmod(0600,LOGIN_PATH) + secret_crypted end diff --git a/src/authm_mad/remotes/x509/x509_auth.rb b/src/authm_mad/remotes/x509/x509_auth.rb index 325027f25d..09a7e42925 100644 --- a/src/authm_mad/remotes/x509/x509_auth.rb +++ b/src/authm_mad/remotes/x509/x509_auth.rb @@ -157,6 +157,8 @@ private file = File.open(LOGIN_PATH, "w") file.write(login_txt) file.close + + File.chmod(0600,LOGIN_PATH) end # Load class options form a configuration file (yaml syntax)