comparison svr-x11fwd.c @ 1459:06d52bcb8094

Pointer parameter could be declared as pointing to const
author Francois Perrad <francois.perrad@gadz.org>
date Sat, 19 Aug 2017 17:16:13 +0200
parents 750ec4ec4cbe
children 58a74cb829b8
comparison
equal deleted inserted replaced
1458:bdd3802c8ac6 1459:06d52bcb8094
38 #define X11BASEPORT 6000 38 #define X11BASEPORT 6000
39 #define X11BINDBASE 6010 39 #define X11BINDBASE 6010
40 40
41 static void x11accept(struct Listener* listener, int sock); 41 static void x11accept(struct Listener* listener, int sock);
42 static int bindport(int fd); 42 static int bindport(int fd);
43 static int send_msg_channel_open_x11(int fd, struct sockaddr_in* addr); 43 static int send_msg_channel_open_x11(int fd, const struct sockaddr_in* addr);
44 44
45 /* Check untrusted xauth strings for metacharacters */ 45 /* Check untrusted xauth strings for metacharacters */
46 /* Returns DROPBEAR_SUCCESS/DROPBEAR_FAILURE */ 46 /* Returns DROPBEAR_SUCCESS/DROPBEAR_FAILURE */
47 static int 47 static int
48 xauth_valid_string(const char *s) 48 xauth_valid_string(const char *s)
152 } 152 }
153 } 153 }
154 154
155 /* This is called after switching to the user, and sets up the xauth 155 /* This is called after switching to the user, and sets up the xauth
156 * and environment variables. */ 156 * and environment variables. */
157 void x11setauth(struct ChanSess *chansess) { 157 void x11setauth(const struct ChanSess *chansess) {
158 158
159 char display[20]; /* space for "localhost:12345.123" */ 159 char display[20]; /* space for "localhost:12345.123" */
160 FILE * authprog = NULL; 160 FILE * authprog = NULL;
161 int val; 161 int val;
162 162
218 NULL, /* reqhandler */ 218 NULL, /* reqhandler */
219 NULL /* closehandler */ 219 NULL /* closehandler */
220 }; 220 };
221 221
222 222
223 static int send_msg_channel_open_x11(int fd, struct sockaddr_in* addr) { 223 static int send_msg_channel_open_x11(int fd, const struct sockaddr_in* addr) {
224 224
225 char* ipstring = NULL; 225 char* ipstring = NULL;
226 226
227 if (send_msg_channel_open_init(fd, &chan_x11) == DROPBEAR_SUCCESS) { 227 if (send_msg_channel_open_init(fd, &chan_x11) == DROPBEAR_SUCCESS) {
228 ipstring = inet_ntoa(addr->sin_addr); 228 ipstring = inet_ntoa(addr->sin_addr);