comparison svr-agentfwd.c @ 1478:3a933956437e coverity

update coverity
author Matt Johnston <matt@ucc.asn.au>
date Fri, 09 Feb 2018 23:49:22 +0800
parents 58a74cb829b8
children 79eef94ccea9
comparison
equal deleted inserted replaced
1439:8d24733026c5 1478:3a933956437e
43 43
44 #define AGENTDIRPREFIX "/tmp/dropbear-" 44 #define AGENTDIRPREFIX "/tmp/dropbear-"
45 45
46 static int send_msg_channel_open_agent(int fd); 46 static int send_msg_channel_open_agent(int fd);
47 static int bindagent(int fd, struct ChanSess * chansess); 47 static int bindagent(int fd, struct ChanSess * chansess);
48 static void agentaccept(struct Listener * listener, int sock); 48 static void agentaccept(const struct Listener * listener, int sock);
49 49
50 /* Handles client requests to start agent forwarding, sets up listening socket. 50 /* Handles client requests to start agent forwarding, sets up listening socket.
51 * Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */ 51 * Returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */
52 int svr_agentreq(struct ChanSess * chansess) { 52 int svr_agentreq(struct ChanSess * chansess) {
53 int fd = -1; 53 int fd = -1;
98 } 98 }
99 99
100 /* accepts a connection on the forwarded socket and opens a new channel for it 100 /* accepts a connection on the forwarded socket and opens a new channel for it
101 * back to the client */ 101 * back to the client */
102 /* returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */ 102 /* returns DROPBEAR_SUCCESS or DROPBEAR_FAILURE */
103 static void agentaccept(struct Listener *UNUSED(listener), int sock) { 103 static void agentaccept(const struct Listener *UNUSED(listener), int sock) {
104 104
105 int fd; 105 int fd;
106 106
107 fd = accept(sock, NULL, NULL); 107 fd = accept(sock, NULL, NULL);
108 if (fd < 0) { 108 if (fd < 0) {
116 116
117 } 117 }
118 118
119 /* set up the environment variable pointing to the socket. This is called 119 /* set up the environment variable pointing to the socket. This is called
120 * just before command/shell execution, after dropping privileges */ 120 * just before command/shell execution, after dropping privileges */
121 void svr_agentset(struct ChanSess * chansess) { 121 void svr_agentset(const struct ChanSess * chansess) {
122 122
123 char *path = NULL; 123 char *path = NULL;
124 int len; 124 int len;
125 125
126 if (chansess->agentlistener == NULL) { 126 if (chansess->agentlistener == NULL) {