From 0e5691f17a69e3516fb6c0bbf9a6a597b0796e64 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Sun, 30 May 2004 07:27:32 +0000 Subject: [PATCH] * getdate.y: Include krb5.h and kadmin.h. (get_date): Drop second argument; always use NULL. * kadmin.h: Include time.h and/or sys/time.h. (get_date): Declare. * kadmin.c (get_date): Don't declare. (kadmin_parse_princ_args, kadmin_parse_policy_args): Drop second argument to get_date. * Makefile.in (LOCALINCLUDES): Define. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16376 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kadmin/cli/ChangeLog | 11 +++++++++++ src/kadmin/cli/Makefile.in | 2 ++ src/kadmin/cli/getdate.y | 8 ++++++-- src/kadmin/cli/kadmin.c | 13 ++++++------- src/kadmin/cli/kadmin.h | 13 +++++++++++++ 5 files changed, 38 insertions(+), 9 deletions(-) diff --git a/src/kadmin/cli/ChangeLog b/src/kadmin/cli/ChangeLog index bd9373086..f454076ad 100644 --- a/src/kadmin/cli/ChangeLog +++ b/src/kadmin/cli/ChangeLog @@ -1,3 +1,14 @@ +2004-05-30 Ken Raeburn + + * getdate.y: Include krb5.h and kadmin.h. + (get_date): Drop second argument; always use NULL. + * kadmin.h: Include time.h and/or sys/time.h. + (get_date): Declare. + * kadmin.c (get_date): Don't declare. + (kadmin_parse_princ_args, kadmin_parse_policy_args): Drop second + argument to get_date. + * Makefile.in (LOCALINCLUDES): Define. + 2003-08-26 Ken Raeburn * getdate.y (bcopy): Don't bother with HAVE_BCOPY and HAVE_MEMCPY diff --git a/src/kadmin/cli/Makefile.in b/src/kadmin/cli/Makefile.in index 1211405b6..64003c16e 100644 --- a/src/kadmin/cli/Makefile.in +++ b/src/kadmin/cli/Makefile.in @@ -8,6 +8,8 @@ PROG_RPATH=$(KRB5_LIBDIR) PROG = kadmin OBJS = kadmin.o kadmin_ct.o ss_wrapper.o getdate.o keytab.o +LOCALINCLUDES=-I$(srcdir) + all:: $(PROG).local $(PROG) $(PROG).local: $(OBJS) $(SS_DEPLIB) $(KADMSRV_DEPLIBS) $(KRB5_BASE_DEPLIBS) diff --git a/src/kadmin/cli/getdate.y b/src/kadmin/cli/getdate.y index afb29b91b..ce1ca5e34 100644 --- a/src/kadmin/cli/getdate.y +++ b/src/kadmin/cli/getdate.y @@ -857,11 +857,15 @@ difftm(a, b) )*60 + (a->tm_sec - b->tm_sec); } +/* For get_date extern declaration compatibility check... yuck. */ +#include +#include "kadmin.h" + time_t -get_date(p, now) +get_date(p) char *p; - struct my_timeb *now; { + struct my_timeb *now = NULL; struct tm *tm, gmt; struct my_timeb ftz; time_t Start; diff --git a/src/kadmin/cli/kadmin.c b/src/kadmin/cli/kadmin.c index eb5468dde..495e75abc 100644 --- a/src/kadmin/cli/kadmin.c +++ b/src/kadmin/cli/kadmin.c @@ -87,7 +87,6 @@ char *getenv(); int exit_status = 0; char *def_realm = NULL; char *whoami = NULL; -time_t get_date(); void *handle = NULL; krb5_context context; @@ -756,7 +755,7 @@ kadmin_parse_princ_args(argc, argv, oprinc, mask, pass, randkey, if (++i > argc - 2) return -1; else { - date = get_date(argv[i], NULL); + date = get_date(argv[i]); if (date == (time_t)-1) { fprintf(stderr, "Invalid date specification \"%s\".\n", argv[i]); @@ -772,7 +771,7 @@ kadmin_parse_princ_args(argc, argv, oprinc, mask, pass, randkey, if (++i > argc - 2) return -1; else { - date = get_date(argv[i], NULL); + date = get_date(argv[i]); if (date == (time_t)-1) { fprintf(stderr, "Invalid date specification \"%s\".\n", argv[i]); @@ -788,7 +787,7 @@ kadmin_parse_princ_args(argc, argv, oprinc, mask, pass, randkey, if (++i > argc - 2) return -1; else { - date = get_date(argv[i], NULL); + date = get_date(argv[i]); if (date == (time_t)-1) { fprintf(stderr, "Invalid date specification \"%s\".\n", argv[i]); @@ -804,7 +803,7 @@ kadmin_parse_princ_args(argc, argv, oprinc, mask, pass, randkey, if (++i > argc - 2) return -1; else { - date = get_date(argv[i], NULL); + date = get_date(argv[i]); if (date == (time_t)-1) { fprintf(stderr, "Invalid date specification \"%s\".\n", argv[i]); @@ -1318,7 +1317,7 @@ kadmin_parse_policy_args(argc, argv, policy, mask, caller) if (++i > argc -2) return -1; else { - date = get_date(argv[i], NULL); + date = get_date(argv[i]); if (date == (time_t)-1) { fprintf(stderr, "Invalid date specification \"%s\".\n", argv[i]); @@ -1333,7 +1332,7 @@ kadmin_parse_policy_args(argc, argv, policy, mask, caller) if (++i > argc - 2) return -1; else { - date = get_date(argv[i], NULL); + date = get_date(argv[i]); if (date == (time_t)-1) { fprintf(stderr, "Invalid date specification \"%s\".\n", argv[i]); diff --git a/src/kadmin/cli/kadmin.h b/src/kadmin/cli/kadmin.h index 4e6e8185f..0b6c8eae5 100644 --- a/src/kadmin/cli/kadmin.h +++ b/src/kadmin/cli/kadmin.h @@ -50,6 +50,19 @@ extern void kadmin_getprivs(int argc, char *argv[]); extern void kadmin_keytab_add(int argc, char *argv[]); extern void kadmin_keytab_remove(int argc, char *argv[]); +#ifdef TIME_WITH_SYS_TIME +#include +#include +#else +#ifdef HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif + +extern time_t get_date(char *); + /* Yucky global variables */ extern krb5_context context; extern char *krb5_defkeyname; -- 2.26.2