|
Petr Lautrbach |
84822b |
diff -up openssh-6.3p1/auth-pam.c.coverity openssh-6.3p1/auth-pam.c
|
|
Petr Lautrbach |
84822b |
--- openssh-6.3p1/auth-pam.c.coverity 2013-06-02 00:07:32.000000000 +0200
|
|
Petr Lautrbach |
84822b |
+++ openssh-6.3p1/auth-pam.c 2013-10-07 13:20:36.288298063 +0200
|
|
Jan F. Chadima |
c870e6 |
@@ -216,7 +216,12 @@ pthread_join(sp_pthread_t thread, void *
|
|
Jan F. Chadima |
3b545b |
if (sshpam_thread_status != -1)
|
|
Jan F. Chadima |
3b545b |
return (sshpam_thread_status);
|
|
Jan F. Chadima |
3b545b |
signal(SIGCHLD, sshpam_oldsig);
|
|
Jan F. Chadima |
3b545b |
- waitpid(thread, &status, 0);
|
|
Jan F. Chadima |
c870e6 |
+ while (waitpid(thread, &status, 0) < 0) {
|
|
Jan F. Chadima |
c870e6 |
+ if (errno == EINTR)
|
|
Jan F. Chadima |
c870e6 |
+ continue;
|
|
Jan F. Chadima |
c870e6 |
+ fatal("%s: waitpid: %s", __func__,
|
|
Jan F. Chadima |
c870e6 |
+ strerror(errno));
|
|
Jan F. Chadima |
c870e6 |
+ }
|
|
Jan F. Chadima |
3b545b |
return (status);
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
#endif
|
|
Petr Lautrbach |
84822b |
diff -up openssh-6.3p1/channels.c.coverity openssh-6.3p1/channels.c
|
|
Petr Lautrbach |
84822b |
--- openssh-6.3p1/channels.c.coverity 2013-09-13 08:19:31.000000000 +0200
|
|
Petr Lautrbach |
84822b |
+++ openssh-6.3p1/channels.c 2013-10-07 13:20:36.289298058 +0200
|
|
Petr Lautrbach |
84822b |
@@ -233,11 +233,11 @@ channel_register_fds(Channel *c, int rfd
|
|
Jan F. Chadima |
3b545b |
channel_max_fd = MAX(channel_max_fd, wfd);
|
|
Jan F. Chadima |
3b545b |
channel_max_fd = MAX(channel_max_fd, efd);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
- if (rfd != -1)
|
|
Jan F. Chadima |
3b545b |
+ if (rfd >= 0)
|
|
Jan F. Chadima |
3b545b |
fcntl(rfd, F_SETFD, FD_CLOEXEC);
|
|
Jan F. Chadima |
3b545b |
- if (wfd != -1 && wfd != rfd)
|
|
Jan F. Chadima |
3b545b |
+ if (wfd >= 0 && wfd != rfd)
|
|
Jan F. Chadima |
3b545b |
fcntl(wfd, F_SETFD, FD_CLOEXEC);
|
|
Jan F. Chadima |
3b545b |
- if (efd != -1 && efd != rfd && efd != wfd)
|
|
Jan F. Chadima |
3b545b |
+ if (efd >= 0 && efd != rfd && efd != wfd)
|
|
Jan F. Chadima |
3b545b |
fcntl(efd, F_SETFD, FD_CLOEXEC);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
c->rfd = rfd;
|
|
Petr Lautrbach |
84822b |
@@ -255,11 +255,11 @@ channel_register_fds(Channel *c, int rfd
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* enable nonblocking mode */
|
|
Jan F. Chadima |
3b545b |
if (nonblock) {
|
|
Jan F. Chadima |
3b545b |
- if (rfd != -1)
|
|
Jan F. Chadima |
3b545b |
+ if (rfd >= 0)
|
|
Jan F. Chadima |
3b545b |
set_nonblock(rfd);
|
|
Jan F. Chadima |
3b545b |
- if (wfd != -1)
|
|
Jan F. Chadima |
3b545b |
+ if (wfd >= 0)
|
|
Jan F. Chadima |
3b545b |
set_nonblock(wfd);
|
|
Jan F. Chadima |
3b545b |
- if (efd != -1)
|
|
Jan F. Chadima |
3b545b |
+ if (efd >= 0)
|
|
Jan F. Chadima |
3b545b |
set_nonblock(efd);
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
}
|
|
Petr Lautrbach |
84822b |
diff -up openssh-6.3p1/clientloop.c.coverity openssh-6.3p1/clientloop.c
|
|
Petr Lautrbach |
84822b |
--- openssh-6.3p1/clientloop.c.coverity 2013-06-10 05:07:12.000000000 +0200
|
|
Petr Lautrbach |
84822b |
+++ openssh-6.3p1/clientloop.c 2013-10-07 13:20:36.289298058 +0200
|
|
Petr Lautrbach |
84822b |
@@ -2068,14 +2068,15 @@ client_input_global_request(int type, u_
|
|
Petr Lautrbach |
8a29de |
char *rtype;
|
|
Petr Lautrbach |
8a29de |
int want_reply;
|
|
Petr Lautrbach |
8a29de |
int success = 0;
|
|
Petr Lautrbach |
8a29de |
+/* success is still 0 the packet is allways SSH2_MSG_REQUEST_FAILURE, isn't it? */
|
|
Petr Lautrbach |
8a29de |
|
|
Petr Lautrbach |
8a29de |
rtype = packet_get_string(NULL);
|
|
Petr Lautrbach |
8a29de |
want_reply = packet_get_char();
|
|
Petr Lautrbach |
8a29de |
debug("client_input_global_request: rtype %s want_reply %d",
|
|
Petr Lautrbach |
8a29de |
rtype, want_reply);
|
|
Petr Lautrbach |
8a29de |
if (want_reply) {
|
|
Petr Lautrbach |
8a29de |
- packet_start(success ?
|
|
Petr Lautrbach |
8a29de |
- SSH2_MSG_REQUEST_SUCCESS : SSH2_MSG_REQUEST_FAILURE);
|
|
Petr Lautrbach |
8a29de |
+ packet_start(/*success ?
|
|
Petr Lautrbach |
8a29de |
+ SSH2_MSG_REQUEST_SUCCESS :*/ SSH2_MSG_REQUEST_FAILURE);
|
|
Petr Lautrbach |
8a29de |
packet_send();
|
|
Petr Lautrbach |
8a29de |
packet_write_wait();
|
|
Petr Lautrbach |
8a29de |
}
|
|
Petr Lautrbach |
84822b |
diff -up openssh-6.3p1/key.c.coverity openssh-6.3p1/key.c
|
|
Petr Lautrbach |
84822b |
--- openssh-6.3p1/key.c.coverity 2013-06-01 23:41:51.000000000 +0200
|
|
Petr Lautrbach |
84822b |
+++ openssh-6.3p1/key.c 2013-10-07 13:20:36.290298054 +0200
|
|
Petr Lautrbach |
84822b |
@@ -807,8 +807,10 @@ key_read(Key *ret, char **cpp)
|
|
Jan F. Chadima |
3b545b |
success = 1;
|
|
Jan F. Chadima |
3b545b |
/*XXXX*/
|
|
Jan F. Chadima |
3b545b |
key_free(k);
|
|
Jan F. Chadima |
3b545b |
+/*XXXX
|
|
Jan F. Chadima |
3b545b |
if (success != 1)
|
|
Jan F. Chadima |
3b545b |
break;
|
|
Jan F. Chadima |
3b545b |
+XXXX*/
|
|
Jan F. Chadima |
3b545b |
/* advance cp: skip whitespace and data */
|
|
Jan F. Chadima |
3b545b |
while (*cp == ' ' || *cp == '\t')
|
|
Jan F. Chadima |
3b545b |
cp++;
|
|
Petr Lautrbach |
84822b |
diff -up openssh-6.3p1/monitor.c.coverity openssh-6.3p1/monitor.c
|
|
Petr Lautrbach |
84822b |
--- openssh-6.3p1/monitor.c.coverity 2013-07-20 05:21:53.000000000 +0200
|
|
Petr Lautrbach |
84822b |
+++ openssh-6.3p1/monitor.c 2013-10-07 13:54:36.761314042 +0200
|
|
Petr Lautrbach |
8a29de |
@@ -449,7 +449,7 @@ monitor_child_preauth(Authctxt *_authctx
|
|
Petr Lautrbach |
8a29de |
mm_get_keystate(pmonitor);
|
|
Jan F. Chadima |
cff1d0 |
|
|
Jan F. Chadima |
cff1d0 |
/* Drain any buffered messages from the child */
|
|
Jan F. Chadima |
cff1d0 |
- while (pmonitor->m_log_recvfd != -1 && monitor_read_log(pmonitor) == 0)
|
|
Jan F. Chadima |
cff1d0 |
+ while (pmonitor->m_log_recvfd >= 0 && monitor_read_log(pmonitor) == 0)
|
|
Jan F. Chadima |
cff1d0 |
;
|
|
Jan F. Chadima |
cff1d0 |
|
|
Petr Lautrbach |
8a29de |
close(pmonitor->m_sendfd);
|
|
Petr Lautrbach |
84822b |
@@ -1202,6 +1202,10 @@ mm_answer_keyallowed(int sock, Buffer *m
|
|
Jan F. Chadima |
ea97ff |
break;
|
|
Jan F. Chadima |
ea97ff |
}
|
|
Jan F. Chadima |
ea97ff |
}
|
|
Jan F. Chadima |
ea97ff |
+
|
|
Jan F. Chadima |
ea97ff |
+ debug3("%s: key %p is %s",
|
|
Jan F. Chadima |
ea97ff |
+ __func__, key, allowed ? "allowed" : "not allowed");
|
|
Jan F. Chadima |
ea97ff |
+
|
|
Jan F. Chadima |
ea97ff |
if (key != NULL)
|
|
Jan F. Chadima |
ea97ff |
key_free(key);
|
|
Jan F. Chadima |
ea97ff |
|
|
Petr Lautrbach |
84822b |
@@ -1223,9 +1227,6 @@ mm_answer_keyallowed(int sock, Buffer *m
|
|
Petr Lautrbach |
84822b |
free(chost);
|
|
Jan F. Chadima |
ea97ff |
}
|
|
Jan F. Chadima |
ea97ff |
|
|
Jan F. Chadima |
ea97ff |
- debug3("%s: key %p is %s",
|
|
Jan F. Chadima |
ea97ff |
- __func__, key, allowed ? "allowed" : "not allowed");
|
|
Jan F. Chadima |
ea97ff |
-
|
|
Jan F. Chadima |
ea97ff |
buffer_clear(m);
|
|
Jan F. Chadima |
ea97ff |
buffer_put_int(m, allowed);
|
|
Jan F. Chadima |
ea97ff |
buffer_put_int(m, forced_command != NULL);
|
|
Petr Lautrbach |
84822b |
diff -up openssh-6.3p1/monitor_wrap.c.coverity openssh-6.3p1/monitor_wrap.c
|
|
Petr Lautrbach |
84822b |
--- openssh-6.3p1/monitor_wrap.c.coverity 2013-06-02 00:07:32.000000000 +0200
|
|
Petr Lautrbach |
84822b |
+++ openssh-6.3p1/monitor_wrap.c 2013-10-07 13:20:36.291298049 +0200
|
|
Petr Lautrbach |
84822b |
@@ -710,10 +710,10 @@ mm_pty_allocate(int *ptyfd, int *ttyfd,
|
|
Jan F. Chadima |
cff1d0 |
if ((tmp1 = dup(pmonitor->m_recvfd)) == -1 ||
|
|
Jan F. Chadima |
cff1d0 |
(tmp2 = dup(pmonitor->m_recvfd)) == -1) {
|
|
Jan F. Chadima |
cff1d0 |
error("%s: cannot allocate fds for pty", __func__);
|
|
Jan F. Chadima |
cff1d0 |
- if (tmp1 > 0)
|
|
Jan F. Chadima |
cff1d0 |
+ if (tmp1 >= 0)
|
|
Jan F. Chadima |
cff1d0 |
close(tmp1);
|
|
Jan F. Chadima |
cff1d0 |
- if (tmp2 > 0)
|
|
Jan F. Chadima |
cff1d0 |
- close(tmp2);
|
|
Jan F. Chadima |
cff1d0 |
+ /*DEAD CODE if (tmp2 >= 0)
|
|
Jan F. Chadima |
cff1d0 |
+ close(tmp2);*/
|
|
Jan F. Chadima |
cff1d0 |
return 0;
|
|
Jan F. Chadima |
cff1d0 |
}
|
|
Jan F. Chadima |
cff1d0 |
close(tmp1);
|
|
Petr Lautrbach |
84822b |
diff -up openssh-6.3p1/openbsd-compat/bindresvport.c.coverity openssh-6.3p1/openbsd-compat/bindresvport.c
|
|
Petr Lautrbach |
84822b |
--- openssh-6.3p1/openbsd-compat/bindresvport.c.coverity 2010-12-03 00:50:26.000000000 +0100
|
|
Petr Lautrbach |
84822b |
+++ openssh-6.3p1/openbsd-compat/bindresvport.c 2013-10-07 13:20:36.291298049 +0200
|
|
Jan F. Chadima |
ea97ff |
@@ -58,7 +58,7 @@ bindresvport_sa(int sd, struct sockaddr
|
|
Jan F. Chadima |
ea97ff |
struct sockaddr_in6 *in6;
|
|
Jan F. Chadima |
ea97ff |
u_int16_t *portp;
|
|
Jan F. Chadima |
ea97ff |
u_int16_t port;
|
|
Jan F. Chadima |
ea97ff |
- socklen_t salen;
|
|
Jan F. Chadima |
ea97ff |
+ socklen_t salen = sizeof(struct sockaddr_storage);
|
|
Jan F. Chadima |
ea97ff |
int i;
|
|
Jan F. Chadima |
ea97ff |
|
|
Jan F. Chadima |
ea97ff |
if (sa == NULL) {
|
|
Petr Lautrbach |
84822b |
diff -up openssh-6.3p1/packet.c.coverity openssh-6.3p1/packet.c
|
|
Petr Lautrbach |
84822b |
--- openssh-6.3p1/packet.c.coverity 2013-07-18 08:12:45.000000000 +0200
|
|
Petr Lautrbach |
84822b |
+++ openssh-6.3p1/packet.c 2013-10-07 13:20:36.291298049 +0200
|
|
Petr Lautrbach |
84822b |
@@ -1199,6 +1199,7 @@ packet_read_poll1(void)
|
|
Jan F. Chadima |
3b545b |
case DEATTACK_DETECTED:
|
|
Jan F. Chadima |
3b545b |
packet_disconnect("crc32 compensation attack: "
|
|
Jan F. Chadima |
3b545b |
"network attack detected");
|
|
Jan F. Chadima |
3b545b |
+ break;
|
|
Jan F. Chadima |
3b545b |
case DEATTACK_DOS_DETECTED:
|
|
Jan F. Chadima |
3b545b |
packet_disconnect("deattack denial of "
|
|
Jan F. Chadima |
3b545b |
"service detected");
|
|
Petr Lautrbach |
84822b |
diff -up openssh-6.3p1/progressmeter.c.coverity openssh-6.3p1/progressmeter.c
|
|
Petr Lautrbach |
84822b |
--- openssh-6.3p1/progressmeter.c.coverity 2013-06-02 15:46:24.000000000 +0200
|
|
Petr Lautrbach |
84822b |
+++ openssh-6.3p1/progressmeter.c 2013-10-07 13:42:32.377850691 +0200
|
|
Jan F. Chadima |
3b545b |
@@ -65,7 +65,7 @@ static void update_progress_meter(int);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
static time_t start; /* start progress */
|
|
Jan F. Chadima |
3b545b |
static time_t last_update; /* last progress update */
|
|
Jan F. Chadima |
3b545b |
-static char *file; /* name of the file being transferred */
|
|
Jan F. Chadima |
3b545b |
+static const char *file; /* name of the file being transferred */
|
|
Jan F. Chadima |
3b545b |
static off_t end_pos; /* ending position of transfer */
|
|
Jan F. Chadima |
3b545b |
static off_t cur_pos; /* transfer position as of last refresh */
|
|
Jan F. Chadima |
3b545b |
static volatile off_t *counter; /* progress counter */
|
|
Jan F. Chadima |
3b545b |
@@ -247,7 +247,7 @@ update_progress_meter(int ignore)
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
void
|
|
Jan F. Chadima |
3b545b |
-start_progress_meter(char *f, off_t filesize, off_t *ctr)
|
|
Jan F. Chadima |
3b545b |
+start_progress_meter(const char *f, off_t filesize, off_t *ctr)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Petr Lautrbach |
84822b |
start = last_update = monotime();
|
|
Jan F. Chadima |
3b545b |
file = f;
|
|
Petr Lautrbach |
84822b |
diff -up openssh-6.3p1/progressmeter.h.coverity openssh-6.3p1/progressmeter.h
|
|
Petr Lautrbach |
84822b |
--- openssh-6.3p1/progressmeter.h.coverity 2006-03-26 05:30:02.000000000 +0200
|
|
Petr Lautrbach |
84822b |
+++ openssh-6.3p1/progressmeter.h 2013-10-07 13:20:36.292298044 +0200
|
|
Jan F. Chadima |
3b545b |
@@ -23,5 +23,5 @@
|
|
Jan F. Chadima |
3b545b |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
Jan F. Chadima |
3b545b |
*/
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
-void start_progress_meter(char *, off_t, off_t *);
|
|
Jan F. Chadima |
3b545b |
+void start_progress_meter(const char *, off_t, off_t *);
|
|
Jan F. Chadima |
3b545b |
void stop_progress_meter(void);
|
|
Petr Lautrbach |
84822b |
diff -up openssh-6.3p1/scp.c.coverity openssh-6.3p1/scp.c
|
|
Petr Lautrbach |
84822b |
--- openssh-6.3p1/scp.c.coverity 2013-07-18 08:11:25.000000000 +0200
|
|
Petr Lautrbach |
84822b |
+++ openssh-6.3p1/scp.c 2013-10-07 13:20:36.292298044 +0200
|
|
Jan F. Chadima |
3b545b |
@@ -155,7 +155,7 @@ killchild(int signo)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
if (do_cmd_pid > 1) {
|
|
Jan F. Chadima |
3b545b |
kill(do_cmd_pid, signo ? signo : SIGTERM);
|
|
Jan F. Chadima |
3b545b |
- waitpid(do_cmd_pid, NULL, 0);
|
|
Jan F. Chadima |
3b545b |
+ (void) waitpid(do_cmd_pid, NULL, 0);
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
if (signo)
|
|
Petr Lautrbach |
84822b |
diff -up openssh-6.3p1/servconf.c.coverity openssh-6.3p1/servconf.c
|
|
Petr Lautrbach |
84822b |
--- openssh-6.3p1/servconf.c.coverity 2013-07-20 05:21:53.000000000 +0200
|
|
Petr Lautrbach |
84822b |
+++ openssh-6.3p1/servconf.c 2013-10-07 13:20:36.293298039 +0200
|
|
Petr Lautrbach |
84822b |
@@ -1323,7 +1323,7 @@ process_server_config_line(ServerOptions
|
|
Jan F. Chadima |
ea97ff |
fatal("%s line %d: Missing subsystem name.",
|
|
Jan F. Chadima |
ea97ff |
filename, linenum);
|
|
Jan F. Chadima |
ea97ff |
if (!*activep) {
|
|
Jan F. Chadima |
ea97ff |
- arg = strdelim(&cp;;
|
|
Jan F. Chadima |
ea97ff |
+ /*arg =*/ (void) strdelim(&cp;;
|
|
Jan F. Chadima |
ea97ff |
break;
|
|
Jan F. Chadima |
ea97ff |
}
|
|
Jan F. Chadima |
ea97ff |
for (i = 0; i < options->num_subsystems; i++)
|
|
Petr Lautrbach |
84822b |
@@ -1414,8 +1414,9 @@ process_server_config_line(ServerOptions
|
|
Jan F. Chadima |
cff1d0 |
if (*activep && *charptr == NULL) {
|
|
Jan F. Chadima |
cff1d0 |
*charptr = tilde_expand_filename(arg, getuid());
|
|
Jan F. Chadima |
cff1d0 |
/* increase optional counter */
|
|
Jan F. Chadima |
cff1d0 |
- if (intptr != NULL)
|
|
Jan F. Chadima |
cff1d0 |
- *intptr = *intptr + 1;
|
|
Jan F. Chadima |
cff1d0 |
+ /* DEAD CODE intptr is still NULL ;)
|
|
Jan F. Chadima |
cff1d0 |
+ if (intptr != NULL)
|
|
Jan F. Chadima |
cff1d0 |
+ *intptr = *intptr + 1; */
|
|
Jan F. Chadima |
cff1d0 |
}
|
|
Jan F. Chadima |
cff1d0 |
break;
|
|
Jan F. Chadima |
cff1d0 |
|
|
Petr Lautrbach |
84822b |
diff -up openssh-6.3p1/serverloop.c.coverity openssh-6.3p1/serverloop.c
|
|
Petr Lautrbach |
84822b |
--- openssh-6.3p1/serverloop.c.coverity 2013-07-18 08:12:45.000000000 +0200
|
|
Petr Lautrbach |
84822b |
+++ openssh-6.3p1/serverloop.c 2013-10-07 13:43:36.620537138 +0200
|
|
Jan F. Chadima |
3b545b |
@@ -147,13 +147,13 @@ notify_setup(void)
|
|
Jan F. Chadima |
3b545b |
static void
|
|
Jan F. Chadima |
3b545b |
notify_parent(void)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
- if (notify_pipe[1] != -1)
|
|
Jan F. Chadima |
3b545b |
+ if (notify_pipe[1] >= 0)
|
|
Petr Lautrbach |
84822b |
(void)write(notify_pipe[1], "", 1);
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
static void
|
|
Jan F. Chadima |
3b545b |
notify_prepare(fd_set *readset)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
- if (notify_pipe[0] != -1)
|
|
Jan F. Chadima |
3b545b |
+ if (notify_pipe[0] >= 0)
|
|
Jan F. Chadima |
3b545b |
FD_SET(notify_pipe[0], readset);
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
static void
|
|
Jan F. Chadima |
3b545b |
@@ -161,8 +161,8 @@ notify_done(fd_set *readset)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
char c;
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
- if (notify_pipe[0] != -1 && FD_ISSET(notify_pipe[0], readset))
|
|
Jan F. Chadima |
3b545b |
- while (read(notify_pipe[0], &c, 1) != -1)
|
|
Jan F. Chadima |
3b545b |
+ if (notify_pipe[0] >= 0 && FD_ISSET(notify_pipe[0], readset))
|
|
Jan F. Chadima |
3b545b |
+ while (read(notify_pipe[0], &c, 1) >= 0)
|
|
Jan F. Chadima |
3b545b |
debug2("notify_done: reading");
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Petr Lautrbach |
9fe1af |
@@ -336,7 +336,7 @@ wait_until_can_do_something(fd_set **rea
|
|
Jan F. Chadima |
3b545b |
* If we have buffered data, try to write some of that data
|
|
Jan F. Chadima |
3b545b |
* to the program.
|
|
Jan F. Chadima |
3b545b |
*/
|
|
Jan F. Chadima |
3b545b |
- if (fdin != -1 && buffer_len(&stdin_buffer) > 0)
|
|
Jan F. Chadima |
3b545b |
+ if (fdin >= 0 && buffer_len(&stdin_buffer) > 0)
|
|
Jan F. Chadima |
3b545b |
FD_SET(fdin, *writesetp);
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
notify_prepare(*readsetp);
|
|
Petr Lautrbach |
9fe1af |
@@ -476,7 +476,7 @@ process_output(fd_set *writeset)
|
|
Jan F. Chadima |
3b545b |
int len;
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* Write buffered data to program stdin. */
|
|
Jan F. Chadima |
3b545b |
- if (!compat20 && fdin != -1 && FD_ISSET(fdin, writeset)) {
|
|
Jan F. Chadima |
3b545b |
+ if (!compat20 && fdin >= 0 && FD_ISSET(fdin, writeset)) {
|
|
Jan F. Chadima |
3b545b |
data = buffer_ptr(&stdin_buffer);
|
|
Jan F. Chadima |
3b545b |
dlen = buffer_len(&stdin_buffer);
|
|
Jan F. Chadima |
3b545b |
len = write(fdin, data, dlen);
|
|
Petr Lautrbach |
9fe1af |
@@ -589,7 +589,7 @@ server_loop(pid_t pid, int fdin_arg, int
|
|
Jan F. Chadima |
3b545b |
set_nonblock(fdin);
|
|
Jan F. Chadima |
3b545b |
set_nonblock(fdout);
|
|
Jan F. Chadima |
3b545b |
/* we don't have stderr for interactive terminal sessions, see below */
|
|
Jan F. Chadima |
3b545b |
- if (fderr != -1)
|
|
Jan F. Chadima |
3b545b |
+ if (fderr >= 0)
|
|
Jan F. Chadima |
3b545b |
set_nonblock(fderr);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
if (!(datafellows & SSH_BUG_IGNOREMSG) && isatty(fdin))
|
|
Petr Lautrbach |
9fe1af |
@@ -613,7 +613,7 @@ server_loop(pid_t pid, int fdin_arg, int
|
|
Jan F. Chadima |
3b545b |
max_fd = MAX(connection_in, connection_out);
|
|
Jan F. Chadima |
3b545b |
max_fd = MAX(max_fd, fdin);
|
|
Jan F. Chadima |
3b545b |
max_fd = MAX(max_fd, fdout);
|
|
Jan F. Chadima |
3b545b |
- if (fderr != -1)
|
|
Jan F. Chadima |
3b545b |
+ if (fderr >= 0)
|
|
Jan F. Chadima |
3b545b |
max_fd = MAX(max_fd, fderr);
|
|
Jan F. Chadima |
3b545b |
#endif
|
|
Jan F. Chadima |
3b545b |
|
|
Petr Lautrbach |
9fe1af |
@@ -643,7 +643,7 @@ server_loop(pid_t pid, int fdin_arg, int
|
|
Jan F. Chadima |
3b545b |
* If we have received eof, and there is no more pending
|
|
Jan F. Chadima |
3b545b |
* input data, cause a real eof by closing fdin.
|
|
Jan F. Chadima |
3b545b |
*/
|
|
Jan F. Chadima |
3b545b |
- if (stdin_eof && fdin != -1 && buffer_len(&stdin_buffer) == 0) {
|
|
Jan F. Chadima |
3b545b |
+ if (stdin_eof && fdin >= 0 && buffer_len(&stdin_buffer) == 0) {
|
|
Jan F. Chadima |
3b545b |
if (fdin != fdout)
|
|
Jan F. Chadima |
3b545b |
close(fdin);
|
|
Jan F. Chadima |
3b545b |
else
|
|
Petr Lautrbach |
84822b |
@@ -739,15 +739,15 @@ server_loop(pid_t pid, int fdin_arg, int
|
|
Jan F. Chadima |
3b545b |
buffer_free(&stderr_buffer);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* Close the file descriptors. */
|
|
Jan F. Chadima |
3b545b |
- if (fdout != -1)
|
|
Jan F. Chadima |
3b545b |
+ if (fdout >= 0)
|
|
Jan F. Chadima |
3b545b |
close(fdout);
|
|
Jan F. Chadima |
3b545b |
fdout = -1;
|
|
Jan F. Chadima |
3b545b |
fdout_eof = 1;
|
|
Jan F. Chadima |
3b545b |
- if (fderr != -1)
|
|
Jan F. Chadima |
3b545b |
+ if (fderr >= 0)
|
|
Jan F. Chadima |
3b545b |
close(fderr);
|
|
Jan F. Chadima |
3b545b |
fderr = -1;
|
|
Jan F. Chadima |
3b545b |
fderr_eof = 1;
|
|
Jan F. Chadima |
3b545b |
- if (fdin != -1)
|
|
Jan F. Chadima |
3b545b |
+ if (fdin >= 0)
|
|
Jan F. Chadima |
3b545b |
close(fdin);
|
|
Jan F. Chadima |
3b545b |
fdin = -1;
|
|
Jan F. Chadima |
3b545b |
|
|
Petr Lautrbach |
84822b |
@@ -946,7 +946,7 @@ server_input_window_size(int type, u_int
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
debug("Window change received.");
|
|
Jan F. Chadima |
3b545b |
packet_check_eom();
|
|
Jan F. Chadima |
3b545b |
- if (fdin != -1)
|
|
Jan F. Chadima |
3b545b |
+ if (fdin >= 0)
|
|
Jan F. Chadima |
3b545b |
pty_change_window_size(fdin, row, col, xpixel, ypixel);
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Petr Lautrbach |
84822b |
@@ -1006,7 +1006,7 @@ server_request_tun(void)
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
tun = packet_get_int();
|
|
Jan F. Chadima |
3b545b |
- if (forced_tun_device != -1) {
|
|
Jan F. Chadima |
3b545b |
+ if (forced_tun_device >= 0) {
|
|
Jan F. Chadima |
3b545b |
if (tun != SSH_TUNID_ANY && forced_tun_device != tun)
|
|
Jan F. Chadima |
3b545b |
goto done;
|
|
Jan F. Chadima |
3b545b |
tun = forced_tun_device;
|
|
Petr Lautrbach |
84822b |
diff -up openssh-6.3p1/sftp-client.c.coverity openssh-6.3p1/sftp-client.c
|
|
Petr Lautrbach |
84822b |
--- openssh-6.3p1/sftp-client.c.coverity 2013-07-26 00:40:00.000000000 +0200
|
|
Petr Lautrbach |
84822b |
+++ openssh-6.3p1/sftp-client.c 2013-10-07 13:48:45.885027420 +0200
|
|
Jan F. Chadima |
3b545b |
@@ -149,7 +149,7 @@ get_msg(struct sftp_conn *conn, Buffer *
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
static void
|
|
Jan F. Chadima |
3b545b |
-send_string_request(struct sftp_conn *conn, u_int id, u_int code, char *s,
|
|
Jan F. Chadima |
3b545b |
+send_string_request(struct sftp_conn *conn, u_int id, u_int code, const char *s,
|
|
Jan F. Chadima |
3b545b |
u_int len)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
Buffer msg;
|
|
Jan F. Chadima |
3b545b |
@@ -165,7 +165,7 @@ send_string_request(struct sftp_conn *co
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
static void
|
|
Jan F. Chadima |
3b545b |
send_string_attrs_request(struct sftp_conn *conn, u_int id, u_int code,
|
|
Jan F. Chadima |
3b545b |
- char *s, u_int len, Attrib *a)
|
|
Jan F. Chadima |
3b545b |
+ const char *s, u_int len, Attrib *a)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
Buffer msg;
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
@@ -422,7 +422,7 @@ sftp_proto_version(struct sftp_conn *con
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
int
|
|
Jan F. Chadima |
3b545b |
-do_close(struct sftp_conn *conn, char *handle, u_int handle_len)
|
|
Jan F. Chadima |
3b545b |
+do_close(struct sftp_conn *conn, const char *handle, u_int handle_len)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
u_int id, status;
|
|
Jan F. Chadima |
3b545b |
Buffer msg;
|
|
Jan F. Chadima |
3b545b |
@@ -447,7 +447,7 @@ do_close(struct sftp_conn *conn, char *h
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
static int
|
|
Jan F. Chadima |
3b545b |
-do_lsreaddir(struct sftp_conn *conn, char *path, int printflag,
|
|
Jan F. Chadima |
3b545b |
+do_lsreaddir(struct sftp_conn *conn, const char *path, int printflag,
|
|
Jan F. Chadima |
3b545b |
SFTP_DIRENT ***dir)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
Buffer msg;
|
|
Petr Lautrbach |
9fe1af |
@@ -572,7 +572,7 @@ do_lsreaddir(struct sftp_conn *conn, cha
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
int
|
|
Jan F. Chadima |
3b545b |
-do_readdir(struct sftp_conn *conn, char *path, SFTP_DIRENT ***dir)
|
|
Jan F. Chadima |
3b545b |
+do_readdir(struct sftp_conn *conn, const char *path, SFTP_DIRENT ***dir)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
return(do_lsreaddir(conn, path, 0, dir));
|
|
Jan F. Chadima |
3b545b |
}
|
|
Petr Lautrbach |
9fe1af |
@@ -590,7 +590,7 @@ void free_sftp_dirents(SFTP_DIRENT **s)
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
int
|
|
Jan F. Chadima |
3b545b |
-do_rm(struct sftp_conn *conn, char *path)
|
|
Jan F. Chadima |
3b545b |
+do_rm(struct sftp_conn *conn, const char *path)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
u_int status, id;
|
|
Jan F. Chadima |
3b545b |
|
|
Petr Lautrbach |
9fe1af |
@@ -605,7 +605,7 @@ do_rm(struct sftp_conn *conn, char *path
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
int
|
|
Jan F. Chadima |
3b545b |
-do_mkdir(struct sftp_conn *conn, char *path, Attrib *a, int printflag)
|
|
Jan F. Chadima |
3b545b |
+do_mkdir(struct sftp_conn *conn, const char *path, Attrib *a, int printflag)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
u_int status, id;
|
|
Jan F. Chadima |
3b545b |
|
|
Petr Lautrbach |
9fe1af |
@@ -621,7 +621,7 @@ do_mkdir(struct sftp_conn *conn, char *p
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
int
|
|
Jan F. Chadima |
3b545b |
-do_rmdir(struct sftp_conn *conn, char *path)
|
|
Jan F. Chadima |
3b545b |
+do_rmdir(struct sftp_conn *conn, const char *path)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
u_int status, id;
|
|
Jan F. Chadima |
3b545b |
|
|
Petr Lautrbach |
9fe1af |
@@ -637,7 +637,7 @@ do_rmdir(struct sftp_conn *conn, char *p
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
Attrib *
|
|
Jan F. Chadima |
3b545b |
-do_stat(struct sftp_conn *conn, char *path, int quiet)
|
|
Jan F. Chadima |
3b545b |
+do_stat(struct sftp_conn *conn, const char *path, int quiet)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
u_int id;
|
|
Jan F. Chadima |
3b545b |
|
|
Petr Lautrbach |
9fe1af |
@@ -651,7 +651,7 @@ do_stat(struct sftp_conn *conn, char *pa
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
Attrib *
|
|
Jan F. Chadima |
3b545b |
-do_lstat(struct sftp_conn *conn, char *path, int quiet)
|
|
Jan F. Chadima |
3b545b |
+do_lstat(struct sftp_conn *conn, const char *path, int quiet)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
u_int id;
|
|
Jan F. Chadima |
3b545b |
|
|
Petr Lautrbach |
9fe1af |
@@ -685,7 +685,7 @@ do_fstat(struct sftp_conn *conn, char *h
|
|
Jan F. Chadima |
3b545b |
#endif
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
int
|
|
Jan F. Chadima |
3b545b |
-do_setstat(struct sftp_conn *conn, char *path, Attrib *a)
|
|
Jan F. Chadima |
3b545b |
+do_setstat(struct sftp_conn *conn, const char *path, Attrib *a)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
u_int status, id;
|
|
Jan F. Chadima |
3b545b |
|
|
Petr Lautrbach |
9fe1af |
@@ -702,7 +702,7 @@ do_setstat(struct sftp_conn *conn, char
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
int
|
|
Jan F. Chadima |
3b545b |
-do_fsetstat(struct sftp_conn *conn, char *handle, u_int handle_len,
|
|
Jan F. Chadima |
3b545b |
+do_fsetstat(struct sftp_conn *conn, const char *handle, u_int handle_len,
|
|
Jan F. Chadima |
3b545b |
Attrib *a)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
u_int status, id;
|
|
Petr Lautrbach |
9fe1af |
@@ -719,7 +719,7 @@ do_fsetstat(struct sftp_conn *conn, char
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
char *
|
|
Jan F. Chadima |
3b545b |
-do_realpath(struct sftp_conn *conn, char *path)
|
|
Jan F. Chadima |
3b545b |
+do_realpath(struct sftp_conn *conn, const char *path)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
Buffer msg;
|
|
Jan F. Chadima |
3b545b |
u_int type, expected_id, count, id;
|
|
Petr Lautrbach |
9fe1af |
@@ -768,7 +768,7 @@ do_realpath(struct sftp_conn *conn, char
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
int
|
|
Jan F. Chadima |
3b545b |
-do_rename(struct sftp_conn *conn, char *oldpath, char *newpath)
|
|
Jan F. Chadima |
3b545b |
+do_rename(struct sftp_conn *conn, const char *oldpath, const char *newpath)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
Buffer msg;
|
|
Jan F. Chadima |
3b545b |
u_int status, id;
|
|
Petr Lautrbach |
9fe1af |
@@ -802,7 +802,7 @@ do_rename(struct sftp_conn *conn, char *
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
int
|
|
Jan F. Chadima |
3b545b |
-do_hardlink(struct sftp_conn *conn, char *oldpath, char *newpath)
|
|
Jan F. Chadima |
3b545b |
+do_hardlink(struct sftp_conn *conn, const char *oldpath, const char *newpath)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
Buffer msg;
|
|
Jan F. Chadima |
3b545b |
u_int status, id;
|
|
Petr Lautrbach |
9fe1af |
@@ -835,7 +835,7 @@ do_hardlink(struct sftp_conn *conn, char
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
int
|
|
Jan F. Chadima |
3b545b |
-do_symlink(struct sftp_conn *conn, char *oldpath, char *newpath)
|
|
Jan F. Chadima |
3b545b |
+do_symlink(struct sftp_conn *conn, const char *oldpath, const char *newpath)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
Buffer msg;
|
|
Jan F. Chadima |
3b545b |
u_int status, id;
|
|
Petr Lautrbach |
9fe1af |
@@ -987,7 +987,7 @@ send_read_request(struct sftp_conn *conn
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
int
|
|
Jan F. Chadima |
3b545b |
-do_download(struct sftp_conn *conn, char *remote_path, char *local_path,
|
|
Jan F. Chadima |
3b545b |
+do_download(struct sftp_conn *conn, const char *remote_path, const char *local_path,
|
|
Petr Lautrbach |
84822b |
Attrib *a, int pflag, int resume)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
Attrib junk;
|
|
Petr Lautrbach |
84822b |
@@ -1255,7 +1255,7 @@ do_download(struct sftp_conn *conn, char
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
static int
|
|
Jan F. Chadima |
3b545b |
-download_dir_internal(struct sftp_conn *conn, char *src, char *dst,
|
|
Jan F. Chadima |
3b545b |
+download_dir_internal(struct sftp_conn *conn, const char *src, const char *dst,
|
|
Petr Lautrbach |
84822b |
Attrib *dirattrib, int pflag, int printflag, int depth, int resume)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
int i, ret = 0;
|
|
Petr Lautrbach |
84822b |
@@ -1345,7 +1345,7 @@ download_dir_internal(struct sftp_conn *
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
int
|
|
Jan F. Chadima |
3b545b |
-download_dir(struct sftp_conn *conn, char *src, char *dst,
|
|
Jan F. Chadima |
3b545b |
+download_dir(struct sftp_conn *conn, const char *src, const char *dst,
|
|
Petr Lautrbach |
84822b |
Attrib *dirattrib, int pflag, int printflag, int resume)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
char *src_canon;
|
|
Petr Lautrbach |
84822b |
@@ -1363,7 +1363,7 @@ download_dir(struct sftp_conn *conn, cha
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
int
|
|
Jan F. Chadima |
3b545b |
-do_upload(struct sftp_conn *conn, char *local_path, char *remote_path,
|
|
Jan F. Chadima |
3b545b |
+do_upload(struct sftp_conn *conn, const char *local_path, const char *remote_path,
|
|
Jan F. Chadima |
3b545b |
int pflag)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
int local_fd;
|
|
Petr Lautrbach |
84822b |
@@ -1548,7 +1548,7 @@ do_upload(struct sftp_conn *conn, char *
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
static int
|
|
Jan F. Chadima |
3b545b |
-upload_dir_internal(struct sftp_conn *conn, char *src, char *dst,
|
|
Jan F. Chadima |
3b545b |
+upload_dir_internal(struct sftp_conn *conn, const char *src, const char *dst,
|
|
Jan F. Chadima |
3b545b |
int pflag, int printflag, int depth)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
int ret = 0, status;
|
|
Petr Lautrbach |
84822b |
@@ -1639,7 +1639,7 @@ upload_dir_internal(struct sftp_conn *co
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
int
|
|
Jan F. Chadima |
3b545b |
-upload_dir(struct sftp_conn *conn, char *src, char *dst, int printflag,
|
|
Jan F. Chadima |
3b545b |
+upload_dir(struct sftp_conn *conn, const char *src, const char *dst, int printflag,
|
|
Jan F. Chadima |
3b545b |
int pflag)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
char *dst_canon;
|
|
Petr Lautrbach |
84822b |
@@ -1656,7 +1656,7 @@ upload_dir(struct sftp_conn *conn, char
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
char *
|
|
Jan F. Chadima |
3b545b |
-path_append(char *p1, char *p2)
|
|
Jan F. Chadima |
3b545b |
+path_append(const char *p1, const char *p2)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
char *ret;
|
|
Jan F. Chadima |
3b545b |
size_t len = strlen(p1) + strlen(p2) + 2;
|
|
Petr Lautrbach |
84822b |
diff -up openssh-6.3p1/sftp-client.h.coverity openssh-6.3p1/sftp-client.h
|
|
Petr Lautrbach |
84822b |
--- openssh-6.3p1/sftp-client.h.coverity 2013-07-25 03:56:52.000000000 +0200
|
|
Petr Lautrbach |
84822b |
+++ openssh-6.3p1/sftp-client.h 2013-10-07 13:45:10.108080813 +0200
|
|
Jan F. Chadima |
3b545b |
@@ -56,49 +56,49 @@ struct sftp_conn *do_init(int, int, u_in
|
|
Jan F. Chadima |
3b545b |
u_int sftp_proto_version(struct sftp_conn *);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* Close file referred to by 'handle' */
|
|
Jan F. Chadima |
3b545b |
-int do_close(struct sftp_conn *, char *, u_int);
|
|
Jan F. Chadima |
3b545b |
+int do_close(struct sftp_conn *, const char *, u_int);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* Read contents of 'path' to NULL-terminated array 'dir' */
|
|
Jan F. Chadima |
3b545b |
-int do_readdir(struct sftp_conn *, char *, SFTP_DIRENT ***);
|
|
Jan F. Chadima |
3b545b |
+int do_readdir(struct sftp_conn *, const char *, SFTP_DIRENT ***);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* Frees a NULL-terminated array of SFTP_DIRENTs (eg. from do_readdir) */
|
|
Jan F. Chadima |
3b545b |
void free_sftp_dirents(SFTP_DIRENT **);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* Delete file 'path' */
|
|
Jan F. Chadima |
3b545b |
-int do_rm(struct sftp_conn *, char *);
|
|
Jan F. Chadima |
3b545b |
+int do_rm(struct sftp_conn *, const char *);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* Create directory 'path' */
|
|
Jan F. Chadima |
3b545b |
-int do_mkdir(struct sftp_conn *, char *, Attrib *, int);
|
|
Jan F. Chadima |
3b545b |
+int do_mkdir(struct sftp_conn *, const char *, Attrib *, int);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* Remove directory 'path' */
|
|
Jan F. Chadima |
3b545b |
-int do_rmdir(struct sftp_conn *, char *);
|
|
Jan F. Chadima |
3b545b |
+int do_rmdir(struct sftp_conn *, const char *);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* Get file attributes of 'path' (follows symlinks) */
|
|
Jan F. Chadima |
3b545b |
-Attrib *do_stat(struct sftp_conn *, char *, int);
|
|
Jan F. Chadima |
3b545b |
+Attrib *do_stat(struct sftp_conn *, const char *, int);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* Get file attributes of 'path' (does not follow symlinks) */
|
|
Jan F. Chadima |
3b545b |
-Attrib *do_lstat(struct sftp_conn *, char *, int);
|
|
Jan F. Chadima |
3b545b |
+Attrib *do_lstat(struct sftp_conn *, const char *, int);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* Set file attributes of 'path' */
|
|
Jan F. Chadima |
3b545b |
-int do_setstat(struct sftp_conn *, char *, Attrib *);
|
|
Jan F. Chadima |
3b545b |
+int do_setstat(struct sftp_conn *, const char *, Attrib *);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* Set file attributes of open file 'handle' */
|
|
Jan F. Chadima |
3b545b |
-int do_fsetstat(struct sftp_conn *, char *, u_int, Attrib *);
|
|
Jan F. Chadima |
3b545b |
+int do_fsetstat(struct sftp_conn *, const char *, u_int, Attrib *);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* Canonicalise 'path' - caller must free result */
|
|
Jan F. Chadima |
3b545b |
-char *do_realpath(struct sftp_conn *, char *);
|
|
Jan F. Chadima |
3b545b |
+char *do_realpath(struct sftp_conn *, const char *);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* Get statistics for filesystem hosting file at "path" */
|
|
Jan F. Chadima |
3b545b |
int do_statvfs(struct sftp_conn *, const char *, struct sftp_statvfs *, int);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* Rename 'oldpath' to 'newpath' */
|
|
Jan F. Chadima |
3b545b |
-int do_rename(struct sftp_conn *, char *, char *);
|
|
Jan F. Chadima |
3b545b |
+int do_rename(struct sftp_conn *, const char *, const char *);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* Link 'oldpath' to 'newpath' */
|
|
Jan F. Chadima |
3b545b |
-int do_hardlink(struct sftp_conn *, char *, char *);
|
|
Jan F. Chadima |
3b545b |
+int do_hardlink(struct sftp_conn *, const char *, const char *);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
-/* Rename 'oldpath' to 'newpath' */
|
|
Jan F. Chadima |
3b545b |
-int do_symlink(struct sftp_conn *, char *, char *);
|
|
Jan F. Chadima |
3b545b |
+/* Symlink 'oldpath' to 'newpath' */
|
|
Jan F. Chadima |
3b545b |
+int do_symlink(struct sftp_conn *, const char *, const char *);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* XXX: add callbacks to do_download/do_upload so we can do progress meter */
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
@@ -106,27 +106,27 @@ int do_symlink(struct sftp_conn *, char
|
|
Jan F. Chadima |
3b545b |
* Download 'remote_path' to 'local_path'. Preserve permissions and times
|
|
Jan F. Chadima |
3b545b |
* if 'pflag' is set
|
|
Jan F. Chadima |
3b545b |
*/
|
|
Petr Lautrbach |
84822b |
-int do_download(struct sftp_conn *, char *, char *, Attrib *, int, int);
|
|
Petr Lautrbach |
84822b |
+int do_download(struct sftp_conn *, const char *, const char *, Attrib *, int, int);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/*
|
|
Jan F. Chadima |
3b545b |
* Recursively download 'remote_directory' to 'local_directory'. Preserve
|
|
Jan F. Chadima |
3b545b |
* times if 'pflag' is set
|
|
Jan F. Chadima |
3b545b |
*/
|
|
Petr Lautrbach |
84822b |
-int download_dir(struct sftp_conn *, char *, char *, Attrib *, int, int, int);
|
|
Petr Lautrbach |
84822b |
+int download_dir(struct sftp_conn *, const char *, const char *, Attrib *, int, int, int);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/*
|
|
Jan F. Chadima |
3b545b |
* Upload 'local_path' to 'remote_path'. Preserve permissions and times
|
|
Jan F. Chadima |
3b545b |
* if 'pflag' is set
|
|
Jan F. Chadima |
3b545b |
*/
|
|
Jan F. Chadima |
3b545b |
-int do_upload(struct sftp_conn *, char *, char *, int);
|
|
Jan F. Chadima |
3b545b |
+int do_upload(struct sftp_conn *, const char *, const char *, int);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/*
|
|
Jan F. Chadima |
3b545b |
* Recursively upload 'local_directory' to 'remote_directory'. Preserve
|
|
Jan F. Chadima |
3b545b |
* times if 'pflag' is set
|
|
Jan F. Chadima |
3b545b |
*/
|
|
Jan F. Chadima |
3b545b |
-int upload_dir(struct sftp_conn *, char *, char *, int, int);
|
|
Jan F. Chadima |
3b545b |
+int upload_dir(struct sftp_conn *, const char *, const char *, int, int);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* Concatenate paths, taking care of slashes. Caller must free result. */
|
|
Jan F. Chadima |
3b545b |
-char *path_append(char *, char *);
|
|
Jan F. Chadima |
3b545b |
+char *path_append(const char *, const char *);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
#endif
|
|
Petr Lautrbach |
84822b |
diff -up openssh-6.3p1/sftp.c.coverity openssh-6.3p1/sftp.c
|
|
Petr Lautrbach |
84822b |
--- openssh-6.3p1/sftp.c.coverity 2013-07-25 03:56:52.000000000 +0200
|
|
Petr Lautrbach |
84822b |
+++ openssh-6.3p1/sftp.c 2013-10-07 13:49:47.322727449 +0200
|
|
Petr Lautrbach |
84822b |
@@ -213,7 +213,7 @@ killchild(int signo)
|
|
Petr Lautrbach |
84822b |
{
|
|
Petr Lautrbach |
84822b |
if (sshpid > 1) {
|
|
Petr Lautrbach |
84822b |
kill(sshpid, SIGTERM);
|
|
Petr Lautrbach |
84822b |
- waitpid(sshpid, NULL, 0);
|
|
Petr Lautrbach |
84822b |
+ (void) waitpid(sshpid, NULL, 0);
|
|
Petr Lautrbach |
84822b |
}
|
|
Petr Lautrbach |
84822b |
|
|
Petr Lautrbach |
84822b |
_exit(1);
|
|
Petr Lautrbach |
84822b |
@@ -324,7 +324,7 @@ local_do_ls(const char *args)
|
|
Petr Lautrbach |
84822b |
|
|
Petr Lautrbach |
84822b |
/* Strip one path (usually the pwd) from the start of another */
|
|
Petr Lautrbach |
84822b |
static char *
|
|
Petr Lautrbach |
84822b |
-path_strip(char *path, char *strip)
|
|
Petr Lautrbach |
84822b |
+path_strip(const char *path, const char *strip)
|
|
Petr Lautrbach |
84822b |
{
|
|
Petr Lautrbach |
84822b |
size_t len;
|
|
Petr Lautrbach |
84822b |
|
|
Petr Lautrbach |
84822b |
@@ -342,7 +342,7 @@ path_strip(char *path, char *strip)
|
|
Petr Lautrbach |
84822b |
}
|
|
Petr Lautrbach |
84822b |
|
|
Petr Lautrbach |
84822b |
static char *
|
|
Petr Lautrbach |
84822b |
-make_absolute(char *p, char *pwd)
|
|
Petr Lautrbach |
84822b |
+make_absolute(char *p, const char *pwd)
|
|
Petr Lautrbach |
84822b |
{
|
|
Petr Lautrbach |
84822b |
char *abs_str;
|
|
Petr Lautrbach |
84822b |
|
|
Petr Lautrbach |
84822b |
@@ -493,7 +493,7 @@ parse_df_flags(const char *cmd, char **a
|
|
Petr Lautrbach |
84822b |
}
|
|
Petr Lautrbach |
84822b |
|
|
Petr Lautrbach |
84822b |
static int
|
|
Petr Lautrbach |
84822b |
-is_dir(char *path)
|
|
Petr Lautrbach |
84822b |
+is_dir(const char *path)
|
|
Petr Lautrbach |
84822b |
{
|
|
Petr Lautrbach |
84822b |
struct stat sb;
|
|
Petr Lautrbach |
84822b |
|
|
Petr Lautrbach |
84822b |
@@ -505,7 +505,7 @@ is_dir(char *path)
|
|
Petr Lautrbach |
84822b |
}
|
|
Petr Lautrbach |
84822b |
|
|
Petr Lautrbach |
84822b |
static int
|
|
Petr Lautrbach |
84822b |
-remote_is_dir(struct sftp_conn *conn, char *path)
|
|
Petr Lautrbach |
84822b |
+remote_is_dir(struct sftp_conn *conn, const char *path)
|
|
Petr Lautrbach |
84822b |
{
|
|
Petr Lautrbach |
84822b |
Attrib *a;
|
|
Petr Lautrbach |
84822b |
|
|
Petr Lautrbach |
84822b |
@@ -519,7 +519,7 @@ remote_is_dir(struct sftp_conn *conn, ch
|
|
Petr Lautrbach |
84822b |
|
|
Petr Lautrbach |
84822b |
/* Check whether path returned from glob(..., GLOB_MARK, ...) is a directory */
|
|
Petr Lautrbach |
84822b |
static int
|
|
Petr Lautrbach |
84822b |
-pathname_is_dir(char *pathname)
|
|
Petr Lautrbach |
84822b |
+pathname_is_dir(const char *pathname)
|
|
Petr Lautrbach |
84822b |
{
|
|
Petr Lautrbach |
84822b |
size_t l = strlen(pathname);
|
|
Petr Lautrbach |
84822b |
|
|
Petr Lautrbach |
84822b |
@@ -527,7 +527,7 @@ pathname_is_dir(char *pathname)
|
|
Petr Lautrbach |
84822b |
}
|
|
Petr Lautrbach |
84822b |
|
|
Petr Lautrbach |
84822b |
static int
|
|
Petr Lautrbach |
84822b |
-process_get(struct sftp_conn *conn, char *src, char *dst, char *pwd,
|
|
Petr Lautrbach |
84822b |
+process_get(struct sftp_conn *conn, const char *src, const char *dst, const char *pwd,
|
|
Petr Lautrbach |
84822b |
int pflag, int rflag, int resume)
|
|
Petr Lautrbach |
84822b |
{
|
|
Petr Lautrbach |
84822b |
char *abs_src = NULL;
|
|
Petr Lautrbach |
84822b |
@@ -605,7 +605,7 @@ out:
|
|
Petr Lautrbach |
84822b |
}
|
|
Petr Lautrbach |
84822b |
|
|
Petr Lautrbach |
84822b |
static int
|
|
Petr Lautrbach |
84822b |
-process_put(struct sftp_conn *conn, char *src, char *dst, char *pwd,
|
|
Petr Lautrbach |
84822b |
+process_put(struct sftp_conn *conn, const char *src, const char *dst, const char *pwd,
|
|
Petr Lautrbach |
84822b |
int pflag, int rflag)
|
|
Petr Lautrbach |
84822b |
{
|
|
Petr Lautrbach |
84822b |
char *tmp_dst = NULL;
|
|
Petr Lautrbach |
84822b |
@@ -709,7 +709,7 @@ sdirent_comp(const void *aa, const void
|
|
Petr Lautrbach |
84822b |
|
|
Petr Lautrbach |
84822b |
/* sftp ls.1 replacement for directories */
|
|
Petr Lautrbach |
84822b |
static int
|
|
Petr Lautrbach |
84822b |
-do_ls_dir(struct sftp_conn *conn, char *path, char *strip_path, int lflag)
|
|
Petr Lautrbach |
84822b |
+do_ls_dir(struct sftp_conn *conn, const char *path, const char *strip_path, int lflag)
|
|
Petr Lautrbach |
84822b |
{
|
|
Petr Lautrbach |
84822b |
int n;
|
|
Petr Lautrbach |
84822b |
u_int c = 1, colspace = 0, columns = 1;
|
|
Petr Lautrbach |
84822b |
@@ -794,7 +794,7 @@ do_ls_dir(struct sftp_conn *conn, char *
|
|
Petr Lautrbach |
84822b |
|
|
Petr Lautrbach |
84822b |
/* sftp ls.1 replacement which handles path globs */
|
|
Petr Lautrbach |
84822b |
static int
|
|
Petr Lautrbach |
84822b |
-do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path,
|
|
Petr Lautrbach |
84822b |
+do_globbed_ls(struct sftp_conn *conn, const char *path, const char *strip_path,
|
|
Petr Lautrbach |
84822b |
int lflag)
|
|
Petr Lautrbach |
84822b |
{
|
|
Petr Lautrbach |
84822b |
char *fname, *lname;
|
|
Petr Lautrbach |
84822b |
@@ -875,7 +875,7 @@ do_globbed_ls(struct sftp_conn *conn, ch
|
|
Petr Lautrbach |
84822b |
}
|
|
Petr Lautrbach |
84822b |
|
|
Petr Lautrbach |
84822b |
static int
|
|
Petr Lautrbach |
84822b |
-do_df(struct sftp_conn *conn, char *path, int hflag, int iflag)
|
|
Petr Lautrbach |
84822b |
+do_df(struct sftp_conn *conn, const char *path, int hflag, int iflag)
|
|
Petr Lautrbach |
84822b |
{
|
|
Petr Lautrbach |
84822b |
struct sftp_statvfs st;
|
|
Petr Lautrbach |
84822b |
char s_used[FMT_SCALED_STRSIZE];
|
|
Petr Lautrbach |
84822b |
diff -up openssh-6.3p1/ssh-agent.c.coverity openssh-6.3p1/ssh-agent.c
|
|
Petr Lautrbach |
84822b |
--- openssh-6.3p1/ssh-agent.c.coverity 2013-07-20 05:22:49.000000000 +0200
|
|
Petr Lautrbach |
84822b |
+++ openssh-6.3p1/ssh-agent.c 2013-10-07 13:20:36.296298024 +0200
|
|
Petr Lautrbach |
84822b |
@@ -1143,8 +1143,8 @@ main(int ac, char **av)
|
|
Jan F. Chadima |
ea97ff |
sanitise_stdfd();
|
|
Jan F. Chadima |
ea97ff |
|
|
Jan F. Chadima |
ea97ff |
/* drop */
|
|
Jan F. Chadima |
ea97ff |
- setegid(getgid());
|
|
Jan F. Chadima |
ea97ff |
- setgid(getgid());
|
|
Jan F. Chadima |
ea97ff |
+ (void) setegid(getgid());
|
|
Jan F. Chadima |
ea97ff |
+ (void) setgid(getgid());
|
|
Jan F. Chadima |
ea97ff |
|
|
Jan F. Chadima |
ea97ff |
#if defined(HAVE_PRCTL) && defined(PR_SET_DUMPABLE)
|
|
Jan F. Chadima |
ea97ff |
/* Disable ptrace on Linux without sgid bit */
|
|
Petr Lautrbach |
84822b |
diff -up openssh-6.3p1/sshd.c.coverity openssh-6.3p1/sshd.c
|
|
Petr Lautrbach |
84822b |
--- openssh-6.3p1/sshd.c.coverity 2013-07-20 05:21:53.000000000 +0200
|
|
Petr Lautrbach |
84822b |
+++ openssh-6.3p1/sshd.c 2013-10-07 13:20:36.296298024 +0200
|
|
Petr Lautrbach |
84822b |
@@ -699,8 +699,10 @@ privsep_preauth(Authctxt *authctxt)
|
|
Jan F. Chadima |
cff1d0 |
if (getuid() == 0 || geteuid() == 0)
|
|
Jan F. Chadima |
cff1d0 |
privsep_preauth_child();
|
|
Jan F. Chadima |
cff1d0 |
setproctitle("%s", "[net]");
|
|
Jan F. Chadima |
cff1d0 |
- if (box != NULL)
|
|
Jan F. Chadima |
cff1d0 |
+ if (box != NULL) {
|
|
Jan F. Chadima |
cff1d0 |
ssh_sandbox_child(box);
|
|
Petr Lautrbach |
84822b |
+ free(box);
|
|
Jan F. Chadima |
cff1d0 |
+ }
|
|
Jan F. Chadima |
cff1d0 |
|
|
Jan F. Chadima |
cff1d0 |
return 0;
|
|
Jan F. Chadima |
cff1d0 |
}
|
|
Petr Lautrbach |
84822b |
@@ -1345,6 +1347,9 @@ server_accept_loop(int *sock_in, int *so
|
|
Jan F. Chadima |
3b545b |
if (num_listen_socks < 0)
|
|
Jan F. Chadima |
3b545b |
break;
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
+
|
|
Jan F. Chadima |
3b545b |
+ if (fdset != NULL)
|
|
Petr Lautrbach |
84822b |
+ free(fdset);
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
|