comparison svr-session.c @ 464:4317be8b7cf9

Make a copy of passwd fields since getpwnam()'s retval isn't safe to keep
author Matt Johnston <matt@ucc.asn.au>
date Sun, 13 Jan 2008 03:55:59 +0000
parents 7e43f5e473b9
children 52a644e7b8e1 e3db1f7a2e43
comparison
equal deleted inserted replaced
461:db4f6adcb7e2 464:4317be8b7cf9
128 "premature exit: %s", format); 128 "premature exit: %s", format);
129 } else if (ses.authstate.authdone) { 129 } else if (ses.authstate.authdone) {
130 /* user has authenticated */ 130 /* user has authenticated */
131 snprintf(fmtbuf, sizeof(fmtbuf), 131 snprintf(fmtbuf, sizeof(fmtbuf),
132 "exit after auth (%s): %s", 132 "exit after auth (%s): %s",
133 ses.authstate.printableuser, format); 133 ses.authstate.pw_name, format);
134 } else if (ses.authstate.printableuser) { 134 } else if (ses.authstate.pw_name) {
135 /* we have a potential user */ 135 /* we have a potential user */
136 snprintf(fmtbuf, sizeof(fmtbuf), 136 snprintf(fmtbuf, sizeof(fmtbuf),
137 "exit before auth (user '%s', %d fails): %s", 137 "exit before auth (user '%s', %d fails): %s",
138 ses.authstate.printableuser, ses.authstate.failcount, format); 138 ses.authstate.pw_name, ses.authstate.failcount, format);
139 } else { 139 } else {
140 /* before userauth */ 140 /* before userauth */
141 snprintf(fmtbuf, sizeof(fmtbuf), 141 snprintf(fmtbuf, sizeof(fmtbuf),
142 "exit before auth: %s", format); 142 "exit before auth: %s", format);
143 } 143 }