AuthorizedKeysCommandUser: use the user being authenticated by default (#953534)
This commit is contained in:
parent
1e3cc96dcb
commit
fb00871f19
|
@ -119,10 +119,9 @@ 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;
|
||||
+ }
|
||||
+
|
||||
+ else {
|
||||
+ username = percent_expand(options.authorized_keys_command_user,
|
||||
+ "u", user_pw->pw_name, (char *)NULL);
|
||||
+ pw = getpwnam(username);
|
||||
|
@ -133,6 +132,7 @@ diff -up openssh-6.1p1/auth2-pubkey.c.akc openssh-6.1p1/auth2-pubkey.c
|
|||
+ return 0;
|
||||
+ }
|
||||
+ free(username);
|
||||
+ }
|
||||
+
|
||||
+ temporarily_use_uid(pw);
|
||||
+
|
||||
|
|
Loading…
Reference in New Issue