--- netkit-rsh-0.17/rcp/rcp.c.warn 2008-03-07 22:53:14 +1000 +++ netkit-rsh-0.17/rcp/rcp.c 2008-03-07 22:53:14 +1000 @@ -435,7 +435,7 @@ source(int argc, char *argv[]) static BUF buffer; BUF *bp; off_t i; - int x, readerr, f, amt; + int x, readerr, f, amt, tmp; char *last, *name, buf[BUFSIZ]; for (x = 0; x < argc; x++) { @@ -475,7 +475,7 @@ notreg: (void)close(f); */ (void)snprintf(buf, sizeof(buf), "T%ld 0 %ld 0\n", stb.st_mtime, stb.st_atime); - (void)write(rem, buf, (int)strlen(buf)); + tmp = write(rem, buf, (int)strlen(buf)); if (response() < 0) { (void)close(f); continue; @@ -483,7 +483,7 @@ notreg: (void)close(f); } (void)snprintf(buf, sizeof(buf), "C%04o %llu %s\n", stb.st_mode&07777, (unsigned long long)(stb.st_size), last); - (void)write(rem, buf, (int)strlen(buf)); + tmp = write(rem, buf, (int)strlen(buf)); if (response() < 0) { (void)close(f); continue; @@ -499,11 +499,11 @@ notreg: (void)close(f); amt = stb.st_size - i; if (readerr == 0 && read(f, bp->buf, amt) != amt) readerr = errno; - (void)write(rem, bp->buf, amt); + tmp = write(rem, bp->buf, amt); } (void)close(f); if (readerr == 0) - (void)write(rem, "", 1); + tmp = write(rem, "", 1); else error("rcp: %s: %s\n", name, strerror(readerr)); (void)response(); @@ -516,6 +516,7 @@ rsource(char *name, struct stat *statp) DIR *dirp; struct dirent *dp; char *last, *vect[1], path[MAXPATHLEN]; + int tmp; if (!(dirp = opendir(name))) { error("rcp: %s: %s\n", name, strerror(errno)); @@ -529,7 +530,7 @@ rsource(char *name, struct stat *statp) if (pflag) { (void)snprintf(path, sizeof(path), "T%ld 0 %ld 0\n", statp->st_mtime, statp->st_atime); - (void)write(rem, path, (int)strlen(path)); + tmp = write(rem, path, (int)strlen(path)); if (response() < 0) { closedir(dirp); return; @@ -537,7 +538,7 @@ rsource(char *name, struct stat *statp) } (void)snprintf(path, sizeof(path), "D%04o %d %s\n", statp->st_mode&07777, 0, last); - (void)write(rem, path, (int)strlen(path)); + tmp = write(rem, path, (int)strlen(path)); if (response() < 0) { closedir(dirp); return; @@ -556,7 +557,7 @@ rsource(char *name, struct stat *statp) source(1, vect); } closedir(dirp); - (void)write(rem, "E\n", 2); + tmp = write(rem, "E\n", 2); (void)response(); } @@ -565,6 +566,7 @@ response(void) { register char *cp; char ch, resp, rbuf[BUFSIZ]; + int tmp; if (read(rem, &resp, sizeof(resp)) != sizeof(resp)) lostconn(0); @@ -585,7 +587,7 @@ response(void) } while (cp < &rbuf[BUFSIZ] && ch != '\n'); if (!iamremote) - write(2, rbuf, cp - rbuf); + tmp = write(2, rbuf, cp - rbuf); ++errs; if (resp == 1) return -1; @@ -619,7 +621,7 @@ sink(int argc, char *argv[]) char ch, *targ; const char *why; int amt, count, exists, first, mask, mode; - int ofd, setimes, targisdir; + int ofd, setimes, targisdir, tmp; char *np, *vect[1], buf[BUFSIZ]; #define atime tv[0] @@ -637,7 +639,7 @@ sink(int argc, char *argv[]) targ = *argv; if (targetshouldbedirectory) verifydir(targ); - (void)write(rem, "", 1); + tmp = write(rem, "", 1); if (stat(targ, &stb) == 0 && (stb.st_mode & S_IFMT) == S_IFDIR) targisdir = 1; for (first = 1;; first = 0) { @@ -655,14 +657,14 @@ sink(int argc, char *argv[]) if (buf[0] == '\01' || buf[0] == '\02') { if (iamremote == 0) - (void)write(2, buf + 1, (int)strlen(buf + 1)); + tmp = write(2, buf + 1, (int)strlen(buf + 1)); if (buf[0] == '\02') exit(1); errs++; continue; } if (buf[0] == 'E') { - (void)write(rem, "", 1); + tmp = write(rem, "", 1); return; } @@ -686,7 +688,7 @@ sink(int argc, char *argv[]) getnum(atime.tv_usec); if (*cp++ != '\0') SCREWUP("atime.usec not delimited"); - (void)write(rem, "", 1); + tmp = write(rem, "", 1); continue; } if (*cp != 'C' && *cp != 'D') { @@ -765,7 +767,7 @@ bad: error("rcp: %s: %s\n", np, strerr } if (exists && pflag) (void)fchmod(ofd, mode); - (void)write(rem, "", 1); + tmp = write(rem, "", 1); if ((bp = allocbuf(&buffer, ofd, BUFSIZ)) == 0) { (void)close(ofd); continue; @@ -825,7 +827,7 @@ bad: error("rcp: %s: %s\n", np, strerr error("rcp: %s: %s\n", np, strerror(werrno)); break; case NO: - (void)write(rem, "", 1); + tmp = write(rem, "", 1); break; case DISPLAYED: break; --- netkit-rsh-0.17/rexec/rexec.c.warn 2008-03-07 22:53:14 +1000 +++ netkit-rsh-0.17/rexec/rexec.c 2008-03-07 22:53:14 +1000 @@ -214,7 +214,7 @@ int main(int argc, char *argv[]) if ( pass_sig && p_to_aux_sock ) { - int sig; + unsigned int sig; if (bsd) { @@ -506,7 +506,8 @@ void safe_write_error(const char *messag int msg_len = strlen(message); /* Ignore error condition--If this doesn't work, not much can be done. */ - (void) write(STDERR_FILENO, message, msg_len); + int tmp; + tmp = write(STDERR_FILENO, message, msg_len); } --- netkit-rsh-0.17/rexec/ruserpass.c.warn 2008-03-07 22:53:14 +1000 +++ netkit-rsh-0.17/rexec/ruserpass.c 2008-03-07 22:53:32 +1000 @@ -76,6 +76,8 @@ static struct toktab { { NULL, 0 } }; +int xruserpass(const char *host, char **aname, char **apass); + int xruserpass(const char *host, char **aname, char **apass) { --- netkit-rsh-0.17/rexecd/rexecd.c.warn 2008-03-07 22:53:14 +1000 +++ netkit-rsh-0.17/rexecd/rexecd.c 2008-03-07 22:53:14 +1000 @@ -124,6 +124,7 @@ main(int argc, char **argv) { struct sockaddr_in from; socklen_t fromlen; + int tmp; (void)argc; @@ -154,7 +155,7 @@ main(int argc, char **argv) sizeof(struct in_addr), AF_INET); if (!h || !h->h_name) { - write(0, "\1Where are you?\n", 16); + tmp = write(0, "\1Where are you?\n", 16); return 1; } /* Be advised that this may be utter nonsense. */ @@ -242,7 +243,7 @@ doit(struct sockaddr_in *fromp) u_short port; const char *theshell; const char *cp2; - int ifd; + int ifd, tmp; #ifdef USE_PAM pam_handle_t *pamh; int pam_error; @@ -393,7 +394,7 @@ doit(struct sockaddr_in *fromp) /* Log successful attempts. */ syslog(LOG_INFO, "login from %.128s as %s", remote, user); - write(2, "\0", 1); + tmp = write(2, "\0", 1); if (port) { /* If we have a port, dup STDERR on that port KRH */ close(2); @@ -443,7 +444,7 @@ doit(struct sockaddr_in *fromp) */ for (ifd = getdtablesize()-1; ifd > 2; ifd--) close(ifd); - execle(theshell, cp2, "-c", cmdbuf, 0, myenviron); + execle(theshell, cp2, "-c", cmdbuf, NULL, myenviron); perror(theshell); exit(1); } @@ -452,8 +453,9 @@ static void fatal(const char *msg) { char x = 1; - write(2, &x, 1); - write(2, msg, strlen(msg)); + int tmp; + tmp = write(2, &x, 1); + tmp = write(2, msg, strlen(msg)); exit(1); } --- netkit-rsh-0.17/rlogin/rlogin.c.warn 2008-03-07 22:53:14 +1000 +++ netkit-rsh-0.17/rlogin/rlogin.c 2008-03-07 22:53:14 +1000 @@ -448,6 +448,7 @@ writer(void) { register int bol, local, n; char c; + int tmp; bol = 1; /* beginning of line */ local = 0; @@ -484,7 +485,7 @@ writer(void) continue; } if (c != escapechar) - write(rem, &escapechar, 1); + tmp = write(rem, &escapechar, 1); } if (write(rem, &c, 1) == 0) { @@ -502,6 +503,7 @@ echo(char c) { register char *p; char buf[8]; + int tmp; p = buf; c &= 0177; @@ -516,7 +518,7 @@ echo(char c) *p++ = c; *p++ = '\r'; *p++ = '\n'; - write(STDOUT_FILENO, buf, p - buf); + tmp = write(STDOUT_FILENO, buf, p - buf); } static void @@ -554,6 +556,7 @@ sendwindow(void) { struct winsize *wp; char obuf[4 + sizeof (struct winsize)]; + int tmp; wp = (struct winsize *)(obuf+4); obuf[0] = (char)0377; /* (char) casts added for 32/64 bit machines */ @@ -565,7 +568,7 @@ sendwindow(void) wp->ws_xpixel = htons(winsize.ws_xpixel); wp->ws_ypixel = htons(winsize.ws_ypixel); - write(rem, obuf, sizeof(obuf)); + tmp = write(rem, obuf, sizeof(obuf)); } /* --- netkit-rsh-0.17/rlogind/network.c.warn 2008-03-07 22:53:14 +1000 +++ netkit-rsh-0.17/rlogind/network.c 2008-03-07 22:53:14 +1000 @@ -150,7 +150,7 @@ network_init(int f, int no_host_check, i int on = 1; char c; char *hname; - int port; + int port, tmp; from.sin_family = AF_INET; fromlen = sizeof (from); @@ -170,7 +170,7 @@ network_init(int f, int no_host_check, i fromp = &from; alarm(60); - read(f, &c, 1); + tmp = read(f, &c, 1); if (c != 0) exit(1); @@ -223,20 +223,22 @@ network_init(int f, int no_host_check, i void network_confirm(void) { assert(confirmed>=0); + int tmp; if (confirmed == 0) { /* do_rlogin may do this */ - write(netf, "", 1); + tmp = write(netf, "", 1); confirmed = 1; /* we sent the null! */ } } void network_anticonfirm(void) { char x='\01'; /* error indicator */ + int tmp; assert(confirmed>=0); if (!confirmed) { - write(netf, &x, 1); + tmp = write(netf, &x, 1); /* * Still not confirmed, but we shouldn't ever get here again * as we should be in the process of crashing. --- netkit-rsh-0.17/rlogind/rlogind.c.warn 2008-03-07 22:53:14 +1000 +++ netkit-rsh-0.17/rlogind/rlogind.c 2008-03-07 22:53:14 +1000 @@ -93,7 +93,7 @@ struct winsize win = { 0, 0, 0, 0 }; void fatal(int f, const char *msg, int syserr) { char buf[BUFSIZ]; - + int tmp; /* * Send out a binary one if we haven't sent the magic null as confirmation. */ @@ -106,7 +106,7 @@ void fatal(int f, const char *msg, int s snprintf(buf, sizeof(buf), "rlogind: %s: %s.\r\n", msg, strerror(errno)); } - write(f, buf, strlen(buf)); + tmp = write(f, buf, strlen(buf)); auth_finish(); exit(1); } @@ -283,6 +283,7 @@ static void protocol(int f, int p) { static void cleanup(int sig) { char *p; (void)sig; + int tmp; p = line + sizeof(_PATH_DEV) - 1; if (logout(p)) logwtmp(p, "", ""); @@ -292,12 +293,12 @@ static void cleanup(int sig) { /* tty end to root.system mode 600 */ chmod(line, 0600); - chown(line, 0, 0); + tmp = chown(line, 0, 0); /* pty end to root.system mode 666 */ *p = 'p'; chmod(line, 0666); - chown(line, 0, 0); + tmp = chown(line, 0, 0); /* all done */ exit(0); @@ -395,7 +396,7 @@ static void doit(int netfd) { int master, pid, on = 1; int authenticated = 0; char *hname; - int hostok; + int hostok, tmp; char lusername[32], rusername[32], termtype[256]; hname = network_init(netfd, no_host_check, &hostok); @@ -421,7 +422,7 @@ static void doit(int netfd) { network_confirm(); if (!hostok) { - write(netfd, "rlogind: Host address mismatch.\r\n", 33); + tmp = write(netfd, "rlogind: Host address mismatch.\r\n", 33); } pid = forkpty(&master, line, NULL, &win); --- netkit-rsh-0.17/rlogind/sockconv.c.warn 1999-10-03 08:50:52 +1100 +++ netkit-rsh-0.17/rlogind/sockconv.c 2008-03-07 22:53:14 +1000 @@ -59,22 +59,22 @@ static char *read_string(int echo, const { char buffer[INPUTSIZE]; char *text; - int charsRead = 0; + int tmp, charsRead = 0; char * nl = "\n\r"; fprintf(stderr,"%s",remark); while (charsRead < (INPUTSIZE - 1)) { - read(0, &buffer[charsRead], 1); + tmp = read(0, &buffer[charsRead], 1); if (buffer[charsRead] == '\r') { - write(1, nl, 2); + tmp = write(1, nl, 2); buffer[charsRead] = '\0'; break; } if (echo) { - write(1, &buffer[charsRead], 1); + tmp = write(1, &buffer[charsRead], 1); } charsRead++; --- netkit-rsh-0.17/rsh/rsh.c.warn 2000-07-23 15:16:24 +1100 +++ netkit-rsh-0.17/rsh/rsh.c 2008-03-07 22:53:14 +1000 @@ -224,7 +224,7 @@ talk(int nflag, long omask, int pid, int register int cc, wc; register char *bp; fd_set readfrom, rembits; - int rfd2_ok, rem_ok; + int rfd2_ok, rem_ok, tmp; char buf[BUFSIZ]; FD_ZERO(&rembits); @@ -286,7 +286,7 @@ done: errno = 0; cc = read(rfd2, buf, sizeof buf); if (cc > 0) - write(2, buf, cc); + tmp = write(2, buf, cc); else if (cc == 0 || errno != EWOULDBLOCK) rfd2_ok = 0; } @@ -294,7 +294,7 @@ done: errno = 0; cc = read(rem, buf, sizeof buf); if (cc > 0) - write(1, buf, cc); + tmp = write(1, buf, cc); else if (cc == 0 || errno != EWOULDBLOCK) rem_ok = 0; } @@ -305,7 +305,8 @@ void sendsig(int signo) { char x = (char) signo; - write(rfd2, &x, 1); + int tmp; + tmp = write(rfd2, &x, 1); } char * --- netkit-rsh-0.17/rshd/rshd.c.warn 2008-03-07 22:53:14 +1000 +++ netkit-rsh-0.17/rshd/rshd.c 2008-03-07 22:53:14 +1000 @@ -125,12 +125,13 @@ static void error(const char *fmt, ...) { va_list ap; char buf[BUFSIZ], *bp = buf; + int tmp; if (sent_null == 0) *bp++ = 1; va_start(ap, fmt); vsnprintf(bp, sizeof(buf)-1, fmt, ap); va_end(ap); - write(2, buf, strlen(buf)); + tmp = write(2, buf, strlen(buf)); } static void fail(const char *errorstr, @@ -174,7 +175,7 @@ static void stderr_parent(int sock, int fd_set ready, readfrom; char buf[BUFSIZ], sig; int one = 1; - int nfd, cc, guys=2; + int nfd, cc, tmp, guys=2; ioctl(pype, FIONBIO, (char *)&one); /* should set s nbio! */ @@ -208,7 +209,7 @@ static void stderr_parent(int sock, int FD_CLR(pype, &readfrom); guys--; } - else write(sock, buf, cc); + else tmp = write(sock, buf, cc); } } @@ -344,7 +345,7 @@ doit(struct sockaddr_in *fromp) int sock = -1; const char *hostname; u_short port; - int pv[2], pid, ifd; + int pv[2], pid, ifd, tmp; signal(SIGINT, SIG_DFL); signal(SIGQUIT, SIG_DFL); @@ -399,7 +400,7 @@ doit(struct sockaddr_in *fromp) exit(1); } - (void) write(2, "\0", 1); + tmp = write(2, "\0", 1); sent_null = 1; if (port) { @@ -455,7 +456,8 @@ doit(struct sockaddr_in *fromp) environ = envinit; if (chdir(pwd->pw_dir) < 0) { - chdir("/"); + int tmp; + tmp = chdir("/"); /* * error("No remote directory.\n"); * exit(1); @@ -495,7 +497,7 @@ doit(struct sockaddr_in *fromp) */ for (ifd = getdtablesize()-1; ifd > 2; ifd--) close(ifd); - execl(theshell, shellname, "-c", cmdbuf, 0); + execl(theshell, shellname, "-c", cmdbuf, NULL); perror(theshell); exit(1); }