diff options
author | markm <markm@FreeBSD.org> | 1995-09-07 21:39:00 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 1995-09-07 21:39:00 +0000 |
commit | 2539acf77b018acd7416a9857a14c466e55cd7e8 (patch) | |
tree | 96ff3578d62372822240f11a1567e45b880f3910 /eBones/usr.bin/kadmin/kadmin.c | |
parent | eed9438eb23b62f78af7685dc226228e2bf5c524 (diff) | |
download | FreeBSD-src-2539acf77b018acd7416a9857a14c466e55cd7e8.zip FreeBSD-src-2539acf77b018acd7416a9857a14c466e55cd7e8.tar.gz |
Major cleanup of eBones code:
- Get all functions prototyped or at least defined before use.
- Make code compile (Mostly) clean with -Wall set
- Start to reduce the degree to which DES aka libdes is built in.
- get all functions to the same uniform standard of definition:
int
foo(a, b)
int a;
int *b;
{
:
}
- fix numerous bugs exposed by above processes.
Note - this replaces the previous work which used an unpopular function
definition style.
Diffstat (limited to 'eBones/usr.bin/kadmin/kadmin.c')
-rw-r--r-- | eBones/usr.bin/kadmin/kadmin.c | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/eBones/usr.bin/kadmin/kadmin.c b/eBones/usr.bin/kadmin/kadmin.c index 56f03d0..fd98428 100644 --- a/eBones/usr.bin/kadmin/kadmin.c +++ b/eBones/usr.bin/kadmin/kadmin.c @@ -16,17 +16,24 @@ * NO_MULTIPLE defined. */ +#if 0 #ifndef lint static char rcsid_kadmin_c[] = "BonesHeader: /afs/athena.mit.edu/astaff/project/kerberos/src/kadmin/RCS/kadmin.c,v 4.5 89/09/26 14:17:54 qjb Exp "; #endif lint +#endif +#include <unistd.h> +#include <string.h> #include <stdio.h> +#include <stdlib.h> +#include <time.h> #include <sys/param.h> #include <pwd.h> #include <ss/ss.h> -#include "krb_err.h" -#include "kadm.h" +#include <com_err.h> +#include <krb_err.h> +#include <kadm.h> #define BAD_PW 1 #define GOOD_PW 0 @@ -40,12 +47,12 @@ static char rcsid_kadmin_c[] = #define DONTSWAP 0 #define SWAP 1 -extern int kadm_init_link(); -extern char *error_message(); -extern void krb_set_tkt_string(); - -static void do_init(); -void clean_up(); +static void do_init(int argc, char *argv[]); +void clean_up(void); +int get_password(unsigned long *low, unsigned long *high, char *prompt, + int byteswap); +int get_admin_password(void); +int princ_exists(char *name, char *instance, char *realm); extern ss_request_table admin_cmds; @@ -56,6 +63,7 @@ static char krbrlm[REALM_SZ]; /* current realm being administered */ static int multiple = 0; /* Allow multiple requests per ticket */ #endif +int main(argc, argv) int argc; char *argv[]; @@ -98,7 +106,7 @@ setvals(vals, string) SET_FIELD(KADM_NAME,vals->fields); SET_FIELD(KADM_INST,vals->fields); - if (status = kname_parse(vals->name, vals->instance, realm, string)) { + if ((status = kname_parse(vals->name, vals->instance, realm, string))) { printf("kerberos error: %s\n", krb_err_txt[status]); return status; } @@ -389,12 +397,13 @@ help(argc, argv) printf("\n"); printf("This command exits this program.\n"); } else { - printf("Sorry there is no such command as %s."); - printf(" Type \"help\" for more information. \n", argv[1]); + printf("Sorry there is no such command as %s.", argv[1]); + printf(" Type \"help\" for more information. \n"); } return; } +void go_home(str,x) char *str; int x; @@ -406,7 +415,8 @@ int x; static int inited = 0; -void usage() +void +usage() { fprintf(stderr, "Usage: kadmin [-u admin_name] [-r default_realm]"); #ifndef NO_MULTIPLE @@ -605,7 +615,7 @@ int byteswap; #ifdef NOENCRYPTION bzero((char *) newkey, sizeof(newkey)); #else - des_string_to_key(new_passwd, newkey); + des_string_to_key(new_passwd, &newkey); #endif bzero(new_passwd, sizeof(new_passwd)); |