|
Jan F. Chadima |
3b545b |
diff -up openssh-5.9p1/auth-pam.c.coverity openssh-5.9p1/auth-pam.c
|
|
Jan F. Chadima |
3b545b |
--- openssh-5.9p1/auth-pam.c.coverity 2009-07-12 14:07:21.000000000 +0200
|
|
Jan F. Chadima |
cff1d0 |
+++ openssh-5.9p1/auth-pam.c 2011-09-14 08:09:47.074520582 +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
|
|
Jan F. Chadima |
3b545b |
diff -up openssh-5.9p1/channels.c.coverity openssh-5.9p1/channels.c
|
|
Jan F. Chadima |
3b545b |
--- openssh-5.9p1/channels.c.coverity 2011-06-23 00:31:57.000000000 +0200
|
|
Jan F. Chadima |
cff1d0 |
+++ openssh-5.9p1/channels.c 2011-09-14 08:09:47.556582810 +0200
|
|
Jan F. Chadima |
3b545b |
@@ -229,11 +229,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;
|
|
Jan F. Chadima |
3b545b |
@@ -248,11 +248,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 |
}
|
|
Jan F. Chadima |
3b545b |
diff -up openssh-5.9p1/clientloop.c.coverity openssh-5.9p1/clientloop.c
|
|
Jan F. Chadima |
3b545b |
--- openssh-5.9p1/clientloop.c.coverity 2011-06-23 00:31:58.000000000 +0200
|
|
Jan F. Chadima |
cff1d0 |
+++ openssh-5.9p1/clientloop.c 2011-09-14 08:17:41.556521887 +0200
|
|
Jan F. Chadima |
cff1d0 |
@@ -1970,14 +1970,15 @@ client_input_global_request(int type, u_
|
|
Jan F. Chadima |
3b545b |
char *rtype;
|
|
Jan F. Chadima |
3b545b |
int want_reply;
|
|
Jan F. Chadima |
3b545b |
int success = 0;
|
|
Jan F. Chadima |
3b545b |
+/* success is still 0 the packet is allways SSH2_MSG_REQUEST_FAILURE, isn't it? */
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
rtype = packet_get_string(NULL);
|
|
Jan F. Chadima |
3b545b |
want_reply = packet_get_char();
|
|
Jan F. Chadima |
cff1d0 |
debug("client_input_global_request: rtype %s want_reply %d",
|
|
Jan F. Chadima |
cff1d0 |
rtype, want_reply);
|
|
Jan F. Chadima |
cff1d0 |
if (want_reply) {
|
|
Jan F. Chadima |
cff1d0 |
- packet_start(success ?
|
|
Jan F. Chadima |
cff1d0 |
- SSH2_MSG_REQUEST_SUCCESS : SSH2_MSG_REQUEST_FAILURE);
|
|
Jan F. Chadima |
cff1d0 |
+ packet_start(/*success ?
|
|
Jan F. Chadima |
cff1d0 |
+ SSH2_MSG_REQUEST_SUCCESS :*/ SSH2_MSG_REQUEST_FAILURE);
|
|
Jan F. Chadima |
cff1d0 |
packet_send();
|
|
Jan F. Chadima |
cff1d0 |
packet_write_wait();
|
|
Jan F. Chadima |
cff1d0 |
}
|
|
Jan F. Chadima |
3b545b |
diff -up openssh-5.9p1/key.c.coverity openssh-5.9p1/key.c
|
|
Jan F. Chadima |
3b545b |
--- openssh-5.9p1/key.c.coverity 2011-05-20 11:03:08.000000000 +0200
|
|
Jan F. Chadima |
cff1d0 |
+++ openssh-5.9p1/key.c 2011-09-14 08:09:47.803458435 +0200
|
|
Jan F. Chadima |
3b545b |
@@ -803,8 +803,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++;
|
|
Jan F. Chadima |
cff1d0 |
diff -up openssh-5.9p1/misc.c.coverity openssh-5.9p1/misc.c
|
|
Jan F. Chadima |
ea97ff |
diff -up openssh-5.9p1/monitor.c.coverity openssh-5.9p1/monitor.c
|
|
Jan F. Chadima |
c870e6 |
--- openssh-5.9p1/monitor.c.coverity 2011-08-05 22:15:18.000000000 +0200
|
|
Jan F. Chadima |
cff1d0 |
+++ openssh-5.9p1/monitor.c 2011-09-14 08:09:47.914584009 +0200
|
|
Jan F. Chadima |
cff1d0 |
@@ -420,7 +420,7 @@ monitor_child_preauth(Authctxt *_authctx
|
|
Jan F. Chadima |
cff1d0 |
}
|
|
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 |
|
|
Jan F. Chadima |
cff1d0 |
if (!authctxt->valid)
|
|
Jan F. Chadima |
ea97ff |
@@ -1161,6 +1161,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 |
|
|
Jan F. Chadima |
ea97ff |
@@ -1182,9 +1186,6 @@ mm_answer_keyallowed(int sock, Buffer *m
|
|
Jan F. Chadima |
ea97ff |
xfree(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);
|
|
Jan F. Chadima |
cff1d0 |
diff -up openssh-5.9p1/monitor_wrap.c.coverity openssh-5.9p1/monitor_wrap.c
|
|
Jan F. Chadima |
cff1d0 |
--- openssh-5.9p1/monitor_wrap.c.coverity 2011-09-14 08:11:36.480500123 +0200
|
|
Jan F. Chadima |
cff1d0 |
+++ openssh-5.9p1/monitor_wrap.c 2011-09-14 08:14:11.279520598 +0200
|
|
Jan F. Chadima |
cff1d0 |
@@ -707,10 +707,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);
|
|
Jan F. Chadima |
ea97ff |
diff -up openssh-5.9p1/openbsd-compat/bindresvport.c.coverity openssh-5.9p1/openbsd-compat/bindresvport.c
|
|
Jan F. Chadima |
c870e6 |
--- openssh-5.9p1/openbsd-compat/bindresvport.c.coverity 2010-12-03 00:50:26.000000000 +0100
|
|
Jan F. Chadima |
cff1d0 |
+++ openssh-5.9p1/openbsd-compat/bindresvport.c 2011-09-14 08:09:48.084459344 +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) {
|
|
Jan F. Chadima |
3b545b |
diff -up openssh-5.9p1/packet.c.coverity openssh-5.9p1/packet.c
|
|
Jan F. Chadima |
3b545b |
--- openssh-5.9p1/packet.c.coverity 2011-05-15 00:58:15.000000000 +0200
|
|
Jan F. Chadima |
cff1d0 |
+++ openssh-5.9p1/packet.c 2011-09-14 08:09:48.184587842 +0200
|
|
Jan F. Chadima |
3b545b |
@@ -1177,6 +1177,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");
|
|
Jan F. Chadima |
3b545b |
@@ -1684,7 +1685,7 @@ void
|
|
Jan F. Chadima |
3b545b |
packet_write_wait(void)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
fd_set *setp;
|
|
Jan F. Chadima |
3b545b |
- int ret, ms_remain;
|
|
Jan F. Chadima |
3b545b |
+ int ret, ms_remain = 0;
|
|
Jan F. Chadima |
3b545b |
struct timeval start, timeout, *timeoutp = NULL;
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
setp = (fd_set *)xcalloc(howmany(active_state->connection_out + 1,
|
|
Jan F. Chadima |
3b545b |
diff -up openssh-5.9p1/progressmeter.c.coverity openssh-5.9p1/progressmeter.c
|
|
Jan F. Chadima |
3b545b |
--- openssh-5.9p1/progressmeter.c.coverity 2006-08-05 04:39:40.000000000 +0200
|
|
Jan F. Chadima |
cff1d0 |
+++ openssh-5.9p1/progressmeter.c 2011-09-14 08:09:48.300586004 +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 |
{
|
|
Jan F. Chadima |
3b545b |
start = last_update = time(NULL);
|
|
Jan F. Chadima |
3b545b |
file = f;
|
|
Jan F. Chadima |
3b545b |
diff -up openssh-5.9p1/progressmeter.h.coverity openssh-5.9p1/progressmeter.h
|
|
Jan F. Chadima |
3b545b |
--- openssh-5.9p1/progressmeter.h.coverity 2006-03-26 05:30:02.000000000 +0200
|
|
Jan F. Chadima |
cff1d0 |
+++ openssh-5.9p1/progressmeter.h 2011-09-14 08:09:48.420645724 +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);
|
|
Jan F. Chadima |
3b545b |
diff -up openssh-5.9p1/scp.c.coverity openssh-5.9p1/scp.c
|
|
Jan F. Chadima |
3b545b |
--- openssh-5.9p1/scp.c.coverity 2011-01-06 12:41:21.000000000 +0100
|
|
Jan F. Chadima |
cff1d0 |
+++ openssh-5.9p1/scp.c 2011-09-14 08:09:48.531505457 +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)
|
|
Jan F. Chadima |
ea97ff |
diff -up openssh-5.9p1/servconf.c.coverity openssh-5.9p1/servconf.c
|
|
Jan F. Chadima |
c870e6 |
--- openssh-5.9p1/servconf.c.coverity 2011-06-23 00:30:03.000000000 +0200
|
|
Jan F. Chadima |
cff1d0 |
+++ openssh-5.9p1/servconf.c 2011-09-14 08:30:17.557468182 +0200
|
|
Jan F. Chadima |
cff1d0 |
@@ -609,7 +609,7 @@ match_cfg_line(char **condition, int lin
|
|
Jan F. Chadima |
cff1d0 |
debug3("checking syntax for 'Match %s'", cp);
|
|
Jan F. Chadima |
cff1d0 |
else
|
|
Jan F. Chadima |
cff1d0 |
debug3("checking match for '%s' user %s host %s addr %s", cp,
|
|
Jan F. Chadima |
cff1d0 |
- user ? user : "(null)", host ? host : "(null)",
|
|
Jan F. Chadima |
cff1d0 |
+ user /* User is not NULL ? user : "(null)" */, host ? host : "(null)",
|
|
Jan F. Chadima |
cff1d0 |
address ? address : "(null)");
|
|
Jan F. Chadima |
cff1d0 |
|
|
Jan F. Chadima |
cff1d0 |
while ((attrib = strdelim(&cp)) && *attrib != '\0') {
|
|
Jan F. Chadima |
ea97ff |
@@ -1171,7 +1171,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++)
|
|
Jan F. Chadima |
cff1d0 |
@@ -1262,8 +1262,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 |
|
|
Jan F. Chadima |
3b545b |
diff -up openssh-5.9p1/serverloop.c.coverity openssh-5.9p1/serverloop.c
|
|
Jan F. Chadima |
3b545b |
--- openssh-5.9p1/serverloop.c.coverity 2011-05-20 11:02:50.000000000 +0200
|
|
Jan F. Chadima |
cff1d0 |
+++ openssh-5.9p1/serverloop.c 2011-09-14 08:09:48.793586380 +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)
|
|
Jan F. Chadima |
3b545b |
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 |
|
|
Jan F. Chadima |
3b545b |
@@ -330,7 +330,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);
|
|
Jan F. Chadima |
3b545b |
@@ -470,7 +470,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);
|
|
Jan F. Chadima |
3b545b |
@@ -583,7 +583,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))
|
|
Jan F. Chadima |
3b545b |
@@ -607,7 +607,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 |
|
|
Jan F. Chadima |
3b545b |
@@ -637,7 +637,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
|
|
Jan F. Chadima |
3b545b |
@@ -735,15 +735,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 |
|
|
Jan F. Chadima |
3b545b |
@@ -937,7 +937,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 |
|
|
Jan F. Chadima |
3b545b |
@@ -990,7 +990,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;
|
|
Jan F. Chadima |
3b545b |
diff -up openssh-5.9p1/sftp-client.c.coverity openssh-5.9p1/sftp-client.c
|
|
Jan F. Chadima |
3b545b |
--- openssh-5.9p1/sftp-client.c.coverity 2010-12-04 23:02:48.000000000 +0100
|
|
Jan F. Chadima |
cff1d0 |
+++ openssh-5.9p1/sftp-client.c 2011-09-14 08:09:48.910470343 +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;
|
|
Jan F. Chadima |
3b545b |
@@ -571,7 +571,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 |
}
|
|
Jan F. Chadima |
3b545b |
@@ -589,7 +589,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 |
|
|
Jan F. Chadima |
3b545b |
@@ -604,7 +604,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 |
|
|
Jan F. Chadima |
3b545b |
@@ -620,7 +620,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 |
|
|
Jan F. Chadima |
3b545b |
@@ -636,7 +636,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 |
|
|
Jan F. Chadima |
3b545b |
@@ -650,7 +650,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 |
|
|
Jan F. Chadima |
3b545b |
@@ -684,7 +684,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 |
|
|
Jan F. Chadima |
3b545b |
@@ -701,7 +701,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;
|
|
Jan F. Chadima |
3b545b |
@@ -718,12 +718,12 @@ 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;
|
|
Jan F. Chadima |
3b545b |
char *filename, *longname;
|
|
Jan F. Chadima |
3b545b |
- Attrib *a;
|
|
Jan F. Chadima |
3b545b |
+/*UNUSED Attrib *a; */
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
expected_id = id = conn->msg_id++;
|
|
Jan F. Chadima |
3b545b |
send_string_request(conn, id, SSH2_FXP_REALPATH, path,
|
|
Jan F. Chadima |
3b545b |
@@ -754,7 +754,7 @@ do_realpath(struct sftp_conn *conn, char
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
filename = buffer_get_string(&msg, NULL);
|
|
Jan F. Chadima |
3b545b |
longname = buffer_get_string(&msg, NULL);
|
|
Jan F. Chadima |
3b545b |
- a = decode_attrib(&msg;;
|
|
Jan F. Chadima |
3b545b |
+ /*a =*/ (void) decode_attrib(&msg;;
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
debug3("SSH_FXP_REALPATH %s -> %s", path, filename);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
@@ -766,7 +766,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;
|
|
Jan F. Chadima |
3b545b |
@@ -800,7 +800,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;
|
|
Jan F. Chadima |
3b545b |
@@ -833,7 +833,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;
|
|
Jan F. Chadima |
3b545b |
@@ -984,7 +984,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,
|
|
Jan F. Chadima |
3b545b |
Attrib *a, int pflag)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
Attrib junk;
|
|
Jan F. Chadima |
3b545b |
@@ -1223,7 +1223,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,
|
|
Jan F. Chadima |
3b545b |
Attrib *dirattrib, int pflag, int printflag, int depth)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
int i, ret = 0;
|
|
Jan F. Chadima |
3b545b |
@@ -1313,7 +1313,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,
|
|
Jan F. Chadima |
3b545b |
Attrib *dirattrib, int pflag, int printflag)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
char *src_canon;
|
|
Jan F. Chadima |
3b545b |
@@ -1331,7 +1331,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;
|
|
Jan F. Chadima |
3b545b |
@@ -1514,7 +1514,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;
|
|
Jan F. Chadima |
3b545b |
@@ -1605,7 +1605,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;
|
|
Jan F. Chadima |
3b545b |
@@ -1622,7 +1622,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;
|
|
Jan F. Chadima |
3b545b |
diff -up openssh-5.9p1/sftp-client.h.coverity openssh-5.9p1/sftp-client.h
|
|
Jan F. Chadima |
3b545b |
--- openssh-5.9p1/sftp-client.h.coverity 2010-12-04 23:02:48.000000000 +0100
|
|
Jan F. Chadima |
cff1d0 |
+++ openssh-5.9p1/sftp-client.h 2011-09-14 08:09:49.021583940 +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 |
*/
|
|
Jan F. Chadima |
3b545b |
-int do_download(struct sftp_conn *, char *, char *, Attrib *, int);
|
|
Jan F. Chadima |
3b545b |
+int do_download(struct sftp_conn *, const char *, const char *, Attrib *, 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 |
*/
|
|
Jan F. Chadima |
3b545b |
-int download_dir(struct sftp_conn *, char *, char *, Attrib *, int, int);
|
|
Jan F. Chadima |
3b545b |
+int download_dir(struct sftp_conn *, const char *, const char *, Attrib *, 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
|
|
Jan F. Chadima |
3b545b |
diff -up openssh-5.9p1/sftp.c.coverity openssh-5.9p1/sftp.c
|
|
Jan F. Chadima |
3b545b |
--- openssh-5.9p1/sftp.c.coverity 2010-12-04 23:02:48.000000000 +0100
|
|
Jan F. Chadima |
cff1d0 |
+++ openssh-5.9p1/sftp.c 2011-09-14 08:09:49.468493585 +0200
|
|
Jan F. Chadima |
ea97ff |
@@ -206,7 +206,7 @@ killchild(int signo)
|
|
Jan F. Chadima |
ea97ff |
{
|
|
Jan F. Chadima |
ea97ff |
if (sshpid > 1) {
|
|
Jan F. Chadima |
ea97ff |
kill(sshpid, SIGTERM);
|
|
Jan F. Chadima |
ea97ff |
- waitpid(sshpid, NULL, 0);
|
|
Jan F. Chadima |
ea97ff |
+ (void) waitpid(sshpid, NULL, 0);
|
|
Jan F. Chadima |
ea97ff |
}
|
|
Jan F. Chadima |
ea97ff |
|
|
Jan F. Chadima |
ea97ff |
_exit(1);
|
|
Jan F. Chadima |
3b545b |
@@ -316,7 +316,7 @@ local_do_ls(const char *args)
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* Strip one path (usually the pwd) from the start of another */
|
|
Jan F. Chadima |
3b545b |
static char *
|
|
Jan F. Chadima |
3b545b |
-path_strip(char *path, char *strip)
|
|
Jan F. Chadima |
3b545b |
+path_strip(const char *path, const char *strip)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
size_t len;
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
@@ -334,7 +334,7 @@ path_strip(char *path, char *strip)
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
static char *
|
|
Jan F. Chadima |
3b545b |
-make_absolute(char *p, char *pwd)
|
|
Jan F. Chadima |
3b545b |
+make_absolute(char *p, const char *pwd)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
char *abs_str;
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
@@ -482,7 +482,7 @@ parse_df_flags(const char *cmd, char **a
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
static int
|
|
Jan F. Chadima |
3b545b |
-is_dir(char *path)
|
|
Jan F. Chadima |
3b545b |
+is_dir(const char *path)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
struct stat sb;
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
@@ -494,7 +494,7 @@ is_dir(char *path)
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
static int
|
|
Jan F. Chadima |
3b545b |
-remote_is_dir(struct sftp_conn *conn, char *path)
|
|
Jan F. Chadima |
3b545b |
+remote_is_dir(struct sftp_conn *conn, const char *path)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
Attrib *a;
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
@@ -508,7 +508,7 @@ remote_is_dir(struct sftp_conn *conn, ch
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* Check whether path returned from glob(..., GLOB_MARK, ...) is a directory */
|
|
Jan F. Chadima |
3b545b |
static int
|
|
Jan F. Chadima |
3b545b |
-pathname_is_dir(char *pathname)
|
|
Jan F. Chadima |
3b545b |
+pathname_is_dir(const char *pathname)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
size_t l = strlen(pathname);
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
@@ -516,7 +516,7 @@ pathname_is_dir(char *pathname)
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
static int
|
|
Jan F. Chadima |
3b545b |
-process_get(struct sftp_conn *conn, char *src, char *dst, char *pwd,
|
|
Jan F. Chadima |
3b545b |
+process_get(struct sftp_conn *conn, const char *src, const char *dst, const char *pwd,
|
|
Jan F. Chadima |
3b545b |
int pflag, int rflag)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
char *abs_src = NULL;
|
|
Jan F. Chadima |
3b545b |
@@ -590,7 +590,7 @@ out:
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
static int
|
|
Jan F. Chadima |
3b545b |
-process_put(struct sftp_conn *conn, char *src, char *dst, char *pwd,
|
|
Jan F. Chadima |
3b545b |
+process_put(struct sftp_conn *conn, const char *src, const char *dst, const char *pwd,
|
|
Jan F. Chadima |
3b545b |
int pflag, int rflag)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
char *tmp_dst = NULL;
|
|
Jan F. Chadima |
3b545b |
@@ -695,7 +695,7 @@ sdirent_comp(const void *aa, const void
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* sftp ls.1 replacement for directories */
|
|
Jan F. Chadima |
3b545b |
static int
|
|
Jan F. Chadima |
3b545b |
-do_ls_dir(struct sftp_conn *conn, char *path, char *strip_path, int lflag)
|
|
Jan F. Chadima |
3b545b |
+do_ls_dir(struct sftp_conn *conn, const char *path, const char *strip_path, int lflag)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
int n;
|
|
Jan F. Chadima |
3b545b |
u_int c = 1, colspace = 0, columns = 1;
|
|
Jan F. Chadima |
3b545b |
@@ -780,10 +780,10 @@ do_ls_dir(struct sftp_conn *conn, char *
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* sftp ls.1 replacement which handles path globs */
|
|
Jan F. Chadima |
3b545b |
static int
|
|
Jan F. Chadima |
3b545b |
-do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path,
|
|
Jan F. Chadima |
3b545b |
+do_globbed_ls(struct sftp_conn *conn, const char *path, const char *strip_path,
|
|
Jan F. Chadima |
3b545b |
int lflag)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
- Attrib *a = NULL;
|
|
Jan F. Chadima |
3b545b |
+/*UNUSED Attrib *a = NULL;*/
|
|
Jan F. Chadima |
3b545b |
char *fname, *lname;
|
|
Jan F. Chadima |
3b545b |
glob_t g;
|
|
Jan F. Chadima |
3b545b |
int err;
|
|
Jan F. Chadima |
3b545b |
@@ -828,7 +828,7 @@ do_globbed_ls(struct sftp_conn *conn, ch
|
|
Jan F. Chadima |
3b545b |
colspace = width / columns;
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
- for (i = 0; g.gl_pathv[i] && !interrupted; i++, a = NULL) {
|
|
Jan F. Chadima |
3b545b |
+ for (i = 0; g.gl_pathv[i] && !interrupted; i++/*, a = NULL*/) {
|
|
Jan F. Chadima |
3b545b |
fname = path_strip(g.gl_pathv[i], strip_path);
|
|
Jan F. Chadima |
3b545b |
if (lflag & LS_LONG_VIEW) {
|
|
Jan F. Chadima |
3b545b |
if (g.gl_statv[i] == NULL) {
|
|
Jan F. Chadima |
3b545b |
@@ -861,7 +861,7 @@ do_globbed_ls(struct sftp_conn *conn, ch
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
static int
|
|
Jan F. Chadima |
3b545b |
-do_df(struct sftp_conn *conn, char *path, int hflag, int iflag)
|
|
Jan F. Chadima |
3b545b |
+do_df(struct sftp_conn *conn, const char *path, int hflag, int iflag)
|
|
Jan F. Chadima |
3b545b |
{
|
|
Jan F. Chadima |
3b545b |
struct sftp_statvfs st;
|
|
Jan F. Chadima |
3b545b |
char s_used[FMT_SCALED_STRSIZE];
|
|
Jan F. Chadima |
ea97ff |
diff -up openssh-5.9p1/ssh-agent.c.coverity openssh-5.9p1/ssh-agent.c
|
|
Jan F. Chadima |
ea97ff |
--- openssh-5.9p1/ssh-agent.c.coverity 2011-06-03 06:14:16.000000000 +0200
|
|
Jan F. Chadima |
cff1d0 |
+++ openssh-5.9p1/ssh-agent.c 2011-09-14 08:09:49.572460295 +0200
|
|
Jan F. Chadima |
ea97ff |
@@ -1147,8 +1147,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 */
|
|
Jan F. Chadima |
3b545b |
diff -up openssh-5.9p1/sshd.c.coverity openssh-5.9p1/sshd.c
|
|
Jan F. Chadima |
3b545b |
--- openssh-5.9p1/sshd.c.coverity 2011-06-23 11:45:51.000000000 +0200
|
|
Jan F. Chadima |
cff1d0 |
+++ openssh-5.9p1/sshd.c 2011-09-14 08:09:49.687509968 +0200
|
|
Jan F. Chadima |
cff1d0 |
@@ -676,8 +676,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);
|
|
Jan F. Chadima |
cff1d0 |
+ xfree(box);
|
|
Jan F. Chadima |
cff1d0 |
+ }
|
|
Jan F. Chadima |
cff1d0 |
|
|
Jan F. Chadima |
cff1d0 |
return 0;
|
|
Jan F. Chadima |
cff1d0 |
}
|
|
Jan F. Chadima |
cff1d0 |
@@ -1302,6 +1304,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)
|
|
Jan F. Chadima |
3b545b |
+ xfree(fdset);
|
|
Jan F. Chadima |
3b545b |
}
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
cff1d0 |
@@ -1774,7 +1779,7 @@ main(int ac, char **av)
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* Chdir to the root directory so that the current disk can be
|
|
Jan F. Chadima |
3b545b |
unmounted if desired. */
|
|
Jan F. Chadima |
3b545b |
- chdir("/");
|
|
Jan F. Chadima |
3b545b |
+ (void) chdir("/");
|
|
Jan F. Chadima |
3b545b |
|
|
Jan F. Chadima |
3b545b |
/* ignore SIGPIPE */
|
|
Jan F. Chadima |
3b545b |
signal(SIGPIPE, SIG_IGN);
|