mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-29 16:54:51 +02:00
Address Group Matching Issue (#380)
- Addressed group mapping issue caused by the username being used after being freed. PowerShell/Win32-OpenSSH#1354
This commit is contained in:
parent
2abb7748a9
commit
afe4880c37
7
auth.c
7
auth.c
@ -595,9 +595,12 @@ getpwnamallow(const char *user)
|
|||||||
struct passwd *pw;
|
struct passwd *pw;
|
||||||
struct connection_info *ci = get_connection_info(1, options.use_dns);
|
struct connection_info *ci = get_connection_info(1, options.use_dns);
|
||||||
#ifdef WINDOWS
|
#ifdef WINDOWS
|
||||||
/* getpwname - normalizes the incoming user and makes it lowercase */
|
/* getpwname - normalizes the incoming user and makes it lowercase
|
||||||
|
/* it must be duped as the server matching routines may use getpwnam() and
|
||||||
|
* and free the name being assigned to the connection info structure
|
||||||
|
*/
|
||||||
pw = getpwnam(user);
|
pw = getpwnam(user);
|
||||||
ci->user = pw? pw->pw_name: user;
|
ci->user = pw? xstrdup(pw->pw_name): user;
|
||||||
#else
|
#else
|
||||||
ci->user = user;
|
ci->user = user;
|
||||||
#endif // WINDOWS
|
#endif // WINDOWS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user