2019-03-04 15:33:28 +00:00
|
|
|
diff -up openssh-7.4p1/session.c.update-pw openssh-7.4p1/session.c
|
|
|
|
--- openssh-7.4p1/session.c.update-pw 2019-03-04 14:10:57.287054645 +0100
|
|
|
|
+++ openssh-7.4p1/session.c 2019-03-04 14:12:39.259997218 +0100
|
|
|
|
@@ -1522,9 +1522,18 @@ do_child(Session *s, const char *command
|
2019-04-26 15:42:30 +00:00
|
|
|
extern char **environ;
|
|
|
|
char **env, *argv[ARGV_MAX], remote_id[512];
|
2019-03-04 15:33:28 +00:00
|
|
|
const char *shell, *shell0;
|
|
|
|
- struct passwd *pw = s->pw;
|
|
|
|
+ struct passwd *pw = NULL;
|
|
|
|
int r = 0;
|
|
|
|
|
|
|
|
+ /* Update the users passwd structure after successful login */
|
|
|
|
+ pw = getpwuid(s->pw->pw_uid);
|
|
|
|
+ if (pw != NULL) {
|
|
|
|
+ free(s->pw);
|
|
|
|
+ s->pw = pw;
|
|
|
|
+ } else {
|
|
|
|
+ pw = s->pw;
|
|
|
|
+ }
|
|
|
|
+
|
2019-04-26 15:42:30 +00:00
|
|
|
sshpkt_fmt_connection_id(ssh, remote_id, sizeof(remote_id));
|
|
|
|
|
2019-03-04 15:33:28 +00:00
|
|
|
/* remove hostkey from the child's memory */
|