diff --git a/appl/ftp/ftp/cmds.c b/appl/ftp/ftp/cmds.c index 32ffcb640..ea60b4454 100644 --- a/appl/ftp/ftp/cmds.c +++ b/appl/ftp/ftp/cmds.c @@ -1935,7 +1935,7 @@ restart(int argc, char **argv) else { off_t restart_point = atol(argv[1]); printf("restarting at %qd. %s\n", restart_point, - "execute get, put or append to initiate transfer"); + "execute get, put or append to initiate transfer"); } } diff --git a/appl/ftp/ftp/ftp_locl.h b/appl/ftp/ftp/ftp_locl.h index abefd7195..f29761799 100644 --- a/appl/ftp/ftp/ftp_locl.h +++ b/appl/ftp/ftp/ftp_locl.h @@ -118,25 +118,21 @@ #include #endif +#include + #include "ftp_var.h" #include "extern.h" #include "common.h" #include "pathnames.h" +#include + +#include + #include "krb4.h" #include "roken.h" -#ifdef NEED_OPTARG_DECLARATION -extern char *optarg; -#endif -#ifdef NEED_OPTIND_DECLARATION -extern int optind; -#endif -#ifdef NEED_OPTERR_DECLARATION -extern int opterr; -#endif - #if defined(__sun__) && !defined(__svr4) int fclose(FILE*); int pclose(FILE*); diff --git a/appl/ftp/ftp/krb4.c b/appl/ftp/ftp/krb4.c index d42a5acf8..961382be8 100644 --- a/appl/ftp/ftp/krb4.c +++ b/appl/ftp/ftp/krb4.c @@ -375,7 +375,6 @@ sec_write(int fd, char *data, int length) { int len = auth_pbsz; int tx = 0; - int bytes; if(data_prot == prot_clear) return write(fd, data, length); diff --git a/appl/ftp/ftp/krb4.h b/appl/ftp/ftp/krb4.h index d198b56a5..ce62e6a02 100644 --- a/appl/ftp/ftp/krb4.h +++ b/appl/ftp/ftp/krb4.h @@ -41,6 +41,9 @@ #ifndef __KRB4_H__ #define __KRB4_H__ +#include +#include + extern int auth_complete; void sec_status(void); @@ -49,6 +52,17 @@ enum { prot_clear, prot_safe, prot_confidential, prot_private }; void sec_prot(int, char**); +int sec_getc(FILE *F); +int sec_putc(int c, FILE *F); +int sec_fflush(FILE *F); +int sec_read(int fd, void *data, int length); +int sec_write(int fd, char *data, int length); + +int krb4_getc(FILE *F); +int krb4_read(int fd, char *data, int length); + + + void sec_set_protection_level(void); int sec_request_prot(char *level); @@ -57,4 +71,11 @@ void klist(int, char **); void krb4_quit(void); +int krb4_write_enc(FILE *F, char *fmt, va_list ap); +int krb4_read_msg(char *s, int priv); +int krb4_read_mic(char *s); +int krb4_read_enc(char *s); + +int do_klogin(char *host); + #endif /* __KRB4_H__ */ diff --git a/appl/ftp/ftp/main.c b/appl/ftp/ftp/main.c index 7406cbc95..16d8d6c22 100644 --- a/appl/ftp/ftp/main.c +++ b/appl/ftp/ftp/main.c @@ -256,7 +256,7 @@ getcmd(char *name) longest = 0; nmatches = 0; found = 0; - for (c = cmdtab; p = c->c_name; c++) { + for (c = cmdtab; (p = c->c_name); c++) { for (q = name; *q == *p++; q++) if (*q == 0) /* exact match? */ return (c); diff --git a/appl/ftp/ftpd/auth.c b/appl/ftp/ftpd/auth.c index 55028f36e..d35261d4d 100644 --- a/appl/ftp/ftpd/auth.c +++ b/appl/ftp/ftpd/auth.c @@ -41,15 +41,19 @@ RCSID("$Id$"); #endif +#include +#include +#include #ifdef HAVE_SYS_TYPES_H #include #endif #ifdef HAVE_SYS_IOCTL_H #include #endif +#ifdef HAVE_UNISTD_H +#include +#endif -#include -#include #include "extern.h" #include "krb4.h" #include "auth.h" diff --git a/appl/ftp/ftpd/extern.h b/appl/ftp/ftpd/extern.h index aaa709a4c..150e32c90 100644 --- a/appl/ftp/ftpd/extern.h +++ b/appl/ftp/ftpd/extern.h @@ -82,11 +82,12 @@ void user(char *); void yyerror(char *); void kauth(char *, char*); +void klist(void); -int find(char *); +int find(char *); - -int klogin(char *name, char *password); +int do_login(int code, char *passwd); +int klogin(char *name, char *password); const char *ftp_rooted(const char *path); diff --git a/appl/ftp/ftpd/ftpcmd.y b/appl/ftp/ftpd/ftpcmd.y index 8df679467..db63b0299 100644 --- a/appl/ftp/ftpd/ftpcmd.y +++ b/appl/ftp/ftpd/ftpcmd.y @@ -42,43 +42,56 @@ %{ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)ftpcmd.y 8.3 (Berkeley) 4/6/94"; -#else -static char rcsid[] = "$NetBSD: ftpcmd.y,v 1.6 1995/06/03 22:46:45 mycroft Exp $"; -#endif -#endif /* not lint */ #ifdef HAVE_CONFIG_H #include #endif +RCSID("$Id$"); + #ifdef SOCKS #include #endif +#ifdef HAVE_SYS_TYPES_H #include +#endif +#ifdef HAVE_SYS_PARAM_H #include +#endif +#ifdef HAVE_SYS_SOCKET_H #include +#endif +#ifdef HAVE_SYS_STAT_H #include +#endif +#ifdef HAVE_NETINET_IN_H #include +#endif +#ifdef HAVE_ARPA_FTP_H #include +#endif #include #include #include +#ifdef HAVE_PWD_H #include +#endif #include #include #include #include #include +#ifdef HAVE_SYSLOG_H #include +#endif #include +#ifdef HAVE_UNISTD_H #include +#endif #ifdef HAVE_BSD_BSD_H #include @@ -686,7 +699,7 @@ host_port : NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER COMMA NUMBER { - char *a, *p; + char *a; data_dest.sin_family = AF_INET; data_dest.sin_port = htons($9 * 256 + $11); diff --git a/appl/ftp/ftpd/ftpd.c b/appl/ftp/ftpd/ftpd.c index 5616911f8..82c5cac06 100644 --- a/appl/ftp/ftpd/ftpd.c +++ b/appl/ftp/ftpd/ftpd.c @@ -105,6 +105,7 @@ RCSID("$Id$"); #include #include #include +#include #include #ifdef HAVE_SYSLOG_H #include @@ -117,7 +118,7 @@ RCSID("$Id$"); #include #endif -#include +#include #include "pathnames.h" #include "extern.h" @@ -846,12 +847,12 @@ retrieve(char *cmd, char *name) char *cmd; } cmds[] = { /* XXX - make this more general */ - ".tar", "/bin/gtar cPf - ", - ".tar.gz", "/bin/gtar zcPf - ", - ".tar.Z", "/bin/gtar ZcPf - ", - ".gz", "/bin/gzip -c ", - ".Z", "/bin/compress -c ", - NULL, NULL + {".tar", "/bin/gtar cPf - "}, + {".tar.gz", "/bin/gtar zcPf - "}, + {".tar.Z", "/bin/gtar ZcPf - "}, + {".gz", "/bin/gzip -c "}, + {".Z", "/bin/compress -c "}, + {NULL, NULL} }; struct cmds *p; for(p = cmds; p->ext; p++){ diff --git a/appl/ftp/ftpd/kauth.c b/appl/ftp/ftpd/kauth.c index c2a474a47..624fb2434 100644 --- a/appl/ftp/ftpd/kauth.c +++ b/appl/ftp/ftpd/kauth.c @@ -47,8 +47,14 @@ RCSID("$Id$"); #include #include +#ifdef HAVE_SYS_TIME_H #include +#endif +#ifdef HAVE_SYS_TYPES_H #include +#endif + +#include #include #include @@ -57,7 +63,7 @@ RCSID("$Id$"); #include "extern.h" #include "krb4.h" #include "auth.h" - +#include "base64.h" static KTEXT_ST cip; static unsigned int lifetime; diff --git a/appl/ftp/ftpd/popen.c b/appl/ftp/ftpd/popen.c index 3e39f7fcc..c87ebf327 100644 --- a/appl/ftp/ftpd/popen.c +++ b/appl/ftp/ftpd/popen.c @@ -35,14 +35,6 @@ * */ -#ifndef lint -#if 0 -static char sccsid[] = "@(#)popen.c 8.3 (Berkeley) 4/6/94"; -#else -static char xrcsid[] = "$NetBSD: popen.c,v 1.5 1995/04/11 02:45:00 cgd Exp $"; -#endif -#endif /* not lint */ - #ifdef HAVE_CONFIG_H #include RCSID("$Id$"); diff --git a/appl/kx/common.c b/appl/kx/common.c index 87e3bc4c4..570bd3aac 100644 --- a/appl/kx/common.c +++ b/appl/kx/common.c @@ -183,7 +183,8 @@ get_xsockets (int *unix_socket, int *tcp_socket) return -1; } #ifdef TCP_NODELAY - setsockopt (tcpfd, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one)); + setsockopt (tcpfd, IPPROTO_TCP, TCP_NODELAY, (void *)&one, + sizeof(one)); #endif memset (&tcpaddr, 0, sizeof(tcpaddr)); tcpaddr.sin_family = AF_INET; diff --git a/appl/kx/kx.c b/appl/kx/kx.c index 608d1e18b..7f5cd9214 100644 --- a/appl/kx/kx.c +++ b/appl/kx/kx.c @@ -139,7 +139,7 @@ connect_host (char *host, des_cblock *key, des_key_schedule schedule, } #ifdef TCP_NODELAY - setsockopt (s, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one)); + setsockopt (s, IPPROTO_TCP, TCP_NODELAY, (void *)&one, sizeof(one)); #endif if (connect (s, (struct sockaddr *)&thataddr, sizeof(thataddr)) < 0) { @@ -385,14 +385,14 @@ doit (char *host, int passivep, int debugp, int tcpp) fn = active; } if(debugp) - printf ("%d\t%d\t%s\n", getpid(), display_num, xauthfile); + printf ("%u\t%d\t%s\n", (unsigned)getpid(), display_num, xauthfile); else { pid = fork(); if (pid < 0) { fprintf (stderr, "%s: fork: %s\n", prog, strerror(errno)); return 1; } else if (pid > 0) { - printf ("%d\t%d\t%s\n", pid, display_num, xauthfile); + printf ("%u\t%d\t%s\n", (unsigned)pid, display_num, xauthfile); exit (0); } else { fclose(stdout); @@ -429,7 +429,7 @@ doit (char *host, int passivep, int debugp, int tcpp) return 1; } #ifdef TCP_NODELAY - setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one)); + setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, (void *)&one, sizeof(one)); #endif ++nchild; child = fork (); diff --git a/appl/kx/kx.h b/appl/kx/kx.h index 07f73e85c..9c3b3d869 100644 --- a/appl/kx/kx.h +++ b/appl/kx/kx.h @@ -57,6 +57,9 @@ #ifdef HAVE_PWD_H #include #endif +#ifdef HAVE_GRP_H +#include +#endif #ifdef HAVE_SYSLOG_H #include #endif @@ -118,6 +121,10 @@ extern size_t cookie_len; int get_xsockets (int *unix_socket, int *tcp_socket); int connect_local_xsocket (unsigned dnr); +int create_and_write_cookie (char *xauthfile, + u_char *cookie, + size_t sz); +int suspicious_address (int sock, struct sockaddr_in addr); #define KX_PORT 2111 diff --git a/appl/kx/kxd.c b/appl/kx/kxd.c index ea5d1fb7f..2e2bea773 100644 --- a/appl/kx/kxd.c +++ b/appl/kx/kxd.c @@ -188,7 +188,7 @@ doit_conn (int fd, struct sockaddr_in *thataddr, return fatal (sock, msg); } #ifdef TCP_NODELAY - setsockopt (sock, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one)); + setsockopt (sock, IPPROTO_TCP, TCP_NODELAY, (void *)&one, sizeof(one)); #endif if (connect (sock, (struct sockaddr *)thataddr, sizeof(*thataddr)) < 0) { @@ -221,7 +221,6 @@ doit(int sock, int tcpp) des_key_schedule schedule; des_cblock key; int localx, tcpx; - u_int32_t tmp; if (recv_conn (sock, &key, schedule, &thataddr)) return 1; @@ -292,7 +291,8 @@ doit(int sock, int tcpp) return fatal (sock, msg); } #ifdef TCP_NODELAY - setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, &one, sizeof(one)); + setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, (void *)&one, + sizeof(one)); #endif child = fork (); if (child < 0) { diff --git a/appl/otp/otp_locl.h b/appl/otp/otp_locl.h index b4c3d7803..ba44c6a34 100644 --- a/appl/otp/otp_locl.h +++ b/appl/otp/otp_locl.h @@ -49,8 +49,12 @@ #ifdef HAVE_SYS_TYPES_H #include #endif +#ifdef HAVE_UNISTD_H +#include +#endif #ifdef HAVE_PWD_H #include #endif #include +#include #include diff --git a/appl/popper/pop_get_command.c b/appl/popper/pop_get_command.c index d9f83a731..e4a2ca1ea 100644 --- a/appl/popper/pop_get_command.c +++ b/appl/popper/pop_get_command.c @@ -17,28 +17,28 @@ RCSID("$Id$"); */ static state_table states[] = { - auth1, "user", 1, 1, pop_user, {auth1, auth2}, - auth2, "pass", 1, 99, pop_pass, {auth1, trans}, + {auth1, "user", 1, 1, pop_user, {auth1, auth2}}, + {auth2, "pass", 1, 99, pop_pass, {auth1, trans}}, #ifdef RPOP - auth2, "rpop", 1, 1, pop_rpop, {auth1, trans}, + {auth2, "rpop", 1, 1, pop_rpop, {auth1, trans}}, #endif /* RPOP */ - auth1, "quit", 0, 0, pop_quit, {halt, halt}, - auth2, "quit", 0, 0, pop_quit, {halt, halt}, - trans, "stat", 0, 0, pop_stat, {trans, trans}, - trans, "list", 0, 1, pop_list, {trans, trans}, - trans, "retr", 1, 1, pop_send, {trans, trans}, - trans, "dele", 1, 1, pop_dele, {trans, trans}, - trans, "noop", 0, 0, NULL, {trans, trans}, - trans, "rset", 0, 0, pop_rset, {trans, trans}, - trans, "top", 2, 2, pop_send, {trans, trans}, - trans, "last", 0, 0, pop_last, {trans, trans}, - trans, "xtnd", 1, 99, pop_xtnd, {trans, trans}, - trans, "quit", 0, 0, pop_updt, {halt, halt}, - trans, "help", 0, 0, pop_help, {trans, trans}, + {auth1, "quit", 0, 0, pop_quit, {halt, halt}}, + {auth2, "quit", 0, 0, pop_quit, {halt, halt}}, + {trans, "stat", 0, 0, pop_stat, {trans, trans}}, + {trans, "list", 0, 1, pop_list, {trans, trans}}, + {trans, "retr", 1, 1, pop_send, {trans, trans}}, + {trans, "dele", 1, 1, pop_dele, {trans, trans}}, + {trans, "noop", 0, 0, NULL, {trans, trans}}, + {trans, "rset", 0, 0, pop_rset, {trans, trans}}, + {trans, "top", 2, 2, pop_send, {trans, trans}}, + {trans, "last", 0, 0, pop_last, {trans, trans}}, + {trans, "xtnd", 1, 99, pop_xtnd, {trans, trans}}, + {trans, "quit", 0, 0, pop_updt, {halt, halt}}, + {trans, "help", 0, 0, pop_help, {trans, trans}}, #ifdef UIDL - trans, "uidl", 0, 1, pop_uidl, {trans, trans}, + {trans, "uidl", 0, 1, pop_uidl, {trans, trans},} #endif - (state) 0, NULL, 0, 0, NULL, {halt, halt}, + {(state) 0, NULL, 0, 0, NULL, {halt, halt}}, }; state_table * diff --git a/appl/popper/pop_get_subcommand.c b/appl/popper/pop_get_subcommand.c index d5a29b0e3..9a9bb087f 100644 --- a/appl/popper/pop_get_subcommand.c +++ b/appl/popper/pop_get_subcommand.c @@ -17,8 +17,8 @@ RCSID("$Id$"); */ static xtnd_table subcommands[] = { - "xmit", 0, 0, pop_xmit, - NULL + {"xmit", 0, 0, pop_xmit}, + {NULL} }; xtnd_table * diff --git a/appl/popper/pop_init.c b/appl/popper/pop_init.c index d3b0920df..4288e6175 100644 --- a/appl/popper/pop_init.c +++ b/appl/popper/pop_init.c @@ -70,7 +70,7 @@ pop_init(POP *p,int argcount,char **argmessage) int len; int options = 0; int sp = 0; /* Socket pointer */ - char * trace_file_name; + char * trace_file_name = "/tmp/popper-trace"; int inetd = 0; /* Initialize the POP parameter block */ @@ -83,7 +83,7 @@ pop_init(POP *p,int argcount,char **argmessage) k_gethostname(p->myhost,MaxHostNameLen); /* Open the log file */ - (void)openlog(p->myname,POP_LOGOPTS,POP_FACILITY); + openlog(p->myname,POP_LOGOPTS,POP_FACILITY); /* Process command line arguments */ while ((c = getopt(argcount,argmessage, diff --git a/appl/popper/popper.c b/appl/popper/popper.c index fad59523f..52c53f598 100644 --- a/appl/popper/popper.c +++ b/appl/popper/popper.c @@ -62,8 +62,8 @@ main (int argc, char **argv) state_table * s; char message[MAXLINELEN]; - (void) signal(SIGHUP, catchSIGHUP); - (void) signal(SIGPIPE,catchSIGHUP); + signal(SIGHUP, catchSIGHUP); + signal(SIGPIPE, catchSIGHUP); /* Start things rolling */ pop_init(&p,argc,argv); diff --git a/appl/xnlock/xnlock.c b/appl/xnlock/xnlock.c index 11bb00703..4c3c66d4d 100644 --- a/appl/xnlock/xnlock.c +++ b/appl/xnlock/xnlock.c @@ -68,11 +68,10 @@ static Pixel Black, White; static XFontStruct *font; static char root_cpass[16]; static char user_cpass[16]; -static char root_pw[16]; static int time_left, prompt_x, prompt_y, time_x, time_y; static unsigned long interval; static Pixmap left0, left1, right0, right1, left_front, - right_front, front, down; + right_front, front, down; #define MAXLINES 40 diff --git a/lib/des/mdtest.c b/lib/des/mdtest.c index e9d405472..56fe4e5b0 100644 --- a/lib/des/mdtest.c +++ b/lib/des/mdtest.c @@ -51,7 +51,7 @@ int md4_tests () { struct test { - char *str; + unsigned char *str; unsigned char hash[16]; } tests[] = { {"", @@ -93,7 +93,7 @@ int md5_tests () { struct test { - char *str; + unsigned char *str; unsigned char hash[16]; } tests[] = { {"", {0xd4, 0x1d, 0x8c, 0xd9, 0x8f, 0x00, 0xb2, 0x04, 0xe9, 0x80, 0x09, 0x98, 0xec, 0xf8, 0x42, 0x7e}}, @@ -127,7 +127,7 @@ int sha_tests () { struct test { - char *str; + unsigned char *str; unsigned char hash[20]; } tests[] = { {"abc", {0xA9, 0x99, 0x3E, 0x36, 0x47, 0x06, 0x81, 0x6A, diff --git a/lib/otp/otp.h b/lib/otp/otp.h index 0e53faed7..76b6685f2 100644 --- a/lib/otp/otp.h +++ b/lib/otp/otp.h @@ -72,7 +72,7 @@ typedef struct { OtpAlgorithm *otp_find_alg (char *name); void otp_print_stddict (OtpKey key, char *str); void otp_print_hex (OtpKey key, char *str); -unsigned opt_checksum (OtpKey key); +unsigned otp_checksum (OtpKey key); int otp_parse_hex (OtpKey key, char *); int otp_parse_stddict (OtpKey key, char *); int otp_parse_altdict (OtpKey key, char *, OtpAlgorithm *); diff --git a/lib/otp/otp_db.c b/lib/otp/otp_db.c index 338ad5462..d618a6612 100644 --- a/lib/otp/otp_db.c +++ b/lib/otp/otp_db.c @@ -46,7 +46,6 @@ RCSID("$Id$"); void * otp_db_open () { - DBM *ret; int lock; do { diff --git a/lib/otp/otp_md.c b/lib/otp/otp_md.c index a57b4b409..76707dce0 100644 --- a/lib/otp/otp_md.c +++ b/lib/otp/otp_md.c @@ -80,7 +80,6 @@ otp_md_init (OtpKey key, { char *p; int len; - int i; len = strlen(pwd) + strlen(seed); p = malloc (len + 1); diff --git a/lib/otp/otp_parse.c b/lib/otp/otp_parse.c index 64112455e..67f61e6f5 100644 --- a/lib/otp/otp_parse.c +++ b/lib/otp/otp_parse.c @@ -41,6 +41,7 @@ RCSID("$Id$"); #endif +#include #include #include #include diff --git a/lib/otp/otp_print.c b/lib/otp/otp_print.c index 8c625a5f9..e93de8409 100644 --- a/lib/otp/otp_print.c +++ b/lib/otp/otp_print.c @@ -41,6 +41,7 @@ RCSID("$Id$"); #endif +#include #include "otp.h" static char *std_dict[] = diff --git a/lib/roken/mini_inetd.c b/lib/roken/mini_inetd.c index 97bd0f189..99b3f2d18 100644 --- a/lib/roken/mini_inetd.c +++ b/lib/roken/mini_inetd.c @@ -41,6 +41,9 @@ RCSID("$Id$"); #endif +#ifdef HAVE_UNISTD_H +#include +#endif #ifdef HAVE_SYS_TYPES_H #include #endif diff --git a/lib/roken/roken.h b/lib/roken/roken.h index e3f249252..5b4f7ac6b 100644 --- a/lib/roken/roken.h +++ b/lib/roken/roken.h @@ -175,4 +175,14 @@ void mini_inetd (int port); #define LOG_AUTHPRIV LOG_AUTH #endif +#ifdef NEED_OPTARG_DECLARATION +extern char *optarg; +#endif +#ifdef NEED_OPTIND_DECLARATION +extern int optind; +#endif +#ifdef NEED_OPTERR_DECLARATION +extern int opterr; +#endif + #endif /* __ROKEN_H__ */ diff --git a/lib/roken/roken.h.in b/lib/roken/roken.h.in index e3f249252..5b4f7ac6b 100644 --- a/lib/roken/roken.h.in +++ b/lib/roken/roken.h.in @@ -175,4 +175,14 @@ void mini_inetd (int port); #define LOG_AUTHPRIV LOG_AUTH #endif +#ifdef NEED_OPTARG_DECLARATION +extern char *optarg; +#endif +#ifdef NEED_OPTIND_DECLARATION +extern int optind; +#endif +#ifdef NEED_OPTERR_DECLARATION +extern int opterr; +#endif + #endif /* __ROKEN_H__ */