comparison svr-x11fwd.c @ 1121:bb3a03feb31f

Merge pull request #13 from gazoo74/fix-warnings Fix warnings
author Matt Johnston <matt@ucc.asn.au>
date Thu, 04 Jun 2015 22:25:28 +0800
parents 877256d1b3fb
children aaf576b27a10
comparison
equal deleted inserted replaced
1087:1e486f368ec3 1121:bb3a03feb31f
56 if (chansess->x11listener != NULL) { 56 if (chansess->x11listener != NULL) {
57 return DROPBEAR_FAILURE; 57 return DROPBEAR_FAILURE;
58 } 58 }
59 59
60 chansess->x11singleconn = buf_getbool(ses.payload); 60 chansess->x11singleconn = buf_getbool(ses.payload);
61 chansess->x11authprot = buf_getstring(ses.payload, NULL); 61 chansess->x11authprot = (char *)buf_getstring(ses.payload, NULL);
62 chansess->x11authcookie = buf_getstring(ses.payload, NULL); 62 chansess->x11authcookie = (char *)buf_getstring(ses.payload, NULL);
63 chansess->x11screennum = buf_getint(ses.payload); 63 chansess->x11screennum = buf_getint(ses.payload);
64 64
65 /* create listening socket */ 65 /* create listening socket */
66 fd = socket(PF_INET, SOCK_STREAM, 0); 66 fd = socket(PF_INET, SOCK_STREAM, 0);
67 if (fd < 0) { 67 if (fd < 0) {
105 /* returns DROPBEAR_FAILURE or DROPBEAR_SUCCESS */ 105 /* returns DROPBEAR_FAILURE or DROPBEAR_SUCCESS */
106 static void x11accept(struct Listener* listener, int sock) { 106 static void x11accept(struct Listener* listener, int sock) {
107 107
108 int fd; 108 int fd;
109 struct sockaddr_in addr; 109 struct sockaddr_in addr;
110 int len; 110 socklen_t len;
111 int ret; 111 int ret;
112 struct ChanSess * chansess = (struct ChanSess *)(listener->typedata); 112 struct ChanSess * chansess = (struct ChanSess *)(listener->typedata);
113 113
114 len = sizeof(addr); 114 len = sizeof(addr);
115 115
201 201
202 char* ipstring = NULL; 202 char* ipstring = NULL;
203 203
204 if (send_msg_channel_open_init(fd, &chan_x11) == DROPBEAR_SUCCESS) { 204 if (send_msg_channel_open_init(fd, &chan_x11) == DROPBEAR_SUCCESS) {
205 ipstring = inet_ntoa(addr->sin_addr); 205 ipstring = inet_ntoa(addr->sin_addr);
206 buf_putstring(ses.writepayload, ipstring, strlen(ipstring)); 206 buf_putstring(ses.writepayload, (const unsigned char *)ipstring, strlen(ipstring));
207 buf_putint(ses.writepayload, addr->sin_port); 207 buf_putint(ses.writepayload, addr->sin_port);
208 208
209 encrypt_packet(); 209 encrypt_packet();
210 return DROPBEAR_SUCCESS; 210 return DROPBEAR_SUCCESS;
211 } else { 211 } else {