Add full prototypes for all functions. Fix calls to functions that
authorEzra Peisach <epeisach@mit.edu>
Thu, 20 Jul 1995 17:15:14 +0000 (17:15 +0000)
committerEzra Peisach <epeisach@mit.edu>
Thu, 20 Jul 1995 17:15:14 +0000 (17:15 +0000)
were missing an argument (usually context)

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@6317 dc483132-0cff-0310-8789-dd5450dbe970

src/clients/ksu/ChangeLog
src/clients/ksu/authorization.c
src/clients/ksu/ccache.c
src/clients/ksu/heuristic.c
src/clients/ksu/krb_auth_su.c
src/clients/ksu/ksu.h
src/clients/ksu/main.c

index 361e0c28936d4125e02bc412e8bebd14d52715fa..2262945d68a3836ad5903ebbf71b6dc7a21998a7 100644 (file)
@@ -1,3 +1,17 @@
+Tue Jul 11 11:10:13 1995  Ezra Peisach  <epeisach@kangaroo.mit.edu>
+
+       * 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.
index 8d0ec90a79ab9a00787dc97be23bc8db161ce9eb..c5ca25454fbffd32670e087d4a624675315e4509 100644 (file)
 
 #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 */
                }
index f3dd5e4838ae8e12fe66e23b206453b3acf36267..319c5e06e33d8603bcb7432234ab9f5d88695073 100644 (file)
@@ -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,
index d65fedb985313811e29d2d2434940c7546fb8a78..47306ba8641b238bac438ed66de2dc4f55ae9292 100644 (file)
@@ -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;
 {
index dbd2cdbd5b00438c2706093d96316cc223a80aa6..ea6335f469ea79ed9e8a94ea3b6b3208b86b39b8 100644 (file)
@@ -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
index 5fd836e611be2c5e1a8ace800d184768d0c99ddc..5c24b431cd33f45c013dc3d93e7c270cbd4c1734 100644 (file)
@@ -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))
index 6e930a2fbea018347a70ca696bef62173d2de0a7..319c777c02e69c6a3552b916ab70c1729a858fce 100644 (file)
@@ -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;