From 1854df3ef4bad13a7f71a567cc2878759359387e Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Tue, 3 Jul 2001 11:00:43 +0000 Subject: [PATCH] * v4rcp.c, login.c: Fill in prototypes, declare many functions static. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13550 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/bsd/ChangeLog | 4 ++++ src/appl/bsd/krcp.c | 3 ++- src/appl/bsd/login.c | 48 +++++++++++++++++++++--------------------- src/appl/bsd/v4rcp.c | 23 ++++++++++---------- 4 files changed, 42 insertions(+), 36 deletions(-) diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index f1fed5060..0fdd77181 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,7 @@ +2001-07-03 Ezra Peisach + + * v4rcp.c, login.c: Fill in prototypes, declare many functions static. + 2001-06-22 Ezra Peisach * krlogind.c: Provide daemon prototype if needed. diff --git a/src/appl/bsd/krcp.c b/src/appl/bsd/krcp.c index c882b5300..bf133c2a7 100644 --- a/src/appl/bsd/krcp.c +++ b/src/appl/bsd/krcp.c @@ -887,7 +887,8 @@ void rsource(name, statp) return; } } - (void) sprintf(buf, "D%04lo %d %s\n", statp->st_mode&07777, 0, last); + (void) sprintf(buf, "D%04lo %d %s\n", (long) statp->st_mode&07777, 0, + last); (void) rcmd_stream_write(rem, buf, strlen(buf), 0); if (response() < 0) { closedir(d); diff --git a/src/appl/bsd/login.c b/src/appl/bsd/login.c index c7c0f4423..0a8acf666 100644 --- a/src/appl/bsd/login.c +++ b/src/appl/bsd/login.c @@ -325,18 +325,17 @@ extern int errno; #endif char *getenv(); -void dofork(); +void dofork(void); - - - -void term_init(); -int doremotelogin(), do_krb_login(), rootterm(); -void lgetstr(), getloginname(), checknologin(), sleepexit(); -void dolastlog(), motd(), check_mail(); +char *stypeof(char *); +void term_init(int); +int doremotelogin(char *), do_krb_login(char *, int), rootterm(char *); +void lgetstr(char *, int, char *), getloginname(void), checknologin(void); +void dolastlog(char *, int, char *), motd(void), check_mail(void); +void sleepexit(int); #ifndef HAVE_STRSAVE -char * strsave(); +char * strsave(char *); #endif typedef krb5_sigtype sigtype; @@ -406,7 +405,7 @@ krb5_data tgtname = { #endif /* get flags (listed above) from the profile */ -void login_get_kconf(k) +static void login_get_kconf(k) krb5_context k; { int i, max_i; @@ -451,7 +450,7 @@ static char *salt; struct spwd *spwd; #endif -void lookup_user (name) +static void lookup_user (name) char *name; { pwd = getpwnam (name); @@ -463,7 +462,7 @@ void lookup_user (name) #endif } -int unix_needs_passwd () +static int unix_needs_passwd () { #ifdef HAVE_SHADOW if (spwd) @@ -474,7 +473,7 @@ int unix_needs_passwd () return 1; } -int unix_passwd_okay (pass) +static int unix_passwd_okay (pass) char *pass; { char user_pwcopy[9], *namep; @@ -514,7 +513,7 @@ char tkfile[MAXPATHLEN]; #endif #ifdef KRB4_GET_TICKETS -void k_init (ttyn, realm) +static void k_init (ttyn, realm) char *ttyn; char *realm; #else @@ -571,7 +570,7 @@ void k_init (ttyn) } #ifdef KRB5_GET_TICKETS -int k5_get_password (user_pwstring, pwsize) +static int k5_get_password (user_pwstring, pwsize) char *user_pwstring; unsigned int pwsize; { @@ -594,7 +593,7 @@ int k5_get_password (user_pwstring, pwsize) return 1; } -int try_krb5 (me_p, pass) +static int try_krb5 (me_p, pass) krb5_principal *me_p; char *pass; { @@ -628,7 +627,7 @@ int try_krb5 (me_p, pass) return 1; } -int have_v5_tickets (me) +static int have_v5_tickets (me) krb5_principal *me; { if (krb5_cc_default (kcontext, &ccache)) @@ -643,7 +642,7 @@ int have_v5_tickets (me) #endif /* KRB5_GET_TICKETS */ #ifdef KRB4_CONVERT -int +static int try_convert524(kctx, me, use_ccache) krb5_context kctx; krb5_principal me; @@ -728,7 +727,7 @@ try_convert524(kctx, me, use_ccache) #endif #ifdef KRB4_GET_TICKETS -int +static int try_krb4 (me, user_pwstring, realm) krb5_principal me; char *user_pwstring; @@ -789,7 +788,7 @@ try_krb4 (me, user_pwstring, realm) * * Returns 1 for confirmation, -1 for failure, 0 for uncertainty. */ -int verify_krb_v4_tgt (realm) +static int verify_krb_v4_tgt (realm) char *realm; { char hostname[MAXHOSTNAMELEN], phost[BUFSIZ]; @@ -875,7 +874,7 @@ EGRESS: } #endif /* KRB4_GET_TICKETS */ -void destroy_tickets() +static void destroy_tickets() { #ifdef KRB5_GET_TICKETS krb5_ccache cache; @@ -932,7 +931,7 @@ static int try_afscall (scall) #endif /* SIGSYS */ #endif /* SETPAG */ -void +static void afs_login () { #if defined(KRB4_GET_TICKETS) && defined(SETPAG) @@ -960,7 +959,7 @@ afs_login () #endif /* KRB_RUN_AKLOG */ } -void +static void afs_cleanup () { #ifdef SETPAG @@ -1048,7 +1047,7 @@ int main(argc, argv) sigtype timedout(); char *domain, **envinit, *ttyn, *tty; char tbuf[MAXPATHLEN + 2]; - char *ttyname(), *stypeof(), *crypt(), *getpass(); + char *ttyname(), *crypt(), *getpass(); time_t login_time; int retval; int rewrite_ccache = 1; /*try to write out ccache*/ @@ -1894,6 +1893,7 @@ speed_t b_speeds[] = { void term_init (do_rlogin) +int do_rlogin; { int line_speed = -1; diff --git a/src/appl/bsd/v4rcp.c b/src/appl/bsd/v4rcp.c index 894dc1a5d..65701b5f0 100644 --- a/src/appl/bsd/v4rcp.c +++ b/src/appl/bsd/v4rcp.c @@ -78,10 +78,11 @@ static char sccsid[] = "@(#)rcp.c 5.10 (Berkeley) 9/20/88"; #include -void sink(), source(), rsource(), usage(); +void sink(int, char **), source(int, char **), + rsource(char *, struct stat *), usage(void); /*VARARGS*/ void error(); -int response(); +int response(void); #if !defined(HAVE_UTIMES) int utimes(); #endif @@ -107,7 +108,7 @@ typedef struct { int returned; } *kstream; -kstream kstream_create_rcp_from_fd(read_fd, write_fd, sched, ivec) +static kstream kstream_create_rcp_from_fd(read_fd, write_fd, sched, ivec) int read_fd, write_fd; des_key_schedule *sched; des_cblock *ivec; @@ -129,7 +130,7 @@ kstream kstream_create_rcp_from_fd(read_fd, write_fd, sched, ivec) return tmp; } -kstream kstream_create_from_fd(read_fd, write_fd, sched, session) +static kstream kstream_create_from_fd(read_fd, write_fd, sched, session) int read_fd, write_fd; Key_schedule *sched; des_cblock *session; @@ -146,7 +147,7 @@ kstream kstream_create_from_fd(read_fd, write_fd, sched, session) /* always set to 0 here anyway */ #define kstream_set_buffer_mode(x,y) -int kstream_read(krem, buf, len) +static int kstream_read(krem, buf, len) kstream krem; char *buf; int len; @@ -228,7 +229,7 @@ int kstream_read(krem, buf, len) } } -int kstream_write(krem, buf, len) +static int kstream_write(krem, buf, len) kstream krem; char *buf; int len; @@ -301,15 +302,15 @@ KTEXT_ST ticket; AUTH_DAT kdata; static des_cblock crypt_session_key; char krb_realm[REALM_SZ]; -char **save_argv(), *krb_realmofhost(); +char **save_argv(int, char **), *krb_realmofhost(); #ifndef HAVE_STRSAVE -static char *strsave(); +static char *strsave(char *); #endif #ifdef NOENCRYPTION #define des_read read #define des_write write #else /* !NOENCRYPTION */ -void send_auth(), answer_auth(); +void answer_auth(void); int encryptflag = 0; #endif /* NOENCRYPTION */ #include "rpaths.h" @@ -334,7 +335,7 @@ char *getenv(); struct buffer { int cnt; char *buf; -} *allocbuf(); +} *allocbuf(struct buffer *, int, int); #define NULLBUF (struct buffer *) 0 @@ -453,7 +454,7 @@ int main(argc, argv) return 1; } -void verifydir(cp) +static void verifydir(cp) char *cp; { struct stat stb; -- 2.26.2