summaryrefslogtreecommitdiff
path: root/crypto/heimdal/admin
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/heimdal/admin')
-rw-r--r--crypto/heimdal/admin/Makefile661
-rw-r--r--crypto/heimdal/admin/Makefile.am29
-rw-r--r--crypto/heimdal/admin/Makefile.in657
-rw-r--r--crypto/heimdal/admin/add.c155
-rw-r--r--crypto/heimdal/admin/change.c257
-rw-r--r--crypto/heimdal/admin/copy.c247
-rw-r--r--crypto/heimdal/admin/get.c269
-rw-r--r--crypto/heimdal/admin/ktutil.8194
-rw-r--r--crypto/heimdal/admin/ktutil.c176
-rw-r--r--crypto/heimdal/admin/ktutil.cat881
-rw-r--r--crypto/heimdal/admin/ktutil_locl.h83
-rw-r--r--crypto/heimdal/admin/list.c213
-rw-r--r--crypto/heimdal/admin/purge.c188
-rw-r--r--crypto/heimdal/admin/remove.c113
-rw-r--r--crypto/heimdal/admin/rename.c133
-rw-r--r--crypto/heimdal/admin/srvconvert.c181
-rw-r--r--crypto/heimdal/admin/srvcreate.c124
17 files changed, 0 insertions, 3761 deletions
diff --git a/crypto/heimdal/admin/Makefile b/crypto/heimdal/admin/Makefile
deleted file mode 100644
index b59509365adc..000000000000
--- a/crypto/heimdal/admin/Makefile
+++ /dev/null
@@ -1,661 +0,0 @@
-# Makefile.in generated by automake 1.6.3 from Makefile.am.
-# admin/Makefile. Generated from Makefile.in by configure.
-
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-
-
-# $Id: Makefile.am,v 1.35 2001/08/28 08:31:19 assar Exp $
-
-# $Id: Makefile.am.common,v 1.5 2002/05/19 18:35:37 joda Exp $
-
-# $Id: Makefile.am.common,v 1.36 2002/08/19 16:10:25 joda Exp $
-SHELL = /bin/sh
-
-srcdir = .
-top_srcdir = ..
-
-prefix = /usr/heimdal
-exec_prefix = ${prefix}
-
-bindir = ${exec_prefix}/bin
-sbindir = ${exec_prefix}/sbin
-libexecdir = ${exec_prefix}/libexec
-datadir = ${prefix}/share
-sysconfdir = /etc
-sharedstatedir = ${prefix}/com
-localstatedir = /var/heimdal
-libdir = ${exec_prefix}/lib
-infodir = ${prefix}/info
-mandir = ${prefix}/man
-includedir = ${prefix}/include
-oldincludedir = /usr/include
-pkgdatadir = $(datadir)/heimdal
-pkglibdir = $(libdir)/heimdal
-pkgincludedir = $(includedir)/heimdal
-top_builddir = ..
-
-ACLOCAL = ${SHELL} /usr/home/nectar/devel/heimdal/missing --run aclocal-1.6
-AUTOCONF = ${SHELL} /usr/home/nectar/devel/heimdal/missing --run autoconf
-AUTOMAKE = ${SHELL} /usr/home/nectar/devel/heimdal/missing --run automake-1.6
-AUTOHEADER = ${SHELL} /usr/home/nectar/devel/heimdal/missing --run autoheader
-
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = /usr/bin/install -c
-INSTALL_PROGRAM = ${INSTALL}
-INSTALL_DATA = ${INSTALL} -m 644
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_SCRIPT = ${INSTALL}
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = s,x,x,
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-host_alias =
-host_triplet = i386-unknown-freebsd5.0
-
-EXEEXT =
-OBJEXT = o
-PATH_SEPARATOR = :
-AIX_EXTRA_KAFS =
-AMTAR = ${SHELL} /usr/home/nectar/devel/heimdal/missing --run tar
-AS = @AS@
-AWK = gawk
-CANONICAL_HOST = i386-unknown-freebsd5.0
-CATMAN = /usr/bin/nroff -mdoc $< > $@
-CATMANEXT = $$section
-CC = gcc
-COMPILE_ET = compile_et
-CPP = gcc -E
-DBLIB =
-DEPDIR = .deps
-DIR_com_err =
-DIR_des =
-DIR_roken = roken
-DLLTOOL = @DLLTOOL@
-ECHO = echo
-EXTRA_LIB45 =
-GROFF = /usr/bin/groff
-INCLUDES_roken = -I$(top_builddir)/lib/roken -I$(top_srcdir)/lib/roken
-INCLUDE_ = @INCLUDE_@
-INCLUDE_des =
-INSTALL_STRIP_PROGRAM = ${SHELL} $(install_sh) -c -s
-LEX = flex
-
-LEXLIB = -lfl
-LEX_OUTPUT_ROOT = lex.yy
-LIBTOOL = $(SHELL) $(top_builddir)/libtool
-LIB_ = @LIB_@
-LIB_AUTH_SUBDIRS =
-LIB_NDBM =
-LIB_com_err = -lcom_err
-LIB_com_err_a =
-LIB_com_err_so =
-LIB_des = -lcrypto
-LIB_des_a = -lcrypto
-LIB_des_appl = -lcrypto
-LIB_des_so = -lcrypto
-LIB_kdb =
-LIB_otp = $(top_builddir)/lib/otp/libotp.la
-LIB_roken = $(top_builddir)/lib/vers/libvers.la $(top_builddir)/lib/roken/libroken.la $(LIB_crypt) $(LIB_dbopen)
-LIB_security =
-LN_S = ln -s
-LTLIBOBJS = copyhostent.lo ecalloc.lo emalloc.lo erealloc.lo estrdup.lo strlwr.lo strndup.lo strnlen.lo strsep_copy.lo strupr.lo
-NEED_WRITEAUTH_FALSE =
-NEED_WRITEAUTH_TRUE = #
-NROFF = /usr/bin/nroff
-OBJDUMP = @OBJDUMP@
-PACKAGE = heimdal
-RANLIB = ranlib
-STRIP = strip
-VERSION = 0.4f
-VOID_RETSIGTYPE =
-WFLAGS = -Wall -Wmissing-prototypes -Wpointer-arith -Wbad-function-cast -Wmissing-declarations -Wnested-externs
-WFLAGS_NOIMPLICITINT =
-WFLAGS_NOUNUSED =
-X_CFLAGS = -I/usr/X11R6/include
-X_EXTRA_LIBS =
-X_LIBS = -L/usr/X11R6/lib
-X_PRE_LIBS = -lSM -lICE
-YACC = bison -y
-am__include = include
-am__quote =
-dpagaix_cflags = -D_THREAD_SAFE -D_AIX_PTHREADS_D7 -D_AIX32_THREADS=1 -D_AES_SOURCE -D_AIX41 -I/usr/include/dce
-dpagaix_ldadd = -L/usr/lib/threads -ldcelibc_r -ldcepthreads -lpthreads_compat lpthreads -lc_r
-dpagaix_ldflags = -Wl,-bI:dfspag.exp
-install_sh = /usr/home/nectar/devel/heimdal/install-sh
-
-AUTOMAKE_OPTIONS = foreign no-dependencies 1.6
-
-SUFFIXES = .et .h .x .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8
-
-INCLUDES = -I$(top_builddir)/include $(INCLUDES_roken) $(INCLUDE_readline) $(INCLUDE_des)
-
-ROKEN_RENAME = -DROKEN_RENAME
-
-AM_CFLAGS = $(WFLAGS)
-
-CP = cp
-
-buildinclude = $(top_builddir)/include
-
-LIB_XauReadAuth = -lXau
-LIB_crypt = -lcrypt
-LIB_dbm_firstkey =
-LIB_dbopen =
-LIB_dlopen =
-LIB_dn_expand =
-LIB_el_init = -ledit
-LIB_getattr = @LIB_getattr@
-LIB_gethostbyname =
-LIB_getpwent_r = @LIB_getpwent_r@
-LIB_getpwnam_r =
-LIB_getsockopt =
-LIB_logout = -lutil
-LIB_logwtmp = -lutil
-LIB_odm_initialize = @LIB_odm_initialize@
-LIB_openpty = -lutil
-LIB_pidfile =
-LIB_res_search =
-LIB_setpcred = @LIB_setpcred@
-LIB_setsockopt =
-LIB_socket =
-LIB_syslog =
-LIB_tgetent = -ltermcap
-
-HESIODLIB = @HESIODLIB@
-HESIODINCLUDE = @HESIODINCLUDE@
-INCLUDE_hesiod =
-LIB_hesiod =
-
-INCLUDE_krb4 =
-LIB_krb4 =
-
-INCLUDE_openldap =
-LIB_openldap =
-
-INCLUDE_readline =
-LIB_readline = $(top_builddir)/lib/editline/libel_compat.la $(LIB_el_init) $(LIB_tgetent)
-
-NROFF_MAN = groff -mandoc -Tascii
-
-#LIB_kafs = $(top_builddir)/lib/kafs/libkafs.la $(AIX_EXTRA_KAFS)
-
-LIB_krb5 = $(top_builddir)/lib/krb5/libkrb5.la \
- $(top_builddir)/lib/asn1/libasn1.la
-
-LIB_gssapi = $(top_builddir)/lib/gssapi/libgssapi.la
-
-#LIB_kdfs = $(top_builddir)/lib/kdfs/libkdfs.la
-
-man_MANS = ktutil.8
-
-sbin_PROGRAMS = ktutil
-
-ktutil_SOURCES = \
- add.c \
- change.c \
- copy.c \
- get.c \
- ktutil.c \
- list.c \
- purge.c \
- remove.c \
- rename.c
-
-
-LDADD = \
- $(top_builddir)/lib/kadm5/libkadm5clnt.la \
- $(top_builddir)/lib/krb5/libkrb5.la \
- $(LIB_des) \
- $(top_builddir)/lib/asn1/libasn1.la \
- $(top_builddir)/lib/sl/libsl.la \
- $(LIB_readline) \
- $(LIB_roken)
-
-subdir = admin
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/include/config.h
-CONFIG_CLEAN_FILES =
-sbin_PROGRAMS = ktutil$(EXEEXT)
-PROGRAMS = $(sbin_PROGRAMS)
-
-am_ktutil_OBJECTS = add.$(OBJEXT) change.$(OBJEXT) copy.$(OBJEXT) \
- get.$(OBJEXT) ktutil.$(OBJEXT) list.$(OBJEXT) purge.$(OBJEXT) \
- remove.$(OBJEXT) rename.$(OBJEXT)
-ktutil_OBJECTS = $(am_ktutil_OBJECTS)
-ktutil_LDADD = $(LDADD)
-ktutil_DEPENDENCIES = $(top_builddir)/lib/kadm5/libkadm5clnt.la \
- $(top_builddir)/lib/krb5/libkrb5.la \
- $(top_builddir)/lib/asn1/libasn1.la \
- $(top_builddir)/lib/sl/libsl.la
-ktutil_LDFLAGS =
-
-DEFS = -DHAVE_CONFIG_H
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
-CPPFLAGS =
-LDFLAGS =
-LIBS =
-depcomp =
-am__depfiles_maybe =
-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 $@
-CFLAGS = -DINET6 -g -O2
-DIST_SOURCES = $(ktutil_SOURCES)
-MANS = $(man_MANS)
-DIST_COMMON = Makefile.am Makefile.in
-SOURCES = $(ktutil_SOURCES)
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .et .h .x .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .c .lo .o .obj
-$(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 admin/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
-sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-install-sbinPROGRAMS: $(sbin_PROGRAMS)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(sbindir)
- @list='$(sbin_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- || test -f $$p1 \
- ; then \
- f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f; \
- else :; fi; \
- done
-
-uninstall-sbinPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(sbin_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \
- rm -f $(DESTDIR)$(sbindir)/$$f; \
- done
-
-clean-sbinPROGRAMS:
- @list='$(sbin_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
-ktutil$(EXEEXT): $(ktutil_OBJECTS) $(ktutil_DEPENDENCIES)
- @rm -f ktutil$(EXEEXT)
- $(LINK) $(ktutil_LDFLAGS) $(ktutil_OBJECTS) $(ktutil_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT) core *.core
-
-distclean-compile:
- -rm -f *.tab.c
-
-.c.o:
- $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
-
-.c.obj:
- $(COMPILE) -c `cygpath -w $<`
-
-.c.lo:
- $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-
-man8dir = $(mandir)/man8
-install-man8: $(man8_MANS) $(man_MANS)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(man8dir)
- @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; \
- done; \
- for i in $$list; do \
- if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
- else file=$$i; fi; \
- ext=`echo $$i | sed -e 's/^.*\\.//'`; \
- case "$$ext" in \
- 8*) ;; \
- *) ext='8' ;; \
- esac; \
- inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
- inst=`echo $$inst | sed -e 's/^.*\///'`; \
- inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst"; \
- $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst; \
- done
-uninstall-man8:
- @$(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; \
- done; \
- for i in $$list; do \
- ext=`echo $$i | sed -e 's/^.*\\.//'`; \
- inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
- inst=`echo $$inst | sed -e 's/^.*\///'`; \
- inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \
- rm -f $(DESTDIR)$(man8dir)/$$inst; \
- done
-
-ETAGS = etags
-ETAGSFLAGS =
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$tags$$unique" \
- || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-top_distdir = ..
-distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
-
-distdir: $(DISTFILES)
- @list='$(DISTFILES)'; for file in $$list; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkinstalldirs) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="${top_distdir}" distdir="$(distdir)" \
- dist-hook
-check-am: all-am
- $(MAKE) $(AM_MAKEFLAGS) check-local
-check: check-am
-all-am: Makefile $(PROGRAMS) $(MANS) all-local
-
-installdirs:
- $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir)
-
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-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)" \
- INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-sbinPROGRAMS mostlyclean-am
-
-distclean: distclean-am
-
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-libtool distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-data-local install-man
-
-install-exec-am: 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
-
-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-man uninstall-sbinPROGRAMS
-
-uninstall-man: uninstall-man8
-
-.PHONY: GTAGS all all-am all-local check check-am check-local clean \
- clean-generic clean-libtool 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-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-man uninstall-man8 \
- uninstall-sbinPROGRAMS
-
-
-install-suid-programs:
- @foo='$(bin_SUIDS)'; \
- for file in $$foo; do \
- x=$(DESTDIR)$(bindir)/$$file; \
- if chown 0:0 $$x && chmod u+s $$x; then :; else \
- echo "*"; \
- echo "* Failed to install $$x setuid root"; \
- echo "*"; \
- fi; done
-
-install-exec-hook: install-suid-programs
-
-install-build-headers:: $(include_HEADERS) $(build_HEADERZ)
- @foo='$(include_HEADERS) $(nodist_include_HEADERS) $(build_HEADERZ)'; \
- for f in $$foo; do \
- f=`basename $$f`; \
- if test -f "$(srcdir)/$$f"; then file="$(srcdir)/$$f"; \
- else file="$$f"; fi; \
- if cmp -s $$file $(buildinclude)/$$f 2> /dev/null ; then \
- : ; else \
- echo " $(CP) $$file $(buildinclude)/$$f"; \
- $(CP) $$file $(buildinclude)/$$f; \
- fi ; \
- done
-
-all-local: install-build-headers
-
-check-local::
- @if test '$(CHECK_LOCAL)'; then \
- foo='$(CHECK_LOCAL)'; else \
- foo='$(PROGRAMS)'; fi; \
- if test "$$foo"; then \
- failed=0; all=0; \
- for i in $$foo; do \
- all=`expr $$all + 1`; \
- if ./$$i --version > /dev/null 2>&1; then \
- echo "PASS: $$i"; \
- else \
- echo "FAIL: $$i"; \
- failed=`expr $$failed + 1`; \
- fi; \
- done; \
- if test "$$failed" -eq 0; then \
- banner="All $$all tests passed"; \
- else \
- banner="$$failed of $$all tests failed"; \
- fi; \
- dashes=`echo "$$banner" | sed s/./=/g`; \
- echo "$$dashes"; \
- echo "$$banner"; \
- echo "$$dashes"; \
- test "$$failed" -eq 0; \
- fi
-
-.x.c:
- @cmp -s $< $@ 2> /dev/null || cp $< $@
-#NROFF_MAN = nroff -man
-.1.cat1:
- $(NROFF_MAN) $< > $@
-.3.cat3:
- $(NROFF_MAN) $< > $@
-.5.cat5:
- $(NROFF_MAN) $< > $@
-.8.cat8:
- $(NROFF_MAN) $< > $@
-
-dist-cat1-mans:
- @foo='$(man1_MANS)'; \
- bar='$(man_MANS)'; \
- for i in $$bar; do \
- case $$i in \
- *.1) foo="$$foo $$i";; \
- esac; done ;\
- for i in $$foo; do \
- x=`echo $$i | sed 's/\.[^.]*$$/.cat1/'`; \
- echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
- $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
- done
-
-dist-cat3-mans:
- @foo='$(man3_MANS)'; \
- bar='$(man_MANS)'; \
- for i in $$bar; do \
- case $$i in \
- *.3) foo="$$foo $$i";; \
- esac; done ;\
- for i in $$foo; do \
- x=`echo $$i | sed 's/\.[^.]*$$/.cat3/'`; \
- echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
- $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
- done
-
-dist-cat5-mans:
- @foo='$(man5_MANS)'; \
- bar='$(man_MANS)'; \
- for i in $$bar; do \
- case $$i in \
- *.5) foo="$$foo $$i";; \
- esac; done ;\
- for i in $$foo; do \
- x=`echo $$i | sed 's/\.[^.]*$$/.cat5/'`; \
- echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
- $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
- done
-
-dist-cat8-mans:
- @foo='$(man8_MANS)'; \
- bar='$(man_MANS)'; \
- for i in $$bar; do \
- case $$i in \
- *.8) foo="$$foo $$i";; \
- esac; done ;\
- for i in $$foo; do \
- x=`echo $$i | sed 's/\.[^.]*$$/.cat8/'`; \
- echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
- $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
- done
-
-dist-hook: dist-cat1-mans dist-cat3-mans dist-cat5-mans dist-cat8-mans
-
-install-cat-mans:
- $(SHELL) $(top_srcdir)/cf/install-catman.sh "$(INSTALL_DATA)" "$(mkinstalldirs)" "$(srcdir)" "$(DESTDIR)$(mandir)" '$(CATMANEXT)' $(man_MANS) $(man1_MANS) $(man3_MANS) $(man5_MANS) $(man8_MANS)
-
-install-data-local: install-cat-mans
-
-.et.h:
- $(COMPILE_ET) $<
-.et.c:
- $(COMPILE_ET) $<
-# 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/admin/Makefile.am b/crypto/heimdal/admin/Makefile.am
deleted file mode 100644
index 81aa47f1f1d0..000000000000
--- a/crypto/heimdal/admin/Makefile.am
+++ /dev/null
@@ -1,29 +0,0 @@
-# $Id: Makefile.am,v 1.35 2001/08/28 08:31:19 assar Exp $
-
-include $(top_srcdir)/Makefile.am.common
-
-INCLUDES += $(INCLUDE_readline) $(INCLUDE_des)
-
-man_MANS = ktutil.8
-
-sbin_PROGRAMS = ktutil
-
-ktutil_SOURCES = \
- add.c \
- change.c \
- copy.c \
- get.c \
- ktutil.c \
- list.c \
- purge.c \
- remove.c \
- rename.c
-
-LDADD = \
- $(top_builddir)/lib/kadm5/libkadm5clnt.la \
- $(top_builddir)/lib/krb5/libkrb5.la \
- $(LIB_des) \
- $(top_builddir)/lib/asn1/libasn1.la \
- $(top_builddir)/lib/sl/libsl.la \
- $(LIB_readline) \
- $(LIB_roken)
diff --git a/crypto/heimdal/admin/Makefile.in b/crypto/heimdal/admin/Makefile.in
deleted file mode 100644
index 1a245ad8029b..000000000000
--- a/crypto/heimdal/admin/Makefile.in
+++ /dev/null
@@ -1,657 +0,0 @@
-# Makefile.in generated by automake 1.6.1 from Makefile.am.
-# @configure_input@
-
-# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
-# Free Software Foundation, Inc.
-# This Makefile.in is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-# PARTICULAR PURPOSE.
-
-@SET_MAKE@
-
-# $Id: Makefile.am,v 1.35 2001/08/28 08:31:19 assar Exp $
-
-# $Id: Makefile.am.common,v 1.5 2002/05/19 18:35:37 joda Exp $
-
-# $Id: Makefile.am.common,v 1.37.2.1 2003/05/08 17:08:09 joda Exp $
-SHELL = @SHELL@
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
-VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = @program_transform_name@
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-host_alias = @host_alias@
-host_triplet = @host@
-
-EXEEXT = @EXEEXT@
-OBJEXT = @OBJEXT@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-AIX_EXTRA_KAFS = @AIX_EXTRA_KAFS@
-AMTAR = @AMTAR@
-AS = @AS@
-AWK = @AWK@
-CANONICAL_HOST = @CANONICAL_HOST@
-CATMAN = @CATMAN@
-CATMANEXT = @CATMANEXT@
-CC = @CC@
-COMPILE_ET = @COMPILE_ET@
-CPP = @CPP@
-DBLIB = @DBLIB@
-DEPDIR = @DEPDIR@
-DIR_com_err = @DIR_com_err@
-DIR_des = @DIR_des@
-DIR_roken = @DIR_roken@
-DLLTOOL = @DLLTOOL@
-ECHO = @ECHO@
-EXTRA_LIB45 = @EXTRA_LIB45@
-GROFF = @GROFF@
-INCLUDES_roken = @INCLUDES_roken@
-INCLUDE_ = @INCLUDE_@
-INCLUDE_des = @INCLUDE_des@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LEX = @LEX@
-
-LEXLIB = @LEXLIB@
-LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-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@
-MAINT = @MAINT@
-NEED_WRITEAUTH_FALSE = @NEED_WRITEAUTH_FALSE@
-NEED_WRITEAUTH_TRUE = @NEED_WRITEAUTH_TRUE@
-NROFF = @NROFF@
-OBJDUMP = @OBJDUMP@
-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@
-dpagaix_ldflags = @dpagaix_ldflags@
-install_sh = @install_sh@
-
-AUTOMAKE_OPTIONS = foreign no-dependencies 1.6
-
-SUFFIXES = .et .h .x .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8
-
-INCLUDES = -I$(top_builddir)/include $(INCLUDES_roken) $(INCLUDE_readline) $(INCLUDE_des)
-
-@do_roken_rename_TRUE@ROKEN_RENAME = -DROKEN_RENAME
-
-AM_CFLAGS = $(WFLAGS)
-
-CP = cp
-
-buildinclude = $(top_builddir)/include
-
-LIB_XauReadAuth = @LIB_XauReadAuth@
-LIB_crypt = @LIB_crypt@
-LIB_dbm_firstkey = @LIB_dbm_firstkey@
-LIB_dbopen = @LIB_dbopen@
-LIB_dlopen = @LIB_dlopen@
-LIB_dn_expand = @LIB_dn_expand@
-LIB_el_init = @LIB_el_init@
-LIB_getattr = @LIB_getattr@
-LIB_gethostbyname = @LIB_gethostbyname@
-LIB_getpwent_r = @LIB_getpwent_r@
-LIB_getpwnam_r = @LIB_getpwnam_r@
-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_res_search = @LIB_res_search@
-LIB_setpcred = @LIB_setpcred@
-LIB_setsockopt = @LIB_setsockopt@
-LIB_socket = @LIB_socket@
-LIB_syslog = @LIB_syslog@
-LIB_tgetent = @LIB_tgetent@
-
-HESIODLIB = @HESIODLIB@
-HESIODINCLUDE = @HESIODINCLUDE@
-INCLUDE_hesiod = @INCLUDE_hesiod@
-LIB_hesiod = @LIB_hesiod@
-
-INCLUDE_krb4 = @INCLUDE_krb4@
-LIB_krb4 = @LIB_krb4@
-
-INCLUDE_openldap = @INCLUDE_openldap@
-LIB_openldap = @LIB_openldap@
-
-INCLUDE_readline = @INCLUDE_readline@
-LIB_readline = @LIB_readline@
-
-NROFF_MAN = groff -mandoc -Tascii
-
-LIB_kafs = $(top_builddir)/lib/kafs/libkafs.la $(AIX_EXTRA_KAFS)
-
-@KRB5_TRUE@LIB_krb5 = $(top_builddir)/lib/krb5/libkrb5.la \
-@KRB5_TRUE@ $(top_builddir)/lib/asn1/libasn1.la
-
-@KRB5_TRUE@LIB_gssapi = $(top_builddir)/lib/gssapi/libgssapi.la
-
-@DCE_TRUE@LIB_kdfs = $(top_builddir)/lib/kdfs/libkdfs.la
-
-man_MANS = ktutil.8
-
-sbin_PROGRAMS = ktutil
-
-ktutil_SOURCES = \
- add.c \
- change.c \
- copy.c \
- get.c \
- ktutil.c \
- list.c \
- purge.c \
- remove.c \
- rename.c
-
-
-LDADD = \
- $(top_builddir)/lib/kadm5/libkadm5clnt.la \
- $(top_builddir)/lib/krb5/libkrb5.la \
- $(LIB_des) \
- $(top_builddir)/lib/asn1/libasn1.la \
- $(top_builddir)/lib/sl/libsl.la \
- $(LIB_readline) \
- $(LIB_roken)
-
-subdir = admin
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
-CONFIG_HEADER = $(top_builddir)/include/config.h
-CONFIG_CLEAN_FILES =
-sbin_PROGRAMS = ktutil$(EXEEXT)
-PROGRAMS = $(sbin_PROGRAMS)
-
-am_ktutil_OBJECTS = add.$(OBJEXT) change.$(OBJEXT) copy.$(OBJEXT) \
- get.$(OBJEXT) ktutil.$(OBJEXT) list.$(OBJEXT) purge.$(OBJEXT) \
- remove.$(OBJEXT) rename.$(OBJEXT)
-ktutil_OBJECTS = $(am_ktutil_OBJECTS)
-ktutil_LDADD = $(LDADD)
-ktutil_DEPENDENCIES = $(top_builddir)/lib/kadm5/libkadm5clnt.la \
- $(top_builddir)/lib/krb5/libkrb5.la \
- $(top_builddir)/lib/asn1/libasn1.la \
- $(top_builddir)/lib/sl/libsl.la
-ktutil_LDFLAGS =
-
-DEFS = @DEFS@
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-depcomp =
-am__depfiles_maybe =
-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 $@
-CFLAGS = @CFLAGS@
-DIST_SOURCES = $(ktutil_SOURCES)
-MANS = $(man_MANS)
-DIST_COMMON = Makefile.am Makefile.in
-SOURCES = $(ktutil_SOURCES)
-
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .et .h .x .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/cf/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign admin/Makefile
-Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
-sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-install-sbinPROGRAMS: $(sbin_PROGRAMS)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(sbindir)
- @list='$(sbin_PROGRAMS)'; for p in $$list; do \
- p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- if test -f $$p \
- || test -f $$p1 \
- ; then \
- p1=`echo "$$p1" | sed -e 's,^.*/,,'`; \
- f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(sbinPROGRAMS_INSTALL) $$p $(DESTDIR)$(sbindir)/$$f; \
- else :; fi; \
- done
-
-uninstall-sbinPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(sbin_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- f=`echo "$$f" | sed -e 's,^.*/,,'`; \
- echo " rm -f $(DESTDIR)$(sbindir)/$$f"; \
- rm -f $(DESTDIR)$(sbindir)/$$f; \
- done
-
-clean-sbinPROGRAMS:
- -test -z "$(sbin_PROGRAMS)" || rm -f $(sbin_PROGRAMS)
-ktutil$(EXEEXT): $(ktutil_OBJECTS) $(ktutil_DEPENDENCIES)
- @rm -f ktutil$(EXEEXT)
- $(LINK) $(ktutil_LDFLAGS) $(ktutil_OBJECTS) $(ktutil_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT) core *.core
-
-distclean-compile:
- -rm -f *.tab.c
-
-.c.o:
- $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
-
-.c.obj:
- $(COMPILE) -c `cygpath -w $<`
-
-.c.lo:
- $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-
-distclean-libtool:
- -rm -f libtool
-uninstall-info-am:
-
-man8dir = $(mandir)/man8
-install-man8: $(man8_MANS) $(man_MANS)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(man8dir)
- @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; \
- done; \
- for i in $$list; do \
- if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
- else file=$$i; fi; \
- ext=`echo $$i | sed -e 's/^.*\\.//'`; \
- inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
- inst=`echo $$inst | sed -e 's/^.*\///'`; \
- inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst"; \
- $(INSTALL_DATA) $$file $(DESTDIR)$(man8dir)/$$inst; \
- done
-uninstall-man8:
- @$(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; \
- done; \
- for i in $$list; do \
- ext=`echo $$i | sed -e 's/^.*\\.//'`; \
- inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
- inst=`echo $$inst | sed -e 's/^.*\///'`; \
- inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " rm -f $(DESTDIR)$(man8dir)/$$inst"; \
- rm -f $(DESTDIR)$(man8dir)/$$inst; \
- done
-
-ETAGS = etags
-ETAGSFLAGS =
-
-tags: TAGS
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- mkid -fID $$unique
-
-TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- tags=; \
- here=`pwd`; \
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$tags$$unique" \
- || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique
-
-GTAGS:
- here=`$(am__cd) $(top_builddir) && pwd` \
- && cd $(top_srcdir) \
- && gtags -i $(GTAGS_ARGS) $$here
-
-distclean-tags:
- -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-
-top_distdir = ..
-distdir = $(top_distdir)/$(PACKAGE)-$(VERSION)
-
-distdir: $(DISTFILES)
- @for file in $(DISTFILES); do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkinstalldirs) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
- if test -d $$d/$$file; then \
- if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
- cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
- fi; \
- cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
- else \
- test -f $(distdir)/$$file \
- || cp -p $$d/$$file $(distdir)/$$file \
- || exit 1; \
- fi; \
- done
- $(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="${top_distdir}" distdir="$(distdir)" \
- dist-hook
-check-am: all-am
- $(MAKE) $(AM_MAKEFLAGS) check-local
-check: check-am
-all-am: Makefile $(PROGRAMS) $(MANS) all-local
-
-installdirs:
- $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(man8dir)
-
-install: install-am
-install-exec: install-exec-am
-install-data: install-data-am
-uninstall: uninstall-am
-
-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)" \
- INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
-
-maintainer-clean-generic:
- @echo "This command is intended for maintainers to use"
- @echo "it deletes files that may require special tools to rebuild."
-clean: clean-am
-
-clean-am: clean-generic clean-libtool clean-sbinPROGRAMS mostlyclean-am
-
-distclean: distclean-am
-
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-libtool distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-info: info-am
-
-info-am:
-
-install-data-am: install-man
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) install-data-hook
-
-install-exec-am: 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
-
-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-man uninstall-sbinPROGRAMS
-
-uninstall-man: uninstall-man8
-
-.PHONY: GTAGS all all-am all-local check check-am check-local clean \
- clean-generic clean-libtool 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-exec \
- install-exec-am install-info install-info-am 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-man uninstall-man8 \
- uninstall-sbinPROGRAMS
-
-
-install-suid-programs:
- @foo='$(bin_SUIDS)'; \
- for file in $$foo; do \
- x=$(DESTDIR)$(bindir)/$$file; \
- if chown 0:0 $$x && chmod u+s $$x; then :; else \
- echo "*"; \
- echo "* Failed to install $$x setuid root"; \
- echo "*"; \
- fi; done
-
-install-exec-hook: install-suid-programs
-
-install-build-headers:: $(include_HEADERS) $(build_HEADERZ)
- @foo='$(include_HEADERS) $(nodist_include_HEADERS) $(build_HEADERZ)'; \
- for f in $$foo; do \
- f=`basename $$f`; \
- if test -f "$(srcdir)/$$f"; then file="$(srcdir)/$$f"; \
- else file="$$f"; fi; \
- if cmp -s $$file $(buildinclude)/$$f 2> /dev/null ; then \
- : ; else \
- echo " $(CP) $$file $(buildinclude)/$$f"; \
- $(CP) $$file $(buildinclude)/$$f; \
- fi ; \
- done
-
-all-local: install-build-headers
-
-check-local::
- @if test '$(CHECK_LOCAL)'; then \
- foo='$(CHECK_LOCAL)'; else \
- foo='$(PROGRAMS)'; fi; \
- if test "$$foo"; then \
- failed=0; all=0; \
- for i in $$foo; do \
- all=`expr $$all + 1`; \
- if ./$$i --version > /dev/null 2>&1; then \
- echo "PASS: $$i"; \
- else \
- echo "FAIL: $$i"; \
- failed=`expr $$failed + 1`; \
- fi; \
- done; \
- if test "$$failed" -eq 0; then \
- banner="All $$all tests passed"; \
- else \
- banner="$$failed of $$all tests failed"; \
- fi; \
- dashes=`echo "$$banner" | sed s/./=/g`; \
- echo "$$dashes"; \
- echo "$$banner"; \
- echo "$$dashes"; \
- test "$$failed" -eq 0; \
- fi
-
-.x.c:
- @cmp -s $< $@ 2> /dev/null || cp $< $@
-#NROFF_MAN = nroff -man
-.1.cat1:
- $(NROFF_MAN) $< > $@
-.3.cat3:
- $(NROFF_MAN) $< > $@
-.5.cat5:
- $(NROFF_MAN) $< > $@
-.8.cat8:
- $(NROFF_MAN) $< > $@
-
-dist-cat1-mans:
- @foo='$(man1_MANS)'; \
- bar='$(man_MANS)'; \
- for i in $$bar; do \
- case $$i in \
- *.1) foo="$$foo $$i";; \
- esac; done ;\
- for i in $$foo; do \
- x=`echo $$i | sed 's/\.[^.]*$$/.cat1/'`; \
- echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
- $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
- done
-
-dist-cat3-mans:
- @foo='$(man3_MANS)'; \
- bar='$(man_MANS)'; \
- for i in $$bar; do \
- case $$i in \
- *.3) foo="$$foo $$i";; \
- esac; done ;\
- for i in $$foo; do \
- x=`echo $$i | sed 's/\.[^.]*$$/.cat3/'`; \
- echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
- $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
- done
-
-dist-cat5-mans:
- @foo='$(man5_MANS)'; \
- bar='$(man_MANS)'; \
- for i in $$bar; do \
- case $$i in \
- *.5) foo="$$foo $$i";; \
- esac; done ;\
- for i in $$foo; do \
- x=`echo $$i | sed 's/\.[^.]*$$/.cat5/'`; \
- echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
- $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
- done
-
-dist-cat8-mans:
- @foo='$(man8_MANS)'; \
- bar='$(man_MANS)'; \
- for i in $$bar; do \
- case $$i in \
- *.8) foo="$$foo $$i";; \
- esac; done ;\
- for i in $$foo; do \
- x=`echo $$i | sed 's/\.[^.]*$$/.cat8/'`; \
- echo "$(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x"; \
- $(NROFF_MAN) $(srcdir)/$$i > $(distdir)/$$x; \
- done
-
-dist-hook: dist-cat1-mans dist-cat3-mans dist-cat5-mans dist-cat8-mans
-
-install-cat-mans:
- $(SHELL) $(top_srcdir)/cf/install-catman.sh "$(INSTALL_DATA)" "$(mkinstalldirs)" "$(srcdir)" "$(DESTDIR)$(mandir)" '$(CATMANEXT)' $(man_MANS) $(man1_MANS) $(man3_MANS) $(man5_MANS) $(man8_MANS)
-
-install-data-hook: install-cat-mans
-
-.et.h:
- $(COMPILE_ET) $<
-.et.c:
- $(COMPILE_ET) $<
-# 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/admin/add.c b/crypto/heimdal/admin/add.c
deleted file mode 100644
index a6003800c9c5..000000000000
--- a/crypto/heimdal/admin/add.c
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "ktutil_locl.h"
-
-RCSID("$Id: add.c,v 1.5 2002/09/10 19:26:52 joda Exp $");
-
-int
-kt_add(int argc, char **argv)
-{
- krb5_error_code ret;
- krb5_keytab keytab;
- krb5_keytab_entry entry;
- char buf[128];
- char *principal_string = NULL;
- int kvno = -1;
- char *enctype_string = NULL;
- krb5_enctype enctype;
- char *password_string = NULL;
- int salt_flag = 1;
- int random_flag = 0;
- int help_flag = 0;
- struct getargs args[] = {
- { "principal", 'p', arg_string, NULL, "principal of key", "principal"},
- { "kvno", 'V', arg_integer, NULL, "key version of key" },
- { "enctype", 'e', arg_string, NULL, "encryption type of key" },
- { "password", 'w', arg_string, NULL, "password for key"},
- { "salt", 's', arg_negative_flag, NULL, "no salt" },
- { "random", 'r', arg_flag, NULL, "generate random key" },
- { "help", 'h', arg_flag, NULL }
- };
- int num_args = sizeof(args) / sizeof(args[0]);
- int optind = 0;
- int i = 0;
- args[i++].value = &principal_string;
- args[i++].value = &kvno;
- args[i++].value = &enctype_string;
- args[i++].value = &password_string;
- args[i++].value = &salt_flag;
- args[i++].value = &random_flag;
- args[i++].value = &help_flag;
-
- if(getarg(args, num_args, argc, argv, &optind)) {
- arg_printusage(args, num_args, "ktutil add", "");
- return 1;
- }
- if(help_flag) {
- arg_printusage(args, num_args, "ktutil add", "");
- return 1;
- }
- if((keytab = ktutil_open_keytab()) == NULL)
- return 1;
-
- memset(&entry, 0, sizeof(entry));
- if(principal_string == NULL) {
- printf("Principal: ");
- if (fgets(buf, sizeof(buf), stdin) == NULL)
- return 1;
- buf[strcspn(buf, "\r\n")] = '\0';
- principal_string = buf;
- }
- ret = krb5_parse_name(context, principal_string, &entry.principal);
- if(ret) {
- krb5_warn(context, ret, "%s", principal_string);
- goto out;
- }
- if(enctype_string == NULL) {
- printf("Encryption type: ");
- if (fgets(buf, sizeof(buf), stdin) == NULL)
- goto out;
- buf[strcspn(buf, "\r\n")] = '\0';
- enctype_string = buf;
- }
- ret = krb5_string_to_enctype(context, enctype_string, &enctype);
- if(ret) {
- int t;
- if(sscanf(enctype_string, "%d", &t) == 1)
- enctype = t;
- else {
- krb5_warn(context, ret, "%s", enctype_string);
- goto out;
- }
- }
- if(kvno == -1) {
- printf("Key version: ");
- if (fgets(buf, sizeof(buf), stdin) == NULL)
- goto out;
- buf[strcspn(buf, "\r\n")] = '\0';
- kvno = atoi(buf);
- }
- if(password_string == NULL && random_flag == 0) {
- if(des_read_pw_string(buf, sizeof(buf), "Password: ", 1))
- goto out;
- password_string = buf;
- }
- if(password_string) {
- if (!salt_flag) {
- krb5_salt salt;
- krb5_data pw;
-
- salt.salttype = KRB5_PW_SALT;
- salt.saltvalue.data = NULL;
- salt.saltvalue.length = 0;
- pw.data = (void*)password_string;
- pw.length = strlen(password_string);
- krb5_string_to_key_data_salt(context, enctype, pw, salt,
- &entry.keyblock);
- } else {
- krb5_string_to_key(context, enctype, password_string,
- entry.principal, &entry.keyblock);
- }
- memset (password_string, 0, strlen(password_string));
- } else {
- krb5_generate_random_keyblock(context, enctype, &entry.keyblock);
- }
- entry.vno = kvno;
- entry.timestamp = time (NULL);
- ret = krb5_kt_add_entry(context, keytab, &entry);
- if(ret)
- krb5_warn(context, ret, "add");
- out:
- krb5_kt_free_entry(context, &entry);
- krb5_kt_close(context, keytab);
- return 0;
-}
diff --git a/crypto/heimdal/admin/change.c b/crypto/heimdal/admin/change.c
deleted file mode 100644
index f790da3436fc..000000000000
--- a/crypto/heimdal/admin/change.c
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
- * Copyright (c) 1997 - 2001, 2003 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "ktutil_locl.h"
-
-RCSID("$Id: change.c,v 1.5 2003/04/01 15:04:49 lha Exp $");
-
-static void
-change_entry (krb5_context context, krb5_keytab keytab,
- krb5_principal principal, krb5_kvno kvno,
- const char *realm, const char *admin_server, int server_port)
-{
- krb5_error_code ret;
- kadm5_config_params conf;
- void *kadm_handle;
- char *client_name;
- krb5_keyblock *keys;
- int num_keys;
- int i;
-
- ret = krb5_unparse_name (context, principal, &client_name);
- if (ret) {
- krb5_warn (context, ret, "krb5_unparse_name");
- return;
- }
-
- memset (&conf, 0, sizeof(conf));
-
- if(realm)
- conf.realm = (char *)realm;
- else
- conf.realm = *krb5_princ_realm (context, principal);
- conf.mask |= KADM5_CONFIG_REALM;
-
- if (admin_server) {
- conf.admin_server = (char *)admin_server;
- conf.mask |= KADM5_CONFIG_ADMIN_SERVER;
- }
-
- if (server_port) {
- conf.kadmind_port = htons(server_port);
- conf.mask |= KADM5_CONFIG_KADMIND_PORT;
- }
-
- ret = kadm5_init_with_skey_ctx (context,
- client_name,
- keytab_string,
- KADM5_ADMIN_SERVICE,
- &conf, 0, 0,
- &kadm_handle);
- free (client_name);
- if (ret) {
- krb5_warn (context, ret, "kadm5_c_init_with_skey_ctx");
- return;
- }
- ret = kadm5_randkey_principal (kadm_handle, principal, &keys, &num_keys);
- kadm5_destroy (kadm_handle);
- if (ret) {
- krb5_warn(context, ret, "kadm5_randkey_principal");
- return;
- }
- for (i = 0; i < num_keys; ++i) {
- krb5_keytab_entry new_entry;
-
- new_entry.principal = principal;
- new_entry.timestamp = time (NULL);
- new_entry.vno = kvno + 1;
- new_entry.keyblock = keys[i];
-
- ret = krb5_kt_add_entry (context, keytab, &new_entry);
- if (ret)
- krb5_warn (context, ret, "krb5_kt_add_entry");
- krb5_free_keyblock_contents (context, &keys[i]);
- }
-}
-
-/*
- * loop over all the entries in the keytab (or those given) and change
- * their keys, writing the new keys
- */
-
-struct change_set {
- krb5_principal principal;
- krb5_kvno kvno;
-};
-
-int
-kt_change (int argc, char **argv)
-{
- krb5_error_code ret;
- krb5_keytab keytab;
- krb5_kt_cursor cursor;
- krb5_keytab_entry entry;
- char *realm = NULL;
- char *admin_server = NULL;
- int server_port = 0;
- int help_flag = 0;
- int optind = 0;
- int i, j, max;
- struct change_set *changeset;
-
- struct getargs args[] = {
- { "realm", 'r', arg_string, NULL,
- "realm to use", "realm"
- },
- { "admin-server", 'a', arg_string, NULL,
- "server to contact", "host"
- },
- { "server-port", 's', arg_integer, NULL,
- "port to contact", "port number"
- },
- { "help", 'h', arg_flag, NULL }
- };
-
- args[0].value = &realm;
- args[1].value = &admin_server;
- args[2].value = &server_port;
- args[3].value = &help_flag;
-
- if(getarg(args, sizeof(args) / sizeof(args[0]), argc, argv, &optind)
- || help_flag) {
- arg_printusage(args, sizeof(args) / sizeof(args[0]),
- "ktutil change", "principal...");
- return 1;
- }
-
- if((keytab = ktutil_open_keytab()) == NULL)
- return 1;
-
- j = 0;
- max = 0;
- changeset = NULL;
-
- ret = krb5_kt_start_seq_get(context, keytab, &cursor);
- if(ret){
- krb5_warn(context, ret, "krb5_kt_start_seq_get %s", keytab_string);
- goto out;
- }
-
- while((ret = krb5_kt_next_entry(context, keytab, &entry, &cursor)) == 0) {
- int add = 0;
-
- for (i = 0; i < j; ++i) {
- if (krb5_principal_compare (context, changeset[i].principal,
- entry.principal)) {
- if (changeset[i].kvno < entry.vno)
- changeset[i].kvno = entry.vno;
- break;
- }
- }
- if (i < j)
- continue;
-
- if (optind == argc) {
- add = 1;
- } else {
- for (i = optind; i < argc; ++i) {
- krb5_principal princ;
-
- ret = krb5_parse_name (context, argv[i], &princ);
- if (ret) {
- krb5_warn (context, ret, "krb5_parse_name %s", argv[i]);
- continue;
- }
- if (krb5_principal_compare (context, princ, entry.principal))
- add = 1;
-
- krb5_free_principal (context, princ);
- }
- }
-
- if (add) {
- if (j >= max) {
- void *tmp;
-
- max = max(max * 2, 1);
- tmp = realloc (changeset, max * sizeof(*changeset));
- if (tmp == NULL) {
- krb5_kt_free_entry (context, &entry);
- krb5_warnx (context, "realloc: out of memory");
- ret = ENOMEM;
- break;
- }
- changeset = tmp;
- }
- ret = krb5_copy_principal (context, entry.principal,
- &changeset[j].principal);
- if (ret) {
- krb5_warn (context, ret, "krb5_copy_principal");
- krb5_kt_free_entry (context, &entry);
- break;
- }
- changeset[j].kvno = entry.vno;
- ++j;
- }
- krb5_kt_free_entry (context, &entry);
- }
-
- if (ret == KRB5_KT_END) {
- for (i = 0; i < j; i++) {
- if (verbose_flag) {
- char *client_name;
-
- ret = krb5_unparse_name (context, changeset[i].principal,
- &client_name);
- if (ret) {
- krb5_warn (context, ret, "krb5_unparse_name");
- } else {
- printf("Changing %s kvno %d\n",
- client_name, changeset[i].kvno);
- free(client_name);
- }
- }
- change_entry (context, keytab,
- changeset[i].principal, changeset[i].kvno,
- realm, admin_server, server_port);
- }
- }
- for (i = 0; i < j; i++)
- krb5_free_principal (context, changeset[i].principal);
- free (changeset);
-
- ret = krb5_kt_end_seq_get(context, keytab, &cursor);
- out:
- krb5_kt_close(context, keytab);
- return 0;
-}
diff --git a/crypto/heimdal/admin/copy.c b/crypto/heimdal/admin/copy.c
deleted file mode 100644
index 18b9d6e0b428..000000000000
--- a/crypto/heimdal/admin/copy.c
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "ktutil_locl.h"
-
-RCSID("$Id: copy.c,v 1.9 2003/01/16 18:59:03 lha Exp $");
-
-
-static krb5_boolean
-compare_keyblock(const krb5_keyblock *a, const krb5_keyblock *b)
-{
- if(a->keytype != b->keytype ||
- a->keyvalue.length != b->keyvalue.length ||
- memcmp(a->keyvalue.data, b->keyvalue.data, a->keyvalue.length) != 0)
- return FALSE;
- return TRUE;
-}
-
-static int
-kt_copy_int (const char *from, const char *to)
-{
- krb5_error_code ret;
- krb5_keytab src_keytab, dst_keytab;
- krb5_kt_cursor cursor;
- krb5_keytab_entry entry, dummy;
-
- ret = krb5_kt_resolve (context, from, &src_keytab);
- if (ret) {
- krb5_warn (context, ret, "resolving src keytab `%s'", from);
- return 1;
- }
-
- ret = krb5_kt_resolve (context, to, &dst_keytab);
- if (ret) {
- krb5_kt_close (context, src_keytab);
- krb5_warn (context, ret, "resolving dst keytab `%s'", to);
- return 1;
- }
-
- ret = krb5_kt_start_seq_get (context, src_keytab, &cursor);
- if (ret) {
- krb5_warn (context, ret, "krb5_kt_start_seq_get %s", keytab_string);
- goto out;
- }
-
- if (verbose_flag)
- fprintf(stderr, "copying %s to %s\n", from, to);
-
- while((ret = krb5_kt_next_entry(context, src_keytab,
- &entry, &cursor)) == 0) {
- char *name_str;
- char *etype_str;
- krb5_unparse_name (context, entry.principal, &name_str);
- krb5_enctype_to_string(context, entry.keyblock.keytype, &etype_str);
- ret = krb5_kt_get_entry(context, dst_keytab,
- entry.principal,
- entry.vno,
- entry.keyblock.keytype,
- &dummy);
- if(ret == 0) {
- /* this entry is already in the new keytab, so no need to
- copy it; if the keyblocks are not the same, something
- is weird, so complain about that */
- if(!compare_keyblock(&entry.keyblock, &dummy.keyblock)) {
- krb5_warnx(context, "entry with different keyvalue "
- "already exists for %s, keytype %s, kvno %d",
- name_str, etype_str, entry.vno);
- }
- krb5_kt_free_entry(context, &dummy);
- krb5_kt_free_entry (context, &entry);
- free(name_str);
- free(etype_str);
- continue;
- } else if(ret != KRB5_KT_NOTFOUND) {
- krb5_warn(context, ret, "krb5_kt_get_entry(%s)", name_str);
- krb5_kt_free_entry (context, &entry);
- free(name_str);
- free(etype_str);
- break;
- }
- if (verbose_flag)
- fprintf (stderr, "copying %s, keytype %s, kvno %d\n", name_str,
- etype_str, entry.vno);
- ret = krb5_kt_add_entry (context, dst_keytab, &entry);
- krb5_kt_free_entry (context, &entry);
- if (ret) {
- krb5_warn (context, ret, "krb5_kt_add_entry(%s)", name_str);
- free(name_str);
- free(etype_str);
- break;
- }
- free(name_str);
- free(etype_str);
- }
- krb5_kt_end_seq_get (context, src_keytab, &cursor);
-
- out:
- krb5_kt_close (context, src_keytab);
- krb5_kt_close (context, dst_keytab);
- return 0;
-}
-
-int
-kt_copy (int argc, char **argv)
-{
- int help_flag = 0;
- int optind = 0;
-
- struct getargs args[] = {
- { "help", 'h', arg_flag, NULL}
- };
-
- int num_args = sizeof(args) / sizeof(args[0]);
- int i = 0;
-
- args[i++].value = &help_flag;
-
- if(getarg(args, num_args, argc, argv, &optind)) {
- arg_printusage(args, num_args, "ktutil copy",
- "keytab-src keytab-dest");
- return 1;
- }
- if (help_flag) {
- arg_printusage(args, num_args, "ktutil copy",
- "keytab-src keytab-dest");
- return 1;
- }
-
- argv += optind;
- argc -= optind;
-
- if (argc != 2) {
- arg_printusage(args, num_args, "ktutil copy",
- "keytab-src keytab-dest");
- return 1;
- }
-
- return kt_copy_int(argv[0], argv[1]);
-}
-
-#ifndef KEYFILE
-#define KEYFILE SYSCONFDIR "/srvtab"
-#endif
-
-/* copy to from v4 srvtab, just short for copy */
-static int
-conv(int srvconv, int argc, char **argv)
-{
- int help_flag = 0;
- char *srvtab = KEYFILE;
- int optind = 0;
- char kt4[1024], kt5[1024];
-
- char *name;
-
- struct getargs args[] = {
- { "srvtab", 's', arg_string, NULL},
- { "help", 'h', arg_flag, NULL}
- };
-
- int num_args = sizeof(args) / sizeof(args[0]);
- int i = 0;
-
- args[i++].value = &srvtab;
- args[i++].value = &help_flag;
-
- if(srvconv)
- name = "ktutil srvconvert";
- else
- name = "ktutil srvcreate";
-
- if(getarg(args, num_args, argc, argv, &optind)){
- arg_printusage(args, num_args, name, "");
- return 1;
- }
- if(help_flag){
- arg_printusage(args, num_args, name, "");
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc != 0) {
- arg_printusage(args, num_args, name, "");
- return 1;
- }
-
- snprintf(kt4, sizeof(kt4), "krb4:%s", srvtab);
-
- if(srvconv) {
- if(keytab_string != NULL)
- return kt_copy_int(kt4, keytab_string);
- else {
- krb5_kt_default_modify_name(context, kt5, sizeof(kt5));
- return kt_copy_int(kt4, kt5);
- }
- } else {
- if(keytab_string != NULL)
- return kt_copy_int(keytab_string, kt4);
-
- krb5_kt_default_name(context, kt5, sizeof(kt5));
- return kt_copy_int(kt5, kt4);
- }
-}
-
-int
-srvconv(int argc, char **argv)
-{
- return conv(1, argc, argv);
-}
-
-int
-srvcreate(int argc, char **argv)
-{
- return conv(0, argc, argv);
-}
diff --git a/crypto/heimdal/admin/get.c b/crypto/heimdal/admin/get.c
deleted file mode 100644
index a9dfeec54926..000000000000
--- a/crypto/heimdal/admin/get.c
+++ /dev/null
@@ -1,269 +0,0 @@
-/*
- * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "ktutil_locl.h"
-
-RCSID("$Id: get.c,v 1.22 2003/01/16 19:03:23 lha Exp $");
-
-static void*
-open_kadmin_connection(char *principal,
- const char *realm,
- char *admin_server,
- int server_port)
-{
- static kadm5_config_params conf;
- krb5_error_code ret;
- void *kadm_handle;
- memset(&conf, 0, sizeof(conf));
-
- if(realm) {
- conf.realm = (char*)realm;
- conf.mask |= KADM5_CONFIG_REALM;
- }
-
- if (admin_server) {
- conf.admin_server = admin_server;
- conf.mask |= KADM5_CONFIG_ADMIN_SERVER;
- }
-
- if (server_port) {
- conf.kadmind_port = htons(server_port);
- conf.mask |= KADM5_CONFIG_KADMIND_PORT;
- }
-
- /* should get realm from each principal, instead of doing
- everything with the same (local) realm */
-
- ret = kadm5_init_with_password_ctx(context,
- principal,
- NULL,
- KADM5_ADMIN_SERVICE,
- &conf, 0, 0,
- &kadm_handle);
- if(ret) {
- krb5_warn(context, ret, "kadm5_init_with_password");
- return NULL;
- }
- return kadm_handle;
-}
-
-int
-kt_get(int argc, char **argv)
-{
- krb5_error_code ret = 0;
- krb5_keytab keytab;
- void *kadm_handle = NULL;
- char *principal = NULL;
- char *realm = NULL;
- char *admin_server = NULL;
- int server_port = 0;
- int help_flag = 0;
- int optind = 0;
- struct getarg_strings etype_strs = {0, NULL};
- krb5_enctype *etypes = NULL;
- size_t netypes = 0;
-
- struct getargs args[] = {
- { "principal", 'p', arg_string, NULL,
- "admin principal", "principal"
- },
- { "enctypes", 'e', arg_strings, NULL,
- "encryption types to use", "enctypes" },
- { "realm", 'r', arg_string, NULL,
- "realm to use", "realm"
- },
- { "admin-server", 'a', arg_string, NULL,
- "server to contact", "host"
- },
- { "server-port", 's', arg_integer, NULL,
- "port to contact", "port number"
- },
- { "help", 'h', arg_flag, NULL }
- };
- int i = 0, j;
-
- args[i++].value = &principal;
- args[i++].value = &etype_strs;
- args[i++].value = &realm;
- args[i++].value = &admin_server;
- args[i++].value = &server_port;
- args[i++].value = &help_flag;
-
- if(getarg(args, sizeof(args) / sizeof(args[0]), argc, argv, &optind)
- || help_flag) {
- arg_printusage(args, sizeof(args) / sizeof(args[0]),
- "ktutil get", "principal...");
- return 1;
- }
- if(optind == argc) {
- krb5_warnx(context, "no principals specified");
- arg_printusage(args, sizeof(args) / sizeof(args[0]),
- "ktutil get", "principal...");
- return 1;
- }
-
- if((keytab = ktutil_open_keytab()) == NULL)
- return 1;
-
- if(realm)
- krb5_set_default_realm(context, realm);
-
- if (etype_strs.num_strings) {
- int i;
-
- etypes = malloc (etype_strs.num_strings * sizeof(*etypes));
- if (etypes == NULL) {
- krb5_warnx(context, "malloc failed");
- goto out;
- }
- netypes = etype_strs.num_strings;
- for(i = 0; i < netypes; i++) {
- ret = krb5_string_to_enctype(context,
- etype_strs.strings[i],
- &etypes[i]);
- if(ret) {
- krb5_warnx(context, "unrecognized enctype: %s",
- etype_strs.strings[i]);
- goto out;
- }
- }
- }
-
-
- for(i = optind; i < argc; i++){
- krb5_principal princ_ent;
- kadm5_principal_ent_rec princ;
- int mask = 0;
- krb5_keyblock *keys;
- int n_keys;
- int created = 0;
- krb5_keytab_entry entry;
-
- ret = krb5_parse_name(context, argv[i], &princ_ent);
- memset(&princ, 0, sizeof(princ));
- princ.principal = princ_ent;
- mask |= KADM5_PRINCIPAL;
- princ.attributes |= KRB5_KDB_DISALLOW_ALL_TIX;
- mask |= KADM5_ATTRIBUTES;
- princ.princ_expire_time = 0;
- mask |= KADM5_PRINC_EXPIRE_TIME;
-
- if(kadm_handle == NULL) {
- const char *r;
- if(realm != NULL)
- r = realm;
- else
- r = krb5_principal_get_realm(context, princ_ent);
- kadm_handle = open_kadmin_connection(principal,
- r,
- admin_server,
- server_port);
- if(kadm_handle == NULL) {
- break;
- }
- }
-
- ret = kadm5_create_principal(kadm_handle, &princ, mask, "x");
- if(ret == 0)
- created++;
- else if(ret != KADM5_DUP) {
- krb5_warn(context, ret, "kadm5_create_principal(%s)", argv[i]);
- krb5_free_principal(context, princ_ent);
- continue;
- }
- ret = kadm5_randkey_principal(kadm_handle, princ_ent, &keys, &n_keys);
- if (ret) {
- krb5_warn(context, ret, "kadm5_randkey_principal(%s)", argv[i]);
- krb5_free_principal(context, princ_ent);
- continue;
- }
-
- ret = kadm5_get_principal(kadm_handle, princ_ent, &princ,
- KADM5_PRINCIPAL | KADM5_KVNO | KADM5_ATTRIBUTES);
- if (ret) {
- krb5_warn(context, ret, "kadm5_get_principal(%s)", argv[i]);
- for (j = 0; j < n_keys; j++)
- krb5_free_keyblock_contents(context, &keys[j]);
- krb5_free_principal(context, princ_ent);
- continue;
- }
- princ.attributes &= (~KRB5_KDB_DISALLOW_ALL_TIX);
- mask = KADM5_ATTRIBUTES;
- if(created) {
- princ.kvno = 1;
- mask |= KADM5_KVNO;
- }
- ret = kadm5_modify_principal(kadm_handle, &princ, mask);
- if (ret) {
- krb5_warn(context, ret, "kadm5_modify_principal(%s)", argv[i]);
- for (j = 0; j < n_keys; j++)
- krb5_free_keyblock_contents(context, &keys[j]);
- krb5_free_principal(context, princ_ent);
- continue;
- }
- for(j = 0; j < n_keys; j++) {
- int do_add = TRUE;
-
- if (netypes) {
- int i;
-
- do_add = FALSE;
- for (i = 0; i < netypes; ++i)
- if (keys[j].keytype == etypes[i]) {
- do_add = TRUE;
- break;
- }
- }
- if (do_add) {
- entry.principal = princ_ent;
- entry.vno = princ.kvno;
- entry.keyblock = keys[j];
- entry.timestamp = time (NULL);
- ret = krb5_kt_add_entry(context, keytab, &entry);
- if (ret)
- krb5_warn(context, ret, "krb5_kt_add_entry");
- }
- krb5_free_keyblock_contents(context, &keys[j]);
- }
-
- kadm5_free_principal_ent(kadm_handle, &princ);
- krb5_free_principal(context, princ_ent);
- }
- out:
- free_getarg_strings(&etype_strs);
- free(etypes);
- if (kadm_handle)
- kadm5_destroy(kadm_handle);
- krb5_kt_close(context, keytab);
- return ret != 0;
-}
diff --git a/crypto/heimdal/admin/ktutil.8 b/crypto/heimdal/admin/ktutil.8
deleted file mode 100644
index f75a953e5dbd..000000000000
--- a/crypto/heimdal/admin/ktutil.8
+++ /dev/null
@@ -1,194 +0,0 @@
-.\" Copyright (c) 1997 - 2003 Kungliga Tekniska Högskolan
-.\" (Royal Institute of Technology, Stockholm, Sweden).
-.\" All rights reserved.
-.\"
-.\" Redistribution and use in source and binary forms, with or without
-.\" modification, are permitted provided that the following conditions
-.\" are met:
-.\"
-.\" 1. Redistributions of source code must retain the above copyright
-.\" notice, this list of conditions and the following disclaimer.
-.\"
-.\" 2. Redistributions in binary form must reproduce the above copyright
-.\" notice, this list of conditions and the following disclaimer in the
-.\" documentation and/or other materials provided with the distribution.
-.\"
-.\" 3. Neither the name of the Institute nor the names of its contributors
-.\" may be used to endorse or promote products derived from this software
-.\" without specific prior written permission.
-.\"
-.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
-.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
-.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\" SUCH DAMAGE.
-.\"
-.\" $Id: ktutil.8,v 1.19 2003/04/08 20:55:10 lha Exp $
-.\"
-.Dd December 16, 2000
-.Dt KTUTIL 8
-.Os HEIMDAL
-.Sh NAME
-.Nm ktutil
-.Nd manage Kerberos keytabs
-.Sh SYNOPSIS
-.Nm
-.Oo Fl k Ar keytab \*(Ba Xo
-.Fl -keytab= Ns Ar keytab
-.Xc
-.Oc
-.Op Fl v | Fl -verbose
-.Op Fl -version
-.Op Fl h | Fl -help
-.Ar command
-.Op Ar args
-.Sh DESCRIPTION
-.Nm
-is a program for managing keytabs.
-Supported options:
-.Bl -tag -width Ds
-.It Xo
-.Fl v ,
-.Fl -verbose
-.Xc
-Verbose output.
-.El
-.Pp
-.Ar command
-can be one of the following:
-.Bl -tag -width srvconvert
-.It add Xo
-.Op Fl p Ar principal
-.Op Fl -principal= Ns Ar principal
-.Op Fl V Ar kvno
-.Op Fl -kvno= Ns Ar kvno
-.Op Fl e Ar enctype
-.Op Fl -enctype= Ns Ar enctype
-.Op Fl w Ar password
-.Op Fl -password= Ns Ar password
-.Op Fl r
-.Op Fl -random
-.Op Fl s
-.Op Fl -no-salt
-.Xc
-Adds a key to the keytab. Options that are not specified will be
-prompted for. This requires that you know the password of the
-principal to add; if what you really want is to add a new principal to
-the keytab, you should consider the
-.Ar get
-command, which talks to the kadmin server.
-.It change Xo
-.Op Fl r Ar realm
-.Op Fl -realm= Ns Ar realm
-.Op Fl -a Ar host
-.Op Fl -admin-server= Ns Ar host
-.Op Fl -s Ar port
-.Op Fl -server-port= Ns Ar port
-.Xc
-Update one or several keys to new versions. By default, use the admin
-server for the realm of a keytab entry. Otherwise it will use the
-values specified by the options.
-.Pp
-If no principals are given, all the ones in the keytab are updated.
-.It copy Xo
-.Ar keytab-src
-.Ar keytab-dest
-.Xc
-Copies all the entries from
-.Ar keytab-src
-to
-.Ar keytab-dest .
-.It get Xo
-.Op Fl p Ar admin principal
-.Op Fl -principal= Ns Ar admin principal
-.Op Fl e Ar enctype
-.Op Fl -enctypes= Ns Ar enctype
-.Op Fl r Ar realm
-.Op Fl -realm= Ns Ar realm
-.Op Fl a Ar admin server
-.Op Fl -admin-server= Ns Ar admin server
-.Op Fl s Ar server port
-.Op Fl -server-port= Ns Ar server port
-.Ar principal ...
-.Xc
-For each
-.Ar principal ,
-generate a new key for it (creating it if it doesn't already exist),
-and put that key in the keytab.
-.Pp
-If no
-.Ar realm
-is specified, the realm to operate on is taken from the first
-principal.
-.It list Xo
-.Op Fl -keys
-.Op Fl -timestamp
-.Xc
-List the keys stored in the keytab.
-.It remove Xo
-.Op Fl p Ar principal
-.Op Fl -principal= Ns Ar principal
-.Op Fl V kvno
-.Op Fl -kvno= Ns Ar kvno
-.Op Fl e enctype
-.Op Fl -enctype= Ns Ar enctype
-.Xc
-Removes the specified key or keys. Not specifying a
-.Ar kvno
-removes keys with any version number. Not specifying an
-.Ar enctype
-removes keys of any type.
-.It rename Xo
-.Ar from-principal
-.Ar to-principal
-.Xc
-Renames all entries in the keytab that match the
-.Ar from-principal
-to
-.Ar to-principal .
-.It purge Xo
-.Op Fl -age= Ns Ar age
-.Xc
-Removes all old entries (for which there is a newer version) that are
-older than
-.Ar age
-(default one week).
-.It srvconvert
-.It srv2keytab Xo
-.Op Fl s Ar srvtab
-.Op Fl -srvtab= Ns Ar srvtab
-.Xc
-Converts the version 4 srvtab in
-.Ar srvtab
-to a version 5 keytab and stores it in
-.Ar keytab .
-Identical to:
-.Bd -ragged -offset indent
-.Li ktutil copy
-.Li krb4: Ns Ar srvtab
-.Ar keytab
-.Ed
-.It srvcreate
-.It key2srvtab Xo
-.Op Fl s Ar srvtab
-.Op Fl -srvtab= Ns Ar srvtab
-.Xc
-Converts the version 5 keytab in
-.Ar keytab
-to a version 4 srvtab and stores it in
-.Ar srvtab .
-Identical to:
-.Bd -ragged -offset indent
-.Li ktutil copy
-.Ar keytab
-.Li krb4: Ns Ar srvtab
-.Ed
-.El
-.Sh SEE ALSO
-.Xr kadmin 8
diff --git a/crypto/heimdal/admin/ktutil.c b/crypto/heimdal/admin/ktutil.c
deleted file mode 100644
index 7ac9b4bd774e..000000000000
--- a/crypto/heimdal/admin/ktutil.c
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "ktutil_locl.h"
-#include <err.h>
-
-RCSID("$Id: ktutil.c,v 1.36 2002/02/11 14:14:11 joda Exp $");
-
-static int help_flag;
-static int version_flag;
-int verbose_flag;
-char *keytab_string;
-static char keytab_buf[256];
-
-static int help(int argc, char **argv);
-
-static SL_cmd cmds[] = {
- { "add", kt_add, "add",
- "adds key to keytab" },
- { "change", kt_change, "change [principal...]",
- "get new key for principals (all)" },
- { "copy", kt_copy, "copy src dst",
- "copy one keytab to another" },
- { "get", kt_get, "get [principal...]",
- "create key in database and add to keytab" },
- { "list", kt_list, "list",
- "shows contents of a keytab" },
- { "purge", kt_purge, "purge",
- "remove old and superceeded entries" },
- { "remove", kt_remove, "remove",
- "remove key from keytab" },
- { "rename", kt_rename, "rename from to",
- "rename entry" },
- { "srvconvert", srvconv, "srvconvert [flags]",
- "convert v4 srvtab to keytab" },
- { "srv2keytab" },
- { "srvcreate", srvcreate, "srvcreate [flags]",
- "convert keytab to v4 srvtab" },
- { "key2srvtab" },
- { "help", help, "help", "" },
- { NULL, NULL, NULL, NULL }
-};
-
-static struct getargs args[] = {
- {
- "version",
- 0,
- arg_flag,
- &version_flag,
- NULL,
- NULL
- },
- {
- "help",
- 'h',
- arg_flag,
- &help_flag,
- NULL,
- NULL
- },
- {
- "keytab",
- 'k',
- arg_string,
- &keytab_string,
- "keytab",
- "keytab to operate on"
- },
- {
- "verbose",
- 'v',
- arg_flag,
- &verbose_flag,
- "verbose",
- "run verbosely"
- }
-};
-
-static int num_args = sizeof(args) / sizeof(args[0]);
-
-krb5_context context;
-
-krb5_keytab
-ktutil_open_keytab(void)
-{
- krb5_error_code ret;
- krb5_keytab keytab;
- if (keytab_string == NULL) {
- ret = krb5_kt_default_name (context, keytab_buf, sizeof(keytab_buf));
- if (ret) {
- krb5_warn(context, ret, "krb5_kt_default_name");
- return NULL;
- }
- keytab_string = keytab_buf;
- }
- ret = krb5_kt_resolve(context, keytab_string, &keytab);
- if (ret) {
- krb5_warn(context, ret, "resolving keytab %s", keytab_string);
- return NULL;
- }
- if (verbose_flag)
- fprintf (stderr, "Using keytab %s\n", keytab_string);
-
- return keytab;
-}
-
-static int
-help(int argc, char **argv)
-{
- sl_help(cmds, argc, argv);
- return 0;
-}
-
-static void
-usage(int status)
-{
- arg_printusage(args, num_args, NULL, "command");
- exit(status);
-}
-
-int
-main(int argc, char **argv)
-{
- int optind = 0;
- krb5_error_code ret;
- setprogname(argv[0]);
- ret = krb5_init_context(&context);
- if (ret)
- errx (1, "krb5_init_context failed: %d", ret);
- if(getarg(args, num_args, argc, argv, &optind))
- usage(1);
- if(help_flag)
- usage(0);
- if(version_flag) {
- print_version(NULL);
- exit(0);
- }
- argc -= optind;
- argv += optind;
- if(argc == 0)
- usage(1);
- ret = sl_command(cmds, argc, argv);
- if(ret == -1)
- krb5_warnx (context, "unrecognized command: %s", argv[0]);
- return ret;
-}
diff --git a/crypto/heimdal/admin/ktutil.cat8 b/crypto/heimdal/admin/ktutil.cat8
deleted file mode 100644
index 8cfd85619a0d..000000000000
--- a/crypto/heimdal/admin/ktutil.cat8
+++ /dev/null
@@ -1,81 +0,0 @@
-KTUTIL(8) NetBSD System Manager's Manual KTUTIL(8)
-
-NNAAMMEE
- kkttuuttiill - manage Kerberos keytabs
-
-SSYYNNOOPPSSIISS
- kkttuuttiill [--kk _k_e_y_t_a_b | ----kkeeyyttaabb==_k_e_y_t_a_b] [--vv | ----vveerrbboossee] [----vveerrssiioonn] [--hh |
- ----hheellpp] _c_o_m_m_a_n_d [_a_r_g_s]
-
-DDEESSCCRRIIPPTTIIOONN
- kkttuuttiill is a program for managing keytabs. _c_o_m_m_a_n_d can be one of the fol-
- lowing:
-
- add [--pp _p_r_i_n_c_i_p_a_l] [----pprriinncciippaall==_p_r_i_n_c_i_p_a_l] [--VV _k_v_n_o] [----kkvvnnoo==_k_v_n_o] [--ee
- _e_n_c_y_p_e] [----eennccttyyppee==_e_n_c_t_y_p_e] [--ww _p_a_s_s_w_o_r_d]
- [----ppaasssswwoorrdd==_p_a_s_s_w_o_r_d] [--rr] [----rraannddoomm] [--ss] [----nnoo--ssaalltt]
- Adds a key to the keytab. Options that are not specified will
- be prompted for. This requires that you know the password of
- the principal to add; if what you really want is to add a new
- principal to the keytab, you should consider the _g_e_t command,
- which talks to the kadmin server.
-
- change [--rr _r_e_a_l_m] [----rreeaallmm==_r_e_a_l_m] [----aa _h_o_s_t] [----aaddmmiinn--sseerrvveerr==_h_o_s_t] [----ss
- _p_o_r_t] [----sseerrvveerr--ppoorrtt==_p_o_r_t]
- Update one or several keys to new versions. By default, use
- the admin server for the realm of an keytab entry. Otherwise
- it will use the values specified by the options.
-
- If no principals are given, all the ones in the keytab are
- updated.
-
- copy _k_e_y_t_a_b_-_s_r_c _k_e_y_t_a_b_-_d_e_s_t
- Copies all the entries from _k_e_y_t_a_b_-_s_r_c to _k_e_y_t_a_b_-_d_e_s_t.
-
- get [--pp _a_d_m_i_n _p_r_i_n_c_i_p_a_l] [----pprriinncciippaall==_a_d_m_i_n _p_r_i_n_c_i_p_a_l] [--ee _e_n_c_t_y_p_e]
- [----eennccttyyppeess==_e_n_c_t_y_p_e] [--rr _r_e_a_l_m] [----rreeaallmm==_r_e_a_l_m] [--aa _a_d_m_i_n
- _s_e_r_v_e_r] [----aaddmmiinn--sseerrvveerr==_a_d_m_i_n _s_e_r_v_e_r] [--ss _s_e_r_v_e_r _p_o_r_t]
- [----sseerrvveerr--ppoorrtt==_s_e_r_v_e_r _p_o_r_t] _p_r_i_n_c_i_p_a_l _._._.
- For each _p_r_i_n_c_i_p_a_l, generate a new key for it (creating it if
- it doesn't already exist), and put that key in the keytab.
-
- If no _r_e_a_l_m is specified, the realm to operate on is taken
- from the first principal.
-
- list [----kkeeyyss] [----ttiimmeessttaammpp]
- List the keys stored in the keytab.
-
- remove [--pp _p_r_i_n_c_i_p_a_l] [----pprriinncciippaall==_p_r_i_n_c_i_p_a_l] [--VV --kkvvnnoo] [----kkvvnnoo==_k_v_n_o]
- [--ee --eennccttyyppee] [----eennccttyyppee==_e_n_c_t_y_p_e]
- Removes the specified key or keys. Not specifying a _k_v_n_o re-
- moves keys with any version number. Not specifying a _e_n_c_t_y_p_e
- removes keys of any type.
-
- rename _f_r_o_m_-_p_r_i_n_c_i_p_a_l _t_o_-_p_r_i_n_c_i_p_a_l
- Renames all entries in the keytab that match the _f_r_o_m_-
- _p_r_i_n_c_i_p_a_l to _t_o_-_p_r_i_n_c_i_p_a_l.
-
- purge [----aaggee==_a_g_e]
- Removes all old entries (for which there is a newer version)
- that are older than _a_g_e (default one week).
-
- srvconvert
-
- srv2keytab [--ss _s_r_v_t_a_b] [----ssrrvvttaabb==_s_r_v_t_a_b]
- Converts the version 4 srvtab in _s_r_v_t_a_b to a version 5 keytab
- and stores it in _k_e_y_t_a_b. Identical to:
-
- ktutil copy krb4:_s_r_v_t_a_b _k_e_y_t_a_b
-
- srvcreate
-
- key2srvtab [--ss _s_r_v_t_a_b] [----ssrrvvttaabb==_s_r_v_t_a_b]
- Converts the version 5 keytab in _k_e_y_t_a_b to a version 4 srvtab
- and stores it in _s_r_v_t_a_b. Identical to:
-
- ktutil copy _k_e_y_t_a_b krb4:_s_r_v_t_a_b
-
-SSEEEE AALLSSOO
- kadmin(8)
-
- HEIMDAL December 16, 2000 2
diff --git a/crypto/heimdal/admin/ktutil_locl.h b/crypto/heimdal/admin/ktutil_locl.h
deleted file mode 100644
index da60f426ba0c..000000000000
--- a/crypto/heimdal/admin/ktutil_locl.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * $Id: ktutil_locl.h,v 1.18 2002/09/10 20:03:45 joda Exp $
- */
-
-#ifndef __KTUTIL_LOCL_H__
-#define __KTUTIL_LOCL_H__
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <parse_time.h>
-#include <roken.h>
-
-#include "crypto-headers.h"
-#include <krb5.h>
-#include <kadm5/admin.h>
-#include <kadm5/kadm5_err.h>
-
-#include <sl.h>
-#include <getarg.h>
-
-extern krb5_context context;
-
-extern int verbose_flag;
-extern char *keytab_string;
-
-krb5_keytab ktutil_open_keytab(void);
-
-int kt_add (int argc, char **argv);
-int kt_change (int argc, char **argv);
-int kt_copy (int argc, char **argv);
-int kt_get (int argc, char **argv);
-int kt_list(int argc, char **argv);
-int kt_purge(int argc, char **argv);
-int kt_remove(int argc, char **argv);
-int kt_rename(int argc, char **argv);
-int srvconv(int argc, char **argv);
-int srvcreate(int argc, char **argv);
-
-#endif /* __KTUTIL_LOCL_H__ */
diff --git a/crypto/heimdal/admin/list.c b/crypto/heimdal/admin/list.c
deleted file mode 100644
index 4c11c2f13f2c..000000000000
--- a/crypto/heimdal/admin/list.c
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Copyright (c) 1997 - 2002 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "ktutil_locl.h"
-
-RCSID("$Id: list.c,v 1.10 2002/01/30 10:12:21 joda Exp $");
-
-static int help_flag;
-static int list_keys;
-static int list_timestamp;
-
-static struct getargs args[] = {
- { "help", 'h', arg_flag, &help_flag },
- { "keys", 0, arg_flag, &list_keys, "show key value" },
- { "timestamp", 0, arg_flag, &list_timestamp, "show timestamp" },
-};
-
-static int num_args = sizeof(args) / sizeof(args[0]);
-
-struct key_info {
- char *version;
- char *etype;
- char *principal;
- char *timestamp;
- char *key;
- struct key_info *next;
-};
-
-static int
-do_list(const char *keytab_string)
-{
- krb5_error_code ret;
- krb5_keytab keytab;
- krb5_keytab_entry entry;
- krb5_kt_cursor cursor;
- struct key_info *ki, **kie = &ki, *kp;
-
- int max_version = sizeof("Vno") - 1;
- int max_etype = sizeof("Type") - 1;
- int max_principal = sizeof("Principal") - 1;
- int max_timestamp = sizeof("Date") - 1;
- int max_key = sizeof("Key") - 1;
-
- /* XXX specialcase the ANY type */
- if(strncasecmp(keytab_string, "ANY:", 4) == 0) {
- int flag = 0;
- char buf[1024];
- keytab_string += 4;
- while (strsep_copy((const char**)&keytab_string, ",",
- buf, sizeof(buf)) != -1) {
- if(flag)
- printf("\n");
- do_list(buf);
- flag = 1;
- }
- return 0;
- }
-
- ret = krb5_kt_resolve(context, keytab_string, &keytab);
- if (ret) {
- krb5_warn(context, ret, "resolving keytab %s", keytab_string);
- return 0;
- }
-
- ret = krb5_kt_start_seq_get(context, keytab, &cursor);
- if(ret){
- krb5_warn(context, ret, "krb5_kt_start_seq_get %s", keytab_string);
- goto out;
- }
-
- printf ("%s:\n\n", keytab_string);
-
- while((ret = krb5_kt_next_entry(context, keytab, &entry, &cursor)) == 0){
-#define CHECK_MAX(F) if(max_##F < strlen(kp->F)) max_##F = strlen(kp->F)
-
- kp = malloc(sizeof(*kp));
- if (kp == NULL) {
- krb5_kt_free_entry(context, &entry);
- krb5_kt_end_seq_get(context, keytab, &cursor);
- krb5_warn(context, ret, "malloc failed");
- goto out;
- }
-
- asprintf(&kp->version, "%d", entry.vno);
- CHECK_MAX(version);
- ret = krb5_enctype_to_string(context,
- entry.keyblock.keytype, &kp->etype);
- if (ret != 0)
- asprintf(&kp->etype, "unknown (%d)", entry.keyblock.keytype);
- CHECK_MAX(etype);
- krb5_unparse_name(context, entry.principal, &kp->principal);
- CHECK_MAX(principal);
- if (list_timestamp) {
- char tstamp[256];
-
- krb5_format_time(context, entry.timestamp,
- tstamp, sizeof(tstamp), FALSE);
-
- kp->timestamp = strdup(tstamp);
- CHECK_MAX(timestamp);
- }
- if(list_keys) {
- int i;
- kp->key = malloc(2 * entry.keyblock.keyvalue.length + 1);
- for(i = 0; i < entry.keyblock.keyvalue.length; i++)
- snprintf(kp->key + 2 * i, 3, "%02x",
- ((unsigned char*)entry.keyblock.keyvalue.data)[i]);
- CHECK_MAX(key);
- }
- *kie = kp;
- kie = &kp->next;
- krb5_kt_free_entry(context, &entry);
- }
- *kie = NULL; /* termiate list */
- ret = krb5_kt_end_seq_get(context, keytab, &cursor);
-
- printf("%-*s %-*s %-*s", max_version, "Vno",
- max_etype, "Type",
- max_principal, "Principal");
- if(list_timestamp)
- printf(" %-*s", max_timestamp, "Date");
- if(list_keys)
- printf(" %s", "Key");
- printf("\n");
-
- for(kp = ki; kp; ) {
- printf("%*s %-*s %-*s", max_version, kp->version,
- max_etype, kp->etype,
- max_principal, kp->principal);
- if(list_timestamp)
- printf(" %-*s", max_timestamp, kp->timestamp);
- if(list_keys)
- printf(" %s", kp->key);
- printf("\n");
-
- /* free entries */
- free(kp->version);
- free(kp->etype);
- free(kp->principal);
- if(list_timestamp)
- free(kp->timestamp);
- if(list_keys) {
- memset(kp->key, 0, strlen(kp->key));
- free(kp->key);
- }
- ki = kp;
- kp = kp->next;
- free(ki);
- }
-out:
- krb5_kt_close(context, keytab);
- return 0;
-}
-
-int
-kt_list(int argc, char **argv)
-{
- krb5_error_code ret;
- int optind = 0;
- char kt[1024];
-
- if(verbose_flag)
- list_timestamp = 1;
-
- if(getarg(args, num_args, argc, argv, &optind)){
- arg_printusage(args, num_args, "ktutil list", "");
- return 1;
- }
- if(help_flag){
- arg_printusage(args, num_args, "ktutil list", "");
- return 0;
- }
-
- if (keytab_string == NULL) {
- if((ret = krb5_kt_default_name(context, kt, sizeof(kt))) != 0) {
- krb5_warn(context, ret, "getting default keytab name");
- return 0;
- }
- keytab_string = kt;
- }
- do_list(keytab_string);
- return 0;
-}
diff --git a/crypto/heimdal/admin/purge.c b/crypto/heimdal/admin/purge.c
deleted file mode 100644
index aaca00a6c529..000000000000
--- a/crypto/heimdal/admin/purge.c
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "ktutil_locl.h"
-
-RCSID("$Id: purge.c,v 1.6 2001/07/23 09:46:41 joda Exp $");
-
-/*
- * keep track of the highest version for every principal.
- */
-
-struct e {
- krb5_principal principal;
- int max_vno;
- struct e *next;
-};
-
-static struct e *
-get_entry (krb5_principal princ, struct e *head)
-{
- struct e *e;
-
- for (e = head; e != NULL; e = e->next)
- if (krb5_principal_compare (context, princ, e->principal))
- return e;
- return NULL;
-}
-
-static void
-add_entry (krb5_principal princ, int vno, struct e **head)
-{
- krb5_error_code ret;
- struct e *e;
-
- e = get_entry (princ, *head);
- if (e != NULL) {
- e->max_vno = max (e->max_vno, vno);
- return;
- }
- e = malloc (sizeof (*e));
- if (e == NULL)
- krb5_errx (context, 1, "malloc: out of memory");
- ret = krb5_copy_principal (context, princ, &e->principal);
- if (ret)
- krb5_err (context, 1, ret, "krb5_copy_principal");
- e->max_vno = vno;
- e->next = *head;
- *head = e;
-}
-
-static void
-delete_list (struct e *head)
-{
- while (head != NULL) {
- struct e *next = head->next;
- krb5_free_principal (context, head->principal);
- free (head);
- head = next;
- }
-}
-
-/*
- * Remove all entries that have newer versions and that are older
- * than `age'
- */
-
-int
-kt_purge(int argc, char **argv)
-{
- krb5_error_code ret = 0;
- krb5_kt_cursor cursor;
- krb5_keytab keytab;
- krb5_keytab_entry entry;
- int help_flag = 0;
- char *age_str = "1 week";
- int age;
- struct getargs args[] = {
- { "age", 0, arg_string, NULL, "age to retire" },
- { "help", 'h', arg_flag, NULL }
- };
- int num_args = sizeof(args) / sizeof(args[0]);
- int optind = 0;
- int i = 0;
- struct e *head = NULL;
- time_t judgement_day;
-
- args[i++].value = &age_str;
- args[i++].value = &help_flag;
-
- if(getarg(args, num_args, argc, argv, &optind)) {
- arg_printusage(args, num_args, "ktutil purge", "");
- return 1;
- }
- if(help_flag) {
- arg_printusage(args, num_args, "ktutil purge", "");
- return 1;
- }
-
- age = parse_time(age_str, "s");
- if(age < 0) {
- krb5_warnx(context, "unparasable time `%s'", age_str);
- return 1;
- }
-
- if((keytab = ktutil_open_keytab()) == NULL)
- return 1;
-
- ret = krb5_kt_start_seq_get(context, keytab, &cursor);
- if(ret){
- krb5_warn(context, ret, "krb5_kt_start_seq_get %s", keytab_string);
- goto out;
- }
-
- while((ret = krb5_kt_next_entry(context, keytab, &entry, &cursor)) == 0) {
- add_entry (entry.principal, entry.vno, &head);
- krb5_kt_free_entry(context, &entry);
- }
- ret = krb5_kt_end_seq_get(context, keytab, &cursor);
-
- judgement_day = time (NULL);
-
- ret = krb5_kt_start_seq_get(context, keytab, &cursor);
- if(ret){
- krb5_warn(context, ret, "krb5_kt_start_seq_get, %s", keytab_string);
- goto out;
- }
-
- while((ret = krb5_kt_next_entry(context, keytab, &entry, &cursor)) == 0) {
- struct e *e = get_entry (entry.principal, head);
-
- if (e == NULL) {
- krb5_warnx (context, "ignoring extra entry");
- continue;
- }
-
- if (entry.vno < e->max_vno
- && judgement_day - entry.timestamp > age) {
- if (verbose_flag) {
- char *name_str;
-
- krb5_unparse_name (context, entry.principal, &name_str);
- printf ("removing %s vno %d\n", name_str, entry.vno);
- free (name_str);
- }
- ret = krb5_kt_remove_entry (context, keytab, &entry);
- if (ret)
- krb5_warn (context, ret, "remove");
- }
- krb5_kt_free_entry(context, &entry);
- }
- ret = krb5_kt_end_seq_get(context, keytab, &cursor);
-
- delete_list (head);
-
- out:
- krb5_kt_close (context, keytab);
- return ret != 0;
-}
diff --git a/crypto/heimdal/admin/remove.c b/crypto/heimdal/admin/remove.c
deleted file mode 100644
index 45f8119202ce..000000000000
--- a/crypto/heimdal/admin/remove.c
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "ktutil_locl.h"
-
-RCSID("$Id: remove.c,v 1.3 2001/07/23 09:46:41 joda Exp $");
-
-int
-kt_remove(int argc, char **argv)
-{
- krb5_error_code ret = 0;
- krb5_keytab_entry entry;
- krb5_keytab keytab;
- char *principal_string = NULL;
- krb5_principal principal = NULL;
- int kvno = 0;
- char *keytype_string = NULL;
- krb5_enctype enctype = 0;
- int help_flag = 0;
- struct getargs args[] = {
- { "principal", 'p', arg_string, NULL, "principal to remove" },
- { "kvno", 'V', arg_integer, NULL, "key version to remove" },
- { "enctype", 'e', arg_string, NULL, "enctype to remove" },
- { "help", 'h', arg_flag, NULL }
- };
- int num_args = sizeof(args) / sizeof(args[0]);
- int optind = 0;
- int i = 0;
- args[i++].value = &principal_string;
- args[i++].value = &kvno;
- args[i++].value = &keytype_string;
- args[i++].value = &help_flag;
- if(getarg(args, num_args, argc, argv, &optind)) {
- arg_printusage(args, num_args, "ktutil remove", "");
- return 1;
- }
- if(help_flag) {
- arg_printusage(args, num_args, "ktutil remove", "");
- return 0;
- }
- if(principal_string) {
- ret = krb5_parse_name(context, principal_string, &principal);
- if(ret) {
- krb5_warn(context, ret, "%s", principal_string);
- return 1;
- }
- }
- if(keytype_string) {
- ret = krb5_string_to_enctype(context, keytype_string, &enctype);
- if(ret) {
- int t;
- if(sscanf(keytype_string, "%d", &t) == 1)
- enctype = t;
- else {
- krb5_warn(context, ret, "%s", keytype_string);
- if(principal)
- krb5_free_principal(context, principal);
- return 1;
- }
- }
- }
- if (!principal && !enctype && !kvno) {
- krb5_warnx(context,
- "You must give at least one of "
- "principal, enctype or kvno.");
- return 1;
- }
-
- if((keytab = ktutil_open_keytab()) == NULL)
- return 1;
-
- entry.principal = principal;
- entry.keyblock.keytype = enctype;
- entry.vno = kvno;
- ret = krb5_kt_remove_entry(context, keytab, &entry);
- krb5_kt_close(context, keytab);
- if(ret)
- krb5_warn(context, ret, "remove");
- if(principal)
- krb5_free_principal(context, principal);
- return 0;
-}
-
diff --git a/crypto/heimdal/admin/rename.c b/crypto/heimdal/admin/rename.c
deleted file mode 100644
index dcfb35244f72..000000000000
--- a/crypto/heimdal/admin/rename.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "ktutil_locl.h"
-
-RCSID("$Id: rename.c,v 1.1 2001/07/23 10:17:32 joda Exp $");
-
-int
-kt_rename(int argc, char **argv)
-{
- krb5_error_code ret = 0;
- krb5_keytab_entry entry;
- krb5_keytab keytab;
- krb5_kt_cursor cursor;
- krb5_principal from_princ, to_princ;
- int help_flag = 0;
-
- struct getargs args[] = {
- { "help", 'h', arg_flag, NULL }
- };
- int num_args = sizeof(args) / sizeof(args[0]);
- int optind = 0;
- int i = 0;
-
- args[i++].value = &help_flag;
- if(getarg(args, num_args, argc, argv, &optind)) {
- arg_printusage(args, num_args, "ktutil rename", "from to");
- return 1;
- }
- if(help_flag) {
- arg_printusage(args, num_args, "ktutil rename", "from to");
- return 0;
- }
- argv += optind;
- argc -= optind;
- if(argc != 2) {
- arg_printusage(args, num_args, "ktutil rename", "from to");
- return 0;
- }
-
- ret = krb5_parse_name(context, argv[0], &from_princ);
- if(ret != 0) {
- krb5_warn(context, ret, "%s", argv[0]);
- return 0;
- }
-
- ret = krb5_parse_name(context, argv[1], &to_princ);
- if(ret != 0) {
- krb5_free_principal(context, from_princ);
- krb5_warn(context, ret, "%s", argv[1]);
- return 0;
- }
-
- if((keytab = ktutil_open_keytab()) == NULL) {
- krb5_free_principal(context, from_princ);
- krb5_free_principal(context, to_princ);
- return 1;
- }
-
- ret = krb5_kt_start_seq_get(context, keytab, &cursor);
- if(ret) {
- krb5_kt_close(context, keytab);
- krb5_free_principal(context, from_princ);
- krb5_free_principal(context, to_princ);
- return 1;
- }
- while(1) {
- ret = krb5_kt_next_entry(context, keytab, &entry, &cursor);
- if(ret != 0) {
- if(ret != KRB5_CC_END && ret != KRB5_KT_END)
- krb5_warn(context, ret, "getting entry from keytab");
- break;
- }
- if(krb5_principal_compare(context, entry.principal, from_princ)) {
- krb5_free_principal(context, entry.principal);
- entry.principal = to_princ;
- ret = krb5_kt_add_entry(context, keytab, &entry);
- if(ret) {
- entry.principal = NULL;
- krb5_kt_free_entry(context, &entry);
- krb5_warn(context, ret, "adding entry");
- break;
- }
- entry.principal = from_princ;
- ret = krb5_kt_remove_entry(context, keytab, &entry);
- if(ret) {
- entry.principal = NULL;
- krb5_kt_free_entry(context, &entry);
- krb5_warn(context, ret, "removing entry");
- break;
- }
- entry.principal = NULL;
- }
- krb5_kt_free_entry(context, &entry);
- }
- krb5_kt_end_seq_get(context, keytab, &cursor);
-
- krb5_free_principal(context, from_princ);
- krb5_free_principal(context, to_princ);
-
- return 0;
-}
-
diff --git a/crypto/heimdal/admin/srvconvert.c b/crypto/heimdal/admin/srvconvert.c
deleted file mode 100644
index e4a2b1104204..000000000000
--- a/crypto/heimdal/admin/srvconvert.c
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- * Copyright (c) 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "ktutil_locl.h"
-
-RCSID("$Id: srvconvert.c,v 1.11 2000/01/02 03:56:21 assar Exp $");
-
-/* convert a version 4 srvtab to a version 5 keytab */
-
-#ifndef KEYFILE
-#define KEYFILE "/etc/srvtab"
-#endif
-
-static char *srvtab = KEYFILE;
-static int help_flag;
-static int verbose;
-
-static struct getargs args[] = {
- { "srvtab", 's', arg_string, &srvtab, "srvtab to convert", "file" },
- { "help", 'h', arg_flag, &help_flag },
- { "verbose", 'v', arg_flag, &verbose },
-};
-
-static int num_args = sizeof(args) / sizeof(args[0]);
-
-int
-srvconv(int argc, char **argv)
-{
- krb5_error_code ret;
- int optind = 0;
- int fd;
- krb5_storage *sp;
-
- if(getarg(args, num_args, argc, argv, &optind)){
- arg_printusage(args, num_args, "ktutil srvconvert", "");
- return 1;
- }
- if(help_flag){
- arg_printusage(args, num_args, "ktutil srvconvert", "");
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc != 0) {
- arg_printusage(args, num_args, "ktutil srvconvert", "");
- return 1;
- }
-
- fd = open(srvtab, O_RDONLY);
- if(fd < 0){
- krb5_warn(context, errno, "%s", srvtab);
- return 1;
- }
- sp = krb5_storage_from_fd(fd);
- if(sp == NULL){
- close(fd);
- return 1;
- }
- while(1){
- char *service, *instance, *realm;
- int8_t kvno;
- des_cblock key;
- krb5_keytab_entry entry;
-
- ret = krb5_ret_stringz(sp, &service);
- if(ret == KRB5_CC_END) {
- ret = 0;
- break;
- }
- if(ret) {
- krb5_warn(context, ret, "reading service");
- break;
- }
- ret = krb5_ret_stringz(sp, &instance);
- if(ret) {
- krb5_warn(context, ret, "reading instance");
- free(service);
- break;
- }
- ret = krb5_ret_stringz(sp, &realm);
- if(ret) {
- krb5_warn(context, ret, "reading realm");
- free(service);
- free(instance);
- break;
- }
- ret = krb5_425_conv_principal(context, service, instance, realm,
- &entry.principal);
- free(service);
- free(instance);
- free(realm);
- if (ret) {
- krb5_warn(context, ret, "krb5_425_conv_principal (%s.%s@%s)",
- service, instance, realm);
- break;
- }
-
- ret = krb5_ret_int8(sp, &kvno);
- if(ret) {
- krb5_warn(context, ret, "reading kvno");
- krb5_free_principal(context, entry.principal);
- break;
- }
- ret = sp->fetch(sp, key, 8);
- if(ret < 0){
- krb5_warn(context, errno, "reading key");
- krb5_free_principal(context, entry.principal);
- break;
- }
- if(ret < 8) {
- krb5_warn(context, errno, "end of file while reading key");
- krb5_free_principal(context, entry.principal);
- break;
- }
-
- entry.vno = kvno;
- entry.timestamp = time (NULL);
- entry.keyblock.keyvalue.data = key;
- entry.keyblock.keyvalue.length = 8;
-
- if(verbose){
- char *p;
- ret = krb5_unparse_name(context, entry.principal, &p);
- if(ret){
- krb5_warn(context, ret, "krb5_unparse_name");
- krb5_free_principal(context, entry.principal);
- break;
- } else{
- fprintf(stderr, "Storing keytab for %s\n", p);
- free(p);
- }
-
- }
- entry.keyblock.keytype = ETYPE_DES_CBC_MD5;
- ret = krb5_kt_add_entry(context, keytab, &entry);
- entry.keyblock.keytype = ETYPE_DES_CBC_MD4;
- ret = krb5_kt_add_entry(context, keytab, &entry);
- entry.keyblock.keytype = ETYPE_DES_CBC_CRC;
- ret = krb5_kt_add_entry(context, keytab, &entry);
- krb5_free_principal(context, entry.principal);
- if(ret) {
- krb5_warn(context, ret, "krb5_kt_add_entry");
- break;
- }
- }
- krb5_storage_free(sp);
- close(fd);
- return ret;
-}
diff --git a/crypto/heimdal/admin/srvcreate.c b/crypto/heimdal/admin/srvcreate.c
deleted file mode 100644
index bc86bc89aa3b..000000000000
--- a/crypto/heimdal/admin/srvcreate.c
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright (c) 1997, 1998, 1999 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * 3. Neither the name of the Institute nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include "ktutil_locl.h"
-
-RCSID("$Id: srvcreate.c,v 1.3 1999/12/02 17:04:53 joda Exp $");
-
-/* convert a version 5 keytab to a version 4 srvtab */
-
-#ifndef KEYFILE
-#define KEYFILE "/etc/srvtab"
-#endif
-
-static char *srvtab = KEYFILE;
-static int help_flag;
-static int verbose;
-
-static struct getargs args[] = {
- { "srvtab", 's', arg_string, &srvtab, "srvtab to create", "file" },
- { "help", 'h', arg_flag, &help_flag },
- { "verbose", 'v', arg_flag, &verbose },
-};
-
-static int num_args = sizeof(args) / sizeof(args[0]);
-
-int
-srvcreate(int argc, char **argv)
-{
- krb5_error_code ret;
- int optind = 0;
- int fd;
- krb5_kt_cursor cursor;
- krb5_keytab_entry entry;
- char service[100], instance[100], realm[100];
- int8_t kvno;
-
- if(getarg(args, num_args, argc, argv, &optind)){
- arg_printusage(args, num_args, "ktutil srvcreate", "");
- return 1;
- }
- if(help_flag){
- arg_printusage(args, num_args, "ktutil srvcreate", "");
- return 0;
- }
-
- argc -= optind;
- argv += optind;
-
- if (argc != 0) {
- arg_printusage(args, num_args, "ktutil srvcreate", "");
- return 1;
- }
-
- ret = krb5_kt_start_seq_get(context, keytab, &cursor);
- if(ret){
- krb5_warn(context, ret, "krb5_kt_start_seq_get");
- return 1;
- }
-
- fd = open(srvtab, O_WRONLY |O_APPEND |O_CREAT, 0600);
- if(fd < 0){
- krb5_warn(context, errno, "%s", srvtab);
- return 1;
- }
-
- while((ret = krb5_kt_next_entry(context, keytab, &entry, &cursor)) == 0){
- ret = krb5_524_conv_principal(context, entry.principal,
- service, instance, realm);
- if(ret) {
- krb5_warn(context, ret, "krb5_524_conv_principal");
- close(fd);
- return 1;
- }
- if ( (entry.keyblock.keyvalue.length == 8) &&
- (entry.keyblock.keytype == ETYPE_DES_CBC_MD5) ) {
- if (verbose) {
- printf ("%s.%s@%s vno %d\n", service, instance, realm,
- entry.vno);
- }
-
- write(fd, service, strlen(service)+1);
- write(fd, instance, strlen(instance)+1);
- write(fd, realm, strlen(realm)+1);
- kvno = entry.vno;
- write(fd, &kvno, sizeof(kvno));
- write(fd, entry.keyblock. keyvalue.data, 8);
- }
- krb5_kt_free_entry(context, &entry);
- }
-
- close(fd);
- ret = krb5_kt_end_seq_get(context, keytab, &cursor);
- return ret;
-}