vishalmishra434 / rpms / openssh

Forked from rpms/openssh a month ago
Clone
Jakub Jelen 8cf031
diff --git a/pam_ssh_agent_auth-0.10.2/pam_user_authorized_keys.c b/pam_ssh_agent_auth-0.10.2/pam_user_authorized_keys.c
Jakub Jelen 8cf031
--- a/pam_ssh_agent_auth-0.10.2/pam_user_authorized_keys.c
Jakub Jelen 8cf031
+++ b/pam_ssh_agent_auth-0.10.2/pam_user_authorized_keys.c
Jakub Jelen 8cf031
@@ -158,11 +158,12 @@ parse_authorized_key_file(const char *user,
Jakub Jelen ea9421
 int
Jakub Jelen ea9421
 pam_user_key_allowed(const char *ruser, Key * key)
Jakub Jelen ea9421
 {
Jakub Jelen 8cf031
+    struct passwd *pw;
Jakub Jelen 8cf031
     return
Jakub Jelen ea9421
-        pamsshagentauth_user_key_allowed2(getpwuid(authorized_keys_file_allowed_owner_uid),
Jakub Jelen ea9421
-                                          key, authorized_keys_file)
Jakub Jelen ea9421
-        || pamsshagentauth_user_key_allowed2(getpwuid(0), key,
Jakub Jelen ea9421
-                                             authorized_keys_file)
Jakub Jelen 8cf031
+        ( (pw = getpwuid(authorized_keys_file_allowed_owner_uid)) &&
Jakub Jelen 8cf031
+            pamsshagentauth_user_key_allowed2(pw, key, authorized_keys_file))
Jakub Jelen 8cf031
+        || ((pw = getpwuid(0)) &&
Jakub Jelen 8cf031
+            pamsshagentauth_user_key_allowed2(pw, key, authorized_keys_file))
Jakub Jelen ea9421
         || pamsshagentauth_user_key_command_allowed2(authorized_keys_command,
Jakub Jelen ea9421
                                                      authorized_keys_command_user,
Jakub Jelen ea9421
                                                      getpwnam(ruser), key);