summaryrefslogtreecommitdiff
path: root/crypto/heimdal/kpasswd
diff options
context:
space:
mode:
authorStanislav Sedov <stas@FreeBSD.org>2011-09-29 05:23:57 +0000
committerStanislav Sedov <stas@FreeBSD.org>2011-09-29 05:23:57 +0000
commit31f1e9c17ffae440059e8cc532fa26b92d534f7b (patch)
treecf5b65423910d126fddaaf04b885d0de3507d692 /crypto/heimdal/kpasswd
parentc19800e8cd5640693f36f2040db4ab5e8d738146 (diff)
downloadsrc-test2-31f1e9c17ffae440059e8cc532fa26b92d534f7b.tar.gz
src-test2-31f1e9c17ffae440059e8cc532fa26b92d534f7b.zip
Notes
Diffstat (limited to 'crypto/heimdal/kpasswd')
-rw-r--r--crypto/heimdal/kpasswd/Makefile.am33
-rw-r--r--crypto/heimdal/kpasswd/Makefile.in956
-rw-r--r--crypto/heimdal/kpasswd/kpasswd-generator.c202
-rw-r--r--crypto/heimdal/kpasswd/kpasswd.168
-rw-r--r--crypto/heimdal/kpasswd/kpasswd.c247
-rw-r--r--crypto/heimdal/kpasswd/kpasswd_locl.h104
-rw-r--r--crypto/heimdal/kpasswd/kpasswdd.896
-rw-r--r--crypto/heimdal/kpasswd/kpasswdd.c859
8 files changed, 0 insertions, 2565 deletions
diff --git a/crypto/heimdal/kpasswd/Makefile.am b/crypto/heimdal/kpasswd/Makefile.am
deleted file mode 100644
index ecfb752e39dd..000000000000
--- a/crypto/heimdal/kpasswd/Makefile.am
+++ /dev/null
@@ -1,33 +0,0 @@
-# $Id: Makefile.am 20466 2007-04-20 08:29:05Z lha $
-
-include $(top_srcdir)/Makefile.am.common
-
-AM_CPPFLAGS += $(INCLUDE_hcrypto)
-
-man_MANS = kpasswd.1 kpasswdd.8
-
-bin_PROGRAMS = kpasswd
-
-kpasswd_SOURCES = kpasswd.c kpasswd_locl.h
-
-libexec_PROGRAMS = kpasswdd
-
-noinst_PROGRAMS = kpasswd-generator
-
-kpasswdd_SOURCES = kpasswdd.c kpasswd_locl.h
-
-kpasswdd_LDADD = \
- $(top_builddir)/lib/kadm5/libkadm5srv.la \
- $(top_builddir)/lib/hdb/libhdb.la \
- $(LIB_openldap) \
- $(LDADD) \
- $(LIB_pidfile) \
- $(LIB_dlopen) \
- $(DBLIB)
-
-LDADD = $(top_builddir)/lib/krb5/libkrb5.la \
- $(LIB_hcrypto) \
- $(top_builddir)/lib/asn1/libasn1.la \
- $(LIB_roken)
-
-EXTRA_DIST = $(man_MANS)
diff --git a/crypto/heimdal/kpasswd/Makefile.in b/crypto/heimdal/kpasswd/Makefile.in
deleted file mode 100644
index 5c0e6db071db..000000000000
--- a/crypto/heimdal/kpasswd/Makefile.in
+++ /dev/null
@@ -1,956 +0,0 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
-# @configure_input@
-
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006 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 20466 2007-04-20 08:29:05Z lha $
-
-# $Id: Makefile.am.common 10998 2002-05-19 18:35:37Z joda $
-
-# $Id: Makefile.am.common 22488 2008-01-21 11:47:22Z lha $
-
-VPATH = @srcdir@
-pkgdatadir = $(datadir)/@PACKAGE@
-pkglibdir = $(libdir)/@PACKAGE@
-pkgincludedir = $(includedir)/@PACKAGE@
-am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-install_sh_DATA = $(install_sh) -c -m 644
-install_sh_PROGRAM = $(install_sh) -c
-install_sh_SCRIPT = $(install_sh) -c
-INSTALL_HEADER = $(INSTALL_DATA)
-transform = $(program_transform_name)
-NORMAL_INSTALL = :
-PRE_INSTALL = :
-POST_INSTALL = :
-NORMAL_UNINSTALL = :
-PRE_UNINSTALL = :
-POST_UNINSTALL = :
-build_triplet = @build@
-host_triplet = @host@
-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(top_srcdir)/Makefile.am.common \
- $(top_srcdir)/cf/Makefile.am.common
-bin_PROGRAMS = kpasswd$(EXEEXT)
-libexec_PROGRAMS = kpasswdd$(EXEEXT)
-noinst_PROGRAMS = kpasswd-generator$(EXEEXT)
-subdir = kpasswd
-ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/cf/aix.m4 \
- $(top_srcdir)/cf/auth-modules.m4 $(top_srcdir)/cf/autobuild.m4 \
- $(top_srcdir)/cf/broken-getaddrinfo.m4 \
- $(top_srcdir)/cf/broken-glob.m4 \
- $(top_srcdir)/cf/broken-realloc.m4 \
- $(top_srcdir)/cf/broken-snprintf.m4 $(top_srcdir)/cf/broken.m4 \
- $(top_srcdir)/cf/broken2.m4 $(top_srcdir)/cf/c-attribute.m4 \
- $(top_srcdir)/cf/capabilities.m4 \
- $(top_srcdir)/cf/check-compile-et.m4 \
- $(top_srcdir)/cf/check-getpwnam_r-posix.m4 \
- $(top_srcdir)/cf/check-man.m4 \
- $(top_srcdir)/cf/check-netinet-ip-and-tcp.m4 \
- $(top_srcdir)/cf/check-type-extra.m4 \
- $(top_srcdir)/cf/check-var.m4 $(top_srcdir)/cf/check-x.m4 \
- $(top_srcdir)/cf/check-xau.m4 $(top_srcdir)/cf/crypto.m4 \
- $(top_srcdir)/cf/db.m4 $(top_srcdir)/cf/destdirs.m4 \
- $(top_srcdir)/cf/dlopen.m4 \
- $(top_srcdir)/cf/find-func-no-libs.m4 \
- $(top_srcdir)/cf/find-func-no-libs2.m4 \
- $(top_srcdir)/cf/find-func.m4 \
- $(top_srcdir)/cf/find-if-not-broken.m4 \
- $(top_srcdir)/cf/framework-security.m4 \
- $(top_srcdir)/cf/have-struct-field.m4 \
- $(top_srcdir)/cf/have-type.m4 $(top_srcdir)/cf/irix.m4 \
- $(top_srcdir)/cf/krb-bigendian.m4 \
- $(top_srcdir)/cf/krb-func-getlogin.m4 \
- $(top_srcdir)/cf/krb-ipv6.m4 $(top_srcdir)/cf/krb-prog-ln-s.m4 \
- $(top_srcdir)/cf/krb-readline.m4 \
- $(top_srcdir)/cf/krb-struct-spwd.m4 \
- $(top_srcdir)/cf/krb-struct-winsize.m4 \
- $(top_srcdir)/cf/largefile.m4 $(top_srcdir)/cf/mips-abi.m4 \
- $(top_srcdir)/cf/misc.m4 $(top_srcdir)/cf/need-proto.m4 \
- $(top_srcdir)/cf/osfc2.m4 $(top_srcdir)/cf/otp.m4 \
- $(top_srcdir)/cf/proto-compat.m4 $(top_srcdir)/cf/pthreads.m4 \
- $(top_srcdir)/cf/resolv.m4 $(top_srcdir)/cf/retsigtype.m4 \
- $(top_srcdir)/cf/roken-frag.m4 \
- $(top_srcdir)/cf/socket-wrapper.m4 $(top_srcdir)/cf/sunos.m4 \
- $(top_srcdir)/cf/telnet.m4 $(top_srcdir)/cf/test-package.m4 \
- $(top_srcdir)/cf/version-script.m4 $(top_srcdir)/cf/wflags.m4 \
- $(top_srcdir)/cf/win32.m4 $(top_srcdir)/cf/with-all.m4 \
- $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.in
-am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
- $(ACLOCAL_M4)
-mkinstalldirs = $(install_sh) -d
-CONFIG_HEADER = $(top_builddir)/include/config.h
-CONFIG_CLEAN_FILES =
-am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" \
- "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)"
-binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-libexecPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
-PROGRAMS = $(bin_PROGRAMS) $(libexec_PROGRAMS) $(noinst_PROGRAMS)
-am_kpasswd_OBJECTS = kpasswd.$(OBJEXT)
-kpasswd_OBJECTS = $(am_kpasswd_OBJECTS)
-kpasswd_LDADD = $(LDADD)
-am__DEPENDENCIES_1 =
-kpasswd_DEPENDENCIES = $(top_builddir)/lib/krb5/libkrb5.la \
- $(am__DEPENDENCIES_1) $(top_builddir)/lib/asn1/libasn1.la \
- $(am__DEPENDENCIES_1)
-kpasswd_generator_SOURCES = kpasswd-generator.c
-kpasswd_generator_OBJECTS = kpasswd-generator.$(OBJEXT)
-kpasswd_generator_LDADD = $(LDADD)
-kpasswd_generator_DEPENDENCIES = $(top_builddir)/lib/krb5/libkrb5.la \
- $(am__DEPENDENCIES_1) $(top_builddir)/lib/asn1/libasn1.la \
- $(am__DEPENDENCIES_1)
-am_kpasswdd_OBJECTS = kpasswdd.$(OBJEXT)
-kpasswdd_OBJECTS = $(am_kpasswdd_OBJECTS)
-am__DEPENDENCIES_2 = $(top_builddir)/lib/krb5/libkrb5.la \
- $(am__DEPENDENCIES_1) $(top_builddir)/lib/asn1/libasn1.la \
- $(am__DEPENDENCIES_1)
-kpasswdd_DEPENDENCIES = $(top_builddir)/lib/kadm5/libkadm5srv.la \
- $(top_builddir)/lib/hdb/libhdb.la $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_2) $(am__DEPENDENCIES_1) \
- $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
-DEFAULT_INCLUDES = -I. -I$(top_builddir)/include@am__isrc@
-depcomp =
-am__depfiles_maybe =
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
- $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
-SOURCES = $(kpasswd_SOURCES) kpasswd-generator.c $(kpasswdd_SOURCES)
-DIST_SOURCES = $(kpasswd_SOURCES) kpasswd-generator.c \
- $(kpasswdd_SOURCES)
-man1dir = $(mandir)/man1
-man8dir = $(mandir)/man8
-MANS = $(man_MANS)
-ETAGS = etags
-CTAGS = ctags
-DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = @ACLOCAL@
-AIX_EXTRA_KAFS = @AIX_EXTRA_KAFS@
-AMTAR = @AMTAR@
-AR = @AR@
-AUTOCONF = @AUTOCONF@
-AUTOHEADER = @AUTOHEADER@
-AUTOMAKE = @AUTOMAKE@
-AWK = @AWK@
-CANONICAL_HOST = @CANONICAL_HOST@
-CATMAN = @CATMAN@
-CATMANEXT = @CATMANEXT@
-CC = @CC@
-CFLAGS = @CFLAGS@
-COMPILE_ET = @COMPILE_ET@
-CPP = @CPP@
-CPPFLAGS = @CPPFLAGS@
-CXX = @CXX@
-CXXCPP = @CXXCPP@
-CXXFLAGS = @CXXFLAGS@
-CYGPATH_W = @CYGPATH_W@
-DBLIB = @DBLIB@
-DEFS = @DEFS@
-DIR_com_err = @DIR_com_err@
-DIR_hcrypto = @DIR_hcrypto@
-DIR_hdbdir = @DIR_hdbdir@
-DIR_roken = @DIR_roken@
-ECHO = @ECHO@
-ECHO_C = @ECHO_C@
-ECHO_N = @ECHO_N@
-ECHO_T = @ECHO_T@
-EGREP = @EGREP@
-EXEEXT = @EXEEXT@
-F77 = @F77@
-FFLAGS = @FFLAGS@
-GREP = @GREP@
-GROFF = @GROFF@
-INCLUDES_roken = @INCLUDES_roken@
-INCLUDE_hcrypto = @INCLUDE_hcrypto@
-INCLUDE_hesiod = @INCLUDE_hesiod@
-INCLUDE_krb4 = @INCLUDE_krb4@
-INCLUDE_openldap = @INCLUDE_openldap@
-INCLUDE_readline = @INCLUDE_readline@
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
-LDFLAGS = @LDFLAGS@
-LDFLAGS_VERSION_SCRIPT = @LDFLAGS_VERSION_SCRIPT@
-LEX = @LEX@
-LEXLIB = @LEXLIB@
-LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
-LIBADD_roken = @LIBADD_roken@
-LIBOBJS = @LIBOBJS@
-LIBS = @LIBS@
-LIBTOOL = @LIBTOOL@
-LIB_AUTH_SUBDIRS = @LIB_AUTH_SUBDIRS@
-LIB_NDBM = @LIB_NDBM@
-LIB_XauFileName = @LIB_XauFileName@
-LIB_XauReadAuth = @LIB_XauReadAuth@
-LIB_XauWriteAuth = @LIB_XauWriteAuth@
-LIB_bswap16 = @LIB_bswap16@
-LIB_bswap32 = @LIB_bswap32@
-LIB_com_err = @LIB_com_err@
-LIB_com_err_a = @LIB_com_err_a@
-LIB_com_err_so = @LIB_com_err_so@
-LIB_crypt = @LIB_crypt@
-LIB_db_create = @LIB_db_create@
-LIB_dbm_firstkey = @LIB_dbm_firstkey@
-LIB_dbopen = @LIB_dbopen@
-LIB_dlopen = @LIB_dlopen@
-LIB_dn_expand = @LIB_dn_expand@
-LIB_door_create = @LIB_door_create@
-LIB_el_init = @LIB_el_init@
-LIB_freeaddrinfo = @LIB_freeaddrinfo@
-LIB_gai_strerror = @LIB_gai_strerror@
-LIB_getaddrinfo = @LIB_getaddrinfo@
-LIB_gethostbyname = @LIB_gethostbyname@
-LIB_gethostbyname2 = @LIB_gethostbyname2@
-LIB_getnameinfo = @LIB_getnameinfo@
-LIB_getpwnam_r = @LIB_getpwnam_r@
-LIB_getsockopt = @LIB_getsockopt@
-LIB_hcrypto = @LIB_hcrypto@
-LIB_hcrypto_a = @LIB_hcrypto_a@
-LIB_hcrypto_appl = @LIB_hcrypto_appl@
-LIB_hcrypto_so = @LIB_hcrypto_so@
-LIB_hesiod = @LIB_hesiod@
-LIB_hstrerror = @LIB_hstrerror@
-LIB_kdb = @LIB_kdb@
-LIB_krb4 = @LIB_krb4@
-LIB_loadquery = @LIB_loadquery@
-LIB_logout = @LIB_logout@
-LIB_logwtmp = @LIB_logwtmp@
-LIB_openldap = @LIB_openldap@
-LIB_openpty = @LIB_openpty@
-LIB_otp = @LIB_otp@
-LIB_pidfile = @LIB_pidfile@
-LIB_readline = @LIB_readline@
-LIB_res_ndestroy = @LIB_res_ndestroy@
-LIB_res_nsearch = @LIB_res_nsearch@
-LIB_res_search = @LIB_res_search@
-LIB_roken = @LIB_roken@
-LIB_security = @LIB_security@
-LIB_setsockopt = @LIB_setsockopt@
-LIB_socket = @LIB_socket@
-LIB_syslog = @LIB_syslog@
-LIB_tgetent = @LIB_tgetent@
-LN_S = @LN_S@
-LTLIBOBJS = @LTLIBOBJS@
-MAINT = @MAINT@
-MAKEINFO = @MAKEINFO@
-MKDIR_P = @MKDIR_P@
-NROFF = @NROFF@
-OBJEXT = @OBJEXT@
-PACKAGE = @PACKAGE@
-PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
-PACKAGE_NAME = @PACKAGE_NAME@
-PACKAGE_STRING = @PACKAGE_STRING@
-PACKAGE_TARNAME = @PACKAGE_TARNAME@
-PACKAGE_VERSION = @PACKAGE_VERSION@
-PATH_SEPARATOR = @PATH_SEPARATOR@
-PTHREADS_CFLAGS = @PTHREADS_CFLAGS@
-PTHREADS_LIBS = @PTHREADS_LIBS@
-RANLIB = @RANLIB@
-SET_MAKE = @SET_MAKE@
-SHELL = @SHELL@
-STRIP = @STRIP@
-VERSION = @VERSION@
-VERSIONING = @VERSIONING@
-VOID_RETSIGTYPE = @VOID_RETSIGTYPE@
-WFLAGS = @WFLAGS@
-WFLAGS_NOIMPLICITINT = @WFLAGS_NOIMPLICITINT@
-WFLAGS_NOUNUSED = @WFLAGS_NOUNUSED@
-XMKMF = @XMKMF@
-X_CFLAGS = @X_CFLAGS@
-X_EXTRA_LIBS = @X_EXTRA_LIBS@
-X_LIBS = @X_LIBS@
-X_PRE_LIBS = @X_PRE_LIBS@
-YACC = @YACC@
-YFLAGS = @YFLAGS@
-abs_builddir = @abs_builddir@
-abs_srcdir = @abs_srcdir@
-abs_top_builddir = @abs_top_builddir@
-abs_top_srcdir = @abs_top_srcdir@
-ac_ct_CC = @ac_ct_CC@
-ac_ct_CXX = @ac_ct_CXX@
-ac_ct_F77 = @ac_ct_F77@
-am__leading_dot = @am__leading_dot@
-am__tar = @am__tar@
-am__untar = @am__untar@
-bindir = @bindir@
-build = @build@
-build_alias = @build_alias@
-build_cpu = @build_cpu@
-build_os = @build_os@
-build_vendor = @build_vendor@
-builddir = @builddir@
-datadir = @datadir@
-datarootdir = @datarootdir@
-docdir = @docdir@
-dpagaix_cflags = @dpagaix_cflags@
-dpagaix_ldadd = @dpagaix_ldadd@
-dpagaix_ldflags = @dpagaix_ldflags@
-dvidir = @dvidir@
-exec_prefix = @exec_prefix@
-host = @host@
-host_alias = @host_alias@
-host_cpu = @host_cpu@
-host_os = @host_os@
-host_vendor = @host_vendor@
-htmldir = @htmldir@
-includedir = @includedir@
-infodir = @infodir@
-install_sh = @install_sh@
-libdir = @libdir@
-libexecdir = @libexecdir@
-localedir = @localedir@
-localstatedir = @localstatedir@
-mandir = @mandir@
-mkdir_p = @mkdir_p@
-oldincludedir = @oldincludedir@
-pdfdir = @pdfdir@
-prefix = @prefix@
-program_transform_name = @program_transform_name@
-psdir = @psdir@
-sbindir = @sbindir@
-sharedstatedir = @sharedstatedir@
-srcdir = @srcdir@
-sysconfdir = @sysconfdir@
-target_alias = @target_alias@
-top_builddir = @top_builddir@
-top_srcdir = @top_srcdir@
-SUFFIXES = .et .h .x .z .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8
-AM_CPPFLAGS = -I$(top_builddir)/include $(INCLUDES_roken) \
- $(INCLUDE_hcrypto)
-@do_roken_rename_TRUE@ROKEN_RENAME = -DROKEN_RENAME
-AM_CFLAGS = $(WFLAGS)
-CP = cp
-buildinclude = $(top_builddir)/include
-LIB_getattr = @LIB_getattr@
-LIB_getpwent_r = @LIB_getpwent_r@
-LIB_odm_initialize = @LIB_odm_initialize@
-LIB_setpcred = @LIB_setpcred@
-HESIODLIB = @HESIODLIB@
-HESIODINCLUDE = @HESIODINCLUDE@
-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
-@KRB5_TRUE@LIB_tsasl = $(top_builddir)/lib/tsasl/libtsasl.la
-@DCE_TRUE@LIB_kdfs = $(top_builddir)/lib/kdfs/libkdfs.la
-man_MANS = kpasswd.1 kpasswdd.8
-kpasswd_SOURCES = kpasswd.c kpasswd_locl.h
-kpasswdd_SOURCES = kpasswdd.c kpasswd_locl.h
-kpasswdd_LDADD = \
- $(top_builddir)/lib/kadm5/libkadm5srv.la \
- $(top_builddir)/lib/hdb/libhdb.la \
- $(LIB_openldap) \
- $(LDADD) \
- $(LIB_pidfile) \
- $(LIB_dlopen) \
- $(DBLIB)
-
-LDADD = $(top_builddir)/lib/krb5/libkrb5.la \
- $(LIB_hcrypto) \
- $(top_builddir)/lib/asn1/libasn1.la \
- $(LIB_roken)
-
-EXTRA_DIST = $(man_MANS)
-all: all-am
-
-.SUFFIXES:
-.SUFFIXES: .et .h .x .z .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .c .lo .o .obj
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/cf/Makefile.am.common $(am__configure_deps)
- @for dep in $?; do \
- case '$(am__configure_deps)' in \
- *$$dep*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \
- && exit 0; \
- exit 1;; \
- esac; \
- done; \
- echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps kpasswd/Makefile'; \
- cd $(top_srcdir) && \
- $(AUTOMAKE) --foreign --ignore-deps kpasswd/Makefile
-.PRECIOUS: Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- @case '$?' in \
- *config.status*) \
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
- *) \
- echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
- cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
- esac;
-
-$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-
-$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
- cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-install-binPROGRAMS: $(bin_PROGRAMS)
- @$(NORMAL_INSTALL)
- test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
- @list='$(bin_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 $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
- else :; fi; \
- done
-
-uninstall-binPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
- rm -f "$(DESTDIR)$(bindir)/$$f"; \
- done
-
-clean-binPROGRAMS:
- @list='$(bin_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
-install-libexecPROGRAMS: $(libexec_PROGRAMS)
- @$(NORMAL_INSTALL)
- test -z "$(libexecdir)" || $(MKDIR_P) "$(DESTDIR)$(libexecdir)"
- @list='$(libexec_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 $(libexecPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(libexecdir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(libexecPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(libexecdir)/$$f" || exit 1; \
- else :; fi; \
- done
-
-uninstall-libexecPROGRAMS:
- @$(NORMAL_UNINSTALL)
- @list='$(libexec_PROGRAMS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f '$(DESTDIR)$(libexecdir)/$$f'"; \
- rm -f "$(DESTDIR)$(libexecdir)/$$f"; \
- done
-
-clean-libexecPROGRAMS:
- @list='$(libexec_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
-
-clean-noinstPROGRAMS:
- @list='$(noinst_PROGRAMS)'; for p in $$list; do \
- f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
- echo " rm -f $$p $$f"; \
- rm -f $$p $$f ; \
- done
-kpasswd$(EXEEXT): $(kpasswd_OBJECTS) $(kpasswd_DEPENDENCIES)
- @rm -f kpasswd$(EXEEXT)
- $(LINK) $(kpasswd_OBJECTS) $(kpasswd_LDADD) $(LIBS)
-kpasswd-generator$(EXEEXT): $(kpasswd_generator_OBJECTS) $(kpasswd_generator_DEPENDENCIES)
- @rm -f kpasswd-generator$(EXEEXT)
- $(LINK) $(kpasswd_generator_OBJECTS) $(kpasswd_generator_LDADD) $(LIBS)
-kpasswdd$(EXEEXT): $(kpasswdd_OBJECTS) $(kpasswdd_DEPENDENCIES)
- @rm -f kpasswdd$(EXEEXT)
- $(LINK) $(kpasswdd_OBJECTS) $(kpasswdd_LDADD) $(LIBS)
-
-mostlyclean-compile:
- -rm -f *.$(OBJEXT)
-
-distclean-compile:
- -rm -f *.tab.c
-
-.c.o:
- $(COMPILE) -c $<
-
-.c.obj:
- $(COMPILE) -c `$(CYGPATH_W) '$<'`
-
-.c.lo:
- $(LTCOMPILE) -c -o $@ $<
-
-mostlyclean-libtool:
- -rm -f *.lo
-
-clean-libtool:
- -rm -rf .libs _libs
-install-man1: $(man1_MANS) $(man_MANS)
- @$(NORMAL_INSTALL)
- test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
- @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
- l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
- for i in $$l2; do \
- case "$$i" in \
- *.1*) 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 \
- 1*) ;; \
- *) ext='1' ;; \
- 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)$(man1dir)/$$inst'"; \
- $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
- done
-uninstall-man1:
- @$(NORMAL_UNINSTALL)
- @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
- l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
- for i in $$l2; do \
- case "$$i" in \
- *.1*) list="$$list $$i" ;; \
- esac; \
- done; \
- for i in $$list; do \
- ext=`echo $$i | sed -e 's/^.*\\.//'`; \
- case "$$ext" in \
- 1*) ;; \
- *) ext='1' ;; \
- esac; \
- 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)$(man1dir)/$$inst'"; \
- rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
- done
-install-man8: $(man8_MANS) $(man_MANS)
- @$(NORMAL_INSTALL)
- test -z "$(man8dir)" || $(MKDIR_P) "$(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/^.*\\.//'`; \
- 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 " rm -f '$(DESTDIR)$(man8dir)/$$inst'"; \
- rm -f "$(DESTDIR)$(man8dir)/$$inst"; \
- done
-
-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: TAGS
-
-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; }'`; \
- if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
- test -n "$$unique" || unique=$$empty_fix; \
- $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique; \
- fi
-ctags: CTAGS
-CTAGS: $(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 "$(CTAGS_ARGS)$$tags$$unique" \
- || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_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 tags
-
-distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
- list='$(DISTFILES)'; \
- dist_files=`for file in $$list; do echo $$file; done | \
- sed -e "s|^$$srcdirstrip/||;t" \
- -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
- case $$dist_files in \
- */*) $(MKDIR_P) `echo "$$dist_files" | \
- sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
- sort -u` ;; \
- esac; \
- for file in $$dist_files; do \
- if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- if test -d $$d/$$file; then \
- dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
- 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:
- for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(libexecdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)"; do \
- test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- done
-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_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
-mostlyclean-generic:
-
-clean-generic:
-
-distclean-generic:
- -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(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-binPROGRAMS clean-generic clean-libexecPROGRAMS \
- clean-libtool clean-noinstPROGRAMS mostlyclean-am
-
-distclean: distclean-am
- -rm -f Makefile
-distclean-am: clean-am distclean-compile distclean-generic \
- distclean-tags
-
-dvi: dvi-am
-
-dvi-am:
-
-html: html-am
-
-info: info-am
-
-info-am:
-
-install-data-am: install-man
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) install-data-hook
-
-install-dvi: install-dvi-am
-
-install-exec-am: install-binPROGRAMS install-libexecPROGRAMS
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) install-exec-hook
-
-install-html: install-html-am
-
-install-info: install-info-am
-
-install-man: install-man1 install-man8
-
-install-pdf: install-pdf-am
-
-install-ps: install-ps-am
-
-installcheck-am:
-
-maintainer-clean: maintainer-clean-am
- -rm -f Makefile
-maintainer-clean-am: distclean-am maintainer-clean-generic
-
-mostlyclean: mostlyclean-am
-
-mostlyclean-am: mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool
-
-pdf: pdf-am
-
-pdf-am:
-
-ps: ps-am
-
-ps-am:
-
-uninstall-am: uninstall-binPROGRAMS uninstall-libexecPROGRAMS \
- uninstall-man
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) uninstall-hook
-
-uninstall-man: uninstall-man1 uninstall-man8
-
-.MAKE: install-am install-data-am install-exec-am install-strip \
- uninstall-am
-
-.PHONY: CTAGS GTAGS all all-am all-local check check-am check-local \
- clean clean-binPROGRAMS clean-generic clean-libexecPROGRAMS \
- clean-libtool clean-noinstPROGRAMS ctags dist-hook distclean \
- distclean-compile distclean-generic distclean-libtool \
- distclean-tags distdir dvi dvi-am html html-am info info-am \
- install install-am install-binPROGRAMS install-data \
- install-data-am install-data-hook install-dvi install-dvi-am \
- install-exec install-exec-am install-exec-hook install-html \
- install-html-am install-info install-info-am \
- install-libexecPROGRAMS install-man install-man1 install-man8 \
- install-pdf install-pdf-am install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- pdf pdf-am ps ps-am tags uninstall uninstall-am \
- uninstall-binPROGRAMS uninstall-hook uninstall-libexecPROGRAMS \
- uninstall-man uninstall-man1 uninstall-man8
-
-
-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) $(dist_include_HEADERS) $(nodist_include_HEADERS) $(build_HEADERZ) $(nobase_include_HEADERS)
- @foo='$(include_HEADERS) $(dist_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 ; \
- foo='$(nobase_include_HEADERS)'; \
- for f in $$foo; do \
- if test -f "$(srcdir)/$$f"; then file="$(srcdir)/$$f"; \
- else file="$$f"; fi; \
- $(mkdir_p) $(buildinclude)/`dirname $$f` ; \
- 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)' = "no-check-local"; then \
- foo=''; elif 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 && ./$$i --help) > /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 || exit 1; \
- 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 "$(INSTALL_DATA)" "$(mkinstalldirs)" "$(srcdir)" "$(DESTDIR)$(mandir)" '$(CATMANEXT)' $(man_MANS) $(man1_MANS) $(man3_MANS) $(man5_MANS) $(man8_MANS)
-
-uninstall-cat-mans:
- $(SHELL) $(top_srcdir)/cf/install-catman.sh uninstall "$(INSTALL_DATA)" "$(mkinstalldirs)" "$(srcdir)" "$(DESTDIR)$(mandir)" '$(CATMANEXT)' $(man_MANS) $(man1_MANS) $(man3_MANS) $(man5_MANS) $(man8_MANS)
-
-install-data-hook: install-cat-mans
-uninstall-hook: uninstall-cat-mans
-
-.et.h:
- $(COMPILE_ET) $<
-.et.c:
- $(COMPILE_ET) $<
-
-#
-# Useful target for debugging
-#
-
-check-valgrind:
- tobjdir=`cd $(top_builddir) && pwd` ; \
- tsrcdir=`cd $(top_srcdir) && pwd` ; \
- env TESTS_ENVIRONMENT="$${tobjdir}/libtool --mode execute valgrind --leak-check=full --trace-children=yes --quiet -q --num-callers=30 --suppressions=$${tsrcdir}/cf/valgrind-suppressions" make check
-
-#
-# Target to please samba build farm, builds distfiles in-tree.
-# Will break when automake changes...
-#
-
-distdir-in-tree: $(DISTFILES) $(INFO_DEPS)
- list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
- if test "$$subdir" != .; then \
- (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) distdir-in-tree) ; \
- fi ; \
- done
-# 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/kpasswd/kpasswd-generator.c b/crypto/heimdal/kpasswd/kpasswd-generator.c
deleted file mode 100644
index e37f86980fe6..000000000000
--- a/crypto/heimdal/kpasswd/kpasswd-generator.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright (c) 2000 - 2004 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 "kpasswd_locl.h"
-
-RCSID("$Id: kpasswd-generator.c 19233 2006-12-06 08:04:05Z lha $");
-
-static unsigned
-read_words (const char *filename, char ***ret_w)
-{
- unsigned n, alloc;
- FILE *f;
- char buf[256];
- char **w = NULL;
-
- f = fopen (filename, "r");
- if (f == NULL)
- err (1, "cannot open %s", filename);
- alloc = n = 0;
- while (fgets (buf, sizeof(buf), f) != NULL) {
- buf[strcspn(buf, "\r\n")] = '\0';
- if (n >= alloc) {
- alloc += 16;
- w = erealloc (w, alloc * sizeof(char **));
- }
- w[n++] = estrdup (buf);
- }
- *ret_w = w;
- if (n == 0)
- errx(1, "%s is an empty file, no words to try", filename);
- return n;
-}
-
-static int
-nop_prompter (krb5_context context,
- void *data,
- const char *name,
- const char *banner,
- int num_prompts,
- krb5_prompt prompts[])
-{
- return 0;
-}
-
-static void
-generate_requests (const char *filename, unsigned nreq)
-{
- krb5_context context;
- krb5_error_code ret;
- int i;
- char **words;
- unsigned nwords;
-
- ret = krb5_init_context (&context);
- if (ret)
- errx (1, "krb5_init_context failed: %d", ret);
-
- nwords = read_words (filename, &words);
-
- for (i = 0; i < nreq; ++i) {
- char *name = words[rand() % nwords];
- krb5_get_init_creds_opt *opt;
- krb5_creds cred;
- krb5_principal principal;
- int result_code;
- krb5_data result_code_string, result_string;
- char *old_pwd, *new_pwd;
-
- krb5_get_init_creds_opt_alloc (context, &opt);
- krb5_get_init_creds_opt_set_tkt_life (opt, 300);
- krb5_get_init_creds_opt_set_forwardable (opt, FALSE);
- krb5_get_init_creds_opt_set_proxiable (opt, FALSE);
-
- ret = krb5_parse_name (context, name, &principal);
- if (ret)
- krb5_err (context, 1, ret, "krb5_parse_name %s", name);
-
- asprintf (&old_pwd, "%s", name);
- asprintf (&new_pwd, "%s2", name);
-
- ret = krb5_get_init_creds_password (context,
- &cred,
- principal,
- old_pwd,
- nop_prompter,
- NULL,
- 0,
- "kadmin/changepw",
- opt);
- if( ret == KRB5KRB_AP_ERR_BAD_INTEGRITY
- || ret == KRB5KRB_AP_ERR_MODIFIED) {
- char *tmp;
-
- tmp = new_pwd;
- new_pwd = old_pwd;
- old_pwd = tmp;
-
- ret = krb5_get_init_creds_password (context,
- &cred,
- principal,
- old_pwd,
- nop_prompter,
- NULL,
- 0,
- "kadmin/changepw",
- opt);
- }
- if (ret)
- krb5_err (context, 1, ret, "krb5_get_init_creds_password");
-
- krb5_free_principal (context, principal);
-
- ret = krb5_change_password (context, &cred, new_pwd,
- &result_code,
- &result_code_string,
- &result_string);
- if (ret)
- krb5_err (context, 1, ret, "krb5_change_password");
-
- free (old_pwd);
- free (new_pwd);
- krb5_free_cred_contents (context, &cred);
- krb5_get_init_creds_opt_free(context, opt);
- }
-}
-
-static int version_flag = 0;
-static int help_flag = 0;
-
-static struct getargs args[] = {
- { "version", 0, arg_flag, &version_flag },
- { "help", 0, arg_flag, &help_flag }
-};
-
-static void
-usage (int ret)
-{
- arg_printusage (args,
- sizeof(args)/sizeof(*args),
- NULL,
- "file [number]");
- exit (ret);
-}
-
-int
-main(int argc, char **argv)
-{
- int optind = 0;
- int nreq;
- char *end;
-
- setprogname(argv[0]);
- if(getarg(args, sizeof(args) / sizeof(args[0]), argc, argv, &optind))
- usage(1);
- if (help_flag)
- usage (0);
- if (version_flag) {
- print_version(NULL);
- return 0;
- }
- argc -= optind;
- argv += optind;
-
- if (argc != 2)
- usage (1);
- srand (0);
- nreq = strtol (argv[1], &end, 0);
- if (argv[1] == end || *end != '\0')
- usage (1);
- generate_requests (argv[0], nreq);
- return 0;
-}
diff --git a/crypto/heimdal/kpasswd/kpasswd.1 b/crypto/heimdal/kpasswd/kpasswd.1
deleted file mode 100644
index 6d2c7c9227dc..000000000000
--- a/crypto/heimdal/kpasswd/kpasswd.1
+++ /dev/null
@@ -1,68 +0,0 @@
-.\" Copyright (c) 1997, 2000 - 2005 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: kpasswd.1 14478 2005-01-05 16:08:58Z lha $
-.\"
-.Dd January 5, 2005
-.Dt KPASSWD 1
-.Os HEIMDAL
-.Sh NAME
-.Nm kpasswd
-.Nd Kerberos 5 password changing program
-.Sh SYNOPSIS
-.Nm
-.Op Fl -admin-principal= Ns Ar principal
-.Oo Fl c Ar cache \*(Ba Xo
-.Fl -cache= Ns Ar cache
-.Xc
-.Oc
-.Op Ar principal ...
-.Sh DESCRIPTION
-.Nm
-is the client for changing passwords.
-.Pp
-If administrator principal is given that principal is used to change
-the password.
-.Pp
-Multiple passwords for different users can be changed at the same time,
-then the administrator principal will be used.
-If the administrator isn't specified on the command prompt, the
-principal of the default credential cache will be used.
-.Pp
-If a credential cache is given, the
-.Fl -admin-principal
-flag is ignored and use the default name of the credential cache is
-used instead.
-.Sh DIAGNOSTICS
-If the password quality check fails or some other error occurs, an
-explanation is printed.
-.Sh SEE ALSO
-.Xr kpasswdd 8
diff --git a/crypto/heimdal/kpasswd/kpasswd.c b/crypto/heimdal/kpasswd/kpasswd.c
deleted file mode 100644
index b844628f6f08..000000000000
--- a/crypto/heimdal/kpasswd/kpasswd.c
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Copyright (c) 1997-2004 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 "kpasswd_locl.h"
-RCSID("$Id: kpasswd.c 19078 2006-11-20 18:12:41Z lha $");
-
-static int version_flag;
-static int help_flag;
-static char *admin_principal_str;
-static char *cred_cache_str;
-
-static struct getargs args[] = {
- { "admin-principal", 0, arg_string, &admin_principal_str },
- { "cache", 'c', arg_string, &cred_cache_str },
- { "version", 0, arg_flag, &version_flag },
- { "help", 0, arg_flag, &help_flag }
-};
-
-static void
-usage (int ret, struct getargs *a, int num_args)
-{
- arg_printusage (a, num_args, NULL, "[principal ...]");
- exit (ret);
-}
-
-static int
-change_password(krb5_context context,
- krb5_principal principal,
- krb5_ccache id)
-{
- krb5_data result_code_string, result_string;
- int result_code;
- krb5_error_code ret;
- char pwbuf[BUFSIZ];
- char *msg, *name;
-
- krb5_data_zero (&result_code_string);
- krb5_data_zero (&result_string);
-
- name = msg = NULL;
- if (principal == NULL)
- asprintf(&msg, "New password: ");
- else {
- ret = krb5_unparse_name(context, principal, &name);
- if (ret)
- krb5_err(context, 1, ret, "krb5_unparse_name");
-
- asprintf(&msg, "New password for %s: ", name);
- }
-
- if (msg == NULL)
- krb5_errx (context, 1, "out of memory");
-
- ret = UI_UTIL_read_pw_string (pwbuf, sizeof(pwbuf), msg, 1);
- free(msg);
- if (name)
- free(name);
- if (ret != 0) {
- return 1;
- }
-
- ret = krb5_set_password_using_ccache (context, id, pwbuf,
- principal,
- &result_code,
- &result_code_string,
- &result_string);
- if (ret) {
- krb5_warn (context, ret, "krb5_set_password_using_ccache");
- return 1;
- }
-
- printf ("%s%s%.*s\n", krb5_passwd_result_to_string(context, result_code),
- result_string.length > 0 ? " : " : "",
- (int)result_string.length,
- result_string.length > 0 ? (char *)result_string.data : "");
-
- krb5_data_free (&result_code_string);
- krb5_data_free (&result_string);
-
- return ret != 0;
-}
-
-
-int
-main (int argc, char **argv)
-{
- krb5_error_code ret;
- krb5_context context;
- krb5_principal principal;
- int optind = 0;
- krb5_get_init_creds_opt *opt;
- krb5_ccache id = NULL;
- int exit_value;
-
- optind = krb5_program_setup(&context, argc, argv,
- args, sizeof(args) / sizeof(args[0]), usage);
-
- if (help_flag)
- usage (0, args, sizeof(args) / sizeof(args[0]));
-
- if(version_flag){
- print_version (NULL);
- exit(0);
- }
-
- argc -= optind;
- argv += optind;
-
- ret = krb5_init_context (&context);
- if (ret)
- errx (1, "krb5_init_context failed: %d", ret);
-
- ret = krb5_get_init_creds_opt_alloc (context, &opt);
- if (ret)
- krb5_err(context, 1, ret, "krb5_get_init_creds_opt_alloc");
-
- krb5_get_init_creds_opt_set_tkt_life (opt, 300);
- krb5_get_init_creds_opt_set_forwardable (opt, FALSE);
- krb5_get_init_creds_opt_set_proxiable (opt, FALSE);
-
- if (cred_cache_str) {
- ret = krb5_cc_resolve(context, cred_cache_str, &id);
- if (ret)
- krb5_err (context, 1, ret, "krb5_cc_resolve");
- } else {
- ret = krb5_cc_gen_new(context, &krb5_mcc_ops, &id);
- if (ret)
- krb5_err (context, 1, ret, "krb5_cc_gen_new");
- }
-
- if (cred_cache_str == NULL) {
- krb5_principal admin_principal = NULL;
- krb5_creds cred;
-
- if (admin_principal_str) {
- ret = krb5_parse_name (context, admin_principal_str,
- &admin_principal);
- if (ret)
- krb5_err (context, 1, ret, "krb5_parse_name");
- } else if (argc == 1) {
- ret = krb5_parse_name (context, argv[0], &admin_principal);
- if (ret)
- krb5_err (context, 1, ret, "krb5_parse_name");
- } else {
- ret = krb5_get_default_principal (context, &admin_principal);
- if (ret)
- krb5_err (context, 1, ret, "krb5_get_default_principal");
- }
-
- ret = krb5_get_init_creds_password (context,
- &cred,
- admin_principal,
- NULL,
- krb5_prompter_posix,
- NULL,
- 0,
- "kadmin/changepw",
- opt);
- switch (ret) {
- case 0:
- break;
- case KRB5_LIBOS_PWDINTR :
- return 1;
- case KRB5KRB_AP_ERR_BAD_INTEGRITY :
- case KRB5KRB_AP_ERR_MODIFIED :
- krb5_errx(context, 1, "Password incorrect");
- break;
- default:
- krb5_err(context, 1, ret, "krb5_get_init_creds");
- }
-
- krb5_get_init_creds_opt_free(context, opt);
-
- ret = krb5_cc_initialize(context, id, admin_principal);
- krb5_free_principal(context, admin_principal);
- if (ret)
- krb5_err(context, 1, ret, "krb5_cc_initialize");
-
- ret = krb5_cc_store_cred(context, id, &cred);
- if (ret)
- krb5_err(context, 1, ret, "krb5_cc_store_cred");
-
- krb5_free_cred_contents (context, &cred);
- }
-
- if (argc == 0) {
- exit_value = change_password(context, NULL, id);
- } else {
- exit_value = 0;
-
- while (argc-- > 0) {
-
- ret = krb5_parse_name (context, argv[0], &principal);
- if (ret)
- krb5_err (context, 1, ret, "krb5_parse_name");
-
- ret = change_password(context, principal, id);
- if (ret)
- exit_value = 1;
- krb5_free_principal(context, principal);
- argv++;
- }
- }
-
- if (cred_cache_str == NULL) {
- ret = krb5_cc_destroy(context, id);
- if (ret)
- krb5_err (context, 1, ret, "krb5_cc_destroy");
- } else {
- ret = krb5_cc_close(context, id);
- if (ret)
- krb5_err (context, 1, ret, "krb5_cc_close");
- }
-
- krb5_free_context (context);
- return ret;
-}
diff --git a/crypto/heimdal/kpasswd/kpasswd_locl.h b/crypto/heimdal/kpasswd/kpasswd_locl.h
deleted file mode 100644
index b797ceb26de9..000000000000
--- a/crypto/heimdal/kpasswd/kpasswd_locl.h
+++ /dev/null
@@ -1,104 +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: kpasswd_locl.h 11444 2002-09-10 20:03:49Z joda $ */
-
-#ifndef __KPASSWD_LOCL_H__
-#define __KPASSWD_LOCL_H__
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-#ifdef HAVE_SYS_UIO_H
-#include <sys/uio.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_PWD_H
-#include <pwd.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_NETINET_IN6_H
-#include <netinet/in6.h>
-#endif
-#ifdef HAVE_NETINET6_IN6_H
-#include <netinet6/in6.h>
-#endif
-
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#ifdef HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-#ifdef HAVE_UTIL_H
-#include <util.h>
-#endif
-#ifdef HAVE_LIBUTIL_H
-#include <libutil.h>
-#endif
-#include <err.h>
-#include <roken.h>
-#include <getarg.h>
-#include <krb5.h>
-#include "crypto-headers.h" /* for des_read_pw_string */
-
-#endif /* __KPASSWD_LOCL_H__ */
diff --git a/crypto/heimdal/kpasswd/kpasswdd.8 b/crypto/heimdal/kpasswd/kpasswdd.8
deleted file mode 100644
index ab750bd4993c..000000000000
--- a/crypto/heimdal/kpasswd/kpasswdd.8
+++ /dev/null
@@ -1,96 +0,0 @@
-.\" $Id: kpasswdd.8 14481 2005-01-05 18:07:44Z lha $
-.\"
-.Dd April 19, 1999
-.Dt KPASSWDD 8
-.Os HEIMDAL
-.Sh NAME
-.Nm kpasswdd
-.Nd Kerberos 5 password changing server
-.Sh SYNOPSIS
-.Nm
-.Bk -words
-.Op Fl -addresses= Ns Ar address
-.Op Fl -check-library= Ns Ar library
-.Op Fl -check-function= Ns Ar function
-.Oo Fl k Ar kspec \*(Ba Xo
-.Fl -keytab= Ns Ar kspec
-.Xc
-.Oc
-.Oo Fl r Ar realm \*(Ba Xo
-.Fl -realm= Ns Ar realm
-.Xc
-.Oc
-.Oo Fl p Ar string \*(Ba Xo
-.Fl -port= Ns Ar string
-.Xc
-.Oc
-.Op Fl -version
-.Op Fl -help
-.Ek
-.Sh DESCRIPTION
-.Nm
-serves request for password changes. It listens on UDP port 464
-(service kpasswd) and processes requests when they arrive. It changes
-the database directly and should thus only run on the master KDC.
-.Pp
-Supported options:
-.Bl -tag -width Ds
-.It Xo
-.Fl -addresses= Ns Ar address
-.Xc
-For each till the argument is given, add the address to what kpasswdd
-should listen too.
-.It Xo
-.Fl -check-library= Ns Ar library
-.Xc
-If your system has support for dynamic loading of shared libraries,
-you can use an external function to check password quality. This
-option specifies which library to load.
-.It Xo
-.Fl -check-function= Ns Ar function
-.Xc
-This is the function to call in the loaded library. The function
-should look like this:
-.Pp
-.Ft const char *
-.Fn passwd_check "krb5_context context" "krb5_principal principal" "krb5_data *password"
-.Pp
-.Fa context
-is an initialized context;
-.Fa principal
-is the one who tries to change passwords, and
-.Fa password
-is the new password. Note that the password (in
-.Fa password->data )
-is not zero terminated.
-.It Xo
-.Fl k Ar kspec ,
-.Fl -keytab= Ns Ar kspec
-.Xc
-Keytab to get authentication key from.
-.It Xo
-.Fl r Ar realm ,
-.Fl -realm= Ns Ar realm
-.Xc
-Default realm.
-.It Xo
-.Fl p Ar string ,
-.Fl -port= Ns Ar string
-.Xc
-Port to listen on (default service kpasswd - 464).
-.El
-.Sh DIAGNOSTICS
-If an error occurs, the error message is returned to the user and/or
-logged to syslog.
-.Sh BUGS
-The default password quality checks are too basic.
-.Sh SEE ALSO
-.Xr kpasswd 1 ,
-.Xr kdc 8
-.\".Sh ENVIRONMENT
-.\".Sh FILES
-.\".Sh EXAMPLES
-.\".Sh SEE ALSO
-.\".Sh STANDARDS
-.\".Sh HISTORY
-.\".Sh AUTHORS
diff --git a/crypto/heimdal/kpasswd/kpasswdd.c b/crypto/heimdal/kpasswd/kpasswdd.c
deleted file mode 100644
index 5b4119c897b5..000000000000
--- a/crypto/heimdal/kpasswd/kpasswdd.c
+++ /dev/null
@@ -1,859 +0,0 @@
-/*
- * Copyright (c) 1997-2005 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 "kpasswd_locl.h"
-RCSID("$Id: kpasswdd.c 22252 2007-12-09 05:59:34Z lha $");
-
-#include <kadm5/admin.h>
-#ifdef HAVE_SYS_UN_H
-#include <sys/un.h>
-#endif
-#include <hdb.h>
-#include <kadm5/private.h>
-
-static krb5_context context;
-static krb5_log_facility *log_facility;
-
-static struct getarg_strings addresses_str;
-krb5_addresses explicit_addresses;
-
-static sig_atomic_t exit_flag = 0;
-
-static void
-add_one_address (const char *str, int first)
-{
- krb5_error_code ret;
- krb5_addresses tmp;
-
- ret = krb5_parse_address (context, str, &tmp);
- if (ret)
- krb5_err (context, 1, ret, "parse_address `%s'", str);
- if (first)
- krb5_copy_addresses(context, &tmp, &explicit_addresses);
- else
- krb5_append_addresses(context, &explicit_addresses, &tmp);
- krb5_free_addresses (context, &tmp);
-}
-
-static void
-send_reply (int s,
- struct sockaddr *sa,
- int sa_size,
- krb5_data *ap_rep,
- krb5_data *rest)
-{
- struct msghdr msghdr;
- struct iovec iov[3];
- uint16_t len, ap_rep_len;
- u_char header[6];
- u_char *p;
-
- if (ap_rep)
- ap_rep_len = ap_rep->length;
- else
- ap_rep_len = 0;
-
- len = 6 + ap_rep_len + rest->length;
- p = header;
- *p++ = (len >> 8) & 0xFF;
- *p++ = (len >> 0) & 0xFF;
- *p++ = 0;
- *p++ = 1;
- *p++ = (ap_rep_len >> 8) & 0xFF;
- *p++ = (ap_rep_len >> 0) & 0xFF;
-
- memset (&msghdr, 0, sizeof(msghdr));
- msghdr.msg_name = (void *)sa;
- msghdr.msg_namelen = sa_size;
- msghdr.msg_iov = iov;
- msghdr.msg_iovlen = sizeof(iov)/sizeof(*iov);
-#if 0
- msghdr.msg_control = NULL;
- msghdr.msg_controllen = 0;
-#endif
-
- iov[0].iov_base = (char *)header;
- iov[0].iov_len = 6;
- if (ap_rep_len) {
- iov[1].iov_base = ap_rep->data;
- iov[1].iov_len = ap_rep->length;
- } else {
- iov[1].iov_base = NULL;
- iov[1].iov_len = 0;
- }
- iov[2].iov_base = rest->data;
- iov[2].iov_len = rest->length;
-
- if (sendmsg (s, &msghdr, 0) < 0)
- krb5_warn (context, errno, "sendmsg");
-}
-
-static int
-make_result (krb5_data *data,
- uint16_t result_code,
- const char *expl)
-{
- char *str;
- krb5_data_zero (data);
-
- data->length = asprintf (&str,
- "%c%c%s",
- (result_code >> 8) & 0xFF,
- result_code & 0xFF,
- expl);
-
- if (str == NULL) {
- krb5_warnx (context, "Out of memory generating error reply");
- return 1;
- }
- data->data = str;
- return 0;
-}
-
-static void
-reply_error (krb5_realm realm,
- int s,
- struct sockaddr *sa,
- int sa_size,
- krb5_error_code error_code,
- uint16_t result_code,
- const char *expl)
-{
- krb5_error_code ret;
- krb5_data error_data;
- krb5_data e_data;
- krb5_principal server = NULL;
-
- if (make_result(&e_data, result_code, expl))
- return;
-
- if (realm) {
- ret = krb5_make_principal (context, &server, realm,
- "kadmin", "changepw", NULL);
- if (ret) {
- krb5_data_free (&e_data);
- return;
- }
- }
-
- ret = krb5_mk_error (context,
- error_code,
- NULL,
- &e_data,
- NULL,
- server,
- NULL,
- NULL,
- &error_data);
- if (server)
- krb5_free_principal(context, server);
- krb5_data_free (&e_data);
- if (ret) {
- krb5_warn (context, ret, "Could not even generate error reply");
- return;
- }
- send_reply (s, sa, sa_size, NULL, &error_data);
- krb5_data_free (&error_data);
-}
-
-static void
-reply_priv (krb5_auth_context auth_context,
- int s,
- struct sockaddr *sa,
- int sa_size,
- uint16_t result_code,
- const char *expl)
-{
- krb5_error_code ret;
- krb5_data krb_priv_data;
- krb5_data ap_rep_data;
- krb5_data e_data;
-
- ret = krb5_mk_rep (context,
- auth_context,
- &ap_rep_data);
- if (ret) {
- krb5_warn (context, ret, "Could not even generate error reply");
- return;
- }
-
- if (make_result(&e_data, result_code, expl))
- return;
-
- ret = krb5_mk_priv (context,
- auth_context,
- &e_data,
- &krb_priv_data,
- NULL);
- krb5_data_free (&e_data);
- if (ret) {
- krb5_warn (context, ret, "Could not even generate error reply");
- return;
- }
- send_reply (s, sa, sa_size, &ap_rep_data, &krb_priv_data);
- krb5_data_free (&ap_rep_data);
- krb5_data_free (&krb_priv_data);
-}
-
-/*
- * Change the password for `principal', sending the reply back on `s'
- * (`sa', `sa_size') to `pwd_data'.
- */
-
-static void
-change (krb5_auth_context auth_context,
- krb5_principal admin_principal,
- uint16_t version,
- int s,
- struct sockaddr *sa,
- int sa_size,
- krb5_data *in_data)
-{
- krb5_error_code ret;
- char *client = NULL, *admin = NULL;
- const char *pwd_reason;
- kadm5_config_params conf;
- void *kadm5_handle = NULL;
- krb5_principal principal;
- krb5_data *pwd_data = NULL;
- char *tmp;
- ChangePasswdDataMS chpw;
-
- memset (&conf, 0, sizeof(conf));
- memset(&chpw, 0, sizeof(chpw));
-
- if (version == KRB5_KPASSWD_VERS_CHANGEPW) {
- ret = krb5_copy_data(context, in_data, &pwd_data);
- if (ret) {
- krb5_warn (context, ret, "krb5_copy_data");
- reply_priv (auth_context, s, sa, sa_size, KRB5_KPASSWD_MALFORMED,
- "out out memory copying password");
- return;
- }
- principal = admin_principal;
- } else if (version == KRB5_KPASSWD_VERS_SETPW) {
- size_t len;
-
- ret = decode_ChangePasswdDataMS(in_data->data, in_data->length,
- &chpw, &len);
- if (ret) {
- krb5_warn (context, ret, "decode_ChangePasswdDataMS");
- reply_priv (auth_context, s, sa, sa_size, KRB5_KPASSWD_MALFORMED,
- "malformed ChangePasswdData");
- return;
- }
-
-
- ret = krb5_copy_data(context, &chpw.newpasswd, &pwd_data);
- if (ret) {
- krb5_warn (context, ret, "krb5_copy_data");
- reply_priv (auth_context, s, sa, sa_size, KRB5_KPASSWD_MALFORMED,
- "out out memory copying password");
- goto out;
- }
-
- if (chpw.targname == NULL && chpw.targrealm != NULL) {
- krb5_warn (context, ret, "kadm5_init_with_password_ctx");
- reply_priv (auth_context, s, sa, sa_size,
- KRB5_KPASSWD_MALFORMED,
- "targrealm but not targname");
- goto out;
- }
-
- if (chpw.targname) {
- krb5_principal_data princ;
-
- princ.name = *chpw.targname;
- princ.realm = *chpw.targrealm;
- if (princ.realm == NULL) {
- ret = krb5_get_default_realm(context, &princ.realm);
-
- if (ret) {
- krb5_warnx (context,
- "kadm5_init_with_password_ctx: "
- "failed to allocate realm");
- reply_priv (auth_context, s, sa, sa_size,
- KRB5_KPASSWD_SOFTERROR,
- "failed to allocate realm");
- goto out;
- }
- }
- ret = krb5_copy_principal(context, &princ, &principal);
- if (*chpw.targrealm == NULL)
- free(princ.realm);
- if (ret) {
- krb5_warn(context, ret, "krb5_copy_principal");
- reply_priv(auth_context, s, sa, sa_size,
- KRB5_KPASSWD_HARDERROR,
- "failed to allocate principal");
- goto out;
- }
- } else
- principal = admin_principal;
- } else {
- krb5_warnx (context, "kadm5_init_with_password_ctx: unknown proto");
- reply_priv (auth_context, s, sa, sa_size,
- KRB5_KPASSWD_HARDERROR,
- "Unknown protocol used");
- return;
- }
-
- ret = krb5_unparse_name (context, admin_principal, &admin);
- if (ret) {
- krb5_warn (context, ret, "unparse_name failed");
- reply_priv (auth_context, s, sa, sa_size,
- KRB5_KPASSWD_HARDERROR, "out of memory error");
- goto out;
- }
-
- conf.realm = principal->realm;
- conf.mask |= KADM5_CONFIG_REALM;
-
- ret = kadm5_init_with_password_ctx(context,
- admin,
- NULL,
- KADM5_ADMIN_SERVICE,
- &conf, 0, 0,
- &kadm5_handle);
- if (ret) {
- krb5_warn (context, ret, "kadm5_init_with_password_ctx");
- reply_priv (auth_context, s, sa, sa_size, 2,
- "Internal error");
- goto out;
- }
-
- ret = krb5_unparse_name(context, principal, &client);
- if (ret) {
- krb5_warn (context, ret, "unparse_name failed");
- reply_priv (auth_context, s, sa, sa_size,
- KRB5_KPASSWD_HARDERROR, "out of memory error");
- goto out;
- }
-
- /*
- * Check password quality if not changing as administrator
- */
-
- if (krb5_principal_compare(context, admin_principal, principal) == TRUE) {
-
- pwd_reason = kadm5_check_password_quality (context, principal,
- pwd_data);
- if (pwd_reason != NULL ) {
- krb5_warnx (context,
- "%s didn't pass password quality check with error: %s",
- client, pwd_reason);
- reply_priv (auth_context, s, sa, sa_size,
- KRB5_KPASSWD_SOFTERROR, pwd_reason);
- goto out;
- }
- krb5_warnx (context, "Changing password for %s", client);
- } else {
- ret = _kadm5_acl_check_permission(kadm5_handle, KADM5_PRIV_CPW,
- principal);
- if (ret) {
- krb5_warn (context, ret,
- "Check ACL failed for %s for changing %s password",
- admin, client);
- reply_priv (auth_context, s, sa, sa_size,
- KRB5_KPASSWD_HARDERROR, "permission denied");
- goto out;
- }
- krb5_warnx (context, "%s is changing password for %s", admin, client);
- }
-
- ret = krb5_data_realloc(pwd_data, pwd_data->length + 1);
- if (ret) {
- krb5_warn (context, ret, "malloc: out of memory");
- reply_priv (auth_context, s, sa, sa_size, KRB5_KPASSWD_HARDERROR,
- "Internal error");
- goto out;
- }
- tmp = pwd_data->data;
- tmp[pwd_data->length - 1] = '\0';
-
- ret = kadm5_s_chpass_principal_cond (kadm5_handle, principal, tmp);
- krb5_free_data (context, pwd_data);
- pwd_data = NULL;
- if (ret) {
- char *str = krb5_get_error_message(context, ret);
- krb5_warnx(context, "kadm5_s_chpass_principal_cond: %s", str);
- reply_priv (auth_context, s, sa, sa_size, KRB5_KPASSWD_SOFTERROR,
- str ? str : "Internal error");
- krb5_free_error_string(context, str);
- goto out;
- }
- reply_priv (auth_context, s, sa, sa_size, KRB5_KPASSWD_SUCCESS,
- "Password changed");
-out:
- free_ChangePasswdDataMS(&chpw);
- if (admin)
- free(admin);
- if (client)
- free(client);
- if (pwd_data)
- krb5_free_data(context, pwd_data);
- if (kadm5_handle)
- kadm5_destroy (kadm5_handle);
-}
-
-static int
-verify (krb5_auth_context *auth_context,
- krb5_realm *realms,
- krb5_keytab keytab,
- krb5_ticket **ticket,
- krb5_data *out_data,
- uint16_t *version,
- int s,
- struct sockaddr *sa,
- int sa_size,
- u_char *msg,
- size_t len)
-{
- krb5_error_code ret;
- uint16_t pkt_len, pkt_ver, ap_req_len;
- krb5_data ap_req_data;
- krb5_data krb_priv_data;
- krb5_realm *r;
-
- pkt_len = (msg[0] << 8) | (msg[1]);
- pkt_ver = (msg[2] << 8) | (msg[3]);
- ap_req_len = (msg[4] << 8) | (msg[5]);
- if (pkt_len != len) {
- krb5_warnx (context, "Strange len: %ld != %ld",
- (long)pkt_len, (long)len);
- reply_error (NULL, s, sa, sa_size, 0, 1, "Bad request");
- return 1;
- }
- if (pkt_ver != KRB5_KPASSWD_VERS_CHANGEPW &&
- pkt_ver != KRB5_KPASSWD_VERS_SETPW) {
- krb5_warnx (context, "Bad version (%d)", pkt_ver);
- reply_error (NULL, s, sa, sa_size, 0, 1, "Wrong program version");
- return 1;
- }
- *version = pkt_ver;
-
- ap_req_data.data = msg + 6;
- ap_req_data.length = ap_req_len;
-
- ret = krb5_rd_req (context,
- auth_context,
- &ap_req_data,
- NULL,
- keytab,
- NULL,
- ticket);
- if (ret) {
- krb5_warn (context, ret, "krb5_rd_req");
- reply_error (NULL, s, sa, sa_size, ret, 3, "Authentication failed");
- return 1;
- }
-
- /* verify realm and principal */
- for (r = realms; *r != NULL; r++) {
- krb5_principal principal;
- krb5_boolean same;
-
- ret = krb5_make_principal (context,
- &principal,
- *r,
- "kadmin",
- "changepw",
- NULL);
- if (ret)
- krb5_err (context, 1, ret, "krb5_make_principal");
-
- same = krb5_principal_compare(context, principal, (*ticket)->server);
- krb5_free_principal(context, principal);
- if (same == TRUE)
- break;
- }
- if (*r == NULL) {
- char *str;
- krb5_unparse_name(context, (*ticket)->server, &str);
- krb5_warnx (context, "client used not valid principal %s", str);
- free(str);
- reply_error (NULL, s, sa, sa_size, ret, 1,
- "Bad request");
- goto out;
- }
-
- if (strcmp((*ticket)->server->realm, (*ticket)->client->realm) != 0) {
- krb5_warnx (context, "server realm (%s) not same a client realm (%s)",
- (*ticket)->server->realm, (*ticket)->client->realm);
- reply_error ((*ticket)->server->realm, s, sa, sa_size, ret, 1,
- "Bad request");
- goto out;
- }
-
- if (!(*ticket)->ticket.flags.initial) {
- krb5_warnx (context, "initial flag not set");
- reply_error ((*ticket)->server->realm, s, sa, sa_size, ret, 1,
- "Bad request");
- goto out;
- }
- krb_priv_data.data = msg + 6 + ap_req_len;
- krb_priv_data.length = len - 6 - ap_req_len;
-
- ret = krb5_rd_priv (context,
- *auth_context,
- &krb_priv_data,
- out_data,
- NULL);
-
- if (ret) {
- krb5_warn (context, ret, "krb5_rd_priv");
- reply_error ((*ticket)->server->realm, s, sa, sa_size, ret, 3,
- "Bad request");
- goto out;
- }
- return 0;
-out:
- krb5_free_ticket (context, *ticket);
- ticket = NULL;
- return 1;
-}
-
-static void
-process (krb5_realm *realms,
- krb5_keytab keytab,
- int s,
- krb5_address *this_addr,
- struct sockaddr *sa,
- int sa_size,
- u_char *msg,
- int len)
-{
- krb5_error_code ret;
- krb5_auth_context auth_context = NULL;
- krb5_data out_data;
- krb5_ticket *ticket;
- krb5_address other_addr;
- uint16_t version;
-
-
- krb5_data_zero (&out_data);
-
- ret = krb5_auth_con_init (context, &auth_context);
- if (ret) {
- krb5_warn (context, ret, "krb5_auth_con_init");
- return;
- }
-
- krb5_auth_con_setflags (context, auth_context,
- KRB5_AUTH_CONTEXT_DO_SEQUENCE);
-
- ret = krb5_sockaddr2address (context, sa, &other_addr);
- if (ret) {
- krb5_warn (context, ret, "krb5_sockaddr2address");
- goto out;
- }
-
- ret = krb5_auth_con_setaddrs (context,
- auth_context,
- this_addr,
- &other_addr);
- krb5_free_address (context, &other_addr);
- if (ret) {
- krb5_warn (context, ret, "krb5_auth_con_setaddr");
- goto out;
- }
-
- if (verify (&auth_context, realms, keytab, &ticket, &out_data,
- &version, s, sa, sa_size, msg, len) == 0) {
- change (auth_context,
- ticket->client,
- version,
- s,
- sa, sa_size,
- &out_data);
- memset (out_data.data, 0, out_data.length);
- krb5_free_ticket (context, ticket);
- }
-
-out:
- krb5_data_free (&out_data);
- krb5_auth_con_free (context, auth_context);
-}
-
-static int
-doit (krb5_keytab keytab, int port)
-{
- krb5_error_code ret;
- int *sockets;
- int maxfd;
- krb5_realm *realms;
- krb5_addresses addrs;
- unsigned n, i;
- fd_set real_fdset;
- struct sockaddr_storage __ss;
- struct sockaddr *sa = (struct sockaddr *)&__ss;
-
- ret = krb5_get_default_realms(context, &realms);
- if (ret)
- krb5_err (context, 1, ret, "krb5_get_default_realms");
-
- if (explicit_addresses.len) {
- addrs = explicit_addresses;
- } else {
- ret = krb5_get_all_server_addrs (context, &addrs);
- if (ret)
- krb5_err (context, 1, ret, "krb5_get_all_server_addrs");
- }
- n = addrs.len;
-
- sockets = malloc (n * sizeof(*sockets));
- if (sockets == NULL)
- krb5_errx (context, 1, "out of memory");
- maxfd = -1;
- FD_ZERO(&real_fdset);
- for (i = 0; i < n; ++i) {
- krb5_socklen_t sa_size = sizeof(__ss);
-
- krb5_addr2sockaddr (context, &addrs.val[i], sa, &sa_size, port);
-
- sockets[i] = socket (sa->sa_family, SOCK_DGRAM, 0);
- if (sockets[i] < 0)
- krb5_err (context, 1, errno, "socket");
- if (bind (sockets[i], sa, sa_size) < 0) {
- char str[128];
- size_t len;
- int save_errno = errno;
-
- ret = krb5_print_address (&addrs.val[i], str, sizeof(str), &len);
- if (ret)
- strlcpy(str, "unknown address", sizeof(str));
- krb5_warn (context, save_errno, "bind(%s)", str);
- continue;
- }
- maxfd = max (maxfd, sockets[i]);
- if (maxfd >= FD_SETSIZE)
- krb5_errx (context, 1, "fd too large");
- FD_SET(sockets[i], &real_fdset);
- }
- if (maxfd == -1)
- krb5_errx (context, 1, "No sockets!");
-
- while(exit_flag == 0) {
- int ret;
- fd_set fdset = real_fdset;
-
- ret = select (maxfd + 1, &fdset, NULL, NULL, NULL);
- if (ret < 0) {
- if (errno == EINTR)
- continue;
- else
- krb5_err (context, 1, errno, "select");
- }
- for (i = 0; i < n; ++i)
- if (FD_ISSET(sockets[i], &fdset)) {
- u_char buf[BUFSIZ];
- socklen_t addrlen = sizeof(__ss);
-
- ret = recvfrom (sockets[i], buf, sizeof(buf), 0,
- sa, &addrlen);
- if (ret < 0) {
- if(errno == EINTR)
- break;
- else
- krb5_err (context, 1, errno, "recvfrom");
- }
-
- process (realms, keytab, sockets[i],
- &addrs.val[i],
- sa, addrlen,
- buf, ret);
- }
- }
-
- for (i = 0; i < n; ++i)
- close(sockets[i]);
- free(sockets);
-
- krb5_free_addresses (context, &addrs);
- krb5_free_host_realm (context, realms);
- krb5_free_context (context);
- return 0;
-}
-
-static RETSIGTYPE
-sigterm(int sig)
-{
- exit_flag = 1;
-}
-
-static const char *check_library = NULL;
-static const char *check_function = NULL;
-static getarg_strings policy_libraries = { 0, NULL };
-static char *keytab_str = "HDB:";
-static char *realm_str;
-static int version_flag;
-static int help_flag;
-static char *port_str;
-static char *config_file;
-
-struct getargs args[] = {
-#ifdef HAVE_DLOPEN
- { "check-library", 0, arg_string, &check_library,
- "library to load password check function from", "library" },
- { "check-function", 0, arg_string, &check_function,
- "password check function to load", "function" },
- { "policy-libraries", 0, arg_strings, &policy_libraries,
- "password check function to load", "function" },
-#endif
- { "addresses", 0, arg_strings, &addresses_str,
- "addresses to listen on", "list of addresses" },
- { "keytab", 'k', arg_string, &keytab_str,
- "keytab to get authentication key from", "kspec" },
- { "config-file", 'c', arg_string, &config_file },
- { "realm", 'r', arg_string, &realm_str, "default realm", "realm" },
- { "port", 'p', arg_string, &port_str, "port" },
- { "version", 0, arg_flag, &version_flag },
- { "help", 0, arg_flag, &help_flag }
-};
-int num_args = sizeof(args) / sizeof(args[0]);
-
-int
-main (int argc, char **argv)
-{
- int optind;
- krb5_keytab keytab;
- krb5_error_code ret;
- char **files;
- int port, i;
-
- optind = krb5_program_setup(&context, argc, argv, args, num_args, NULL);
-
- if(help_flag)
- krb5_std_usage(0, args, num_args);
- if(version_flag) {
- print_version(NULL);
- exit(0);
- }
-
- if (config_file == NULL) {
- asprintf(&config_file, "%s/kdc.conf", hdb_db_dir(context));
- if (config_file == NULL)
- errx(1, "out of memory");
- }
-
- ret = krb5_prepend_config_files_default(config_file, &files);
- if (ret)
- krb5_err(context, 1, ret, "getting configuration files");
-
- ret = krb5_set_config_files(context, files);
- krb5_free_config_files(files);
- if (ret)
- krb5_err(context, 1, ret, "reading configuration files");
-
- if(realm_str)
- krb5_set_default_realm(context, realm_str);
-
- krb5_openlog (context, "kpasswdd", &log_facility);
- krb5_set_warn_dest(context, log_facility);
-
- if (port_str != NULL) {
- struct servent *s = roken_getservbyname (port_str, "udp");
-
- if (s != NULL)
- port = s->s_port;
- else {
- char *ptr;
-
- port = strtol (port_str, &ptr, 10);
- if (port == 0 && ptr == port_str)
- krb5_errx (context, 1, "bad port `%s'", port_str);
- port = htons(port);
- }
- } else
- port = krb5_getportbyname (context, "kpasswd", "udp", KPASSWD_PORT);
-
- ret = krb5_kt_register(context, &hdb_kt_ops);
- if(ret)
- krb5_err(context, 1, ret, "krb5_kt_register");
-
- ret = krb5_kt_resolve(context, keytab_str, &keytab);
- if(ret)
- krb5_err(context, 1, ret, "%s", keytab_str);
-
- kadm5_setup_passwd_quality_check (context, check_library, check_function);
-
- for (i = 0; i < policy_libraries.num_strings; i++) {
- ret = kadm5_add_passwd_quality_verifier(context,
- policy_libraries.strings[i]);
- if (ret)
- krb5_err(context, 1, ret, "kadm5_add_passwd_quality_verifier");
- }
- ret = kadm5_add_passwd_quality_verifier(context, NULL);
- if (ret)
- krb5_err(context, 1, ret, "kadm5_add_passwd_quality_verifier");
-
-
- explicit_addresses.len = 0;
-
- if (addresses_str.num_strings) {
- int i;
-
- for (i = 0; i < addresses_str.num_strings; ++i)
- add_one_address (addresses_str.strings[i], i == 0);
- free_getarg_strings (&addresses_str);
- } else {
- char **foo = krb5_config_get_strings (context, NULL,
- "kdc", "addresses", NULL);
-
- if (foo != NULL) {
- add_one_address (*foo++, TRUE);
- while (*foo)
- add_one_address (*foo++, FALSE);
- }
- }
-
-#ifdef HAVE_SIGACTION
- {
- struct sigaction sa;
-
- sa.sa_flags = 0;
- sa.sa_handler = sigterm;
- sigemptyset(&sa.sa_mask);
-
- sigaction(SIGINT, &sa, NULL);
- sigaction(SIGTERM, &sa, NULL);
- }
-#else
- signal(SIGINT, sigterm);
- signal(SIGTERM, sigterm);
-#endif
-
- pidfile(NULL);
-
- return doit (keytab, port);
-}