comparison common-session.c @ 483:738313e73b1c

- "-J 'nc localhost 22'" kind of works, needs fixing hostkeys, ptys etc.
author Matt Johnston <matt@ucc.asn.au>
date Mon, 15 Sep 2008 14:40:30 +0000
parents 7ad49f34a122
children 6cd2152aae0b 43bbe17d6ba0
comparison
equal deleted inserted replaced
482:7ad49f34a122 483:738313e73b1c
421 return "/bin/sh"; 421 return "/bin/sh";
422 } else { 422 } else {
423 return ses.authstate.pw_shell; 423 return ses.authstate.pw_shell;
424 } 424 }
425 } 425 }
426 void fill_passwd(const char* username) {
427 struct passwd *pw = NULL;
428 if (ses.authstate.pw_name)
429 m_free(ses.authstate.pw_name);
430 if (ses.authstate.pw_dir)
431 m_free(ses.authstate.pw_dir);
432 if (ses.authstate.pw_shell)
433 m_free(ses.authstate.pw_shell);
434 if (ses.authstate.pw_passwd)
435 m_free(ses.authstate.pw_passwd);
436
437 pw = getpwnam(username);
438 if (!pw) {
439 return;
440 }
441 ses.authstate.pw_uid = pw->pw_uid;
442 ses.authstate.pw_gid = pw->pw_gid;
443 ses.authstate.pw_name = m_strdup(pw->pw_name);
444 ses.authstate.pw_dir = m_strdup(pw->pw_dir);
445 ses.authstate.pw_shell = m_strdup(pw->pw_shell);
446 ses.authstate.pw_passwd = m_strdup(pw->pw_passwd);
447 }
448