[openssh/f18] AuthorizedKeysCommandUser: use the user being authenticated by default (#953534)

plautrba plautrba at fedoraproject.org
Fri Apr 19 14:15:25 UTC 2013


commit fb00871f195ba3776d72181ac402cbe420620c74
Author: Petr Lautrbach <plautrba at redhat.com>
Date:   Fri Apr 19 14:12:14 2013 +0200

    AuthorizedKeysCommandUser: use the user being authenticated by default (#953534)

 openssh-6.1p1-akc.patch |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/openssh-6.1p1-akc.patch b/openssh-6.1p1-akc.patch
index f78dec2..7c5973a 100644
--- a/openssh-6.1p1-akc.patch
+++ b/openssh-6.1p1-akc.patch
@@ -119,20 +119,20 @@ diff -up openssh-6.1p1/auth2-pubkey.c.akc openssh-6.1p1/auth2-pubkey.c
 +		return 0;
 +
 +	if (options.authorized_keys_command_user == NULL) {
-+		error("No user for AuthorizedKeysCommand specified, skipping");
-+		return 0;
++		pw = user_pw;
 +	}
-+
-+	username = percent_expand(options.authorized_keys_command_user,
-+	    "u", user_pw->pw_name, (char *)NULL);
-+	pw = getpwnam(username);
-+	if (pw == NULL) {
-+		error("AuthorizedKeyCommandUser \"%s\" not found: %s",
-+		    username, strerror(errno));
++	else {
++		username = percent_expand(options.authorized_keys_command_user,
++		    "u", user_pw->pw_name, (char *)NULL);
++		pw = getpwnam(username);
++		if (pw == NULL) {
++			error("AuthorizedKeyCommandUser \"%s\" not found: %s",
++			    username, strerror(errno));
++			free(username);
++			return 0;
++		}
 +		free(username);
-+		return 0;
 +	}
-+	free(username);
 +
 +	temporarily_use_uid(pw);
 +


More information about the scm-commits mailing list