version 1.40, 2000/10/15 14:14:01 |
version 1.41, 2000/10/18 18:42:00 |
|
|
void session_proctitle(Session *s); |
void session_proctitle(Session *s); |
void do_exec_pty(Session *s, const char *command, struct passwd * pw); |
void do_exec_pty(Session *s, const char *command, struct passwd * pw); |
void do_exec_no_pty(Session *s, const char *command, struct passwd * pw); |
void do_exec_no_pty(Session *s, const char *command, struct passwd * pw); |
void do_login(Session *s); |
void do_login(Session *s, const char *command); |
|
|
void |
void |
do_child(const char *command, struct passwd * pw, const char *term, |
do_child(const char *command, struct passwd * pw, const char *term, |
|
|
close(ttyfd); |
close(ttyfd); |
|
|
/* record login, etc. similar to login(1) */ |
/* record login, etc. similar to login(1) */ |
if (command == NULL && !options.use_login) |
if (!(options.use_login && command == NULL)) |
do_login(s); |
do_login(s, command); |
|
|
/* Do common processing for the child, such as execing the command. */ |
/* Do common processing for the child, such as execing the command. */ |
do_child(command, pw, s->term, s->display, s->auth_proto, |
do_child(command, pw, s->term, s->display, s->auth_proto, |
|
|
|
|
/* administrative, login(1)-like work */ |
/* administrative, login(1)-like work */ |
void |
void |
do_login(Session *s) |
do_login(Session *s, const char *command) |
{ |
{ |
FILE *f; |
FILE *f; |
char *time_string; |
char *time_string; |
|
|
record_login(pid, s->tty, pw->pw_name, pw->pw_uid, |
record_login(pid, s->tty, pw->pw_name, pw->pw_uid, |
get_remote_name_or_ip(), (struct sockaddr *)&from); |
get_remote_name_or_ip(), (struct sockaddr *)&from); |
|
|
/* Done if .hushlogin exists. */ |
/* Done if .hushlogin exists or a command given. */ |
|
if (command != NULL) |
|
return; |
snprintf(buf, sizeof(buf), "%.200s/.hushlogin", pw->pw_dir); |
snprintf(buf, sizeof(buf), "%.200s/.hushlogin", pw->pw_dir); |
#ifdef HAVE_LOGIN_CAP |
#ifdef HAVE_LOGIN_CAP |
if (login_getcapbool(lc, "hushlogin", 0) || stat(buf, &st) >= 0) |
if (login_getcapbool(lc, "hushlogin", 0) || stat(buf, &st) >= 0) |