Mercurial > dropbear
comparison svr-chansession.c @ 970:0bb16232e7c4
Make keepalive handling more robust, this should now match what OpenSSH does
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 19 Aug 2014 23:08:56 +0800 |
parents | 36eacc322e00 |
children | eb5cb4f45cd6 |
comparison
equal
deleted
inserted
replaced
969:939944f0fca9 | 970:0bb16232e7c4 |
---|---|
51 static void addchildpid(struct ChanSess *chansess, pid_t pid); | 51 static void addchildpid(struct ChanSess *chansess, pid_t pid); |
52 static void sesssigchild_handler(int val); | 52 static void sesssigchild_handler(int val); |
53 static void closechansess(struct Channel *channel); | 53 static void closechansess(struct Channel *channel); |
54 static int newchansess(struct Channel *channel); | 54 static int newchansess(struct Channel *channel); |
55 static void chansessionrequest(struct Channel *channel); | 55 static void chansessionrequest(struct Channel *channel); |
56 static int sesscheckclose(struct Channel *channel); | |
56 | 57 |
57 static void send_exitsignalstatus(struct Channel *channel); | 58 static void send_exitsignalstatus(struct Channel *channel); |
58 static void send_msg_chansess_exitstatus(struct Channel * channel, | 59 static void send_msg_chansess_exitstatus(struct Channel * channel, |
59 struct ChanSess * chansess); | 60 struct ChanSess * chansess); |
60 static void send_msg_chansess_exitsignal(struct Channel * channel, | 61 static void send_msg_chansess_exitsignal(struct Channel * channel, |
61 struct ChanSess * chansess); | 62 struct ChanSess * chansess); |
62 static void get_termmodes(struct ChanSess *chansess); | 63 static void get_termmodes(struct ChanSess *chansess); |
63 | 64 |
65 const struct ChanType svrchansess = { | |
66 0, /* sepfds */ | |
67 "session", /* name */ | |
68 newchansess, /* inithandler */ | |
69 sesscheckclose, /* checkclosehandler */ | |
70 chansessionrequest, /* reqhandler */ | |
71 closechansess, /* closehandler */ | |
72 }; | |
64 | 73 |
65 /* required to clear environment */ | 74 /* required to clear environment */ |
66 extern char** environ; | 75 extern char** environ; |
67 | 76 |
68 static int sesscheckclose(struct Channel *channel) { | 77 static int sesscheckclose(struct Channel *channel) { |
966 | 975 |
967 /* only reached on error */ | 976 /* only reached on error */ |
968 dropbear_exit("Child failed"); | 977 dropbear_exit("Child failed"); |
969 } | 978 } |
970 | 979 |
971 const struct ChanType svrchansess = { | |
972 0, /* sepfds */ | |
973 "session", /* name */ | |
974 newchansess, /* inithandler */ | |
975 sesscheckclose, /* checkclosehandler */ | |
976 chansessionrequest, /* reqhandler */ | |
977 closechansess, /* closehandler */ | |
978 }; | |
979 | |
980 | |
981 /* Set up the general chansession environment, in particular child-exit | 980 /* Set up the general chansession environment, in particular child-exit |
982 * handling */ | 981 * handling */ |
983 void svr_chansessinitialise() { | 982 void svr_chansessinitialise() { |
984 | 983 |
985 struct sigaction sa_chld; | 984 struct sigaction sa_chld; |