version 1.93, 2001/06/21 21:08:25 |
version 1.94, 2001/06/23 15:12:20 |
|
|
/* func */ |
/* func */ |
|
|
Session *session_new(void); |
Session *session_new(void); |
void session_set_fds(Session *s, int fdin, int fdout, int fderr); |
void session_set_fds(Session *, int, int, int); |
void session_pty_cleanup(void *session); |
static void session_pty_cleanup(void *); |
int session_pty_req(Session *s); |
void session_proctitle(Session *); |
void session_proctitle(Session *s); |
int session_setup_x11fwd(Session *); |
int session_setup_x11fwd(Session *s); |
void do_exec_pty(Session *, const char *); |
void session_close(Session *s); |
void do_exec_no_pty(Session *, const char *); |
void do_exec_pty(Session *s, const char *command); |
void do_exec(Session *, const char *); |
void do_exec_no_pty(Session *s, const char *command); |
void do_login(Session *, const char *); |
void do_exec(Session *s, const char *command); |
void do_child(Session *, const char *); |
void do_login(Session *s, const char *command); |
|
void do_child(Session *s, const char *command); |
|
void do_motd(void); |
void do_motd(void); |
int check_quietlogin(Session *s, const char *command); |
int check_quietlogin(Session *, const char *); |
|
|
void do_authenticated1(Authctxt *authctxt); |
static void do_authenticated1(Authctxt *); |
void do_authenticated2(Authctxt *authctxt); |
static void do_authenticated2(Authctxt *); |
|
|
|
static void session_close(Session *); |
|
static int session_pty_req(Session *); |
|
|
/* import */ |
/* import */ |
extern ServerOptions options; |
extern ServerOptions options; |
extern char *__progname; |
extern char *__progname; |
|
|
* terminals are allocated, X11, TCP/IP, and authentication agent forwardings |
* terminals are allocated, X11, TCP/IP, and authentication agent forwardings |
* are requested, etc. |
* are requested, etc. |
*/ |
*/ |
void |
static void |
do_authenticated1(Authctxt *authctxt) |
do_authenticated1(Authctxt *authctxt) |
{ |
{ |
Session *s; |
Session *s; |
|
|
* Sets the value of the given variable in the environment. If the variable |
* Sets the value of the given variable in the environment. If the variable |
* already exists, its value is overriden. |
* already exists, its value is overriden. |
*/ |
*/ |
void |
static void |
child_set_env(char ***envp, u_int *envsizep, const char *name, |
child_set_env(char ***envp, u_int *envsizep, const char *name, |
const char *value) |
const char *value) |
{ |
{ |
|
|
* Otherwise, it must consist of empty lines, comments (line starts with '#') |
* Otherwise, it must consist of empty lines, comments (line starts with '#') |
* and assignments of the form name=value. No other forms are allowed. |
* and assignments of the form name=value. No other forms are allowed. |
*/ |
*/ |
void |
static void |
read_environment_file(char ***env, u_int *envsize, |
read_environment_file(char ***env, u_int *envsize, |
const char *filename) |
const char *filename) |
{ |
{ |
|
|
return NULL; |
return NULL; |
} |
} |
|
|
void |
static void |
session_dump(void) |
session_dump(void) |
{ |
{ |
int i; |
int i; |
|
|
return 1; |
return 1; |
} |
} |
|
|
Session * |
static Session * |
session_by_channel(int id) |
session_by_channel(int id) |
{ |
{ |
int i; |
int i; |
|
|
return NULL; |
return NULL; |
} |
} |
|
|
Session * |
static Session * |
session_by_pid(pid_t pid) |
session_by_pid(pid_t pid) |
{ |
{ |
int i; |
int i; |
|
|
return NULL; |
return NULL; |
} |
} |
|
|
int |
static int |
session_window_change_req(Session *s) |
session_window_change_req(Session *s) |
{ |
{ |
s->col = packet_get_int(); |
s->col = packet_get_int(); |
|
|
return 1; |
return 1; |
} |
} |
|
|
int |
static int |
session_pty_req(Session *s) |
session_pty_req(Session *s) |
{ |
{ |
u_int len; |
u_int len; |
|
|
return 1; |
return 1; |
} |
} |
|
|
int |
static int |
session_subsystem_req(Session *s) |
session_subsystem_req(Session *s) |
{ |
{ |
u_int len; |
u_int len; |
|
|
return success; |
return success; |
} |
} |
|
|
int |
static int |
session_x11_req(Session *s) |
session_x11_req(Session *s) |
{ |
{ |
int success; |
int success; |
|
|
return success; |
return success; |
} |
} |
|
|
int |
static int |
session_shell_req(Session *s) |
session_shell_req(Session *s) |
{ |
{ |
packet_done(); |
packet_done(); |
|
|
return 1; |
return 1; |
} |
} |
|
|
int |
static int |
session_exec_req(Session *s) |
session_exec_req(Session *s) |
{ |
{ |
u_int len; |
u_int len; |
|
|
return 1; |
return 1; |
} |
} |
|
|
int |
static int |
session_auth_agent_req(Session *s) |
session_auth_agent_req(Session *s) |
{ |
{ |
static int called = 0; |
static int called = 0; |
|
|
* Function to perform pty cleanup. Also called if we get aborted abnormally |
* Function to perform pty cleanup. Also called if we get aborted abnormally |
* (e.g., due to a dropped connection). |
* (e.g., due to a dropped connection). |
*/ |
*/ |
void |
static void |
session_pty_cleanup(void *session) |
session_pty_cleanup(void *session) |
{ |
{ |
Session *s = session; |
Session *s = session; |
|
|
error("close(s->ptymaster): %s", strerror(errno)); |
error("close(s->ptymaster): %s", strerror(errno)); |
} |
} |
|
|
void |
static void |
session_exit_message(Session *s, int status) |
session_exit_message(Session *s, int status) |
{ |
{ |
Channel *c; |
Channel *c; |
|
|
s->chanid = -1; |
s->chanid = -1; |
} |
} |
|
|
void |
static void |
session_close(Session *s) |
session_close(Session *s) |
{ |
{ |
debug("session_close: session %d pid %d", s->self, s->pid); |
debug("session_close: session %d pid %d", s->self, s->pid); |
|
|
} |
} |
} |
} |
|
|
char * |
static char * |
session_tty_list(void) |
session_tty_list(void) |
{ |
{ |
static char buf[1024]; |
static char buf[1024]; |
|
|
return 1; |
return 1; |
} |
} |
|
|
void |
static void |
do_authenticated2(Authctxt *authctxt) |
do_authenticated2(Authctxt *authctxt) |
{ |
{ |
server_loop2(); |
server_loop2(); |