From: Ezra Peisach Date: Thu, 20 Jul 1995 17:15:14 +0000 (+0000) Subject: Add full prototypes for all functions. Fix calls to functions that X-Git-Tag: krb5-1.0-beta6~1502 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=66dafe6a2861b807b70d804894e52371a029848f;p=krb5.git Add full prototypes for all functions. Fix calls to functions that were missing an argument (usually context) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6317 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/clients/ksu/ChangeLog b/src/clients/ksu/ChangeLog index 361e0c289..2262945d6 100644 --- a/src/clients/ksu/ChangeLog +++ b/src/clients/ksu/ChangeLog @@ -1,3 +1,17 @@ +Tue Jul 11 11:10:13 1995 Ezra Peisach + + * main.c (main): Remove extraneous argument to call to + krb5_parse_lifetime. Add context argument to call to + plain_dump_principal. + + * authorization.c, heuristic.c, krb_auth_su.c: Add prototypes + for static functions. Add missing arguments to + _dbm_an_to_ln call. + + * ccache.c: Remove prototype declaration of function now defined + in ksu.h + + * ksu.h: Add full prototypes for all functions in program. Fri Jul 7 15:55:14 EDT 1995 Paul Park (pjpark@mit.edu) * Makefile.in - Remove explicit library handling and LDFLAGS. diff --git a/src/clients/ksu/authorization.c b/src/clients/ksu/authorization.c index 8d0ec90a7..c5ca25454 100644 --- a/src/clients/ksu/authorization.c +++ b/src/clients/ksu/authorization.c @@ -27,9 +27,11 @@ #include "ksu.h" -static krb5_error_code _dbm_an_to_ln(); -static krb5_error_code _username_an_to_ln(); -static void auth_cleanup(); +static krb5_error_code _dbm_an_to_ln PROTOTYPE((krb5_context, + krb5_const_principal, const int, char *)); +static krb5_error_code _username_an_to_ln PROTOTYPE((krb5_context, + krb5_const_principal, const int, char *, char *)); +static void auth_cleanup PROTOTYPE((int, FILE *, int, FILE *, char *)); krb5_boolean fowner(fp, uid) FILE *fp; @@ -185,7 +187,7 @@ krb5_error_code krb5_authorization(context, principal, luser, local_realm_name, #endif if (!stat(krb5_lname_file, &statbuf)){ - if ((! _dbm_an_to_ln(principal, strlen(princname), kuser)) && + if ((! _dbm_an_to_ln(context, principal, strlen(princname), kuser)) && (strcmp(kuser, luser) == 0)){ retbool = TRUE; /* found the right one in db */ } diff --git a/src/clients/ksu/ccache.c b/src/clients/ksu/ccache.c index f3dd5e483..319c5e06e 100644 --- a/src/clients/ksu/ccache.c +++ b/src/clients/ksu/ccache.c @@ -35,7 +35,6 @@ copies the default cache into the secondary cache, ************************************************************************/ -krb5_boolean compare_creds(); void show_credential(); /* modifies only the cc_other, the algorithm may look a bit funny, diff --git a/src/clients/ksu/heuristic.c b/src/clients/ksu/heuristic.c index d65fedb98..47306ba86 100644 --- a/src/clients/ksu/heuristic.c +++ b/src/clients/ksu/heuristic.c @@ -32,8 +32,8 @@ get_all_princ_from_file - retrieves all principal names from file pointed to by fp. *******************************************************************/ -void close_time(); -krb5_boolean find_str_in_list(); +static void close_time PROTOTYPE((int, FILE *, int, FILE *)); +static krb5_boolean find_str_in_list PROTOTYPE((char **, char *)); krb5_error_code get_all_princ_from_file (fp, plist) FILE *fp; @@ -278,7 +278,7 @@ get_authorized_princ_names(luser, cmd, princ_list) return 0; } -void close_time(k5users_flag, users_fp, k5login_flag, login_fp) +static void close_time(k5users_flag, users_fp, k5login_flag, login_fp) int k5users_flag; FILE *users_fp; int k5login_flag; @@ -290,7 +290,7 @@ void close_time(k5users_flag, users_fp, k5login_flag, login_fp) } -krb5_boolean find_str_in_list(list , elm) +static krb5_boolean find_str_in_list(list , elm) char **list; char *elm; { diff --git a/src/clients/ksu/krb_auth_su.c b/src/clients/ksu/krb_auth_su.c index dbd2cdbd5..ea6335f46 100644 --- a/src/clients/ksu/krb_auth_su.c +++ b/src/clients/ksu/krb_auth_su.c @@ -499,7 +499,7 @@ krb5_error_code retval; } -static time_t convtime(); +static time_t convtime PROTOTYPE((char *)); krb5_error_code krb5_parse_lifetime (time, len) @@ -574,6 +574,7 @@ convtime(p) return (r); } +#if 0 krb5_error_code get_tgt_via_login_list(context, server, cc, k5login_plist, client, got_it) krb5_context context; @@ -643,6 +644,7 @@ krb5_error_code retval =0; return 0; } +#endif /********************************************************************** returns the principal that is closes to client. plist contains diff --git a/src/clients/ksu/ksu.h b/src/clients/ksu/ksu.h index 5fd836e61..5c24b431c 100644 --- a/src/clients/ksu/ksu.h +++ b/src/clients/ksu/ksu.h @@ -76,21 +76,162 @@ typedef struct opt_info{ int princ; }opt_info; -extern krb5_boolean krb5_auth_check(); -extern krb5_error_code get_best_principal(); -extern void dump_principal (); -extern krb5_boolean krb5_fast_auth(); -extern krb5_boolean krb5_get_tkt_via_passwd (); -extern int gen_sym(); -extern krb5_error_code krb5_authorization(); -extern krb5_error_code k5login_lookup (); -extern krb5_error_code k5users_lookup (); -extern krb5_error_code get_line (); -extern char * get_first_token (); -extern char * get_next_token (); -extern krb5_boolean fowner(); -extern krb5_boolean krb5_find_princ_in_cred_list(); -extern krb5_error_code krb5_find_princ_in_cache(); +/* krb_auth_su.c */ +extern krb5_boolean krb5_auth_check + PROTOTYPE((krb5_context, krb5_principal, char *, opt_info *, + char *, krb5_ccache, int *)); + +extern krb5_boolean krb5_fast_auth + PROTOTYPE((krb5_context, krb5_principal, krb5_principal, char *, + krb5_ccache)); + +extern krb5_boolean krb5_get_tkt_via_passwd + PROTOTYPE((krb5_context, krb5_ccache *, krb5_principal, + krb5_principal, opt_info *, krb5_boolean *)); + +extern void dump_principal + PROTOTYPE((krb5_context, char *, krb5_principal)); + +extern void plain_dump_principal + PROTOTYPE((krb5_context, krb5_principal)); + + +extern krb5_error_code krb5_parse_lifetime + PROTOTYPE((char *, long *)); + +extern krb5_error_code get_best_principal + PROTOTYPE((krb5_context, char **, krb5_principal *)); + +/* ccache.c */ +extern krb5_error_code krb5_ccache_copy + PROTOTYPE((krb5_context, krb5_ccache, char *, krb5_principal, + krb5_ccache *, krb5_boolean *)); + +extern krb5_error_code krb5_store_all_creds + PROTOTYPE((krb5_context, krb5_ccache, krb5_creds **, krb5_creds **)); + +extern krb5_error_code krb5_store_all_creds + PROTOTYPE((krb5_context, krb5_ccache, krb5_creds **, krb5_creds **)); + +extern krb5_boolean compare_creds + PROTOTYPE((krb5_context, krb5_creds *, krb5_creds *)); + +extern krb5_error_code krb5_get_nonexp_tkts + PROTOTYPE((krb5_context, krb5_ccache, krb5_creds ***)); + +extern krb5_error_code krb5_check_exp + PROTOTYPE((krb5_context, krb5_ticket_times)); + +extern char *flags_string PROTOTYPE((krb5_creds *)); + +extern krb5_error_code krb5_get_login_princ + PROTOTYPE((const char *, char ***)); + +extern void show_credential + PROTOTYPE((krb5_context, krb5_creds *, krb5_ccache)); + +extern int gen_sym PROTOTYPE((void)); + +extern krb5_error_code krb5_ccache_overwrite + PROTOTYPE((krb5_context, krb5_ccache, krb5_ccache, krb5_principal)); + +extern krb5_error_code krb5_store_some_creds + PROTOTYPE((krb5_context, krb5_ccache, krb5_creds **, krb5_creds **, + krb5_principal, krb5_boolean *)); + +extern krb5_error_code krb5_ccache_copy_restricted + PROTOTYPE((krb5_context, krb5_ccache, char *, krb5_principal, + krb5_ccache *, krb5_boolean *)); + +extern krb5_error_code krb5_ccache_refresh + PROTOTYPE((krb5_context, krb5_ccache)); + +extern krb5_error_code krb5_ccache_filter + PROTOTYPE((krb5_context, krb5_ccache, krb5_principal)); + +extern krb5_boolean krb5_find_princ_in_cred_list + PROTOTYPE((krb5_context, krb5_creds **, krb5_principal)); + +extern krb5_error_code krb5_find_princ_in_cache + PROTOTYPE((krb5_context, krb5_ccache, krb5_principal, krb5_boolean *)); + +extern void printtime PROTOTYPE((time_t)); + +/* authorization.c */ +extern krb5_boolean fowner PROTOTYPE((FILE *, int)); + +extern krb5_error_code krb5_authorization + PROTOTYPE((krb5_context, krb5_principal, const char *, char *, char *, + krb5_boolean *, char **)); + +extern krb5_error_code k5login_lookup PROTOTYPE((FILE *, char *, + krb5_boolean *)); + +extern krb5_error_code k5users_lookup + PROTOTYPE((FILE *, char *, char *, krb5_boolean *, char **)); + +extern krb5_boolean fcmd_resolve + PROTOTYPE((char *, char ***, char **)); + +extern krb5_boolean cmd_single PROTOTYPE((char *)); + +extern int cmd_arr_cmp_postfix PROTOTYPE((char **, char *)); + +extern int cmd_arr_cmp PROTOTYPE((char **, char *)); + +extern krb5_boolean find_first_cmd_that_exists + PROTOTYPE((char **, char **, char **)); + +extern int match_commands + PROTOTYPE((char *, char *, krb5_boolean *, char **, char **)); + +extern krb5_error_code get_line PROTOTYPE((FILE *, char **)); + +extern char * get_first_token PROTOTYPE((char *, char **)); + +extern char * get_next_token PROTOTYPE((char **)); + +extern krb5_boolean fowner PROTOTYPE((FILE *, int)); + +extern void init_auth_names PROTOTYPE((char *)); + +/* main.c */ +extern void usage PROTOTYPE((void)); + +extern int standard_shell PROTOTYPE((char *)); + +extern krb5_error_code get_params PROTOTYPE((int *, int, char **, char ***)); + +extern char *get_dir_of_file PROTOTYPE((char *)); + +/* heuristic.c */ +extern krb5_error_code get_all_princ_from_file PROTOTYPE((FILE *, char ***)); + +extern krb5_error_code list_union PROTOTYPE((char **, char **, char ***)); + +extern krb5_error_code filter PROTOTYPE((FILE *, char *, char **, char ***)); + +extern krb5_error_code get_authorized_princ_names + PROTOTYPE((const char *, char *, char ***)); + +extern krb5_error_code get_closest_principal + PROTOTYPE((krb5_context, char **, krb5_principal *, krb5_boolean *)); + +extern krb5_error_code find_either_ticket + PROTOTYPE((krb5_context, krb5_ccache, krb5_principal, + krb5_principal, krb5_boolean *)); + +extern krb5_error_code find_ticket + PROTOTYPE((krb5_context, krb5_ccache, krb5_principal, + krb5_principal, krb5_boolean *)); + + +extern krb5_error_code find_princ_in_list + PROTOTYPE((krb5_context, krb5_principal, char **, krb5_boolean *)); + +extern krb5_error_code get_best_princ_for_target + PROTOTYPE((krb5_context, int, int, char *, char *, krb5_ccache, + opt_info *, char *, char *, krb5_principal *, int *)); #ifndef min #define min(a,b) ((a) > (b) ? (b) : (a)) diff --git a/src/clients/ksu/main.c b/src/clients/ksu/main.c index 6e930a2fb..319c777c0 100644 --- a/src/clients/ksu/main.c +++ b/src/clients/ksu/main.c @@ -37,10 +37,9 @@ int quiet = 0; /***********/ #define _DEF_CSH "/bin/csh" -int set_env_var(); -void sweep_up(); -char * ontty(); -void init_auth_names(); +static int set_env_var PROTOTYPE((char *, char *)); +static void sweep_up PROTOTYPE((krb5_context, int, krb5_ccache)); +static char * ontty PROTOTYPE((void)); #ifdef HAVE_STDARG_H void print_status( const char *fmt, ...); #else @@ -172,7 +171,7 @@ char * dir_of_cc_source; switch (option) { case 'r': options.opt |= KDC_OPT_RENEWABLE; - retval = krb5_parse_lifetime(ksu_context, optarg, &options.rlife); + retval = krb5_parse_lifetime(optarg, &options.rlife); if (retval != 0 || options.rlife == 0) { fprintf(stderr, "Bad lifetime value (%s hours?)\n", optarg); errflg++; @@ -204,7 +203,7 @@ char * dir_of_cc_source; quiet =1; break; case 'l': - retval = krb5_parse_lifetime(ksu_context, optarg, &options.lifetime); + retval = krb5_parse_lifetime(optarg, &options.lifetime); if (retval != 0 || options.lifetime == 0) { fprintf(stderr, "Bad lifetime value (%s hours?)\n", optarg); errflg++; @@ -421,7 +420,7 @@ char * dir_of_cc_source; }else{ fprintf(stderr, "GET_best_princ_for_target result-best principal "); - plain_dump_principal (client); + plain_dump_principal (ksu_context, client); fprintf(stderr,"\n"); } } @@ -563,7 +562,7 @@ char * dir_of_cc_source; fprintf(stderr, "Could not get a tgt for "); - plain_dump_principal (client); + plain_dump_principal (ksu_context, client); fprintf(stderr, "\n"); } @@ -863,7 +862,7 @@ char *getusershell(); #endif /* HAVE_GETUSERSHELL */ -char * ontty() +static char * ontty() { char *p, *ttyname(); static char buf[MAXPATHLEN + 4]; @@ -875,7 +874,7 @@ static char buf[MAXPATHLEN + 4]; } -int set_env_var(name, value) +static int set_env_var(name, value) char *name; char *value; { @@ -890,7 +889,7 @@ char * env_var_buf; } -void sweep_up(context, use_source_cache, cc) +static void sweep_up(context, use_source_cache, cc) krb5_context context; int use_source_cache; krb5_ccache cc;