summaryrefslogtreecommitdiff
path: root/session.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-06-25 05:01:22 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-06-25 05:01:22 +0000
commitbba81213b972ce15fbbaca60b9ffabb42371ce8f (patch)
treee6bd40752969f2b93d179cfb9aaae9074ca45956 /session.c
parent34f91883a6f3123656b0a8017d68b658f7cf2403 (diff)
- itojun@cvs.openbsd.org 2001/06/23 15:12:20
[auth1.c auth2.c auth2-chall.c authfd.c authfile.c auth-rhosts.c canohost.c channels.c cipher.c clientloop.c deattack.c dh.c hostfile.c kex.c kexdh.c kexgex.c key.c nchan.c packet.c radix.c readpass.c scp.c servconf.c serverloop.c session.c sftp.c sftp-client.c sftp-glob.c sftp-int.c sftp-server.c ssh-add.c ssh-agent.c ssh.c sshconnect1.c sshconnect2.c sshconnect.c sshd.c ssh-keygen.c ssh-keyscan.c] more strict prototypes. raise warning level in Makefile.inc. markus ok'ed TODO; cleanup headers
Diffstat (limited to 'session.c')
-rw-r--r--session.c69
1 files changed, 33 insertions, 36 deletions
diff --git a/session.c b/session.c
index 0c723ef1a..92870a111 100644
--- a/session.c
+++ b/session.c
@@ -33,7 +33,7 @@
33 */ 33 */
34 34
35#include "includes.h" 35#include "includes.h"
36RCSID("$OpenBSD: session.c,v 1.93 2001/06/21 21:08:25 markus Exp $"); 36RCSID("$OpenBSD: session.c,v 1.94 2001/06/23 15:12:20 itojun Exp $");
37 37
38#include "ssh.h" 38#include "ssh.h"
39#include "ssh1.h" 39#include "ssh1.h"
@@ -120,25 +120,22 @@ struct Session {
120/* func */ 120/* func */
121 121
122Session *session_new(void); 122Session *session_new(void);
123void session_set_fds(Session *s, int fdin, int fdout, int fderr); 123void session_set_fds(Session *, int, int, int);
124void session_pty_cleanup(void *session); 124static void session_pty_cleanup(void *);
125int session_pty_req(Session *s); 125void session_proctitle(Session *);
126void session_proctitle(Session *s); 126int session_setup_x11fwd(Session *);
127int session_setup_x11fwd(Session *s); 127void do_exec_pty(Session *, const char *);
128void session_close(Session *s); 128void do_exec_no_pty(Session *, const char *);
129void do_exec_pty(Session *s, const char *command); 129void do_exec(Session *, const char *);
130void do_exec_no_pty(Session *s, const char *command); 130void do_login(Session *, const char *);
131void do_exec(Session *s, const char *command); 131void do_child(Session *, const char *);
132void do_login(Session *s, const char *command);
133#ifdef LOGIN_NEEDS_UTMPX
134void do_pre_login(Session *s);
135#endif
136void do_child(Session *s, const char *command);
137void do_motd(void); 132void do_motd(void);
138int check_quietlogin(Session *s, const char *command);
139 133
140void do_authenticated1(Authctxt *authctxt); 134static void do_authenticated1(Authctxt *);
141void do_authenticated2(Authctxt *authctxt); 135static void do_authenticated2(Authctxt *);
136
137static void session_close(Session *);
138static int session_pty_req(Session *);
142 139
143/* import */ 140/* import */
144extern ServerOptions options; 141extern ServerOptions options;
@@ -209,7 +206,7 @@ do_authenticated(Authctxt *authctxt)
209 * terminals are allocated, X11, TCP/IP, and authentication agent forwardings 206 * terminals are allocated, X11, TCP/IP, and authentication agent forwardings
210 * are requested, etc. 207 * are requested, etc.
211 */ 208 */
212void 209static void
213do_authenticated1(Authctxt *authctxt) 210do_authenticated1(Authctxt *authctxt)
214{ 211{
215 Session *s; 212 Session *s;
@@ -738,7 +735,7 @@ check_quietlogin(Session *s, const char *command)
738 * Sets the value of the given variable in the environment. If the variable 735 * Sets the value of the given variable in the environment. If the variable
739 * already exists, its value is overriden. 736 * already exists, its value is overriden.
740 */ 737 */
741void 738static void
742child_set_env(char ***envp, u_int *envsizep, const char *name, 739child_set_env(char ***envp, u_int *envsizep, const char *name,
743 const char *value) 740 const char *value)
744{ 741{
@@ -779,7 +776,7 @@ child_set_env(char ***envp, u_int *envsizep, const char *name,
779 * Otherwise, it must consist of empty lines, comments (line starts with '#') 776 * Otherwise, it must consist of empty lines, comments (line starts with '#')
780 * and assignments of the form name=value. No other forms are allowed. 777 * and assignments of the form name=value. No other forms are allowed.
781 */ 778 */
782void 779static void
783read_environment_file(char ***env, u_int *envsize, 780read_environment_file(char ***env, u_int *envsize,
784 const char *filename) 781 const char *filename)
785{ 782{
@@ -1488,7 +1485,7 @@ session_new(void)
1488 return NULL; 1485 return NULL;
1489} 1486}
1490 1487
1491void 1488static void
1492session_dump(void) 1489session_dump(void)
1493{ 1490{
1494 int i; 1491 int i;
@@ -1520,7 +1517,7 @@ session_open(int chanid)
1520 return 1; 1517 return 1;
1521} 1518}
1522 1519
1523Session * 1520static Session *
1524session_by_channel(int id) 1521session_by_channel(int id)
1525{ 1522{
1526 int i; 1523 int i;
@@ -1536,7 +1533,7 @@ session_by_channel(int id)
1536 return NULL; 1533 return NULL;
1537} 1534}
1538 1535
1539Session * 1536static Session *
1540session_by_pid(pid_t pid) 1537session_by_pid(pid_t pid)
1541{ 1538{
1542 int i; 1539 int i;
@@ -1551,7 +1548,7 @@ session_by_pid(pid_t pid)
1551 return NULL; 1548 return NULL;
1552} 1549}
1553 1550
1554int 1551static int
1555session_window_change_req(Session *s) 1552session_window_change_req(Session *s)
1556{ 1553{
1557 s->col = packet_get_int(); 1554 s->col = packet_get_int();
@@ -1563,7 +1560,7 @@ session_window_change_req(Session *s)
1563 return 1; 1560 return 1;
1564} 1561}
1565 1562
1566int 1563static int
1567session_pty_req(Session *s) 1564session_pty_req(Session *s)
1568{ 1565{
1569 u_int len; 1566 u_int len;
@@ -1628,7 +1625,7 @@ session_pty_req(Session *s)
1628 return 1; 1625 return 1;
1629} 1626}
1630 1627
1631int 1628static int
1632session_subsystem_req(Session *s) 1629session_subsystem_req(Session *s)
1633{ 1630{
1634 u_int len; 1631 u_int len;
@@ -1655,7 +1652,7 @@ session_subsystem_req(Session *s)
1655 return success; 1652 return success;
1656} 1653}
1657 1654
1658int 1655static int
1659session_x11_req(Session *s) 1656session_x11_req(Session *s)
1660{ 1657{
1661 int success; 1658 int success;
@@ -1676,7 +1673,7 @@ session_x11_req(Session *s)
1676 return success; 1673 return success;
1677} 1674}
1678 1675
1679int 1676static int
1680session_shell_req(Session *s) 1677session_shell_req(Session *s)
1681{ 1678{
1682 packet_done(); 1679 packet_done();
@@ -1684,7 +1681,7 @@ session_shell_req(Session *s)
1684 return 1; 1681 return 1;
1685} 1682}
1686 1683
1687int 1684static int
1688session_exec_req(Session *s) 1685session_exec_req(Session *s)
1689{ 1686{
1690 u_int len; 1687 u_int len;
@@ -1695,7 +1692,7 @@ session_exec_req(Session *s)
1695 return 1; 1692 return 1;
1696} 1693}
1697 1694
1698int 1695static int
1699session_auth_agent_req(Session *s) 1696session_auth_agent_req(Session *s)
1700{ 1697{
1701 static int called = 0; 1698 static int called = 0;
@@ -1788,7 +1785,7 @@ session_set_fds(Session *s, int fdin, int fdout, int fderr)
1788 * Function to perform pty cleanup. Also called if we get aborted abnormally 1785 * Function to perform pty cleanup. Also called if we get aborted abnormally
1789 * (e.g., due to a dropped connection). 1786 * (e.g., due to a dropped connection).
1790 */ 1787 */
1791void 1788static void
1792session_pty_cleanup(void *session) 1789session_pty_cleanup(void *session)
1793{ 1790{
1794 Session *s = session; 1791 Session *s = session;
@@ -1818,7 +1815,7 @@ session_pty_cleanup(void *session)
1818 error("close(s->ptymaster): %s", strerror(errno)); 1815 error("close(s->ptymaster): %s", strerror(errno));
1819} 1816}
1820 1817
1821void 1818static void
1822session_exit_message(Session *s, int status) 1819session_exit_message(Session *s, int status)
1823{ 1820{
1824 Channel *c; 1821 Channel *c;
@@ -1867,7 +1864,7 @@ session_exit_message(Session *s, int status)
1867 s->chanid = -1; 1864 s->chanid = -1;
1868} 1865}
1869 1866
1870void 1867static void
1871session_close(Session *s) 1868session_close(Session *s)
1872{ 1869{
1873 debug("session_close: session %d pid %d", s->self, s->pid); 1870 debug("session_close: session %d pid %d", s->self, s->pid);
@@ -1928,7 +1925,7 @@ session_close_by_channel(int id, void *arg)
1928 } 1925 }
1929} 1926}
1930 1927
1931char * 1928static char *
1932session_tty_list(void) 1929session_tty_list(void)
1933{ 1930{
1934 static char buf[1024]; 1931 static char buf[1024];
@@ -1991,7 +1988,7 @@ session_setup_x11fwd(Session *s)
1991 return 1; 1988 return 1;
1992} 1989}
1993 1990
1994void 1991static void
1995do_authenticated2(Authctxt *authctxt) 1992do_authenticated2(Authctxt *authctxt)
1996{ 1993{
1997 server_loop2(); 1994 server_loop2();