diff options
author | Jacques Vidrine <nectar@FreeBSD.org> | 2002-02-19 15:46:56 +0000 |
---|---|---|
committer | Jacques Vidrine <nectar@FreeBSD.org> | 2002-02-19 15:46:56 +0000 |
commit | 4137ff4cc173ea2e05227027e1c9e0ea42bcc0dc (patch) | |
tree | 85ecf91fd00875cec4b93111d3a8ed9eec9cddfe /crypto/heimdal/kadmin | |
parent | 5a83b025a988368a32c549e5bd9fd3e0478c0198 (diff) | |
download | src-test2-4137ff4cc173ea2e05227027e1c9e0ea42bcc0dc.tar.gz src-test2-4137ff4cc173ea2e05227027e1c9e0ea42bcc0dc.zip |
Notes
Diffstat (limited to 'crypto/heimdal/kadmin')
-rw-r--r-- | crypto/heimdal/kadmin/ChangeLog | 59 | ||||
-rw-r--r-- | crypto/heimdal/kadmin/Makefile.am | 12 | ||||
-rw-r--r-- | crypto/heimdal/kadmin/Makefile.in | 500 | ||||
-rw-r--r-- | crypto/heimdal/kadmin/add-random-users.c | 43 | ||||
-rw-r--r-- | crypto/heimdal/kadmin/ank.c | 16 | ||||
-rw-r--r-- | crypto/heimdal/kadmin/cpw.c | 4 | ||||
-rw-r--r-- | crypto/heimdal/kadmin/ext.c | 11 | ||||
-rw-r--r-- | crypto/heimdal/kadmin/kadmin.c | 10 | ||||
-rw-r--r-- | crypto/heimdal/kadmin/kadmin_locl.h | 11 | ||||
-rw-r--r-- | crypto/heimdal/kadmin/kadmind.8 | 15 | ||||
-rw-r--r-- | crypto/heimdal/kadmin/load.c | 59 | ||||
-rw-r--r-- | crypto/heimdal/kadmin/server.c | 6 | ||||
-rw-r--r-- | crypto/heimdal/kadmin/util.c | 94 |
13 files changed, 490 insertions, 350 deletions
diff --git a/crypto/heimdal/kadmin/ChangeLog b/crypto/heimdal/kadmin/ChangeLog index ccc615edcaae..39cd386687e7 100644 --- a/crypto/heimdal/kadmin/ChangeLog +++ b/crypto/heimdal/kadmin/ChangeLog @@ -1,3 +1,62 @@ +2002-02-11 Johan Danielsson <joda@pdc.kth.se> + + * ext.c: no need to use the "modify" keytab anymore + +2001-09-20 Assar Westerlund <assar@sics.se> + + * add-random-users.c: allocate several buffers for the list of + words, instead of one strdup per word (running under efence does + not work very well otherwise) + +2001-09-13 Assar Westerlund <assar@sics.se> + + * add-random-users.c: allow specifying the number of users to + create + +2001-08-24 Assar Westerlund <assar@sics.se> + + * Makefile.am: rename variable name to avoid error from current + automake + +2001-08-22 Assar Westerlund <assar@sics.se> + + * kadmin_locl.h: include libutil.h if it exists + +2001-08-10 Johan Danielsson <joda@pdc.kth.se> + + * util.c: do something to handle C-c in prompts + + * load.c: remove unused etypes code, and add parsing of the + generation field + + * ank.c: add a --use-defaults option to just use default values + without questions + + * kadmin.c: add "del" alias for delete + + * cpw.c: call this operation "passwd" in usage + + * kadmin_locl.h: prototype for set_defaults + + * util.c (edit_entry): move setting of default values to a + separate function, set_defaults + +2001-08-01 Johan Danielsson <joda@pdc.kth.se> + + * kadmin.c: print help message on bad options + +2001-07-31 Assar Westerlund <assar@sics.se> + + * add-random-users.c (main): handle --version + +2001-07-30 Johan Danielsson <joda@pdc.kth.se> + + * load.c: increase line buffer to 8k + +2001-06-12 Assar Westerlund <assar@sics.se> + + * ext.c (ext_keytab): use the default modify keytab per default + 2001-05-17 Assar Westerlund <assar@sics.se> * kadm_conn.c (start_server): fix krb5_eai_to_heim_errno call diff --git a/crypto/heimdal/kadmin/Makefile.am b/crypto/heimdal/kadmin/Makefile.am index 585219807807..3e9e4066fb6a 100644 --- a/crypto/heimdal/kadmin/Makefile.am +++ b/crypto/heimdal/kadmin/Makefile.am @@ -1,8 +1,8 @@ -# $Id: Makefile.am,v 1.32 2000/11/15 22:51:12 assar Exp $ +# $Id: Makefile.am,v 1.34 2001/08/28 08:31:26 assar Exp $ include $(top_srcdir)/Makefile.am.common -INCLUDES += $(INCLUDE_readline) $(INCLUDE_krb4) -I$(srcdir)/../lib/krb5 +INCLUDES += $(INCLUDE_readline) $(INCLUDE_krb4) $(INCLUDE_des) -I$(srcdir)/../lib/krb5 sbin_PROGRAMS = kadmin @@ -45,7 +45,7 @@ EXTRA_kadmind_SOURCES = version4.c add_random_users_SOURCES = add-random-users.c -COMMON_LDADD = \ +LDADD_common = \ $(top_builddir)/lib/hdb/libhdb.la \ $(LIB_openldap) \ $(top_builddir)/lib/krb5/libkrb5.la \ @@ -55,7 +55,7 @@ COMMON_LDADD = \ $(DBLIB) kadmind_LDADD = $(KRB4LIB) $(top_builddir)/lib/kadm5/libkadm5srv.la \ - $(COMMON_LDADD) \ + $(LDADD_common) \ $(LIB_pidfile) \ $(LIB_dlopen) @@ -64,11 +64,11 @@ kadmin_LDADD = \ $(top_builddir)/lib/kadm5/libkadm5srv.la \ $(top_builddir)/lib/sl/libsl.la \ $(LIB_readline) \ - $(COMMON_LDADD) \ + $(LDADD_common) \ $(LIB_dlopen) add_random_users_LDADD = \ $(top_builddir)/lib/kadm5/libkadm5clnt.la \ $(top_builddir)/lib/kadm5/libkadm5srv.la \ - $(COMMON_LDADD) \ + $(LDADD_common) \ $(LIB_dlopen) diff --git a/crypto/heimdal/kadmin/Makefile.in b/crypto/heimdal/kadmin/Makefile.in index dd2ec1371e7d..34bf50f721a8 100644 --- a/crypto/heimdal/kadmin/Makefile.in +++ b/crypto/heimdal/kadmin/Makefile.in @@ -1,6 +1,6 @@ -# Makefile.in generated automatically by automake 1.4b from Makefile.am +# Makefile.in generated automatically by automake 1.5 from Makefile.am. -# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -11,6 +11,16 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. +@SET_MAKE@ + +# $Id: Makefile.am,v 1.34 2001/08/28 08:31:26 assar Exp $ + + +# $Id: Makefile.am.common,v 1.3 1999/04/01 14:58:43 joda Exp $ + + +# $Id: Makefile.am.common,v 1.31 2001/09/01 11:12:18 assar Exp $ + SHELL = @SHELL@ srcdir = @srcdir@ @@ -31,11 +41,9 @@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include - pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ - top_builddir = .. ACLOCAL = @ACLOCAL@ @@ -47,21 +55,17 @@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_FLAG = +INSTALL_HEADER = $(INSTALL_DATA) transform = @program_transform_name@ - NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : - -@SET_MAKE@ host_alias = @host_alias@ host_triplet = @host@ AIX_EXTRA_KAFS = @AIX_EXTRA_KAFS@ -AMDEP = @AMDEP@ AMTAR = @AMTAR@ AS = @AS@ AWK = @AWK@ @@ -69,11 +73,11 @@ CANONICAL_HOST = @CANONICAL_HOST@ CATMAN = @CATMAN@ CATMANEXT = @CATMANEXT@ CC = @CC@ +COMPILE_ET = @COMPILE_ET@ CPP = @CPP@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ DBLIB = @DBLIB@ DEPDIR = @DEPDIR@ +DIR_com_err = @DIR_com_err@ DIR_des = @DIR_des@ DIR_roken = @DIR_roken@ DLLTOOL = @DLLTOOL@ @@ -82,20 +86,27 @@ EXTRA_LIB45 = @EXTRA_LIB45@ GROFF = @GROFF@ INCLUDES_roken = @INCLUDES_roken@ INCLUDE_ = @INCLUDE_@ +INCLUDE_des = @INCLUDE_des@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LEX = @LEX@ LIBOBJS = @LIBOBJS@ LIBTOOL = @LIBTOOL@ LIB_ = @LIB_@ LIB_AUTH_SUBDIRS = @LIB_AUTH_SUBDIRS@ +LIB_NDBM = @LIB_NDBM@ +LIB_com_err = @LIB_com_err@ +LIB_com_err_a = @LIB_com_err_a@ +LIB_com_err_so = @LIB_com_err_so@ LIB_des = @LIB_des@ +LIB_des_a = @LIB_des_a@ LIB_des_appl = @LIB_des_appl@ +LIB_des_so = @LIB_des_so@ LIB_kdb = @LIB_kdb@ LIB_otp = @LIB_otp@ LIB_roken = @LIB_roken@ LIB_security = @LIB_security@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ NEED_WRITEAUTH_FALSE = @NEED_WRITEAUTH_FALSE@ NEED_WRITEAUTH_TRUE = @NEED_WRITEAUTH_TRUE@ NROFF = @NROFF@ @@ -103,38 +114,32 @@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ RANLIB = @RANLIB@ -STRIP = @STRIP@ VERSION = @VERSION@ VOID_RETSIGTYPE = @VOID_RETSIGTYPE@ WFLAGS = @WFLAGS@ WFLAGS_NOIMPLICITINT = @WFLAGS_NOIMPLICITINT@ WFLAGS_NOUNUSED = @WFLAGS_NOUNUSED@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ YACC = @YACC@ +am__include = @am__include@ +am__quote = @am__quote@ dpagaix_CFLAGS = @dpagaix_CFLAGS@ dpagaix_LDADD = @dpagaix_LDADD@ install_sh = @install_sh@ -# $Id: Makefile.am,v 1.32 2000/11/15 22:51:12 assar Exp $ - - -# $Id: Makefile.am.common,v 1.3 1999/04/01 14:58:43 joda Exp $ - - -# $Id: Makefile.am.common,v 1.26 2001/05/21 13:27:48 joda Exp $ - - -AUTOMAKE_OPTIONS = foreign no-dependencies +AUTOMAKE_OPTIONS = foreign no-dependencies 1.4b SUFFIXES = .et .h .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .x -INCLUDES = -I$(top_builddir)/include $(INCLUDES_roken) $(INCLUDE_readline) $(INCLUDE_krb4) -I$(srcdir)/../lib/krb5 +INCLUDES = -I$(top_builddir)/include $(INCLUDES_roken) $(INCLUDE_readline) $(INCLUDE_krb4) $(INCLUDE_des) -I$(srcdir)/../lib/krb5 -AM_CFLAGS = $(WFLAGS) +AM_CFLAGS = $(WFLAGS) CP = cp -COMPILE_ET = $(top_builddir)/lib/com_err/compile_et - buildinclude = $(top_builddir)/include LIB_XauReadAuth = @LIB_XauReadAuth@ @@ -152,8 +157,8 @@ LIB_getsockopt = @LIB_getsockopt@ LIB_logout = @LIB_logout@ LIB_logwtmp = @LIB_logwtmp@ LIB_odm_initialize = @LIB_odm_initialize@ +LIB_openpty = @LIB_openpty@ LIB_pidfile = @LIB_pidfile@ -LIB_readline = @LIB_readline@ LIB_res_search = @LIB_res_search@ LIB_setpcred = @LIB_setpcred@ LIB_setsockopt = @LIB_setsockopt@ @@ -175,18 +180,20 @@ INCLUDE_openldap = @INCLUDE_openldap@ LIB_openldap = @LIB_openldap@ INCLUDE_readline = @INCLUDE_readline@ +LIB_readline = @LIB_readline@ LEXLIB = @LEXLIB@ NROFF_MAN = groff -mandoc -Tascii -@KRB4_TRUE@LIB_kafs = @KRB4_TRUE@$(top_builddir)/lib/kafs/libkafs.la $(AIX_EXTRA_KAFS) +@KRB4_TRUE@LIB_kafs = $(top_builddir)/lib/kafs/libkafs.la $(AIX_EXTRA_KAFS) -@KRB5_TRUE@LIB_krb5 = @KRB5_TRUE@$(top_builddir)/lib/krb5/libkrb5.la \ +@KRB5_TRUE@LIB_krb5 = $(top_builddir)/lib/krb5/libkrb5.la \ @KRB5_TRUE@ $(top_builddir)/lib/asn1/libasn1.la -@KRB5_TRUE@LIB_gssapi = @KRB5_TRUE@$(top_builddir)/lib/gssapi/libgssapi.la -@DCE_TRUE@LIB_kdfs = @DCE_TRUE@$(top_builddir)/lib/kdfs/libkdfs.la +@KRB5_TRUE@LIB_gssapi = $(top_builddir)/lib/gssapi/libgssapi.la + +@DCE_TRUE@LIB_kdfs = $(top_builddir)/lib/kdfs/libkdfs.la CHECK_LOCAL = $(PROGRAMS) @@ -216,8 +223,8 @@ kadmin_SOURCES = \ kadmin_locl.h -@KRB4_TRUE@KRB4LIB = @KRB4_TRUE@$(LIB_krb4) -@KRB4_TRUE@version4_c = @KRB4_TRUE@version4.c +@KRB4_TRUE@KRB4LIB = $(LIB_krb4) +@KRB4_TRUE@version4_c = version4.c kadmind_SOURCES = \ kadmind.c \ @@ -231,7 +238,7 @@ EXTRA_kadmind_SOURCES = version4.c add_random_users_SOURCES = add-random-users.c -COMMON_LDADD = \ +LDADD_common = \ $(top_builddir)/lib/hdb/libhdb.la \ $(LIB_openldap) \ $(top_builddir)/lib/krb5/libkrb5.la \ @@ -242,7 +249,7 @@ COMMON_LDADD = \ kadmind_LDADD = $(KRB4LIB) $(top_builddir)/lib/kadm5/libkadm5srv.la \ - $(COMMON_LDADD) \ + $(LDADD_common) \ $(LIB_pidfile) \ $(LIB_dlopen) @@ -252,205 +259,189 @@ kadmin_LDADD = \ $(top_builddir)/lib/kadm5/libkadm5srv.la \ $(top_builddir)/lib/sl/libsl.la \ $(LIB_readline) \ - $(COMMON_LDADD) \ + $(LDADD_common) \ $(LIB_dlopen) add_random_users_LDADD = \ $(top_builddir)/lib/kadm5/libkadm5clnt.la \ $(top_builddir)/lib/kadm5/libkadm5srv.la \ - $(COMMON_LDADD) \ + $(LDADD_common) \ $(LIB_dlopen) subdir = kadmin mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../include/config.h -CONFIG_CLEAN_FILES = -libexec_PROGRAMS = kadmind$(EXEEXT) -noinst_PROGRAMS = add_random_users$(EXEEXT) -sbin_PROGRAMS = kadmin$(EXEEXT) -PROGRAMS = $(libexec_PROGRAMS) $(noinst_PROGRAMS) $(sbin_PROGRAMS) - - -DEFS = @DEFS@ -I. -I$(srcdir) -I../include +CONFIG_HEADER = $(top_builddir)/include/config.h +CONFIG_CLEAN_FILES = +libexec_PROGRAMS = kadmind$(EXEEXT) +noinst_PROGRAMS = add_random_users$(EXEEXT) +sbin_PROGRAMS = kadmin$(EXEEXT) +PROGRAMS = $(libexec_PROGRAMS) $(noinst_PROGRAMS) $(sbin_PROGRAMS) + +am_add_random_users_OBJECTS = add-random-users.$(OBJEXT) +add_random_users_OBJECTS = $(am_add_random_users_OBJECTS) +add_random_users_DEPENDENCIES = \ + $(top_builddir)/lib/kadm5/libkadm5clnt.la \ + $(top_builddir)/lib/kadm5/libkadm5srv.la \ + $(top_builddir)/lib/hdb/libhdb.la \ + $(top_builddir)/lib/krb5/libkrb5.la \ + $(top_builddir)/lib/asn1/libasn1.la +add_random_users_LDFLAGS = +am_kadmin_OBJECTS = ank.$(OBJEXT) cpw.$(OBJEXT) del.$(OBJEXT) \ + del_enctype.$(OBJEXT) dump.$(OBJEXT) ext.$(OBJEXT) \ + get.$(OBJEXT) init.$(OBJEXT) kadmin.$(OBJEXT) load.$(OBJEXT) \ + mod.$(OBJEXT) rename.$(OBJEXT) util.$(OBJEXT) \ + random_password.$(OBJEXT) +kadmin_OBJECTS = $(am_kadmin_OBJECTS) +kadmin_DEPENDENCIES = $(top_builddir)/lib/kadm5/libkadm5clnt.la \ + $(top_builddir)/lib/kadm5/libkadm5srv.la \ + $(top_builddir)/lib/sl/libsl.la \ + $(top_builddir)/lib/hdb/libhdb.la \ + $(top_builddir)/lib/krb5/libkrb5.la \ + $(top_builddir)/lib/asn1/libasn1.la +kadmin_LDFLAGS = +@KRB4_TRUE@am_kadmind_OBJECTS = kadmind.$(OBJEXT) server.$(OBJEXT) \ +@KRB4_TRUE@ version4.$(OBJEXT) kadm_conn.$(OBJEXT) +@KRB4_FALSE@am_kadmind_OBJECTS = kadmind.$(OBJEXT) server.$(OBJEXT) \ +@KRB4_FALSE@ kadm_conn.$(OBJEXT) +kadmind_OBJECTS = $(am_kadmind_OBJECTS) +@KRB4_TRUE@kadmind_DEPENDENCIES = \ +@KRB4_TRUE@ $(top_builddir)/lib/kadm5/libkadm5srv.la \ +@KRB4_TRUE@ $(top_builddir)/lib/hdb/libhdb.la \ +@KRB4_TRUE@ $(top_builddir)/lib/krb5/libkrb5.la \ +@KRB4_TRUE@ $(top_builddir)/lib/asn1/libasn1.la +@KRB4_FALSE@kadmind_DEPENDENCIES = \ +@KRB4_FALSE@ $(top_builddir)/lib/kadm5/libkadm5srv.la \ +@KRB4_FALSE@ $(top_builddir)/lib/hdb/libhdb.la \ +@KRB4_FALSE@ $(top_builddir)/lib/krb5/libkrb5.la \ +@KRB4_FALSE@ $(top_builddir)/lib/asn1/libasn1.la +kadmind_LDFLAGS = + +DEFS = @DEFS@ +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ -X_CFLAGS = @X_CFLAGS@ -X_LIBS = @X_LIBS@ -X_EXTRA_LIBS = @X_EXTRA_LIBS@ -X_PRE_LIBS = @X_PRE_LIBS@ -am_add_random_users_OBJECTS = add-random-users.$(OBJEXT) -add_random_users_OBJECTS = $(am_add_random_users_OBJECTS) -add_random_users_DEPENDENCIES = \ -$(top_builddir)/lib/kadm5/libkadm5clnt.la \ -$(top_builddir)/lib/kadm5/libkadm5srv.la \ -$(top_builddir)/lib/hdb/libhdb.la $(top_builddir)/lib/krb5/libkrb5.la \ -$(top_builddir)/lib/asn1/libasn1.la -add_random_users_LDFLAGS = -am_kadmin_OBJECTS = ank.$(OBJEXT) cpw.$(OBJEXT) del.$(OBJEXT) \ -del_enctype.$(OBJEXT) dump.$(OBJEXT) ext.$(OBJEXT) get.$(OBJEXT) \ -init.$(OBJEXT) kadmin.$(OBJEXT) load.$(OBJEXT) mod.$(OBJEXT) \ -rename.$(OBJEXT) util.$(OBJEXT) random_password.$(OBJEXT) -kadmin_OBJECTS = $(am_kadmin_OBJECTS) -kadmin_DEPENDENCIES = $(top_builddir)/lib/kadm5/libkadm5clnt.la \ -$(top_builddir)/lib/kadm5/libkadm5srv.la \ -$(top_builddir)/lib/sl/libsl.la $(top_builddir)/lib/hdb/libhdb.la \ -$(top_builddir)/lib/krb5/libkrb5.la $(top_builddir)/lib/asn1/libasn1.la -kadmin_LDFLAGS = -@KRB4_FALSE@am_kadmind_OBJECTS = kadmind.$(OBJEXT) server.$(OBJEXT) \ -@KRB4_FALSE@kadm_conn.$(OBJEXT) -@KRB4_TRUE@am_kadmind_OBJECTS = kadmind.$(OBJEXT) server.$(OBJEXT) \ -@KRB4_TRUE@version4.$(OBJEXT) kadm_conn.$(OBJEXT) -kadmind_OBJECTS = $(am_kadmind_OBJECTS) -@KRB4_FALSE@kadmind_DEPENDENCIES = \ -@KRB4_FALSE@$(top_builddir)/lib/kadm5/libkadm5srv.la \ -@KRB4_FALSE@$(top_builddir)/lib/hdb/libhdb.la \ -@KRB4_FALSE@$(top_builddir)/lib/krb5/libkrb5.la \ -@KRB4_FALSE@$(top_builddir)/lib/asn1/libasn1.la -@KRB4_TRUE@kadmind_DEPENDENCIES = \ -@KRB4_TRUE@$(top_builddir)/lib/kadm5/libkadm5srv.la \ -@KRB4_TRUE@$(top_builddir)/lib/hdb/libhdb.la \ -@KRB4_TRUE@$(top_builddir)/lib/krb5/libkrb5.la \ -@KRB4_TRUE@$(top_builddir)/lib/asn1/libasn1.la -kadmind_LDFLAGS = -COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -CFLAGS = @CFLAGS@ +depcomp = +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \ + $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) -LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -DIST_SOURCES = $(add_random_users_SOURCES) $(kadmin_SOURCES) \ -$(kadmind_SOURCES) $(EXTRA_kadmind_SOURCES) -man8dir = $(mandir)/man8 -MANS = $(man_MANS) -depcomp = -DIST_COMMON = ChangeLog Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CFLAGS = @CFLAGS@ +DIST_SOURCES = $(add_random_users_SOURCES) $(kadmin_SOURCES) \ + $(kadmind_SOURCES) $(EXTRA_kadmind_SOURCES) -GZIP_ENV = --best +NROFF = nroff +MANS = $(man_MANS) +DIST_COMMON = ChangeLog Makefile.am Makefile.in SOURCES = $(add_random_users_SOURCES) $(kadmin_SOURCES) $(kadmind_SOURCES) $(EXTRA_kadmind_SOURCES) -OBJECTS = $(am_add_random_users_OBJECTS) $(am_kadmin_OBJECTS) $(am_kadmind_OBJECTS) -all: all-redirect +all: all-am + .SUFFIXES: .SUFFIXES: .et .h .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .x .c .lo .o .obj -$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) $(top_srcdir)/Makefile.am.common $(top_srcdir)/cf/Makefile.am.common - cd $(top_srcdir) && $(AUTOMAKE) --foreign kadmin/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - -mostlyclean-libexecPROGRAMS: - -clean-libexecPROGRAMS: - -test -z "$(libexec_PROGRAMS)" || rm -f $(libexec_PROGRAMS) - -distclean-libexecPROGRAMS: +mostlyclean-libtool: + -rm -f *.lo -maintainer-clean-libexecPROGRAMS: +clean-libtool: + -rm -rf .libs _libs +distclean-libtool: + -rm -f libtool +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/cf/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --foreign kadmin/Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && \ + CONFIG_HEADERS= CONFIG_LINKS= \ + CONFIG_FILES=$(subdir)/$@ $(SHELL) ./config.status install-libexecPROGRAMS: $(libexec_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(libexecdir) @list='$(libexec_PROGRAMS)'; for p in $$list; do \ - if test -f $$p; then \ - f="`echo $$p|sed -e 's/$(EXEEXT)$$//' -e '$(transform)' -e 's/$$/$(EXEEXT)/'`"; \ - echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libexecdir)/$$f"; \ - $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libexecdir)/$$f; \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(libexecdir)/$$f; \ else :; fi; \ done uninstall-libexecPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(libexec_PROGRAMS)'; for p in $$list; do \ - f="`echo $$p|sed -e 's/$(EXEEXT)$$//' -e '$(transform)' -e 's/$$/$(EXEEXT)/'`"; \ + f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(libexecdir)/$$f"; \ rm -f $(DESTDIR)$(libexecdir)/$$f; \ done -mostlyclean-noinstPROGRAMS: +clean-libexecPROGRAMS: + -test -z "$(libexec_PROGRAMS)" || rm -f $(libexec_PROGRAMS) clean-noinstPROGRAMS: -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) - -distclean-noinstPROGRAMS: - -maintainer-clean-noinstPROGRAMS: - -mostlyclean-sbinPROGRAMS: - -clean-sbinPROGRAMS: - -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) - -distclean-sbinPROGRAMS: - -maintainer-clean-sbinPROGRAMS: - install-sbinPROGRAMS: $(sbin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(sbindir) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ - if test -f $$p; then \ - f="`echo $$p|sed -e 's/$(EXEEXT)$$//' -e '$(transform)' -e 's/$$/$(EXEEXT)/'`"; \ - echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(sbindir)/$$f"; \ - $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(sbindir)/$$f; \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(sbindir)/$$f; \ else :; fi; \ done uninstall-sbinPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(sbin_PROGRAMS)'; for p in $$list; do \ - f="`echo $$p|sed -e 's/$(EXEEXT)$$//' -e '$(transform)' -e 's/$$/$(EXEEXT)/'`"; \ + f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \ rm -f $(DESTDIR)$(sbindir)/$$f; \ done -mostlyclean-compile: - -rm -f *.o core *.core - -rm -f *.$(OBJEXT) - -clean-compile: - -distclean-compile: - -rm -f *.tab.c - -maintainer-clean-compile: - -mostlyclean-libtool: - -rm -f *.lo - -clean-libtool: - -rm -rf .libs _libs - -distclean-libtool: - -maintainer-clean-libtool: - -add_random_users$(EXEEXT): $(add_random_users_OBJECTS) $(add_random_users_DEPENDENCIES) +clean-sbinPROGRAMS: + -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS) +add_random_users$(EXEEXT): $(add_random_users_OBJECTS) $(add_random_users_DEPENDENCIES) @rm -f add_random_users$(EXEEXT) $(LINK) $(add_random_users_LDFLAGS) $(add_random_users_OBJECTS) $(add_random_users_LDADD) $(LIBS) - -kadmin$(EXEEXT): $(kadmin_OBJECTS) $(kadmin_DEPENDENCIES) +kadmin$(EXEEXT): $(kadmin_OBJECTS) $(kadmin_DEPENDENCIES) @rm -f kadmin$(EXEEXT) $(LINK) $(kadmin_LDFLAGS) $(kadmin_OBJECTS) $(kadmin_LDADD) $(LIBS) - -kadmind$(EXEEXT): $(kadmind_OBJECTS) $(kadmind_DEPENDENCIES) +kadmind$(EXEEXT): $(kadmind_OBJECTS) $(kadmind_DEPENDENCIES) @rm -f kadmind$(EXEEXT) $(LINK) $(kadmind_LDFLAGS) $(kadmind_OBJECTS) $(kadmind_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + .c.o: - $(COMPILE) -c $< + $(COMPILE) -c `test -f $< || echo '$(srcdir)/'`$< + .c.obj: $(COMPILE) -c `cygpath -w $<` + .c.lo: - $(LTCOMPILE) -c -o $@ $< + $(LTCOMPILE) -c -o $@ `test -f $< || echo '$(srcdir)/'`$< +uninstall-info-am: -install-man8: +man8dir = $(mandir)/man8 +install-man8: $(man8_MANS) $(man_MANS) + @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(man8dir) - @list='$(man8_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ + @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ @@ -465,10 +456,11 @@ install-man8: echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst"; \ $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst; \ done - uninstall-man8: - @list='$(man8_MANS)'; \ - l2='$(man_MANS)'; for i in $$l2; do \ + @$(NORMAL_UNINSTALL) + @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ case "$$i" in \ *.8*) list="$$list $$i" ;; \ esac; \ @@ -481,12 +473,6 @@ uninstall-man8: echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \ rm -f $(DESTDIR)$(man8dir)/$$inst; \ done -install-man: $(MANS) - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-man8 -uninstall-man: - @$(NORMAL_UNINSTALL) - $(MAKE) $(AM_MAKEFLAGS) uninstall-man8 tags: TAGS @@ -515,22 +501,23 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ GTAGS: here=`CDPATH=: && cd $(top_builddir) && pwd` \ && cd $(top_srcdir) \ - && gtags -i $$here - -mostlyclean-tags: - -clean-tags: + && gtags -i $(GTAGS_ARGS) $$here distclean-tags: - -rm -f TAGS ID + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH -maintainer-clean-tags: +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) distdir: $(DISTFILES) @for file in $(DISTFILES); do \ - d=$(srcdir); \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + $(mkinstalldirs) "$(distdir)/$$dir"; \ + fi; \ if test -d $$d/$$file; then \ cp -pR $$d/$$file $(distdir) \ || exit 1; \ @@ -540,98 +527,98 @@ distdir: $(DISTFILES) || exit 1; \ fi; \ done - $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook -info-am: -info: info-am -dvi-am: -dvi: dvi-am + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="${top_distdir}" distdir="$(distdir)" \ + dist-hook check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-local check: check-am -installcheck-am: -installcheck: installcheck-am -install-exec-am: install-libexecPROGRAMS install-sbinPROGRAMS - @$(NORMAL_INSTALL) - $(MAKE) $(AM_MAKEFLAGS) install-exec-hook -install-exec: install-exec-am +all-am: Makefile $(PROGRAMS) $(MANS) all-local -install-data-am: install-man install-data-local -install-data: install-data-am +installdirs: + $(mkinstalldirs) $(DESTDIR)$(libexecdir) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir) -install-am: all-am - @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am -uninstall-am: uninstall-libexecPROGRAMS uninstall-sbinPROGRAMS \ - uninstall-man +install-exec: install-exec-am +install-data: install-data-am uninstall: uninstall-am -all-am: Makefile $(PROGRAMS) $(MANS) all-local -all-redirect: all-am -install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_STRIP_FLAG=-s install -installdirs: - $(mkinstalldirs) $(DESTDIR)$(libexecdir) $(DESTDIR)$(sbindir) \ - $(DESTDIR)$(mandir)/man8 +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: - -rm -f Makefile $(CONFIG_CLEAN_FILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]* maintainer-clean-generic: - -rm -f Makefile.in -mostlyclean-am: mostlyclean-libexecPROGRAMS mostlyclean-noinstPROGRAMS \ - mostlyclean-sbinPROGRAMS mostlyclean-compile \ - mostlyclean-libtool mostlyclean-tags \ - mostlyclean-generic + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am -mostlyclean: mostlyclean-am +clean-am: clean-generic clean-libexecPROGRAMS clean-libtool \ + clean-noinstPROGRAMS clean-sbinPROGRAMS mostlyclean-am -clean-am: clean-libexecPROGRAMS clean-noinstPROGRAMS clean-sbinPROGRAMS \ - clean-compile clean-libtool clean-tags clean-generic \ - mostlyclean-am +distclean: distclean-am -clean: clean-am +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-libtool distclean-tags -distclean-am: distclean-libexecPROGRAMS distclean-noinstPROGRAMS \ - distclean-sbinPROGRAMS distclean-compile \ - distclean-libtool distclean-tags distclean-generic \ - clean-am - -rm -f libtool +dvi: dvi-am -distclean: distclean-am +dvi-am: -maintainer-clean-am: maintainer-clean-libexecPROGRAMS \ - maintainer-clean-noinstPROGRAMS \ - maintainer-clean-sbinPROGRAMS maintainer-clean-compile \ - maintainer-clean-libtool maintainer-clean-tags \ - maintainer-clean-generic distclean-am - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." +info: info-am + +info-am: + +install-data-am: install-data-local install-man + +install-exec-am: install-libexecPROGRAMS install-sbinPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook + +install-info: install-info-am + +install-man: install-man8 + +installcheck-am: maintainer-clean: maintainer-clean-am -.PHONY: mostlyclean-libexecPROGRAMS distclean-libexecPROGRAMS \ -clean-libexecPROGRAMS maintainer-clean-libexecPROGRAMS \ -uninstall-libexecPROGRAMS install-libexecPROGRAMS \ -mostlyclean-noinstPROGRAMS distclean-noinstPROGRAMS \ -clean-noinstPROGRAMS maintainer-clean-noinstPROGRAMS \ -mostlyclean-sbinPROGRAMS distclean-sbinPROGRAMS clean-sbinPROGRAMS \ -maintainer-clean-sbinPROGRAMS uninstall-sbinPROGRAMS \ -install-sbinPROGRAMS mostlyclean-compile distclean-compile \ -clean-compile maintainer-clean-compile mostlyclean-libtool \ -distclean-libtool clean-libtool maintainer-clean-libtool install-man8 \ -uninstall-man8 install-man uninstall-man tags mostlyclean-tags \ -distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ -dvi-am dvi check-local check check-am installcheck-am installcheck \ -install-exec-am install-exec install-data-local install-data-am \ -install-data install-am install uninstall-am uninstall all-local \ -all-redirect all-am all install-strip installdirs mostlyclean-generic \ -distclean-generic clean-generic maintainer-clean-generic clean \ -mostlyclean distclean maintainer-clean +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +uninstall-am: uninstall-info-am uninstall-libexecPROGRAMS uninstall-man \ + uninstall-sbinPROGRAMS + +uninstall-man: uninstall-man8 + +.PHONY: GTAGS all all-am all-local check check-am check-local clean \ + clean-generic clean-libexecPROGRAMS clean-libtool \ + clean-noinstPROGRAMS clean-sbinPROGRAMS distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am info info-am install \ + install-am install-data install-data-am install-data-local \ + install-exec install-exec-am install-info install-info-am \ + install-libexecPROGRAMS install-man install-man8 \ + install-sbinPROGRAMS install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool tags uninstall uninstall-am \ + uninstall-info-am uninstall-libexecPROGRAMS uninstall-man \ + uninstall-man8 uninstall-sbinPROGRAMS install-suid-programs: @@ -761,7 +748,6 @@ check-local:: echo "$$dashes"; \ test "$$failed" -eq 0; \ fi - # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: diff --git a/crypto/heimdal/kadmin/add-random-users.c b/crypto/heimdal/kadmin/add-random-users.c index f0b7f4cd41fd..ebd114945d60 100644 --- a/crypto/heimdal/kadmin/add-random-users.c +++ b/crypto/heimdal/kadmin/add-random-users.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000 Kungliga Tekniska Högskolan + * Copyright (c) 2000 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,12 +33,14 @@ #include "kadmin_locl.h" -RCSID("$Id: add-random-users.c,v 1.3 2001/02/20 01:44:49 assar Exp $"); +RCSID("$Id: add-random-users.c,v 1.6 2001/09/20 09:17:33 assar Exp $"); #define WORDS_FILENAME "/usr/share/dict/words" #define NUSERS 1000 +#define WORDBUF_SIZE 65535 + static unsigned read_words (const char *filename, char ***ret_w) { @@ -46,19 +48,29 @@ read_words (const char *filename, char ***ret_w) FILE *f; char buf[256]; char **w = NULL; + char *wbuf = NULL, *wptr = NULL, *wend = NULL; f = fopen (filename, "r"); if (f == NULL) err (1, "cannot open %s", filename); alloc = n = 0; while (fgets (buf, sizeof(buf), f) != NULL) { + size_t len; + if (buf[strlen (buf) - 1] == '\n') buf[strlen (buf) - 1] = '\0'; if (n >= alloc) { - alloc += 16; + alloc = max(alloc + 16, alloc * 2); w = erealloc (w, alloc * sizeof(char **)); } - w[n++] = estrdup (buf); + len = strlen(buf); + if (wptr + len + 1 >= wend) { + wptr = wbuf = emalloc (WORDBUF_SIZE); + wend = wbuf + WORDBUF_SIZE; + } + memmove (wptr, buf, len + 1); + w[n++] = wptr; + wptr += len + 1; } *ret_w = w; return n; @@ -94,7 +106,7 @@ add_user (krb5_context context, void *kadm_handle, } static void -add_users (unsigned n) +add_users (const char *filename, unsigned n) { krb5_error_code ret; int i; @@ -115,7 +127,7 @@ add_users (unsigned n) if(ret) krb5_err(context, 1, ret, "kadm5_init_with_password"); - nwords = read_words (WORDS_FILENAME, &words); + nwords = read_words (filename, &words); for (i = 0; i < n; ++i) add_user (context, kadm_handle, nwords, words); @@ -137,7 +149,7 @@ usage (int ret) arg_printusage (args, sizeof(args)/sizeof(*args), NULL, - NULL); + "[filename [n]]"); exit (ret); } @@ -145,13 +157,28 @@ int main(int argc, char **argv) { int optind = 0; + int n = NUSERS; + const char *filename = WORDS_FILENAME; setprogname(argv[0]); if(getarg(args, sizeof(args) / sizeof(args[0]), argc, argv, &optind)) usage(1); if (help_flag) usage (0); + if (version_flag) { + print_version(NULL); + return 0; + } srand (0); - add_users (NUSERS); + argc -= optind; + argv += optind; + + if (argc > 0) { + if (argc > 1) + n = atoi(argv[1]); + filename = argv[0]; + } + + add_users (filename, n); return 0; } diff --git a/crypto/heimdal/kadmin/ank.c b/crypto/heimdal/kadmin/ank.c index 129ee66f6723..24977ac5bdd3 100644 --- a/crypto/heimdal/kadmin/ank.c +++ b/crypto/heimdal/kadmin/ank.c @@ -33,7 +33,7 @@ #include "kadmin_locl.h" -RCSID("$Id: ank.c,v 1.21 2000/09/10 19:16:39 joda Exp $"); +RCSID("$Id: ank.c,v 1.22 2001/08/10 08:08:22 joda Exp $"); /* * fetch the default principal corresponding to `princ' @@ -67,6 +67,7 @@ static krb5_error_code add_one_principal (const char *name, int rand_key, int rand_password, + int use_defaults, char *password, krb5_key_data *key_data, const char *max_ticket_life, @@ -108,7 +109,10 @@ add_one_principal (const char *name, KADM5_PRINC_EXPIRE_TIME | KADM5_PW_EXPIRATION; } - edit_entry(&princ, &mask, default_ent, default_mask); + if(use_defaults) + set_defaults(&princ, &mask, default_ent, default_mask); + else + edit_entry(&princ, &mask, default_ent, default_mask); if(rand_key || key_data) { princ.attributes |= KRB5_KDB_DISALLOW_ALL_TIX; mask |= KADM5_ATTRIBUTES; @@ -200,10 +204,11 @@ static struct getargs args[] = { "max renewable lifetime", "lifetime" }, { "attributes", 0, arg_string, NULL, "principal attributes", "attributes"}, - { "expiration-time",0, arg_string, NULL, "Expiration time", + { "expiration-time",0, arg_string, NULL, "expiration time", "time"}, { "pw-expiration-time", 0, arg_string, NULL, - "Password expiration time", "time"} + "password expiration time", "time"}, + { "use-defaults", 0, arg_flag, NULL, "use default values" } }; static int num_args = sizeof(args) / sizeof(args[0]); @@ -232,6 +237,7 @@ add_new_key(int argc, char **argv) char *attributes = NULL; char *expiration = NULL; char *pw_expiration = NULL; + int use_defaults = 0; int i; int num; krb5_key_data key_data[3]; @@ -246,6 +252,7 @@ add_new_key(int argc, char **argv) args[6].value = &attributes; args[7].value = &expiration; args[8].value = &pw_expiration; + args[9].value = &use_defaults; if(getarg(args, num_args, argc, argv, &optind)) { usage (); @@ -284,6 +291,7 @@ add_new_key(int argc, char **argv) for (i = optind; i < argc; ++i) { ret = add_one_principal (argv[i], random_key, random_password, + use_defaults, password, kdp, max_ticket_life, diff --git a/crypto/heimdal/kadmin/cpw.c b/crypto/heimdal/kadmin/cpw.c index 06200d6d3623..50c1cb27ebd8 100644 --- a/crypto/heimdal/kadmin/cpw.c +++ b/crypto/heimdal/kadmin/cpw.c @@ -33,7 +33,7 @@ #include "kadmin_locl.h" -RCSID("$Id: cpw.c,v 1.12 2001/05/07 05:30:23 assar Exp $"); +RCSID("$Id: cpw.c,v 1.13 2001/08/10 08:05:35 joda Exp $"); struct cpw_entry_data { int random_key; @@ -54,7 +54,7 @@ static int num_args = sizeof(args) / sizeof(args[0]); static void usage(void) { - arg_printusage(args, num_args, "cpw", "principal..."); + arg_printusage(args, num_args, "passwd", "principal..."); } static int diff --git a/crypto/heimdal/kadmin/ext.c b/crypto/heimdal/kadmin/ext.c index 6b3f3af64647..c945fea4c44c 100644 --- a/crypto/heimdal/kadmin/ext.c +++ b/crypto/heimdal/kadmin/ext.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "kadmin_locl.h" -RCSID("$Id: ext.c,v 1.6 2001/05/07 05:31:12 assar Exp $"); +RCSID("$Id: ext.c,v 1.8 2002/02/11 14:29:52 joda Exp $"); struct ext_keytab_data { krb5_keytab keytab; @@ -94,10 +94,11 @@ ext_keytab(int argc, char **argv) usage(); return 0; } - if(keytab) - ret = krb5_kt_resolve(context, keytab, &data.keytab); - else + if (keytab == NULL) ret = krb5_kt_default(context, &data.keytab); + else + ret = krb5_kt_resolve(context, keytab, &data.keytab); + if(ret){ krb5_warn(context, ret, "krb5_kt_resolve"); return 0; diff --git a/crypto/heimdal/kadmin/kadmin.c b/crypto/heimdal/kadmin/kadmin.c index 058187cb1f93..ff2eec9407c8 100644 --- a/crypto/heimdal/kadmin/kadmin.c +++ b/crypto/heimdal/kadmin/kadmin.c @@ -34,7 +34,7 @@ #include "kadmin_locl.h" #include <sl.h> -RCSID("$Id: kadmin.c,v 1.38 2001/05/15 06:34:35 assar Exp $"); +RCSID("$Id: kadmin.c,v 1.41 2001/08/10 08:06:13 joda Exp $"); static char *config_file; static char *keyfile; @@ -118,6 +118,7 @@ static SL_cmd commands[] = { "Deletes all principals matching the expressions." }, { "del_entry" }, + { "del" }, { "del_enctype", del_enctype, "del_enctype principal enctype...", "Delete all the mentioned enctypes for principal." @@ -223,16 +224,15 @@ main(int argc, char **argv) krb5_config_section *cf = NULL; kadm5_config_params conf; int optind = 0; - int e; setprogname(argv[0]); ret = krb5_init_context(&context); if (ret) errx (1, "krb5_init_context failed: %d", ret); - - while((e = getarg(args, num_args, argc, argv, &optind))) - errx(1, "error at argument `%s'", argv[optind]); + + if(getarg(args, num_args, argc, argv, &optind)) + usage(1); if (help_flag) usage (0); diff --git a/crypto/heimdal/kadmin/kadmin_locl.h b/crypto/heimdal/kadmin/kadmin_locl.h index 5fc3fb870a96..0cd5d4e78c08 100644 --- a/crypto/heimdal/kadmin/kadmin_locl.h +++ b/crypto/heimdal/kadmin/kadmin_locl.h @@ -32,7 +32,7 @@ */ /* - * $Id: kadmin_locl.h,v 1.36 2001/05/07 05:32:04 assar Exp $ + * $Id: kadmin_locl.h,v 1.40 2001/08/22 20:30:24 assar Exp $ */ #ifndef __ADMIN_LOCL_H__ @@ -75,6 +75,9 @@ #ifdef HAVE_UTIL_H #include <util.h> #endif +#ifdef HAVE_LIBUTIL_H +#include <libutil.h> +#endif #ifdef HAVE_NETDB_H #include <netdb.h> #endif @@ -83,7 +86,7 @@ #endif #include <err.h> #include <roken.h> -#ifdef HAVE_OPENSSL_DES_H +#ifdef HAVE_OPENSSL #include <openssl/des.h> #else #include <des.h> @@ -145,6 +148,8 @@ int edit_deltat (const char *prompt, krb5_deltat *value, int *mask, int bit); int edit_entry(kadm5_principal_ent_t ent, int *mask, kadm5_principal_ent_t default_ent, int default_mask); +void set_defaults(kadm5_principal_ent_t ent, int *mask, + kadm5_principal_ent_t default_ent, int default_mask); int set_entry(krb5_context context, kadm5_principal_ent_t ent, int *mask, @@ -159,8 +164,6 @@ foreach_principal(const char *exp, const char *funcname, void *data); -void get_response(const char *prompt, const char *def, char *buf, size_t len); - int parse_des_key (const char *key_string, krb5_key_data *key_data, const char **err); diff --git a/crypto/heimdal/kadmin/kadmind.8 b/crypto/heimdal/kadmin/kadmind.8 index 928d12ffe046..11695301c5a7 100644 --- a/crypto/heimdal/kadmin/kadmind.8 +++ b/crypto/heimdal/kadmin/kadmind.8 @@ -124,14 +124,15 @@ representing the default set of ports. .Sh FILES .Pa /var/heimdal/kadmind.acl .Sh EXAMPLES -This will cause kadmind to listen to port 4711 in addition to any +This will cause +.Nm +to listen to port 4711 in addition to any compiled in defaults: -.Bd -literal -offset indent -# kadmind --ports="+ 4711" & -.Ed +.Pp +.D1 Nm Fl -ports Ns Li "=\*[q]+ 4711\*[q] &" .\".Sh DIAGNOSTICS .Sh SEE ALSO -.Xr kdc 8 , .Xr kadmin 1 , -.Xr kpasswdd 8 , -.Xr kpasswd 1 +.Xr kpasswd 1 , +.Xr kdc 8 , +.Xr kpasswdd 8 diff --git a/crypto/heimdal/kadmin/load.c b/crypto/heimdal/kadmin/load.c index f1175541d735..ebeee6c8b3d0 100644 --- a/crypto/heimdal/kadmin/load.c +++ b/crypto/heimdal/kadmin/load.c @@ -34,7 +34,7 @@ #include "kadmin_locl.h" #include <kadm5/private.h> -RCSID("$Id: load.c,v 1.41 2001/02/20 01:44:49 assar Exp $"); +RCSID("$Id: load.c,v 1.43 2001/08/10 13:52:22 joda Exp $"); struct entry { char *principal; @@ -47,7 +47,7 @@ struct entry { char *valid_end; char *pw_end; char *flags; - char *etypes; + char *generation; }; static char * @@ -282,24 +282,30 @@ parse_hdbflags2int(HDBFlags *f, const char *s) return ret; } -#if 0 -static void -parse_etypes(char *str, unsigned **val, unsigned *len) +static int +parse_generation(char *str, GENERATION **gen) { - unsigned v; - - *val = NULL; - *len = 0; - while(sscanf(str, "%u", &v) == 1) { - *val = realloc(*val, (*len+1) * sizeof(**val)); - (*val)[(*len)++] = v; - str = strchr(str, ':'); - if(str == NULL) - break; - str++; - } + char *p; + int v; + + if(strcmp(str, "-") == 0 || *str == '\0') + *gen = NULL; + *gen = calloc(1, sizeof(**gen)); + + p = strsep(&str, ":"); + if(parse_time_string(&(*gen)->time, p) != 1) + return -1; + p = strsep(&str, ":"); + if(sscanf(p, "%d", &v) != 1) + return -1; + (*gen)->usec = v; + p = strsep(&str, ":"); + if(sscanf(p, "%d", &v) != 1) + return -1; + (*gen)->gen = v - 1; /* XXX gets bumped in _hdb_store */ + return 0; } -#endif + /* * Parse the dump file in `filename' and create the database (merging @@ -311,7 +317,7 @@ doit(const char *filename, int merge) { krb5_error_code ret; FILE *f; - char s[1024]; + char s[8192]; /* XXX should fix this properly */ char *p; int line; int flags = O_RDWR; @@ -382,7 +388,7 @@ doit(const char *filename, int merge) e.flags = p; p = skip_next(p); - e.etypes = p; + e.generation = p; p = skip_next(p); memset(&ent, 0, sizeof(ent)); @@ -454,14 +460,13 @@ doit(const char *filename, int merge) hdb_free_entry (context, &ent); continue; } -#if 0 - ALLOC(ent.etypes); - parse_etypes(e.etypes, &ent.etypes->val, &ent.etypes->len); - if(ent.etypes->len == 0) { - free(ent.etypes); - ent.etypes = NULL; + + if(parse_generation(e.generation, &ent.generation) == -1) { + fprintf (stderr, "%s:%d:error parsing generation (%s)\n", + filename, line, e.generation); + hdb_free_entry (context, &ent); + continue; } -#endif ret = db->store(context, db, HDB_F_REPLACE, &ent); hdb_free_entry (context, &ent); diff --git a/crypto/heimdal/kadmin/server.c b/crypto/heimdal/kadmin/server.c index add1ddee05e9..1e486382d2b2 100644 --- a/crypto/heimdal/kadmin/server.c +++ b/crypto/heimdal/kadmin/server.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -34,7 +34,7 @@ #include "kadmin_locl.h" #include <krb5-private.h> -RCSID("$Id: server.c,v 1.32 2000/09/19 12:46:01 assar Exp $"); +RCSID("$Id: server.c,v 1.33 2001/07/23 13:46:47 joda Exp $"); static kadm5_ret_t kadmind_dispatch(void *kadm_handle, krb5_boolean initial, @@ -483,7 +483,7 @@ handle_v5(krb5_context context, NULL, KRB5_RECVAUTH_IGNORE_VERSION, keytab, &ticket); if(ret == KRB5_KT_NOTFOUND) - krb5_errx(context, 1, "krb5_recvauth: key no found"); + krb5_errx(context, 1, "krb5_recvauth: key not found"); if(ret) krb5_err(context, 1, ret, "krb5_recvauth"); diff --git a/crypto/heimdal/kadmin/util.c b/crypto/heimdal/kadmin/util.c index 4a5e1c054316..c0c77de3639f 100644 --- a/crypto/heimdal/kadmin/util.c +++ b/crypto/heimdal/kadmin/util.c @@ -34,13 +34,16 @@ #include "kadmin_locl.h" #include <parse_units.h> -RCSID("$Id: util.c,v 1.32 2001/05/14 06:17:20 assar Exp $"); +RCSID("$Id: util.c,v 1.36 2001/08/27 23:07:36 assar Exp $"); /* * util.c - functions for parsing, unparsing, and editing different * types of data used in kadmin. */ +static int +get_response(const char *prompt, const char *def, char *buf, size_t len); + /* * attributes */ @@ -130,7 +133,8 @@ edit_attributes (const char *prompt, krb5_flags *attr, int *mask, int bit) attributes2str(*attr, buf, sizeof(buf)); for (;;) { - get_response("Attributes", buf, resp, sizeof(resp)); + if(get_response("Attributes", buf, resp, sizeof(resp)) != 0) + return 1; if (resp[0] == '\0') break; if (parse_attributes (resp, attr, mask, bit) == 0) @@ -242,7 +246,8 @@ edit_timet (const char *prompt, krb5_timestamp *value, int *mask, int bit) time_t2str (*value, buf, sizeof (buf), 0); for (;;) { - get_response(prompt, buf, resp, sizeof(resp)); + if(get_response(prompt, buf, resp, sizeof(resp)) != 0) + return 1; if (parse_timet (resp, value, mask, bit) == 0) break; } @@ -327,7 +332,8 @@ edit_deltat (const char *prompt, krb5_deltat *value, int *mask, int bit) deltat2str(*value, buf, sizeof(buf)); for (;;) { - get_response(prompt, buf, resp, sizeof(resp)); + if(get_response(prompt, buf, resp, sizeof(resp)) != 0) + return 1; if (parse_deltat (resp, value, mask, bit) == 0) break; } @@ -338,44 +344,63 @@ edit_deltat (const char *prompt, krb5_deltat *value, int *mask, int bit) * allow the user to edit `ent' */ -int -edit_entry(kadm5_principal_ent_t ent, int *mask, - kadm5_principal_ent_t default_ent, int default_mask) +void +set_defaults(kadm5_principal_ent_t ent, int *mask, + kadm5_principal_ent_t default_ent, int default_mask) { if (default_ent && (default_mask & KADM5_MAX_LIFE) && !(*mask & KADM5_MAX_LIFE)) ent->max_life = default_ent->max_life; - edit_deltat ("Max ticket life", &ent->max_life, mask, - KADM5_MAX_LIFE); if (default_ent && (default_mask & KADM5_MAX_RLIFE) && !(*mask & KADM5_MAX_RLIFE)) ent->max_renewable_life = default_ent->max_renewable_life; - edit_deltat ("Max renewable life", &ent->max_renewable_life, mask, - KADM5_MAX_RLIFE); if (default_ent && (default_mask & KADM5_PRINC_EXPIRE_TIME) && !(*mask & KADM5_PRINC_EXPIRE_TIME)) ent->princ_expire_time = default_ent->princ_expire_time; - edit_timet ("Principal expiration time", &ent->princ_expire_time, mask, - KADM5_PRINC_EXPIRE_TIME); if (default_ent && (default_mask & KADM5_PW_EXPIRATION) && !(*mask & KADM5_PW_EXPIRATION)) ent->pw_expiration = default_ent->pw_expiration; - edit_timet ("Password expiration time", &ent->pw_expiration, mask, - KADM5_PW_EXPIRATION); if (default_ent && (default_mask & KADM5_ATTRIBUTES) && !(*mask & KADM5_ATTRIBUTES)) ent->attributes = default_ent->attributes & ~KRB5_KDB_DISALLOW_ALL_TIX; - edit_attributes ("Attributes", &ent->attributes, mask, - KADM5_ATTRIBUTES); +} + +int +edit_entry(kadm5_principal_ent_t ent, int *mask, + kadm5_principal_ent_t default_ent, int default_mask) +{ + + set_defaults(ent, mask, default_ent, default_mask); + + if(edit_deltat ("Max ticket life", &ent->max_life, mask, + KADM5_MAX_LIFE) != 0) + return 1; + + if(edit_deltat ("Max renewable life", &ent->max_renewable_life, mask, + KADM5_MAX_RLIFE) != 0) + return 1; + + if(edit_timet ("Principal expiration time", &ent->princ_expire_time, mask, + KADM5_PRINC_EXPIRE_TIME) != 0) + return 1; + + if(edit_timet ("Password expiration time", &ent->pw_expiration, mask, + KADM5_PW_EXPIRATION) != 0) + return 1; + + if(edit_attributes ("Attributes", &ent->attributes, mask, + KADM5_ATTRIBUTES) != 0) + return 1; + return 0; } @@ -512,20 +537,45 @@ foreach_principal(const char *exp, * in `buf, len' */ -void +#include <setjmp.h> + +static sig_atomic_t num_intrs; +static jmp_buf jmpbuf; + +static void +interrupt(int sig) +{ + longjmp(jmpbuf, 1); +} + +static int get_response(const char *prompt, const char *def, char *buf, size_t len) { char *p; + void (*osig)(int); + + num_intrs = 0; + osig = signal(SIGINT, interrupt); + if(setjmp(jmpbuf)) { + signal(SIGINT, osig); + return 1; + } printf("%s [%s]:", prompt, def); - if(fgets(buf, len, stdin) == NULL) - *buf = '\0'; + if(fgets(buf, len, stdin) == NULL) { + int save_errno = errno; + if(ferror(stdin)) + krb5_err(context, 1, save_errno, "<stdin>"); + signal(SIGINT, osig); + return 1; + } p = strchr(buf, '\n'); if(p) *p = '\0'; if(strcmp(buf, "") == 0) - strncpy(buf, def, len); - buf[len-1] = 0; + strlcpy(buf, def, len); + signal(SIGINT, osig); + return 0; } /* |