summaryrefslogtreecommitdiff
path: root/crypto/kerberosIV/lib
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/kerberosIV/lib')
-rw-r--r--crypto/kerberosIV/lib/auth/ChangeLog65
-rw-r--r--crypto/kerberosIV/lib/auth/Makefile.am6
-rw-r--r--crypto/kerberosIV/lib/auth/Makefile.in55
-rw-r--r--crypto/kerberosIV/lib/auth/afskauthlib/Makefile.am38
-rw-r--r--crypto/kerberosIV/lib/auth/afskauthlib/Makefile.in87
-rw-r--r--crypto/kerberosIV/lib/auth/afskauthlib/README25
-rw-r--r--crypto/kerberosIV/lib/auth/afskauthlib/verify.c288
-rw-r--r--crypto/kerberosIV/lib/auth/pam/Makefile.am3
-rw-r--r--crypto/kerberosIV/lib/auth/pam/Makefile.in88
-rw-r--r--crypto/kerberosIV/lib/auth/pam/README25
-rw-r--r--crypto/kerberosIV/lib/auth/pam/pam.c243
-rw-r--r--crypto/kerberosIV/lib/auth/pam/pam.conf.add76
-rw-r--r--crypto/kerberosIV/lib/auth/sia/Makefile.am48
-rw-r--r--crypto/kerberosIV/lib/auth/sia/Makefile.in90
-rw-r--r--crypto/kerberosIV/lib/auth/sia/README87
-rw-r--r--crypto/kerberosIV/lib/auth/sia/krb4+c2_matrix.conf58
-rw-r--r--crypto/kerberosIV/lib/auth/sia/krb4_matrix.conf59
-rw-r--r--crypto/kerberosIV/lib/auth/sia/krb5+c2_matrix.conf27
-rw-r--r--crypto/kerberosIV/lib/auth/sia/krb5_matrix.conf27
-rw-r--r--crypto/kerberosIV/lib/auth/sia/posix_getpw.c78
-rw-r--r--crypto/kerberosIV/lib/auth/sia/security.patch11
-rw-r--r--crypto/kerberosIV/lib/auth/sia/sia.c672
-rw-r--r--crypto/kerberosIV/lib/auth/sia/sia_locl.h94
-rw-r--r--crypto/kerberosIV/lib/kadm/check_password.c55
-rw-r--r--crypto/kerberosIV/lib/kafs/ChangeLog165
-rw-r--r--crypto/kerberosIV/lib/kafs/Makefile.am70
-rw-r--r--crypto/kerberosIV/lib/kafs/README.dlfcn246
-rw-r--r--crypto/kerberosIV/lib/kafs/afskrb5.c179
-rw-r--r--crypto/kerberosIV/lib/kafs/common.c396
-rw-r--r--crypto/kerberosIV/lib/kclient/KClient.c440
-rw-r--r--crypto/kerberosIV/lib/kclient/KClient.def19
-rw-r--r--crypto/kerberosIV/lib/kclient/KClient.dsp127
-rw-r--r--crypto/kerberosIV/lib/kclient/KClient.h160
-rw-r--r--crypto/kerberosIV/lib/kclient/KClient.mak297
-rw-r--r--crypto/kerberosIV/lib/kclient/passwd_dialog.rc143
-rw-r--r--crypto/kerberosIV/lib/kclient/passwd_dlg.c109
-rw-r--r--crypto/kerberosIV/lib/kclient/passwd_dlg.h47
-rw-r--r--crypto/kerberosIV/lib/kclient/resource.h18
-rw-r--r--crypto/kerberosIV/lib/krb/defaults.c58
-rw-r--r--crypto/kerberosIV/lib/krb/extra.c202
-rw-r--r--crypto/kerberosIV/lib/krb/getfile.c91
-rw-r--r--crypto/kerberosIV/lib/krb/krb-archaeology.h131
-rw-r--r--crypto/kerberosIV/lib/krb/krb-protos.h789
-rw-r--r--crypto/kerberosIV/lib/krb/krb.dsp398
-rw-r--r--crypto/kerberosIV/lib/krb/krb.rc105
-rw-r--r--crypto/kerberosIV/lib/krb/krb_ip_realm.c104
-rw-r--r--crypto/kerberosIV/lib/krb/krb_log.h74
-rw-r--r--crypto/kerberosIV/lib/krb/krb_net_read.c42
-rw-r--r--crypto/kerberosIV/lib/krb/krb_net_write.c42
-rw-r--r--crypto/kerberosIV/lib/krb/resource.h15
-rw-r--r--crypto/kerberosIV/lib/krb/roken_rename.h98
-rw-r--r--crypto/kerberosIV/lib/krb/solaris_compat.c89
-rw-r--r--crypto/kerberosIV/lib/krb/time.c71
-rw-r--r--crypto/kerberosIV/lib/roken/ChangeLog614
-rw-r--r--crypto/kerberosIV/lib/roken/Makefile.am177
-rw-r--r--crypto/kerberosIV/lib/roken/base64.c146
-rw-r--r--crypto/kerberosIV/lib/roken/base64.h42
-rw-r--r--crypto/kerberosIV/lib/roken/concat.c112
-rw-r--r--crypto/kerberosIV/lib/roken/copyhostent.c102
-rw-r--r--crypto/kerberosIV/lib/roken/emalloc.c56
-rw-r--r--crypto/kerberosIV/lib/roken/eread.c57
-rw-r--r--crypto/kerberosIV/lib/roken/erealloc.c56
-rw-r--r--crypto/kerberosIV/lib/roken/estrdup.c56
-rw-r--r--crypto/kerberosIV/lib/roken/ewrite.c57
-rw-r--r--crypto/kerberosIV/lib/roken/flock.c87
-rw-r--r--crypto/kerberosIV/lib/roken/fnmatch.c173
-rw-r--r--crypto/kerberosIV/lib/roken/fnmatch.h49
-rw-r--r--crypto/kerberosIV/lib/roken/freehostent.c62
-rw-r--r--crypto/kerberosIV/lib/roken/get_default_username.c80
-rw-r--r--crypto/kerberosIV/lib/roken/getarg.3317
-rw-r--r--crypto/kerberosIV/lib/roken/getarg.c547
-rw-r--r--crypto/kerberosIV/lib/roken/getarg.h89
-rw-r--r--crypto/kerberosIV/lib/roken/getcap.c1118
-rw-r--r--crypto/kerberosIV/lib/roken/getegid.c48
-rw-r--r--crypto/kerberosIV/lib/roken/geteuid.c48
-rw-r--r--crypto/kerberosIV/lib/roken/getgid.c48
-rw-r--r--crypto/kerberosIV/lib/roken/gethostname.c72
-rw-r--r--crypto/kerberosIV/lib/roken/getipnodebyaddr.c74
-rw-r--r--crypto/kerberosIV/lib/roken/getipnodebyname.c86
-rw-r--r--crypto/kerberosIV/lib/roken/gettimeofday.c55
-rw-r--r--crypto/kerberosIV/lib/roken/getuid.c48
-rw-r--r--crypto/kerberosIV/lib/roken/glob.c835
-rw-r--r--crypto/kerberosIV/lib/roken/glob.h84
-rw-r--r--crypto/kerberosIV/lib/roken/inet_ntop.c153
-rw-r--r--crypto/kerberosIV/lib/roken/inet_pton.c66
-rw-r--r--crypto/kerberosIV/lib/roken/innetgr.c49
-rw-r--r--crypto/kerberosIV/lib/roken/iruserok.c294
-rw-r--r--crypto/kerberosIV/lib/roken/issuid.c53
-rw-r--r--crypto/kerberosIV/lib/roken/make-print-version.c68
-rw-r--r--crypto/kerberosIV/lib/roken/net_read.c74
-rw-r--r--crypto/kerberosIV/lib/roken/net_write.c72
-rw-r--r--crypto/kerberosIV/lib/roken/parse_bytes-test.c92
-rw-r--r--crypto/kerberosIV/lib/roken/parse_bytes.c78
-rw-r--r--crypto/kerberosIV/lib/roken/parse_bytes.h48
-rw-r--r--crypto/kerberosIV/lib/roken/parse_time.c78
-rw-r--r--crypto/kerberosIV/lib/roken/parse_time.h51
-rw-r--r--crypto/kerberosIV/lib/roken/parse_units.c324
-rw-r--r--crypto/kerberosIV/lib/roken/parse_units.h73
-rw-r--r--crypto/kerberosIV/lib/roken/print_version.c78
-rw-r--r--crypto/kerberosIV/lib/roken/readv.c67
-rw-r--r--crypto/kerberosIV/lib/roken/recvmsg.c69
-rw-r--r--crypto/kerberosIV/lib/roken/resolve.c353
-rw-r--r--crypto/kerberosIV/lib/roken/resolve.h103
-rw-r--r--crypto/kerberosIV/lib/roken/resource.h15
-rw-r--r--crypto/kerberosIV/lib/roken/roken-common.h255
-rw-r--r--crypto/kerberosIV/lib/roken/roken.awk35
-rw-r--r--crypto/kerberosIV/lib/roken/roken.dsp156
-rw-r--r--crypto/kerberosIV/lib/roken/roken.h.in505
-rw-r--r--crypto/kerberosIV/lib/roken/roken.rc105
-rw-r--r--crypto/kerberosIV/lib/roken/roken_gethostby.c280
-rw-r--r--crypto/kerberosIV/lib/roken/sendmsg.c65
-rw-r--r--crypto/kerberosIV/lib/roken/simple_exec.c171
-rw-r--r--crypto/kerberosIV/lib/roken/socket.c282
-rw-r--r--crypto/kerberosIV/lib/roken/strlcat.c50
-rw-r--r--crypto/kerberosIV/lib/roken/strlcpy.c60
-rw-r--r--crypto/kerberosIV/lib/roken/strncasecmp.c60
-rw-r--r--crypto/kerberosIV/lib/roken/strndup.c56
-rw-r--r--crypto/kerberosIV/lib/roken/strpftime-test.c287
-rw-r--r--crypto/kerberosIV/lib/roken/strptime.c444
-rw-r--r--crypto/kerberosIV/lib/roken/strsep.c61
-rw-r--r--crypto/kerberosIV/lib/roken/swab.c54
-rw-r--r--crypto/kerberosIV/lib/roken/vsyslog.c57
-rw-r--r--crypto/kerberosIV/lib/roken/writev.c64
-rw-r--r--crypto/kerberosIV/lib/sl/ChangeLog112
-rw-r--r--crypto/kerberosIV/lib/sl/Makefile.am44
-rw-r--r--crypto/kerberosIV/lib/sl/lex.l114
-rw-r--r--crypto/kerberosIV/lib/sl/make_cmds.c240
-rw-r--r--crypto/kerberosIV/lib/sl/make_cmds.h69
-rw-r--r--crypto/kerberosIV/lib/sl/parse.y194
-rw-r--r--crypto/kerberosIV/lib/sl/roken_rename.h61
-rw-r--r--crypto/kerberosIV/lib/sl/ss.c133
-rw-r--r--crypto/kerberosIV/lib/sl/ss.h55
132 files changed, 0 insertions, 18752 deletions
diff --git a/crypto/kerberosIV/lib/auth/ChangeLog b/crypto/kerberosIV/lib/auth/ChangeLog
deleted file mode 100644
index f9c948ca7146c..0000000000000
--- a/crypto/kerberosIV/lib/auth/ChangeLog
+++ /dev/null
@@ -1,65 +0,0 @@
-1999-11-15 Assar Westerlund <assar@sics.se>
-
- * */lib/Makefile.in: set LIBNAME. From Enrico Scholz
- <Enrico.Scholz@informatik.tu-chemnitz.de>
-
-1999-10-17 Assar Westerlund <assar@sics.se>
-
- * afskauthlib/verify.c (verify_krb5): need realm for v5 -> v4
-
-1999-10-03 Assar Westerlund <assar@sics.se>
-
- * afskauthlib/verify.c (verify_krb5): update to new
- krb524_convert_creds_kdc
-
-1999-09-28 Assar Westerlund <assar@sics.se>
-
- * sia/sia.c (doauth): use krb5_get_local_realms and
- krb5_verify_user_lrealm
-
- * afskauthlib/verify.c (verify_krb5): remove krb5_kuserok. use
- krb5_verify_user_lrealm
-
-1999-08-11 Johan Danielsson <joda@pdc.kth.se>
-
- * afskauthlib/verify.c: make this compile w/o krb4
-
-1999-08-04 Assar Westerlund <assar@sics.se>
-
- * afskauthlib/verify.c: incorporate patches from Miroslav Ruda
- <ruda@ics.muni.cz>
-
-Thu Apr 8 14:35:34 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * sia/sia.c: remove definition of KRB_VERIFY_USER (moved to
- config.h)
-
- * sia/Makefile.am: make it build w/o krb4
-
- * afskauthlib/verify.c: add krb5 support
-
- * afskauthlib/Makefile.am: build afskauthlib.so
-
-Wed Apr 7 14:06:22 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * sia/sia.c: make it compile w/o krb4
-
- * sia/Makefile.am: make it compile w/o krb4
-
-Thu Apr 1 18:09:23 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * sia/sia_locl.h: POSIX_GETPWNAM_R is defined in config.h
-
-Sun Mar 21 14:08:30 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * sia/Makefile.in: add posix_getpw.c
-
- * sia/Makefile.am: makefile for sia
-
- * sia/posix_getpw.c: move from sia.c
-
- * sia/sia_locl.h: merge with krb5 version
-
- * sia/sia.c: merge with krb5 version
-
- * sia/sia5.c: remove unused variables
diff --git a/crypto/kerberosIV/lib/auth/Makefile.am b/crypto/kerberosIV/lib/auth/Makefile.am
deleted file mode 100644
index 0310dc36d6ccc..0000000000000
--- a/crypto/kerberosIV/lib/auth/Makefile.am
+++ /dev/null
@@ -1,6 +0,0 @@
-# $Id: Makefile.am,v 1.2 1999/03/21 17:11:08 joda Exp $
-
-include $(top_srcdir)/Makefile.am.common
-
-SUBDIRS = @LIB_AUTH_SUBDIRS@
-DIST_SUBDIRS = afskauthlib pam sia
diff --git a/crypto/kerberosIV/lib/auth/Makefile.in b/crypto/kerberosIV/lib/auth/Makefile.in
deleted file mode 100644
index 53fde5fc16a99..0000000000000
--- a/crypto/kerberosIV/lib/auth/Makefile.in
+++ /dev/null
@@ -1,55 +0,0 @@
-#
-# $Id: Makefile.in,v 1.12 1998/03/15 05:58:10 assar Exp $
-#
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-SHELL = /bin/sh
-
-@SET_MAKE@
-
-SUBDIRS = @LIB_AUTH_SUBDIRS@
-
-all:
- SUBDIRS='$(SUBDIRS)'; \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) all); done
-
-Wall:
- make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
-
-install:
- SUBDIRS=$(SUBDIRS); \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) install); done
-
-uninstall:
- SUBDIRS=$(SUBDIRS); \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) uninstall); done
-
-check:
- SUBDIRS=$(SUBDIRS); \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) check); done
-
-clean:
- SUBDIRS=$(SUBDIRS); \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) clean); done
-
-mostlyclean: clean
-
-distclean:
- SUBDIRS=$(SUBDIRS); \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) distclean); done
- rm -f Makefile *~
-
-realclean:
- SUBDIRS=$(SUBDIRS); \
- for i in $$SUBDIRS; \
- do (cd $$i && $(MAKE) $(MFLAGS) realclean); done
-
-.PHONY: all Wall install uninstall check clean mostlyclean distclean realclean
diff --git a/crypto/kerberosIV/lib/auth/afskauthlib/Makefile.am b/crypto/kerberosIV/lib/auth/afskauthlib/Makefile.am
deleted file mode 100644
index 7dd6d5283fe93..0000000000000
--- a/crypto/kerberosIV/lib/auth/afskauthlib/Makefile.am
+++ /dev/null
@@ -1,38 +0,0 @@
-# $Id: Makefile.am,v 1.3 1999/04/08 12:35:33 joda Exp $
-
-include $(top_srcdir)/Makefile.am.common
-
-INCLUDES += $(INCLUDE_krb4)
-
-DEFS = @DEFS@
-
-foodir = $(libdir)
-foo_DATA = afskauthlib.so
-
-SUFFIXES += .c .o
-
-SRCS = verify.c
-OBJS = verify.o
-
-CLEANFILES = $(foo_DATA) $(OBJS) so_locations
-
-afskauthlib.so: $(OBJS)
- $(LD) -shared -o $@ $(LDFLAGS) $(OBJS) $(L)
-
-.c.o:
- $(COMPILE) -c $<
-
-if KRB4
-KAFS = $(top_builddir)/lib/kafs/.libs/libkafs.a
-endif
-
-L = \
- $(KAFS) \
- $(top_builddir)/lib/krb5/.libs/libkrb5.a \
- $(top_builddir)/lib/asn1/.libs/libasn1.a \
- $(LIB_krb4) \
- $(top_builddir)/lib/des/.libs/libdes.a \
- $(top_builddir)/lib/roken/.libs/libroken.a \
- -lc
-
-$(OBJS): $(top_builddir)/include/config.h
diff --git a/crypto/kerberosIV/lib/auth/afskauthlib/Makefile.in b/crypto/kerberosIV/lib/auth/afskauthlib/Makefile.in
deleted file mode 100644
index 2eb2576fe384f..0000000000000
--- a/crypto/kerberosIV/lib/auth/afskauthlib/Makefile.in
+++ /dev/null
@@ -1,87 +0,0 @@
-#
-# $Id: Makefile.in,v 1.25 1999/11/15 10:20:46 assar Exp $
-#
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-CC = @CC@
-LINK = @LINK@
-AR = ar
-LN_S = @LN_S@
-RANLIB = @RANLIB@
-DEFS = @DEFS@
-CFLAGS = @CFLAGS@ $(WFLAGS)
-WFLAGS = @WFLAGS@
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-
-@lib_deps_yes@LIB_DEPS = -L../../kafs -lkafs \
-@lib_deps_yes@ -L../../krb -lkrb \
-@lib_deps_yes@ -L../../des -ldes \
-@lib_deps_yes@ -L../../roken -lroken \
-@lib_deps_yes@ -lc
-@lib_deps_no@LIB_DEPS =
-
-PICFLAGS = @REAL_PICFLAGS@
-LDSHARED = @LDSHARED@
-SHLIBEXT = @REAL_SHLIBEXT@
-LD_FLAGS = @REAL_LD_FLAGS@
-
-LIBNAME = afskauthlib
-LIB = $(LIBNAME).$(SHLIBEXT)
-
-SOURCES = verify.c
-
-OBJECTS = verify.o
-
-all: $(LIB)
-
-Wall:
- make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
-
-.c.o:
- $(CC) -c $(DEFS) -I../../../include -I$(srcdir) $(CFLAGS) $(CPPFLAGS) $(PICFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
- -if test "$(LIB)" != ""; then \
- $(INSTALL_DATA) -m 0555 $(LIB) $(DESTDIR)$(libdir)/$(LIB) ; \
- fi
-
-uninstall:
- -if test "$(LIB)" != ""; then \
- rm -f $(DESTDIR)$(libdir)/$(LIB) ; \
- fi
-
-TAGS: $(SOURCES)
- etags $(SOURCES)
-
-check:
-
-clean:
- rm -f $(LIB) *.o
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile *.tab.c *~
-
-realclean: distclean
- rm -f TAGS
-
-$(OBJECTS): ../../../include/config.h
-
-$(LIB): $(OBJECTS)
- rm -f $@
- $(LDSHARED) $(CFLAGS) -o $@ $(OBJECTS) $(LD_FLAGS) $(LIB_DEPS)
-
-.PHONY: all Wall install uninstall check clean mostlyclean distclean realclean
diff --git a/crypto/kerberosIV/lib/auth/afskauthlib/README b/crypto/kerberosIV/lib/auth/afskauthlib/README
deleted file mode 100644
index 6052a261a1a5c..0000000000000
--- a/crypto/kerberosIV/lib/auth/afskauthlib/README
+++ /dev/null
@@ -1,25 +0,0 @@
-
-IRIX
-----
-
-The IRIX support is a module that is compatible with Transarc's
-`afskauthlib.so'. It should work with all programs that use this
-library, this should include `login' and `xdm'.
-
-The interface is not very documented but it seems that you have to copy
-`libkafs.so', `libkrb.so', and `libdes.so' to `/usr/lib', or build your
-`afskauthlib.so' statically.
-
-The `afskauthlib.so' itself is able to reside in `/usr/vice/etc',
-`/usr/afsws/lib', or the current directory (wherever that is).
-
-IRIX 6.4 and newer seems to have all programs (including `xdm' and
-`login') in the N32 object format, whereas in older versions they were
-O32. For it to work, the `afskauthlib.so' library has to be in the same
-object format as the program that tries to load it. This might require
-that you have to configure and build for O32 in addition to the default
-N32.
-
-Appart from this it should "just work", there are no configuration
-files.
-
diff --git a/crypto/kerberosIV/lib/auth/afskauthlib/verify.c b/crypto/kerberosIV/lib/auth/afskauthlib/verify.c
deleted file mode 100644
index 1c23119f9fc74..0000000000000
--- a/crypto/kerberosIV/lib/auth/afskauthlib/verify.c
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- * Copyright (c) 1995-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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: verify.c,v 1.20 1999/12/02 16:58:37 joda Exp $");
-#endif
-#include <unistd.h>
-#include <sys/types.h>
-#include <pwd.h>
-#ifdef KRB5
-#include <krb5.h>
-#endif
-#ifdef KRB4
-#include <krb.h>
-#include <kafs.h>
-#endif
-#include <roken.h>
-
-#ifdef KRB5
-static char krb5ccname[128];
-#endif
-#ifdef KRB4
-static char krbtkfile[128];
-#endif
-
-/*
- In some cases is afs_gettktstring called twice (once before
- afs_verify and once after afs_verify).
- In some cases (rlogin with access allowed via .rhosts)
- afs_verify is not called!
- So we can't rely on correct value in krbtkfile in some
- cases!
-*/
-
-static int correct_tkfilename=0;
-static int pag_set=0;
-
-#ifdef KRB4
-static void
-set_krbtkfile(uid_t uid)
-{
- snprintf (krbtkfile, sizeof(krbtkfile), "%s%d", TKT_ROOT, (unsigned)uid);
- krb_set_tkt_string (krbtkfile);
- correct_tkfilename = 1;
-}
-#endif
-
-/* XXX this has to be the default cache name, since the KRB5CCNAME
- * environment variable isn't exported by login/xdm
- */
-
-#ifdef KRB5
-static void
-set_krb5ccname(uid_t uid)
-{
- snprintf (krb5ccname, sizeof(krb5ccname), "FILE:/tmp/krb5cc_%d", uid);
-#ifdef KRB4
- snprintf (krbtkfile, sizeof(krbtkfile), "%s%d", TKT_ROOT, (unsigned)uid);
-#endif
- correct_tkfilename = 1;
-}
-#endif
-
-static void
-set_spec_krbtkfile(void)
-{
- int fd;
-#ifdef KRB4
- snprintf (krbtkfile, sizeof(krbtkfile), "%s_XXXXXX", TKT_ROOT);
- fd = mkstemp(krbtkfile);
- close(fd);
- unlink(krbtkfile);
- krb_set_tkt_string (krbtkfile);
-#endif
-#ifdef KRB5
- snprintf(krb5ccname, sizeof(krb5ccname),"FILE:/tmp/krb5cc_XXXXXX");
- fd=mkstemp(krb5ccname+5);
- close(fd);
- unlink(krb5ccname+5);
-#endif
-}
-
-#ifdef KRB5
-static int
-verify_krb5(struct passwd *pwd,
- char *password,
- int32_t *exp,
- int quiet)
-{
- krb5_context context;
- krb5_error_code ret;
- krb5_ccache ccache;
- krb5_principal principal;
-
- krb5_init_context(&context);
-
- ret = krb5_parse_name (context, pwd->pw_name, &principal);
- if (ret) {
- syslog(LOG_AUTH|LOG_DEBUG, "krb5_parse_name: %s",
- krb5_get_err_text(context, ret));
- goto out;
- }
-
- set_krb5ccname(pwd->pw_uid);
- ret = krb5_cc_resolve(context, krb5ccname, &ccache);
- if(ret) {
- syslog(LOG_AUTH|LOG_DEBUG, "krb5_cc_resolve: %s",
- krb5_get_err_text(context, ret));
- goto out;
- }
-
- ret = krb5_verify_user_lrealm(context,
- principal,
- ccache,
- password,
- TRUE,
- NULL);
- if(ret) {
- syslog(LOG_AUTH|LOG_DEBUG, "krb5_verify_user: %s",
- krb5_get_err_text(context, ret));
- goto out;
- }
-
- if(chown(krb5_cc_get_name(context, ccache), pwd->pw_uid, pwd->pw_gid)) {
- syslog(LOG_AUTH|LOG_DEBUG, "chown: %s",
- krb5_get_err_text(context, errno));
- goto out;
- }
-
-#ifdef KRB4
- if (krb5_config_get_bool(context, NULL,
- "libdefaults",
- "krb4_get_tickets",
- NULL)) {
- CREDENTIALS c;
- krb5_creds mcred, cred;
- krb5_realm realm;
-
- krb5_get_default_realm(context, &realm);
- krb5_make_principal(context, &mcred.server, realm,
- "krbtgt",
- realm,
- NULL);
- free (realm);
- ret = krb5_cc_retrieve_cred(context, ccache, 0, &mcred, &cred);
- if(ret == 0) {
- ret = krb524_convert_creds_kdc(context, ccache, &cred, &c);
- if(ret)
- krb5_warn(context, ret, "converting creds");
- else {
- set_krbtkfile(pwd->pw_uid);
- tf_setup(&c, c.pname, c.pinst);
- }
- memset(&c, 0, sizeof(c));
- krb5_free_creds_contents(context, &cred);
- } else
- syslog(LOG_AUTH|LOG_DEBUG, "krb5_cc_retrieve_cred: %s",
- krb5_get_err_text(context, ret));
-
- krb5_free_principal(context, mcred.server);
- }
- if (!pag_set && k_hasafs()) {
- k_setpag();
- pag_set = 1;
- krb5_afslog_uid_home(context, ccache, NULL, NULL,
- pwd->pw_uid, pwd->pw_dir);
- }
-#endif
-out:
- if(ret && !quiet)
- printf ("%s\n", krb5_get_err_text (context, ret));
- return ret;
-}
-#endif
-
-#ifdef KRB4
-static int
-verify_krb4(struct passwd *pwd,
- char *password,
- int32_t *exp,
- int quiet)
-{
- int ret = 1;
- char lrealm[REALM_SZ];
-
- if (krb_get_lrealm (lrealm, 1) != KFAILURE) {
- set_krbtkfile(pwd->pw_uid);
- ret = krb_verify_user (pwd->pw_name, "", lrealm, password,
- KRB_VERIFY_SECURE, NULL);
- if (ret == KSUCCESS) {
- if (!pag_set && k_hasafs()) {
- k_setpag ();
- pag_set = 1;
- krb_afslog_uid_home (0, 0, pwd->pw_uid, pwd->pw_dir);
- }
- } else if (!quiet)
- printf ("%s\n", krb_get_err_text (ret));
- }
- return ret;
-}
-#endif
-
-int
-afs_verify(char *name,
- char *password,
- int32_t *exp,
- int quiet)
-{
- int ret = 1;
- struct passwd *pwd = k_getpwnam (name);
-
- if(pwd == NULL)
- return 1;
- if (ret)
- ret = unix_verify_user (name, password);
-#ifdef KRB5
- if (ret)
- ret = verify_krb5(pwd, password, exp, quiet);
-#endif
-#ifdef KRB4
- if(ret)
- ret = verify_krb4(pwd, password, exp, quiet);
-#endif
- return ret;
-}
-
-char *
-afs_gettktstring (void)
-{
- char *ptr;
- struct passwd *pwd;
-
- if (!correct_tkfilename) {
- ptr = getenv("LOGNAME");
- if (ptr != NULL && ((pwd = getpwnam(ptr)) != NULL)) {
- set_krb5ccname(pwd->pw_uid);
-#ifdef KRB4
- set_krbtkfile(pwd->pw_uid);
- if (!pag_set && k_hasafs()) {
- k_setpag();
- pag_set=1;
- }
-#endif
- } else {
- set_spec_krbtkfile();
- }
- }
-#ifdef KRB5
- setenv("KRB5CCNAME",krb5ccname,1);
-#endif
-#ifdef KRB4
- setenv("KRBTKFILE",krbtkfile,1);
- return krbtkfile;
-#else
- return "";
-#endif
-}
diff --git a/crypto/kerberosIV/lib/auth/pam/Makefile.am b/crypto/kerberosIV/lib/auth/pam/Makefile.am
deleted file mode 100644
index abde2d9a49385..0000000000000
--- a/crypto/kerberosIV/lib/auth/pam/Makefile.am
+++ /dev/null
@@ -1,3 +0,0 @@
-# $Id: Makefile.am,v 1.2 1999/04/01 14:57:04 joda Exp $
-
-include $(top_srcdir)/Makefile.am.common
diff --git a/crypto/kerberosIV/lib/auth/pam/Makefile.in b/crypto/kerberosIV/lib/auth/pam/Makefile.in
deleted file mode 100644
index b012fcd63ecfc..0000000000000
--- a/crypto/kerberosIV/lib/auth/pam/Makefile.in
+++ /dev/null
@@ -1,88 +0,0 @@
-#
-# $Id: Makefile.in,v 1.25 1999/11/15 10:20:48 assar Exp $
-#
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-CC = @CC@
-LINK = @LINK@
-AR = ar
-RANLIB = @RANLIB@
-DEFS = @DEFS@
-CFLAGS = @CFLAGS@ $(WFLAGS)
-WFLAGS = @WFLAGS@
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-
-PICFLAGS = @REAL_PICFLAGS@
-LDSHARED = @LDSHARED@
-SHLIBEXT = @REAL_SHLIBEXT@
-LD_FLAGS = @REAL_LD_FLAGS@
-
-LIB_res_search = @LIB_res_search@
-LIB_dn_expand = @LIB_dn_expand@
-
-@lib_deps_yes@LIB_DEPS = -L../../kafs -L../../krb -L../../des \
-@lib_deps_yes@ -lkafs -lkrb -ldes \
-@lib_deps_yes@ $(LIB_res_search) $(LIB_dn_expand) -lpam -lc
-@lib_deps_no@LIB_DEPS =
-
-LIBNAME = pam_krb4
-LIB = $(LIBNAME).$(SHLIBEXT)
-
-SOURCES = pam.c
-
-OBJECTS = pam.o
-
-all: $(LIB)
-
-Wall:
- make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
-
-.c.o:
- $(CC) -c $(DEFS) -I../../../include -I$(srcdir) $(CFLAGS) $(CPPFLAGS) $(PICFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
- -if test "$(LIB)" != ""; then \
- $(INSTALL_DATA) -m 0555 $(LIB) $(DESTDIR)$(libdir)/$(LIB) ; \
- fi
-
-uninstall:
- -if test "$(LIB)" != ""; then \
- rm -f $(DESTDIR)$(libdir)/$(LIB) ; \
- fi
-
-TAGS: $(SOURCES)
- etags $(SOURCES)
-
-check:
-
-clean:
- rm -f $(LIB) *.o
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile *.tab.c *~
-
-realclean: distclean
- rm -f TAGS
-
-$(OBJECTS): ../../../include/config.h
-
-$(LIB): $(OBJECTS)
- rm -f $@
- $(LDSHARED) -o $@ $(OBJECTS) $(LD_FLAGS) $(LIB_DEPS)
-# $(LINK) -shared -Wl,-x -o $(LIB) $(OBJECTS) ../../kafs/libkafs.a ../../krb/libkrb.a ../../des/libdes.a
-
-.PHONY: all Wall install uninstall check clean mostlyclean distclean realclean
diff --git a/crypto/kerberosIV/lib/auth/pam/README b/crypto/kerberosIV/lib/auth/pam/README
deleted file mode 100644
index 2c45a53db5ed0..0000000000000
--- a/crypto/kerberosIV/lib/auth/pam/README
+++ /dev/null
@@ -1,25 +0,0 @@
-
-PAM
----
-
-The PAM module was written more out of curiosity that anything else. It
-has not been updated for quite a while, but it seems to mostly work on
-both Linux and Solaris.
-
-To use this module you should:
-
- * Make sure `pam_krb4.so' is available in `/usr/athena/lib'. You
- might actually want it on local disk, so `/lib/security' might be a
- better place if `/usr/athena' is not local.
-
- * Look at `pam.conf.add' for examples of what to add to
- `/etc/pam.conf'.
-
-There is currently no support for changing kerberos passwords. Use
-kpasswd instead.
-
-See also Derrick J Brashear's `<shadow@dementia.org>' Kerberos PAM
-module at
-<ftp://ftp.dementia.org/pub/pam>. It has a lot more features, and it is
-also more in line with other PAM modules.
-
diff --git a/crypto/kerberosIV/lib/auth/pam/pam.c b/crypto/kerberosIV/lib/auth/pam/pam.c
deleted file mode 100644
index d919bf8f83b8a..0000000000000
--- a/crypto/kerberosIV/lib/auth/pam/pam.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 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.
- */
-
-/* This code is extremely ugly, and would probably be better off
- beeing completely rewritten */
-
-
-#ifdef HAVE_CONFIG_H
-#include<config.h>
-RCSID("$Id: pam.c,v 1.22 1999/12/02 16:58:37 joda Exp $");
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <pwd.h>
-#include <unistd.h>
-#include <sys/types.h>
-
-#define PAM_SM_AUTH
-#define PAM_SM_SESSION
-#include <security/pam_appl.h>
-#include <security/pam_modules.h>
-
-#include <netinet/in.h>
-#include <krb.h>
-#include <kafs.h>
-
-static int
-cleanup(pam_handle_t *pamh, void *data, int error_code)
-{
- if(error_code != PAM_SUCCESS)
- dest_tkt();
- free(data);
- return PAM_SUCCESS;
-}
-
-static int
-doit(pam_handle_t *pamh, char *name, char *inst, char *pwd, char *tkt)
-{
- char realm[REALM_SZ];
- int ret;
-
- pam_set_data(pamh, "KRBTKFILE", strdup(tkt), cleanup);
- krb_set_tkt_string(tkt);
-
- krb_get_lrealm(realm, 1);
- ret = krb_verify_user(name, inst, realm, pwd, KRB_VERIFY_SECURE, NULL);
- memset(pwd, 0, strlen(pwd));
- switch(ret){
- case KSUCCESS:
- return PAM_SUCCESS;
- case KDC_PR_UNKNOWN:
- return PAM_USER_UNKNOWN;
- case SKDC_CANT:
- case SKDC_RETRY:
- case RD_AP_TIME:
- return PAM_AUTHINFO_UNAVAIL;
- default:
- return PAM_AUTH_ERR;
- }
-}
-
-static int
-auth_login(pam_handle_t *pamh, int flags, char *user, struct pam_conv *conv)
-{
- int ret;
- struct pam_message msg, *pmsg;
- struct pam_response *resp;
- char prompt[128];
-
- pmsg = &msg;
- msg.msg_style = PAM_PROMPT_ECHO_OFF;
- snprintf(prompt, sizeof(prompt), "%s's Password: ", user);
- msg.msg = prompt;
-
- ret = conv->conv(1, (const struct pam_message**)&pmsg,
- &resp, conv->appdata_ptr);
- if(ret != PAM_SUCCESS)
- return ret;
-
- {
- char tkt[1024];
- struct passwd *pw = getpwnam(user);
-
- if(pw){
- snprintf(tkt, sizeof(tkt),
- "%s%u", TKT_ROOT, (unsigned)pw->pw_uid);
- ret = doit(pamh, user, "", resp->resp, tkt);
- if(ret == PAM_SUCCESS)
- chown(tkt, pw->pw_uid, pw->pw_gid);
- }else
- ret = PAM_USER_UNKNOWN;
- memset(resp->resp, 0, strlen(resp->resp));
- free(resp->resp);
- free(resp);
- }
- return ret;
-}
-
-static int
-auth_su(pam_handle_t *pamh, int flags, char *user, struct pam_conv *conv)
-{
- int ret;
- struct passwd *pw;
- struct pam_message msg, *pmsg;
- struct pam_response *resp;
- char prompt[128];
- krb_principal pr;
-
- pr.realm[0] = 0;
- ret = pam_get_user(pamh, &user, "login: ");
- if(ret != PAM_SUCCESS)
- return ret;
-
- pw = getpwuid(getuid());
- if(strcmp(user, "root") == 0){
- strlcpy(pr.name, pw->pw_name, sizeof(pr.name));
- strlcpy(pr.instance, "root", sizeof(pr.instance));
- }else{
- strlcpy(pr.name, user, sizeof(pr.name));
- pr.instance[0] = 0;
- }
- pmsg = &msg;
- msg.msg_style = PAM_PROMPT_ECHO_OFF;
- snprintf(prompt, sizeof(prompt), "%s's Password: ", krb_unparse_name(&pr));
- msg.msg = prompt;
-
- ret = conv->conv(1, (const struct pam_message**)&pmsg,
- &resp, conv->appdata_ptr);
- if(ret != PAM_SUCCESS)
- return ret;
-
- {
- char tkt[1024];
-
- snprintf(tkt, sizeof(tkt),"%s_%s_to_%s",
- TKT_ROOT, pw->pw_name, user);
- ret = doit(pamh, pr.name, pr.instance, resp->resp, tkt);
- if(ret == PAM_SUCCESS)
- chown(tkt, pw->pw_uid, pw->pw_gid);
- memset(resp->resp, 0, strlen(resp->resp));
- free(resp->resp);
- free(resp);
- }
- return ret;
-}
-
-int
-pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv)
-{
- char *user;
- int ret;
- struct pam_conv *conv;
- ret = pam_get_user(pamh, &user, "login: ");
- if(ret != PAM_SUCCESS)
- return ret;
-
- ret = pam_get_item(pamh, PAM_CONV, (void*)&conv);
- if(ret != PAM_SUCCESS)
- return ret;
-
-
- if(getuid() != geteuid())
- return auth_su(pamh, flags, user, conv);
- else
- return auth_login(pamh, flags, user, conv);
-}
-
-int
-pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char **argv)
-{
- return PAM_SUCCESS;
-}
-
-
-int
-pam_sm_open_session(pam_handle_t *pamh, int flags, int argc, const char **argv)
-{
- char *tkt, *var;
- void *user;
- const char *homedir = NULL;
-
- if(pam_get_item (pamh, PAM_USER, &user) == PAM_SUCCESS) {
- struct passwd *pwd;
-
- pwd = getpwnam ((char *)user);
- if (pwd != NULL)
- homedir = pwd->pw_dir;
- }
-
- pam_get_data(pamh, "KRBTKFILE", (const void**)&tkt);
- var = malloc(strlen("KRBTKFILE=") + strlen(tkt) + 1);
- strcpy(var, "KRBTKFILE=");
- strcat(var, tkt);
- putenv(var);
- pam_putenv(pamh, var);
- if(k_hasafs()){
- k_setpag();
- krb_afslog_home(0, 0, homedir);
- }
- return PAM_SUCCESS;
-}
-
-
-int
-pam_sm_close_session(pam_handle_t *pamh, int flags, int argc, const char **argv)
-{
- dest_tkt();
- if(k_hasafs())
- k_unlog();
- return PAM_SUCCESS;
-}
diff --git a/crypto/kerberosIV/lib/auth/pam/pam.conf.add b/crypto/kerberosIV/lib/auth/pam/pam.conf.add
deleted file mode 100644
index 42497d2b44a05..0000000000000
--- a/crypto/kerberosIV/lib/auth/pam/pam.conf.add
+++ /dev/null
@@ -1,76 +0,0 @@
-To enable PAM in dtlogin and /bin/login under SunOS 5.6 apply this patch:
-
---- /etc/pam.conf.DIST Mon Jul 20 15:37:46 1998
-+++ /etc/pam.conf Tue Nov 30 18:47:22 1999
-@@ -4,12 +4,14 @@
- #
- # Authentication management
- #
-+login auth sufficient /usr/athena/lib/pam_krb4.so
- login auth required /usr/lib/security/pam_unix.so.1
- login auth required /usr/lib/security/pam_dial_auth.so.1
- #
- rlogin auth sufficient /usr/lib/security/pam_rhosts_auth.so.1
- rlogin auth required /usr/lib/security/pam_unix.so.1
- #
-+dtlogin auth sufficient /usr/athena/lib/pam_krb4.so
- dtlogin auth required /usr/lib/security/pam_unix.so.1
- #
- rsh auth required /usr/lib/security/pam_rhosts_auth.so.1
-@@ -24,6 +26,8 @@
- #
- # Session management
- #
-+dtlogin session required /usr/athena/lib/pam_krb4.so
-+login session required /usr/athena/lib/pam_krb4.so
- other session required /usr/lib/security/pam_unix.so.1
- #
- # Password management
----------------------------------------------------------------------------
-To enable PAM in /bin/login and xdm under Red Hat 6.1 apply these patches:
-
---- /etc/pam.d/login~ Thu Jul 8 00:14:02 1999
-+++ /etc/pam.d/login Mon Aug 30 14:33:12 1999
-@@ -1,9 +1,12 @@
- #%PAM-1.0
-+# Updated to work with kerberos
-+auth sufficient /lib/security/pam_krb4.so
- auth required /lib/security/pam_securetty.so
- auth required /lib/security/pam_pwdb.so shadow nullok
- auth required /lib/security/pam_nologin.so
- account required /lib/security/pam_pwdb.so
- password required /lib/security/pam_cracklib.so
- password required /lib/security/pam_pwdb.so nullok use_authtok shadow
-+session required /lib/security/pam_krb4.so
- session required /lib/security/pam_pwdb.so
- session optional /lib/security/pam_console.so
---- /etc/pam.d/xdm~ Mon Jun 14 17:39:05 1999
-+++ /etc/pam.d/xdm Mon Aug 30 14:54:51 1999
-@@ -1,8 +1,10 @@
- #%PAM-1.0
-+auth sufficient /lib/security/pam_krb4.so
- auth required /lib/security/pam_pwdb.so shadow nullok
- auth required /lib/security/pam_nologin.so
- account required /lib/security/pam_pwdb.so
- password required /lib/security/pam_cracklib.so
- password required /lib/security/pam_pwdb.so shadow nullok use_authtok
-+session required /lib/security/pam_krb4.so
- session required /lib/security/pam_pwdb.so
- session optional /lib/security/pam_console.so
---------------------------------------------------------------------------
-
-This stuff may work under some other system.
-
-# To get this to work, you will have to add entries to /etc/pam.conf
-#
-# To make login kerberos-aware, you might change pam.conf to look
-# like:
-
-# login authorization
-login auth sufficient /lib/security/pam_krb4.so
-login auth required /lib/security/pam_securetty.so
-login auth required /lib/security/pam_unix_auth.so
-login account required /lib/security/pam_unix_acct.so
-login password required /lib/security/pam_unix_passwd.so
-login session required /lib/security/pam_krb4.so
-login session required /lib/security/pam_unix_session.so
diff --git a/crypto/kerberosIV/lib/auth/sia/Makefile.am b/crypto/kerberosIV/lib/auth/sia/Makefile.am
deleted file mode 100644
index 5a58cb72d3599..0000000000000
--- a/crypto/kerberosIV/lib/auth/sia/Makefile.am
+++ /dev/null
@@ -1,48 +0,0 @@
-# $Id: Makefile.am,v 1.4 1999/04/08 12:36:40 joda Exp $
-
-include $(top_srcdir)/Makefile.am.common
-
-INCLUDES += $(INCLUDE_krb4)
-
-WFLAGS += $(WFLAGS_NOIMPLICITINT)
-
-DEFS = @DEFS@
-
-## this is horribly ugly, but automake/libtool doesn't allow us to
-## unconditionally build shared libraries, and it does not allow us to
-## link with non-installed libraries
-
-if KRB4
-KAFS=$(top_builddir)/lib/kafs/.libs/libkafs.a
-endif
-
-L = \
- $(KAFS) \
- $(top_builddir)/lib/krb5/.libs/libkrb5.a \
- $(top_builddir)/lib/asn1/.libs/libasn1.a \
- $(LIB_krb4) \
- $(top_builddir)/lib/des/.libs/libdes.a \
- $(top_builddir)/lib/com_err/.libs/libcom_err.a \
- $(top_builddir)/lib/roken/.libs/libroken.a \
- $(LIB_getpwnam_r) \
- -lc
-
-EXTRA_DIST = sia.c krb5_matrix.conf krb5+c2_matrix.conf security.patch
-
-foodir = $(libdir)
-foo_DATA = libsia_krb5.so
-
-LDFLAGS = -rpath $(libdir) -hidden -exported_symbol siad_\*
-
-OBJS = sia.o posix_getpw.o
-
-libsia_krb5.so: $(OBJS)
- ld -shared -o $@ $(LDFLAGS) $(OBJS) $(L)
- ostrip -x -z $@
-
-CLEANFILES = libsia_krb5.so $(OBJS) so_locations
-
-SUFFIXES += .c .o
-
-.c.o:
- $(COMPILE) -c $<
diff --git a/crypto/kerberosIV/lib/auth/sia/Makefile.in b/crypto/kerberosIV/lib/auth/sia/Makefile.in
deleted file mode 100644
index 69858bd60257d..0000000000000
--- a/crypto/kerberosIV/lib/auth/sia/Makefile.in
+++ /dev/null
@@ -1,90 +0,0 @@
-#
-# $Id: Makefile.in,v 1.30 1999/11/15 10:20:50 assar Exp $
-#
-
-SHELL = /bin/sh
-
-srcdir = @srcdir@
-VPATH = @srcdir@
-
-CC = @CC@
-LINK = @LINK@
-AR = ar
-RANLIB = @RANLIB@
-DEFS = @DEFS@
-CFLAGS = @CFLAGS@ $(WFLAGS)
-WFLAGS = @WFLAGS@
-
-INSTALL = @INSTALL@
-INSTALL_DATA = @INSTALL_DATA@
-MKINSTALLDIRS = @top_srcdir@/mkinstalldirs
-
-prefix = @prefix@
-exec_prefix = @exec_prefix@
-libdir = @libdir@
-
-PICFLAGS = @REAL_PICFLAGS@
-SHARED = @SHARED@
-LDSHARED = @LDSHARED@
-SHLIBEXT = @REAL_SHLIBEXT@
-LD_FLAGS = @REAL_LD_FLAGS@
-
-@lib_deps_yes@LIB_DEPS = -L../../kafs -lkafs \
-@lib_deps_yes@ -L../../kadm -lkadm \
-@lib_deps_yes@ -L../../krb -lkrb \
-@lib_deps_yes@ -L../../des -ldes \
-@lib_deps_yes@ -L../../com_err -lcom_err \
-@lib_deps_yes@ -L../../roken -lroken \
-@lib_deps_yes@ @LIB_getpwnam_r@ \
-@lib_deps_yes@ -lc
-@lib_deps_no@LIB_DEPS =
-
-LIBNAME = libsia_krb4
-LIB = $(LIBNAME).$(SHLIBEXT)
-
-SOURCES = sia.c posix_getpw.c
-
-OBJECTS = sia.o posix_getpw.o
-
-all: $(LIB)
-
-Wall:
- make CFLAGS="-g -Wall -Wno-comment -Wmissing-prototypes -Wmissing-declarations -D__USE_FIXED_PROTOTYPES__"
-
-.c.o:
- $(CC) -c $(DEFS) -I../../../include -I$(srcdir) $(CFLAGS) $(CPPFLAGS) $(PICFLAGS) $<
-
-install: all
- $(MKINSTALLDIRS) $(DESTDIR)$(libdir)
- -if test "$(LIB)" != ""; then \
- $(INSTALL_DATA) -m 0555 $(LIB) $(DESTDIR)$(libdir)/$(LIB) ; \
- fi
-
-uninstall:
- -if test "$(LIB)" != ""; then \
- rm -f $(DESTDIR)$(libdir)/$(LIB) ; \
- fi
-
-TAGS: $(SOURCES)
- etags $(SOURCES)
-
-check:
-
-clean:
- rm -f $(LIB) *.o
-
-mostlyclean: clean
-
-distclean: clean
- rm -f Makefile *.tab.c *~
-
-realclean: distclean
- rm -f TAGS
-
-$(OBJECTS): ../../../include/config.h
-
-$(LIB): $(OBJECTS)
- rm -f $@
- $(LDSHARED) -shared -o $@ -rpath $(libdir) -hidden -exported_symbol siad_\* $(OBJECTS) $(LIB_DEPS)
-
-.PHONY: all Wall install uninstall check clean mostlyclean distclean realclean
diff --git a/crypto/kerberosIV/lib/auth/sia/README b/crypto/kerberosIV/lib/auth/sia/README
deleted file mode 100644
index 65957345dad1e..0000000000000
--- a/crypto/kerberosIV/lib/auth/sia/README
+++ /dev/null
@@ -1,87 +0,0 @@
-
-Digital SIA
------------
-
-To install the SIA module you will have to do the following:
-
- * Make sure `libsia_krb4.so' is available in `/usr/athena/lib'. If
- `/usr/athena' is not on local disk, you might want to put it in
- `/usr/shlib' or someplace else. If you do, you'll have to edit
- `krb4_matrix.conf' to reflect the new location (you will also have
- to do this if you installed in some other directory than
- `/usr/athena'). If you built with shared libraries, you will have
- to copy the shared `libkrb.so', `libdes.so', `libkadm.so', and
- `libkafs.so' to a place where the loader can find them (such as
- `/usr/shlib').
-
- * Copy (your possibly edited) `krb4_matrix.conf' to `/etc/sia'.
-
- * Apply `security.patch' to `/sbin/init.d/security'.
-
- * Turn on KRB4 security by issuing `rcmgr set SECURITY KRB4' and
- `rcmgr set KRB4_MATRIX_CONF krb4_matrix.conf'.
-
- * Digital thinks you should reboot your machine, but that really
- shouldn't be necessary. It's usually sufficient just to run
- `/sbin/init.d/security start' (and restart any applications that
- use SIA, like `xdm'.)
-
-Users with local passwords (like `root') should be able to login safely.
-
-When using Digital's xdm the `KRBTKFILE' environment variable isn't
-passed along as it should (since xdm zaps the environment). Instead you
-have to set `KRBTKFILE' to the correct value in
-`/usr/lib/X11/xdm/Xsession'. Add a line similar to
- KRBTKFILE=/tmp/tkt`id -u`_`ps -o ppid= -p $$`; export KRBTKFILE
-If you use CDE, `dtlogin' allows you to specify which additional
-environment variables it should export. To add `KRBTKFILE' to this
-list, edit `/usr/dt/config/Xconfig', and look for the definition of
-`exportList'. You want to add something like:
- Dtlogin.exportList: KRBTKFILE
-
-Notes to users with Enhanced security
-.....................................
-
-Digital's `ENHANCED' (C2) security, and Kerberos solves two different
-problems. C2 deals with local security, adds better control of who can
-do what, auditing, and similar things. Kerberos deals with network
-security.
-
-To make C2 security work with Kerberos you will have to do the
-following.
-
- * Replace all occurencies of `krb4_matrix.conf' with
- `krb4+c2_matrix.conf' in the directions above.
-
- * You must enable "vouching" in the `default' database. This will
- make the OSFC2 module trust other SIA modules, so you can login
- without giving your C2 password. To do this use `edauth' to edit
- the default entry `/usr/tcb/bin/edauth -dd default', and add a
- `d_accept_alternate_vouching' capability, if not already present.
-
- * For each user that does _not_ have a local C2 password, you should
- set the password expiration field to zero. You can do this for each
- user, or in the `default' table. To do this use `edauth' to set
- (or change) the `u_exp' capability to `u_exp#0'.
-
- * You also need to be aware that the shipped `login', `rcp', and
- `rshd', doesn't do any particular C2 magic (such as checking to
- various forms of disabled accounts), so if you rely on those
- features, you shouldn't use those programs. If you configure with
- `--enable-osfc2', these programs will, however, set the login UID.
- Still: use at your own risk.
-
-At present `su' does not accept the vouching flag, so it will not work
-as expected.
-
-Also, kerberised ftp will not work with C2 passwords. You can solve this
-by using both Digital's ftpd and our on different ports.
-
-*Remember*, if you do these changes you will get a system that most
-certainly does _not_ fulfill the requirements of a C2 system. If C2 is
-what you want, for instance if someone else is forcing you to use it,
-you're out of luck. If you use enhanced security because you want a
-system that is more secure than it would otherwise be, you probably got
-an even more secure system. Passwords will not be sent in the clear,
-for instance.
-
diff --git a/crypto/kerberosIV/lib/auth/sia/krb4+c2_matrix.conf b/crypto/kerberosIV/lib/auth/sia/krb4+c2_matrix.conf
deleted file mode 100644
index 4b90e0264a372..0000000000000
--- a/crypto/kerberosIV/lib/auth/sia/krb4+c2_matrix.conf
+++ /dev/null
@@ -1,58 +0,0 @@
-# Copyright (c) 1998 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: krb4+c2_matrix.conf,v 1.4 1999/12/02 16:58:37 joda Exp $
-
-# sia matrix configuration file (Kerberos 4 + C2)
-
-siad_init=(KRB4,/usr/athena/lib/libsia_krb4.so)(BSD,libc.so)
-siad_chk_invoker=(KRB4,/usr/athena/lib/libsia_krb4.so)(OSFC2,/usr/shlib/libsecurity.so)
-siad_ses_init=(KRB4,/usr/athena/lib/libsia_krb4.so)(OSFC2,/usr/shlib/libsecurity.so)
-siad_ses_authent=(KRB4,/usr/athena/lib/libsia_krb4.so)(OSFC2,/usr/shlib/libsecurity.so)
-siad_ses_estab=(KRB4,/usr/athena/lib/libsia_krb4.so)(OSFC2,/usr/shlib/libsecurity.so)
-siad_ses_launch=(KRB4,/usr/athena/lib/libsia_krb4.so)(OSFC2,/usr/shlib/libsecurity.so)
-siad_ses_suauthent=(KRB4,/usr/athena/lib/libsia_krb4.so)(OSFC2,/usr/shlib/libsecurity.so)
-siad_ses_reauthent=(KRB4,/usr/athena/lib/libsia_krb4.so)(OSFC2,/usr/shlib/libsecurity.so)
-siad_chg_finger=(KRB4,/usr/athena/lib/libsia_krb4.so)(OSFC2,/usr/shlib/libsecurity.so)
-siad_chg_password=(KRB4,/usr/athena/lib/libsia_krb4.so)(OSFC2,/usr/shlib/libsecurity.so)
-siad_chg_shell=(KRB4,/usr/athena/lib/libsia_krb4.so)(OSFC2,/usr/shlib/libsecurity.so)
-siad_getpwent=(BSD,libc.so)
-siad_getpwuid=(BSD,libc.so)
-siad_getpwnam=(BSD,libc.so)
-siad_setpwent=(BSD,libc.so)
-siad_endpwent=(BSD,libc.so)
-siad_getgrent=(BSD,libc.so)
-siad_getgrgid=(BSD,libc.so)
-siad_getgrnam=(BSD,libc.so)
-siad_setgrent=(BSD,libc.so)
-siad_endgrent=(BSD,libc.so)
-siad_ses_release=(KRB4,/usr/athena/lib/libsia_krb4.so)(OSFC2,/usr/shlib/libsecurity.so)
-siad_chk_user=(KRB4,/usr/athena/lib/libsia_krb4.so)(OSFC2,/usr/shlib/libsecurity.so)
diff --git a/crypto/kerberosIV/lib/auth/sia/krb4_matrix.conf b/crypto/kerberosIV/lib/auth/sia/krb4_matrix.conf
deleted file mode 100644
index 4f55a810ce717..0000000000000
--- a/crypto/kerberosIV/lib/auth/sia/krb4_matrix.conf
+++ /dev/null
@@ -1,59 +0,0 @@
-# Copyright (c) 1998 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: krb4_matrix.conf,v 1.6 1999/12/02 16:58:37 joda Exp $
-
-# sia matrix configuration file (Kerberos 4 + BSD)
-
-siad_init=(KRB4,/usr/athena/lib/libsia_krb4.so)(BSD,libc.so)
-siad_chk_invoker=(BSD,libc.so)
-siad_ses_init=(KRB4,/usr/athena/lib/libsia_krb4.so)
-siad_ses_authent=(KRB4,/usr/athena/lib/libsia_krb4.so)(BSD,libc.so)
-siad_ses_estab=(BSD,libc.so)
-siad_ses_launch=(KRB4,/usr/athena/lib/libsia_krb4.so)(BSD,libc.so)
-siad_ses_suauthent=(KRB4,/usr/athena/lib/libsia_krb4.so)(BSD,libc.so)
-siad_ses_reauthent=(KRB4,/usr/athena/lib/libsia_krb4.so)(BSD,libc.so)
-siad_chg_finger=(BSD,libc.so)
-siad_chg_password=(KRB4,/usr/athena/lib/libsia_krb4.so)(BSD,libc.so)
-siad_chg_shell=(BSD,libc.so)
-siad_getpwent=(BSD,libc.so)
-siad_getpwuid=(BSD,libc.so)
-siad_getpwnam=(BSD,libc.so)
-siad_setpwent=(BSD,libc.so)
-siad_endpwent=(BSD,libc.so)
-siad_getgrent=(BSD,libc.so)
-siad_getgrgid=(BSD,libc.so)
-siad_getgrnam=(BSD,libc.so)
-siad_setgrent=(BSD,libc.so)
-siad_endgrent=(BSD,libc.so)
-siad_ses_release=(KRB4,/usr/athena/lib/libsia_krb4.so)(BSD,libc.so)
-siad_chk_user=(KRB4,/usr/athena/lib/libsia_krb4.so)(BSD,libc.so)
-
diff --git a/crypto/kerberosIV/lib/auth/sia/krb5+c2_matrix.conf b/crypto/kerberosIV/lib/auth/sia/krb5+c2_matrix.conf
deleted file mode 100644
index c2952e2db8f6a..0000000000000
--- a/crypto/kerberosIV/lib/auth/sia/krb5+c2_matrix.conf
+++ /dev/null
@@ -1,27 +0,0 @@
-# $Id: krb5+c2_matrix.conf,v 1.2 1998/11/26 20:58:18 assar Exp $
-
-# sia matrix configuration file (Kerberos 5 + C2)
-
-siad_init=(KRB5,/usr/athena/lib/libsia_krb5.so)(BSD,libc.so)
-siad_chk_invoker=(OSFC2,/usr/shlib/libsecurity.so)
-siad_ses_init=(KRB5,/usr/athena/lib/libsia_krb5.so)(OSFC2,/usr/shlib/libsecurity.so)
-siad_ses_authent=(KRB5,/usr/athena/lib/libsia_krb5.so)(OSFC2,/usr/shlib/libsecurity.so)
-siad_ses_estab=(KRB5,/usr/athena/lib/libsia_krb5.so)(OSFC2,/usr/shlib/libsecurity.so)
-siad_ses_launch=(KRB5,/usr/athena/lib/libsia_krb5.so)(OSFC2,/usr/shlib/libsecurity.so)
-siad_ses_suauthent=(KRB5,/usr/athena/lib/libsia_krb5.so)(OSFC2,/usr/shlib/libsecurity.so)
-siad_ses_reauthent=(KRB5,/usr/athena/lib/libsia_krb5.so)(OSFC2,/usr/shlib/libsecurity.so)
-siad_chg_finger=(KRB5,/usr/athena/lib/libsia_krb5.so)(OSFC2,/usr/shlib/libsecurity.so)
-siad_chg_password=(KRB5,/usr/athena/lib/libsia_krb5.so)(OSFC2,/usr/shlib/libsecurity.so)
-siad_chg_shell=(KRB5,/usr/athena/lib/libsia_krb5.so)(OSFC2,/usr/shlib/libsecurity.so)
-siad_getpwent=(BSD,libc.so)
-siad_getpwuid=(BSD,libc.so)
-siad_getpwnam=(BSD,libc.so)
-siad_setpwent=(BSD,libc.so)
-siad_endpwent=(BSD,libc.so)
-siad_getgrent=(BSD,libc.so)
-siad_getgrgid=(BSD,libc.so)
-siad_getgrnam=(BSD,libc.so)
-siad_setgrent=(BSD,libc.so)
-siad_endgrent=(BSD,libc.so)
-siad_ses_release=(KRB5,/usr/athena/lib/libsia_krb5.so)(OSFC2,/usr/shlib/libsecurity.so)
-siad_chk_user=(KRB5,/usr/athena/lib/libsia_krb5.so)(OSFC2,/usr/shlib/libsecurity.so)
diff --git a/crypto/kerberosIV/lib/auth/sia/krb5_matrix.conf b/crypto/kerberosIV/lib/auth/sia/krb5_matrix.conf
deleted file mode 100644
index e49366aefc677..0000000000000
--- a/crypto/kerberosIV/lib/auth/sia/krb5_matrix.conf
+++ /dev/null
@@ -1,27 +0,0 @@
-# $Id: krb5_matrix.conf,v 1.1 1997/05/15 18:34:18 joda Exp $
-
-# sia matrix configuration file (Kerberos 5 + BSD)
-
-siad_init=(KRB5,/usr/athena/lib/libsia_krb5.so)(BSD,libc.so)
-siad_chk_invoker=(BSD,libc.so)
-siad_ses_init=(KRB5,/usr/athena/lib/libsia_krb5.so)
-siad_ses_authent=(KRB5,/usr/athena/lib/libsia_krb5.so)(BSD,libc.so)
-siad_ses_estab=(BSD,libc.so)
-siad_ses_launch=(KRB5,/usr/athena/lib/libsia_krb5.so)(BSD,libc.so)
-siad_ses_suauthent=(KRB5,/usr/athena/lib/libsia_krb5.so)(BSD,libc.so)
-siad_ses_reauthent=(BSD,libc.so)
-siad_chg_finger=(BSD,libc.so)
-siad_chg_password=(BSD,libc.so)
-siad_chg_shell=(BSD,libc.so)
-siad_getpwent=(BSD,libc.so)
-siad_getpwuid=(BSD,libc.so)
-siad_getpwnam=(BSD,libc.so)
-siad_setpwent=(BSD,libc.so)
-siad_endpwent=(BSD,libc.so)
-siad_getgrent=(BSD,libc.so)
-siad_getgrgid=(BSD,libc.so)
-siad_getgrnam=(BSD,libc.so)
-siad_setgrent=(BSD,libc.so)
-siad_endgrent=(BSD,libc.so)
-siad_ses_release=(KRB5,/usr/athena/lib/libsia_krb5.so)(BSD,libc.so)
-siad_chk_user=(BSD,libc.so)
diff --git a/crypto/kerberosIV/lib/auth/sia/posix_getpw.c b/crypto/kerberosIV/lib/auth/sia/posix_getpw.c
deleted file mode 100644
index c5961dcd2c5bb..0000000000000
--- a/crypto/kerberosIV/lib/auth/sia/posix_getpw.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 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 KTH 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 KTH AND ITS 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 KTH OR ITS 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 "sia_locl.h"
-
-RCSID("$Id: posix_getpw.c,v 1.1 1999/03/21 17:07:02 joda Exp $");
-
-#ifndef POSIX_GETPWNAM_R
-/*
- * These functions translate from the old Digital UNIX 3.x interface
- * to POSIX.1c.
- */
-
-int
-posix_getpwnam_r(const char *name, struct passwd *pwd,
- char *buffer, int len, struct passwd **result)
-{
- int ret = getpwnam_r(name, pwd, buffer, len);
- if(ret == 0)
- *result = pwd;
- else{
- *result = NULL;
- ret = _Geterrno();
- if(ret == 0){
- ret = ERANGE;
- _Seterrno(ret);
- }
- }
- return ret;
-}
-
-int
-posix_getpwuid_r(uid_t uid, struct passwd *pwd,
- char *buffer, int len, struct passwd **result)
-{
- int ret = getpwuid_r(uid, pwd, buffer, len);
- if(ret == 0)
- *result = pwd;
- else{
- *result = NULL;
- ret = _Geterrno();
- if(ret == 0){
- ret = ERANGE;
- _Seterrno(ret);
- }
- }
- return ret;
-}
-#endif /* POSIX_GETPWNAM_R */
diff --git a/crypto/kerberosIV/lib/auth/sia/security.patch b/crypto/kerberosIV/lib/auth/sia/security.patch
deleted file mode 100644
index c407876d63623..0000000000000
--- a/crypto/kerberosIV/lib/auth/sia/security.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- /sbin/init.d/security~ Tue Aug 20 22:44:09 1996
-+++ /sbin/init.d/security Fri Nov 1 14:52:56 1996
-@@ -49,7 +49,7 @@
- SECURITY=BASE
- fi
- ;;
-- BASE)
-+ BASE|KRB4)
- ;;
- *)
- echo "security configuration set to default (BASE)."
diff --git a/crypto/kerberosIV/lib/auth/sia/sia.c b/crypto/kerberosIV/lib/auth/sia/sia.c
deleted file mode 100644
index 73cd53e7dcede..0000000000000
--- a/crypto/kerberosIV/lib/auth/sia/sia.c
+++ /dev/null
@@ -1,672 +0,0 @@
-/*
- * Copyright (c) 1995-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 "sia_locl.h"
-
-RCSID("$Id: sia.c,v 1.32 1999/10/03 15:49:36 joda Exp $");
-
-int
-siad_init(void)
-{
- return SIADSUCCESS;
-}
-
-int
-siad_chk_invoker(void)
-{
- SIA_DEBUG(("DEBUG", "siad_chk_invoker"));
- return SIADFAIL;
-}
-
-int
-siad_ses_init(SIAENTITY *entity, int pkgind)
-{
- struct state *s = malloc(sizeof(*s));
- SIA_DEBUG(("DEBUG", "siad_ses_init"));
- if(s == NULL)
- return SIADFAIL;
- memset(s, 0, sizeof(*s));
-#ifdef SIA_KRB5
- krb5_init_context(&s->context);
-#endif
- entity->mech[pkgind] = (int*)s;
- return SIADSUCCESS;
-}
-
-static int
-setup_name(SIAENTITY *e, prompt_t *p)
-{
- SIA_DEBUG(("DEBUG", "setup_name"));
- e->name = malloc(SIANAMEMIN + 1);
- if(e->name == NULL){
- SIA_DEBUG(("DEBUG", "failed to malloc %u bytes", SIANAMEMIN+1));
- return SIADFAIL;
- }
- p->prompt = (unsigned char*)"login: ";
- p->result = (unsigned char*)e->name;
- p->min_result_length = 1;
- p->max_result_length = SIANAMEMIN;
- p->control_flags = 0;
- return SIADSUCCESS;
-}
-
-static int
-setup_password(SIAENTITY *e, prompt_t *p)
-{
- SIA_DEBUG(("DEBUG", "setup_password"));
- e->password = malloc(SIAMXPASSWORD + 1);
- if(e->password == NULL){
- SIA_DEBUG(("DEBUG", "failed to malloc %u bytes", SIAMXPASSWORD+1));
- return SIADFAIL;
- }
- p->prompt = (unsigned char*)"Password: ";
- p->result = (unsigned char*)e->password;
- p->min_result_length = 0;
- p->max_result_length = SIAMXPASSWORD;
- p->control_flags = SIARESINVIS;
- return SIADSUCCESS;
-}
-
-
-static int
-doauth(SIAENTITY *entity, int pkgind, char *name)
-{
- struct passwd pw, *pwd;
- char pwbuf[1024];
- struct state *s = (struct state*)entity->mech[pkgind];
-#ifdef SIA_KRB5
- krb5_realm *realms, *r;
- krb5_principal principal;
- krb5_ccache ccache;
- krb5_error_code ret;
-#endif
-#ifdef SIA_KRB4
- char realm[REALM_SZ];
- char *toname, *toinst;
- int ret;
- struct passwd fpw, *fpwd;
- char fpwbuf[1024];
- int secure;
-#endif
-
- if(getpwnam_r(name, &pw, pwbuf, sizeof(pwbuf), &pwd) != 0){
- SIA_DEBUG(("DEBUG", "failed to getpwnam(%s)", name));
- return SIADFAIL;
- }
-
-#ifdef SIA_KRB5
- ret = krb5_get_default_realms(s->context, &realms);
-
- for (r = realms; *r != NULL; ++r) {
- krb5_make_principal (s->context, &principal, *r, entity->name, NULL);
-
- if(krb5_kuserok(s->context, principal, entity->name))
- break;
- }
- krb5_free_host_realm (s->context, realms);
- if (*r == NULL)
- return SIADFAIL;
-
- sprintf(s->ticket, "FILE:/tmp/krb5_cc%d_%d", pwd->pw_uid, getpid());
- ret = krb5_cc_resolve(s->context, s->ticket, &ccache);
- if(ret)
- return SIADFAIL;
-#endif
-
-#ifdef SIA_KRB4
- snprintf(s->ticket, sizeof(s->ticket),
- TKT_ROOT "%u_%u", (unsigned)pwd->pw_uid, (unsigned)getpid());
- krb_get_lrealm(realm, 1);
- toname = name;
- toinst = "";
- if(entity->authtype == SIA_A_SUAUTH){
- uid_t ouid;
-#ifdef HAVE_SIAENTITY_OUID
- ouid = entity->ouid;
-#else
- ouid = getuid();
-#endif
- if(getpwuid_r(ouid, &fpw, fpwbuf, sizeof(fpwbuf), &fpwd) != 0){
- SIA_DEBUG(("DEBUG", "failed to getpwuid(%u)", ouid));
- return SIADFAIL;
- }
- snprintf(s->ticket, sizeof(s->ticket), TKT_ROOT "_%s_to_%s_%d",
- fpwd->pw_name, pwd->pw_name, getpid());
- if(strcmp(pwd->pw_name, "root") == 0){
- toname = fpwd->pw_name;
- toinst = pwd->pw_name;
- }
- }
- if(entity->authtype == SIA_A_REAUTH)
- snprintf(s->ticket, sizeof(s->ticket), "%s", tkt_string());
-
- krb_set_tkt_string(s->ticket);
-
- setuid(0); /* XXX fix for fix in tf_util.c */
- if(krb_kuserok(toname, toinst, realm, name)){
- SIA_DEBUG(("DEBUG", "%s.%s@%s is not allowed to login as %s",
- toname, toinst, realm, name));
- return SIADFAIL;
- }
-#endif
-#ifdef SIA_KRB5
- ret = krb5_verify_user_lrealm(s->context, principal, ccache,
- entity->password, 1, NULL);
- if(ret){
- /* if this is most likely a local user (such as
- root), just silently return failure when the
- principal doesn't exist */
- if(ret != KRB5KDC_ERR_C_PRINCIPAL_UNKNOWN &&
- ret != KRB5KDC_ERR_S_PRINCIPAL_UNKNOWN)
- SIALOG("WARNING", "krb5_verify_user(%s): %s",
- entity->name, error_message(ret));
- return SIADFAIL;
- }
-#endif
-#ifdef SIA_KRB4
- if (getuid () == 0)
- secure = KRB_VERIFY_SECURE;
- else
- secure = KRB_VERIFY_NOT_SECURE;
-
- ret = krb_verify_user(toname, toinst, realm,
- entity->password, secure, NULL);
- if(ret){
- SIA_DEBUG(("DEBUG", "krb_verify_user: %s", krb_get_err_text(ret)));
- if(ret != KDC_PR_UNKNOWN)
- /* since this is most likely a local user (such as
- root), just silently return failure when the
- principal doesn't exist */
- SIALOG("WARNING", "krb_verify_user(%s.%s): %s",
- toname, toinst, krb_get_err_text(ret));
- return SIADFAIL;
- }
-#endif
- if(sia_make_entity_pwd(pwd, entity) == SIAFAIL)
- return SIADFAIL;
- s->valid = 1;
- return SIADSUCCESS;
-}
-
-
-static int
-common_auth(sia_collect_func_t *collect,
- SIAENTITY *entity,
- int siastat,
- int pkgind)
-{
- prompt_t prompts[2], *pr;
- char *name;
-
- SIA_DEBUG(("DEBUG", "common_auth"));
- if((siastat == SIADSUCCESS) && (geteuid() == 0))
- return SIADSUCCESS;
- if(entity == NULL) {
- SIA_DEBUG(("DEBUG", "entity == NULL"));
- return SIADFAIL | SIADSTOP;
- }
- name = entity->name;
- if(entity->acctname)
- name = entity->acctname;
-
- if((collect != NULL) && entity->colinput) {
- int num;
- pr = prompts;
- if(name == NULL){
- if(setup_name(entity, pr) != SIADSUCCESS)
- return SIADFAIL;
- pr++;
- }
- if(entity->password == NULL){
- if(setup_password(entity, pr) != SIADSUCCESS)
- return SIADFAIL;
- pr++;
- }
- num = pr - prompts;
- if(num == 1){
- if((*collect)(240, SIAONELINER, (unsigned char*)"", num,
- prompts) != SIACOLSUCCESS){
- SIA_DEBUG(("DEBUG", "collect failed"));
- return SIADFAIL | SIADSTOP;
- }
- } else if(num > 0){
- if((*collect)(0, SIAFORM, (unsigned char*)"", num,
- prompts) != SIACOLSUCCESS){
- SIA_DEBUG(("DEBUG", "collect failed"));
- return SIADFAIL | SIADSTOP;
- }
- }
- }
- if(name == NULL)
- name = entity->name;
- if(name == NULL || name[0] == '\0'){
- SIA_DEBUG(("DEBUG", "name is null"));
- return SIADFAIL;
- }
-
- if(entity->password == NULL || strlen(entity->password) > SIAMXPASSWORD){
- SIA_DEBUG(("DEBUG", "entity->password is null"));
- return SIADFAIL;
- }
-
- return doauth(entity, pkgind, name);
-}
-
-
-int
-siad_ses_authent(sia_collect_func_t *collect,
- SIAENTITY *entity,
- int siastat,
- int pkgind)
-{
- SIA_DEBUG(("DEBUG", "siad_ses_authent"));
- return common_auth(collect, entity, siastat, pkgind);
-}
-
-int
-siad_ses_estab(sia_collect_func_t *collect,
- SIAENTITY *entity, int pkgind)
-{
- SIA_DEBUG(("DEBUG", "siad_ses_estab"));
- return SIADFAIL;
-}
-
-int
-siad_ses_launch(sia_collect_func_t *collect,
- SIAENTITY *entity,
- int pkgind)
-{
- static char env[MaxPathLen];
- struct state *s = (struct state*)entity->mech[pkgind];
- SIA_DEBUG(("DEBUG", "siad_ses_launch"));
- if(s->valid){
-#ifdef SIA_KRB5
- chown(s->ticket + sizeof("FILE:") - 1,
- entity->pwd->pw_uid,
- entity->pwd->pw_gid);
- snprintf(env, sizeof(env), "KRB5CCNAME=%s", s->ticket);
-#endif
-#ifdef SIA_KRB4
- chown(s->ticket, entity->pwd->pw_uid, entity->pwd->pw_gid);
- snprintf(env, sizeof(env), "KRBTKFILE=%s", s->ticket);
-#endif
- putenv(env);
- }
-#ifdef KRB4
- if (k_hasafs()) {
- char cell[64];
- k_setpag();
- if(k_afs_cell_of_file(entity->pwd->pw_dir, cell, sizeof(cell)) == 0)
- krb_afslog(cell, 0);
- krb_afslog_home(0, 0, entity->pwd->pw_dir);
- }
-#endif
- return SIADSUCCESS;
-}
-
-int
-siad_ses_release(SIAENTITY *entity, int pkgind)
-{
- SIA_DEBUG(("DEBUG", "siad_ses_release"));
- if(entity->mech[pkgind]){
-#ifdef SIA_KRB5
- struct state *s = (struct state*)entity->mech[pkgind];
- krb5_free_context(s->context);
-#endif
- free(entity->mech[pkgind]);
- }
- return SIADSUCCESS;
-}
-
-int
-siad_ses_suauthent(sia_collect_func_t *collect,
- SIAENTITY *entity,
- int siastat,
- int pkgind)
-{
- SIA_DEBUG(("DEBUG", "siad_ses_suauth"));
- if(geteuid() != 0)
- return SIADFAIL;
- if(entity->name == NULL)
- return SIADFAIL;
- if(entity->name[0] == '\0') {
- free(entity->name);
- entity->name = strdup("root");
- if (entity->name == NULL)
- return SIADFAIL;
- }
- return common_auth(collect, entity, siastat, pkgind);
-}
-
-int
-siad_ses_reauthent (sia_collect_func_t *collect,
- SIAENTITY *entity,
- int siastat,
- int pkgind)
-{
- int ret;
- SIA_DEBUG(("DEBUG", "siad_ses_reauthent"));
- if(entity == NULL || entity->name == NULL)
- return SIADFAIL;
- ret = common_auth(collect, entity, siastat, pkgind);
- if((ret & SIADSUCCESS)){
- /* launch isn't (always?) called when doing reauth, so we must
- duplicate some code here... */
- struct state *s = (struct state*)entity->mech[pkgind];
- chown(s->ticket, entity->pwd->pw_uid, entity->pwd->pw_gid);
-#ifdef KRB4
- if(k_hasafs()) {
- char cell[64];
- if(k_afs_cell_of_file(entity->pwd->pw_dir,
- cell, sizeof(cell)) == 0)
- krb_afslog(cell, 0);
- krb_afslog_home(0, 0, entity->pwd->pw_dir);
- }
-#endif
- }
- return ret;
-}
-
-int
-siad_chg_finger (sia_collect_func_t *collect,
- const char *username,
- int argc,
- char *argv[])
-{
- SIA_DEBUG(("DEBUG", "siad_chg_finger"));
- return SIADFAIL;
-}
-
-#ifdef SIA_KRB5
-int
-siad_chg_password (sia_collect_func_t *collect,
- const char *username,
- int argc,
- char *argv[])
-{
- return SIADFAIL;
-}
-#endif
-
-#ifdef SIA_KRB4
-static void
-sia_message(sia_collect_func_t *collect, int rendition,
- const char *title, const char *message)
-{
- prompt_t prompt;
- prompt.prompt = (unsigned char*)message;
- (*collect)(0, rendition, (unsigned char*)title, 1, &prompt);
-}
-
-static int
-init_change(sia_collect_func_t *collect, krb_principal *princ)
-{
- prompt_t prompt;
- char old_pw[MAX_KPW_LEN+1];
- char *msg;
- char tktstring[128];
- int ret;
-
- SIA_DEBUG(("DEBUG", "init_change"));
- prompt.prompt = (unsigned char*)"Old password: ";
- prompt.result = (unsigned char*)old_pw;
- prompt.min_result_length = 0;
- prompt.max_result_length = sizeof(old_pw) - 1;
- prompt.control_flags = SIARESINVIS;
- asprintf(&msg, "Changing password for %s", krb_unparse_name(princ));
- if(msg == NULL){
- SIA_DEBUG(("DEBUG", "out of memory"));
- return SIADFAIL;
- }
- ret = (*collect)(60, SIAONELINER, (unsigned char*)msg, 1, &prompt);
- free(msg);
- SIA_DEBUG(("DEBUG", "ret = %d", ret));
- if(ret != SIACOLSUCCESS)
- return SIADFAIL;
- snprintf(tktstring, sizeof(tktstring),
- TKT_ROOT "_cpw_%u", (unsigned)getpid());
- krb_set_tkt_string(tktstring);
-
- ret = krb_get_pw_in_tkt(princ->name, princ->instance, princ->realm,
- PWSERV_NAME, KADM_SINST, 1, old_pw);
- if (ret != KSUCCESS) {
- SIA_DEBUG(("DEBUG", "krb_get_pw_in_tkt: %s", krb_get_err_text(ret)));
- if (ret == INTK_BADPW)
- sia_message(collect, SIAWARNING, "", "Incorrect old password.");
- else
- sia_message(collect, SIAWARNING, "", "Kerberos error.");
- memset(old_pw, 0, sizeof(old_pw));
- return SIADFAIL;
- }
- if(chown(tktstring, getuid(), -1) < 0){
- dest_tkt();
- return SIADFAIL;
- }
- memset(old_pw, 0, sizeof(old_pw));
- return SIADSUCCESS;
-}
-
-int
-siad_chg_password (sia_collect_func_t *collect,
- const char *username,
- int argc,
- char *argv[])
-{
- prompt_t prompts[2];
- krb_principal princ;
- int ret;
- char new_pw1[MAX_KPW_LEN+1];
- char new_pw2[MAX_KPW_LEN+1];
- static struct et_list *et_list;
-
- set_progname(argv[0]);
-
- SIA_DEBUG(("DEBUG", "siad_chg_password"));
- if(collect == NULL)
- return SIADFAIL;
-
- if(username == NULL)
- username = getlogin();
-
- ret = krb_parse_name(username, &princ);
- if(ret)
- return SIADFAIL;
- if(princ.realm[0] == '\0')
- krb_get_lrealm(princ.realm, 1);
-
- if(et_list == NULL) {
- initialize_kadm_error_table_r(&et_list);
- initialize_krb_error_table_r(&et_list);
- }
-
- ret = init_change(collect, &princ);
- if(ret != SIADSUCCESS)
- return ret;
-
-again:
- prompts[0].prompt = (unsigned char*)"New password: ";
- prompts[0].result = (unsigned char*)new_pw1;
- prompts[0].min_result_length = MIN_KPW_LEN;
- prompts[0].max_result_length = sizeof(new_pw1) - 1;
- prompts[0].control_flags = SIARESINVIS;
- prompts[1].prompt = (unsigned char*)"Verify new password: ";
- prompts[1].result = (unsigned char*)new_pw2;
- prompts[1].min_result_length = MIN_KPW_LEN;
- prompts[1].max_result_length = sizeof(new_pw2) - 1;
- prompts[1].control_flags = SIARESINVIS;
- if((*collect)(120, SIAFORM, (unsigned char*)"", 2, prompts) !=
- SIACOLSUCCESS) {
- dest_tkt();
- return SIADFAIL;
- }
- if(strcmp(new_pw1, new_pw2) != 0){
- sia_message(collect, SIAWARNING, "", "Password mismatch.");
- goto again;
- }
- ret = kadm_check_pw(new_pw1);
- if(ret) {
- sia_message(collect, SIAWARNING, "", com_right(et_list, ret));
- goto again;
- }
-
- memset(new_pw2, 0, sizeof(new_pw2));
- ret = kadm_init_link (PWSERV_NAME, KRB_MASTER, princ.realm);
- if (ret != KADM_SUCCESS)
- sia_message(collect, SIAWARNING, "Error initing kadmin connection",
- com_right(et_list, ret));
- else {
- des_cblock newkey;
- char *pw_msg; /* message from server */
-
- des_string_to_key(new_pw1, &newkey);
- ret = kadm_change_pw_plain((unsigned char*)&newkey, new_pw1, &pw_msg);
- memset(newkey, 0, sizeof(newkey));
-
- if (ret == KADM_INSECURE_PW)
- sia_message(collect, SIAWARNING, "Insecure password", pw_msg);
- else if (ret != KADM_SUCCESS)
- sia_message(collect, SIAWARNING, "Error changing password",
- com_right(et_list, ret));
- }
- memset(new_pw1, 0, sizeof(new_pw1));
-
- if (ret != KADM_SUCCESS)
- sia_message(collect, SIAWARNING, "", "Password NOT changed.");
- else
- sia_message(collect, SIAINFO, "", "Password changed.");
-
- dest_tkt();
- if(ret)
- return SIADFAIL;
- return SIADSUCCESS;
-}
-#endif
-
-int
-siad_chg_shell (sia_collect_func_t *collect,
- const char *username,
- int argc,
- char *argv[])
-{
- return SIADFAIL;
-}
-
-int
-siad_getpwent(struct passwd *result,
- char *buf,
- int bufsize,
- struct sia_context *context)
-{
- return SIADFAIL;
-}
-
-int
-siad_getpwuid (uid_t uid,
- struct passwd *result,
- char *buf,
- int bufsize,
- struct sia_context *context)
-{
- return SIADFAIL;
-}
-
-int
-siad_getpwnam (const char *name,
- struct passwd *result,
- char *buf,
- int bufsize,
- struct sia_context *context)
-{
- return SIADFAIL;
-}
-
-int
-siad_setpwent (struct sia_context *context)
-{
- return SIADFAIL;
-}
-
-int
-siad_endpwent (struct sia_context *context)
-{
- return SIADFAIL;
-}
-
-int
-siad_getgrent(struct group *result,
- char *buf,
- int bufsize,
- struct sia_context *context)
-{
- return SIADFAIL;
-}
-
-int
-siad_getgrgid (gid_t gid,
- struct group *result,
- char *buf,
- int bufsize,
- struct sia_context *context)
-{
- return SIADFAIL;
-}
-
-int
-siad_getgrnam (const char *name,
- struct group *result,
- char *buf,
- int bufsize,
- struct sia_context *context)
-{
- return SIADFAIL;
-}
-
-int
-siad_setgrent (struct sia_context *context)
-{
- return SIADFAIL;
-}
-
-int
-siad_endgrent (struct sia_context *context)
-{
- return SIADFAIL;
-}
-
-int
-siad_chk_user (const char *logname, int checkflag)
-{
- if(checkflag != CHGPASSWD)
- return SIADFAIL;
- return SIADSUCCESS;
-}
diff --git a/crypto/kerberosIV/lib/auth/sia/sia_locl.h b/crypto/kerberosIV/lib/auth/sia/sia_locl.h
deleted file mode 100644
index 0f3f74d98d3b1..0000000000000
--- a/crypto/kerberosIV/lib/auth/sia/sia_locl.h
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 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 KTH 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 KTH AND ITS 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 KTH OR ITS 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: sia_locl.h,v 1.2 1999/04/01 16:09:22 joda Exp $ */
-
-#ifndef __sia_locl_h__
-#define __sia_locl_h__
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <ctype.h>
-#include <stdio.h>
-#include <string.h>
-#include <siad.h>
-#include <pwd.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-#ifdef KRB5
-#define SIA_KRB5
-#elif defined(KRB4)
-#define SIA_KRB4
-#endif
-
-#ifdef SIA_KRB5
-#include <krb5.h>
-#include <com_err.h>
-#endif
-#ifdef SIA_KRB4
-#include <krb.h>
-#include <krb_err.h>
-#include <kadm.h>
-#include <kadm_err.h>
-#endif
-#ifdef KRB4
-#include <kafs.h>
-#endif
-
-#include <roken.h>
-
-#ifndef POSIX_GETPWNAM_R
-
-#define getpwnam_r posix_getpwnam_r
-#define getpwuid_r posix_getpwuid_r
-
-#endif /* POSIX_GETPWNAM_R */
-
-#ifndef DEBUG
-#define SIA_DEBUG(X)
-#else
-#define SIA_DEBUG(X) SIALOG X
-#endif
-
-struct state{
-#ifdef SIA_KRB5
- krb5_context context;
- krb5_auth_context auth_context;
-#endif
- char ticket[MaxPathLen];
- int valid;
-};
-
-#endif /* __sia_locl_h__ */
diff --git a/crypto/kerberosIV/lib/kadm/check_password.c b/crypto/kerberosIV/lib/kadm/check_password.c
deleted file mode 100644
index ba6ba4879a277..0000000000000
--- a/crypto/kerberosIV/lib/kadm/check_password.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 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 "kadm_locl.h"
-RCSID("$Id: check_password.c,v 1.3 1999/12/02 16:58:39 joda Exp $");
-
-/* This is a client side password check. Should perhaps be merged with
- kadmind version that lives in pw_check.c */
-
-int
-kadm_check_pw (const char *password)
-{
- const char *t;
- if (strlen(password) == 0)
- return KADM_PASS_Q_NULL;
- if (strlen(password) < MIN_KPW_LEN)
- return KADM_PASS_Q_TOOSHORT;
-
- /* Don't allow all lower case passwords regardless of length */
- for (t = password; *t && islower((unsigned char)*t); t++)
- ;
- if (*t == '\0')
- return KADM_PASS_Q_CLASS;
- return 0;
-}
diff --git a/crypto/kerberosIV/lib/kafs/ChangeLog b/crypto/kerberosIV/lib/kafs/ChangeLog
deleted file mode 100644
index c9cd032deb4b8..0000000000000
--- a/crypto/kerberosIV/lib/kafs/ChangeLog
+++ /dev/null
@@ -1,165 +0,0 @@
-1999-11-22 Assar Westerlund <assar@sics.se>
-
- * afskrb5.c (afslog_uid_int): handle d->realm == NULL
-
-1999-11-17 Assar Westerlund <assar@sics.se>
-
- * afskrb5.c (afslog_uid_int): don't look at the local realm at
- all. just use the realm from the ticket file.
-
-1999-10-20 Assar Westerlund <assar@sics.se>
-
- * Makefile.am: set version to 1:1:1
-
- * afskrb5.c (get_cred): always request a DES key
-
-Mon Oct 18 17:40:21 1999 Bjoern Groenvall <bg@mummel.sics.se>
-
- * common.c (find_cells): Trim trailing whitespace from
- cellname. Lines starting with # are regarded as comments.
-
-Fri Oct 8 18:17:22 1999 Bjoern Groenvall <bg@mummel.sics.se>
-
- * afskrb.c, common.c : Change code to make a clear distinction
- between hinted realm and ticket realm.
-
- * kafs_locl.h: Added argument realm_hint.
-
- * common.c (_kafs_get_cred): Change code to acquire the ``best''
- possible ticket. Use cross-cell authentication only as method of
- last resort.
-
- * afskrb.c (afslog_uid_int): Add realm_hint argument and extract
- realm from ticket file.
-
- * afskrb5.c (afslog_uid_int): Added argument realm_hint.
-
-1999-10-03 Assar Westerlund <assar@sics.se>
-
- * afskrb5.c (get_cred): update to new krb524_convert_creds_kdc
-
-1999-08-12 Johan Danielsson <joda@pdc.kth.se>
-
- * Makefile.am: ignore the comlicated aix construct if !krb4
-
-1999-07-26 Assar Westerlund <assar@sics.se>
-
- * Makefile.am: set version to 1:0:1
-
-1999-07-22 Assar Westerlund <assar@sics.se>
-
- * afssysdefs.h: define AFS_SYSCALL to 73 for Solaris 2.7
-
-1999-07-07 Assar Westerlund <assar@sics.se>
-
- * afskrb5.c (krb5_realm_of_cell): new function
-
- * afskrb.c (krb_realm_of_cell): new function
- (afslog_uid_int): call krb_get_lrealm correctly
-
-1999-06-15 Assar Westerlund <assar@sics.se>
-
- * common.c (realm_of_cell): rename to _kafs_realm_of_cell and
- un-staticize
-
-Fri Mar 19 14:52:29 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * Makefile.am: add version-info
-
-Thu Mar 18 11:24:02 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * Makefile.am: include Makefile.am.common
-
-Sat Feb 27 19:46:21 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * Makefile.am: remove EXTRA_DATA (as of autoconf 2.13/automake
- 1.4)
-
-Thu Feb 11 22:57:37 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * Makefile.am: set AIX_SRC also if !AIX
-
-Tue Dec 1 14:45:15 1998 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * Makefile.am: fix AIX linkage
-
-Sun Nov 22 10:40:44 1998 Assar Westerlund <assar@sics.se>
-
- * Makefile.in (WFLAGS): set
-
-Sat Nov 21 16:55:19 1998 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * afskrb5.c: add homedir support
-
-Sun Sep 6 20:16:27 1998 Assar Westerlund <assar@sics.se>
-
- * add new functionality for specifying the homedir to krb_afslog
- et al
-
-Thu Jul 16 01:27:19 1998 Assar Westerlund <assar@sics.se>
-
- * afssys.c: reorganize order of definitions.
- (try_one, try_two): conditionalize
-
-Thu Jul 9 18:31:52 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * common.c (realm_of_cell): make the dns fallback work
-
-Wed Jul 8 01:39:44 1998 Assar Westerlund <assar@sics.se>
-
- * afssys.c (map_syscall_name_to_number): new function for finding
- the number of a syscall given the name on solaris
- (k_hasafs): try using map_syscall_name_to_number
-
-Tue Jun 30 17:19:00 1998 Assar Westerlund <assar@sics.se>
-
- * afssys.c: rewrite and add support for environment variable
- AFS_SYSCALL
-
- * Makefile.in (distclean): don't remove roken_rename.h
-
-Fri May 29 19:03:20 1998 Assar Westerlund <assar@sics.se>
-
- * Makefile.in (roken_rename.h): remove dependency
-
-Mon May 25 05:25:54 1998 Assar Westerlund <assar@sics.se>
-
- * Makefile.in (clean): try to remove shared library debris
-
-Sun Apr 19 09:58:40 1998 Assar Westerlund <assar@sics.se>
-
- * Makefile.in: add symlink magic for linux
-
-Sat Apr 4 15:08:48 1998 Assar Westerlund <assar@sics.se>
-
- * kafs.h: add arla paths
-
- * common.c (_kafs_afslog_all_local_cells): Try _PATH_ARLA_*
- (_realm_of_cell): Try _PATH_ARLA_CELLSERVDB
-
-Thu Feb 19 14:50:22 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * common.c: Don't store expired tokens (this broke when using
- pag-less rsh-sessions, and `non-standard' ticket files).
-
-Thu Feb 12 11:20:15 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * Makefile.in: Install/uninstall one library at a time.
-
-Thu Feb 12 05:38:58 1998 Assar Westerlund <assar@sics.se>
-
- * Makefile.in (install): one library at a time.
-
-Mon Feb 9 23:40:32 1998 Assar Westerlund <assar@sics.se>
-
- * common.c (find_cells): ignore empty lines
-
-Tue Jan 6 04:25:58 1998 Assar Westerlund <assar@sics.se>
-
- * afssysdefs.h (AFS_SYSCALL): add FreeBSD
-
-Fri Jan 2 17:08:24 1998 Assar Westerlund <assar@sics.se>
-
- * kafs.h: new VICEIOCTL's. From <rb@stacken.kth.se>
-
- * afssysdefs.h: Add OpenBSD
diff --git a/crypto/kerberosIV/lib/kafs/Makefile.am b/crypto/kerberosIV/lib/kafs/Makefile.am
deleted file mode 100644
index 2333221958fad..0000000000000
--- a/crypto/kerberosIV/lib/kafs/Makefile.am
+++ /dev/null
@@ -1,70 +0,0 @@
-# $Id: Makefile.am,v 1.17 1999/10/19 23:54:05 assar Exp $
-
-include $(top_srcdir)/Makefile.am.common
-
-INCLUDES += $(INCLUDE_krb4) $(AFS_EXTRA_DEFS)
-
-if KRB4
-AFSLIBS = libkafs.la
-
-if AIX
-AFSL_EXP = $(srcdir)/afsl.exp
-
-if AIX4
-AFS_EXTRA_LD = -bnoentry
-else
-AFS_EXTRA_LD = -e _nostart
-endif
-
-if AIX_DYNAMIC_AFS
-if HAVE_DLOPEN
-AIX_SRC =
-else
-AIX_SRC = dlfcn.c
-endif
-AFS_EXTRA_LIBS = afslib.so
-AFS_EXTRA_DEFS =
-else
-AIX_SRC = afslib.c
-AFS_EXTRA_LIBS =
-AFS_EXTRA_DEFS = -DSTATIC_AFS
-endif
-
-else
-AFSL_EXP =
-AIX_SRC =
-endif # AIX
-
-else
-AFSLIBS =
-endif # KRB4
-
-
-lib_LTLIBRARIES = $(AFSLIBS)
-libkafs_la_LDFLAGS = -version-info 1:1:1
-foodir = $(libdir)
-foo_DATA = $(AFS_EXTRA_LIBS)
-# EXTRA_DATA = afslib.so
-
-CLEANFILES= $(AFS_EXTRA_LIBS)
-
-include_HEADERS = kafs.h
-
-if KRB5
-afskrb5_c = afskrb5.c
-endif
-
-libkafs_la_SOURCES = afssys.c afskrb.c $(afskrb5_c) common.c $(AIX_SRC) kafs_locl.h afssysdefs.h
-#afslib_so_SOURCES = afslib.c
-
-EXTRA_libkafs_la_SOURCES = afskrb5.c dlfcn.c afslib.c dlfcn.h
-
-EXTRA_DIST = README.dlfcn afsl.exp afslib.exp
-
-
-# AIX: this almost works with gcc, but somehow it fails to use the
-# correct ld, use ld instead
-afslib.so: afslib.o
- ld -o $@ -bM:SRE -bI:$(srcdir)/afsl.exp -bE:$(srcdir)/afslib.exp $(AFS_EXTRA_LD) afslib.o -lc
-
-$(OBJECTS): ../../include/config.h
diff --git a/crypto/kerberosIV/lib/kafs/README.dlfcn b/crypto/kerberosIV/lib/kafs/README.dlfcn
deleted file mode 100644
index cee1b751939e0..0000000000000
--- a/crypto/kerberosIV/lib/kafs/README.dlfcn
+++ /dev/null
@@ -1,246 +0,0 @@
-Copyright (c) 1992,1993,1995,1996, Jens-Uwe Mager, Helios Software GmbH
-Not derived from licensed software.
-
-Permission is granted to freely use, copy, modify, and redistribute
-this software, provided that the author is not construed to be liable
-for any results of using the software, alterations are clearly marked
-as such, and this notice is not modified.
-
-libdl.a
--------
-
-This is an emulation library to emulate the SunOS/System V.4 functions
-to access the runtime linker. The functions are emulated by using the
-AIX load() function and by reading the .loader section of the loaded
-module to find the exports. The to be loaded module should be linked as
-follows (if using AIX 3):
-
- cc -o module.so -bM:SRE -bE:module.exp -e _nostart $(OBJS)
-
-For AIX 4:
-
- cc -o module.so -bM:SRE -bE:module.exp -bnoentry $(OBJS)
-
-If you want to reference symbols from the main part of the program in a
-loaded module, you will have to link against the export file of the
-main part:
-
- cc -o main -bE:main.exp $(MAIN_OBJS)
- cc -o module.so -bM:SRE -bI:main.exp -bE:module.exp -bnoentry $(OBJS)
-
-Note that you explicitely have to specify what functions are supposed
-to be accessible from your loaded modules, this is different from
-SunOS/System V.4 where any global is automatically exported. If you
-want to export all globals, the following script might be of help:
-
-#!/bin/sh
-/usr/ucb/nm -g $* | awk '$2 == "B" || $2 == "D" { print $3 }'
-
-The module export file contains the symbols to be exported. Because
-this library uses the loader section, the final module.so file can be
-stripped. C++ users should build their shared objects using the script
-makeC++SharedLib (part of the IBM C++ compiler), this will make sure
-that constructors and destructors for static and global objects will be
-called upon loading and unloading the module. GNU C++ users should use
-the -shared option to g++ to link the shared object:
-
- g++ -o module.so -shared $(OBJS)
-
-If the shared object does have permissions for anybody, the shared
-object will be loaded into the shared library segment and it will stay
-there even if the main application terminates. If you rebuild your
-shared object after a bugfix and you want to make sure that you really
-get the newest version you will have to use the "slibclean" command
-before starting the application again to garbage collect the shared
-library segment. If the performance utilities (bosperf) are installed
-you can use the following command to see what shared objects are
-loaded:
-
-/usr/lpp/bosperf/genkld | sort | uniq
-
-For easier debugging you can avoid loading the shared object into the
-shared library segment alltogether by removing permissions for others
-from the module.so file:
-
-chmod o-rwx module.so
-
-This will ensure you get a fresh copy of the shared object for every
-dlopen() call which is loaded into the application's data segment.
-
-Usage
------
-
-void *dlopen(const char *path, int mode);
-
-This routine loads the module pointed to by path and reads its export
-table. If the path does not contain a '/' character, dlopen will search
-for the module using the LIBPATH environment variable. It returns an
-opaque handle to the module or NULL on error. The mode parameter can be
-either RTLD_LAZY (for lazy function binding) or RTLD_NOW for immediate
-function binding. The AIX implementation currently does treat RTLD_NOW
-the same as RTLD_LAZY. The flag RTLD_GLOBAL might be or'ed into the
-mode parameter to allow loaded modules to bind to global variables or
-functions in other loaded modules loaded by dlopen(). If RTLD_GLOBAL is
-not specified, only globals from the main part of the executable or
-shared libraries are used to look for undefined symbols in loaded
-modules.
-
-
-void *dlsym(void *handle, const char *symbol);
-
-This routine searches for the symbol in the module referred to by
-handle and returns its address. If the symbol could not be found, the
-function returns NULL. The return value must be casted to a proper
-function pointer before it can be used. SunOS/System V.4 allows handle
-to be a NULL pointer to refer to the module the call is made from, this
-is not implemented.
-
-int dlclose(void *handle);
-
-This routine unloads the module referred to by the handle and disposes
-of any local storage. this function returns -1 on failure. Any function
-pointers obtained through dlsym() should be considered invalid after
-closing a module.
-
-As AIX caches shared objects in the shared library segment, function
-pointers obtained through dlsym() might still work even though the
-module has been unloaded. This can introduce subtle bugs that will
-segment fault later if AIX garbage collects or immediatly on
-SunOS/System V.4 as the text segment is unmapped.
-
-char *dlerror(void);
-
-This routine can be used to retrieve a text message describing the most
-recent error that occured on on of the above routines. This function
-returns NULL if there is no error information.
-
-Initialization and termination handlers
----------------------------------------
-
-The emulation provides for an initialization and a termination
-handler. The dlfcn.h file contains a structure declaration named
-dl_info with following members:
-
- void (*init)(void);
- void (*fini)(void);
-
-The init function is called upon first referencing the library. The
-fini function is called at dlclose() time or when the process exits.
-The module should declare a variable named dl_info that contains this
-structure which must be exported. These functions correspond to the
-documented _init() and _fini() functions of SunOS 4.x, but these are
-appearently not implemented in SunOS. When using SunOS 5.0, these
-correspond to #pragma init and #pragma fini respectively. At the same
-time any static or global C++ object's constructors or destructors will
-be called.
-
-BUGS
-----
-
-Please note that there is currently a problem with implicitely loaded
-shared C++ libaries: if you refer to a shared C++ library from a loaded
-module that is not yet used by the main program, the dlopen() emulator
-does not notice this and does not call the static constructors for the
-implicitely loaded library. This can be easily demonstrated by
-referencing the C++ standard streams from a loaded module if the main
-program is a plain C program.
-
-Jens-Uwe Mager
-
-HELIOS Software GmbH
-Lavesstr. 80
-30159 Hannover
-Germany
-
-Phone: +49 511 36482-0
-FAX: +49 511 36482-69
-AppleLink: helios.de/jum
-Internet: jum@helios.de
-
-Revison History
----------------
-
-SCCS/s.dlfcn.h:
-
-D 1.4 95/04/25 09:36:52 jum 4 3 00018/00004/00028
-MRs:
-COMMENTS:
-added RTLD_GLOBAL, include and C++ guards
-
-D 1.3 92/12/27 20:58:32 jum 3 2 00001/00001/00031
-MRs:
-COMMENTS:
-we always have prototypes on RS/6000
-
-D 1.2 92/08/16 17:45:11 jum 2 1 00009/00000/00023
-MRs:
-COMMENTS:
-added dl_info structure to implement initialize and terminate functions
-
-D 1.1 92/08/02 18:08:45 jum 1 0 00023/00000/00000
-MRs:
-COMMENTS:
-Erstellungsdatum und -uhrzeit 92/08/02 18:08:45 von jum
-
-SCCS/s.dlfcn.c:
-
-D 1.11 96/04/10 20:12:51 jum 13 12 00037/00000/00533
-MRs:
-COMMENTS:
-Integrated the changes from John W. Eaton <jwe@bevo.che.wisc.edu> to initialize
-g++ generated shared objects.
-
-D 1.10 96/02/15 17:42:44 jum 12 10 00012/00007/00521
-MRs:
-COMMENTS:
-the C++ constructor and destructor chains are now called properly for either
-xlC 2 or xlC 3 (CSet++).
-
-D 1.9 95/09/22 11:09:38 markus 10 9 00001/00008/00527
-MRs:
-COMMENTS:
-Fix version number
-
-D 1.8 95/09/22 10:14:34 markus 9 8 00008/00001/00527
-MRs:
-COMMENTS:
-Added version number for dl lib
-
-D 1.7 95/08/14 19:08:38 jum 8 6 00026/00004/00502
-MRs:
-COMMENTS:
-Integrated the fixes from Kirk Benell (kirk@rsinc.com) to allow loading of
-shared objects generated under AIX 4. Fixed bug that symbols with exactly
-8 characters would use garbage characters from the following symbol value.
-
-D 1.6 95/04/25 09:38:03 jum 6 5 00046/00006/00460
-MRs:
-COMMENTS:
-added handling of C++ static constructors and destructors, added RTLD_GLOBAL to bind against other loaded modules
-
-D 1.5 93/02/14 20:14:17 jum 5 4 00002/00000/00464
-MRs:
-COMMENTS:
-added path to dlopen error message to make clear where there error occured.
-
-D 1.4 93/01/03 19:13:56 jum 4 3 00061/00005/00403
-MRs:
-COMMENTS:
-to allow calling symbols in the main module call load with L_NOAUTODEFER and
-do a loadbind later with the main module.
-
-D 1.3 92/12/27 20:59:55 jum 3 2 00066/00008/00342
-MRs:
-COMMENTS:
-added search by L_GETINFO if module got loaded by LIBPATH
-
-D 1.2 92/08/16 17:45:43 jum 2 1 00074/00006/00276
-MRs:
-COMMENTS:
-implemented initialize and terminate functions, added reference counting to avoid multiple loads of the same library
-
-D 1.1 92/08/02 18:08:45 jum 1 0 00282/00000/00000
-MRs:
-COMMENTS:
-Erstellungsdatum und -uhrzeit 92/08/02 18:08:45 von jum
-
diff --git a/crypto/kerberosIV/lib/kafs/afskrb5.c b/crypto/kerberosIV/lib/kafs/afskrb5.c
deleted file mode 100644
index 4c35ea7382f29..0000000000000
--- a/crypto/kerberosIV/lib/kafs/afskrb5.c
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 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 "kafs_locl.h"
-
-RCSID("$Id: afskrb5.c,v 1.13 1999/12/02 16:58:39 joda Exp $");
-
-struct krb5_kafs_data {
- krb5_context context;
- krb5_ccache id;
- krb5_const_realm realm;
-};
-
-static int
-get_cred(kafs_data *data, const char *name, const char *inst,
- const char *realm, CREDENTIALS *c)
-{
- krb5_error_code ret;
- krb5_creds in_creds, *out_creds;
- struct krb5_kafs_data *d = data->data;
-
- memset(&in_creds, 0, sizeof(in_creds));
- ret = krb5_425_conv_principal(d->context, name, inst, realm,
- &in_creds.server);
- if(ret)
- return ret;
- ret = krb5_cc_get_principal(d->context, d->id, &in_creds.client);
- if(ret){
- krb5_free_principal(d->context, in_creds.server);
- return ret;
- }
- in_creds.session.keytype = KEYTYPE_DES;
- ret = krb5_get_credentials(d->context, 0, d->id, &in_creds, &out_creds);
- krb5_free_principal(d->context, in_creds.server);
- krb5_free_principal(d->context, in_creds.client);
- if(ret)
- return ret;
- ret = krb524_convert_creds_kdc(d->context, d->id, out_creds, c);
- krb5_free_creds(d->context, out_creds);
- return ret;
-}
-
-static krb5_error_code
-afslog_uid_int(kafs_data *data, const char *cell, const char *rh, uid_t uid,
- const char *homedir)
-{
- krb5_error_code ret;
- CREDENTIALS c;
- krb5_principal princ;
- krb5_realm *trealm; /* ticket realm */
- struct krb5_kafs_data *d = data->data;
-
- if (cell == 0 || cell[0] == 0)
- return _kafs_afslog_all_local_cells (data, uid, homedir);
-
- ret = krb5_cc_get_principal (d->context, d->id, &princ);
- if (ret)
- return ret;
-
- trealm = krb5_princ_realm (d->context, princ);
-
- if (d->realm != NULL && strcmp (d->realm, *trealm) == 0) {
- trealm = NULL;
- krb5_free_principal (d->context, princ);
- }
-
- ret = _kafs_get_cred(data, cell, d->realm, *trealm, &c);
- if(trealm)
- krb5_free_principal (d->context, princ);
-
- if(ret == 0)
- ret = kafs_settoken(cell, uid, &c);
- return ret;
-}
-
-static char *
-get_realm(kafs_data *data, const char *host)
-{
- struct krb5_kafs_data *d = data->data;
- krb5_realm *realms;
- char *r;
- if(krb5_get_host_realm(d->context, host, &realms))
- return NULL;
- r = strdup(realms[0]);
- krb5_free_host_realm(d->context, realms);
- return r;
-}
-
-krb5_error_code
-krb5_afslog_uid_home(krb5_context context,
- krb5_ccache id,
- const char *cell,
- krb5_const_realm realm,
- uid_t uid,
- const char *homedir)
-{
- kafs_data kd;
- struct krb5_kafs_data d;
- kd.afslog_uid = afslog_uid_int;
- kd.get_cred = get_cred;
- kd.get_realm = get_realm;
- kd.data = &d;
- d.context = context;
- d.id = id;
- d.realm = realm;
- return afslog_uid_int(&kd, cell, 0, uid, homedir);
-}
-
-krb5_error_code
-krb5_afslog_uid(krb5_context context,
- krb5_ccache id,
- const char *cell,
- krb5_const_realm realm,
- uid_t uid)
-{
- return krb5_afslog_uid_home (context, id, cell, realm, uid, NULL);
-}
-
-krb5_error_code
-krb5_afslog(krb5_context context,
- krb5_ccache id,
- const char *cell,
- krb5_const_realm realm)
-{
- return krb5_afslog_uid (context, id, cell, realm, getuid());
-}
-
-krb5_error_code
-krb5_afslog_home(krb5_context context,
- krb5_ccache id,
- const char *cell,
- krb5_const_realm realm,
- const char *homedir)
-{
- return krb5_afslog_uid_home (context, id, cell, realm, getuid(), homedir);
-}
-
-/*
- *
- */
-
-krb5_error_code
-krb5_realm_of_cell(const char *cell, char **realm)
-{
- kafs_data kd;
-
- kd.get_realm = get_realm;
- return _kafs_realm_of_cell(&kd, cell, realm);
-}
diff --git a/crypto/kerberosIV/lib/kafs/common.c b/crypto/kerberosIV/lib/kafs/common.c
deleted file mode 100644
index 207b9b643de79..0000000000000
--- a/crypto/kerberosIV/lib/kafs/common.c
+++ /dev/null
@@ -1,396 +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 "kafs_locl.h"
-
-RCSID("$Id: common.c,v 1.19 1999/12/02 16:58:40 joda Exp $");
-
-#define AUTH_SUPERUSER "afs"
-
-/*
- * Here only ASCII characters are relevant.
- */
-
-#define IsAsciiLower(c) ('a' <= (c) && (c) <= 'z')
-
-#define ToAsciiUpper(c) ((c) - 'a' + 'A')
-
-static void
-foldup(char *a, const char *b)
-{
- for (; *b; a++, b++)
- if (IsAsciiLower(*b))
- *a = ToAsciiUpper(*b);
- else
- *a = *b;
- *a = '\0';
-}
-
-int
-kafs_settoken(const char *cell, uid_t uid, CREDENTIALS *c)
-{
- struct ViceIoctl parms;
- struct ClearToken ct;
- int32_t sizeof_x;
- char buf[2048], *t;
- int ret;
-
- /*
- * Build a struct ClearToken
- */
- ct.AuthHandle = c->kvno;
- memcpy (ct.HandShakeKey, c->session, sizeof(c->session));
- ct.ViceId = uid;
- ct.BeginTimestamp = c->issue_date;
- ct.EndTimestamp = krb_life_to_time(c->issue_date, c->lifetime);
- if(ct.EndTimestamp < time(NULL))
- return 0; /* don't store tokens that has expired (and possibly
- overwriting valid tokens)*/
-
-#define ODD(x) ((x) & 1)
- /* According to Transarc conventions ViceId is valid iff
- * (EndTimestamp - BeginTimestamp) is odd. By decrementing EndTime
- * the transformations:
- *
- * (issue_date, life) -> (StartTime, EndTime) -> (issue_date, life)
- * preserves the original values.
- */
- if (uid != 0) /* valid ViceId */
- {
- if (!ODD(ct.EndTimestamp - ct.BeginTimestamp))
- ct.EndTimestamp--;
- }
- else /* not valid ViceId */
- {
- if (ODD(ct.EndTimestamp - ct.BeginTimestamp))
- ct.EndTimestamp--;
- }
-
- t = buf;
- /*
- * length of secret token followed by secret token
- */
- sizeof_x = c->ticket_st.length;
- memcpy(t, &sizeof_x, sizeof(sizeof_x));
- t += sizeof(sizeof_x);
- memcpy(t, c->ticket_st.dat, sizeof_x);
- t += sizeof_x;
- /*
- * length of clear token followed by clear token
- */
- sizeof_x = sizeof(ct);
- memcpy(t, &sizeof_x, sizeof(sizeof_x));
- t += sizeof(sizeof_x);
- memcpy(t, &ct, sizeof_x);
- t += sizeof_x;
-
- /*
- * do *not* mark as primary cell
- */
- sizeof_x = 0;
- memcpy(t, &sizeof_x, sizeof(sizeof_x));
- t += sizeof(sizeof_x);
- /*
- * follow with cell name
- */
- sizeof_x = strlen(cell) + 1;
- memcpy(t, cell, sizeof_x);
- t += sizeof_x;
-
- /*
- * Build argument block
- */
- parms.in = buf;
- parms.in_size = t - buf;
- parms.out = 0;
- parms.out_size = 0;
- ret = k_pioctl(0, VIOCSETTOK, &parms, 0);
- return ret;
-}
-
-/* Try to get a db-server for an AFS cell from a AFSDB record */
-
-static int
-dns_find_cell(const char *cell, char *dbserver, size_t len)
-{
- struct dns_reply *r;
- int ok = -1;
- r = dns_lookup(cell, "afsdb");
- if(r){
- struct resource_record *rr = r->head;
- while(rr){
- if(rr->type == T_AFSDB && rr->u.afsdb->preference == 1){
- strlcpy(dbserver,
- rr->u.afsdb->domain,
- len);
- ok = 0;
- break;
- }
- rr = rr->next;
- }
- dns_free_data(r);
- }
- return ok;
-}
-
-
-/*
- * Try to find the cells we should try to klog to in "file".
- */
-static void
-find_cells(char *file, char ***cells, int *index)
-{
- FILE *f;
- char cell[64];
- int i;
- int ind = *index;
-
- f = fopen(file, "r");
- if (f == NULL)
- return;
- while (fgets(cell, sizeof(cell), f)) {
- char *t;
- t = cell + strlen(cell);
- for (; t >= cell; t--)
- if (*t == '\n' || *t == '\t' || *t == ' ')
- *t = 0;
- if (cell[0] == '\0' || cell[0] == '#')
- continue;
- for(i = 0; i < ind; i++)
- if(strcmp((*cells)[i], cell) == 0)
- break;
- if(i == ind){
- char **tmp;
-
- tmp = realloc(*cells, (ind + 1) * sizeof(**cells));
- if (tmp == NULL)
- break;
- *cells = tmp;
- (*cells)[ind] = strdup(cell);
- if ((*cells)[ind] == NULL)
- break;
- ++ind;
- }
- }
- fclose(f);
- *index = ind;
-}
-
-/*
- * Get tokens for all cells[]
- */
-static int
-afslog_cells(kafs_data *data, char **cells, int max, uid_t uid,
- const char *homedir)
-{
- int ret = 0;
- int i;
- for (i = 0; i < max; i++) {
- int er = (*data->afslog_uid)(data, cells[i], 0, uid, homedir);
- if (er)
- ret = er;
- }
- return ret;
-}
-
-int
-_kafs_afslog_all_local_cells(kafs_data *data, uid_t uid, const char *homedir)
-{
- int ret;
- char **cells = NULL;
- int index = 0;
-
- if (homedir == NULL)
- homedir = getenv("HOME");
- if (homedir != NULL) {
- char home[MaxPathLen];
- snprintf(home, sizeof(home), "%s/.TheseCells", homedir);
- find_cells(home, &cells, &index);
- }
- find_cells(_PATH_THESECELLS, &cells, &index);
- find_cells(_PATH_THISCELL, &cells, &index);
- find_cells(_PATH_ARLA_THESECELLS, &cells, &index);
- find_cells(_PATH_ARLA_THISCELL, &cells, &index);
-
- ret = afslog_cells(data, cells, index, uid, homedir);
- while(index > 0)
- free(cells[--index]);
- free(cells);
- return ret;
-}
-
-
-/* Find the realm associated with cell. Do this by opening
- /usr/vice/etc/CellServDB and getting the realm-of-host for the
- first VL-server for the cell.
-
- This does not work when the VL-server is living in one realm, but
- the cell it is serving is living in another realm.
-
- Return 0 on success, -1 otherwise.
- */
-
-int
-_kafs_realm_of_cell(kafs_data *data, const char *cell, char **realm)
-{
- FILE *F;
- char buf[1024];
- char *p;
- int ret = -1;
-
- if ((F = fopen(_PATH_CELLSERVDB, "r"))
- || (F = fopen(_PATH_ARLA_CELLSERVDB, "r"))) {
- while (fgets(buf, sizeof(buf), F)) {
- if (buf[0] != '>')
- continue; /* Not a cell name line, try next line */
- if (strncmp(buf + 1, cell, strlen(cell)) == 0) {
- /*
- * We found the cell name we're looking for.
- * Read next line on the form ip-address '#' hostname
- */
- if (fgets(buf, sizeof(buf), F) == NULL)
- break; /* Read failed, give up */
- p = strchr(buf, '#');
- if (p == NULL)
- break; /* No '#', give up */
- p++;
- if (buf[strlen(buf) - 1] == '\n')
- buf[strlen(buf) - 1] = '\0';
- *realm = (*data->get_realm)(data, p);
- if (*realm && **realm != '\0')
- ret = 0;
- break; /* Won't try any more */
- }
- }
- fclose(F);
- }
- if (*realm == NULL && dns_find_cell(cell, buf, sizeof(buf)) == 0) {
- *realm = strdup(krb_realmofhost(buf));
- if(*realm != NULL)
- ret = 0;
- }
- return ret;
-}
-
-int
-_kafs_get_cred(kafs_data *data,
- const char *cell,
- const char *realm_hint,
- const char *realm,
- CREDENTIALS *c)
-{
- int ret = -1;
- char *vl_realm;
- char CELL[64];
-
- /* We're about to find the the realm that holds the key for afs in
- * the specified cell. The problem is that null-instance
- * afs-principals are common and that hitting the wrong realm might
- * yield the wrong afs key. The following assumptions were made.
- *
- * Any realm passed to us is preferred.
- *
- * If there is a realm with the same name as the cell, it is most
- * likely the correct realm to talk to.
- *
- * In most (maybe even all) cases the database servers of the cell
- * will live in the realm we are looking for.
- *
- * Try the local realm, but if the previous cases fail, this is
- * really a long shot.
- *
- */
-
- /* comments on the ordering of these tests */
-
- /* If the user passes a realm, she probably knows something we don't
- * know and we should try afs@realm_hint (otherwise we're talking with a
- * blondino and she might as well have it.)
- */
-
- if (realm_hint) {
- ret = (*data->get_cred)(data, AUTH_SUPERUSER, cell, realm_hint, c);
- if (ret == 0) return 0;
- ret = (*data->get_cred)(data, AUTH_SUPERUSER, "", realm_hint, c);
- if (ret == 0) return 0;
- }
-
- foldup(CELL, cell);
-
- /*
- * If cell == realm we don't need no cross-cell authentication.
- * Try afs@REALM.
- */
- if (strcmp(CELL, realm) == 0) {
- ret = (*data->get_cred)(data, AUTH_SUPERUSER, "", realm, c);
- if (ret == 0) return 0;
- /* Try afs.cell@REALM below. */
- }
-
- /*
- * If the AFS servers have a file /usr/afs/etc/krb.conf containing
- * REALM we still don't have to resort to cross-cell authentication.
- * Try afs.cell@REALM.
- */
- ret = (*data->get_cred)(data, AUTH_SUPERUSER, cell, realm, c);
- if (ret == 0) return 0;
-
- /*
- * We failed to get ``first class tickets'' for afs,
- * fall back to cross-cell authentication.
- * Try afs@CELL.
- * Try afs.cell@CELL.
- */
- ret = (*data->get_cred)(data, AUTH_SUPERUSER, "", CELL, c);
- if (ret == 0) return 0;
- ret = (*data->get_cred)(data, AUTH_SUPERUSER, cell, CELL, c);
- if (ret == 0) return 0;
-
- /*
- * Perhaps the cell doesn't correspond to any realm?
- * Use realm of first volume location DB server.
- * Try afs.cell@VL_REALM.
- * Try afs@VL_REALM???
- */
- if (_kafs_realm_of_cell(data, cell, &vl_realm) == 0
- && strcmp(vl_realm, realm) != 0
- && strcmp(vl_realm, CELL) != 0) {
- ret = (*data->get_cred)(data, AUTH_SUPERUSER, cell, vl_realm, c);
- if (ret)
- ret = (*data->get_cred)(data, AUTH_SUPERUSER, "", vl_realm, c);
- free(vl_realm);
- if (ret == 0) return 0;
- }
-
- return ret;
-}
diff --git a/crypto/kerberosIV/lib/kclient/KClient.c b/crypto/kerberosIV/lib/kclient/KClient.c
deleted file mode 100644
index 6d4ed60ca182f..0000000000000
--- a/crypto/kerberosIV/lib/kclient/KClient.c
+++ /dev/null
@@ -1,440 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998 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.
- */
-
-/* KClient.c - KClient glue to krb4.dll
- * Author: Jörgen Karlsson - d93-jka@nada.kth.se
- * Date: June 1996
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: KClient.c,v 1.14 1999/12/02 16:58:40 joda Exp $");
-#endif
-
-#ifdef WIN32 /* Visual C++ 4.0 (Windows95/NT) */
-#include <Windows.h>
-#endif /* WIN32 */
-
-//#include <string.h>
-#include <winsock.h>
-#include "passwd_dlg.h"
-#include "KClient.h"
-#include "krb.h"
-
-char guser[64];
-
-void
-msg(char *text)
-{
- HWND wnd = GetActiveWindow();
- MessageBox(wnd, text, "KClient message", MB_OK|MB_APPLMODAL);
-}
-
-BOOL
-SendTicketForService(LPSTR service, LPSTR version, int fd)
-{
- KTEXT_ST ticket;
- MSG_DAT mdat;
- CREDENTIALS cred;
- des_key_schedule schedule;
- char name[SNAME_SZ], inst[INST_SZ], realm[REALM_SZ];
- int ret;
- static KClientSessionInfo foo;
- KClientKey key;
-
- kname_parse(name, inst, realm, service);
- strlcpy(foo.realm, realm, sizeof(foo.realm));
-
- if(KClientStatus(&foo) == KClientNotLoggedIn)
- KClientLogin(&foo, &key);
-
- ret = krb_sendauth (0, fd, &ticket,
- name, inst, realm, 17, &mdat,
- &cred, &schedule, NULL, NULL, version);
- if(ret)
- return FALSE;
- return TRUE;
-}
-
-BOOL WINAPI
-DllMain(HANDLE hInst, ULONG reason, LPVOID lpReserved)
-{
- WORD wVersionRequested;
- WSADATA wsaData;
- int err;
-
- switch(reason){
- case DLL_PROCESS_ATTACH:
- wVersionRequested = MAKEWORD(1, 1);
-
- err = WSAStartup(wVersionRequested, &wsaData);
-
- if (err != 0)
- {
- /* Tell the user that we couldn't find a useable */
- /* winsock.dll. */
- msg("Cannot find winsock.dll");
- return FALSE;
- }
- break;
- case DLL_PROCESS_DETACH:
- WSACleanup();
- }
-
- return TRUE;
-}
-
-Kerr
-KClientMessage(char *text, Kerr error)
-{
- msg(text);
- return error;
-}
-
-/* KClientInitSession
- * You need to call this routine before calling most other routines.
- * It initializes a KClientSessionInfo structure.
- * The local and remote addresses are for use in KClientEncrypt,
- * KClientDecrypt, KClientMakeSendAuth and KClientVerifySendAuth.
- * If you don't use any of these routines it's perfectly OK to do the following...
- * err = KClientInitSession(session,0,0,0,0);
- */
-Kerr
-KClientInitSession(KClientSessionInfo *session,
- unsigned long lAddr,
- unsigned short lPort,
- unsigned long fAddr,
- unsigned short fPort)
-{
- session->lAddr = lAddr;
- session->lPort = lPort;
- session->fAddr = fAddr;
- session->fPort = fPort;
- if(tf_get_pname(session->user) != KSUCCESS)
- *(session->user) = '\0';
- if(tf_get_pinst(session->inst) != KSUCCESS)
- *(session->inst) = '\0';
- krb_get_lrealm (session->realm, 1);
- if(*(session->user))
- strlcpy(guser, session->user, sizeof(guser));
- else
- *guser ='\0';
-
- return 0;
-}
-
-
-/* KClientGetTicketForService
- * This routine gets an authenticator to be passed to a service.
- * If the user isn't already logged in the user is prompted for a password.
- */
-Kerr
-KClientGetTicketForService(KClientSessionInfo *session,
- char *service,
- void *buf,
- unsigned long *buflen)
-{
- CREDENTIALS c;
- KClientKey k;
- KTEXT_ST ticket;
- char serv[255], inst[255], realm[255];
- Kerr err;
-
- // KClientSetUserName(session->user);
- err = kname_parse(serv,inst,realm,service);
- if(*realm)
- strlcpy(session->realm, realm, sizeof(session->realm));
- else
- strlcpy(realm, session->realm, sizeof(realm));
- if(KClientStatus(session) == KClientNotLoggedIn)
- if((err = KClientLogin(session, &k)) != KSUCCESS)
- return err;
-
- if((err = krb_mk_req(&ticket, serv, inst, realm, 0)) != KSUCCESS)
- return KClientMessage(KClientErrorText(err,0),err);
- if((err = krb_get_cred(serv, inst, realm, &c)) != KSUCCESS)
- return KClientMessage(KClientErrorText(err,0),err);
-
- if(*buflen >= ticket.length)
- {
- *buflen = ticket.length + sizeof(unsigned long);
- CopyMemory(buf, &ticket, *buflen);
- CopyMemory(session->key, c.session, sizeof(session->key));
- }
- else
- err = -1;
- return err;
-}
-
-
-/* KClientLogin
- * This routine "logs in" by getting a ticket granting ticket from kerberos.
- * It returns the user's private key which can be used to automate login at
- * a later time with KClientKeyLogin.
- */
-
-Kerr
-KClientLogin(KClientSessionInfo *session,
- KClientKey *privateKey)
-{
- CREDENTIALS c;
- Kerr err;
- char passwd[100];
-
- if((err = pwd_dialog(guser, passwd)))
- return err;
- if(KClientStatus(session) == KClientNotLoggedIn)
- {
-
- if((err = krb_get_pw_in_tkt(guser, session->inst, session->realm,
- "krbtgt", session->realm,
- DEFAULT_TKT_LIFE, passwd)) != KSUCCESS)
- return KClientMessage(KClientErrorText(err,0),err);
- }
- if((err = krb_get_cred("krbtgt", session->realm,
- session->realm, &c)) == KSUCCESS)
- CopyMemory(privateKey, c.session, sizeof(*privateKey));
- return err;
-}
-
-
-/* KClientPasswordLogin
- * This routine is similiar to KClientLogin but instead of prompting the user
- * for a password it uses the password supplied to establish login.
- */
-Kerr
-KClientPasswordLogin(KClientSessionInfo *session,
- char *password,
- KClientKey *privateKey)
-{
- return krb_get_pw_in_tkt(guser, session->inst, session->realm,
- "krbtgt",
- session->realm,
- DEFAULT_TKT_LIFE,
- password);
-}
-
-
-static key_proc_t
-key_proc(void *arg)
-{
- return arg;
-}
-
-/* KClientKeyLogin
- * This routine is similiar to KClientLogin but instead of prompting the user
- * for a password it uses the private key supplied to establish login.
- */
-Kerr
-KClientKeyLogin(KClientSessionInfo *session,
- KClientKey *privateKey)
-{
- return krb_get_in_tkt(guser, session->inst, session->realm,
- "krbtgt",
- session->realm,
- DEFAULT_TKT_LIFE,
- key_proc,
- 0,
- privateKey);
-}
-
-/* KClientLogout
- * This routine destroys all credentials stored in the credential cache
- * effectively logging the user out.
- */
-Kerr
-KClientLogout(void)
-{
- return 0;
-}
-
-
-/* KClientStatus
- * This routine returns the user's login status which can be
- * KClientLoggedIn or KClientNotLoggedIn.
- */
-short
-KClientStatus(KClientSessionInfo *session)
-{
- CREDENTIALS c;
- if(krb_get_cred("krbtgt",
- session->realm,
- session->realm, &c) == KSUCCESS)
- return KClientLoggedIn;
- else
- return KClientNotLoggedIn;
-}
-
-
-/* KClientGetUserName
- * This routine returns the name the user supplied in the login dialog.
- * No name is returned if the user is not logged in.
- */
-Kerr
-KClientGetUserName(char *user)
-{
- strcpy(user, guser);
- return 0;
-}
-
-
-/* KClientSetUserName
- * This routine sets the name that will come up in the login dialog
- * the next time the user is prompted for a password.
- */
-Kerr
-KClientSetUserName(char *user)
-{
- strlcpy(guser, user, sizeof(guser));
- return 0;
-}
-
-
-/* KClientCacheInitialTicket
- * This routine is used to obtain a ticket for the password changing service.
- */
-Kerr
-KClientCacheInitialTicket(KClientSessionInfo *session,
- char *service)
-{
- return 0;
-}
-
-
-/* KClientGetSessionKey
- * This routine can be used to obtain the session key which is stored
- * in the KClientSessionInfo record. The session key has no usefullness
- * with any KClient calls but it can be used to with the MIT kerberos API.
- */
-Kerr
-KClientGetSessionKey(KClientSessionInfo *session,
- KClientKey *sessionKey)
-{
- CopyMemory(sessionKey, session->key, sizeof(*sessionKey));
- return 0;
-}
-
-
-/* KClientMakeSendAuth
- * This routine is used to create an authenticator that is the same as those
- * created by the kerberos routine SendAuth.
- */
-Kerr
-KClientMakeSendAuth(KClientSessionInfo *session,
- char *service,
- void *buf,
- unsigned long *buflen,
- long checksum,
- char *applicationVersion)
-{
- return 0;
-}
-
-
-/* KClientVerifySendAuth
- * This routine is used to verify a response made by a server doing RecvAuth.
- * The two routines KClientMakeSendAuth and KClientVerifySendAuth together
- * provide the functionality of SendAuth minus the transmission of authenticators
- * between client->server->client.
- */
-Kerr
-KClientVerifySendAuth(KClientSessionInfo *session,
- void *buf,
- unsigned long *buflen)
-{
- return 0;
-}
-
-
-/* KClientEncrypt
- * This routine encrypts a series a bytes for transmission to the remote host.
- * For this to work properly you must be logged in and you must have specified
- * the remote and local addresses in KClientInitSession. The unencrypted
- * message pointed to by buf and of length buflen is returned encrypted
- * in encryptBuf of length encryptLength.
- * The encrypted buffer must be at least 26 bytes longer the buf.
- */
-Kerr
-KClientEncrypt(KClientSessionInfo *session,
- void *buf,
- unsigned long buflen,
- void *encryptBuf,
- unsigned long *encryptLength)
-{
- int num = 64;
- des_cfb64_encrypt(buf, encryptBuf, buflen,
- (struct des_ks_struct*) session->key,
- 0, &num, 1);
- return 0;
-}
-
-
-/* KClientDecrypt
- * This routine decrypts a series of bytes received from the remote host.
-
- * NOTE: this routine will not reverse a KClientEncrypt call.
- * It can only decrypt messages sent from the remote host.
-
- * Instead of copying the decrypted message to an out buffer,
- * the message is decrypted in place and you are returned
- * an offset into the buffer where the decrypted message begins.
- */
-Kerr
-KClientDecrypt(KClientSessionInfo *session,
- void *buf,
- unsigned long buflen,
- unsigned long *decryptOffset,
- unsigned long *decryptLength)
-{
- int num;
- des_cfb64_encrypt(buf, buf, buflen,
- (struct des_ks_struct*)session->key, 0, &num, 0);
- *decryptOffset = 0;
- *decryptLength = buflen;
- return 0;
-}
-
-
-/* KClientErrorText
- * This routine returns a text description of errors returned by any of
- * the calls in this library.
- */
-char *
-KClientErrorText(Kerr err,
- char *text)
-{
- char *t = krb_get_err_text(err);
- if(text)
- strcpy(text, t);
- return t;
-}
diff --git a/crypto/kerberosIV/lib/kclient/KClient.def b/crypto/kerberosIV/lib/kclient/KClient.def
deleted file mode 100644
index 9b55b2c21332b..0000000000000
--- a/crypto/kerberosIV/lib/kclient/KClient.def
+++ /dev/null
@@ -1,19 +0,0 @@
-LIBRARY kclnt32
-EXPORTS
- KClientInitSession
- KClientGetTicketForService
- KClientLogin
- KClientPasswordLogin
- KClientKeyLogin
- KClientLogout
- KClientStatus
- KClientGetUserName
- KClientSetUserName
- KClientCacheInitialTicket
- KClientGetSessionKey
- KClientMakeSendAuth
- KClientVerifySendAuth
- KClientEncrypt
- KClientDecrypt
- KClientErrorText
- SendTicketForService
diff --git a/crypto/kerberosIV/lib/kclient/KClient.dsp b/crypto/kerberosIV/lib/kclient/KClient.dsp
deleted file mode 100644
index de4dde2af9f77..0000000000000
--- a/crypto/kerberosIV/lib/kclient/KClient.dsp
+++ /dev/null
@@ -1,127 +0,0 @@
-# Microsoft Developer Studio Project File - Name="kclient" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 5.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=kclient - Win32 Release
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "KClient.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "KClient.mak" CFG="kclient - Win32 Release"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "kclient - Win32 Release" (based on\
- "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "kclient - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "kclient - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir ".\Release"
-# PROP BASE Intermediate_Dir ".\Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ".\Release"
-# PROP Intermediate_Dir ".\Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "..\krb" /I "..\..\include" /I "..\..\include\win32" /I "..\des" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_CONFIG_H" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
-# ADD LINK32 ..\krb\Release\krb.lib ..\des\Release\des.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1320000" /subsystem:windows /dll /machine:I386 /out:".\Release/kclnt32.dll"
-
-!ELSEIF "$(CFG)" == "kclient - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir ".\Debug"
-# PROP BASE Intermediate_Dir ".\Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ".\Debug"
-# PROP Intermediate_Dir ".\Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I "..\krb" /I "..\..\include" /I "..\..\include\win32" /I "..\des" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_CONFIG_H" /YX /FD /c
-# ADD BASE MTL /nologo /D "_DEBUG" /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
-# ADD LINK32 ..\krb\Debug\krb.lib ..\des\Debug\des.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1320000" /subsystem:windows /dll /debug /machine:I386 /out:".\Debug/kclnt32.dll"
-
-!ENDIF
-
-# Begin Target
-
-# Name "kclient - Win32 Release"
-# Name "kclient - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
-# Begin Source File
-
-SOURCE=.\KClient.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\KClient.def
-# End Source File
-# Begin Source File
-
-SOURCE=.\passwd_dialog.rc
-# End Source File
-# Begin Source File
-
-SOURCE=.\passwd_dlg.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
-# Begin Source File
-
-SOURCE=.\KClient.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\passwd_dlg.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
-# End Group
-# End Target
-# End Project
diff --git a/crypto/kerberosIV/lib/kclient/KClient.h b/crypto/kerberosIV/lib/kclient/KClient.h
deleted file mode 100644
index d8916c5fbb1da..0000000000000
--- a/crypto/kerberosIV/lib/kclient/KClient.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 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.
- */
-
-/* KClient.h - KClient glue to krb4.dll
- * Author: Jörgen Karlsson - d93-jka@nada.kth.se
- * Date: June 1996
- */
-
-/* $Id: KClient.h,v 1.8 1999/12/02 16:58:40 joda Exp $ */
-
-#ifndef KCLIENT_H
-#define KCLIENT_H
-
-#ifdef MacOS
-#include <Types.h>
-typedef OSerr Kerr;
-#endif /* MacOS */
-
-#ifdef WIN32 /* Visual C++ 4.0 (Windows95/NT) */
-typedef int Kerr;
-#endif /* WIN32 */
-
-enum { KClientLoggedIn, KClientNotLoggedIn };
-
-struct _KClientKey
-{
- unsigned char keyBytes[8];
-};
-typedef struct _KClientKey KClientKey;
-
-struct _KClientSessionInfo
-{
- unsigned long lAddr;
- unsigned short lPort;
- unsigned long fAddr;
- unsigned short fPort;
- char user[32];
- char inst[32];
- char realm[32];
- char key[8];
-};
-typedef struct _KClientSessionInfo KClientSessionInfo;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-Kerr KClientMessage(char *text, Kerr error);
-
-/* KClientInitSession */
-Kerr KClientInitSession(KClientSessionInfo *session,
- unsigned long lAddr,
- unsigned short lPort,
- unsigned long fAddr,
- unsigned short fPort);
-
-/* KClientGetTicketForService */
-Kerr KClientGetTicketForService(KClientSessionInfo *session,
- char *service,
- void *buf,
- unsigned long *buflen);
-
-
-/* KClientLogin */
-Kerr KClientLogin(KClientSessionInfo *session,
- KClientKey *privateKey );
-
-/* KClientPasswordLogin */
-Kerr KClientPasswordLogin(KClientSessionInfo *session,
- char *password,
- KClientKey *privateKey);
-
-/* KClientKeyLogin */
-Kerr KClientKeyLogin(KClientSessionInfo *session, KClientKey *privateKey);
-
-/* KClientLogout */
-Kerr KClientLogout(void);
-
-/* KClientStatus */
-short KClientStatus(KClientSessionInfo *session);
-
-/* KClientGetUserName */
-Kerr KClientGetUserName(char *user);
-
-/* KClientSetUserName */
-Kerr KClientSetUserName(char *user);
-
-/* KClientCacheInitialTicket */
-Kerr KClientCacheInitialTicket(KClientSessionInfo *session,
- char *service);
-
-/* KClientGetSessionKey */
-Kerr KClientGetSessionKey(KClientSessionInfo *session,
- KClientKey *sessionKey);
-
-/* KClientMakeSendAuth */
-Kerr KClientMakeSendAuth(KClientSessionInfo *session,
- char *service,
- void *buf,
- unsigned long *buflen,
- long checksum,
- char *applicationVersion);
-
-/* KClientVerifySendAuth */
-Kerr KClientVerifySendAuth(KClientSessionInfo *session,
- void *buf,
- unsigned long *buflen);
-
-/* KClientEncrypt */
-Kerr KClientEncrypt(KClientSessionInfo *session,
- void *buf,
- unsigned long buflen,
- void *encryptBuf,
- unsigned long *encryptLength);
-
-/* KClientDecrypt */
-Kerr KClientDecrypt(KClientSessionInfo *session,
- void *buf,
- unsigned long buflen,
- unsigned long *decryptOffset,
- unsigned long *decryptLength);
-
-/* KClientErrorText */
-char *KClientErrorText(Kerr err, char *text);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* KCLIENT_H */
diff --git a/crypto/kerberosIV/lib/kclient/KClient.mak b/crypto/kerberosIV/lib/kclient/KClient.mak
deleted file mode 100644
index 40d4ab8603986..0000000000000
--- a/crypto/kerberosIV/lib/kclient/KClient.mak
+++ /dev/null
@@ -1,297 +0,0 @@
-# Microsoft Developer Studio Generated NMAKE File, Based on KClient.dsp
-!IF "$(CFG)" == ""
-CFG=kclient - Win32 Release
-!MESSAGE No configuration specified. Defaulting to kclient - Win32 Release.
-!ENDIF
-
-!IF "$(CFG)" != "kclient - Win32 Release" && "$(CFG)" !=\
- "kclient - Win32 Debug"
-!MESSAGE Invalid configuration "$(CFG)" specified.
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "KClient.mak" CFG="kclient - Win32 Release"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "kclient - Win32 Release" (based on\
- "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "kclient - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-!ERROR An invalid configuration is specified.
-!ENDIF
-
-!IF "$(OS)" == "Windows_NT"
-NULL=
-!ELSE
-NULL=nul
-!ENDIF
-
-!IF "$(CFG)" == "kclient - Win32 Release"
-
-OUTDIR=.\Release
-INTDIR=.\Release
-# Begin Custom Macros
-OutDir=.\.\Release
-# End Custom Macros
-
-!IF "$(RECURSE)" == "0"
-
-ALL : "$(OUTDIR)\kclnt32.dll"
-
-!ELSE
-
-ALL : "krb - Win32 Release" "$(OUTDIR)\kclnt32.dll"
-
-!ENDIF
-
-!IF "$(RECURSE)" == "1"
-CLEAN :"krb - Win32 ReleaseCLEAN"
-!ELSE
-CLEAN :
-!ENDIF
- -@erase "$(INTDIR)\KClient.obj"
- -@erase "$(INTDIR)\passwd_dialog.res"
- -@erase "$(INTDIR)\passwd_dlg.obj"
- -@erase "$(INTDIR)\vc50.idb"
- -@erase "$(OUTDIR)\kclnt32.dll"
- -@erase "$(OUTDIR)\kclnt32.exp"
- -@erase "$(OUTDIR)\kclnt32.lib"
-
-"$(OUTDIR)" :
- if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-CPP=cl.exe
-CPP_PROJ=/nologo /MT /W3 /GX /O2 /I "." /I "..\krb" /I "..\..\include" /I\
- "..\..\include\win32" /I "..\des" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D\
- "HAVE_CONFIG_H" /Fp"$(INTDIR)\KClient.pch" /YX /Fo"$(INTDIR)\\"\
- /Fd"$(INTDIR)\\" /FD /c
-CPP_OBJS=.\Release/
-CPP_SBRS=.
-
-.c{$(CPP_OBJS)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cpp{$(CPP_OBJS)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cxx{$(CPP_OBJS)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.c{$(CPP_SBRS)}.sbr::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cpp{$(CPP_SBRS)}.sbr::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cxx{$(CPP_SBRS)}.sbr::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-MTL=midl.exe
-MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32
-RSC=rc.exe
-RSC_PROJ=/l 0x409 /fo"$(INTDIR)\passwd_dialog.res" /d "NDEBUG"
-BSC32=bscmake.exe
-BSC32_FLAGS=/nologo /o"$(OUTDIR)\KClient.bsc"
-BSC32_SBRS= \
-
-LINK32=link.exe
-LINK32_FLAGS=..\krb\Release\krb.lib ..\des\Release\des.lib wsock32.lib\
- kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib\
- shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1320000"\
- /subsystem:windows /dll /incremental:no /pdb:"$(OUTDIR)\kclnt32.pdb"\
- /machine:I386 /def:".\KClient.def" /out:"$(OUTDIR)\kclnt32.dll"\
- /implib:"$(OUTDIR)\kclnt32.lib"
-DEF_FILE= \
- ".\KClient.def"
-LINK32_OBJS= \
- "$(INTDIR)\KClient.obj" \
- "$(INTDIR)\passwd_dialog.res" \
- "$(INTDIR)\passwd_dlg.obj" \
- "..\krb\Release\krb.lib"
-
-"$(OUTDIR)\kclnt32.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
- $(LINK32) @<<
- $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
-
-!ELSEIF "$(CFG)" == "kclient - Win32 Debug"
-
-OUTDIR=.\Debug
-INTDIR=.\Debug
-# Begin Custom Macros
-OutDir=.\.\Debug
-# End Custom Macros
-
-!IF "$(RECURSE)" == "0"
-
-ALL : "$(OUTDIR)\kclnt32.dll"
-
-!ELSE
-
-ALL : "krb - Win32 Debug" "$(OUTDIR)\kclnt32.dll"
-
-!ENDIF
-
-!IF "$(RECURSE)" == "1"
-CLEAN :"krb - Win32 DebugCLEAN"
-!ELSE
-CLEAN :
-!ENDIF
- -@erase "$(INTDIR)\KClient.obj"
- -@erase "$(INTDIR)\passwd_dialog.res"
- -@erase "$(INTDIR)\passwd_dlg.obj"
- -@erase "$(INTDIR)\vc50.idb"
- -@erase "$(INTDIR)\vc50.pdb"
- -@erase "$(OUTDIR)\kclnt32.dll"
- -@erase "$(OUTDIR)\kclnt32.exp"
- -@erase "$(OUTDIR)\kclnt32.ilk"
- -@erase "$(OUTDIR)\kclnt32.lib"
- -@erase "$(OUTDIR)\kclnt32.pdb"
-
-"$(OUTDIR)" :
- if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
-
-CPP=cl.exe
-CPP_PROJ=/nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I "..\krb" /I "..\..\include"\
- /I "..\..\include\win32" /I "..\des" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D\
- "HAVE_CONFIG_H" /Fp"$(INTDIR)\KClient.pch" /YX /Fo"$(INTDIR)\\"\
- /Fd"$(INTDIR)\\" /FD /c
-CPP_OBJS=.\Debug/
-CPP_SBRS=.
-
-.c{$(CPP_OBJS)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cpp{$(CPP_OBJS)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cxx{$(CPP_OBJS)}.obj::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.c{$(CPP_SBRS)}.sbr::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cpp{$(CPP_SBRS)}.sbr::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-.cxx{$(CPP_SBRS)}.sbr::
- $(CPP) @<<
- $(CPP_PROJ) $<
-<<
-
-MTL=midl.exe
-MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32
-RSC=rc.exe
-RSC_PROJ=/l 0x409 /fo"$(INTDIR)\passwd_dialog.res" /d "_DEBUG"
-BSC32=bscmake.exe
-BSC32_FLAGS=/nologo /o"$(OUTDIR)\KClient.bsc"
-BSC32_SBRS= \
-
-LINK32=link.exe
-LINK32_FLAGS=..\krb\Debug\krb.lib ..\des\Debug\des.lib wsock32.lib kernel32.lib\
- user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib\
- ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x1320000" /subsystem:windows\
- /dll /incremental:yes /pdb:"$(OUTDIR)\kclnt32.pdb" /debug /machine:I386\
- /def:".\KClient.def" /out:"$(OUTDIR)\kclnt32.dll"\
- /implib:"$(OUTDIR)\kclnt32.lib"
-DEF_FILE= \
- ".\KClient.def"
-LINK32_OBJS= \
- "$(INTDIR)\KClient.obj" \
- "$(INTDIR)\passwd_dialog.res" \
- "$(INTDIR)\passwd_dlg.obj" \
- "..\krb\Debug\krb.lib"
-
-"$(OUTDIR)\kclnt32.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
- $(LINK32) @<<
- $(LINK32_FLAGS) $(LINK32_OBJS)
-<<
-
-!ENDIF
-
-
-!IF "$(CFG)" == "kclient - Win32 Release" || "$(CFG)" ==\
- "kclient - Win32 Debug"
-SOURCE=.\KClient.c
-DEP_CPP_KCLIE=\
- "..\..\include\win32\config.h"\
- "..\..\include\win32\ktypes.h"\
- "..\des\des.h"\
- "..\krb\krb-protos.h"\
- "..\krb\krb.h"\
- ".\KClient.h"\
- ".\passwd_dlg.h"\
-
-
-"$(INTDIR)\KClient.obj" : $(SOURCE) $(DEP_CPP_KCLIE) "$(INTDIR)"
-
-
-SOURCE=.\passwd_dialog.rc
-
-"$(INTDIR)\passwd_dialog.res" : $(SOURCE) "$(INTDIR)"
- $(RSC) $(RSC_PROJ) $(SOURCE)
-
-
-SOURCE=.\passwd_dlg.c
-DEP_CPP_PASSW=\
- "..\..\include\win32\config.h"\
- ".\passwd_dlg.h"\
-
-
-"$(INTDIR)\passwd_dlg.obj" : $(SOURCE) $(DEP_CPP_PASSW) "$(INTDIR)"
-
-
-!IF "$(CFG)" == "kclient - Win32 Release"
-
-"krb - Win32 Release" :
- cd "\tmp\wirus-krb\krb4-pre-0.9.9\lib\krb"
- $(MAKE) /$(MAKEFLAGS) /F ".\krb.mak" CFG="krb - Win32 Release"
- cd "..\kclient"
-
-"krb - Win32 ReleaseCLEAN" :
- cd "\tmp\wirus-krb\krb4-pre-0.9.9\lib\krb"
- $(MAKE) /$(MAKEFLAGS) CLEAN /F ".\krb.mak" CFG="krb - Win32 Release"\
- RECURSE=1
- cd "..\kclient"
-
-!ELSEIF "$(CFG)" == "kclient - Win32 Debug"
-
-"krb - Win32 Debug" :
- cd "\tmp\wirus-krb\krb4-pre-0.9.9\lib\krb"
- $(MAKE) /$(MAKEFLAGS) /F ".\krb.mak" CFG="krb - Win32 Debug"
- cd "..\kclient"
-
-"krb - Win32 DebugCLEAN" :
- cd "\tmp\wirus-krb\krb4-pre-0.9.9\lib\krb"
- $(MAKE) /$(MAKEFLAGS) CLEAN /F ".\krb.mak" CFG="krb - Win32 Debug" RECURSE=1\
-
- cd "..\kclient"
-
-!ENDIF
-
-
-!ENDIF
-
diff --git a/crypto/kerberosIV/lib/kclient/passwd_dialog.rc b/crypto/kerberosIV/lib/kclient/passwd_dialog.rc
deleted file mode 100644
index 6478e5f24e62f..0000000000000
--- a/crypto/kerberosIV/lib/kclient/passwd_dialog.rc
+++ /dev/null
@@ -1,143 +0,0 @@
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// Swedish resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SVE)
-#ifdef _WIN32
-LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT
-#pragma code_page(1252)
-#endif //_WIN32
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 186, 95
-STYLE DS_ABSALIGN | DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_CAPTION
-CAPTION "User data"
-FONT 8, "MS Sans Serif"
-BEGIN
- EDITTEXT IDC_EDIT1,71,19,40,14,ES_AUTOHSCROLL
- EDITTEXT IDC_EDIT2,71,36,40,14,ES_PASSWORD | ES_AUTOHSCROLL
- DEFPUSHBUTTON "OK",IDOK,31,74,50,14
- PUSHBUTTON "Cancel",IDCANCEL,105,74,50,14
- LTEXT "User name:",IDC_STATIC,27,23,37,8,NOT WS_GROUP
- LTEXT "Password:",IDC_STATIC,27,39,34,8,NOT WS_GROUP
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO DISCARDABLE
-BEGIN
- IDD_DIALOG1, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 179
- TOPMARGIN, 7
- BOTTOMMARGIN, 88
- END
-END
-#endif // APSTUDIO_INVOKED
-
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "CompanyName", "Royal Institute of Technology (KTH)\0"
- VALUE "FileDescription", "kclient\0"
- VALUE "FileVersion", "4, 0, 9, 9\0"
- VALUE "InternalName", "kclient\0"
- VALUE "LegalCopyright", "Copyright © 1996 - 1998 Royal Institute of Technology (KTH)\0"
- VALUE "OriginalFilename", "kclnt32.dll\0"
- VALUE "ProductName", "KTH Kerberos\0"
- VALUE "ProductVersion", "4,0,9,9\0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
-
-#endif // !_MAC
-
-#endif // Swedish resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/crypto/kerberosIV/lib/kclient/passwd_dlg.c b/crypto/kerberosIV/lib/kclient/passwd_dlg.c
deleted file mode 100644
index fb2f46803dec4..0000000000000
--- a/crypto/kerberosIV/lib/kclient/passwd_dlg.c
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998 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.
- */
-
-/* passwd_dlg.c - Dialog boxes for Windows95/NT
- * Author: Jörgen Karlsson - d93-jka@nada.kth.se
- * Date: June 1996
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: passwd_dlg.c,v 1.11 1999/12/02 16:58:40 joda Exp $");
-#endif
-
-#ifdef WIN32 /* Visual C++ 4.0 (Windows95/NT) */
-#include <Windows.h>
-#include "passwd_dlg.h"
-#include "Resource.h"
-#define passwdBufSZ 64
-#define usr_nameSZ 64
-
-static char user_name[usr_nameSZ];
-static char passwd[passwdBufSZ];
-
-BOOL CALLBACK
-pwd_dialog_proc(HWND hwndDlg,
- UINT uMsg,
- WPARAM wParam,
- LPARAM lParam)
-{
- switch(uMsg)
- {
- case WM_INITDIALOG:
- SetDlgItemText(hwndDlg, IDC_EDIT1, user_name);
- return TRUE;
- break;
-
- case WM_COMMAND:
- switch(wParam)
- {
- case IDOK:
- if(!GetDlgItemText(hwndDlg,IDC_EDIT1, user_name, usr_nameSZ))
- EndDialog(hwndDlg, IDCANCEL);
- if(!GetDlgItemText(hwndDlg,IDC_EDIT2, passwd, passwdBufSZ))
- EndDialog(hwndDlg, IDCANCEL);
- case IDCANCEL:
- EndDialog(hwndDlg, wParam);
- return TRUE;
- }
- break;
- }
- return FALSE;
-}
-
-
-/* return 0 if ok, 1 otherwise */
-int
-pwd_dialog(char *user, size_t user_sz,
- char *password, size_t password_sz)
-{
- int i;
- HWND wnd = GetActiveWindow();
- HANDLE hInst = GetModuleHandle("kclnt32");
-
- strlcpy(user_name, user, sizeof(user_name));
- switch(DialogBox(hInst,MAKEINTRESOURCE(IDD_DIALOG1),wnd,pwd_dialog_proc))
- {
- case IDOK:
- strlcpy(user, user_name, user_sz);
- strlcpy(password, passwd, password_sz);
- memset (passwd, 0, sizeof(passwd));
- return 0;
- case IDCANCEL:
- default:
- memset (passwd, 0, sizeof(passwd));
- return 1;
- }
-}
-
-#endif /* WIN32 */
diff --git a/crypto/kerberosIV/lib/kclient/passwd_dlg.h b/crypto/kerberosIV/lib/kclient/passwd_dlg.h
deleted file mode 100644
index 543a560ca971c..0000000000000
--- a/crypto/kerberosIV/lib/kclient/passwd_dlg.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998 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.
- */
-
-/* passwd_dlg.h - Dialog boxes for Windows95/NT
- * Author: Jörgen Karlsson - d93-jka@nada.kth.se
- * Date: June 1996
- */
-
-/* $Id: passwd_dlg.h,v 1.7 1999/12/02 16:58:40 joda Exp $ */
-
-#ifndef PASSWD_DLG_H
-#define PASSWD_DLG_H
-
-int pwd_dialog(char *user, size_t user_sz,
- char *password, size_t password_sz);
-
-#endif /* PASSWD_DLG_H */
diff --git a/crypto/kerberosIV/lib/kclient/resource.h b/crypto/kerberosIV/lib/kclient/resource.h
deleted file mode 100644
index 76a6eb5e3e9c0..0000000000000
--- a/crypto/kerberosIV/lib/kclient/resource.h
+++ /dev/null
@@ -1,18 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by passwd_dialog.rc
-//
-#define IDD_DIALOG1 101
-#define IDC_EDIT1 1000
-#define IDC_EDIT2 1001
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 103
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1002
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/crypto/kerberosIV/lib/krb/defaults.c b/crypto/kerberosIV/lib/krb/defaults.c
deleted file mode 100644
index e4fe027f9a04c..0000000000000
--- a/crypto/kerberosIV/lib/krb/defaults.c
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (c) 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 "krb_locl.h"
-
-RCSID("$Id: defaults.c,v 1.3 1999/12/02 16:58:41 joda Exp $");
-
-const
-char *
-krb_get_default_tkt_root(void)
-{
- const char *t = krb_get_config_string("krb_default_tkt_root");
- if (t)
- return t;
- else
- return "/tmp/tkt";
-}
-
-const
-char *
-krb_get_default_keyfile(void)
-{
- const char *t = krb_get_config_string("krb_default_keyfile");
- if (t)
- return t;
- else
- return "/etc/srvtab";
-}
diff --git a/crypto/kerberosIV/lib/krb/extra.c b/crypto/kerberosIV/lib/krb/extra.c
deleted file mode 100644
index c90767e87a685..0000000000000
--- a/crypto/kerberosIV/lib/krb/extra.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- * Copyright (c) 1998 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 "krb_locl.h"
-
-RCSID("$Id: extra.c,v 1.7 1999/12/02 16:58:41 joda Exp $");
-
-struct value {
- char *variable;
- char *value;
- struct value *next;
-};
-
-static struct value *_extra_values;
-
-static int _krb_extra_read = 0;
-
-static int
-define_variable(const char *variable, const char *value)
-{
- struct value *e;
- e = malloc(sizeof(*e));
- if(e == NULL)
- return ENOMEM;
- e->variable = strdup(variable);
- if(e->variable == NULL) {
- free(e);
- return ENOMEM;
- }
- e->value = strdup(value);
- if(e->value == NULL) {
- free(e->variable);
- free(e);
- return ENOMEM;
- }
- e->next = _extra_values;
- _extra_values = e;
- return 0;
-}
-
-#ifndef WIN32
-
-struct obsolete {
- const char *from;
- const char *to;
-} obsolete [] = {
- { "KDC_TIMESYNC", "kdc_timesync" },
- { "KRB_REVERSE_DIRECTION", "reverse_lsb_test"},
- { "krb4_proxy", "krb4_proxy"},
- { NULL, NULL }
-};
-
-static void
-check_obsolete(void)
-{
- struct obsolete *r;
- for(r = obsolete; r->from; r++) {
- if(getenv(r->from)) {
- krb_warning("The environment variable `%s' is obsolete;\n"
- "set `%s' in your `krb.extra' file instead\n",
- r->from, r->to);
- define_variable(r->to, getenv(r->from));
- }
- }
-}
-
-static int
-read_extra_file(void)
-{
- int i = 0;
- char file[128];
- char line[1024];
- if(_krb_extra_read)
- return 0;
- _krb_extra_read = 1;
- check_obsolete();
- while(krb_get_krbextra(i++, file, sizeof(file)) == 0) {
- FILE *f = fopen(file, "r");
- if(f == NULL)
- continue;
- while(fgets(line, sizeof(line), f)) {
- char *var, *tmp, *val;
-
- /* skip initial whitespace */
- var = line + strspn(line, " \t");
- /* skip non-whitespace */
- tmp = var + strcspn(var, " \t=");
- /* skip whitespace */
- val = tmp + strspn(tmp, " \t=");
- *tmp = '\0';
- tmp = val + strcspn(val, " \t\n");
- *tmp = '\0';
- if(*var == '\0' || *var == '#' || *val == '\0')
- continue;
- if(krb_debug)
- krb_warning("%s: setting `%s' to `%s'\n", file, var, val);
- define_variable(var, val);
- }
- fclose(f);
- return 0;
- }
- return ENOENT;
-}
-
-#else /* WIN32 */
-
-static int
-read_extra_file(void)
-{
- char name[1024], data[1024];
- DWORD name_sz, data_sz;
- DWORD type;
- int num = 0;
- HKEY reg_key;
-
- if(_krb_extra_read)
- return 0;
- _krb_extra_read = 1;
-
- if(RegCreateKey(HKEY_CURRENT_USER, "krb4", &reg_key) != 0)
- return -1;
-
-
- while(1) {
- name_sz = sizeof(name);
- data_sz = sizeof(data);
- if(RegEnumValue(reg_key,
- num++,
- name,
- &name_sz,
- NULL,
- &type,
- data,
- &data_sz) != 0)
- break;
- if(type == REG_SZ)
- define_variable(name, data);
- }
- RegCloseKey(reg_key);
- return 0;
-}
-
-#endif
-
-static const char*
-find_variable(const char *variable)
-{
- struct value *e;
- for(e = _extra_values; e; e = e->next) {
- if(strcasecmp(variable, e->variable) == 0)
- return e->value;
- }
- return NULL;
-}
-
-const char *
-krb_get_config_string(const char *variable)
-{
- read_extra_file();
- return find_variable(variable);
-}
-
-int
-krb_get_config_bool(const char *variable)
-{
- const char *value = krb_get_config_string(variable);
- if(value == NULL)
- return 0;
- return strcasecmp(value, "yes") == 0 ||
- strcasecmp(value, "true") == 0 ||
- atoi(value);
-}
diff --git a/crypto/kerberosIV/lib/krb/getfile.c b/crypto/kerberosIV/lib/krb/getfile.c
deleted file mode 100644
index 99d0c3f5502b0..0000000000000
--- a/crypto/kerberosIV/lib/krb/getfile.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998 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 "krb_locl.h"
-
-RCSID("$Id: getfile.c,v 1.5 1999/12/02 16:58:42 joda Exp $");
-
-static int
-is_suid(void)
-{
- int ret = 0;
-#ifdef HAVE_GETUID
- ret |= getuid() != geteuid();
-#endif
-#ifdef HAVE_GETGID
- ret |= getgid() != getegid();
-#endif
- return ret;
-}
-
-static int
-get_file(const char **files, int num, const char *file, char *buf, size_t len)
-{
- const char *p, **q;
- int i = 0;
- if(!is_suid() && (p = getenv("KRBCONFDIR"))){
- if(num == i){
- snprintf(buf, len, "%s/%s", p, file);
- return 0;
- }
- i++;
- }
- for(q = files; *q; q++, i++){
- if(num == i){
- snprintf(buf, len, "%s", *q);
- return 0;
- }
- }
- return -1;
-}
-
-int
-krb_get_krbconf(int num, char *buf, size_t len)
-{
- const char *files[] = KRB_CNF_FILES;
- return get_file(files, num, "krb.conf", buf, len);
-}
-
-int
-krb_get_krbrealms(int num, char *buf, size_t len)
-{
- const char *files[] = KRB_RLM_FILES;
- return get_file(files, num, "krb.realms", buf, len);
-}
-
-int
-krb_get_krbextra(int num, char *buf, size_t len)
-{
- const char *files[] = { "/etc/krb.extra", NULL };
- return get_file(files, num, "krb.extra", buf, len);
-}
diff --git a/crypto/kerberosIV/lib/krb/krb-archaeology.h b/crypto/kerberosIV/lib/krb/krb-archaeology.h
deleted file mode 100644
index 0757996eeb37a..0000000000000
--- a/crypto/kerberosIV/lib/krb/krb-archaeology.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * $Id: krb-archaeology.h,v 1.2 1997/12/05 02:04:44 joda Exp $
- *
- * Most of the cruft in this file is probably:
- *
- * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute
- * of Technology.
- *
- * For copying and distribution information, please see the file
- * <mit-copyright.h>.
- */
-
-#ifndef __KRB_ARCHAEOLOGY_H__
-#define __KRB_ARCHAEOLOGY_H__
-
-/* Compare x and y in VAX byte order, result is -1, 0 or 1. */
-
-#define krb_lsb_antinet_ulong_less(x, y) (((x) == (y)) ? 0 : krb_lsb_antinet_ulong_cmp(x, y))
-
-#define krb_lsb_antinet_ushort_less(x, y) (((x) == (y)) ? 0 : krb_lsb_antinet_ushort_cmp(x, y))
-
-int krb_lsb_antinet_ulong_cmp(u_int32_t x, u_int32_t y);
-int krb_lsb_antinet_ushort_cmp(u_int16_t x, u_int16_t y);
-u_int32_t lsb_time(time_t t, struct sockaddr_in *src, struct sockaddr_in *dst);
-
-/* Macro's to obtain various fields from a packet */
-
-#define pkt_version(packet) (unsigned int) *(packet->dat)
-#define pkt_msg_type(packet) (unsigned int) *(packet->dat+1)
-#define pkt_a_name(packet) (packet->dat+2)
-#define pkt_a_inst(packet) \
- (packet->dat+3+strlen((char *)pkt_a_name(packet)))
-#define pkt_a_realm(packet) \
- (pkt_a_inst(packet)+1+strlen((char *)pkt_a_inst(packet)))
-
-/* Macro to obtain realm from application request */
-#define apreq_realm(auth) (auth->dat + 3)
-
-#define pkt_time_ws(packet) (char *) \
- (packet->dat+5+strlen((char *)pkt_a_name(packet)) + \
- strlen((char *)pkt_a_inst(packet)) + \
- strlen((char *)pkt_a_realm(packet)))
-
-#define pkt_no_req(packet) (unsigned short) \
- *(packet->dat+9+strlen((char *)pkt_a_name(packet)) + \
- strlen((char *)pkt_a_inst(packet)) + \
- strlen((char *)pkt_a_realm(packet)))
-#define pkt_x_date(packet) (char *) \
- (packet->dat+10+strlen((char *)pkt_a_name(packet)) + \
- strlen((char *)pkt_a_inst(packet)) + \
- strlen((char *)pkt_a_realm(packet)))
-#define pkt_err_code(packet) ( (char *) \
- (packet->dat+9+strlen((char *)pkt_a_name(packet)) + \
- strlen((char *)pkt_a_inst(packet)) + \
- strlen((char *)pkt_a_realm(packet))))
-#define pkt_err_text(packet) \
- (packet->dat+13+strlen((char *)pkt_a_name(packet)) + \
- strlen((char *)pkt_a_inst(packet)) + \
- strlen((char *)pkt_a_realm(packet)))
-
-/*
- * macros for byte swapping; also scratch space
- * u_quad 0-->7, 1-->6, 2-->5, 3-->4, 4-->3, 5-->2, 6-->1, 7-->0
- * u_int32_t 0-->3, 1-->2, 2-->1, 3-->0
- * u_int16_t 0-->1, 1-->0
- */
-
-#define swap_u_16(x) {\
- u_int32_t _krb_swap_tmp[4];\
- swab(((char *) x) +0, ((char *) _krb_swap_tmp) +14 ,2); \
- swab(((char *) x) +2, ((char *) _krb_swap_tmp) +12 ,2); \
- swab(((char *) x) +4, ((char *) _krb_swap_tmp) +10 ,2); \
- swab(((char *) x) +6, ((char *) _krb_swap_tmp) +8 ,2); \
- swab(((char *) x) +8, ((char *) _krb_swap_tmp) +6 ,2); \
- swab(((char *) x) +10,((char *) _krb_swap_tmp) +4 ,2); \
- swab(((char *) x) +12,((char *) _krb_swap_tmp) +2 ,2); \
- swab(((char *) x) +14,((char *) _krb_swap_tmp) +0 ,2); \
- memcpy(x, _krb_swap_tmp, 16);\
- }
-
-#define swap_u_12(x) {\
- u_int32_t _krb_swap_tmp[4];\
- swab(( char *) x, ((char *) _krb_swap_tmp) +10 ,2); \
- swab(((char *) x) +2, ((char *) _krb_swap_tmp) +8 ,2); \
- swab(((char *) x) +4, ((char *) _krb_swap_tmp) +6 ,2); \
- swab(((char *) x) +6, ((char *) _krb_swap_tmp) +4 ,2); \
- swab(((char *) x) +8, ((char *) _krb_swap_tmp) +2 ,2); \
- swab(((char *) x) +10,((char *) _krb_swap_tmp) +0 ,2); \
- memcpy(x, _krb_swap_tmp, 12);\
- }
-
-#define swap_C_Block(x) {\
- u_int32_t _krb_swap_tmp[4];\
- swab(( char *) x, ((char *) _krb_swap_tmp) +6 ,2); \
- swab(((char *) x) +2,((char *) _krb_swap_tmp) +4 ,2); \
- swab(((char *) x) +4,((char *) _krb_swap_tmp) +2 ,2); \
- swab(((char *) x) +6,((char *) _krb_swap_tmp) ,2); \
- memcpy(x, _krb_swap_tmp, 8);\
- }
-#define swap_u_quad(x) {\
- u_int32_t _krb_swap_tmp[4];\
- swab(( char *) &x, ((char *) _krb_swap_tmp) +6 ,2); \
- swab(((char *) &x) +2,((char *) _krb_swap_tmp) +4 ,2); \
- swab(((char *) &x) +4,((char *) _krb_swap_tmp) +2 ,2); \
- swab(((char *) &x) +6,((char *) _krb_swap_tmp) ,2); \
- memcpy(x, _krb_swap_tmp, 8);\
- }
-
-#define swap_u_long(x) {\
- u_int32_t _krb_swap_tmp[4];\
- swab((char *) &x, ((char *) _krb_swap_tmp) +2 ,2); \
- swab(((char *) &x) +2,((char *) _krb_swap_tmp),2); \
- x = _krb_swap_tmp[0]; \
- }
-
-#define swap_u_short(x) {\
- u_int16_t _krb_swap_sh_tmp; \
- swab((char *) &x, ( &_krb_swap_sh_tmp) ,2); \
- x = (u_int16_t) _krb_swap_sh_tmp; \
- }
-/* Kerberos ticket flag field bit definitions */
-#define K_FLAG_ORDER 0 /* bit 0 --> lsb */
-#define K_FLAG_1 /* reserved */
-#define K_FLAG_2 /* reserved */
-#define K_FLAG_3 /* reserved */
-#define K_FLAG_4 /* reserved */
-#define K_FLAG_5 /* reserved */
-#define K_FLAG_6 /* reserved */
-#define K_FLAG_7 /* reserved, bit 7 --> msb */
-
-#endif /* __KRB_ARCHAEOLOGY_H__ */
diff --git a/crypto/kerberosIV/lib/krb/krb-protos.h b/crypto/kerberosIV/lib/krb/krb-protos.h
deleted file mode 100644
index bb385d64a4d99..0000000000000
--- a/crypto/kerberosIV/lib/krb/krb-protos.h
+++ /dev/null
@@ -1,789 +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.
- */
-
-/* $Id: krb-protos.h,v 1.24 1999/12/02 16:58:42 joda Exp $ */
-
-#ifndef __krb_protos_h__
-#define __krb_protos_h__
-
-#if defined (__STDC__) || defined (_MSC_VER)
-#include <stdarg.h>
-#ifndef __P
-#define __P(x) x
-#endif
-#else
-#ifndef __P
-#define __P(x) ()
-#endif
-#endif
-
-#ifdef __STDC__
-struct in_addr;
-struct sockaddr_in;
-struct timeval;
-#endif
-
-#ifndef KRB_LIB_FUNCTION
-#if defined(__BORLANDC__)
-#define KRB_LIB_FUNCTION /* not-ready-definition-yet */
-#elif defined(_MSC_VER)
-#define KRB_LIB_FUNCTION /* not-ready-definition-yet2 */
-#else
-#define KRB_LIB_FUNCTION
-#endif
-#endif
-
-void KRB_LIB_FUNCTION
-afs_string_to_key __P((
- const char *str,
- const char *cell,
- des_cblock *key));
-
-int KRB_LIB_FUNCTION
-create_ciph __P((
- KTEXT c,
- unsigned char *session,
- char *service,
- char *instance,
- char *realm,
- u_int32_t life,
- int kvno,
- KTEXT tkt,
- u_int32_t kdc_time,
- des_cblock *key));
-
-int KRB_LIB_FUNCTION
-cr_err_reply __P((
- KTEXT pkt,
- char *pname,
- char *pinst,
- char *prealm,
- u_int32_t time_ws,
- u_int32_t e,
- char *e_string));
-
-int KRB_LIB_FUNCTION
-decomp_ticket __P((
- KTEXT tkt,
- unsigned char *flags,
- char *pname,
- char *pinstance,
- char *prealm,
- u_int32_t *paddress,
- unsigned char *session,
- int *life,
- u_int32_t *time_sec,
- char *sname,
- char *sinstance,
- des_cblock *key,
- des_key_schedule schedule));
-
-int KRB_LIB_FUNCTION
-dest_tkt __P((void));
-
-int KRB_LIB_FUNCTION
-get_ad_tkt __P((
- char *service,
- char *sinstance,
- char *realm,
- int lifetime));
-
-int KRB_LIB_FUNCTION
-getst __P((
- int fd,
- char *s,
- int n));
-
-int KRB_LIB_FUNCTION
-in_tkt __P((
- char *pname,
- char *pinst));
-
-int KRB_LIB_FUNCTION
-k_get_all_addrs __P((struct in_addr **l));
-
-int KRB_LIB_FUNCTION
-k_gethostname __P((
- char *name,
- int namelen));
-
-int KRB_LIB_FUNCTION
-k_getportbyname __P((
- const char *service,
- const char *proto,
- int default_port));
-
-int KRB_LIB_FUNCTION
-k_getsockinst __P((
- int fd,
- char *inst,
- size_t inst_size));
-
-int KRB_LIB_FUNCTION
-k_isinst __P((char *s));
-
-int KRB_LIB_FUNCTION
-k_isname __P((char *s));
-
-int KRB_LIB_FUNCTION
-k_isrealm __P((char *s));
-
-struct tm * KRB_LIB_FUNCTION
-k_localtime __P((u_int32_t *tp));
-
-int KRB_LIB_FUNCTION
-kname_parse __P((
- char *np,
- char *ip,
- char *rp,
- char *fullname));
-
-int KRB_LIB_FUNCTION
-krb_atime_to_life __P((char *atime));
-
-int KRB_LIB_FUNCTION
-krb_check_auth __P((
- KTEXT packet,
- u_int32_t checksum,
- MSG_DAT *msg_data,
- des_cblock *session,
- struct des_ks_struct *schedule,
- struct sockaddr_in *laddr,
- struct sockaddr_in *faddr));
-
-int KRB_LIB_FUNCTION
-krb_check_tm __P((struct tm tm));
-
-KTEXT KRB_LIB_FUNCTION
-krb_create_death_packet __P((char *a_name));
-
-int KRB_LIB_FUNCTION
-krb_create_ticket __P((
- KTEXT tkt,
- unsigned char flags,
- char *pname,
- char *pinstance,
- char *prealm,
- int32_t paddress,
- void *session,
- int16_t life,
- int32_t time_sec,
- char *sname,
- char *sinstance,
- des_cblock *key));
-
-int KRB_LIB_FUNCTION
-krb_decode_as_rep __P((
- const char *user,
- char *instance, /* INOUT parameter */
- const char *realm,
- const char *service,
- const char *sinstance,
- key_proc_t key_proc,
- decrypt_proc_t decrypt_proc,
- const void *arg,
- KTEXT as_rep,
- CREDENTIALS *cred));
-
-int KRB_LIB_FUNCTION
-krb_disable_debug __P((void));
-
-int KRB_LIB_FUNCTION
-krb_enable_debug __P((void));
-
-int KRB_LIB_FUNCTION
-krb_equiv __P((
- u_int32_t a,
- u_int32_t b));
-
-int KRB_LIB_FUNCTION
-krb_get_address __P((
- void *from,
- u_int32_t *to));
-
-int KRB_LIB_FUNCTION
-krb_get_admhst __P((
- char *host,
- char *realm,
- int nth));
-
-int KRB_LIB_FUNCTION
-krb_get_config_bool __P((const char *variable));
-
-const char * KRB_LIB_FUNCTION
-krb_get_config_string __P((const char *variable));
-
-int KRB_LIB_FUNCTION
-krb_get_cred __P((
- char *service,
- char *instance,
- char *realm,
- CREDENTIALS *c));
-
-int KRB_LIB_FUNCTION
-krb_get_default_principal __P((
- char *name,
- char *instance,
- char *realm));
-
-char * KRB_LIB_FUNCTION
-krb_get_default_realm __P((void));
-
-const char * KRB_LIB_FUNCTION
-krb_get_default_tkt_root __P((void));
-
-const char * KRB_LIB_FUNCTION
-krb_get_default_keyfile __P((void));
-
-const char * KRB_LIB_FUNCTION
-krb_get_err_text __P((int code));
-
-struct krb_host* KRB_LIB_FUNCTION
-krb_get_host __P((
- int nth,
- const char *realm,
- int admin));
-
-int KRB_LIB_FUNCTION
-krb_get_in_tkt __P((
- char *user,
- char *instance,
- char *realm,
- char *service,
- char *sinstance,
- int life,
- key_proc_t key_proc,
- decrypt_proc_t decrypt_proc,
- void *arg));
-
-int KRB_LIB_FUNCTION
-krb_get_int __P((
- void *f,
- u_int32_t *to,
- int size,
- int lsb));
-
-int KRB_LIB_FUNCTION
-krb_get_kdc_time_diff __P((void));
-
-int KRB_LIB_FUNCTION
-krb_get_krbconf __P((
- int num,
- char *buf,
- size_t len));
-
-int KRB_LIB_FUNCTION
-krb_get_krbextra __P((
- int num,
- char *buf,
- size_t len));
-
-int KRB_LIB_FUNCTION
-krb_get_krbhst __P((
- char *host,
- char *realm,
- int nth));
-
-int KRB_LIB_FUNCTION
-krb_get_krbrealms __P((
- int num,
- char *buf,
- size_t len));
-
-int KRB_LIB_FUNCTION
-krb_get_lrealm __P((
- char *r,
- int n));
-
-int KRB_LIB_FUNCTION
-krb_get_nir __P((
- void *from,
- char *name,
- char *instance,
- char *realm));
-
-char * KRB_LIB_FUNCTION
-krb_get_phost __P((const char *alias));
-
-int KRB_LIB_FUNCTION
-krb_get_pw_in_tkt __P((
- const char *user,
- const char *instance,
- const char *realm,
- const char *service,
- const char *sinstance,
- int life,
- const char *password));
-
-int KRB_LIB_FUNCTION
-krb_get_pw_in_tkt2 __P((
- const char *user,
- const char *instance,
- const char *realm,
- const char *service,
- const char *sinstance,
- int life,
- const char *password,
- des_cblock *key));
-
-int KRB_LIB_FUNCTION
-krb_get_string __P((
- void *from,
- char *to,
- size_t to_size));
-
-int KRB_LIB_FUNCTION
-krb_get_svc_in_tkt __P((
- char *user,
- char *instance,
- char *realm,
- char *service,
- char *sinstance,
- int life,
- char *srvtab));
-
-int KRB_LIB_FUNCTION
-krb_get_tf_fullname __P((
- char *ticket_file,
- char *name,
- char *instance,
- char *realm));
-
-int KRB_LIB_FUNCTION
-krb_get_tf_realm __P((
- char *ticket_file,
- char *realm));
-
-void KRB_LIB_FUNCTION
-krb_kdctimeofday __P((struct timeval *tv));
-
-int KRB_LIB_FUNCTION
-krb_kntoln __P((
- AUTH_DAT *ad,
- char *lname));
-
-int KRB_LIB_FUNCTION
-krb_kuserok __P((
- char *name,
- char *instance,
- char *realm,
- char *luser));
-
-char * KRB_LIB_FUNCTION
-krb_life_to_atime __P((int life));
-
-u_int32_t KRB_LIB_FUNCTION
-krb_life_to_time __P((
- u_int32_t start,
- int life_));
-
-int KRB_LIB_FUNCTION
-krb_lsb_antinet_ulong_cmp __P((
- u_int32_t x,
- u_int32_t y));
-
-int KRB_LIB_FUNCTION
-krb_lsb_antinet_ushort_cmp __P((
- u_int16_t x,
- u_int16_t y));
-
-int KRB_LIB_FUNCTION
-krb_mk_as_req __P((
- const char *user,
- const char *instance,
- const char *realm,
- const char *service,
- const char *sinstance,
- int life,
- KTEXT cip));
-
-int KRB_LIB_FUNCTION
-krb_mk_auth __P((
- int32_t options,
- KTEXT ticket,
- char *service,
- char *instance,
- char *realm,
- u_int32_t checksum,
- char *version,
- KTEXT buf));
-
-int32_t KRB_LIB_FUNCTION
-krb_mk_err __P((
- u_char *p,
- int32_t e,
- char *e_string));
-
-int32_t KRB_LIB_FUNCTION
-krb_mk_priv __P((
- void *in,
- void *out,
- u_int32_t length,
- struct des_ks_struct *schedule,
- des_cblock *key,
- struct sockaddr_in *sender,
- struct sockaddr_in *receiver));
-
-int KRB_LIB_FUNCTION
-krb_mk_req __P((
- KTEXT authent,
- char *service,
- char *instance,
- char *realm,
- int32_t checksum));
-
-int32_t KRB_LIB_FUNCTION
-krb_mk_safe __P((
- void *in,
- void *out,
- u_int32_t length,
- des_cblock *key,
- struct sockaddr_in *sender,
- struct sockaddr_in *receiver));
-
-int KRB_LIB_FUNCTION
-krb_net_read __P((
- int fd,
- void *v,
- size_t len));
-
-int KRB_LIB_FUNCTION
-krb_net_write __P((
- int fd,
- const void *v,
- size_t len));
-
-int KRB_LIB_FUNCTION
-krb_parse_name __P((
- const char *fullname,
- krb_principal *principal));
-
-int KRB_LIB_FUNCTION
-krb_put_address __P((
- u_int32_t addr,
- void *to,
- size_t rem));
-
-int KRB_LIB_FUNCTION
-krb_put_int __P((
- u_int32_t from,
- void *to,
- size_t rem,
- int size));
-
-int KRB_LIB_FUNCTION
-krb_put_nir __P((
- const char *name,
- const char *instance,
- const char *realm,
- void *to,
- size_t rem));
-
-int KRB_LIB_FUNCTION
-krb_put_string __P((
- const char *from,
- void *to,
- size_t rem));
-
-int KRB_LIB_FUNCTION
-krb_rd_err __P((
- u_char *in,
- u_int32_t in_length,
- int32_t *code,
- MSG_DAT *m_data));
-
-int32_t KRB_LIB_FUNCTION
-krb_rd_priv __P((
- void *in,
- u_int32_t in_length,
- struct des_ks_struct *schedule,
- des_cblock *key,
- struct sockaddr_in *sender,
- struct sockaddr_in *receiver,
- MSG_DAT *m_data));
-
-int KRB_LIB_FUNCTION
-krb_rd_req __P((
- KTEXT authent,
- char *service,
- char *instance,
- int32_t from_addr,
- AUTH_DAT *ad,
- char *fn));
-
-int32_t KRB_LIB_FUNCTION
-krb_rd_safe __P((
- void *in,
- u_int32_t in_length,
- des_cblock *key,
- struct sockaddr_in *sender,
- struct sockaddr_in *receiver,
- MSG_DAT *m_data));
-
-int KRB_LIB_FUNCTION
-krb_realm_parse __P((
- char *realm,
- int length));
-
-char * KRB_LIB_FUNCTION
-krb_realmofhost __P((const char *host));
-
-int KRB_LIB_FUNCTION
-krb_recvauth __P((
- int32_t options,
- int fd,
- KTEXT ticket,
- char *service,
- char *instance,
- struct sockaddr_in *faddr,
- struct sockaddr_in *laddr,
- AUTH_DAT *kdata,
- char *filename,
- struct des_ks_struct *schedule,
- char *version));
-
-int KRB_LIB_FUNCTION
-krb_sendauth __P((
- int32_t options,
- int fd,
- KTEXT ticket,
- char *service,
- char *instance,
- char *realm,
- u_int32_t checksum,
- MSG_DAT *msg_data,
- CREDENTIALS *cred,
- struct des_ks_struct *schedule,
- struct sockaddr_in *laddr,
- struct sockaddr_in *faddr,
- char *version));
-
-void KRB_LIB_FUNCTION
-krb_set_kdc_time_diff __P((int diff));
-
-int KRB_LIB_FUNCTION
-krb_set_key __P((
- void *key,
- int cvt));
-
-int KRB_LIB_FUNCTION
-krb_set_lifetime __P((int newval));
-
-void KRB_LIB_FUNCTION
-krb_set_tkt_string __P((const char *val));
-
-const char * KRB_LIB_FUNCTION
-krb_stime __P((time_t *t));
-
-int KRB_LIB_FUNCTION
-krb_time_to_life __P((
- u_int32_t start,
- u_int32_t end));
-
-char * KRB_LIB_FUNCTION
-krb_unparse_name __P((krb_principal *pr));
-
-char * KRB_LIB_FUNCTION
-krb_unparse_name_long __P((
- char *name,
- char *instance,
- char *realm));
-
-char * KRB_LIB_FUNCTION
-krb_unparse_name_long_r __P((
- char *name,
- char *instance,
- char *realm,
- char *fullname));
-
-char * KRB_LIB_FUNCTION
-krb_unparse_name_r __P((
- krb_principal *pr,
- char *fullname));
-
-int KRB_LIB_FUNCTION
-krb_use_admin_server __P((int flag));
-
-int KRB_LIB_FUNCTION
-krb_verify_user __P((
- char *name,
- char *instance,
- char *realm,
- char *password,
- int secure,
- char *linstance));
-
-int KRB_LIB_FUNCTION
-krb_verify_user_srvtab __P((
- char *name,
- char *instance,
- char *realm,
- char *password,
- int secure,
- char *linstance,
- char *srvtab));
-
-int KRB_LIB_FUNCTION
-kuserok __P((
- AUTH_DAT *auth,
- char *luser));
-
-u_int32_t KRB_LIB_FUNCTION
-lsb_time __P((
- time_t t,
- struct sockaddr_in *src,
- struct sockaddr_in *dst));
-
-const char * KRB_LIB_FUNCTION
-month_sname __P((int n));
-
-int KRB_LIB_FUNCTION
-passwd_to_5key __P((
- const char *user,
- const char *instance,
- const char *realm,
- const void *passwd,
- des_cblock *key));
-
-int KRB_LIB_FUNCTION
-passwd_to_afskey __P((
- const char *user,
- const char *instance,
- const char *realm,
- const void *passwd,
- des_cblock *key));
-
-int KRB_LIB_FUNCTION
-passwd_to_key __P((
- const char *user,
- const char *instance,
- const char *realm,
- const void *passwd,
- des_cblock *key));
-
-int KRB_LIB_FUNCTION
-read_service_key __P((
- const char *service,
- char *instance,
- const char *realm,
- int kvno,
- const char *file,
- void *key));
-
-int KRB_LIB_FUNCTION
-save_credentials __P((
- char *service,
- char *instance,
- char *realm,
- unsigned char *session,
- int lifetime,
- int kvno,
- KTEXT ticket,
- int32_t issue_date));
-
-int KRB_LIB_FUNCTION
-send_to_kdc __P((
- KTEXT pkt,
- KTEXT rpkt,
- const char *realm));
-
-int KRB_LIB_FUNCTION
-srvtab_to_key __P((
- const char *user,
- char *instance, /* INOUT parameter */
- const char *realm,
- const void *srvtab,
- des_cblock *key));
-
-void KRB_LIB_FUNCTION
-tf_close __P((void));
-
-int KRB_LIB_FUNCTION
-tf_create __P((char *tf_name));
-
-int KRB_LIB_FUNCTION
-tf_get_cred __P((CREDENTIALS *c));
-
-int KRB_LIB_FUNCTION
-tf_get_cred_addr __P((char *realm, size_t realm_sz, struct in_addr *addr));
-
-int KRB_LIB_FUNCTION
-tf_get_pinst __P((char *inst));
-
-int KRB_LIB_FUNCTION
-tf_get_pname __P((char *p));
-
-int KRB_LIB_FUNCTION
-tf_init __P((
- char *tf_name,
- int rw));
-
-int KRB_LIB_FUNCTION
-tf_put_pinst __P((const char *inst));
-
-int KRB_LIB_FUNCTION
-tf_put_pname __P((const char *p));
-
-int KRB_LIB_FUNCTION
-tf_save_cred __P((
- char *service,
- char *instance,
- char *realm,
- unsigned char *session,
- int lifetime,
- int kvno,
- KTEXT ticket,
- u_int32_t issue_date));
-
-int KRB_LIB_FUNCTION
-tf_setup __P((
- CREDENTIALS *cred,
- const char *pname,
- const char *pinst));
-
-int KRB_LIB_FUNCTION
-tf_get_addr __P((
- const char *realm,
- struct in_addr *addr));
-
-int KRB_LIB_FUNCTION
-tf_store_addr __P((const char *realm, struct in_addr *addr));
-
-char * KRB_LIB_FUNCTION
-tkt_string __P((void));
-
-int KRB_LIB_FUNCTION
-krb_add_our_ip_for_realm __P((const char *user, const char *instance,
- const char *realm, const char *password));
-
-#endif /* __krb_protos_h__ */
diff --git a/crypto/kerberosIV/lib/krb/krb.dsp b/crypto/kerberosIV/lib/krb/krb.dsp
deleted file mode 100644
index efec3b2d46dc2..0000000000000
--- a/crypto/kerberosIV/lib/krb/krb.dsp
+++ /dev/null
@@ -1,398 +0,0 @@
-# Microsoft Developer Studio Project File - Name="krb" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 5.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=krb - Win32 Release
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "krb.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "krb.mak" CFG="krb - Win32 Release"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "krb - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "krb - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "krb - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir ".\Release"
-# PROP BASE Intermediate_Dir ".\Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ".\Release"
-# PROP Intermediate_Dir ".\Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MT /W3 /GX /O2 /I "." /I "..\..\include" /I "..\..\include\win32" /I "..\des" /I "..\roken" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_CONFIG_H" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
-# ADD LINK32 ..\roken\Release\roken.lib ..\des\Release\des.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /machine:I386
-
-!ELSEIF "$(CFG)" == "krb - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir ".\Debug"
-# PROP BASE Intermediate_Dir ".\Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ".\Debug"
-# PROP Intermediate_Dir ".\Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MDd /W3 /Gm /GX /Zi /Od /I "." /I "..\..\include" /I "..\..\include\win32" /I "..\des" /I "..\roken" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_CONFIG_H" /YX /FD /c
-# ADD BASE MTL /nologo /D "_DEBUG" /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
-# ADD LINK32 ..\roken\Debug\roken.lib ..\des\Debug\des.lib wsock32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386
-
-!ENDIF
-
-# Begin Target
-
-# Name "krb - Win32 Release"
-# Name "krb - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
-# Begin Source File
-
-SOURCE=.\cr_err_reply.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\create_auth_reply.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\create_ciph.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\create_ticket.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\debug_decl.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\decomp_ticket.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\dllmain.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\encrypt_ktext.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\extra.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\get_ad_tkt.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\get_cred.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\get_default_principal.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\get_host.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\get_in_tkt.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\get_krbrlm.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\get_svc_in_tkt.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\get_tf_fullname.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\get_tf_realm.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\getaddrs.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\getfile.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\getrealm.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\getst.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\k_gethostname.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\k_getport.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\k_getsockinst.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\k_localtime.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\kdc_reply.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\kntoln.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\krb.def
-# End Source File
-# Begin Source File
-
-SOURCE=.\krb_check_auth.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\krb_equiv.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\krb_err_txt.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\krb_get_in_tkt.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\lifetime.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\logging.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\lsb_addr_comp.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\mk_auth.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\mk_err.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\mk_priv.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\mk_req.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\mk_safe.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\month_sname.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\name2name.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\netread.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\netwrite.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\one.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\parse_name.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\rd_err.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\rd_priv.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\rd_req.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\rd_safe.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\read_service_key.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\realm_parse.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\recvauth.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\rw.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\save_credentials.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\send_to_kdc.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\sendauth.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\stime.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\str2key.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\ticket_memory.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\time.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\tkt_string.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\unparse_name.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\util.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\verify_user.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
-# Begin Source File
-
-SOURCE=.\klog.h
-# End Source File
-# Begin Source File
-
-SOURCE=".\krb-protos.h"
-# End Source File
-# Begin Source File
-
-SOURCE=.\krb.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\krb_locl.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\krb_log.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\prot.h
-# End Source File
-# Begin Source File
-
-SOURCE=.\ticket_memory.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
-# Begin Source File
-
-SOURCE=.\krb.rc
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/crypto/kerberosIV/lib/krb/krb.rc b/crypto/kerberosIV/lib/krb/krb.rc
deleted file mode 100644
index 413e706bbede8..0000000000000
--- a/crypto/kerberosIV/lib/krb/krb.rc
+++ /dev/null
@@ -1,105 +0,0 @@
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// Swedish resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SVE)
-#ifdef _WIN32
-LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "CompanyName", "Royal Institute of Technology (KTH)\0"
- VALUE "FileDescription", "krb\0"
- VALUE "FileVersion", "4, 0, 9, 9\0"
- VALUE "InternalName", "krb\0"
- VALUE "LegalCopyright", "Copyright © 1996 - 1998 Royal Institute of Technology (KTH)\0"
- VALUE "OriginalFilename", "krb.dll\0"
- VALUE "ProductName", "KTH Kerberos\0"
- VALUE "ProductVersion", "4,0,9,9\0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
-
-#endif // !_MAC
-
-#endif // Swedish resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/crypto/kerberosIV/lib/krb/krb_ip_realm.c b/crypto/kerberosIV/lib/krb/krb_ip_realm.c
deleted file mode 100644
index a9581f1304a8c..0000000000000
--- a/crypto/kerberosIV/lib/krb/krb_ip_realm.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright (c) 1999 Thomas Nyström and Stacken Computer Club
- * (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 "krb_locl.h"
-
-RCSID("$Id: krb_ip_realm.c,v 1.2.2.1 1999/12/06 23:01:12 assar Exp $");
-
-/*
- * Obtain a ticket for ourselves (`user.instance') in REALM and decrypt
- * it using `password' to verify the address that the KDC got our
- * request from.
- * Store in the ticket cache.
- */
-
-int
-krb_add_our_ip_for_realm(const char *user, const char *instance,
- const char *realm, const char *password)
-{
- des_cblock newkey;
- des_key_schedule schedule;
- char scrapbuf[1024];
- struct in_addr myAddr;
- KTEXT_ST ticket;
- CREDENTIALS c;
- int err;
- u_int32_t addr;
-
- if ((err = krb_mk_req(&ticket, (char *)user, (char *)instance,
- (char *)realm, 0)) != KSUCCESS)
- return err;
-
- if ((err = krb_get_cred((char *)user, (char *)instance, (char *)realm,
- &c)) != KSUCCESS)
- return err;
-
- des_string_to_key((char *)password, &newkey);
- des_set_key(&newkey, schedule);
- err = decomp_ticket(&c.ticket_st,
- (unsigned char *)scrapbuf, /* Flags */
- scrapbuf, /* Authentication name */
- scrapbuf, /* Principal's instance */
- scrapbuf, /* Principal's authentication domain */
- /* The Address Of Me That Servers Sees */
- (u_int32_t *)&addr,
- (unsigned char *)scrapbuf, /* Session key in ticket */
- (int *)scrapbuf, /* Lifetime of ticket */
- (u_int32_t *)scrapbuf, /* Issue time and date */
- scrapbuf, /* Service name */
- scrapbuf, /* Service instance */
- &newkey, /* Secret key */
- schedule /* Precomp. key schedule */
- );
-
- if (err != KSUCCESS) {
- memset(newkey, 0, sizeof(newkey));
- memset(schedule, 0, sizeof(schedule));
- return err;
- }
-
- myAddr.s_addr = addr;
-
- err = tf_store_addr(realm, &myAddr);
-
- memset(newkey, 0, sizeof(newkey));
- memset(schedule, 0, sizeof(schedule));
-
- return err;
-}
-
-int
-krb_get_our_ip_for_realm(const char *realm, struct in_addr *ip_addr)
-{
- return tf_get_addr(realm, ip_addr);
-}
diff --git a/crypto/kerberosIV/lib/krb/krb_log.h b/crypto/kerberosIV/lib/krb/krb_log.h
deleted file mode 100644
index 5155bc73c28af..0000000000000
--- a/crypto/kerberosIV/lib/krb/krb_log.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 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: krb_log.h,v 1.3 1999/12/02 16:58:42 joda Exp $ */
-
-#include <krb.h>
-
-#ifndef __KRB_LOG_H__
-#define __KRB_LOG_H__
-
-#if !defined(__GNUC__) && !defined(__attribute__)
-#define __attribute__(X)
-#endif
-
-__BEGIN_DECLS
-
-/* logging.c */
-
-typedef int (*krb_log_func_t) __P((FILE *, const char *, va_list));
-
-typedef krb_log_func_t krb_warnfn_t;
-
-struct krb_log_facility;
-
-int krb_vlogger __P((struct krb_log_facility*, const char *, va_list))
- __attribute__ ((format (printf, 2, 0)));
-int krb_logger __P((struct krb_log_facility*, const char *, ...))
- __attribute__ ((format (printf, 2, 3)));
-int krb_openlog __P((struct krb_log_facility*, char*, FILE*, krb_log_func_t));
-
-void krb_set_warnfn __P((krb_warnfn_t));
-krb_warnfn_t krb_get_warnfn __P((void));
-void krb_warning __P((const char*, ...))
- __attribute__ ((format (printf, 1, 2)));
-
-void kset_logfile __P((char*));
-void krb_log __P((const char*, ...))
- __attribute__ ((format (printf, 1, 2)));
-char *klog __P((int, const char*, ...))
- __attribute__ ((format (printf, 2, 3)));
-
-__END_DECLS
-
-#endif /* __KRB_LOG_H__ */
diff --git a/crypto/kerberosIV/lib/krb/krb_net_read.c b/crypto/kerberosIV/lib/krb/krb_net_read.c
deleted file mode 100644
index 3830cf94a5254..0000000000000
--- a/crypto/kerberosIV/lib/krb/krb_net_read.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 1998 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 "krb_locl.h"
-
-RCSID("$Id: krb_net_read.c,v 1.3 1999/12/02 16:58:42 joda Exp $");
-
-int
-krb_net_read (int fd, void *buf, size_t nbytes)
-{
- return net_read (fd, buf, nbytes);
-}
diff --git a/crypto/kerberosIV/lib/krb/krb_net_write.c b/crypto/kerberosIV/lib/krb/krb_net_write.c
deleted file mode 100644
index 04736857a1a74..0000000000000
--- a/crypto/kerberosIV/lib/krb/krb_net_write.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 1998 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 "krb_locl.h"
-
-RCSID("$Id: krb_net_write.c,v 1.3 1999/12/02 16:58:42 joda Exp $");
-
-int
-krb_net_write (int fd, const void *buf, size_t nbytes)
-{
- return net_write (fd, buf, nbytes);
-}
diff --git a/crypto/kerberosIV/lib/krb/resource.h b/crypto/kerberosIV/lib/krb/resource.h
deleted file mode 100644
index d50551f2920a1..0000000000000
--- a/crypto/kerberosIV/lib/krb/resource.h
+++ /dev/null
@@ -1,15 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by krb.rc
-//
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 101
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1000
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/crypto/kerberosIV/lib/krb/roken_rename.h b/crypto/kerberosIV/lib/krb/roken_rename.h
deleted file mode 100644
index bae10983f3a78..0000000000000
--- a/crypto/kerberosIV/lib/krb/roken_rename.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 1998 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: roken_rename.h,v 1.8 1999/12/02 16:58:44 joda Exp $ */
-
-#ifndef __roken_rename_h__
-#define __roken_rename_h__
-
-/*
- * Libroken routines that are added libkrb
- */
-
-#define base64_decode _krb_base64_decode
-#define base64_encode _krb_base64_encode
-
-#define net_write roken_net_write
-#define net_read roken_net_read
-
-#ifndef HAVE_FLOCK
-#define flock _krb_flock
-#endif
-#ifndef HAVE_GETHOSTNAME
-#define gethostname _krb_gethostname
-#endif
-#ifndef HAVE_GETTIMEOFDAY
-#define gettimeofday _krb_gettimeofday
-#endif
-#ifndef HAVE_GETUID
-#define getuid _krb_getuid
-#endif
-#ifndef HAVE_SNPRINTF
-#define snprintf _krb_snprintf
-#endif
-#ifndef HAVE_ASPRINTF
-#define asprintf _krb_asprintf
-#endif
-#ifndef HAVE_ASNPRINTF
-#define asnprintf _krb_asnprintf
-#endif
-#ifndef HAVE_VASPRINTF
-#define vasprintf _krb_vasprintf
-#endif
-#ifndef HAVE_VASNPRINTF
-#define vasnprintf _krb_vasnprintf
-#endif
-#ifndef HAVE_VSNPRINTF
-#define vsnprintf _krb_vsnprintf
-#endif
-#ifndef HAVE_STRCASECMP
-#define strcasecmp _krb_strcasecmp
-#endif
-#ifndef HAVE_STRNCASECMP
-#define strncasecmp _krb_strncasecmp
-#endif
-#ifndef HAVE_STRDUP
-#define strdup _krb_strdup
-#endif
-#ifndef HAVE_STRNLEN
-#define strnlen _krb_strnlen
-#endif
-#ifndef HAVE_SWAB
-#define swab _krb_swab
-#endif
-#ifndef HAVE_STRTOK_R
-#define strtok_r _krb_strtok_r
-#endif
-
-#endif /* __roken_rename_h__ */
diff --git a/crypto/kerberosIV/lib/krb/solaris_compat.c b/crypto/kerberosIV/lib/krb/solaris_compat.c
deleted file mode 100644
index ff31e4b1ff355..0000000000000
--- a/crypto/kerberosIV/lib/krb/solaris_compat.c
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 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 "krb_locl.h"
-
-RCSID("$Id: solaris_compat.c,v 1.4 1999/12/02 16:58:44 joda Exp $");
-
-#if (SunOS + 0) >= 50
-/*
- * Compatibility with solaris' libkrb.
- */
-
-int32_t
-_C0095C2A(void *in, void *out, u_int32_t length,
- struct des_ks_struct *schedule, des_cblock *key,
- struct sockaddr_in *sender, struct sockaddr_in *receiver)
-{
- return krb_mk_priv (in, out, length, schedule, key, sender, receiver);
-}
-
-int32_t
-_C0095C2B(void *in, u_int32_t in_length,
- struct des_ks_struct *schedule, des_cblock *key,
- struct sockaddr_in *sender, struct sockaddr_in *receiver,
- MSG_DAT *m_data)
-{
- return krb_rd_priv (in, in_length, schedule, key,
- sender, receiver, m_data);
-}
-
-void
-_C0095B2B(des_cblock *input,des_cblock *output,
- des_key_schedule ks,int enc)
-{
- des_ecb_encrypt(input, output, ks, enc);
-}
-
-void
-_C0095B2A(des_cblock (*input),
- des_cblock (*output),
- long length,
- des_key_schedule schedule,
- des_cblock (*ivec),
- int encrypt)
-{
- des_cbc_encrypt(input, output, length, schedule, ivec, encrypt);
-}
-
-void
-_C0095B2C(des_cblock (*input),
- des_cblock (*output),
- long length,
- des_key_schedule schedule,
- des_cblock (*ivec),
- int encrypt)
-{
- des_pcbc_encrypt(input, output, length, schedule, ivec, encrypt);
-}
-#endif /* (SunOS-0) >= 50 */
diff --git a/crypto/kerberosIV/lib/krb/time.c b/crypto/kerberosIV/lib/krb/time.c
deleted file mode 100644
index 015259bcfca0d..0000000000000
--- a/crypto/kerberosIV/lib/krb/time.c
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 1998 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 "krb_locl.h"
-
-RCSID("$Id: time.c,v 1.4 1999/12/02 16:58:44 joda Exp $");
-
-/* number of seconds the kdc clock is ahead of us */
-static int time_diff;
-
-void
-krb_set_kdc_time_diff(int diff)
-{
- time_diff = diff;
- if(krb_debug)
- krb_warning("Setting time diff to %d\n", diff);
-}
-
-int
-krb_get_kdc_time_diff(void)
-{
- return time_diff;
-}
-
-/* return the time at the kdc (local time corrected with a time
- differential) */
-void
-krb_kdctimeofday(struct timeval *tv)
-{
- time_t t;
-
- gettimeofday(tv, NULL);
- t = tv->tv_sec;
-
- if(krb_debug)
- krb_warning("Machine time: %s", ctime(&t));
- t += krb_get_kdc_time_diff();
- if(krb_debug)
- krb_warning("Correcting to %s", ctime(&t));
- tv->tv_sec = t;
-}
diff --git a/crypto/kerberosIV/lib/roken/ChangeLog b/crypto/kerberosIV/lib/roken/ChangeLog
deleted file mode 100644
index 116fdbdc1a58d..0000000000000
--- a/crypto/kerberosIV/lib/roken/ChangeLog
+++ /dev/null
@@ -1,614 +0,0 @@
-1999-11-25 Assar Westerlund <assar@sics.se>
-
- * getopt.c (getopt): return -1 instead of EOF. From
- <art@stacken.kth.se>
-
-1999-11-13 Assar Westerlund <assar@sics.se>
-
- * strftime.c (strftime): handle `%z' and `%Z' in a tm_gmtoff-less
- world
-
- * getcap.c: make sure to use db only if we have both the library
- and the header file
-
-1999-11-12 Assar Westerlund <assar@sics.se>
-
- * getarg.h: add arg_counter
- * getarg.c: add a new type of argument: `arg_counter' re-organize
- the code somewhat
-
- * Makefile.am: add strptime and strpftime-test
-
- * snprintf.c (xyzprintf): try to do the right thing with an % at
- the end of the format string
-
- * strptime.c (strptime): implement '%U', '%V', '%W'
- * strftime.c (strftime): implement '%U', '%V', '%W', '%z'
-
- * strftime.c (strftime): correct %E and %O handling. do something
- reasonable with "...%"
-
- * strftime.c: replace the BSD implementation by one of our own
- coding
-
- * strptime.c : new file
- * strpftime-test.c: new file
-
-1999-11-07 Assar Westerlund <assar@sics.se>
-
- * parse_bytes-test.c: new file
-
- * Makefile.am: add parse_bytes-test
-
- * parse_units.c (parse_something): try to handle the case of no
- value specified a little bit better
-
-1999-11-04 Assar Westerlund <assar@sics.se>
-
- * Makefile.am: bump version to 3:2:0
-
-1999-10-30 Assar Westerlund <assar@sics.se>
-
- * snprintf.c (PARSE_INT_FORMAT): add redundant casts to work
- around a gcc-bug that manifests itself on Linux-PPC. From Tom
- Rini <trini@kernel.crashing.org>
-
-1999-10-28 Assar Westerlund <assar@sics.se>
-
- * Makefile.am: bump version to 3:1:0
-
- * roken.h.in: use `unsigned char' instead of `u_int8_t' to avoid
- having to have that definition. this is the easy way out instead
- of getting the definition here where it's needed. flame me.
-
-Fri Oct 22 15:39:31 1999 Bjoern Groenvall <bg@sics.se>
-
- * k_getpwuid.c (k_getpwuid): getspuid() does not exist (even
- though it should), use getspnam().
-
-1999-10-20 Assar Westerlund <assar@sics.se>
-
- * Makefile.am: set version to 3:0:0
-
-1999-10-18 Johan Danielsson <joda@pdc.kth.se>
-
- * getarg.3: document arg_collect
-
- * getarg.c: change the way arg_collect works; it's still quite
- horrible though
-
- * getarg.h: change type of the collect function
-
-1999-10-17 Assar Westerlund <assar@sics.se>
-
- * xdbm.h: undo last commit
-
- * xdbm.h: reorder db includes
-
-1999-10-10 Assar Westerlund <assar@sics.se>
-
- * socket.c: const-ize and comment
-
- * net_write.c: const-ize
-
- * base64.c: const-ize
-
-1999-10-06 Assar Westerlund <assar@sics.se>
-
- * getarg.c (getarg): also set optind when returning error
-
-1999-09-26 Assar Westerlund <assar@sics.se>
-
- * Makefile.am: add parse_bytes.[ch]
-
-1999-09-24 Johan Danielsson <joda@pdc.kth.se>
-
- * getarg.3: getarg manpage
-
- * getarg.{c,h}: add a callback type to do more complicated processing
-
- * getarg.{c,h}: add floating point support
-
-1999-09-16 Assar Westerlund <assar@sics.se>
-
- * strlcat.c (strlcat): call strlcpy
-
- * strlcpy.c: update name and prototype
-
- * strlcat.c: update name and prototype
-
- * roken.h.in: rename strc{py,at}_truncate to strlc{py,at}
-
- * Makefile.am: rename strc{py,at}_truncate -> strlc{py,at}
-
- * Makefile.in: rename strc{py,at}_truncate -> strlc{py,at}
-
- * strcpy_truncate.c (strcpy_truncate): change return value to be
- the length of `src'
-
-1999-08-16 Assar Westerlund <assar@sics.se>
-
- * getcap.c: try to make this work on systems with DB
-
-1999-08-16 Johan Danielsson <joda@pdc.kth.se>
-
- * getcap.c: protect from db-less systems
-
-1999-08-09 Johan Danielsson <joda@pdc.kth.se>
-
- * simple_exec.c: add simple_exec{ve,le}
-
- * getcap.c: getcap from NetBSD
-
-1999-08-06 Assar Westerlund <assar@sics.se>
-
- * roken.h.in (sockaddr_storage): cater for those that have
- v6-support also
-
-1999-08-05 Assar Westerlund <assar@sics.se>
-
- * inet_ntop.c (inet_ntop_v4): remember to call ntohl
-
-1999-08-04 Assar Westerlund <assar@sics.se>
-
- * roken-common.h: add shutdown constants
-
- * mini_inetd.c (listen_v4, listen_v6): handle the case of the
- protocol not being supported
-
-1999-08-01 Assar Westerlund <assar@sics.se>
-
- * mini_inetd.c (socket_set_reuseaddr): remove duplicate
-
-1999-07-29 Assar Westerlund <assar@sics.se>
-
- * mini_inetd.c (mini_inetd): fix my stupid bugs
-
-1999-07-28 Assar Westerlund <assar@sics.se>
-
- * roken-common.h: add socket* functions
-
- * Makefile.am (libroken_la_SOURCES): add socket.c
-
- * socket.c: new file, originally from appl/ftp/common
-
- * Makefile.am: set version to 2:0:2
-
- * roken.h.in (inet_pton): add prototype
-
- * Makefile.am (EXTRA_libroken_la_SOURCES): add inet_pton
-
- * inet_pton.c: new file
-
- * getipnodebyname.c (getipnodebyname): try gethostbyname2 if we
- have it
-
-1999-07-27 Assar Westerlund <assar@sics.se>
-
- * mini_inetd.c: support IPv6
-
-1999-07-26 Assar Westerlund <assar@sics.se>
-
- * Makefile.am: set version to 1:0:1
-
- * roken.h.in (inet_ntop): add prototype
-
- * roken-common.h: (INET{,6}_ADDRSTRLEN): add
-
- * inet_ntop.c: new file
-
- * Makefile.am (EXTRA_libroken_la_SOURCES): add inet_ntop.c
-
- * Makefile.am: move some files from libroken_la_SOURCES to
- EXTRA_libroken_la_SOURCES
-
- * snprintf.c: some signed vs unsigned casts
-
-1999-07-24 Assar Westerlund <assar@sics.se>
-
- * roken.h.in (struct sockaddr_storage): define it needed
-
-1999-07-19 Assar Westerlund <assar@sics.se>
-
- * Makefile.am (libroken_la_SOURCES): add copyhostent.c,
- freehostent.c, getipnodebyname.c, getipnodebyaddr.c
-
- * roken.h.in: <netdb.h>: include
- (copyhostent, freehostent, getipnodebyname, getipnodebyaddr): add
- prototypes
-
- * roken-common.h: new constants for getipnodeby*
-
- * Makefile.in (SOURCES): add freehostent, copyhostent,
- getipnodebyname, getipnodebyaddr
-
- * freehostent.c: new file
-
- * copyhostent.c: new file
-
- * getipnodebyaddr.c: new file
-
- * getipnodebyname.c: new file
-
-1999-07-13 Assar Westerlund <assar@sics.se>
-
- * roken.h.in (k_getpwnam): update prototype
-
- * k_getpwnam.c (k_getpwnam): const-ize
-
- * get_default_username.c (get_default_username): a better way of
- guessing when the user has su:ed
-
-1999-07-08 Johan Danielsson <joda@pdc.kth.se>
-
- * roken.awk: use puts, as suggested by Jeffrey Hutzelman
- <jhutz+@cmu.edu>
-
-1999-07-06 Assar Westerlund <assar@sics.se>
-
- * readv.c (readv): typo
-
-1999-07-03 Assar Westerlund <assar@sics.se>
-
- * writev.c (writev): error check malloc properly
-
- * sendmsg.c (sendmsg): error check malloc properly
-
- * resolve.c (parse_reply): error check malloc properly
-
- * recvmsg.c (recvmsg): error check malloc properly
-
- * readv.c (readv): error check malloc properly
-
-1999-06-23 Assar Westerlund <assar@sics.se>
-
- * parse_units.c (acc_units): move the special case of 0 -> 1 to
- parse_something to avoid having it happen at the end of the string
-
-1999-06-15 Assar Westerlund <assar@sics.se>
-
- * Makefile.in: add get_default_username
-
- * get_default_username.c: new file
-
- * roken.h.in (get_default_username): add prototype
-
- * Makefile.am: add get_default_username
-
-1999-05-08 Assar Westerlund <assar@sics.se>
-
- * xdbm.h: also try <db.h> with DB_DBM_HSEARCH == 1
-
- * strnlen.c (strnlen): update prototype
-
- * Makefile.am: strndup.c: add
-
- * Makefile.in: strndup.c: add
-
- * roken.h.in (strndup): add
- (strnlen): update prototype
-
- * strndup.c: new file
-
-Fri Apr 16 17:59:30 1999 Assar Westerlund <assar@sics.se>
-
- * roken.h.in: include strsep prototype if needed
-
-Thu Apr 15 14:04:03 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * Makefile.am: make make-print-version.o depend on version.h
-
-Wed Apr 7 14:11:00 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * Makefile.am: make it compile w/o krb4
-
-Sat Mar 27 17:33:03 1999 Johan Danielsson <joda@blubb.pdc.kth.se>
-
- * snprintf.c (vasnprintf): correct check if realloc returns NULL
-
-Sat Mar 27 12:37:55 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * Makefile.am: link print_version with -ldes to avoid unresolved
- references if -lkrb is shared
-
-Sat Mar 20 03:42:30 1999 Assar Westerlund <assar@sics.se>
-
- * roken-common.h (eread, ewrite): add
-
- * simple_exec.c: add <roken.h>
-
-Fri Mar 19 21:29:58 1999 Assar Westerlund <assar@sics.se>
-
- * Makefile.in: add eread, ewrite
-
- * eread.c, ewrite.c: new files
-
- * Makefile.am (libroken_la_SOURCES): add eread and ewrite
-
-Fri Mar 19 14:52:57 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * Makefile.am: add version-info
-
-Thu Mar 18 12:53:32 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * Makefile.am: remove include_dir hack
-
- * Makefile.am: parse_units.h
-
- * Makefile.am: include Makefile.am.common
-
-Sat Mar 13 23:31:35 1999 Assar Westerlund <assar@sics.se>
-
- * Makefile.in (SOURCES): add glob.c
-
-Thu Mar 11 15:02:21 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * iruserok.c: move innetgr() to separate file
-
- * innetgr.c: move innetgr() to separate file
-
- * hstrerror.c (hstrerror): add const to return type
-
- * erealloc.c: fix types in format string
-
- * emalloc.c: fix types in format string
-
-Wed Mar 10 16:36:55 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * resolve.c: ugly fix for crays
-
-Mon Mar 8 11:52:20 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * roken.h.in: protos for {un,}setenv
-
-1999-02-16 Assar Westerlund <assar@sics.se>
-
- * Makefile.in (SOURCES): add fnmatch
-
- * roken-common.h (abs): add
-
-Sat Feb 13 17:12:53 1999 Assar Westerlund <assar@sics.se>
-
- * emalloc.c, erealloc.c, estrup.c: new files
-
- * roken.h.in (mkstemp, gethostname): also includes prototypes if
- they are needed.
-
-1998-12-23 Assar Westerlund <assar@sics.se>
-
- * roken.h.in: mkstemp: add prototype
-
-1998-12-20 Assar Westerlund <assar@sics.se>
-
- * snprintf.c, iruserok.c, parse-units.c: unsigned char-correctness
-
- * roken.h.in (inet_aton): also chedk NEED_INET_ATON_PROTO
-
- * roken-common.h: __attribute__: check for autoconf'd
- HAVE___ATTRIBUTE__ instead of GNUC
-
-Sun Dec 6 19:53:21 1998 Assar Westerlund <assar@sics.se>
-
- * parse_units.c (parse_something): func is called with val == 0 if
- no unit was given
- (acc_flags, acc_units): update to new standard
-
-Fri Nov 27 03:09:42 1998 Assar Westerlund <assar@sics.se>
-
- * resolve.c (stot): constify
- (type_to_string): always declare
- (dns_lookup_int): correct debug output
-
-Thu Nov 26 23:43:55 1998 Assar Westerlund <assar@sics.se>
-
- * resolve.c (dns_lookup_int): send rr_class to res_search
-
-Thu Nov 26 17:09:47 1998 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * resolve.c: some cleanup
-
- * resolve.h: add T_NAPTR
-
-Sun Nov 22 10:23:07 1998 Assar Westerlund <assar@sics.se>
-
- * Makefile.in (WFLAGS): set
-
- * k_getpwnam.c (k_getpwnam): check for `struct spwd'
-
- * k_getpwuid.c (k_getpwuid): check for `struct spwd'
-
-Tue Sep 8 05:18:31 1998 Assar Westerlund <assar@sics.se>
-
- * recvmsg.c (recvmsg): patch from bpreece@unity.ncsu.edu
-
-Fri Sep 4 16:29:27 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * vsyslog.c: asprintf -> vasprintf
-
-Tue Aug 18 22:25:52 1998 Assar Westerlund <assar@sics.se>
-
- * getarg.h (arg_printusage): new signature
-
- * getarg.c (arg_printusage): new parameter `progname'. NULL means
- __progname.
-
-Sun Aug 9 14:53:44 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * Makefile.am: net_{read,write}.c
-
-Fri Jul 24 21:56:02 1998 Assar Westerlund <assar@sics.se>
-
- * simple_exec.c (simple_execvp): loop around waitpid when errno ==
- EINTR
-
-Thu Jul 23 20:24:35 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * Makefile.am: net_{read,write}.c
-
-Wed Jul 22 21:38:35 1998 Assar Westerlund <assar@sics.se>
-
- * simple_exec.c (simple_execlp): initialize `argv'
-
-Mon Jul 13 23:01:22 1998 Assar Westerlund <assar@sics.se>
-
- * inaddr2str.c (inaddr2str): don't advance hostent->h_addr_list,
- use a copy instead
-
-Fri Jul 10 01:20:08 1998 Assar Westerlund <assar@sics.se>
-
- * roken.h.in (net_write, net_read): add prototypes
-
- * Makefile.in: net_{read,write}.c: add
-
- * net_{read,write}.c: new files
-
-Tue Jun 30 17:29:09 1998 Assar Westerlund <assar@sics.se>
-
- * roken.h.in (issuid): add
-
- * get_window_size.c: fix misspelling of TIOCGWINSZ and bad use of
- fields
-
-Sun May 31 03:24:34 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * getarg.c (mandoc_template): Put short and long options in
- SYNOPSIS within the same [ ] pair.
-
-Sat May 30 00:13:01 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * getarg.c (arg_printusage): try to keep options shorter than
- column width
-
- * get_window_size.c (get_window_size): check COLUMNS and LINES
-
-Fri May 29 00:05:04 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * getarg.c (mandoc_template): Put short and long options in
- DESCRIPTION on the same line.
-
- * getarg.c (arg_match_long): make sure you only get an exact match
- if the strings are the same length
-
-Thu May 14 02:23:40 1998 Assar Westerlund <assar@sics.se>
-
- * roken.awk: stupid cray awk wants \#
-
-Fri May 1 01:29:36 1998 Assar Westerlund <assar@sics.se>
-
- * print_version.c (print_version): according to ISO/ANSI C the
- elements of `arg' are not constant and therefore not settable at
- compile-time. Set the at run-time instead.
-
-Sun Apr 19 10:00:06 1998 Assar Westerlund <assar@sics.se>
-
- * roken.h.in: include paths.h
-
-Sun Apr 5 12:30:49 1998 Assar Westerlund <assar@sics.se>
-
- * Makefile.in (SOURCES): add roken_gethostby.c to make solaris
- make happy
-
-Thu Mar 19 20:41:25 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * simple_exec.c: Simple fork+exec system() replacement.
-
-Fri Mar 6 00:21:53 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * roken_gethostby.c: Make `roken_gethostby_setup' take url-like
- specification instead of split up versions. Makes it easier for
- calling applications.
-
- * roken_gethostby.c: Another miracle of the 20th century:
- gethostby* over HTTP.
-
-Sat Feb 21 15:18:36 1998 assar westerlund <assar@sics.se>
-
- * parse_time.c (unparse_time_approx): new function that calls
- `unparse_units_approx'
-
- * parse_units.c (unparse_units_approx): new function that will
- only print the first unit.
-
- * Makefile.in: include parse_{time,units}
-
-Thu Feb 12 03:30:08 1998 Assar Westerlund <assar@sics.se>
-
- * parse_time.c (print_time_table): don't return a void value.
-
-Tue Feb 3 11:06:24 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * getarg.c (mandoc_template): Change date format to full month
- name, and day of month without leading zero.
-
-Thu Jan 22 21:23:23 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * getarg.c: Fix long form of negative flags.
-
-Mon Dec 29 23:31:10 1997 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * roken.h.in: Include <err.h>, to get linux __progname.
-
-Sun Dec 21 09:45:18 1997 Assar Westerlund <assar@sics.se>
-
- * parse_time.c (print_time_table): new function
-
- * parse_units.c (print_flags_table, print_units_table): new
- functions.
-
-Thu Dec 4 02:51:46 1997 Assar Westerlund <assar@sics.se>
-
- * iruserok.c: moved here.
-
- * snprintf.c (sn_append_char): don't write any terminating zero.
- (as_reserve): don't loop. better heuristic for how much space to
- realloc.
- (vasnprintf): simplify initializing to one.
-
-Sun Nov 30 14:56:59 1997 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * getarg.c: Add mandoc help back-end to getarg.
-
-Wed Nov 12 01:09:17 1997 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * verr.c, verrx.c: Fix warnings by moving exit from.
-
-Tue Nov 11 21:12:09 1997 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * parse_units.c: Change the list of separating characters (between
- units) to comma, space, and tab, removing digits. Having digits in
- this list makes a flag like `T42 generate a parse error. This
- change makes `17m3s' an invalid time-spec (you need a space).
-
-Tue Nov 11 02:38:44 1997 Assar Westerlund <assar@sics.se>
-
- * roken.h: add <sys/socket.h>
-
-Sun Nov 9 04:48:46 1997 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * fnmatch.c: Add fnmatch from NetBSD
-
-Sun Nov 9 02:00:08 1997 Assar Westerlund <assar@sics.se>
-
- * parse_units.c (parse_something): ignore white-space and ','
-
-Mon Nov 3 22:38:32 1997 Assar Westerlund <assar@sics.se>
-
- * roken.h: fclose prototype
-
- * roken.h: add prototype for vsyslog
-
- * Makefile.in: add some more source files to make soriasis make
- happy
-
-Sat Nov 1 00:19:21 1997 Assar Westerlund <assar@sics.se>
-
- * roken.h: include <sys/uio.h> and <errno.h>.
- prototypes for readv and writev
-
- * readv.c, writev.c: new files
-
-Wed Oct 29 02:21:38 1997 Assar Westerlund <assar@sics.se>
-
- * roken.h: Add ugly macros for openlog, gethostbyname,
- gethostbyaddr, and getservbyname for the benefit of Crays. Add
- default definition of MAXPATHLEN
diff --git a/crypto/kerberosIV/lib/roken/Makefile.am b/crypto/kerberosIV/lib/roken/Makefile.am
deleted file mode 100644
index e680230c5a494..0000000000000
--- a/crypto/kerberosIV/lib/roken/Makefile.am
+++ /dev/null
@@ -1,177 +0,0 @@
-# $Id: Makefile.am,v 1.54 1999/12/03 04:04:13 assar Exp $
-
-include $(top_srcdir)/Makefile.am.common
-
-CLEANFILES = roken.h make-roken.c print_version.h
-
-lib_LTLIBRARIES = libroken.la
-libroken_la_LDFLAGS = -version-info 3:2:0
-
-noinst_PROGRAMS = make-roken make-print-version
-
-check_PROGRAMS = parse_bytes-test strpftime-test getaddrinfo-test
-TESTS = $(check_PROGRAMS)
-
-getaddrinfo_test_LDADD = libroken.la
-parse_bytes_test_LDADD = libroken.la
-strpftime_test_LDADD = strftime.o strptime.o
-
-if KRB4
-if KRB5
-## need to link with des here; otherwise, if krb4 is shared the link
-## will fail with unresolved references
-make_print_version_LDADD += $(LIB_krb4) -ldes
-endif
-endif
-
-libroken_la_SOURCES = \
- base64.c \
- concat.c \
- emalloc.c \
- eread.c \
- erealloc.c \
- estrdup.c \
- ewrite.c \
- get_default_username.c \
- get_window_size.c \
- getarg.c \
- inaddr2str.c \
- issuid.c \
- k_getpwnam.c \
- k_getpwuid.c \
- mini_inetd.c \
- net_read.c \
- net_write.c \
- parse_bytes.c \
- parse_time.c \
- parse_units.c \
- print_version.c \
- resolve.c \
- roken_gethostby.c \
- signal.c \
- simple_exec.c \
- snprintf.c \
- socket.c \
- tm2time.c \
- verify.c \
- warnerr.c \
- xdbm.h
-
-EXTRA_libroken_la_SOURCES = \
- chown.c \
- copyhostent.c \
- daemon.c \
- err.c \
- err.h \
- errx.c \
- fchown.c \
- flock.c \
- fnmatch.c \
- fnmatch.h \
- freeaddrinfo.c \
- freehostent.c \
- gai_strerror.c \
- getaddrinfo.c \
- getdtablesize.c \
- getegid.c \
- geteuid.c \
- getgid.c \
- gethostname.c \
- getipnodebyaddr.c \
- getipnodebyname.c \
- getnameinfo.c \
- getopt.c \
- gettimeofday.c \
- getuid.c \
- getusershell.c \
- glob.h \
- hstrerror.c \
- inet_aton.c \
- inet_ntop.c \
- inet_pton.c \
- initgroups.c \
- innetgr.c \
- iruserok.c \
- lstat.c \
- memmove.c \
- mkstemp.c \
- putenv.c \
- rcmd.c \
- readv.c \
- recvmsg.c \
- sendmsg.c \
- setegid.c \
- setenv.c \
- seteuid.c \
- strcasecmp.c \
- strdup.c \
- strerror.c \
- strftime.c \
- strlcat.c \
- strlcpy.c \
- strlwr.c \
- strncasecmp.c \
- strndup.c \
- strnlen.c \
- strptime.c \
- strsep.c \
- strtok_r.c \
- strupr.c \
- swab.c \
- unsetenv.c \
- verr.c \
- verrx.c \
- vsyslog.c \
- vwarn.c \
- vwarnx.c \
- warn.c \
- warnx.c \
- writev.c
-
-EXTRA_DIST = resource.h roken.awk roken.def roken.dsp roken.h.in \
- roken.mak roken.rc
-
-
-
-libroken_la_LIBADD = @LTLIBOBJS@
-
-$(LTLIBOBJS) $(libroken_la_OBJECTS): roken.h
-
-include_HEADERS = $(err_h) base64.h getarg.h \
- parse_bytes.h parse_time.h parse_units.h \
- resolve.h roken.h roken-common.h
-
-build_HEADERZ = $(err_h) $(fnmatch_h) $(glob_h) xdbm.h
-
-if have_err_h
-err_h =
-else
-err_h = err.h
-endif
-
-if have_fnmatch_h
-fnmatch_h =
-else
-fnmatch_h = fnmatch.h
-endif
-
-if have_glob_h
-glob_h =
-else
-glob_h = glob.h
-endif
-
-roken.h: make-roken
- @./make-roken > tmp.h ;\
- if [ -f roken.h ] && cmp -s tmp.h roken.h ; then rm -f tmp.h ; \
- else rm -f roken.h; mv tmp.h roken.h; fi
-
-make-roken.c: roken.h.in roken.awk
- $(AWK) -f $(srcdir)/roken.awk $(srcdir)/roken.h.in > make-roken.c
-
-print_version.lo: print_version.h
-
-print_version.h: make-print-version
- ./make-print-version print_version.h
-
-make-print-version.o: $(top_builddir)/include/version.h
diff --git a/crypto/kerberosIV/lib/roken/base64.c b/crypto/kerberosIV/lib/roken/base64.c
deleted file mode 100644
index daed8697ce26f..0000000000000
--- a/crypto/kerberosIV/lib/roken/base64.c
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Copyright (c) 1995 - 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: base64.c,v 1.4 1999/12/02 16:58:45 joda Exp $");
-#endif
-#include <stdlib.h>
-#include <string.h>
-#include "base64.h"
-
-static char base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
-static int pos(char c)
-{
- char *p;
- for(p = base64; *p; p++)
- if(*p == c)
- return p - base64;
- return -1;
-}
-
-int base64_encode(const void *data, int size, char **str)
-{
- char *s, *p;
- int i;
- int c;
- const unsigned char *q;
-
- p = s = (char*)malloc(size*4/3+4);
- if (p == NULL)
- return -1;
- q = (const unsigned char*)data;
- i=0;
- for(i = 0; i < size;){
- c=q[i++];
- c*=256;
- if(i < size)
- c+=q[i];
- i++;
- c*=256;
- if(i < size)
- c+=q[i];
- i++;
- p[0]=base64[(c&0x00fc0000) >> 18];
- p[1]=base64[(c&0x0003f000) >> 12];
- p[2]=base64[(c&0x00000fc0) >> 6];
- p[3]=base64[(c&0x0000003f) >> 0];
- if(i > size)
- p[3]='=';
- if(i > size+1)
- p[2]='=';
- p+=4;
- }
- *p=0;
- *str = s;
- return strlen(s);
-}
-
-int base64_decode(const char *str, void *data)
-{
- const char *p;
- unsigned char *q;
- int c;
- int x;
- int done = 0;
- q=(unsigned char*)data;
- for(p=str; *p && !done; p+=4){
- x = pos(p[0]);
- if(x >= 0)
- c = x;
- else{
- done = 3;
- break;
- }
- c*=64;
-
- x = pos(p[1]);
- if(x >= 0)
- c += x;
- else
- return -1;
- c*=64;
-
- if(p[2] == '=')
- done++;
- else{
- x = pos(p[2]);
- if(x >= 0)
- c += x;
- else
- return -1;
- }
- c*=64;
-
- if(p[3] == '=')
- done++;
- else{
- if(done)
- return -1;
- x = pos(p[3]);
- if(x >= 0)
- c += x;
- else
- return -1;
- }
- if(done < 3)
- *q++=(c&0x00ff0000)>>16;
-
- if(done < 2)
- *q++=(c&0x0000ff00)>>8;
- if(done < 1)
- *q++=(c&0x000000ff)>>0;
- }
- return q - (unsigned char*)data;
-}
diff --git a/crypto/kerberosIV/lib/roken/base64.h b/crypto/kerberosIV/lib/roken/base64.h
deleted file mode 100644
index 5ad1e3b18ea9a..0000000000000
--- a/crypto/kerberosIV/lib/roken/base64.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 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: base64.h,v 1.2 1999/12/02 16:58:45 joda Exp $ */
-
-#ifndef _BASE64_H_
-#define _BASE64_H_
-
-int base64_encode(const void *data, int size, char **str);
-int base64_decode(const char *str, void *data);
-
-#endif
diff --git a/crypto/kerberosIV/lib/roken/concat.c b/crypto/kerberosIV/lib/roken/concat.c
deleted file mode 100644
index ca295c030ae52..0000000000000
--- a/crypto/kerberosIV/lib/roken/concat.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: concat.c,v 1.4 1999/12/02 16:58:45 joda Exp $");
-#endif
-#include "roken.h"
-
-int
-roken_concat (char *s, size_t len, ...)
-{
- int ret;
- va_list args;
-
- va_start(args, len);
- ret = roken_vconcat (s, len, args);
- va_end(args);
- return ret;
-}
-
-int
-roken_vconcat (char *s, size_t len, va_list args)
-{
- const char *a;
-
- while ((a = va_arg(args, const char*))) {
- size_t n = strlen (a);
-
- if (n >= len)
- return -1;
- memcpy (s, a, n);
- s += n;
- len -= n;
- }
- *s = '\0';
- return 0;
-}
-
-size_t
-roken_vmconcat (char **s, size_t max_len, va_list args)
-{
- const char *a;
- char *p, *q;
- size_t len = 0;
- *s = NULL;
- p = malloc(1);
- if(p == NULL)
- return 0;
- len = 1;
- while ((a = va_arg(args, const char*))) {
- size_t n = strlen (a);
-
- if(max_len && len + n > max_len){
- free(p);
- return 0;
- }
- q = realloc(p, len + n);
- if(q == NULL){
- free(p);
- return 0;
- }
- p = q;
- memcpy (p + len - 1, a, n);
- len += n;
- }
- p[len - 1] = '\0';
- *s = p;
- return len;
-}
-
-size_t
-roken_mconcat (char **s, size_t max_len, ...)
-{
- int ret;
- va_list args;
-
- va_start(args, max_len);
- ret = roken_vmconcat (s, max_len, args);
- va_end(args);
- return ret;
-}
diff --git a/crypto/kerberosIV/lib/roken/copyhostent.c b/crypto/kerberosIV/lib/roken/copyhostent.c
deleted file mode 100644
index a3be6db9134d8..0000000000000
--- a/crypto/kerberosIV/lib/roken/copyhostent.c
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: copyhostent.c,v 1.2 1999/12/02 16:58:45 joda Exp $");
-#endif
-
-#include "roken.h"
-
-/*
- * return a malloced copy of `h'
- */
-
-struct hostent *
-copyhostent (const struct hostent *h)
-{
- struct hostent *res;
- char **p;
- int i, n;
-
- res = malloc (sizeof (*res));
- if (res == NULL)
- return NULL;
- res->h_name = NULL;
- res->h_aliases = NULL;
- res->h_addrtype = h->h_addrtype;
- res->h_length = h->h_length;
- res->h_addr_list = NULL;
- res->h_name = strdup (h->h_name);
- if (res->h_name == NULL) {
- freehostent (res);
- return NULL;
- }
- for (n = 0, p = h->h_aliases; *p != NULL; ++p)
- ++n;
- res->h_aliases = malloc ((n + 1) * sizeof(*res->h_aliases));
- if (res->h_aliases == NULL) {
- freehostent (res);
- return NULL;
- }
- for (i = 0; i < n + 1; ++i)
- res->h_aliases[i] = NULL;
- for (i = 0; i < n; ++i) {
- res->h_aliases[i] = strdup (h->h_aliases[i]);
- if (res->h_aliases[i] == NULL) {
- freehostent (res);
- return NULL;
- }
- }
-
- for (n = 0, p = h->h_addr_list; *p != NULL; ++p)
- ++n;
- res->h_addr_list = malloc ((n + 1) * sizeof(*res->h_addr_list));
- if (res->h_addr_list == NULL) {
- freehostent (res);
- return NULL;
- }
- for (i = 0; i < n + 1; ++i) {
- res->h_addr_list[i] = NULL;
- }
- for (i = 0; i < n; ++i) {
- res->h_addr_list[i] = malloc (h->h_length);
- if (res->h_addr_list[i] == NULL) {
- freehostent (res);
- return NULL;
- }
- memcpy (res->h_addr_list[i], h->h_addr_list[i], h->h_length);
- }
- return res;
-}
-
diff --git a/crypto/kerberosIV/lib/roken/emalloc.c b/crypto/kerberosIV/lib/roken/emalloc.c
deleted file mode 100644
index bbea1e0b5f0b9..0000000000000
--- a/crypto/kerberosIV/lib/roken/emalloc.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: emalloc.c,v 1.4 1999/12/02 16:58:45 joda Exp $");
-#endif
-
-#include <stdlib.h>
-#include <err.h>
-
-#include <roken.h>
-
-/*
- * Like malloc but never fails.
- */
-
-void *
-emalloc (size_t sz)
-{
- void *tmp = malloc (sz);
-
- if (tmp == NULL && sz != 0)
- err (1, "malloc %lu", (unsigned long)sz);
- return tmp;
-}
diff --git a/crypto/kerberosIV/lib/roken/eread.c b/crypto/kerberosIV/lib/roken/eread.c
deleted file mode 100644
index 9a1b24bd55df8..0000000000000
--- a/crypto/kerberosIV/lib/roken/eread.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: eread.c,v 1.2 1999/12/02 16:58:45 joda Exp $");
-#endif
-
-#include <unistd.h>
-#include <err.h>
-
-#include <roken.h>
-
-/*
- * Like read but never fails (and never returns partial data).
- */
-
-ssize_t
-eread (int fd, void *buf, size_t nbytes)
-{
- ssize_t ret;
-
- ret = net_read (fd, buf, nbytes);
- if (ret < 0)
- err (1, "read");
- return ret;
-}
diff --git a/crypto/kerberosIV/lib/roken/erealloc.c b/crypto/kerberosIV/lib/roken/erealloc.c
deleted file mode 100644
index 8afa8f3d7b615..0000000000000
--- a/crypto/kerberosIV/lib/roken/erealloc.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: erealloc.c,v 1.4 1999/12/02 16:58:45 joda Exp $");
-#endif
-
-#include <stdlib.h>
-#include <err.h>
-
-#include <roken.h>
-
-/*
- * Like realloc but never fails.
- */
-
-void *
-erealloc (void *ptr, size_t sz)
-{
- void *tmp = realloc (ptr, sz);
-
- if (tmp == NULL && sz != 0)
- err (1, "realloc %lu", (unsigned long)sz);
- return tmp;
-}
diff --git a/crypto/kerberosIV/lib/roken/estrdup.c b/crypto/kerberosIV/lib/roken/estrdup.c
deleted file mode 100644
index 8c0d9a748cb39..0000000000000
--- a/crypto/kerberosIV/lib/roken/estrdup.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: estrdup.c,v 1.2 1999/12/02 16:58:45 joda Exp $");
-#endif
-
-#include <stdlib.h>
-#include <err.h>
-
-#include <roken.h>
-
-/*
- * Like strdup but never fails.
- */
-
-char *
-estrdup (const char *str)
-{
- char *tmp = strdup (str);
-
- if (tmp == NULL)
- err (1, "strdup");
- return tmp;
-}
diff --git a/crypto/kerberosIV/lib/roken/ewrite.c b/crypto/kerberosIV/lib/roken/ewrite.c
deleted file mode 100644
index b2c43de8dbc99..0000000000000
--- a/crypto/kerberosIV/lib/roken/ewrite.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: ewrite.c,v 1.2 1999/12/02 16:58:45 joda Exp $");
-#endif
-
-#include <unistd.h>
-#include <err.h>
-
-#include <roken.h>
-
-/*
- * Like write but never fails (and never returns partial data).
- */
-
-ssize_t
-ewrite (int fd, const void *buf, size_t nbytes)
-{
- ssize_t ret;
-
- ret = net_write (fd, buf, nbytes);
- if (ret < 0)
- err (1, "write");
- return ret;
-}
diff --git a/crypto/kerberosIV/lib/roken/flock.c b/crypto/kerberosIV/lib/roken/flock.c
deleted file mode 100644
index 13da4f474bef8..0000000000000
--- a/crypto/kerberosIV/lib/roken/flock.c
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef HAVE_FLOCK
-RCSID("$Id: flock.c,v 1.4 1999/12/02 16:58:46 joda Exp $");
-
-#include "roken.h"
-
-
-#define OP_MASK (LOCK_SH | LOCK_EX | LOCK_UN)
-
-int
-flock(int fd, int operation)
-{
-#if defined(HAVE_FCNTL) && defined(F_SETLK)
- struct flock arg;
- int code, cmd;
-
- arg.l_whence = SEEK_SET;
- arg.l_start = 0;
- arg.l_len = 0; /* means to EOF */
-
- if (operation & LOCK_NB)
- cmd = F_SETLK;
- else
- cmd = F_SETLKW; /* Blocking */
-
- switch (operation & OP_MASK) {
- case LOCK_UN:
- arg.l_type = F_UNLCK;
- code = fcntl(fd, F_SETLK, &arg);
- break;
- case LOCK_SH:
- arg.l_type = F_RDLCK;
- code = fcntl(fd, cmd, &arg);
- break;
- case LOCK_EX:
- arg.l_type = F_WRLCK;
- code = fcntl(fd, cmd, &arg);
- break;
- default:
- errno = EINVAL;
- code = -1;
- break;
- }
- return code;
-#else
- return -1;
-#endif
-}
-
-#endif
-
diff --git a/crypto/kerberosIV/lib/roken/fnmatch.c b/crypto/kerberosIV/lib/roken/fnmatch.c
deleted file mode 100644
index dc01d6ea61ba2..0000000000000
--- a/crypto/kerberosIV/lib/roken/fnmatch.c
+++ /dev/null
@@ -1,173 +0,0 @@
-/* $NetBSD: fnmatch.c,v 1.11 1995/02/27 03:43:06 cgd Exp $ */
-
-/*
- * Copyright (c) 1989, 1993, 1994
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Guido van Rossum.
- *
- * 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- */
-
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)fnmatch.c 8.2 (Berkeley) 4/16/94";
-#else
-static char rcsid[] = "$NetBSD: fnmatch.c,v 1.11 1995/02/27 03:43:06 cgd Exp $";
-#endif
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * Function fnmatch() as specified in POSIX 1003.2-1992, section B.6.
- * Compares a filename or pathname to a pattern.
- */
-
-#include <fnmatch.h>
-#include <string.h>
-
-#define EOS '\0'
-
-static const char *rangematch (const char *, int, int);
-
-int
-fnmatch(const char *pattern, const char *string, int flags)
-{
- const char *stringstart;
- char c, test;
-
- for (stringstart = string;;)
- switch (c = *pattern++) {
- case EOS:
- return (*string == EOS ? 0 : FNM_NOMATCH);
- case '?':
- if (*string == EOS)
- return (FNM_NOMATCH);
- if (*string == '/' && (flags & FNM_PATHNAME))
- return (FNM_NOMATCH);
- if (*string == '.' && (flags & FNM_PERIOD) &&
- (string == stringstart ||
- ((flags & FNM_PATHNAME) && *(string - 1) == '/')))
- return (FNM_NOMATCH);
- ++string;
- break;
- case '*':
- c = *pattern;
- /* Collapse multiple stars. */
- while (c == '*')
- c = *++pattern;
-
- if (*string == '.' && (flags & FNM_PERIOD) &&
- (string == stringstart ||
- ((flags & FNM_PATHNAME) && *(string - 1) == '/')))
- return (FNM_NOMATCH);
-
- /* Optimize for pattern with * at end or before /. */
- if (c == EOS)
- if (flags & FNM_PATHNAME)
- return (strchr(string, '/') == NULL ?
- 0 : FNM_NOMATCH);
- else
- return (0);
- else if (c == '/' && flags & FNM_PATHNAME) {
- if ((string = strchr(string, '/')) == NULL)
- return (FNM_NOMATCH);
- break;
- }
-
- /* General case, use recursion. */
- while ((test = *string) != EOS) {
- if (!fnmatch(pattern, string, flags & ~FNM_PERIOD))
- return (0);
- if (test == '/' && flags & FNM_PATHNAME)
- break;
- ++string;
- }
- return (FNM_NOMATCH);
- case '[':
- if (*string == EOS)
- return (FNM_NOMATCH);
- if (*string == '/' && flags & FNM_PATHNAME)
- return (FNM_NOMATCH);
- if ((pattern =
- rangematch(pattern, *string, flags)) == NULL)
- return (FNM_NOMATCH);
- ++string;
- break;
- case '\\':
- if (!(flags & FNM_NOESCAPE)) {
- if ((c = *pattern++) == EOS) {
- c = '\\';
- --pattern;
- }
- }
- /* FALLTHROUGH */
- default:
- if (c != *string++)
- return (FNM_NOMATCH);
- break;
- }
- /* NOTREACHED */
-}
-
-static const char *
-rangematch(const char *pattern, int test, int flags)
-{
- int negate, ok;
- char c, c2;
-
- /*
- * A bracket expression starting with an unquoted circumflex
- * character produces unspecified results (IEEE 1003.2-1992,
- * 3.13.2). This implementation treats it like '!', for
- * consistency with the regular expression syntax.
- * J.T. Conklin (conklin@ngai.kaleida.com)
- */
- if (negate = (*pattern == '!' || *pattern == '^'))
- ++pattern;
-
- for (ok = 0; (c = *pattern++) != ']';) {
- if (c == '\\' && !(flags & FNM_NOESCAPE))
- c = *pattern++;
- if (c == EOS)
- return (NULL);
- if (*pattern == '-'
- && (c2 = *(pattern+1)) != EOS && c2 != ']') {
- pattern += 2;
- if (c2 == '\\' && !(flags & FNM_NOESCAPE))
- c2 = *pattern++;
- if (c2 == EOS)
- return (NULL);
- if (c <= test && test <= c2)
- ok = 1;
- } else if (c == test)
- ok = 1;
- }
- return (ok == negate ? NULL : pattern);
-}
diff --git a/crypto/kerberosIV/lib/roken/fnmatch.h b/crypto/kerberosIV/lib/roken/fnmatch.h
deleted file mode 100644
index 95c91d600b646..0000000000000
--- a/crypto/kerberosIV/lib/roken/fnmatch.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* $NetBSD: fnmatch.h,v 1.5 1994/10/26 00:55:53 cgd Exp $ */
-
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- *
- * @(#)fnmatch.h 8.1 (Berkeley) 6/2/93
- */
-
-#ifndef _FNMATCH_H_
-#define _FNMATCH_H_
-
-#define FNM_NOMATCH 1 /* Match failed. */
-
-#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */
-#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */
-#define FNM_PERIOD 0x04 /* Period must be matched by period. */
-
-int fnmatch (const char *, const char *, int);
-
-#endif /* !_FNMATCH_H_ */
diff --git a/crypto/kerberosIV/lib/roken/freehostent.c b/crypto/kerberosIV/lib/roken/freehostent.c
deleted file mode 100644
index 0cd92cd732cd1..0000000000000
--- a/crypto/kerberosIV/lib/roken/freehostent.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: freehostent.c,v 1.2 1999/12/02 16:58:46 joda Exp $");
-#endif
-
-#include "roken.h"
-
-/*
- * free a malloced hostent
- */
-
-void
-freehostent (struct hostent *h)
-{
- char **p;
-
- free (h->h_name);
- if (h->h_aliases != NULL) {
- for (p = h->h_aliases; *p != NULL; ++p)
- free (*p);
- free (h->h_aliases);
- }
- if (h->h_addr_list != NULL) {
- for (p = h->h_addr_list; *p != NULL; ++p)
- free (*p);
- free (h->h_addr_list);
- }
- free (h);
-}
diff --git a/crypto/kerberosIV/lib/roken/get_default_username.c b/crypto/kerberosIV/lib/roken/get_default_username.c
deleted file mode 100644
index 10b0863888d39..0000000000000
--- a/crypto/kerberosIV/lib/roken/get_default_username.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * Copyright (c) 1997 - 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: get_default_username.c,v 1.3 1999/12/02 16:58:46 joda Exp $");
-#endif /* HAVE_CONFIG_H */
-
-#include "roken.h"
-
-/*
- * Try to return what should be considered the default username or
- * NULL if we can't guess at all.
- */
-
-const char *
-get_default_username (void)
-{
- const char *user;
-
- user = getenv ("USER");
- if (user == NULL)
- user = getenv ("LOGNAME");
- if (user == NULL)
- user = getenv ("USERNAME");
-
-#if defined(HAVE_GETLOGIN) && !defined(POSIX_GETLOGIN)
- if (user == NULL) {
- user = (const char *)getlogin ();
- if (user != NULL)
- return user;
- }
-#endif
-#ifdef HAVE_PWD_H
- {
- uid_t uid = getuid ();
- struct passwd *pwd;
-
- if (user != NULL) {
- pwd = k_getpwnam (user);
- if (pwd != NULL && pwd->pw_uid == uid)
- return user;
- }
- pwd = k_getpwuid (uid);
- if (pwd != NULL)
- return pwd->pw_name;
- }
-#endif
- return user;
-}
diff --git a/crypto/kerberosIV/lib/roken/getarg.3 b/crypto/kerberosIV/lib/roken/getarg.3
deleted file mode 100644
index 78a88028caf49..0000000000000
--- a/crypto/kerberosIV/lib/roken/getarg.3
+++ /dev/null
@@ -1,317 +0,0 @@
-.\" Copyright (c) 1999 Kungliga Tekniska Högskolan
-.\" $Id: getarg.3,v 1.2 1999/10/18 17:14:31 joda Exp $
-.Dd September 24, 1999
-.Dt GETARG 3
-.Os ROKEN
-.Sh NAME
-.Nm getarg ,
-.Nm arg_printusage
-.Nd collect command line options
-.Sh SYNOPSIS
-.Fd #include <getarg.h>
-
-.Ft int
-.Fn getarg "struct getargs *args" "size_t num_args" "int argc" "char **argv" "int *optind"
-
-.Ft void
-.Fn arg_printusage "struct getargs *args" "size_t num_args" "const char *progname" "const char *extra_string"
-
-.Sh DESCRIPTION
-.Fn getarg
-collects any command line options given to a program in an easily used way.
-.Fn arg_printusage
-pretty-prints the available options, with a short help text.
-.Pp
-.Fa args
-is the option specification to use, and it's an array of
-.Fa struct getargs
-elements.
-.Fa num_args
-is the size of
-.Fa args
-(in elements).
-.Fa argc
-and
-.Fa argv
-are the argument count and argument vector to extract option from.
-.Fa optind
-is a pointer to an integer where the index to the last processed
-argument is stored, it must be initialised to the first index (minus
-one) to process (normally 0) before the first call.
-.Pp
-.Fa arg_printusage
-take the same
-.Fa args
-and
-.Fa num_args
-as getarg;
-.Fa progname is the name of the program (to be used in the help text), and
-.Fa extra_string
-is a string to print after the actual options to indicate more
-arguments. The usefulness of this function is realised only be people
-who has used programs that has help strings that doesn't match what
-the code does.
-.Pp
-The
-.Fa getargs
-struct has the following elements.
-
-.Bd -literal
-struct getargs{
- const char *long_name;
- char short_name;
- enum { arg_integer,
- arg_string,
- arg_flag,
- arg_negative_flag,
- arg_strings,
- arg_double,
- arg_collect
- } type;
- void *value;
- const char *help;
- const char *arg_help;
-};
-.Ed
-.Pp
-.Fa long_name
-is the long name of the option, it can be
-.Dv NULL ,
-if you don't want a long name.
-.Fa short_name
-is the characted to use as short option, it can be zero. If the option
-has a value the
-.Fa value
-field gets filled in with that value interpreted as specified by the
-.Fa type
-field.
-.Fa help
-is a longer help string for the option as a whole, if it's
-.Dv NULL
-the help text for the option is omitted (but it's still displayed in
-the synopsis).
-.Fa arg_help
-is a description of the argument, if
-.Dv NULL
-a default value will be used, depending on the type of the option:
-.Pp
-.Bl -hang -width arg_negative_flag
-.It arg_integer
-the argument is a signed integer, and
-.Fa value
-should point to an
-.Fa int .
-.It Fa arg_string
-the argument is a string, and
-.Fa value
-should point to a
-.Fa char* .
-.It Fa arg_flag
-the argument is a flag, and
-.Fa value
-should point to a
-.Fa int .
-It gets filled in with either zero or one, depending on how the option
-is given, the normal case beeing one. Note that if the option isn't
-given, the value isn't altered, so it should be initialised to some
-useful default.
-.It Fa arg_negative_flag
-this is the same as
-.Fa arg_flag
-but it reverses the meaning of the flag (a given short option clears
-the flag), and the synopsis of a long option is negated.
-.It Fa arg_strings
-the argument can be given multiple times, and the values are collected
-in an array;
-.Fa value
-should be a pointer to a
-.Fa struct getarg_strings
-structure, which holds a length and a string pointer.
-.It Fa arg_double
-argument is a double precision floating point value, and
-.Fa value
-should point to a
-.Fa double .
-.It Fa arg_collect
-allows more fine-grained control of the option parsing process.
-.Fa value
-should be a pointer to a
-.Fa getarg_collect_info
-structure:
-.Bd -literal
-typedef int (*getarg_collect_func)(int short_opt,
- int argc,
- char **argv,
- int *optind,
- int *optarg,
- void *data);
-
-typedef struct getarg_collect_info {
- getarg_collect_func func;
- void *data;
-} getarg_collect_info;
-.Ed
-.Pp
-With the
-.Fa func
-member set to a function to call, and
-.Fa data
-to some application specific data. The parameters to the collect function are:
-.Bl -inset
-.It Fa short_flag
-non-zero if this call is via a short option flag, zero otherwise
-.It Fa argc , argv
-the whole argument list
-.It Fa optind
-pointer to the index in argv where the flag is
-.It Fa optarg
-pointer to the index in argv[*optind] where the flag name starts
-.It Fa data
-application specific data
-.El
-.Pp
-You can modify
-.Fa *optind ,
-and
-.Fa *optarg ,
-but to do this correct you (more or less) have to know about the inner
-workings of getarg.
-
-You can skip parts of arguments by increasing
-.Fa *optarg
-(you could
-implement the
-.Fl z Ns Ar 3
-set of flags from
-.Nm gzip
-with this), or whole argument strings by increasing
-.Fa *optind
-(let's say you want a flag
-.Fl c Ar x y z
-to specify a coordinate); if you also have to set
-.Fa *optarg
-to a sane value.
-.Pp
-The collect function should return one of
-.Dv ARG_ERR_NO_MATCH , ARG_ERR_BAD_ARG , ARG_ERR_NO_ARG
-on error, zero otherwise.
-.Pp
-For your convenience there is a function,
-.Fn getarg_optarg ,
-that returns the traditional argument string, and you pass it all
-arguments, sans data, that where given to the collection function.
-.Pp
-Don't use this more this unless you absolutely have to.
-.El
-.Pp
-Option parsing is similar to what
-.Xr getopt
-uses. Short options without arguments can be compressed
-.Pf ( Fl xyz
-is the same as
-.Fl x y z ) ,
-and short
-options with arguments take these as either the rest of the
-argv-string or as the next option
-.Pf ( Fl o Ns Ar foo ,
-or
-.Fl o Ar foo ) .
-.Pp
-Long option names are prefixed with -- (double dash), and the value
-with a = (equal),
-.Fl -foo= Ns Ar bar .
-Long option flags can either be specified as they are
-.Pf ( Fl -help ) ,
-or with an (boolean parsable) option
-.Pf ( Fl -help= Ns Ar yes ,
-.Fl -help= Ns Ar true ,
-or similar), or they can also be negated
-.Pf ( Fl -no-help
-is the same as
-.Fl -help= Ns no ) ,
-and if you're really confused you can do it multiple times
-.Pf ( Fl -no-no-help= Ns Ar false ,
-or even
-.Fl -no-no-help= Ns Ar maybe ) .
-
-.Pp
-.Sh EXAMPLE
-.Bd -literal
-#include <stdio.h>
-#include <string.h>
-#include <getarg.h>
-
-char *source = "Ouagadougou";
-char *destination;
-int weight;
-int include_catalog = 1;
-int help_flag;
-
-struct getargs args[] = {
- { "source", 's', arg_string, &source,
- "source of shippment", "city" },
- { "destination", 'd', arg_string, &destination,
- "destination of shippment", "city" },
- { "weight", 'w', arg_integer, &weight,
- "weight of shippment", "tons" },
- { "catalog", 'c', arg_negative_flag, &include_catalog,
- "include product catalog" },
- { "help", 'h', arg_flag, &help_flag }
-};
-
-int num_args = sizeof(args) / sizeof(args[0]); /* number of elements in args */
-
-const char *progname = "ship++";
-
-int
-main(int argc, char **argv)
-{
- int optind = 0;
- if (getarg(args, num_args, argc, argv, &optind)) {
- arg_printusage(args, num_args, progname, "stuff...");
- exit (1);
- }
- if (help_flag) {
- arg_printusage(args, num_args, progname, "stuff...");
- exit (0);
- }
- if (destination == NULL) {
- fprintf(stderr, "%s: must specify destination\n", progname);
- exit(1);
- }
- if (strcmp(source, destination) == 0) {
- fprintf(stderr, "%s: destination must be different from source\n");
- exit(1);
- }
- /* include more stuff here ... */
- exit(2);
-}
-.Ed
-.Pp
-The output help output from this program looks like this:
-.Bd -literal
-$ ship++ --help
-Usage: ship++ [--source=city] [-s city] [--destination=city] [-d city]
- [--weight=tons] [-w tons] [--no-catalog] [-c] [--help] [-h] stuff...
--s city, --source=city source of shippment
--d city, --destination=city destination of shippment
--w tons, --weight=tons weight of shippment
--c, --no-catalog include product catalog
-.Ed
-
-.Sh BUGS
-It should be more flexible, so it would be possible to use other more
-complicated option syntaxes, such as what
-.Xr ps 1 ,
-and
-.Xr tar 1 ,
-uses, or the AFS model where you can skip the flag names as long as
-the options come in the correct order.
-.Pp
-Options with multiple arguments should be handled better.
-.Pp
-Should be integreated with SL.
-.Pp
-It's very confusing that the struct you pass in is called getargS.
-.Sh SEE ALSO
-.Xr getopt 3
diff --git a/crypto/kerberosIV/lib/roken/getarg.c b/crypto/kerberosIV/lib/roken/getarg.c
deleted file mode 100644
index 505e41867ad6b..0000000000000
--- a/crypto/kerberosIV/lib/roken/getarg.c
+++ /dev/null
@@ -1,547 +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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: getarg.c,v 1.32 1999/12/02 16:58:46 joda Exp $");
-#endif
-
-#include <stdio.h>
-#include <roken.h>
-#include "getarg.h"
-
-#define ISFLAG(X) ((X).type == arg_flag || (X).type == arg_negative_flag)
-
-static size_t
-print_arg (char *string, size_t len, int mdoc, int longp, struct getargs *arg)
-{
- const char *s;
-
- *string = '\0';
-
- if (ISFLAG(*arg) || (!longp && arg->type == arg_counter))
- return 0;
-
- if(mdoc){
- if(longp)
- strlcat(string, "= Ns", len);
- strlcat(string, " Ar ", len);
- }else
- if (longp)
- strlcat (string, "=", len);
- else
- strlcat (string, " ", len);
-
- if (arg->arg_help)
- s = arg->arg_help;
- else if (arg->type == arg_integer || arg->type == arg_counter)
- s = "integer";
- else if (arg->type == arg_string)
- s = "string";
- else if (arg->type == arg_double)
- s = "float";
- else
- s = "<undefined>";
-
- strlcat(string, s, len);
- return 1 + strlen(s);
-}
-
-static void
-mandoc_template(struct getargs *args,
- size_t num_args,
- const char *progname,
- const char *extra_string)
-{
- int i;
- char timestr[64], cmd[64];
- char buf[128];
- const char *p;
- time_t t;
-
- printf(".\\\" Things to fix:\n");
- printf(".\\\" * correct section, and operating system\n");
- printf(".\\\" * remove Op from mandatory flags\n");
- printf(".\\\" * use better macros for arguments (like .Pa for files)\n");
- printf(".\\\"\n");
- t = time(NULL);
- strftime(timestr, sizeof(timestr), "%B %e, %Y", localtime(&t));
- printf(".Dd %s\n", timestr);
- p = strrchr(progname, '/');
- if(p) p++; else p = progname;
- strlcpy(cmd, p, sizeof(cmd));
- strupr(cmd);
-
- printf(".Dt %s SECTION\n", cmd);
- printf(".Os OPERATING_SYSTEM\n");
- printf(".Sh NAME\n");
- printf(".Nm %s\n", p);
- printf(".Nd\n");
- printf("in search of a description\n");
- printf(".Sh SYNOPSIS\n");
- printf(".Nm\n");
- for(i = 0; i < num_args; i++){
- /* we seem to hit a limit on number of arguments if doing
- short and long flags with arguments -- split on two lines */
- if(ISFLAG(args[i]) ||
- args[i].short_name == 0 || args[i].long_name == NULL) {
- printf(".Op ");
-
- if(args[i].short_name) {
- print_arg(buf, sizeof(buf), 1, 0, args + i);
- printf("Fl %c%s", args[i].short_name, buf);
- if(args[i].long_name)
- printf(" | ");
- }
- if(args[i].long_name) {
- print_arg(buf, sizeof(buf), 1, 1, args + i);
- printf("Fl -%s%s", args[i].long_name, buf);
- }
- printf("\n");
- } else {
- print_arg(buf, sizeof(buf), 1, 0, args + i);
- printf(".Oo Fl %c%s \\*(Ba Xo\n", args[i].short_name, buf);
- print_arg(buf, sizeof(buf), 1, 1, args + i);
- printf(".Fl -%s%s Oc\n.Xc\n", args[i].long_name, buf);
- }
- /*
- if(args[i].type == arg_strings)
- fprintf (stderr, "...");
- */
- }
- if (extra_string && *extra_string)
- printf (".Ar %s\n", extra_string);
- printf(".Sh DESCRIPTION\n");
- printf("Supported options:\n");
- printf(".Bl -tag -width Ds\n");
- for(i = 0; i < num_args; i++){
- printf(".It Xo\n");
- if(args[i].short_name){
- printf(".Fl %c", args[i].short_name);
- print_arg(buf, sizeof(buf), 1, 0, args + i);
- printf("%s", buf);
- if(args[i].long_name)
- printf(" Ns ,");
- printf("\n");
- }
- if(args[i].long_name){
- printf(".Fl -%s", args[i].long_name);
- print_arg(buf, sizeof(buf), 1, 1, args + i);
- printf("%s\n", buf);
- }
- printf(".Xc\n");
- if(args[i].help)
- printf("%s\n", args[i].help);
- /*
- if(args[i].type == arg_strings)
- fprintf (stderr, "...");
- */
- }
- printf(".El\n");
- printf(".\\\".Sh ENVIRONMENT\n");
- printf(".\\\".Sh FILES\n");
- printf(".\\\".Sh EXAMPLES\n");
- printf(".\\\".Sh DIAGNOSTICS\n");
- printf(".\\\".Sh SEE ALSO\n");
- printf(".\\\".Sh STANDARDS\n");
- printf(".\\\".Sh HISTORY\n");
- printf(".\\\".Sh AUTHORS\n");
- printf(".\\\".Sh BUGS\n");
-}
-
-static int
-check_column(FILE *f, int col, int len, int columns)
-{
- if(col + len > columns) {
- fprintf(f, "\n");
- col = fprintf(f, " ");
- }
- return col;
-}
-
-void
-arg_printusage (struct getargs *args,
- size_t num_args,
- const char *progname,
- const char *extra_string)
-{
- int i;
- size_t max_len = 0;
- char buf[128];
- int col = 0, columns;
- struct winsize ws;
-
- if (progname == NULL)
- progname = __progname;
-
- if(getenv("GETARGMANDOC")){
- mandoc_template(args, num_args, progname, extra_string);
- return;
- }
- if(get_window_size(2, &ws) == 0)
- columns = ws.ws_col;
- else
- columns = 80;
- col = 0;
- col += fprintf (stderr, "Usage: %s", progname);
- for (i = 0; i < num_args; ++i) {
- size_t len = 0;
-
- if (args[i].long_name) {
- buf[0] = '\0';
- strlcat(buf, "[--", sizeof(buf));
- len += 2;
- if(args[i].type == arg_negative_flag) {
- strlcat(buf, "no-", sizeof(buf));
- len += 3;
- }
- strlcat(buf, args[i].long_name, sizeof(buf));
- len += strlen(args[i].long_name);
- len += print_arg(buf + strlen(buf), sizeof(buf) - strlen(buf),
- 0, 1, &args[i]);
- strlcat(buf, "]", sizeof(buf));
- if(args[i].type == arg_strings)
- strlcat(buf, "...", sizeof(buf));
- col = check_column(stderr, col, strlen(buf) + 1, columns);
- col += fprintf(stderr, " %s", buf);
- }
- if (args[i].short_name) {
- snprintf(buf, sizeof(buf), "[-%c", args[i].short_name);
- len += 2;
- len += print_arg(buf + strlen(buf), sizeof(buf) - strlen(buf),
- 0, 0, &args[i]);
- strlcat(buf, "]", sizeof(buf));
- if(args[i].type == arg_strings)
- strlcat(buf, "...", sizeof(buf));
- col = check_column(stderr, col, strlen(buf) + 1, columns);
- col += fprintf(stderr, " %s", buf);
- }
- if (args[i].long_name && args[i].short_name)
- len += 2; /* ", " */
- max_len = max(max_len, len);
- }
- if (extra_string) {
- col = check_column(stderr, col, strlen(extra_string) + 1, columns);
- fprintf (stderr, " %s\n", extra_string);
- } else
- fprintf (stderr, "\n");
- for (i = 0; i < num_args; ++i) {
- if (args[i].help) {
- size_t count = 0;
-
- if (args[i].short_name) {
- count += fprintf (stderr, "-%c", args[i].short_name);
- print_arg (buf, sizeof(buf), 0, 0, &args[i]);
- count += fprintf(stderr, "%s", buf);
- }
- if (args[i].short_name && args[i].long_name)
- count += fprintf (stderr, ", ");
- if (args[i].long_name) {
- count += fprintf (stderr, "--");
- if (args[i].type == arg_negative_flag)
- count += fprintf (stderr, "no-");
- count += fprintf (stderr, "%s", args[i].long_name);
- print_arg (buf, sizeof(buf), 0, 1, &args[i]);
- count += fprintf(stderr, "%s", buf);
- }
- while(count++ <= max_len)
- putc (' ', stderr);
- fprintf (stderr, "%s\n", args[i].help);
- }
- }
-}
-
-static void
-add_string(getarg_strings *s, char *value)
-{
- s->strings = realloc(s->strings, (s->num_strings + 1) * sizeof(*s->strings));
- s->strings[s->num_strings] = value;
- s->num_strings++;
-}
-
-static int
-arg_match_long(struct getargs *args, size_t num_args,
- char *argv, int argc, char **rargv, int *optind)
-{
- int i;
- char *optarg = NULL;
- int negate = 0;
- int partial_match = 0;
- struct getargs *partial = NULL;
- struct getargs *current = NULL;
- int argv_len;
- char *p;
-
- argv_len = strlen(argv);
- p = strchr (argv, '=');
- if (p != NULL)
- argv_len = p - argv;
-
- for (i = 0; i < num_args; ++i) {
- if(args[i].long_name) {
- int len = strlen(args[i].long_name);
- char *p = argv;
- int p_len = argv_len;
- negate = 0;
-
- for (;;) {
- if (strncmp (args[i].long_name, p, p_len) == 0) {
- if(p_len == len)
- current = &args[i];
- else {
- ++partial_match;
- partial = &args[i];
- }
- optarg = p + p_len;
- } else if (ISFLAG(args[i]) && strncmp (p, "no-", 3) == 0) {
- negate = !negate;
- p += 3;
- p_len -= 3;
- continue;
- }
- break;
- }
- if (current)
- break;
- }
- }
- if (current == NULL) {
- if (partial_match == 1)
- current = partial;
- else
- return ARG_ERR_NO_MATCH;
- }
-
- if(*optarg == '\0'
- && !ISFLAG(*current)
- && current->type != arg_collect
- && current->type != arg_counter)
- return ARG_ERR_NO_MATCH;
- switch(current->type){
- case arg_integer:
- {
- int tmp;
- if(sscanf(optarg + 1, "%d", &tmp) != 1)
- return ARG_ERR_BAD_ARG;
- *(int*)current->value = tmp;
- return 0;
- }
- case arg_string:
- {
- *(char**)current->value = optarg + 1;
- return 0;
- }
- case arg_strings:
- {
- add_string((getarg_strings*)current->value, optarg + 1);
- return 0;
- }
- case arg_flag:
- case arg_negative_flag:
- {
- int *flag = current->value;
- if(*optarg == '\0' ||
- strcmp(optarg + 1, "yes") == 0 ||
- strcmp(optarg + 1, "true") == 0){
- *flag = !negate;
- return 0;
- } else if (*optarg && strcmp(optarg + 1, "maybe") == 0) {
- *flag = rand() & 1;
- } else {
- *flag = negate;
- return 0;
- }
- return ARG_ERR_BAD_ARG;
- }
- case arg_counter :
- {
- int val;
-
- if (*optarg == '\0')
- val = 1;
- else {
- char *endstr;
-
- val = strtol (optarg, &endstr, 0);
- if (endstr == optarg)
- return ARG_ERR_BAD_ARG;
- }
- *(int *)current->value += val;
- return 0;
- }
- case arg_double:
- {
- double tmp;
- if(sscanf(optarg + 1, "%lf", &tmp) != 1)
- return ARG_ERR_BAD_ARG;
- *(double*)current->value = tmp;
- return 0;
- }
- case arg_collect:{
- struct getarg_collect_info *c = current->value;
- int o = argv - rargv[*optind];
- return (*c->func)(FALSE, argc, rargv, optind, &o, c->data);
- }
-
- default:
- abort ();
- }
-}
-
-static int
-arg_match_short (struct getargs *args, size_t num_args,
- char *argv, int argc, char **rargv, int *optind)
-{
- int j, k;
-
- for(j = 1; j > 0 && j < strlen(rargv[*optind]); j++) {
- for(k = 0; k < num_args; k++) {
- char *optarg;
-
- if(args[k].short_name == 0)
- continue;
- if(argv[j] == args[k].short_name) {
- if(args[k].type == arg_flag) {
- *(int*)args[k].value = 1;
- break;
- }
- if(args[k].type == arg_negative_flag) {
- *(int*)args[k].value = 0;
- break;
- }
- if(args[k].type == arg_counter) {
- ++*(int *)args[k].value;
- break;
- }
- if(args[k].type == arg_collect) {
- struct getarg_collect_info *c = args[k].value;
-
- if((*c->func)(TRUE, argc, rargv, optind, &j, c->data))
- return ARG_ERR_BAD_ARG;
- break;
- }
-
- if(argv[j + 1])
- optarg = &argv[j + 1];
- else {
- ++*optind;
- optarg = rargv[*optind];
- }
- if(optarg == NULL)
- return ARG_ERR_NO_ARG;
- if(args[k].type == arg_integer) {
- int tmp;
- if(sscanf(optarg, "%d", &tmp) != 1)
- return ARG_ERR_BAD_ARG;
- *(int*)args[k].value = tmp;
- return 0;
- } else if(args[k].type == arg_string) {
- *(char**)args[k].value = optarg;
- return 0;
- } else if(args[k].type == arg_strings) {
- add_string((getarg_strings*)args[k].value, optarg);
- return 0;
- } else if(args[k].type == arg_double) {
- double tmp;
- if(sscanf(optarg, "%lf", &tmp) != 1)
- return ARG_ERR_BAD_ARG;
- *(double*)args[k].value = tmp;
- return 0;
- }
- return ARG_ERR_BAD_ARG;
- }
- }
- if (k == num_args)
- return ARG_ERR_NO_MATCH;
- }
- return 0;
-}
-
-int
-getarg(struct getargs *args, size_t num_args,
- int argc, char **argv, int *optind)
-{
- int i;
- int ret = 0;
-
- srand (time(NULL));
- (*optind)++;
- for(i = *optind; i < argc; i++) {
- if(argv[i][0] != '-')
- break;
- if(argv[i][1] == '-'){
- if(argv[i][2] == 0){
- i++;
- break;
- }
- ret = arg_match_long (args, num_args, argv[i] + 2,
- argc, argv, &i);
- } else {
- ret = arg_match_short (args, num_args, argv[i],
- argc, argv, &i);
- }
- if(ret)
- break;
- }
- *optind = i;
- return ret;
-}
-
-#if TEST
-int foo_flag = 2;
-int flag1 = 0;
-int flag2 = 0;
-int bar_int;
-char *baz_string;
-
-struct getargs args[] = {
- { NULL, '1', arg_flag, &flag1, "one", NULL },
- { NULL, '2', arg_flag, &flag2, "two", NULL },
- { "foo", 'f', arg_negative_flag, &foo_flag, "foo", NULL },
- { "bar", 'b', arg_integer, &bar_int, "bar", "seconds"},
- { "baz", 'x', arg_string, &baz_string, "baz", "name" },
-};
-
-int main(int argc, char **argv)
-{
- int optind = 0;
- while(getarg(args, 5, argc, argv, &optind))
- printf("Bad arg: %s\n", argv[optind]);
- printf("flag1 = %d\n", flag1);
- printf("flag2 = %d\n", flag2);
- printf("foo_flag = %d\n", foo_flag);
- printf("bar_int = %d\n", bar_int);
- printf("baz_flag = %s\n", baz_string);
- arg_printusage (args, 5, argv[0], "nothing here");
-}
-#endif
diff --git a/crypto/kerberosIV/lib/roken/getarg.h b/crypto/kerberosIV/lib/roken/getarg.h
deleted file mode 100644
index 7fd374bba53d2..0000000000000
--- a/crypto/kerberosIV/lib/roken/getarg.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Copyright (c) 1997, 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.
- */
-
-/* $Id: getarg.h,v 1.10 1999/12/02 16:58:46 joda Exp $ */
-
-#ifndef __GETARG_H__
-#define __GETARG_H__
-
-#include <stddef.h>
-
-struct getargs{
- const char *long_name;
- char short_name;
- enum { arg_integer,
- arg_string,
- arg_flag,
- arg_negative_flag,
- arg_strings,
- arg_double,
- arg_collect,
- arg_counter
- } type;
- void *value;
- const char *help;
- const char *arg_help;
-};
-
-enum {
- ARG_ERR_NO_MATCH = 1,
- ARG_ERR_BAD_ARG,
- ARG_ERR_NO_ARG
-};
-
-typedef struct getarg_strings {
- int num_strings;
- char **strings;
-} getarg_strings;
-
-typedef int (*getarg_collect_func)(int short_opt,
- int argc,
- char **argv,
- int *optind,
- int *optarg,
- void *data);
-
-typedef struct getarg_collect_info {
- getarg_collect_func func;
- void *data;
-} getarg_collect_info;
-
-int getarg(struct getargs *args, size_t num_args,
- int argc, char **argv, int *optind);
-
-void arg_printusage (struct getargs *args,
- size_t num_args,
- const char *progname,
- const char *extra_string);
-
-#endif /* __GETARG_H__ */
diff --git a/crypto/kerberosIV/lib/roken/getcap.c b/crypto/kerberosIV/lib/roken/getcap.c
deleted file mode 100644
index 997fabf253cd1..0000000000000
--- a/crypto/kerberosIV/lib/roken/getcap.c
+++ /dev/null
@@ -1,1118 +0,0 @@
-/* $NetBSD: getcap.c,v 1.29 1999/03/29 09:27:29 abs Exp $ */
-
-/*-
- * Copyright (c) 1992, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Casey Leedom of Lawrence Livermore National Laboratory.
- *
- * 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "roken.h"
-RCSID("$Id: getcap.c,v 1.7 1999/11/17 21:11:58 assar Exp $");
-
-#include <sys/types.h>
-#include <ctype.h>
-#if defined(HAVE_DB_185_H)
-#include <db_185.h>
-#elif defined(HAVE_DB_H)
-#include <db.h>
-#endif
-#include <errno.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#define BFRAG 1024
-#if 0
-#define BSIZE 1024
-#endif
-#define ESC ('[' & 037) /* ASCII ESC */
-#define MAX_RECURSION 32 /* maximum getent recursion */
-#define SFRAG 100 /* cgetstr mallocs in SFRAG chunks */
-
-#define RECOK (char)0
-#define TCERR (char)1
-#define SHADOW (char)2
-
-static size_t topreclen; /* toprec length */
-static char *toprec; /* Additional record specified by cgetset() */
-static int gottoprec; /* Flag indicating retrieval of toprecord */
-
-#if defined(HAVE_DBOPEN) && defined(HAVE_DB_H)
-#define USE_DB
-#endif
-
-#ifdef USE_DB
-static int cdbget (DB *, char **, const char *);
-#endif
-static int getent (char **, size_t *, char **, int, const char *, int, char *);
-static int nfcmp (char *, char *);
-
-
-int cgetset(const char *ent);
-char *cgetcap(char *buf, const char *cap, int type);
-int cgetent(char **buf, char **db_array, const char *name);
-int cgetmatch(const char *buf, const char *name);
-int cgetclose(void);
-#if 0
-int cgetfirst(char **buf, char **db_array);
-int cgetnext(char **bp, char **db_array);
-#endif
-int cgetstr(char *buf, const char *cap, char **str);
-int cgetustr(char *buf, const char *cap, char **str);
-int cgetnum(char *buf, const char *cap, long *num);
-/*
- * Cgetset() allows the addition of a user specified buffer to be added
- * to the database array, in effect "pushing" the buffer on top of the
- * virtual database. 0 is returned on success, -1 on failure.
- */
-int
-cgetset(const char *ent)
-{
- const char *source, *check;
- char *dest;
-
- if (ent == NULL) {
- if (toprec)
- free(toprec);
- toprec = NULL;
- topreclen = 0;
- return (0);
- }
- topreclen = strlen(ent);
- if ((toprec = malloc (topreclen + 1)) == NULL) {
- errno = ENOMEM;
- return (-1);
- }
- gottoprec = 0;
-
- source=ent;
- dest=toprec;
- while (*source) { /* Strip whitespace */
- *dest++ = *source++; /* Do not check first field */
- while (*source == ':') {
- check=source+1;
- while (*check && (isspace((unsigned char)*check) ||
- (*check=='\\' && isspace((unsigned char)check[1]))))
- ++check;
- if( *check == ':' )
- source=check;
- else
- break;
-
- }
- }
- *dest=0;
-
- return (0);
-}
-
-/*
- * Cgetcap searches the capability record buf for the capability cap with
- * type `type'. A pointer to the value of cap is returned on success, NULL
- * if the requested capability couldn't be found.
- *
- * Specifying a type of ':' means that nothing should follow cap (:cap:).
- * In this case a pointer to the terminating ':' or NUL will be returned if
- * cap is found.
- *
- * If (cap, '@') or (cap, terminator, '@') is found before (cap, terminator)
- * return NULL.
- */
-char *
-cgetcap(char *buf, const char *cap, int type)
-{
- char *bp;
- const char *cp;
-
- bp = buf;
- for (;;) {
- /*
- * Skip past the current capability field - it's either the
- * name field if this is the first time through the loop, or
- * the remainder of a field whose name failed to match cap.
- */
- for (;;)
- if (*bp == '\0')
- return (NULL);
- else
- if (*bp++ == ':')
- break;
-
- /*
- * Try to match (cap, type) in buf.
- */
- for (cp = cap; *cp == *bp && *bp != '\0'; cp++, bp++)
- continue;
- if (*cp != '\0')
- continue;
- if (*bp == '@')
- return (NULL);
- if (type == ':') {
- if (*bp != '\0' && *bp != ':')
- continue;
- return(bp);
- }
- if (*bp != type)
- continue;
- bp++;
- return (*bp == '@' ? NULL : bp);
- }
- /* NOTREACHED */
-}
-
-/*
- * Cgetent extracts the capability record name from the NULL terminated file
- * array db_array and returns a pointer to a malloc'd copy of it in buf.
- * Buf must be retained through all subsequent calls to cgetcap, cgetnum,
- * cgetflag, and cgetstr, but may then be free'd. 0 is returned on success,
- * -1 if the requested record couldn't be found, -2 if a system error was
- * encountered (couldn't open/read a file, etc.), and -3 if a potential
- * reference loop is detected.
- */
-int
-cgetent(char **buf, char **db_array, const char *name)
-{
- size_t dummy;
-
- return (getent(buf, &dummy, db_array, -1, name, 0, NULL));
-}
-
-/*
- * Getent implements the functions of cgetent. If fd is non-negative,
- * *db_array has already been opened and fd is the open file descriptor. We
- * do this to save time and avoid using up file descriptors for tc=
- * recursions.
- *
- * Getent returns the same success/failure codes as cgetent. On success, a
- * pointer to a malloc'ed capability record with all tc= capabilities fully
- * expanded and its length (not including trailing ASCII NUL) are left in
- * *cap and *len.
- *
- * Basic algorithm:
- * + Allocate memory incrementally as needed in chunks of size BFRAG
- * for capability buffer.
- * + Recurse for each tc=name and interpolate result. Stop when all
- * names interpolated, a name can't be found, or depth exceeds
- * MAX_RECURSION.
- */
-static int
-getent(char **cap, size_t *len, char **db_array, int fd,
- const char *name, int depth, char *nfield)
-{
- char *r_end, *rp = NULL, **db_p; /* pacify gcc */
- int myfd = 0, eof, foundit;
- char *record;
- int tc_not_resolved;
-
- /*
- * Return with ``loop detected'' error if we've recursed more than
- * MAX_RECURSION times.
- */
- if (depth > MAX_RECURSION)
- return (-3);
-
- /*
- * Check if we have a top record from cgetset().
- */
- if (depth == 0 && toprec != NULL && cgetmatch(toprec, name) == 0) {
- if ((record = malloc (topreclen + BFRAG)) == NULL) {
- errno = ENOMEM;
- return (-2);
- }
- (void)strcpy(record, toprec); /* XXX: strcpy is safe */
- db_p = db_array;
- rp = record + topreclen + 1;
- r_end = rp + BFRAG;
- goto tc_exp;
- }
- /*
- * Allocate first chunk of memory.
- */
- if ((record = malloc(BFRAG)) == NULL) {
- errno = ENOMEM;
- return (-2);
- }
- r_end = record + BFRAG;
- foundit = 0;
- /*
- * Loop through database array until finding the record.
- */
-
- for (db_p = db_array; *db_p != NULL; db_p++) {
- eof = 0;
-
- /*
- * Open database if not already open.
- */
-
- if (fd >= 0) {
- (void)lseek(fd, (off_t)0, SEEK_SET);
- } else {
-#ifdef USE_DB
- char pbuf[_POSIX_PATH_MAX];
- char *cbuf;
- size_t clen;
- int retval;
- DB *capdbp;
-
- (void)snprintf(pbuf, sizeof(pbuf), "%s.db", *db_p);
- if ((capdbp = dbopen(pbuf, O_RDONLY, 0, DB_HASH, 0))
- != NULL) {
- free(record);
- retval = cdbget(capdbp, &record, name);
- if (retval < 0) {
- /* no record available */
- (void)capdbp->close(capdbp);
- return (retval);
- }
- /* save the data; close frees it */
- clen = strlen(record);
- cbuf = malloc(clen + 1);
- memmove(cbuf, record, clen + 1);
- if (capdbp->close(capdbp) < 0) {
- free(cbuf);
- return (-2);
- }
- *len = clen;
- *cap = cbuf;
- return (retval);
- } else
-#endif
- {
- fd = open(*db_p, O_RDONLY, 0);
- if (fd < 0) {
- /* No error on unfound file. */
- continue;
- }
- myfd = 1;
- }
- }
- /*
- * Find the requested capability record ...
- */
- {
- char buf[BUFSIZ];
- char *b_end, *bp, *cp;
- int c, slash;
-
- /*
- * Loop invariants:
- * There is always room for one more character in record.
- * R_end always points just past end of record.
- * Rp always points just past last character in record.
- * B_end always points just past last character in buf.
- * Bp always points at next character in buf.
- * Cp remembers where the last colon was.
- */
- b_end = buf;
- bp = buf;
- cp = 0;
- slash = 0;
- for (;;) {
-
- /*
- * Read in a line implementing (\, newline)
- * line continuation.
- */
- rp = record;
- for (;;) {
- if (bp >= b_end) {
- int n;
-
- n = read(fd, buf, sizeof(buf));
- if (n <= 0) {
- if (myfd)
- (void)close(fd);
- if (n < 0) {
- free(record);
- return (-2);
- } else {
- fd = -1;
- eof = 1;
- break;
- }
- }
- b_end = buf+n;
- bp = buf;
- }
-
- c = *bp++;
- if (c == '\n') {
- if (slash) {
- slash = 0;
- rp--;
- continue;
- } else
- break;
- }
- if (slash) {
- slash = 0;
- cp = 0;
- }
- if (c == ':') {
- /*
- * If the field was `empty' (i.e.
- * contained only white space), back up
- * to the colon (eliminating the
- * field).
- */
- if (cp)
- rp = cp;
- else
- cp = rp;
- } else if (c == '\\') {
- slash = 1;
- } else if (c != ' ' && c != '\t') {
- /*
- * Forget where the colon was, as this
- * is not an empty field.
- */
- cp = 0;
- }
- *rp++ = c;
-
- /*
- * Enforce loop invariant: if no room
- * left in record buffer, try to get
- * some more.
- */
- if (rp >= r_end) {
- u_int pos;
- size_t newsize;
-
- pos = rp - record;
- newsize = r_end - record + BFRAG;
- record = realloc(record, newsize);
- if (record == NULL) {
- errno = ENOMEM;
- if (myfd)
- (void)close(fd);
- return (-2);
- }
- r_end = record + newsize;
- rp = record + pos;
- }
- }
- /* Eliminate any white space after the last colon. */
- if (cp)
- rp = cp + 1;
- /* Loop invariant lets us do this. */
- *rp++ = '\0';
-
- /*
- * If encountered eof check next file.
- */
- if (eof)
- break;
-
- /*
- * Toss blank lines and comments.
- */
- if (*record == '\0' || *record == '#')
- continue;
-
- /*
- * See if this is the record we want ...
- */
- if (cgetmatch(record, name) == 0) {
- if (nfield == NULL || !nfcmp(nfield, record)) {
- foundit = 1;
- break; /* found it! */
- }
- }
- }
- }
- if (foundit)
- break;
- }
-
- if (!foundit)
- return (-1);
-
- /*
- * Got the capability record, but now we have to expand all tc=name
- * references in it ...
- */
- tc_exp: {
- char *newicap, *s;
- size_t ilen, newilen;
- int diff, iret, tclen;
- char *icap, *scan, *tc, *tcstart, *tcend;
-
- /*
- * Loop invariants:
- * There is room for one more character in record.
- * R_end points just past end of record.
- * Rp points just past last character in record.
- * Scan points at remainder of record that needs to be
- * scanned for tc=name constructs.
- */
- scan = record;
- tc_not_resolved = 0;
- for (;;) {
- if ((tc = cgetcap(scan, "tc", '=')) == NULL)
- break;
-
- /*
- * Find end of tc=name and stomp on the trailing `:'
- * (if present) so we can use it to call ourselves.
- */
- s = tc;
- for (;;)
- if (*s == '\0')
- break;
- else
- if (*s++ == ':') {
- *(s - 1) = '\0';
- break;
- }
- tcstart = tc - 3;
- tclen = s - tcstart;
- tcend = s;
-
- iret = getent(&icap, &ilen, db_p, fd, tc, depth+1,
- NULL);
- newicap = icap; /* Put into a register. */
- newilen = ilen;
- if (iret != 0) {
- /* an error */
- if (iret < -1) {
- if (myfd)
- (void)close(fd);
- free(record);
- return (iret);
- }
- if (iret == 1)
- tc_not_resolved = 1;
- /* couldn't resolve tc */
- if (iret == -1) {
- *(s - 1) = ':';
- scan = s - 1;
- tc_not_resolved = 1;
- continue;
-
- }
- }
- /* not interested in name field of tc'ed record */
- s = newicap;
- for (;;)
- if (*s == '\0')
- break;
- else
- if (*s++ == ':')
- break;
- newilen -= s - newicap;
- newicap = s;
-
- /* make sure interpolated record is `:'-terminated */
- s += newilen;
- if (*(s-1) != ':') {
- *s = ':'; /* overwrite NUL with : */
- newilen++;
- }
-
- /*
- * Make sure there's enough room to insert the
- * new record.
- */
- diff = newilen - tclen;
- if (diff >= r_end - rp) {
- u_int pos, tcpos, tcposend;
- size_t newsize;
-
- pos = rp - record;
- newsize = r_end - record + diff + BFRAG;
- tcpos = tcstart - record;
- tcposend = tcend - record;
- record = realloc(record, newsize);
- if (record == NULL) {
- errno = ENOMEM;
- if (myfd)
- (void)close(fd);
- free(icap);
- return (-2);
- }
- r_end = record + newsize;
- rp = record + pos;
- tcstart = record + tcpos;
- tcend = record + tcposend;
- }
-
- /*
- * Insert tc'ed record into our record.
- */
- s = tcstart + newilen;
- memmove(s, tcend, (size_t)(rp - tcend));
- memmove(tcstart, newicap, newilen);
- rp += diff;
- free(icap);
-
- /*
- * Start scan on `:' so next cgetcap works properly
- * (cgetcap always skips first field).
- */
- scan = s-1;
- }
-
- }
- /*
- * Close file (if we opened it), give back any extra memory, and
- * return capability, length and success.
- */
- if (myfd)
- (void)close(fd);
- *len = rp - record - 1; /* don't count NUL */
- if (r_end > rp)
- if ((record =
- realloc(record, (size_t)(rp - record))) == NULL) {
- errno = ENOMEM;
- return (-2);
- }
-
- *cap = record;
- if (tc_not_resolved)
- return (1);
- return (0);
-}
-
-#ifdef USE_DB
-static int
-cdbget(DB *capdbp, char **bp, const char *name)
-{
- DBT key;
- DBT data;
-
- /* LINTED key is not modified */
- key.data = (char *)name;
- key.size = strlen(name);
-
- for (;;) {
- /* Get the reference. */
- switch(capdbp->get(capdbp, &key, &data, 0)) {
- case -1:
- return (-2);
- case 1:
- return (-1);
- }
-
- /* If not an index to another record, leave. */
- if (((char *)data.data)[0] != SHADOW)
- break;
-
- key.data = (char *)data.data + 1;
- key.size = data.size - 1;
- }
-
- *bp = (char *)data.data + 1;
- return (((char *)(data.data))[0] == TCERR ? 1 : 0);
-}
-#endif /* USE_DB */
-
-/*
- * Cgetmatch will return 0 if name is one of the names of the capability
- * record buf, -1 if not.
- */
-int
-cgetmatch(const char *buf, const char *name)
-{
- const char *np, *bp;
-
- /*
- * Start search at beginning of record.
- */
- bp = buf;
- for (;;) {
- /*
- * Try to match a record name.
- */
- np = name;
- for (;;)
- if (*np == '\0') {
- if (*bp == '|' || *bp == ':' || *bp == '\0')
- return (0);
- else
- break;
- } else
- if (*bp++ != *np++)
- break;
-
- /*
- * Match failed, skip to next name in record.
- */
- bp--; /* a '|' or ':' may have stopped the match */
- for (;;)
- if (*bp == '\0' || *bp == ':')
- return (-1); /* match failed totally */
- else
- if (*bp++ == '|')
- break; /* found next name */
- }
-}
-
-#if 0
-int
-cgetfirst(char **buf, char **db_array)
-{
- (void)cgetclose();
- return (cgetnext(buf, db_array));
-}
-#endif
-
-static FILE *pfp;
-static int slash;
-static char **dbp;
-
-int
-cgetclose(void)
-{
- if (pfp != NULL) {
- (void)fclose(pfp);
- pfp = NULL;
- }
- dbp = NULL;
- gottoprec = 0;
- slash = 0;
- return(0);
-}
-
-#if 0
-/*
- * Cgetnext() gets either the first or next entry in the logical database
- * specified by db_array. It returns 0 upon completion of the database, 1
- * upon returning an entry with more remaining, and -1 if an error occurs.
- */
-int
-cgetnext(char **bp, char **db_array)
-{
- size_t len;
- int status, done;
- char *cp, *line, *rp, *np, buf[BSIZE], nbuf[BSIZE];
- size_t dummy;
-
- if (dbp == NULL)
- dbp = db_array;
-
- if (pfp == NULL && (pfp = fopen(*dbp, "r")) == NULL) {
- (void)cgetclose();
- return (-1);
- }
- for(;;) {
- if (toprec && !gottoprec) {
- gottoprec = 1;
- line = toprec;
- } else {
- line = fgetln(pfp, &len);
- if (line == NULL && pfp) {
- if (ferror(pfp)) {
- (void)cgetclose();
- return (-1);
- } else {
- (void)fclose(pfp);
- pfp = NULL;
- if (*++dbp == NULL) {
- (void)cgetclose();
- return (0);
- } else if ((pfp =
- fopen(*dbp, "r")) == NULL) {
- (void)cgetclose();
- return (-1);
- } else
- continue;
- }
- } else
- line[len - 1] = '\0';
- if (len == 1) {
- slash = 0;
- continue;
- }
- if (isspace((unsigned char)*line) ||
- *line == ':' || *line == '#' || slash) {
- if (line[len - 2] == '\\')
- slash = 1;
- else
- slash = 0;
- continue;
- }
- if (line[len - 2] == '\\')
- slash = 1;
- else
- slash = 0;
- }
-
-
- /*
- * Line points to a name line.
- */
- done = 0;
- np = nbuf;
- for (;;) {
- for (cp = line; *cp != '\0'; cp++) {
- if (*cp == ':') {
- *np++ = ':';
- done = 1;
- break;
- }
- if (*cp == '\\')
- break;
- *np++ = *cp;
- }
- if (done) {
- *np = '\0';
- break;
- } else { /* name field extends beyond the line */
- line = fgetln(pfp, &len);
- if (line == NULL && pfp) {
- if (ferror(pfp)) {
- (void)cgetclose();
- return (-1);
- }
- (void)fclose(pfp);
- pfp = NULL;
- *np = '\0';
- break;
- } else
- line[len - 1] = '\0';
- }
- }
- rp = buf;
- for(cp = nbuf; *cp != '\0'; cp++)
- if (*cp == '|' || *cp == ':')
- break;
- else
- *rp++ = *cp;
-
- *rp = '\0';
- /*
- * XXX
- * Last argument of getent here should be nbuf if we want true
- * sequential access in the case of duplicates.
- * With NULL, getent will return the first entry found
- * rather than the duplicate entry record. This is a
- * matter of semantics that should be resolved.
- */
- status = getent(bp, &dummy, db_array, -1, buf, 0, NULL);
- if (status == -2 || status == -3)
- (void)cgetclose();
-
- return (status + 1);
- }
- /* NOTREACHED */
-}
-#endif
-
-/*
- * Cgetstr retrieves the value of the string capability cap from the
- * capability record pointed to by buf. A pointer to a decoded, NUL
- * terminated, malloc'd copy of the string is returned in the char *
- * pointed to by str. The length of the string not including the trailing
- * NUL is returned on success, -1 if the requested string capability
- * couldn't be found, -2 if a system error was encountered (storage
- * allocation failure).
- */
-int
-cgetstr(char *buf, const char *cap, char **str)
-{
- u_int m_room;
- const char *bp;
- char *mp;
- int len;
- char *mem;
-
- /*
- * Find string capability cap
- */
- bp = cgetcap(buf, cap, '=');
- if (bp == NULL)
- return (-1);
-
- /*
- * Conversion / storage allocation loop ... Allocate memory in
- * chunks SFRAG in size.
- */
- if ((mem = malloc(SFRAG)) == NULL) {
- errno = ENOMEM;
- return (-2); /* couldn't even allocate the first fragment */
- }
- m_room = SFRAG;
- mp = mem;
-
- while (*bp != ':' && *bp != '\0') {
- /*
- * Loop invariants:
- * There is always room for one more character in mem.
- * Mp always points just past last character in mem.
- * Bp always points at next character in buf.
- */
- if (*bp == '^') {
- bp++;
- if (*bp == ':' || *bp == '\0')
- break; /* drop unfinished escape */
- *mp++ = *bp++ & 037;
- } else if (*bp == '\\') {
- bp++;
- if (*bp == ':' || *bp == '\0')
- break; /* drop unfinished escape */
- if ('0' <= *bp && *bp <= '7') {
- int n, i;
-
- n = 0;
- i = 3; /* maximum of three octal digits */
- do {
- n = n * 8 + (*bp++ - '0');
- } while (--i && '0' <= *bp && *bp <= '7');
- *mp++ = n;
- }
- else switch (*bp++) {
- case 'b': case 'B':
- *mp++ = '\b';
- break;
- case 't': case 'T':
- *mp++ = '\t';
- break;
- case 'n': case 'N':
- *mp++ = '\n';
- break;
- case 'f': case 'F':
- *mp++ = '\f';
- break;
- case 'r': case 'R':
- *mp++ = '\r';
- break;
- case 'e': case 'E':
- *mp++ = ESC;
- break;
- case 'c': case 'C':
- *mp++ = ':';
- break;
- default:
- /*
- * Catches '\', '^', and
- * everything else.
- */
- *mp++ = *(bp-1);
- break;
- }
- } else
- *mp++ = *bp++;
- m_room--;
-
- /*
- * Enforce loop invariant: if no room left in current
- * buffer, try to get some more.
- */
- if (m_room == 0) {
- size_t size = mp - mem;
-
- if ((mem = realloc(mem, size + SFRAG)) == NULL)
- return (-2);
- m_room = SFRAG;
- mp = mem + size;
- }
- }
- *mp++ = '\0'; /* loop invariant let's us do this */
- m_room--;
- len = mp - mem - 1;
-
- /*
- * Give back any extra memory and return value and success.
- */
- if (m_room != 0)
- if ((mem = realloc(mem, (size_t)(mp - mem))) == NULL)
- return (-2);
- *str = mem;
- return (len);
-}
-
-/*
- * Cgetustr retrieves the value of the string capability cap from the
- * capability record pointed to by buf. The difference between cgetustr()
- * and cgetstr() is that cgetustr does not decode escapes but rather treats
- * all characters literally. A pointer to a NUL terminated malloc'd
- * copy of the string is returned in the char pointed to by str. The
- * length of the string not including the trailing NUL is returned on success,
- * -1 if the requested string capability couldn't be found, -2 if a system
- * error was encountered (storage allocation failure).
- */
-int
-cgetustr(char *buf, const char *cap, char **str)
-{
- u_int m_room;
- const char *bp;
- char *mp;
- int len;
- char *mem;
-
- /*
- * Find string capability cap
- */
- if ((bp = cgetcap(buf, cap, '=')) == NULL)
- return (-1);
-
- /*
- * Conversion / storage allocation loop ... Allocate memory in
- * chunks SFRAG in size.
- */
- if ((mem = malloc(SFRAG)) == NULL) {
- errno = ENOMEM;
- return (-2); /* couldn't even allocate the first fragment */
- }
- m_room = SFRAG;
- mp = mem;
-
- while (*bp != ':' && *bp != '\0') {
- /*
- * Loop invariants:
- * There is always room for one more character in mem.
- * Mp always points just past last character in mem.
- * Bp always points at next character in buf.
- */
- *mp++ = *bp++;
- m_room--;
-
- /*
- * Enforce loop invariant: if no room left in current
- * buffer, try to get some more.
- */
- if (m_room == 0) {
- size_t size = mp - mem;
-
- if ((mem = realloc(mem, size + SFRAG)) == NULL)
- return (-2);
- m_room = SFRAG;
- mp = mem + size;
- }
- }
- *mp++ = '\0'; /* loop invariant let's us do this */
- m_room--;
- len = mp - mem - 1;
-
- /*
- * Give back any extra memory and return value and success.
- */
- if (m_room != 0)
- if ((mem = realloc(mem, (size_t)(mp - mem))) == NULL)
- return (-2);
- *str = mem;
- return (len);
-}
-
-/*
- * Cgetnum retrieves the value of the numeric capability cap from the
- * capability record pointed to by buf. The numeric value is returned in
- * the long pointed to by num. 0 is returned on success, -1 if the requested
- * numeric capability couldn't be found.
- */
-int
-cgetnum(char *buf, const char *cap, long *num)
-{
- long n;
- int base, digit;
- const char *bp;
-
- /*
- * Find numeric capability cap
- */
- bp = cgetcap(buf, cap, '#');
- if (bp == NULL)
- return (-1);
-
- /*
- * Look at value and determine numeric base:
- * 0x... or 0X... hexadecimal,
- * else 0... octal,
- * else decimal.
- */
- if (*bp == '0') {
- bp++;
- if (*bp == 'x' || *bp == 'X') {
- bp++;
- base = 16;
- } else
- base = 8;
- } else
- base = 10;
-
- /*
- * Conversion loop ...
- */
- n = 0;
- for (;;) {
- if ('0' <= *bp && *bp <= '9')
- digit = *bp - '0';
- else if ('a' <= *bp && *bp <= 'f')
- digit = 10 + *bp - 'a';
- else if ('A' <= *bp && *bp <= 'F')
- digit = 10 + *bp - 'A';
- else
- break;
-
- if (digit >= base)
- break;
-
- n = n * base + digit;
- bp++;
- }
-
- /*
- * Return value and success.
- */
- *num = n;
- return (0);
-}
-
-
-/*
- * Compare name field of record.
- */
-static int
-nfcmp(char *nf, char *rec)
-{
- char *cp, tmp;
- int ret;
-
- for (cp = rec; *cp != ':'; cp++)
- ;
-
- tmp = *(cp + 1);
- *(cp + 1) = '\0';
- ret = strcmp(nf, rec);
- *(cp + 1) = tmp;
-
- return (ret);
-}
diff --git a/crypto/kerberosIV/lib/roken/getegid.c b/crypto/kerberosIV/lib/roken/getegid.c
deleted file mode 100644
index b6eab857e41ac..0000000000000
--- a/crypto/kerberosIV/lib/roken/getegid.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "roken.h"
-
-#ifndef HAVE_GETEGID
-
-RCSID("$Id: getegid.c,v 1.2 1999/12/02 16:58:46 joda Exp $");
-
-int getegid(void)
-{
- return getgid();
-}
-
-#endif
diff --git a/crypto/kerberosIV/lib/roken/geteuid.c b/crypto/kerberosIV/lib/roken/geteuid.c
deleted file mode 100644
index 4bdf531bf921d..0000000000000
--- a/crypto/kerberosIV/lib/roken/geteuid.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "roken.h"
-
-#ifndef HAVE_GETEUID
-
-RCSID("$Id: geteuid.c,v 1.2 1999/12/02 16:58:46 joda Exp $");
-
-int geteuid(void)
-{
- return getuid();
-}
-
-#endif
diff --git a/crypto/kerberosIV/lib/roken/getgid.c b/crypto/kerberosIV/lib/roken/getgid.c
deleted file mode 100644
index f2ca01a69982c..0000000000000
--- a/crypto/kerberosIV/lib/roken/getgid.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "roken.h"
-
-#ifndef HAVE_GETGID
-
-RCSID("$Id: getgid.c,v 1.2 1999/12/02 16:58:46 joda Exp $");
-
-int getgid(void)
-{
- return 17;
-}
-
-#endif
diff --git a/crypto/kerberosIV/lib/roken/gethostname.c b/crypto/kerberosIV/lib/roken/gethostname.c
deleted file mode 100644
index 753ba9f1b6b9d..0000000000000
--- a/crypto/kerberosIV/lib/roken/gethostname.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "roken.h"
-
-#ifndef HAVE_GETHOSTNAME
-
-#ifdef HAVE_SYS_UTSNAME_H
-#include <sys/utsname.h>
-#endif
-
-/*
- * Return the local host's name in "name", up to "namelen" characters.
- * "name" will be null-terminated if "namelen" is big enough.
- * The return code is 0 on success, -1 on failure. (The calling
- * interface is identical to gethostname(2).)
- */
-
-int
-gethostname(char *name, int namelen)
-{
-#if defined(HAVE_UNAME)
- {
- struct utsname utsname;
- int ret;
-
- ret = uname (&utsname);
- if (ret < 0)
- return ret;
- strlcpy (name, utsname.nodename, namelen);
- return 0;
- }
-#else
- strlcpy (name, "some.random.host", namelen);
- return 0;
-#endif
-}
-
-#endif /* GETHOSTNAME */
diff --git a/crypto/kerberosIV/lib/roken/getipnodebyaddr.c b/crypto/kerberosIV/lib/roken/getipnodebyaddr.c
deleted file mode 100644
index f22aad7f73cb2..0000000000000
--- a/crypto/kerberosIV/lib/roken/getipnodebyaddr.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: getipnodebyaddr.c,v 1.2 1999/12/02 16:58:46 joda Exp $");
-#endif
-
-#include "roken.h"
-
-/*
- * lookup `src, len' (address family `af') in DNS and return a pointer
- * to a malloced struct hostent or NULL.
- */
-
-struct hostent *
-getipnodebyaddr (const void *src, size_t len, int af, int *error_num)
-{
- struct hostent *tmp;
-
- tmp = gethostbyaddr (src, len, af);
- if (tmp == NULL) {
- switch (h_errno) {
- case HOST_NOT_FOUND :
- case TRY_AGAIN :
- case NO_RECOVERY :
- *error_num = h_errno;
- break;
- case NO_DATA :
- *error_num = NO_ADDRESS;
- break;
- default :
- *error_num = NO_RECOVERY;
- break;
- }
- return NULL;
- }
- tmp = copyhostent (tmp);
- if (tmp == NULL) {
- *error_num = TRY_AGAIN;
- return NULL;
- }
- return tmp;
-}
diff --git a/crypto/kerberosIV/lib/roken/getipnodebyname.c b/crypto/kerberosIV/lib/roken/getipnodebyname.c
deleted file mode 100644
index 576feef0aea65..0000000000000
--- a/crypto/kerberosIV/lib/roken/getipnodebyname.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: getipnodebyname.c,v 1.3 1999/12/02 16:58:46 joda Exp $");
-#endif
-
-#include "roken.h"
-
-#ifndef HAVE_H_ERRNO
-static int h_errno = NO_RECOVERY;
-#endif
-
-/*
- * lookup `name' (address family `af') in DNS and return a pointer
- * to a malloced struct hostent or NULL.
- */
-
-struct hostent *
-getipnodebyname (const char *name, int af, int flags, int *error_num)
-{
- struct hostent *tmp;
-
-#ifdef HAVE_GETHOSTBYNAME2
- tmp = gethostbyname2 (name, af);
-#else
- if (af != AF_INET) {
- *error_num = NO_ADDRESS;
- return NULL;
- }
- tmp = gethostbyname (name);
-#endif
- if (tmp == NULL) {
- switch (h_errno) {
- case HOST_NOT_FOUND :
- case TRY_AGAIN :
- case NO_RECOVERY :
- *error_num = h_errno;
- break;
- case NO_DATA :
- *error_num = NO_ADDRESS;
- break;
- default :
- *error_num = NO_RECOVERY;
- break;
- }
- return NULL;
- }
- tmp = copyhostent (tmp);
- if (tmp == NULL) {
- *error_num = TRY_AGAIN;
- return NULL;
- }
- return tmp;
-}
diff --git a/crypto/kerberosIV/lib/roken/gettimeofday.c b/crypto/kerberosIV/lib/roken/gettimeofday.c
deleted file mode 100644
index ec8b62f64e768..0000000000000
--- a/crypto/kerberosIV/lib/roken/gettimeofday.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "roken.h"
-#ifndef HAVE_GETTIMEOFDAY
-
-RCSID("$Id: gettimeofday.c,v 1.8 1999/12/02 16:58:46 joda Exp $");
-
-/*
- * Simple gettimeofday that only returns seconds.
- */
-int
-gettimeofday (struct timeval *tp, void *ignore)
-{
- time_t t;
-
- t = time(NULL);
- tp->tv_sec = t;
- tp->tv_usec = 0;
- return 0;
-}
-#endif
diff --git a/crypto/kerberosIV/lib/roken/getuid.c b/crypto/kerberosIV/lib/roken/getuid.c
deleted file mode 100644
index 6ebce0a810cd9..0000000000000
--- a/crypto/kerberosIV/lib/roken/getuid.c
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "roken.h"
-
-#ifndef HAVE_GETUID
-
-RCSID("$Id: getuid.c,v 1.3 1999/12/02 16:58:46 joda Exp $");
-
-int getuid(void)
-{
- return 17;
-}
-
-#endif
diff --git a/crypto/kerberosIV/lib/roken/glob.c b/crypto/kerberosIV/lib/roken/glob.c
deleted file mode 100644
index 66e8ec6db8cbd..0000000000000
--- a/crypto/kerberosIV/lib/roken/glob.c
+++ /dev/null
@@ -1,835 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Guido van Rossum.
- *
- * 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- */
-
-/*
- * glob(3) -- a superset of the one defined in POSIX 1003.2.
- *
- * The [!...] convention to negate a range is supported (SysV, Posix, ksh).
- *
- * Optional extra services, controlled by flags not defined by POSIX:
- *
- * GLOB_QUOTE:
- * Escaping convention: \ inhibits any special meaning the following
- * character might have (except \ at end of string is retained).
- * GLOB_MAGCHAR:
- * Set in gl_flags if pattern contained a globbing character.
- * GLOB_NOMAGIC:
- * Same as GLOB_NOCHECK, but it will only append pattern if it did
- * not contain any magic characters. [Used in csh style globbing]
- * GLOB_ALTDIRFUNC:
- * Use alternately specified directory access functions.
- * GLOB_TILDE:
- * expand ~user/foo to the /home/dir/of/user/foo
- * GLOB_BRACE:
- * expand {1,2}{a,b} to 1a 1b 2a 2b
- * gl_matchc:
- * Number of matches in the current invocation of glob.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-
-#include <ctype.h>
-#ifdef HAVE_DIRENT_H
-#include <dirent.h>
-#endif
-#include <errno.h>
-#ifdef HAVE_PWD_H
-#include <pwd.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-
-#include "glob.h"
-#include "roken.h"
-
-#define CHAR_DOLLAR '$'
-#define CHAR_DOT '.'
-#define CHAR_EOS '\0'
-#define CHAR_LBRACKET '['
-#define CHAR_NOT '!'
-#define CHAR_QUESTION '?'
-#define CHAR_QUOTE '\\'
-#define CHAR_RANGE '-'
-#define CHAR_RBRACKET ']'
-#define CHAR_SEP '/'
-#define CHAR_STAR '*'
-#define CHAR_TILDE '~'
-#define CHAR_UNDERSCORE '_'
-#define CHAR_LBRACE '{'
-#define CHAR_RBRACE '}'
-#define CHAR_SLASH '/'
-#define CHAR_COMMA ','
-
-#ifndef DEBUG
-
-#define M_QUOTE 0x8000
-#define M_PROTECT 0x4000
-#define M_MASK 0xffff
-#define M_ASCII 0x00ff
-
-typedef u_short Char;
-
-#else
-
-#define M_QUOTE 0x80
-#define M_PROTECT 0x40
-#define M_MASK 0xff
-#define M_ASCII 0x7f
-
-typedef char Char;
-
-#endif
-
-
-#define CHAR(c) ((Char)((c)&M_ASCII))
-#define META(c) ((Char)((c)|M_QUOTE))
-#define M_ALL META('*')
-#define M_END META(']')
-#define M_NOT META('!')
-#define M_ONE META('?')
-#define M_RNG META('-')
-#define M_SET META('[')
-#define ismeta(c) (((c)&M_QUOTE) != 0)
-
-
-static int compare (const void *, const void *);
-static void g_Ctoc (const Char *, char *);
-static int g_lstat (Char *, struct stat *, glob_t *);
-static DIR *g_opendir (Char *, glob_t *);
-static Char *g_strchr (Char *, int);
-#ifdef notdef
-static Char *g_strcat (Char *, const Char *);
-#endif
-static int g_stat (Char *, struct stat *, glob_t *);
-static int glob0 (const Char *, glob_t *);
-static int glob1 (Char *, glob_t *);
-static int glob2 (Char *, Char *, Char *, glob_t *);
-static int glob3 (Char *, Char *, Char *, Char *, glob_t *);
-static int globextend (const Char *, glob_t *);
-static const Char * globtilde (const Char *, Char *, glob_t *);
-static int globexp1 (const Char *, glob_t *);
-static int globexp2 (const Char *, const Char *, glob_t *, int *);
-static int match (Char *, Char *, Char *);
-#ifdef DEBUG
-static void qprintf (const char *, Char *);
-#endif
-
-int
-glob(const char *pattern,
- int flags,
- int (*errfunc)(const char *, int),
- glob_t *pglob)
-{
- const u_char *patnext;
- int c;
- Char *bufnext, *bufend, patbuf[MaxPathLen+1];
-
- patnext = (u_char *) pattern;
- if (!(flags & GLOB_APPEND)) {
- pglob->gl_pathc = 0;
- pglob->gl_pathv = NULL;
- if (!(flags & GLOB_DOOFFS))
- pglob->gl_offs = 0;
- }
- pglob->gl_flags = flags & ~GLOB_MAGCHAR;
- pglob->gl_errfunc = errfunc;
- pglob->gl_matchc = 0;
-
- bufnext = patbuf;
- bufend = bufnext + MaxPathLen;
- if (flags & GLOB_QUOTE) {
- /* Protect the quoted characters. */
- while (bufnext < bufend && (c = *patnext++) != CHAR_EOS)
- if (c == CHAR_QUOTE) {
- if ((c = *patnext++) == CHAR_EOS) {
- c = CHAR_QUOTE;
- --patnext;
- }
- *bufnext++ = c | M_PROTECT;
- }
- else
- *bufnext++ = c;
- }
- else
- while (bufnext < bufend && (c = *patnext++) != CHAR_EOS)
- *bufnext++ = c;
- *bufnext = CHAR_EOS;
-
- if (flags & GLOB_BRACE)
- return globexp1(patbuf, pglob);
- else
- return glob0(patbuf, pglob);
-}
-
-/*
- * Expand recursively a glob {} pattern. When there is no more expansion
- * invoke the standard globbing routine to glob the rest of the magic
- * characters
- */
-static int globexp1(const Char *pattern, glob_t *pglob)
-{
- const Char* ptr = pattern;
- int rv;
-
- /* Protect a single {}, for find(1), like csh */
- if (pattern[0] == CHAR_LBRACE && pattern[1] == CHAR_RBRACE && pattern[2] == CHAR_EOS)
- return glob0(pattern, pglob);
-
- while ((ptr = (const Char *) g_strchr((Char *) ptr, CHAR_LBRACE)) != NULL)
- if (!globexp2(ptr, pattern, pglob, &rv))
- return rv;
-
- return glob0(pattern, pglob);
-}
-
-
-/*
- * Recursive brace globbing helper. Tries to expand a single brace.
- * If it succeeds then it invokes globexp1 with the new pattern.
- * If it fails then it tries to glob the rest of the pattern and returns.
- */
-static int globexp2(const Char *ptr, const Char *pattern,
- glob_t *pglob, int *rv)
-{
- int i;
- Char *lm, *ls;
- const Char *pe, *pm, *pl;
- Char patbuf[MaxPathLen + 1];
-
- /* copy part up to the brace */
- for (lm = patbuf, pm = pattern; pm != ptr; *lm++ = *pm++)
- continue;
- ls = lm;
-
- /* Find the balanced brace */
- for (i = 0, pe = ++ptr; *pe; pe++)
- if (*pe == CHAR_LBRACKET) {
- /* Ignore everything between [] */
- for (pm = pe++; *pe != CHAR_RBRACKET && *pe != CHAR_EOS; pe++)
- continue;
- if (*pe == CHAR_EOS) {
- /*
- * We could not find a matching CHAR_RBRACKET.
- * Ignore and just look for CHAR_RBRACE
- */
- pe = pm;
- }
- }
- else if (*pe == CHAR_LBRACE)
- i++;
- else if (*pe == CHAR_RBRACE) {
- if (i == 0)
- break;
- i--;
- }
-
- /* Non matching braces; just glob the pattern */
- if (i != 0 || *pe == CHAR_EOS) {
- *rv = glob0(patbuf, pglob);
- return 0;
- }
-
- for (i = 0, pl = pm = ptr; pm <= pe; pm++)
- switch (*pm) {
- case CHAR_LBRACKET:
- /* Ignore everything between [] */
- for (pl = pm++; *pm != CHAR_RBRACKET && *pm != CHAR_EOS; pm++)
- continue;
- if (*pm == CHAR_EOS) {
- /*
- * We could not find a matching CHAR_RBRACKET.
- * Ignore and just look for CHAR_RBRACE
- */
- pm = pl;
- }
- break;
-
- case CHAR_LBRACE:
- i++;
- break;
-
- case CHAR_RBRACE:
- if (i) {
- i--;
- break;
- }
- /* FALLTHROUGH */
- case CHAR_COMMA:
- if (i && *pm == CHAR_COMMA)
- break;
- else {
- /* Append the current string */
- for (lm = ls; (pl < pm); *lm++ = *pl++)
- continue;
- /*
- * Append the rest of the pattern after the
- * closing brace
- */
- for (pl = pe + 1; (*lm++ = *pl++) != CHAR_EOS;)
- continue;
-
- /* Expand the current pattern */
-#ifdef DEBUG
- qprintf("globexp2:", patbuf);
-#endif
- *rv = globexp1(patbuf, pglob);
-
- /* move after the comma, to the next string */
- pl = pm + 1;
- }
- break;
-
- default:
- break;
- }
- *rv = 0;
- return 0;
-}
-
-
-
-/*
- * expand tilde from the passwd file.
- */
-static const Char *
-globtilde(const Char *pattern, Char *patbuf, glob_t *pglob)
-{
- struct passwd *pwd;
- char *h;
- const Char *p;
- Char *b;
-
- if (*pattern != CHAR_TILDE || !(pglob->gl_flags & GLOB_TILDE))
- return pattern;
-
- /* Copy up to the end of the string or / */
- for (p = pattern + 1, h = (char *) patbuf; *p && *p != CHAR_SLASH;
- *h++ = *p++)
- continue;
-
- *h = CHAR_EOS;
-
- if (((char *) patbuf)[0] == CHAR_EOS) {
- /*
- * handle a plain ~ or ~/ by expanding $HOME
- * first and then trying the password file
- */
- if ((h = getenv("HOME")) == NULL) {
- if ((pwd = k_getpwuid(getuid())) == NULL)
- return pattern;
- else
- h = pwd->pw_dir;
- }
- }
- else {
- /*
- * Expand a ~user
- */
- if ((pwd = k_getpwnam((char*) patbuf)) == NULL)
- return pattern;
- else
- h = pwd->pw_dir;
- }
-
- /* Copy the home directory */
- for (b = patbuf; *h; *b++ = *h++)
- continue;
-
- /* Append the rest of the pattern */
- while ((*b++ = *p++) != CHAR_EOS)
- continue;
-
- return patbuf;
-}
-
-
-/*
- * The main glob() routine: compiles the pattern (optionally processing
- * quotes), calls glob1() to do the real pattern matching, and finally
- * sorts the list (unless unsorted operation is requested). Returns 0
- * if things went well, nonzero if errors occurred. It is not an error
- * to find no matches.
- */
-static int
-glob0(const Char *pattern, glob_t *pglob)
-{
- const Char *qpatnext;
- int c, err, oldpathc;
- Char *bufnext, patbuf[MaxPathLen+1];
-
- qpatnext = globtilde(pattern, patbuf, pglob);
- oldpathc = pglob->gl_pathc;
- bufnext = patbuf;
-
- /* We don't need to check for buffer overflow any more. */
- while ((c = *qpatnext++) != CHAR_EOS) {
- switch (c) {
- case CHAR_LBRACKET:
- c = *qpatnext;
- if (c == CHAR_NOT)
- ++qpatnext;
- if (*qpatnext == CHAR_EOS ||
- g_strchr((Char *) qpatnext+1, CHAR_RBRACKET) == NULL) {
- *bufnext++ = CHAR_LBRACKET;
- if (c == CHAR_NOT)
- --qpatnext;
- break;
- }
- *bufnext++ = M_SET;
- if (c == CHAR_NOT)
- *bufnext++ = M_NOT;
- c = *qpatnext++;
- do {
- *bufnext++ = CHAR(c);
- if (*qpatnext == CHAR_RANGE &&
- (c = qpatnext[1]) != CHAR_RBRACKET) {
- *bufnext++ = M_RNG;
- *bufnext++ = CHAR(c);
- qpatnext += 2;
- }
- } while ((c = *qpatnext++) != CHAR_RBRACKET);
- pglob->gl_flags |= GLOB_MAGCHAR;
- *bufnext++ = M_END;
- break;
- case CHAR_QUESTION:
- pglob->gl_flags |= GLOB_MAGCHAR;
- *bufnext++ = M_ONE;
- break;
- case CHAR_STAR:
- pglob->gl_flags |= GLOB_MAGCHAR;
- /* collapse adjacent stars to one,
- * to avoid exponential behavior
- */
- if (bufnext == patbuf || bufnext[-1] != M_ALL)
- *bufnext++ = M_ALL;
- break;
- default:
- *bufnext++ = CHAR(c);
- break;
- }
- }
- *bufnext = CHAR_EOS;
-#ifdef DEBUG
- qprintf("glob0:", patbuf);
-#endif
-
- if ((err = glob1(patbuf, pglob)) != 0)
- return(err);
-
- /*
- * If there was no match we are going to append the pattern
- * if GLOB_NOCHECK was specified or if GLOB_NOMAGIC was specified
- * and the pattern did not contain any magic characters
- * GLOB_NOMAGIC is there just for compatibility with csh.
- */
- if (pglob->gl_pathc == oldpathc &&
- ((pglob->gl_flags & GLOB_NOCHECK) ||
- ((pglob->gl_flags & GLOB_NOMAGIC) &&
- !(pglob->gl_flags & GLOB_MAGCHAR))))
- return(globextend(pattern, pglob));
- else if (!(pglob->gl_flags & GLOB_NOSORT))
- qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc,
- pglob->gl_pathc - oldpathc, sizeof(char *), compare);
- return(0);
-}
-
-static int
-compare(const void *p, const void *q)
-{
- return(strcmp(*(char **)p, *(char **)q));
-}
-
-static int
-glob1(Char *pattern, glob_t *pglob)
-{
- Char pathbuf[MaxPathLen+1];
-
- /* A null pathname is invalid -- POSIX 1003.1 sect. 2.4. */
- if (*pattern == CHAR_EOS)
- return(0);
- return(glob2(pathbuf, pathbuf, pattern, pglob));
-}
-
-/*
- * The functions glob2 and glob3 are mutually recursive; there is one level
- * of recursion for each segment in the pattern that contains one or more
- * meta characters.
- */
-
-#ifndef S_ISLNK
-#if defined(S_IFLNK) && defined(S_IFMT)
-#define S_ISLNK(mode) (((mode) & S_IFMT) == S_IFLNK)
-#else
-#define S_ISLNK(mode) 0
-#endif
-#endif
-
-static int
-glob2(Char *pathbuf, Char *pathend, Char *pattern, glob_t *pglob)
-{
- struct stat sb;
- Char *p, *q;
- int anymeta;
-
- /*
- * Loop over pattern segments until end of pattern or until
- * segment with meta character found.
- */
- for (anymeta = 0;;) {
- if (*pattern == CHAR_EOS) { /* End of pattern? */
- *pathend = CHAR_EOS;
- if (g_lstat(pathbuf, &sb, pglob))
- return(0);
-
- if (((pglob->gl_flags & GLOB_MARK) &&
- pathend[-1] != CHAR_SEP) && (S_ISDIR(sb.st_mode)
- || (S_ISLNK(sb.st_mode) &&
- (g_stat(pathbuf, &sb, pglob) == 0) &&
- S_ISDIR(sb.st_mode)))) {
- *pathend++ = CHAR_SEP;
- *pathend = CHAR_EOS;
- }
- ++pglob->gl_matchc;
- return(globextend(pathbuf, pglob));
- }
-
- /* Find end of next segment, copy tentatively to pathend. */
- q = pathend;
- p = pattern;
- while (*p != CHAR_EOS && *p != CHAR_SEP) {
- if (ismeta(*p))
- anymeta = 1;
- *q++ = *p++;
- }
-
- if (!anymeta) { /* No expansion, do next segment. */
- pathend = q;
- pattern = p;
- while (*pattern == CHAR_SEP)
- *pathend++ = *pattern++;
- } else /* Need expansion, recurse. */
- return(glob3(pathbuf, pathend, pattern, p, pglob));
- }
- /* CHAR_NOTREACHED */
-}
-
-static int
-glob3(Char *pathbuf, Char *pathend, Char *pattern, Char *restpattern,
- glob_t *pglob)
-{
- struct dirent *dp;
- DIR *dirp;
- int err;
- char buf[MaxPathLen];
-
- /*
- * The readdirfunc declaration can't be prototyped, because it is
- * assigned, below, to two functions which are prototyped in glob.h
- * and dirent.h as taking pointers to differently typed opaque
- * structures.
- */
- struct dirent *(*readdirfunc)(void *);
-
- *pathend = CHAR_EOS;
- errno = 0;
-
- if ((dirp = g_opendir(pathbuf, pglob)) == NULL) {
- /* TODO: don't call for ENOENT or ENOTDIR? */
- if (pglob->gl_errfunc) {
- g_Ctoc(pathbuf, buf);
- if (pglob->gl_errfunc(buf, errno) ||
- pglob->gl_flags & GLOB_ERR)
- return (GLOB_ABEND);
- }
- return(0);
- }
-
- err = 0;
-
- /* Search directory for matching names. */
- if (pglob->gl_flags & GLOB_ALTDIRFUNC)
- readdirfunc = pglob->gl_readdir;
- else
- readdirfunc = (struct dirent *(*)(void *))readdir;
- while ((dp = (*readdirfunc)(dirp))) {
- u_char *sc;
- Char *dc;
-
- /* Initial CHAR_DOT must be matched literally. */
- if (dp->d_name[0] == CHAR_DOT && *pattern != CHAR_DOT)
- continue;
- for (sc = (u_char *) dp->d_name, dc = pathend;
- (*dc++ = *sc++) != CHAR_EOS;)
- continue;
- if (!match(pathend, pattern, restpattern)) {
- *pathend = CHAR_EOS;
- continue;
- }
- err = glob2(pathbuf, --dc, restpattern, pglob);
- if (err)
- break;
- }
-
- if (pglob->gl_flags & GLOB_ALTDIRFUNC)
- (*pglob->gl_closedir)(dirp);
- else
- closedir(dirp);
- return(err);
-}
-
-
-/*
- * Extend the gl_pathv member of a glob_t structure to accomodate a new item,
- * add the new item, and update gl_pathc.
- *
- * This assumes the BSD realloc, which only copies the block when its size
- * crosses a power-of-two boundary; for v7 realloc, this would cause quadratic
- * behavior.
- *
- * Return 0 if new item added, error code if memory couldn't be allocated.
- *
- * Invariant of the glob_t structure:
- * Either gl_pathc is zero and gl_pathv is NULL; or gl_pathc > 0 and
- * gl_pathv points to (gl_offs + gl_pathc + 1) items.
- */
-static int
-globextend(const Char *path, glob_t *pglob)
-{
- char **pathv;
- int i;
- u_int newsize;
- char *copy;
- const Char *p;
-
- newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs);
- pathv = pglob->gl_pathv ?
- realloc(pglob->gl_pathv, newsize) :
- malloc(newsize);
- if (pathv == NULL)
- return(GLOB_NOSPACE);
-
- if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) {
- /* first time around -- clear initial gl_offs items */
- pathv += pglob->gl_offs;
- for (i = pglob->gl_offs; --i >= 0; )
- *--pathv = NULL;
- }
- pglob->gl_pathv = pathv;
-
- for (p = path; *p++;)
- continue;
- if ((copy = malloc(p - path)) != NULL) {
- g_Ctoc(path, copy);
- pathv[pglob->gl_offs + pglob->gl_pathc++] = copy;
- }
- pathv[pglob->gl_offs + pglob->gl_pathc] = NULL;
- return(copy == NULL ? GLOB_NOSPACE : 0);
-}
-
-
-/*
- * pattern matching function for filenames. Each occurrence of the *
- * pattern causes a recursion level.
- */
-static int
-match(Char *name, Char *pat, Char *patend)
-{
- int ok, negate_range;
- Char c, k;
-
- while (pat < patend) {
- c = *pat++;
- switch (c & M_MASK) {
- case M_ALL:
- if (pat == patend)
- return(1);
- do
- if (match(name, pat, patend))
- return(1);
- while (*name++ != CHAR_EOS);
- return(0);
- case M_ONE:
- if (*name++ == CHAR_EOS)
- return(0);
- break;
- case M_SET:
- ok = 0;
- if ((k = *name++) == CHAR_EOS)
- return(0);
- if ((negate_range = ((*pat & M_MASK) == M_NOT)) != CHAR_EOS)
- ++pat;
- while (((c = *pat++) & M_MASK) != M_END)
- if ((*pat & M_MASK) == M_RNG) {
- if (c <= k && k <= pat[1])
- ok = 1;
- pat += 2;
- } else if (c == k)
- ok = 1;
- if (ok == negate_range)
- return(0);
- break;
- default:
- if (*name++ != c)
- return(0);
- break;
- }
- }
- return(*name == CHAR_EOS);
-}
-
-/* Free allocated data belonging to a glob_t structure. */
-void
-globfree(glob_t *pglob)
-{
- int i;
- char **pp;
-
- if (pglob->gl_pathv != NULL) {
- pp = pglob->gl_pathv + pglob->gl_offs;
- for (i = pglob->gl_pathc; i--; ++pp)
- if (*pp)
- free(*pp);
- free(pglob->gl_pathv);
- }
-}
-
-static DIR *
-g_opendir(Char *str, glob_t *pglob)
-{
- char buf[MaxPathLen];
-
- if (!*str)
- strlcpy(buf, ".", sizeof(buf));
- else
- g_Ctoc(str, buf);
-
- if (pglob->gl_flags & GLOB_ALTDIRFUNC)
- return((*pglob->gl_opendir)(buf));
-
- return(opendir(buf));
-}
-
-static int
-g_lstat(Char *fn, struct stat *sb, glob_t *pglob)
-{
- char buf[MaxPathLen];
-
- g_Ctoc(fn, buf);
- if (pglob->gl_flags & GLOB_ALTDIRFUNC)
- return((*pglob->gl_lstat)(buf, sb));
- return(lstat(buf, sb));
-}
-
-static int
-g_stat(Char *fn, struct stat *sb, glob_t *pglob)
-{
- char buf[MaxPathLen];
-
- g_Ctoc(fn, buf);
- if (pglob->gl_flags & GLOB_ALTDIRFUNC)
- return((*pglob->gl_stat)(buf, sb));
- return(stat(buf, sb));
-}
-
-static Char *
-g_strchr(Char *str, int ch)
-{
- do {
- if (*str == ch)
- return (str);
- } while (*str++);
- return (NULL);
-}
-
-#ifdef notdef
-static Char *
-g_strcat(Char *dst, const Char *src)
-{
- Char *sdst = dst;
-
- while (*dst++)
- continue;
- --dst;
- while((*dst++ = *src++) != CHAR_EOS)
- continue;
-
- return (sdst);
-}
-#endif
-
-static void
-g_Ctoc(const Char *str, char *buf)
-{
- char *dc;
-
- for (dc = buf; (*dc++ = *str++) != CHAR_EOS;)
- continue;
-}
-
-#ifdef DEBUG
-static void
-qprintf(const Char *str, Char *s)
-{
- Char *p;
-
- printf("%s:\n", str);
- for (p = s; *p; p++)
- printf("%c", CHAR(*p));
- printf("\n");
- for (p = s; *p; p++)
- printf("%c", *p & M_PROTECT ? '"' : ' ');
- printf("\n");
- for (p = s; *p; p++)
- printf("%c", ismeta(*p) ? '_' : ' ');
- printf("\n");
-}
-#endif
diff --git a/crypto/kerberosIV/lib/roken/glob.h b/crypto/kerberosIV/lib/roken/glob.h
deleted file mode 100644
index bece48a89cd76..0000000000000
--- a/crypto/kerberosIV/lib/roken/glob.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 1989, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Guido van Rossum.
- *
- * 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- *
- * @(#)glob.h 8.1 (Berkeley) 6/2/93
- */
-
-#ifndef _GLOB_H_
-#define _GLOB_H_
-
-struct stat;
-typedef struct {
- int gl_pathc; /* Count of total paths so far. */
- int gl_matchc; /* Count of paths matching pattern. */
- int gl_offs; /* Reserved at beginning of gl_pathv. */
- int gl_flags; /* Copy of flags parameter to glob. */
- char **gl_pathv; /* List of paths matching pattern. */
- /* Copy of errfunc parameter to glob. */
- int (*gl_errfunc) (const char *, int);
-
- /*
- * Alternate filesystem access methods for glob; replacement
- * versions of closedir(3), readdir(3), opendir(3), stat(2)
- * and lstat(2).
- */
- void (*gl_closedir) (void *);
- struct dirent *(*gl_readdir) (void *);
- void *(*gl_opendir) (const char *);
- int (*gl_lstat) (const char *, struct stat *);
- int (*gl_stat) (const char *, struct stat *);
-} glob_t;
-
-#define GLOB_APPEND 0x0001 /* Append to output from previous call. */
-#define GLOB_DOOFFS 0x0002 /* Use gl_offs. */
-#define GLOB_ERR 0x0004 /* Return on error. */
-#define GLOB_MARK 0x0008 /* Append / to matching directories. */
-#define GLOB_NOCHECK 0x0010 /* Return pattern itself if nothing matches. */
-#define GLOB_NOSORT 0x0020 /* Don't sort. */
-
-#define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */
-#define GLOB_BRACE 0x0080 /* Expand braces ala csh. */
-#define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */
-#define GLOB_NOMAGIC 0x0200 /* GLOB_NOCHECK without magic chars (csh). */
-#define GLOB_QUOTE 0x0400 /* Quote special chars with \. */
-#define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */
-
-#define GLOB_NOSPACE (-1) /* Malloc call failed. */
-#define GLOB_ABEND (-2) /* Unignored error. */
-
-int glob (const char *, int, int (*)(const char *, int), glob_t *);
-void globfree (glob_t *);
-
-#endif /* !_GLOB_H_ */
diff --git a/crypto/kerberosIV/lib/roken/inet_ntop.c b/crypto/kerberosIV/lib/roken/inet_ntop.c
deleted file mode 100644
index f79a35eb334ba..0000000000000
--- a/crypto/kerberosIV/lib/roken/inet_ntop.c
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: inet_ntop.c,v 1.3 1999/12/02 16:58:47 joda Exp $");
-#endif
-
-#include <errno.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.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
-
-#include <roken.h>
-
-/*
- *
- */
-
-static const char *
-inet_ntop_v4 (const void *src, char *dst, size_t size)
-{
- const char digits[] = "0123456789";
- int i;
- struct in_addr *addr = (struct in_addr *)src;
- u_long a = ntohl(addr->s_addr);
- const char *orig_dst = dst;
-
- if (size < INET_ADDRSTRLEN) {
- errno = ENOSPC;
- return NULL;
- }
- for (i = 0; i < 4; ++i) {
- int n = (a >> (24 - i * 8)) & 0xFF;
- int non_zerop = 0;
-
- if (non_zerop || n / 100 > 0) {
- *dst++ = digits[n / 100];
- n %= 100;
- non_zerop = 1;
- }
- if (non_zerop || n / 10 > 0) {
- *dst++ = digits[n / 10];
- n %= 10;
- non_zerop = 1;
- }
- *dst++ = digits[n];
- if (i != 3)
- *dst++ = '.';
- }
- *dst++ = '\0';
- return orig_dst;
-}
-
-#ifdef HAVE_IPV6
-static const char *
-inet_ntop_v6 (const void *src, char *dst, size_t size)
-{
- const char xdigits[] = "0123456789abcdef";
- int i;
- const struct in6_addr *addr = (struct in6_addr *)src;
- const u_char *ptr = addr->s6_addr;
- const char *orig_dst = dst;
-
- if (size < INET6_ADDRSTRLEN) {
- errno = ENOSPC;
- return NULL;
- }
- for (i = 0; i < 8; ++i) {
- int non_zerop = 1;
-
- if (non_zerop || (ptr[0] >> 4)) {
- *dst++ = xdigits[ptr[0] >> 4];
- non_zerop = 1;
- }
- if (non_zerop || (ptr[0] & 0x0F)) {
- *dst++ = xdigits[ptr[0] & 0x0F];
- non_zerop = 1;
- }
- if (non_zerop || (ptr[1] >> 4)) {
- *dst++ = xdigits[ptr[1] >> 4];
- non_zerop = 1;
- }
- if (non_zerop || (ptr[1] & 0x0F)) {
- *dst++ = xdigits[ptr[1] & 0x0F];
- non_zerop = 1;
- }
- if (i != 7)
- *dst++ = ':';
- ptr += 2;
- }
- *dst++ = '\0';
- return orig_dst;
-}
-#endif /* HAVE_IPV6 */
-
-const char *
-inet_ntop(int af, const void *src, char *dst, size_t size)
-{
- switch (af) {
- case AF_INET :
- return inet_ntop_v4 (src, dst, size);
-#ifdef HAVE_IPV6
- case AF_INET6 :
- return inet_ntop_v6 (src, dst, size);
-#endif
- default :
- errno = EAFNOSUPPORT;
- return NULL;
- }
-}
diff --git a/crypto/kerberosIV/lib/roken/inet_pton.c b/crypto/kerberosIV/lib/roken/inet_pton.c
deleted file mode 100644
index 9b195c23dafca..0000000000000
--- a/crypto/kerberosIV/lib/roken/inet_pton.c
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: inet_pton.c,v 1.2 1999/12/02 16:58:47 joda Exp $");
-#endif
-
-#include <errno.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.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
-
-#include <roken.h>
-
-int
-inet_pton(int af, const char *src, void *dst)
-{
- if (af != AF_INET) {
- errno = EAFNOSUPPORT;
- return -1;
- }
- return inet_aton (src, dst);
-}
diff --git a/crypto/kerberosIV/lib/roken/innetgr.c b/crypto/kerberosIV/lib/roken/innetgr.c
deleted file mode 100644
index 4bc57f93e566d..0000000000000
--- a/crypto/kerberosIV/lib/roken/innetgr.c
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 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 KTH 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 KTH AND ITS 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 KTH OR ITS 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. */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "roken.h"
-
-#ifndef HAVE_INNETGR
-
-RCSID("$Id: innetgr.c,v 1.1 1999/03/11 14:04:01 joda Exp $");
-
-int
-innetgr(const char *netgroup, const char *machine,
- const char *user, const char *domain)
-{
- return 0;
-}
-#endif
-
diff --git a/crypto/kerberosIV/lib/roken/iruserok.c b/crypto/kerberosIV/lib/roken/iruserok.c
deleted file mode 100644
index 7cac29f412a25..0000000000000
--- a/crypto/kerberosIV/lib/roken/iruserok.c
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * Copyright (c) 1983, 1993, 1994
- * The Regents of the University of California. 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. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University 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 REGENTS 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 REGENTS 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: iruserok.c,v 1.22 1999/09/16 20:06:06 assar Exp $");
-#endif
-
-#include <stdio.h>
-#include <ctype.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.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_RPCSVC_YPCLNT_H
-#include <rpcsvc/ypclnt.h>
-#endif
-
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
-#include "roken.h"
-
-int __check_rhosts_file = 1;
-char *__rcmd_errstr = 0;
-
-/*
- * Returns "true" if match, 0 if no match.
- */
-static
-int
-__icheckhost(unsigned raddr, const char *lhost)
-{
- struct hostent *hp;
- u_long laddr;
- char **pp;
-
- /* Try for raw ip address first. */
- if (isdigit((unsigned char)*lhost)
- && (long)(laddr = inet_addr(lhost)) != -1)
- return (raddr == laddr);
-
- /* Better be a hostname. */
- if ((hp = gethostbyname(lhost)) == NULL)
- return (0);
-
- /* Spin through ip addresses. */
- for (pp = hp->h_addr_list; *pp; ++pp)
- if (memcmp(&raddr, *pp, sizeof(u_long)) == 0)
- return (1);
-
- /* No match. */
- return (0);
-}
-
-/*
- * Returns 0 if ok, -1 if not ok.
- */
-static
-int
-__ivaliduser(FILE *hostf, unsigned raddr, const char *luser,
- const char *ruser)
-{
- char *user, *p;
- int ch;
- char buf[MaxHostNameLen + 128]; /* host + login */
- char hname[MaxHostNameLen];
- struct hostent *hp;
- /* Presumed guilty until proven innocent. */
- int userok = 0, hostok = 0;
-#ifdef HAVE_YP_GET_DEFAULT_DOMAIN
- char *ypdomain;
-
- if (yp_get_default_domain(&ypdomain))
- ypdomain = NULL;
-#else
-#define ypdomain NULL
-#endif
- /* We need to get the damn hostname back for netgroup matching. */
- if ((hp = gethostbyaddr((char *)&raddr,
- sizeof(u_long),
- AF_INET)) == NULL)
- return (-1);
- strlcpy(hname, hp->h_name, sizeof(hname));
-
- while (fgets(buf, sizeof(buf), hostf)) {
- p = buf;
- /* Skip lines that are too long. */
- if (strchr(p, '\n') == NULL) {
- while ((ch = getc(hostf)) != '\n' && ch != EOF);
- continue;
- }
- if (*p == '\n' || *p == '#') {
- /* comment... */
- continue;
- }
- while (*p != '\n' && *p != ' ' && *p != '\t' && *p != '\0') {
- if (isupper((unsigned char)*p))
- *p = tolower((unsigned char)*p);
- p++;
- }
- if (*p == ' ' || *p == '\t') {
- *p++ = '\0';
- while (*p == ' ' || *p == '\t')
- p++;
- user = p;
- while (*p != '\n' && *p != ' ' &&
- *p != '\t' && *p != '\0')
- p++;
- } else
- user = p;
- *p = '\0';
- /*
- * Do +/- and +@/-@ checking. This looks really nasty,
- * but it matches SunOS's behavior so far as I can tell.
- */
- switch(buf[0]) {
- case '+':
- if (!buf[1]) { /* '+' matches all hosts */
- hostok = 1;
- break;
- }
- if (buf[1] == '@') /* match a host by netgroup */
- hostok = innetgr((char *)&buf[2],
- (char *)&hname, NULL, ypdomain);
- else /* match a host by addr */
- hostok = __icheckhost(raddr,(char *)&buf[1]);
- break;
- case '-': /* reject '-' hosts and all their users */
- if (buf[1] == '@') {
- if (innetgr((char *)&buf[2],
- (char *)&hname, NULL, ypdomain))
- return(-1);
- } else {
- if (__icheckhost(raddr,(char *)&buf[1]))
- return(-1);
- }
- break;
- default: /* if no '+' or '-', do a simple match */
- hostok = __icheckhost(raddr, buf);
- break;
- }
- switch(*user) {
- case '+':
- if (!*(user+1)) { /* '+' matches all users */
- userok = 1;
- break;
- }
- if (*(user+1) == '@') /* match a user by netgroup */
- userok = innetgr(user+2, NULL, (char *)ruser,
- ypdomain);
- else /* match a user by direct specification */
- userok = !(strcmp(ruser, user+1));
- break;
- case '-': /* if we matched a hostname, */
- if (hostok) { /* check for user field rejections */
- if (!*(user+1))
- return(-1);
- if (*(user+1) == '@') {
- if (innetgr(user+2, NULL,
- (char *)ruser, ypdomain))
- return(-1);
- } else {
- if (!strcmp(ruser, user+1))
- return(-1);
- }
- }
- break;
- default: /* no rejections: try to match the user */
- if (hostok)
- userok = !(strcmp(ruser,*user ? user : luser));
- break;
- }
- if (hostok && userok)
- return(0);
- }
- return (-1);
-}
-
-/*
- * New .rhosts strategy: We are passed an ip address. We spin through
- * hosts.equiv and .rhosts looking for a match. When the .rhosts only
- * has ip addresses, we don't have to trust a nameserver. When it
- * contains hostnames, we spin through the list of addresses the nameserver
- * gives us and look for a match.
- *
- * Returns 0 if ok, -1 if not ok.
- */
-int
-iruserok(unsigned raddr, int superuser, const char *ruser, const char *luser)
-{
- char *cp;
- struct stat sbuf;
- struct passwd *pwd;
- FILE *hostf;
- uid_t uid;
- int first;
- char pbuf[MaxPathLen];
-
- first = 1;
- hostf = superuser ? NULL : fopen(_PATH_HEQUIV, "r");
-again:
- if (hostf) {
- if (__ivaliduser(hostf, raddr, luser, ruser) == 0) {
- fclose(hostf);
- return (0);
- }
- fclose(hostf);
- }
- if (first == 1 && (__check_rhosts_file || superuser)) {
- first = 0;
- if ((pwd = k_getpwnam((char*)luser)) == NULL)
- return (-1);
- snprintf (pbuf, sizeof(pbuf), "%s/.rhosts", pwd->pw_dir);
-
- /*
- * Change effective uid while opening .rhosts. If root and
- * reading an NFS mounted file system, can't read files that
- * are protected read/write owner only.
- */
- uid = geteuid();
- seteuid(pwd->pw_uid);
- hostf = fopen(pbuf, "r");
- seteuid(uid);
-
- if (hostf == NULL)
- return (-1);
- /*
- * If not a regular file, or is owned by someone other than
- * user or root or if writeable by anyone but the owner, quit.
- */
- cp = NULL;
- if (lstat(pbuf, &sbuf) < 0)
- cp = ".rhosts lstat failed";
- else if (!S_ISREG(sbuf.st_mode))
- cp = ".rhosts not regular file";
- else if (fstat(fileno(hostf), &sbuf) < 0)
- cp = ".rhosts fstat failed";
- else if (sbuf.st_uid && sbuf.st_uid != pwd->pw_uid)
- cp = "bad .rhosts owner";
- else if (sbuf.st_mode & (S_IWGRP|S_IWOTH))
- cp = ".rhosts writeable by other than owner";
- /* If there were any problems, quit. */
- if (cp) {
- __rcmd_errstr = cp;
- fclose(hostf);
- return (-1);
- }
- goto again;
- }
- return (-1);
-}
diff --git a/crypto/kerberosIV/lib/roken/issuid.c b/crypto/kerberosIV/lib/roken/issuid.c
deleted file mode 100644
index af2aae542875f..0000000000000
--- a/crypto/kerberosIV/lib/roken/issuid.c
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Copyright (c) 1998 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: issuid.c,v 1.3 1999/12/02 16:58:47 joda Exp $");
-#endif
-
-#include "roken.h"
-
-int
-issuid(void)
-{
-#if defined(HAVE_GETUID) && defined(HAVE_GETEUID)
- if(getuid() != geteuid())
- return 1;
-#endif
-#if defined(HAVE_GETGID) && defined(HAVE_GETEGID)
- if(getgid() != getegid())
- return 2;
-#endif
- return 0;
-}
diff --git a/crypto/kerberosIV/lib/roken/make-print-version.c b/crypto/kerberosIV/lib/roken/make-print-version.c
deleted file mode 100644
index d08e023da950d..0000000000000
--- a/crypto/kerberosIV/lib/roken/make-print-version.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Copyright (c) 1998 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: make-print-version.c,v 1.2 1999/12/02 16:58:51 joda Exp $");
-#endif
-
-#include <stdio.h>
-
-#ifdef KRB5
-extern char *heimdal_version;
-#endif
-#ifdef KRB4
-extern char *krb4_version;
-#endif
-#include <version.h>
-
-int
-main(int argc, char **argv)
-{
- FILE *f;
- if(argc != 2)
- return 1;
- f = fopen(argv[1], "w");
- if(f == NULL)
- return 1;
- fprintf(f, "#define VERSIONLIST { ");
-#ifdef KRB5
- fprintf(f, "\"%s\", ", heimdal_version);
-#endif
-#ifdef KRB4
- fprintf(f, "\"%s\", ", krb4_version);
-#endif
- fprintf(f, "}\n");
- fclose(f);
- return 0;
-}
diff --git a/crypto/kerberosIV/lib/roken/net_read.c b/crypto/kerberosIV/lib/roken/net_read.c
deleted file mode 100644
index 6d45bfa5471a9..0000000000000
--- a/crypto/kerberosIV/lib/roken/net_read.c
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: net_read.c,v 1.3 1999/12/02 16:58:51 joda Exp $");
-#endif
-
-#include <sys/types.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include <roken.h>
-
-/*
- * Like read but never return partial data.
- */
-
-ssize_t
-net_read (int fd, void *buf, size_t nbytes)
-{
- char *cbuf = (char *)buf;
- ssize_t count;
- size_t rem = nbytes;
-
- while (rem > 0) {
-#ifdef WIN32
- count = recv (fd, cbuf, rem, 0);
-#else
- count = read (fd, cbuf, rem);
-#endif
- if (count < 0) {
- if (errno == EINTR)
- continue;
- else
- return count;
- } else if (count == 0) {
- return count;
- }
- cbuf += count;
- rem -= count;
- }
- return nbytes;
-}
diff --git a/crypto/kerberosIV/lib/roken/net_write.c b/crypto/kerberosIV/lib/roken/net_write.c
deleted file mode 100644
index 2f63dbeed10e0..0000000000000
--- a/crypto/kerberosIV/lib/roken/net_write.c
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: net_write.c,v 1.4 1999/12/02 16:58:51 joda Exp $");
-#endif
-
-#include <sys/types.h>
-#include <unistd.h>
-#include <errno.h>
-
-#include <roken.h>
-
-/*
- * Like write but never return partial data.
- */
-
-ssize_t
-net_write (int fd, const void *buf, size_t nbytes)
-{
- const char *cbuf = (const char *)buf;
- ssize_t count;
- size_t rem = nbytes;
-
- while (rem > 0) {
-#ifdef WIN32
- count = send (fd, cbuf, rem, 0);
-#else
- count = write (fd, cbuf, rem);
-#endif
- if (count < 0) {
- if (errno == EINTR)
- continue;
- else
- return count;
- }
- cbuf += count;
- rem -= count;
- }
- return nbytes;
-}
diff --git a/crypto/kerberosIV/lib/roken/parse_bytes-test.c b/crypto/kerberosIV/lib/roken/parse_bytes-test.c
deleted file mode 100644
index 499d942bf0609..0000000000000
--- a/crypto/kerberosIV/lib/roken/parse_bytes-test.c
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: parse_bytes-test.c,v 1.2 1999/12/02 16:58:51 joda Exp $");
-#endif
-
-#include "roken.h"
-#include "parse_bytes.h"
-
-static struct testcase {
- int canonicalp;
- int val;
- const char *def_unit;
- const char *str;
-} tests[] = {
- {0, 0, NULL, "0 bytes"},
- {1, 0, NULL, "0"},
- {0, 1, NULL, "1"},
- {1, 1, NULL, "1 byte"},
- {0, 0, "kilobyte", "0"},
- {0, 1024, "kilobyte", "1"},
- {1, 1024, "kilobyte", "1 kilobyte"},
- {1, 1024 * 1024, NULL, "1 megabyte"},
- {0, 1025, NULL, "1 kilobyte 1"},
- {1, 1025, NULL, "1 kilobyte 1 byte"},
-};
-
-int
-main(int argc, char **argv)
-{
- int i;
- int ret = 0;
-
- for (i = 0; i < sizeof(tests)/sizeof(tests[0]); ++i) {
- char buf[256];
- int val = parse_bytes (tests[i].str, tests[i].def_unit);
- size_t len;
-
- if (val != tests[i].val) {
- printf ("parse_bytes (%s, %s) = %d != %d\n",
- tests[i].str,
- tests[i].def_unit ? tests[i].def_unit : "none",
- val, tests[i].val);
- ++ret;
- }
- if (tests[i].canonicalp) {
- len = unparse_bytes (tests[i].val, buf, sizeof(buf));
- if (strcmp (tests[i].str, buf) != 0) {
- printf ("unparse_bytes (%d) = \"%s\" != \"%s\"\n",
- tests[i].val, buf, tests[i].str);
- ++ret;
- }
- }
- }
- if (ret) {
- printf ("%d errors\n", ret);
- return 1;
- } else
- return 0;
-}
diff --git a/crypto/kerberosIV/lib/roken/parse_bytes.c b/crypto/kerberosIV/lib/roken/parse_bytes.c
deleted file mode 100644
index f3c514fcd6770..0000000000000
--- a/crypto/kerberosIV/lib/roken/parse_bytes.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: parse_bytes.c,v 1.2 1999/12/02 16:58:51 joda Exp $");
-#endif
-
-#include <parse_units.h>
-#include "parse_bytes.h"
-
-static units bytes_units[] = {
- { "gigabyte", 1024 * 1024 * 1024 },
- { "gbyte", 1024 * 1024 * 1024 },
- { "GB", 1024 * 1024 * 1024 },
- { "megabyte", 1024 * 1024 },
- { "mbyte", 1024 * 1024 },
- { "MB", 1024 * 1024 },
- { "kilobyte", 1024 },
- { "KB", 1024 },
- { "byte", 1 },
- { NULL, 0 }
-};
-
-static units bytes_short_units[] = {
- { "GB", 1024 * 1024 * 1024 },
- { "MB", 1024 * 1024 },
- { "KB", 1024 },
- { NULL, 0 }
-};
-
-int
-parse_bytes (const char *s, const char *def_unit)
-{
- return parse_units (s, bytes_units, def_unit);
-}
-
-size_t
-unparse_bytes (int t, char *s, size_t len)
-{
- return unparse_units (t, bytes_units, s, len);
-}
-
-size_t
-unparse_bytes_short (int t, char *s, size_t len)
-{
- return unparse_units_approx (t, bytes_short_units, s, len);
-}
diff --git a/crypto/kerberosIV/lib/roken/parse_bytes.h b/crypto/kerberosIV/lib/roken/parse_bytes.h
deleted file mode 100644
index 8116c1c8ad777..0000000000000
--- a/crypto/kerberosIV/lib/roken/parse_bytes.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-/* $Id: parse_bytes.h,v 1.2 1999/12/02 16:58:51 joda Exp $ */
-
-#ifndef __PARSE_BYTES_H__
-#define __PARSE_BYTES_H__
-
-int
-parse_bytes (const char *s, const char *def_unit);
-
-size_t
-unparse_bytes (int t, char *s, size_t len);
-
-size_t
-unparse_bytes_short (int t, char *s, size_t len);
-
-#endif /* __PARSE_BYTES_H__ */
diff --git a/crypto/kerberosIV/lib/roken/parse_time.c b/crypto/kerberosIV/lib/roken/parse_time.c
deleted file mode 100644
index a09ded758de8e..0000000000000
--- a/crypto/kerberosIV/lib/roken/parse_time.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 1997, 1998 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: parse_time.c,v 1.5 1999/12/02 16:58:51 joda Exp $");
-#endif
-
-#include <parse_units.h>
-#include "parse_time.h"
-
-static units time_units[] = {
- {"year", 365 * 24 * 60 * 60},
- {"month", 30 * 24 * 60 * 60},
- {"week", 7 * 24 * 60 * 60},
- {"day", 24 * 60 * 60},
- {"hour", 60 * 60},
- {"h", 60 * 60},
- {"minute", 60},
- {"m", 60},
- {"second", 1},
- {"s", 1},
- {NULL, 0},
-};
-
-int
-parse_time (const char *s, const char *def_unit)
-{
- return parse_units (s, time_units, def_unit);
-}
-
-size_t
-unparse_time (int t, char *s, size_t len)
-{
- return unparse_units (t, time_units, s, len);
-}
-
-size_t
-unparse_time_approx (int t, char *s, size_t len)
-{
- return unparse_units_approx (t, time_units, s, len);
-}
-
-void
-print_time_table (FILE *f)
-{
- print_units_table (time_units, f);
-}
diff --git a/crypto/kerberosIV/lib/roken/parse_time.h b/crypto/kerberosIV/lib/roken/parse_time.h
deleted file mode 100644
index 55de505dbba35..0000000000000
--- a/crypto/kerberosIV/lib/roken/parse_time.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (c) 1997 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: parse_time.h,v 1.4 1999/12/02 16:58:51 joda Exp $ */
-
-#ifndef __PARSE_TIME_H__
-#define __PARSE_TIME_H__
-
-int
-parse_time (const char *s, const char *def_unit);
-
-size_t
-unparse_time (int t, char *s, size_t len);
-
-size_t
-unparse_time_approx (int t, char *s, size_t len);
-
-void
-print_time_table (FILE *f);
-
-#endif /* __PARSE_TIME_H__ */
diff --git a/crypto/kerberosIV/lib/roken/parse_units.c b/crypto/kerberosIV/lib/roken/parse_units.c
deleted file mode 100644
index 34c5030cb65ed..0000000000000
--- a/crypto/kerberosIV/lib/roken/parse_units.c
+++ /dev/null
@@ -1,324 +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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: parse_units.c,v 1.12 1999/12/02 16:58:51 joda Exp $");
-#endif
-
-#include <stdio.h>
-#include <ctype.h>
-#include <string.h>
-#include <roken.h>
-#include "parse_units.h"
-
-/*
- * Parse string in `s' according to `units' and return value.
- * def_unit defines the default unit.
- */
-
-static int
-parse_something (const char *s, const struct units *units,
- const char *def_unit,
- int (*func)(int res, int val, unsigned mult),
- int init,
- int accept_no_val_p)
-{
- const char *p;
- int res = init;
- unsigned def_mult = 1;
-
- if (def_unit != NULL) {
- const struct units *u;
-
- for (u = units; u->name; ++u) {
- if (strcasecmp (u->name, def_unit) == 0) {
- def_mult = u->mult;
- break;
- }
- }
- if (u->name == NULL)
- return -1;
- }
-
- p = s;
- while (*p) {
- double val;
- char *next;
- const struct units *u, *partial_unit;
- size_t u_len;
- unsigned partial;
- int no_val_p = 0;
-
- while(isspace((unsigned char)*p) || *p == ',')
- ++p;
-
- val = strtod (p, &next); /* strtol(p, &next, 0); */
- if (val == 0 && p == next) {
- if(!accept_no_val_p)
- return -1;
- no_val_p = 1;
- }
- p = next;
- while (isspace((unsigned char)*p))
- ++p;
- if (*p == '\0') {
- res = (*func)(res, val, def_mult);
- if (res < 0)
- return res;
- break;
- } else if (*p == '+') {
- ++p;
- val = 1;
- } else if (*p == '-') {
- ++p;
- val = -1;
- }
- if (no_val_p && val == 0)
- val = 1;
- u_len = strcspn (p, ", \t");
- partial = 0;
- partial_unit = NULL;
- if (u_len > 1 && p[u_len - 1] == 's')
- --u_len;
- for (u = units; u->name; ++u) {
- if (strncasecmp (p, u->name, u_len) == 0) {
- if (u_len == strlen (u->name)) {
- p += u_len;
- res = (*func)(res, val, u->mult);
- if (res < 0)
- return res;
- break;
- } else {
- ++partial;
- partial_unit = u;
- }
- }
- }
- if (u->name == NULL) {
- if (partial == 1) {
- p += u_len;
- res = (*func)(res, val, partial_unit->mult);
- if (res < 0)
- return res;
- } else {
- return -1;
- }
- }
- if (*p == 's')
- ++p;
- }
- return res;
-}
-
-/*
- * The string consists of a sequence of `n unit'
- */
-
-static int
-acc_units(int res, int val, unsigned mult)
-{
- return res + val * mult;
-}
-
-int
-parse_units (const char *s, const struct units *units,
- const char *def_unit)
-{
- return parse_something (s, units, def_unit, acc_units, 0, 0);
-}
-
-/*
- * The string consists of a sequence of `[+-]flag'. `orig' consists
- * the original set of flags, those are then modified and returned as
- * the function value.
- */
-
-static int
-acc_flags(int res, int val, unsigned mult)
-{
- if(val == 1)
- return res | mult;
- else if(val == -1)
- return res & ~mult;
- else if (val == 0)
- return mult;
- else
- return -1;
-}
-
-int
-parse_flags (const char *s, const struct units *units,
- int orig)
-{
- return parse_something (s, units, NULL, acc_flags, orig, 1);
-}
-
-/*
- * Return a string representation according to `units' of `num' in `s'
- * with maximum length `len'. The actual length is the function value.
- */
-
-static size_t
-unparse_something (int num, const struct units *units, char *s, size_t len,
- int (*print) (char *s, size_t len, int div,
- const char *name, int rem),
- int (*update) (int in, unsigned mult),
- const char *zero_string)
-{
- const struct units *u;
- size_t ret = 0, tmp;
-
- if (num == 0)
- return snprintf (s, len, "%s", zero_string);
-
- for (u = units; num > 0 && u->name; ++u) {
- int div;
-
- div = num / u->mult;
- if (div) {
- num = (*update) (num, u->mult);
- tmp = (*print) (s, len, div, u->name, num);
-
- len -= tmp;
- s += tmp;
- ret += tmp;
- }
- }
- return ret;
-}
-
-static int
-print_unit (char *s, size_t len, int div, const char *name, int rem)
-{
- return snprintf (s, len, "%u %s%s%s",
- div, name,
- div == 1 ? "" : "s",
- rem > 0 ? " " : "");
-}
-
-static int
-update_unit (int in, unsigned mult)
-{
- return in % mult;
-}
-
-static int
-update_unit_approx (int in, unsigned mult)
-{
- if (in / mult > 0)
- return 0;
- else
- return update_unit (in, mult);
-}
-
-size_t
-unparse_units (int num, const struct units *units, char *s, size_t len)
-{
- return unparse_something (num, units, s, len,
- print_unit,
- update_unit,
- "0");
-}
-
-size_t
-unparse_units_approx (int num, const struct units *units, char *s, size_t len)
-{
- return unparse_something (num, units, s, len,
- print_unit,
- update_unit_approx,
- "0");
-}
-
-void
-print_units_table (const struct units *units, FILE *f)
-{
- const struct units *u, *u2;
- unsigned max_sz = 0;
-
- for (u = units; u->name; ++u) {
- max_sz = max(max_sz, strlen(u->name));
- }
-
- for (u = units; u->name;) {
- char buf[1024];
- const struct units *next;
-
- for (next = u + 1; next->name && next->mult == u->mult; ++next)
- ;
-
- if (next->name) {
- for (u2 = next;
- u2->name && u->mult % u2->mult != 0;
- ++u2)
- ;
- if (u2->name == NULL)
- --u2;
- unparse_units (u->mult, u2, buf, sizeof(buf));
- fprintf (f, "1 %*s = %s\n", max_sz, u->name, buf);
- } else {
- fprintf (f, "1 %s\n", u->name);
- }
- u = next;
- }
-}
-
-static int
-print_flag (char *s, size_t len, int div, const char *name, int rem)
-{
- return snprintf (s, len, "%s%s", name, rem > 0 ? ", " : "");
-}
-
-static int
-update_flag (int in, unsigned mult)
-{
- return in - mult;
-}
-
-size_t
-unparse_flags (int num, const struct units *units, char *s, size_t len)
-{
- return unparse_something (num, units, s, len,
- print_flag,
- update_flag,
- "");
-}
-
-void
-print_flags_table (const struct units *units, FILE *f)
-{
- const struct units *u;
-
- for(u = units; u->name; ++u)
- fprintf(f, "%s%s", u->name, (u+1)->name ? ", " : "\n");
-}
diff --git a/crypto/kerberosIV/lib/roken/parse_units.h b/crypto/kerberosIV/lib/roken/parse_units.h
deleted file mode 100644
index f159d30e9007e..0000000000000
--- a/crypto/kerberosIV/lib/roken/parse_units.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Copyright (c) 1997 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: parse_units.h,v 1.6 1999/12/02 16:58:51 joda Exp $ */
-
-#ifndef __PARSE_UNITS_H__
-#define __PARSE_UNITS_H__
-
-#include <stdio.h>
-#include <stddef.h>
-
-struct units {
- const char *name;
- unsigned mult;
-};
-
-typedef struct units units;
-
-int
-parse_units (const char *s, const struct units *units,
- const char *def_unit);
-
-void
-print_units_table (const struct units *units, FILE *f);
-
-int
-parse_flags (const char *s, const struct units *units,
- int orig);
-
-size_t
-unparse_units (int num, const struct units *units, char *s, size_t len);
-
-size_t
-unparse_units_approx (int num, const struct units *units, char *s,
- size_t len);
-
-size_t
-unparse_flags (int num, const struct units *units, char *s, size_t len);
-
-void
-print_flags_table (const struct units *units, FILE *f);
-
-#endif /* __PARSE_UNITS_H__ */
diff --git a/crypto/kerberosIV/lib/roken/print_version.c b/crypto/kerberosIV/lib/roken/print_version.c
deleted file mode 100644
index 809bbb3bb920a..0000000000000
--- a/crypto/kerberosIV/lib/roken/print_version.c
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: print_version.c,v 1.5 1999/12/02 16:58:51 joda Exp $");
-#endif
-#include "roken.h"
-
-#include "print_version.h"
-
-void
-print_version(const char *progname)
-{
- const char *arg[] = VERSIONLIST;
- const int num_args = sizeof(arg) / sizeof(arg[0]);
- char *msg;
- size_t len = 0;
- int i;
-
- if(progname == NULL)
- progname = __progname;
-
- if(num_args == 0)
- msg = "no version information";
- else {
- for(i = 0; i < num_args; i++) {
- if(i > 0)
- len += 2;
- len += strlen(arg[i]);
- }
- msg = malloc(len + 1);
- if(msg == NULL) {
- fprintf(stderr, "%s: out of memory\n", progname);
- return;
- }
- msg[0] = '\0';
- for(i = 0; i < num_args; i++) {
- if(i > 0)
- strcat(msg, ", ");
- strcat(msg, arg[i]);
- }
- }
- fprintf(stderr, "%s (%s)\n", progname, msg);
- fprintf(stderr, "Copyright (c) 1999 Kungliga Tekniska Högskolan\n");
- if(num_args != 0)
- free(msg);
-}
diff --git a/crypto/kerberosIV/lib/roken/readv.c b/crypto/kerberosIV/lib/roken/readv.c
deleted file mode 100644
index de2f9ea8af72c..0000000000000
--- a/crypto/kerberosIV/lib/roken/readv.c
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: readv.c,v 1.5 1999/12/02 16:58:52 joda Exp $");
-#endif
-
-#include "roken.h"
-
-ssize_t
-readv(int d, const struct iovec *iov, int iovcnt)
-{
- ssize_t ret, nb;
- size_t tot = 0;
- int i;
- char *buf, *p;
-
- for(i = 0; i < iovcnt; ++i)
- tot += iov[i].iov_len;
- buf = malloc(tot);
- if (tot != 0 && buf == NULL) {
- errno = ENOMEM;
- return -1;
- }
- nb = ret = read (d, buf, tot);
- p = buf;
- while (nb > 0) {
- ssize_t cnt = min(nb, iov->iov_len);
-
- memcpy (iov->iov_base, p, cnt);
- p += cnt;
- nb -= cnt;
- }
- free(buf);
- return ret;
-}
diff --git a/crypto/kerberosIV/lib/roken/recvmsg.c b/crypto/kerberosIV/lib/roken/recvmsg.c
deleted file mode 100644
index e94ad68c80be1..0000000000000
--- a/crypto/kerberosIV/lib/roken/recvmsg.c
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: recvmsg.c,v 1.5 1999/12/02 16:58:52 joda Exp $");
-#endif
-
-#include "roken.h"
-
-ssize_t
-recvmsg(int s, struct msghdr *msg, int flags)
-{
- ssize_t ret, nb;
- size_t tot = 0;
- int i;
- char *buf, *p;
- struct iovec *iov = msg->msg_iov;
-
- for(i = 0; i < msg->msg_iovlen; ++i)
- tot += iov[i].iov_len;
- buf = malloc(tot);
- if (tot != 0 && buf == NULL) {
- errno = ENOMEM;
- return -1;
- }
- nb = ret = recvfrom (s, buf, tot, flags, msg->msg_name, &msg->msg_namelen);
- p = buf;
- while (nb > 0) {
- ssize_t cnt = min(nb, iov->iov_len);
-
- memcpy (iov->iov_base, p, cnt);
- p += cnt;
- nb -= cnt;
- ++iov;
- }
- free(buf);
- return ret;
-}
diff --git a/crypto/kerberosIV/lib/roken/resolve.c b/crypto/kerberosIV/lib/roken/resolve.c
deleted file mode 100644
index 8840740532cc4..0000000000000
--- a/crypto/kerberosIV/lib/roken/resolve.c
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "roken.h"
-#ifdef HAVE_ARPA_NAMESER_H
-#include <arpa/nameser.h>
-#endif
-#ifdef HAVE_RESOLV_H
-#include <resolv.h>
-#endif
-#include "resolve.h"
-
-RCSID("$Id: resolve.c,v 1.22 1999/12/02 16:58:52 joda Exp $");
-
-#if defined(HAVE_RES_SEARCH) && defined(HAVE_DN_EXPAND)
-
-#define DECL(X) {#X, T_##X}
-
-static struct stot{
- const char *name;
- int type;
-}stot[] = {
- DECL(A),
- DECL(NS),
- DECL(CNAME),
- DECL(PTR),
- DECL(MX),
- DECL(TXT),
- DECL(AFSDB),
- DECL(SRV),
- {NULL, 0}
-};
-
-int _resolve_debug;
-
-static int
-string_to_type(const char *name)
-{
- struct stot *p = stot;
- for(p = stot; p->name; p++)
- if(strcasecmp(name, p->name) == 0)
- return p->type;
- return -1;
-}
-
-static const char *
-type_to_string(int type)
-{
- struct stot *p = stot;
- for(p = stot; p->name; p++)
- if(type == p->type)
- return p->name;
- return NULL;
-}
-
-void
-dns_free_data(struct dns_reply *r)
-{
- struct resource_record *rr;
- if(r->q.domain)
- free(r->q.domain);
- for(rr = r->head; rr;){
- struct resource_record *tmp = rr;
- if(rr->domain)
- free(rr->domain);
- if(rr->u.data)
- free(rr->u.data);
- rr = rr->next;
- free(tmp);
- }
- free (r);
-}
-
-static struct dns_reply*
-parse_reply(unsigned char *data, int len)
-{
- unsigned char *p;
- char host[128];
- int status;
-
- struct dns_reply *r;
- struct resource_record **rr;
-
- r = calloc(1, sizeof(*r));
- if (r == NULL)
- return NULL;
-
- p = data;
-#if 0
- /* doesn't work on Crays */
- memcpy(&r->h, p, sizeof(HEADER));
- p += sizeof(HEADER);
-#else
- memcpy(&r->h, p, 12); /* XXX this will probably be mostly garbage */
- p += 12;
-#endif
- status = dn_expand(data, data + len, p, host, sizeof(host));
- if(status < 0){
- dns_free_data(r);
- return NULL;
- }
- r->q.domain = strdup(host);
- if(r->q.domain == NULL) {
- dns_free_data(r);
- return NULL;
- }
- p += status;
- r->q.type = (p[0] << 8 | p[1]);
- p += 2;
- r->q.class = (p[0] << 8 | p[1]);
- p += 2;
- rr = &r->head;
- while(p < data + len){
- int type, class, ttl, size;
- status = dn_expand(data, data + len, p, host, sizeof(host));
- if(status < 0){
- dns_free_data(r);
- return NULL;
- }
- p += status;
- type = (p[0] << 8) | p[1];
- p += 2;
- class = (p[0] << 8) | p[1];
- p += 2;
- ttl = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
- p += 4;
- size = (p[0] << 8) | p[1];
- p += 2;
- *rr = (struct resource_record*)calloc(1,
- sizeof(struct resource_record));
- if(*rr == NULL) {
- dns_free_data(r);
- return NULL;
- }
- (*rr)->domain = strdup(host);
- if((*rr)->domain == NULL) {
- dns_free_data(r);
- return NULL;
- }
- (*rr)->type = type;
- (*rr)->class = class;
- (*rr)->ttl = ttl;
- (*rr)->size = size;
- switch(type){
- case T_NS:
- case T_CNAME:
- case T_PTR:
- status = dn_expand(data, data + len, p, host, sizeof(host));
- if(status < 0){
- dns_free_data(r);
- return NULL;
- }
- (*rr)->u.txt = strdup(host);
- if((*rr)->u.txt == NULL) {
- dns_free_data(r);
- return NULL;
- }
- break;
- case T_MX:
- case T_AFSDB:{
- status = dn_expand(data, data + len, p + 2, host, sizeof(host));
- if(status < 0){
- dns_free_data(r);
- return NULL;
- }
- (*rr)->u.mx = (struct mx_record*)malloc(sizeof(struct mx_record) +
- strlen(host));
- if((*rr)->u.mx == NULL) {
- dns_free_data(r);
- return NULL;
- }
- (*rr)->u.mx->preference = (p[0] << 8) | p[1];
- strcpy((*rr)->u.mx->domain, host);
- break;
- }
- case T_SRV:{
- status = dn_expand(data, data + len, p + 6, host, sizeof(host));
- if(status < 0){
- dns_free_data(r);
- return NULL;
- }
- (*rr)->u.srv =
- (struct srv_record*)malloc(sizeof(struct srv_record) +
- strlen(host));
- if((*rr)->u.srv == NULL) {
- dns_free_data(r);
- return NULL;
- }
- (*rr)->u.srv->priority = (p[0] << 8) | p[1];
- (*rr)->u.srv->weight = (p[2] << 8) | p[3];
- (*rr)->u.srv->port = (p[4] << 8) | p[5];
- strcpy((*rr)->u.srv->target, host);
- break;
- }
- case T_TXT:{
- (*rr)->u.txt = (char*)malloc(size + 1);
- if((*rr)->u.txt == NULL) {
- dns_free_data(r);
- return NULL;
- }
- strncpy((*rr)->u.txt, (char*)p + 1, *p);
- (*rr)->u.txt[*p] = 0;
- break;
- }
-
- default:
- (*rr)->u.data = (unsigned char*)malloc(size);
- if(size != 0 && (*rr)->u.data == NULL) {
- dns_free_data(r);
- return NULL;
- }
- memcpy((*rr)->u.data, p, size);
- }
- p += size;
- rr = &(*rr)->next;
- }
- *rr = NULL;
- return r;
-}
-
-static struct dns_reply *
-dns_lookup_int(const char *domain, int rr_class, int rr_type)
-{
- unsigned char reply[1024];
- int len;
- struct dns_reply *r = NULL;
- u_long old_options = 0;
-
- if (_resolve_debug) {
- old_options = _res.options;
- _res.options |= RES_DEBUG;
- fprintf(stderr, "dns_lookup(%s, %d, %s)\n", domain,
- rr_class, type_to_string(rr_type));
- }
- len = res_search(domain, rr_class, rr_type, reply, sizeof(reply));
- if (_resolve_debug) {
- _res.options = old_options;
- fprintf(stderr, "dns_lookup(%s, %d, %s) --> %d\n",
- domain, rr_class, type_to_string(rr_type), len);
- }
- if (len >= 0)
- r = parse_reply(reply, len);
- return r;
-}
-
-struct dns_reply *
-dns_lookup(const char *domain, const char *type_name)
-{
- int type;
-
- type = string_to_type(type_name);
- if(type == -1) {
- if(_resolve_debug)
- fprintf(stderr, "dns_lookup: unknown resource type: `%s'\n",
- type_name);
- return NULL;
- }
- return dns_lookup_int(domain, C_IN, type);
-}
-
-#else /* NOT defined(HAVE_RES_SEARCH) && defined(HAVE_DN_EXPAND) */
-
-struct dns_reply *
-dns_lookup(const char *domain, const char *type_name)
-{
- return NULL;
-}
-
-void
-dns_free_data(struct dns_reply *r)
-{
-}
-
-#endif
-
-#ifdef TEST
-int
-main(int argc, char **argv)
-{
- struct dns_reply *r;
- struct resource_record *rr;
- r = dns_lookup(argv[1], argv[2]);
- if(r == NULL){
- printf("No reply.\n");
- return 1;
- }
- for(rr = r->head; rr;rr=rr->next){
- printf("%s %s %d ", rr->domain, type_to_string(rr->type), rr->ttl);
- switch(rr->type){
- case T_NS:
- printf("%s\n", (char*)rr->u.data);
- break;
- case T_A:
- printf("%d.%d.%d.%d\n",
- ((unsigned char*)rr->u.data)[0],
- ((unsigned char*)rr->u.data)[1],
- ((unsigned char*)rr->u.data)[2],
- ((unsigned char*)rr->u.data)[3]);
- break;
- case T_MX:
- case T_AFSDB:{
- struct mx_record *mx = (struct mx_record*)rr->u.data;
- printf("%d %s\n", mx->preference, mx->domain);
- break;
- }
- case T_SRV:{
- struct srv_record *srv = (struct srv_record*)rr->u.data;
- printf("%d %d %d %s\n", srv->priority, srv->weight,
- srv->port, srv->target);
- break;
- }
- default:
- printf("\n");
- break;
- }
- }
-
- return 0;
-}
-#endif
diff --git a/crypto/kerberosIV/lib/roken/resolve.h b/crypto/kerberosIV/lib/roken/resolve.h
deleted file mode 100644
index c90f6b54ada5a..0000000000000
--- a/crypto/kerberosIV/lib/roken/resolve.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997, 1998 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: resolve.h,v 1.8 1999/12/02 16:58:52 joda Exp $ */
-
-#ifndef __RESOLVE_H__
-#define __RESOLVE_H__
-
-/* We use these, but they are not always present in <arpa/nameser.h> */
-
-#ifndef T_TXT
-#define T_TXT 16
-#endif
-#ifndef T_AFSDB
-#define T_AFSDB 18
-#endif
-#ifndef T_SRV
-#define T_SRV 33
-#endif
-#ifndef T_NAPTR
-#define T_NAPTR 35
-#endif
-
-struct dns_query{
- char *domain;
- unsigned type;
- unsigned class;
-};
-
-struct mx_record{
- unsigned preference;
- char domain[1];
-};
-
-struct srv_record{
- unsigned priority;
- unsigned weight;
- unsigned port;
- char target[1];
-};
-
-struct resource_record{
- char *domain;
- unsigned type;
- unsigned class;
- unsigned ttl;
- unsigned size;
- union {
- void *data;
- struct mx_record *mx;
- struct mx_record *afsdb; /* mx and afsdb are identical */
- struct srv_record *srv;
- struct in_addr *a;
- char *txt;
- }u;
- struct resource_record *next;
-};
-
-#ifndef T_A /* XXX if <arpa/nameser.h> isn't included */
-typedef int HEADER; /* will never be used */
-#endif
-
-struct dns_reply{
- HEADER h;
- struct dns_query q;
- struct resource_record *head;
-};
-
-
-struct dns_reply* dns_lookup(const char *, const char *);
-void dns_free_data(struct dns_reply *);
-
-#endif /* __RESOLVE_H__ */
diff --git a/crypto/kerberosIV/lib/roken/resource.h b/crypto/kerberosIV/lib/roken/resource.h
deleted file mode 100644
index 01cd01d76c8c4..0000000000000
--- a/crypto/kerberosIV/lib/roken/resource.h
+++ /dev/null
@@ -1,15 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by roken.rc
-//
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 101
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1000
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/crypto/kerberosIV/lib/roken/roken-common.h b/crypto/kerberosIV/lib/roken/roken-common.h
deleted file mode 100644
index 0bb648b07cf96..0000000000000
--- a/crypto/kerberosIV/lib/roken/roken-common.h
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 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.
- */
-
-/* $Id: roken-common.h,v 1.19 1999/12/02 16:58:52 joda Exp $ */
-
-#ifndef __ROKEN_COMMON_H__
-#define __ROKEN_COMMON_H__
-
-#ifndef INADDR_NONE
-#define INADDR_NONE 0xffffffff
-#endif
-
-#ifndef SOMAXCONN
-#define SOMAXCONN 5
-#endif
-
-#ifndef STDIN_FILENO
-#define STDIN_FILENO 0
-#endif
-
-#ifndef STDOUT_FILENO
-#define STDOUT_FILENO 1
-#endif
-
-#ifndef STDERR_FILENO
-#define STDERR_FILENO 2
-#endif
-
-#ifndef max
-#define max(a,b) (((a)>(b))?(a):(b))
-#endif
-
-#ifndef min
-#define min(a,b) (((a)<(b))?(a):(b))
-#endif
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#ifndef LOG_DAEMON
-#define openlog(id,option,facility) openlog((id),(option))
-#define LOG_DAEMON 0
-#endif
-#ifndef LOG_ODELAY
-#define LOG_ODELAY 0
-#endif
-#ifndef LOG_NDELAY
-#define LOG_NDELAY 0x08
-#endif
-#ifndef LOG_CONS
-#define LOG_CONS 0
-#endif
-#ifndef LOG_AUTH
-#define LOG_AUTH 0
-#endif
-#ifndef LOG_AUTHPRIV
-#define LOG_AUTHPRIV LOG_AUTH
-#endif
-
-#ifndef F_OK
-#define F_OK 0
-#endif
-
-#ifndef O_ACCMODE
-#define O_ACCMODE 003
-#endif
-
-#ifndef _PATH_DEVNULL
-#define _PATH_DEVNULL "/dev/null"
-#endif
-
-#ifndef _PATH_HEQUIV
-#define _PATH_HEQUIV "/etc/hosts.equiv"
-#endif
-
-#ifndef MAXPATHLEN
-#define MAXPATHLEN (1024+4)
-#endif
-
-#ifndef SIG_ERR
-#define SIG_ERR ((RETSIGTYPE (*)())-1)
-#endif
-
-#ifndef HOST_NOT_FOUND
-#define HOST_NOT_FOUND 1
-#endif
-
-#ifndef TRY_AGAIN
-#define TRY_AGAIN 2
-#endif
-
-#ifndef NO_RECOVERY
-#define NO_RECOVERY 3
-#endif
-
-#ifndef NO_DATA
-#define NO_DATA 4
-#endif
-
-#ifndef NO_ADDRESS
-#define NO_ADDRESS NO_DATA
-#endif
-
-#if 0
-
-struct addrinfo {
- int ai_flags;
- int ai_family;
- int ai_socktype;
- int ai_protocol;
- size_t ai_addrlen;
- char *ai_canonname;
- struct sockaddr *ai_addr;
- struct addrinfo *ai_next;
-};
-
-#define EAI_ADDRFAMILY 1 /* address family for nodename not supported */
-#define EAI_AGAIN 2 /* temporary failure in name resolution */
-#define EAI_BADFLAGS 3 /* invalid value for ai_flags */
-#define EAI_FAIL 4 /* non-recoverable failure in name resolution */
-#define EAI_FAMILY 5 /* ai_family not supported */
-#define EAI_MEMORY 6 /* memory allocation failure */
-#define EAI_NODATA 7 /* no address associated with nodename */
-#define EAI_NONAME 8 /* nodename nor servname provided, or not known */
-#define EAI_SERVICE 9 /* servname not supported for ai_socktype */
-#define EAI_SOCKTYPE 10 /* ai_socktype not supported */
-#define EAI_SYSTEM 11 /* system error returned in errno */
-
-/* flags for getaddrinfo() */
-
-#define AI_PASSIVE 0x01
-#define AI_CANONNAME 0x02
-#define AI_NUMERICHOST 0x04
-
-#endif
-
-/*
- * constants for inet_ntop
- */
-
-#ifndef INET_ADDRSTRLEN
-#define INET_ADDRSTRLEN 16
-#endif
-
-#ifndef INET6_ADDRSTRLEN
-#define INET6_ADDRSTRLEN 46
-#endif
-
-/*
- * for shutdown(2)
- */
-
-#ifndef SHUT_RD
-#define SHUT_RD 0
-#endif
-
-#ifndef SHUT_WR
-#define SHUT_WR 1
-#endif
-
-#ifndef SHUT_RDWR
-#define SHUT_RDWR 2
-#endif
-
-#ifndef HAVE___ATTRIBUTE__
-#define __attribute__(x)
-#endif
-
-#if IRIX != 4 /* fix for compiler bug */
-#ifdef RETSIGTYPE
-typedef RETSIGTYPE (*SigAction)(/* int??? */);
-SigAction signal(int iSig, SigAction pAction); /* BSD compatible */
-#endif
-#endif
-
-int ROKEN_LIB_FUNCTION simple_execve(const char*, char*const[], char*const[]);
-int ROKEN_LIB_FUNCTION simple_execvp(const char*, char *const[]);
-int ROKEN_LIB_FUNCTION simple_execlp(const char*, ...);
-int ROKEN_LIB_FUNCTION simple_execle(const char*, ...);
-
-void ROKEN_LIB_FUNCTION print_version(const char *);
-
-void *ROKEN_LIB_FUNCTION emalloc (size_t);
-void *ROKEN_LIB_FUNCTION erealloc (void *, size_t);
-char *ROKEN_LIB_FUNCTION estrdup (const char *);
-
-ssize_t ROKEN_LIB_FUNCTION eread (int fd, void *buf, size_t nbytes);
-ssize_t ROKEN_LIB_FUNCTION ewrite (int fd, const void *buf, size_t nbytes);
-
-void
-socket_set_address_and_port (struct sockaddr *sa, const void *ptr, int port);
-
-size_t
-socket_addr_size (const struct sockaddr *sa);
-
-void
-socket_set_any (struct sockaddr *sa, int af);
-
-size_t
-socket_sockaddr_size (const struct sockaddr *sa);
-
-void *
-socket_get_address (struct sockaddr *sa);
-
-int
-socket_get_port (const struct sockaddr *sa);
-
-void
-socket_set_port (struct sockaddr *sa, int port);
-
-void
-socket_set_debug (int sock);
-
-void
-socket_set_tos (int sock, int tos);
-
-void
-socket_set_reuseaddr (int sock, int val);
-
-#endif /* __ROKEN_COMMON_H__ */
diff --git a/crypto/kerberosIV/lib/roken/roken.awk b/crypto/kerberosIV/lib/roken/roken.awk
deleted file mode 100644
index 626fae5906e08..0000000000000
--- a/crypto/kerberosIV/lib/roken/roken.awk
+++ /dev/null
@@ -1,35 +0,0 @@
-BEGIN {
- print "#include <stdio.h>"
- print "#ifdef HAVE_CONFIG_H"
- print "#include <config.h>"
- print "#endif"
- print ""
- print "int main()"
- print "{"
- print "puts(\"/* This is an OS dependent, generated file */\");"
- print "puts(\"\\n\");"
- print "puts(\"#ifndef __ROKEN_H__\");"
- print "puts(\"#define __ROKEN_H__\");"
- print "puts(\"\");"
-}
-END {
- print "puts(\"#endif /* __ROKEN_H__ */\");"
- print "exit(0);"
- print "}"
-}
-
-$1 == "\#ifdef" || $1 == "\#ifndef" || $1 == "\#if" || $1 == "\#else" || $1 == "\#elif" || $1 == "\#endif" || $1 == "#ifdef" || $1 == "#ifndef" || $1 == "#if" || $1 == "#else" || $1 == "#elif" || $1 == "#endif" {
- print $0;
- next
-}
-
-{
- s = ""
- for(i = 1; i <= length; i++){
- x = substr($0, i, 1)
- if(x == "\"" || x == "\\")
- s = s "\\";
- s = s x;
- }
- print "puts(\"" s "\");"
-}
diff --git a/crypto/kerberosIV/lib/roken/roken.dsp b/crypto/kerberosIV/lib/roken/roken.dsp
deleted file mode 100644
index d84854e3d30df..0000000000000
--- a/crypto/kerberosIV/lib/roken/roken.dsp
+++ /dev/null
@@ -1,156 +0,0 @@
-# Microsoft Developer Studio Project File - Name="roken" - Package Owner=<4>
-# Microsoft Developer Studio Generated Build File, Format Version 5.00
-# ** DO NOT EDIT **
-
-# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
-
-CFG=roken - Win32 Release
-!MESSAGE This is not a valid makefile. To build this project using NMAKE,
-!MESSAGE use the Export Makefile command and run
-!MESSAGE
-!MESSAGE NMAKE /f "roken.mak".
-!MESSAGE
-!MESSAGE You can specify a configuration when running NMAKE
-!MESSAGE by defining the macro CFG on the command line. For example:
-!MESSAGE
-!MESSAGE NMAKE /f "roken.mak" CFG="roken - Win32 Release"
-!MESSAGE
-!MESSAGE Possible choices for configuration are:
-!MESSAGE
-!MESSAGE "roken - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE "roken - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
-!MESSAGE
-
-# Begin Project
-# PROP Scc_ProjName ""
-# PROP Scc_LocalPath ""
-CPP=cl.exe
-MTL=midl.exe
-RSC=rc.exe
-
-!IF "$(CFG)" == "roken - Win32 Release"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 0
-# PROP BASE Output_Dir ".\Release"
-# PROP BASE Intermediate_Dir ".\Release"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 0
-# PROP Output_Dir ".\Release"
-# PROP Intermediate_Dir ".\Release"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MT /GX /O2 /I "..\krb" /I "..\des" /I "..\..\include" /I "..\..\include\win32" /I "." /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_CONFIG_H" /YX /FD /c
-# ADD BASE MTL /nologo /D "NDEBUG" /win32
-# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC /l 0x409 /d "NDEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /base:"0x68e7780" /subsystem:windows /dll /machine:I386
-
-!ELSEIF "$(CFG)" == "roken - Win32 Debug"
-
-# PROP BASE Use_MFC 0
-# PROP BASE Use_Debug_Libraries 1
-# PROP BASE Output_Dir ".\Debug"
-# PROP BASE Intermediate_Dir ".\Debug"
-# PROP BASE Target_Dir ""
-# PROP Use_MFC 0
-# PROP Use_Debug_Libraries 1
-# PROP Output_Dir ".\Debug"
-# PROP Intermediate_Dir ".\Debug"
-# PROP Ignore_Export_Lib 0
-# PROP Target_Dir ""
-# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
-# ADD CPP /nologo /MDd /Gm /GX /Zi /Od /I "..\krb" /I "..\des" /I "..\..\include" /I "..\..\include\win32" /I "." /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "HAVE_CONFIG_H" /YX /FD /c
-# ADD BASE MTL /nologo /D "_DEBUG" /win32
-# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
-# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC /l 0x409 /d "_DEBUG"
-BSC32=bscmake.exe
-# ADD BASE BSC32 /nologo
-# ADD BSC32 /nologo
-LINK32=link.exe
-# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:windows /dll /debug /machine:I386 /def:".\roken.def"
-# SUBTRACT LINK32 /pdb:none
-
-!ENDIF
-
-# Begin Target
-
-# Name "roken - Win32 Release"
-# Name "roken - Win32 Debug"
-# Begin Group "Source Files"
-
-# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;hpj;bat;for;f90"
-# Begin Source File
-
-SOURCE=.\base64.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\concat.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\gettimeofday.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\getuid.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\resolve.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\roken.def
-
-!IF "$(CFG)" == "roken - Win32 Release"
-
-!ELSEIF "$(CFG)" == "roken - Win32 Debug"
-
-# PROP Exclude_From_Build 1
-
-!ENDIF
-
-# End Source File
-# Begin Source File
-
-SOURCE=.\snprintf.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\strcasecmp.c
-# End Source File
-# Begin Source File
-
-SOURCE=.\strtok_r.c
-# End Source File
-# End Group
-# Begin Group "Header Files"
-
-# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
-# Begin Source File
-
-SOURCE=.\resolve.h
-# End Source File
-# End Group
-# Begin Group "Resource Files"
-
-# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
-# Begin Source File
-
-SOURCE=.\roken.rc
-# End Source File
-# End Group
-# End Target
-# End Project
diff --git a/crypto/kerberosIV/lib/roken/roken.h.in b/crypto/kerberosIV/lib/roken/roken.h.in
deleted file mode 100644
index 65263ba8a0951..0000000000000
--- a/crypto/kerberosIV/lib/roken/roken.h.in
+++ /dev/null
@@ -1,505 +0,0 @@
-/* -*- C -*- */
-/*
- * Copyright (c) 1995, 1996, 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.
- */
-
-/* $Id: roken.h.in,v 1.125 1999/12/02 16:58:52 joda Exp $ */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <signal.h>
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#endif
-#ifdef HAVE_SYS_UIO_H
-#include <sys/uio.h>
-#endif
-#ifdef HAVE_GRP_H
-#include <grp.h>
-#endif
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.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_NETDB_H
-#include <netdb.h>
-#endif
-#ifdef HAVE_SYSLOG_H
-#include <syslog.h>
-#endif
-#ifdef HAVE_WINSOCK_H
-#include <winsock.h>
-#endif
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
-#ifdef HAVE_ERRNO_H
-#include <errno.h>
-#endif
-#ifdef HAVE_ERR_H
-#include <err.h>
-#endif
-#ifdef HAVE_TERMIOS_H
-#include <termios.h>
-#endif
-#if defined(HAVE_SYS_IOCTL_H) && SunOS != 40
-#include <sys/ioctl.h>
-#endif
-#ifdef TIME_WITH_SYS_TIME
-#include <sys/time.h>
-#include <time.h>
-#elif defined(HAVE_SYS_TIME_H)
-#include <sys/time.h>
-#else
-#include <time.h>
-#endif
-
-#ifdef HAVE_PATHS_H
-#include <paths.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef ROKEN_LIB_FUNCTION
-#if defined(__BORLANDC__)
-#define ROKEN_LIB_FUNCTION /* not-ready-definition-yet */
-#elif defined(_MSC_VER)
-#define ROKEN_LIB_FUNCTION /* not-ready-definition-yet2 */
-#else
-#define ROKEN_LIB_FUNCTION
-#endif
-#endif
-
-#include <roken-common.h>
-
-#if !defined(HAVE_SETSID) && defined(HAVE__SETSID)
-#define setsid _setsid
-#endif
-
-#ifndef HAVE_PUTENV
-int putenv(const char *string);
-#endif
-
-#if !defined(HAVE_SETENV) || defined(NEED_SETENV_PROTO)
-int setenv(const char *var, const char *val, int rewrite);
-#endif
-
-#if !defined(HAVE_UNSETENV) || defined(NEED_UNSETENV_PROTO)
-void unsetenv(const char *name);
-#endif
-
-#if !defined(HAVE_GETUSERSHELL) || defined(NEED_GETUSERSHELL_PROTO)
-char *getusershell(void);
-void endusershell(void);
-#endif
-
-#if !defined(HAVE_SNPRINTF) || defined(NEED_SNPRINTF_PROTO)
-int snprintf (char *str, size_t sz, const char *format, ...)
- __attribute__ ((format (printf, 3, 4)));
-#endif
-
-#if !defined(HAVE_VSNPRINTF) || defined(NEED_VSNPRINTF_PROTO)
-int vsnprintf (char *str, size_t sz, const char *format, va_list ap)
- __attribute__((format (printf, 3, 0)));
-#endif
-
-#if !defined(HAVE_ASPRINTF) || defined(NEED_ASPRINTF_PROTO)
-int asprintf (char **ret, const char *format, ...)
- __attribute__ ((format (printf, 2, 3)));
-#endif
-
-#if !defined(HAVE_VASPRINTF) || defined(NEED_VASPRINTF_PROTO)
-int vasprintf (char **ret, const char *format, va_list ap)
- __attribute__((format (printf, 2, 0)));
-#endif
-
-#if !defined(HAVE_ASNPRINTF) || defined(NEED_ASNPRINTF_PROTO)
-int asnprintf (char **ret, size_t max_sz, const char *format, ...)
- __attribute__ ((format (printf, 3, 4)));
-#endif
-
-#if !defined(HAVE_VASNPRINTF) || defined(NEED_VASNPRINTF_PROTO)
-int vasnprintf (char **ret, size_t max_sz, const char *format, va_list ap)
- __attribute__((format (printf, 3, 0)));
-#endif
-
-#ifndef HAVE_STRDUP
-char * strdup(const char *old);
-#endif
-
-#ifndef HAVE_STRNDUP
-char * strndup(const char *old, size_t sz);
-#endif
-
-#ifndef HAVE_STRLWR
-char * strlwr(char *);
-#endif
-
-#ifndef HAVE_STRNLEN
-size_t strnlen(const char*, size_t);
-#endif
-
-#if !defined(HAVE_STRSEP) || defined(NEED_STRSEP_PROTO)
-char *strsep(char**, const char*);
-#endif
-
-#ifndef HAVE_STRCASECMP
-int strcasecmp(const char *s1, const char *s2);
-#endif
-
-#ifdef NEED_FCLOSE_PROTO
-int fclose(FILE *);
-#endif
-
-#ifdef NEED_STRTOK_R_PROTO
-char *strtok_r(char *s1, const char *s2, char **lasts);
-#endif
-
-#ifndef HAVE_STRUPR
-char * strupr(char *);
-#endif
-
-#ifndef HAVE_STRLCPY
-size_t strlcpy (char *dst, const char *src, size_t dst_sz);
-#endif
-
-#ifndef HAVE_STRLCAT
-size_t strlcat (char *dst, const char *src, size_t dst_sz);
-#endif
-
-#ifndef HAVE_GETDTABLESIZE
-int getdtablesize(void);
-#endif
-
-#if !defined(HAVE_STRERROR) && !defined(strerror)
-char *strerror(int eno);
-#endif
-
-#if !defined(HAVE_HSTRERROR) || defined(NEED_HSTRERROR_PROTO)
-/* This causes a fatal error under Psoriasis */
-#if !(defined(SunOS) && (SunOS >= 50))
-const char *hstrerror(int herr);
-#endif
-#endif
-
-#ifndef HAVE_H_ERRNO_DECLARATION
-extern int h_errno;
-#endif
-
-#if !defined(HAVE_INET_ATON) || defined(NEED_INET_ATON_PROTO)
-int inet_aton(const char *cp, struct in_addr *adr);
-#endif
-
-#ifndef HAVE_INET_NTOP
-const char *
-inet_ntop(int af, const void *src, char *dst, size_t size);
-#endif
-
-#ifndef HAVE_INET_PTON
-int
-inet_pton(int af, const char *src, void *dst);
-#endif
-
-#if !defined(HAVE_GETCWD)
-char* getcwd(char *path, size_t size);
-#endif
-
-#ifdef HAVE_PWD_H
-#include <pwd.h>
-struct passwd *k_getpwnam (const char *user);
-struct passwd *k_getpwuid (uid_t uid);
-#endif
-
-const char *get_default_username (void);
-
-#ifndef HAVE_SETEUID
-int seteuid(uid_t euid);
-#endif
-
-#ifndef HAVE_SETEGID
-int setegid(gid_t egid);
-#endif
-
-#ifndef HAVE_LSTAT
-int lstat(const char *path, struct stat *buf);
-#endif
-
-#if !defined(HAVE_MKSTEMP) || defined(NEED_MKSTEMP_PROTO)
-int mkstemp(char *);
-#endif
-
-#ifndef HAVE_CGETENT
-int cgetent(char **buf, char **db_array, const char *name);
-int cgetstr(char *buf, const char *cap, char **str);
-#endif
-
-#ifndef HAVE_INITGROUPS
-int initgroups(const char *name, gid_t basegid);
-#endif
-
-#ifndef HAVE_FCHOWN
-int fchown(int fd, uid_t owner, gid_t group);
-#endif
-
-#ifndef HAVE_DAEMON
-int daemon(int nochdir, int noclose);
-#endif
-
-#ifndef HAVE_INNETGR
-int innetgr(const char *netgroup, const char *machine,
- const char *user, const char *domain);
-#endif
-
-#ifndef HAVE_CHOWN
-int chown(const char *path, uid_t owner, gid_t group);
-#endif
-
-#ifndef HAVE_RCMD
-int rcmd(char **ahost, unsigned short inport, const char *locuser,
- const char *remuser, const char *cmd, int *fd2p);
-#endif
-
-#if !defined(HAVE_INNETGR) || defined(NEED_INNETGR_PROTO)
-int innetgr(const char*, const char*, const char*, const char*);
-#endif
-
-#ifndef HAVE_IRUSEROK
-int iruserok(unsigned raddr, int superuser, const char *ruser,
- const char *luser);
-#endif
-
-#if !defined(HAVE_GETHOSTNAME) || defined(NEED_GETHOSTNAME_PROTO)
-int gethostname(char *name, int namelen);
-#endif
-
-#ifndef HAVE_WRITEV
-ssize_t
-writev(int d, const struct iovec *iov, int iovcnt);
-#endif
-
-#ifndef HAVE_READV
-ssize_t
-readv(int d, const struct iovec *iov, int iovcnt);
-#endif
-
-#ifndef HAVE_MKSTEMP
-int
-mkstemp(char *template);
-#endif
-
-#ifndef HAVE_FLOCK
-#ifndef LOCK_SH
-#define LOCK_SH 1 /* Shared lock */
-#endif
-#ifndef LOCK_EX
-#define LOCK_EX 2 /* Exclusive lock */
-#endif
-#ifndef LOCK_NB
-#define LOCK_NB 4 /* Don't block when locking */
-#endif
-#ifndef LOCK_UN
-#define LOCK_UN 8 /* Unlock */
-#endif
-
-int flock(int fd, int operation);
-#endif /* HAVE_FLOCK */
-
-time_t tm2time (struct tm tm, int local);
-
-int unix_verify_user(char *user, char *password);
-
-void inaddr2str(struct in_addr addr, char *s, size_t len);
-
-void mini_inetd (int port);
-
-int roken_concat (char *s, size_t len, ...);
-
-size_t roken_mconcat (char **s, size_t max_len, ...);
-
-int roken_vconcat (char *s, size_t len, va_list args);
-
-size_t roken_vmconcat (char **s, size_t max_len, va_list args);
-
-ssize_t net_write (int fd, const void *buf, size_t nbytes);
-
-ssize_t net_read (int fd, void *buf, size_t nbytes);
-
-int issuid(void);
-
-#ifndef HAVE_STRUCT_WINSIZE
-struct winsize {
- unsigned short ws_row, ws_col;
- unsigned short ws_xpixel, ws_ypixel;
-};
-#endif
-
-int get_window_size(int fd, struct winsize *);
-
-#ifndef HAVE_VSYSLOG
-void vsyslog(int pri, const char *fmt, va_list ap);
-#endif
-
-#ifndef HAVE_OPTARG_DECLARATION
-extern char *optarg;
-#endif
-#ifndef HAVE_OPTIND_DECLARATION
-extern int optind;
-#endif
-#ifndef HAVE_OPTERR_DECLARATION
-extern int opterr;
-#endif
-
-#ifndef HAVE___PROGNAME_DECLARATION
-extern const char *__progname;
-#endif
-
-#ifndef HAVE_ENVIRON_DECLARATION
-extern char **environ;
-#endif
-
-#ifndef HAVE_GETIPNODEBYNAME
-struct hostent *
-getipnodebyname (const char *name, int af, int flags, int *error_num);
-#endif
-
-#ifndef HAVE_GETIPNODEBYADDR
-struct hostent *
-getipnodebyaddr (const void *src, size_t len, int af, int *error_num);
-#endif
-
-#ifndef HAVE_FREEHOSTENT
-void
-freehostent (struct hostent *h);
-#endif
-
-#ifndef HAVE_COPYHOSTENT
-struct hostent *
-copyhostent (const struct hostent *h);
-#endif
-
-#ifndef HAVE_STRUCT_SOCKADDR_STORAGE
-
-#ifndef HAVE_SA_FAMILY_T
-typedef unsigned short sa_family_t;
-#endif
-
-#if HAVE_STRUCT_SOCKADDR_SA_LEN
-
-struct sockaddr_storage {
- unsigned char __ss_len;
- sa_family_t __ss_family;
- char pad[
-#ifdef HAVE_IPV6
- sizeof(struct sockaddr_in6)
-#else
- sizeof(struct sockaddr_in)
-#endif
- - sizeof(unsigned char) - sizeof(sa_family_t)];
-};
-
-#else
-
-struct sockaddr_storage {
- sa_family_t __ss_family;
- char pad[
-#ifdef HAVE_IPV6
- sizeof(struct sockaddr_in6)
-#else
- sizeof(struct sockaddr_in)
-#endif
- - sizeof(sa_family_t)];
-};
-
-#endif
-
-#endif /* HAVE_STRUCT_SOCKADDR_STORAGE */
-
-/*
- * kludges and such
- */
-
-#if 1
-int roken_gethostby_setup(const char*, const char*);
-struct hostent* roken_gethostbyname(const char*);
-struct hostent* roken_gethostbyaddr(const void*, size_t, int);
-#else
-#ifdef GETHOSTBYNAME_PROTO_COMPATIBLE
-#define roken_gethostbyname(x) gethostbyname(x)
-#else
-#define roken_gethostbyname(x) gethostbyname((char *)x)
-#endif
-
-#ifdef GETHOSTBYADDR_PROTO_COMPATIBLE
-#define roken_gethostbyaddr(a, l, t) gethostbyaddr(a, l, t)
-#else
-#define roken_gethostbyaddr(a, l, t) gethostbyaddr((char *)a, l, t)
-#endif
-#endif
-
-#ifdef GETSERVBYNAME_PROTO_COMPATIBLE
-#define roken_getservbyname(x,y) getservbyname(x,y)
-#else
-#define roken_getservbyname(x,y) getservbyname((char *)x, (char *)y)
-#endif
-
-#ifdef OPENLOG_PROTO_COMPATIBLE
-#define roken_openlog(a,b,c) openlog(a,b,c)
-#else
-#define roken_openlog(a,b,c) openlog((char *)a,b,c)
-#endif
-
-void set_progname(char *argv0);
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/crypto/kerberosIV/lib/roken/roken.rc b/crypto/kerberosIV/lib/roken/roken.rc
deleted file mode 100644
index e7e2f3e499cac..0000000000000
--- a/crypto/kerberosIV/lib/roken/roken.rc
+++ /dev/null
@@ -1,105 +0,0 @@
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// Swedish resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_SVE)
-#ifdef _WIN32
-LANGUAGE LANG_SWEDISH, SUBLANG_DEFAULT
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE
-BEGIN
- "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE
-BEGIN
- "#include ""afxres.h""\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
-
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,1
- PRODUCTVERSION 1,0,0,1
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x40004L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "040904b0"
- BEGIN
- VALUE "CompanyName", "Royal Institute of Technology (KTH)\0"
- VALUE "FileDescription", "roken\0"
- VALUE "FileVersion", "4, 0, 9, 9\0"
- VALUE "InternalName", "roken\0"
- VALUE "LegalCopyright", "Copyright © 1996 - 1998 Royal Institute of Technology (KTH)\0"
- VALUE "OriginalFilename", "roken.dll\0"
- VALUE "ProductName", "KTH Kerberos\0"
- VALUE "ProductVersion", "4,0,9,9\0"
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation", 0x409, 1200
- END
-END
-
-#endif // !_MAC
-
-#endif // Swedish resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-
-
-/////////////////////////////////////////////////////////////////////////////
-#endif // not APSTUDIO_INVOKED
-
diff --git a/crypto/kerberosIV/lib/roken/roken_gethostby.c b/crypto/kerberosIV/lib/roken/roken_gethostby.c
deleted file mode 100644
index 8eb23258cdc37..0000000000000
--- a/crypto/kerberosIV/lib/roken/roken_gethostby.c
+++ /dev/null
@@ -1,280 +0,0 @@
-/*
- * Copyright (c) 1998 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: roken_gethostby.c,v 1.4 1999/12/02 16:58:52 joda Exp $");
-#endif
-
-#include <roken.h>
-#ifdef HAVE_NETDB_H
-#include <netdb.h>
-#endif
-#ifdef HAVE_ARPA_INET_H
-#include <arpa/inet.h>
-#endif
-
-#undef roken_gethostbyname
-#undef roken_gethostbyaddr
-
-static struct sockaddr_in dns_addr;
-static char *dns_req;
-
-static int
-make_address(const char *address, struct in_addr *ip)
-{
- if(inet_aton(address, ip) == 0){
- /* try to resolve as hostname, it might work if the address we
- are trying to lookup is local, for instance a web proxy */
- struct hostent *he = gethostbyname(address);
- if(he) {
- unsigned char *p = (unsigned char*)he->h_addr;
- ip->s_addr = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3];
- } else {
- return -1;
- }
- }
- return 0;
-}
-
-static int
-setup_int(const char *proxy_host, short proxy_port,
- const char *dns_host, short dns_port,
- const char *dns_path)
-{
- memset(&dns_addr, 0, sizeof(dns_addr));
- if(dns_req)
- free(dns_req);
- if(proxy_host) {
- if(make_address(proxy_host, &dns_addr.sin_addr) != 0)
- return -1;
- dns_addr.sin_port = htons(proxy_port);
- asprintf(&dns_req, "http://%s:%d%s", dns_host, dns_port, dns_path);
- } else {
- if(make_address(dns_host, &dns_addr.sin_addr) != 0)
- return -1;
- dns_addr.sin_port = htons(dns_port);
- asprintf(&dns_req, "%s", dns_path);
- }
- dns_addr.sin_family = AF_INET;
- return 0;
-}
-
-static void
-split_spec(const char *spec, char **host, int *port, char **path, int def_port)
-{
- char *p;
- *host = strdup(spec);
- p = strchr(*host, ':');
- if(p) {
- *p++ = '\0';
- if(sscanf(p, "%d", port) != 1)
- *port = def_port;
- } else
- *port = def_port;
- p = strchr(p ? p : *host, '/');
- if(p) {
- if(path)
- *path = strdup(p);
- *p = '\0';
- }else
- if(path)
- *path = NULL;
-}
-
-
-int
-roken_gethostby_setup(const char *proxy_spec, const char *dns_spec)
-{
- char *proxy_host = NULL;
- int proxy_port;
- char *dns_host, *dns_path;
- int dns_port;
-
- int ret = -1;
-
- split_spec(dns_spec, &dns_host, &dns_port, &dns_path, 80);
- if(dns_path == NULL)
- goto out;
- if(proxy_spec)
- split_spec(proxy_spec, &proxy_host, &proxy_port, NULL, 80);
- ret = setup_int(proxy_host, proxy_port, dns_host, dns_port, dns_path);
-out:
- free(proxy_host);
- free(dns_host);
- free(dns_path);
- return ret;
-}
-
-
-/* Try to lookup a name or an ip-address using http as transport
- mechanism. See the end of this file for an example program. */
-static struct hostent*
-roken_gethostby(const char *hostname)
-{
- int s;
- struct sockaddr_in sin;
- char *request;
- char buf[1024];
- int offset = 0;
- int n;
- char *p, *foo;
-
- if(dns_addr.sin_family == 0)
- return NULL; /* no configured host */
- sin = dns_addr;
- asprintf(&request, "GET %s?%s HTTP/1.0\r\n\r\n", dns_req, hostname);
- if(request == NULL)
- return NULL;
- s = socket(AF_INET, SOCK_STREAM, 0);
- if(s < 0) {
- free(request);
- return NULL;
- }
- if(connect(s, (struct sockaddr*)&sin, sizeof(sin)) < 0) {
- close(s);
- free(request);
- return NULL;
- }
- if(write(s, request, strlen(request)) != strlen(request)) {
- close(s);
- free(request);
- return NULL;
- }
- free(request);
- while(1) {
- n = read(s, buf + offset, sizeof(buf) - offset);
- if(n <= 0)
- break;
- offset += n;
- }
- buf[offset] = '\0';
- close(s);
- p = strstr(buf, "\r\n\r\n"); /* find end of header */
- if(p) p += 4;
- else return NULL;
- foo = NULL;
- p = strtok_r(p, " \t\r\n", &foo);
- if(p == NULL)
- return NULL;
- {
- /* make a hostent to return */
-#define MAX_ADDRS 16
- static struct hostent he;
- static char addrs[4 * MAX_ADDRS];
- static char *addr_list[MAX_ADDRS];
- int num_addrs = 0;
-
- he.h_name = p;
- he.h_aliases = NULL;
- he.h_addrtype = AF_INET;
- he.h_length = 4;
-
- while((p = strtok_r(NULL, " \t\r\n", &foo)) && num_addrs < MAX_ADDRS) {
- struct in_addr ip;
- inet_aton(p, &ip);
- ip.s_addr = ntohl(ip.s_addr);
- addr_list[num_addrs] = &addrs[num_addrs * 4];
- addrs[num_addrs * 4 + 0] = (ip.s_addr >> 24) & 0xff;
- addrs[num_addrs * 4 + 1] = (ip.s_addr >> 16) & 0xff;
- addrs[num_addrs * 4 + 2] = (ip.s_addr >> 8) & 0xff;
- addrs[num_addrs * 4 + 3] = (ip.s_addr >> 0) & 0xff;
- addr_list[++num_addrs] = NULL;
- }
- he.h_addr_list = addr_list;
- return &he;
- }
-}
-
-struct hostent*
-roken_gethostbyname(const char *hostname)
-{
- struct hostent *he;
- he = gethostbyname(hostname);
- if(he)
- return he;
- return roken_gethostby(hostname);
-}
-
-struct hostent*
-roken_gethostbyaddr(const void *addr, size_t len, int type)
-{
- struct in_addr a;
- const char *p;
- struct hostent *he;
- he = gethostbyaddr(addr, len, type);
- if(he)
- return he;
- if(type != AF_INET || len != 4)
- return NULL;
- p = addr;
- a.s_addr = htonl((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]);
- return roken_gethostby(inet_ntoa(a));
-}
-
-#if 0
-
-/* this program can be used as a cgi `script' to lookup names and
- ip-addresses */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <netdb.h>
-#include <sys/param.h>
-
-int
-main(int argc, char **argv)
-{
- char *query = getenv("QUERY_STRING");
- char host[MAXHOSTNAMELEN];
- int i;
- struct hostent *he;
-
- printf("Content-type: text/plain\n\n");
- if(query == NULL)
- exit(0);
- he = gethostbyname(query);
- strncpy(host, he->h_name, sizeof(host));
- host[sizeof(host) - 1] = '\0';
- he = gethostbyaddr(he->h_addr, he->h_length, AF_INET);
- printf("%s\n", he->h_name);
- for(i = 0; he->h_addr_list[i]; i++) {
- struct in_addr ip;
- unsigned char *p = (unsigned char*)he->h_addr_list[i];
- ip.s_addr = htonl((p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]);
- printf("%s\n", inet_ntoa(ip));
- }
- exit(0);
-}
-
-#endif
diff --git a/crypto/kerberosIV/lib/roken/sendmsg.c b/crypto/kerberosIV/lib/roken/sendmsg.c
deleted file mode 100644
index 7075bf2142114..0000000000000
--- a/crypto/kerberosIV/lib/roken/sendmsg.c
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: sendmsg.c,v 1.4 1999/12/02 16:58:52 joda Exp $");
-#endif
-
-#include "roken.h"
-
-ssize_t
-sendmsg(int s, const struct msghdr *msg, int flags)
-{
- ssize_t ret;
- size_t tot = 0;
- int i;
- char *buf, *p;
- struct iovec *iov = msg->msg_iov;
-
- for(i = 0; i < msg->msg_iovlen; ++i)
- tot += iov[i].iov_len;
- buf = malloc(tot);
- if (tot != 0 && buf == NULL) {
- errno = ENOMEM;
- return -1;
- }
- p = buf;
- for (i = 0; i < msg->msg_iovlen; ++i) {
- memcpy (p, iov[i].iov_base, iov[i].iov_len);
- p += iov[i].iov_len;
- }
- ret = sendto (s, buf, tot, flags, msg->msg_name, msg->msg_namelen);
- free (buf);
- return ret;
-}
diff --git a/crypto/kerberosIV/lib/roken/simple_exec.c b/crypto/kerberosIV/lib/roken/simple_exec.c
deleted file mode 100644
index 426f494fcc041..0000000000000
--- a/crypto/kerberosIV/lib/roken/simple_exec.c
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: simple_exec.c,v 1.6 1999/12/02 16:58:52 joda Exp $");
-#endif
-
-#include <stdarg.h>
-#include <stdlib.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <errno.h>
-
-#include <roken.h>
-
-#define EX_NOEXEC 126
-#define EX_NOTFOUND 127
-
-/* return values:
- -1 on `unspecified' system errors
- -2 on fork failures
- -3 on waitpid errors
- 0- is return value from subprocess
- 126 if the program couldn't be executed
- 127 if the program couldn't be found
- 128- is 128 + signal that killed subprocess
- */
-
-static int
-check_status(pid_t pid)
-{
- while(1) {
- int status;
-
- while(waitpid(pid, &status, 0) < 0)
- if (errno != EINTR)
- return -3;
- if(WIFSTOPPED(status))
- continue;
- if(WIFEXITED(status))
- return WEXITSTATUS(status);
- if(WIFSIGNALED(status))
- return WTERMSIG(status) + 128;
- }
-}
-
-int
-simple_execvp(const char *file, char *const args[])
-{
- pid_t pid = fork();
- switch(pid){
- case -1:
- return -2;
- case 0:
- execvp(file, args);
- exit((errno == ENOENT) ? EX_NOTFOUND : EX_NOEXEC);
- default:
- return check_status(pid);
- }
-}
-
-/* gee, I'd like a execvpe */
-int
-simple_execve(const char *file, char *const args[], char *const envp[])
-{
- pid_t pid = fork();
- switch(pid){
- case -1:
- return -2;
- case 0:
- execve(file, args, envp);
- exit((errno == ENOENT) ? EX_NOTFOUND : EX_NOEXEC);
- default:
- return check_status(pid);
- }
-}
-
-static char **
-collect_args(va_list *ap)
-{
- char **argv = NULL;
- int argc = 0, i = 0;
- do {
- if(i == argc) {
- /* realloc argv */
- char **tmp = realloc(argv, (argc + 5) * sizeof(*argv));
- if(tmp == NULL) {
- errno = ENOMEM;
- return NULL;
- }
- argv = tmp;
- argc += 5;
- }
- argv[i++] = va_arg(*ap, char*);
- } while(argv[i - 1] != NULL);
- return argv;
-}
-
-int
-simple_execlp(const char *file, ...)
-{
- va_list ap;
- char **argv;
- int ret;
-
- va_start(ap, file);
- argv = collect_args(&ap);
- va_end(ap);
- if(argv == NULL)
- return -1;
- ret = simple_execvp(file, argv);
- free(argv);
- return ret;
-}
-
-int
-simple_execle(const char *file, ... /* ,char *const envp[] */)
-{
- va_list ap;
- char **argv;
- char *const* envp;
- int ret;
-
- va_start(ap, file);
- argv = collect_args(&ap);
- envp = va_arg(ap, char **);
- va_end(ap);
- if(argv == NULL)
- return -1;
- ret = simple_execve(file, argv, envp);
- free(argv);
- return ret;
-}
diff --git a/crypto/kerberosIV/lib/roken/socket.c b/crypto/kerberosIV/lib/roken/socket.c
deleted file mode 100644
index 6e9c3dfe9b0a4..0000000000000
--- a/crypto/kerberosIV/lib/roken/socket.c
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * Copyright (c) 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: socket.c,v 1.3 1999/12/02 16:58:52 joda Exp $");
-#endif
-
-#include <string.h>
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.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_IN_SYSTM_H
-#include <netinet/in_systm.h>
-#endif
-#ifdef HAVE_NETINET_IP_H
-#include <netinet/ip.h>
-#endif
-
-#include <roken.h>
-
-#include <err.h>
-
-/*
- * Set `sa' to the unitialized address of address family `af'
- */
-
-void
-socket_set_any (struct sockaddr *sa, int af)
-{
- switch (af) {
- case AF_INET : {
- struct sockaddr_in *sin = (struct sockaddr_in *)sa;
-
- memset (sin, 0, sizeof(*sin));
- sin->sin_family = AF_INET;
- sin->sin_port = 0;
- sin->sin_addr.s_addr = INADDR_ANY;
- break;
- }
-#ifdef HAVE_IPV6
- case AF_INET6 : {
- struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa;
-
- memset (sin6, 0, sizeof(*sin6));
- sin6->sin6_family = AF_INET6;
- sin6->sin6_port = 0;
- sin6->sin6_addr = in6addr_any;
- break;
- }
-#endif
- default :
- errx (1, "unknown address family %d", sa->sa_family);
- break;
- }
-}
-
-/*
- * set `sa' to (`ptr', `port')
- */
-
-void
-socket_set_address_and_port (struct sockaddr *sa, const void *ptr, int port)
-{
- switch (sa->sa_family) {
- case AF_INET : {
- struct sockaddr_in *sin = (struct sockaddr_in *)sa;
-
- memset (sin, 0, sizeof(*sin));
- sin->sin_family = AF_INET;
- sin->sin_port = port;
- memcpy (&sin->sin_addr, ptr, sizeof(struct in_addr));
- break;
- }
-#ifdef HAVE_IPV6
- case AF_INET6 : {
- struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa;
-
- memset (sin6, 0, sizeof(*sin6));
- sin6->sin6_family = AF_INET6;
- sin6->sin6_port = port;
- memcpy (&sin6->sin6_addr, ptr, sizeof(struct in6_addr));
- break;
- }
-#endif
- default :
- errx (1, "unknown address family %d", sa->sa_family);
- break;
- }
-}
-
-/*
- * Return the size of an address of the type in `sa'
- */
-
-size_t
-socket_addr_size (const struct sockaddr *sa)
-{
- switch (sa->sa_family) {
- case AF_INET :
- return sizeof(struct in_addr);
-#ifdef HAVE_IPV6
- case AF_INET6 :
- return sizeof(struct in6_addr);
-#endif
- default :
- errx (1, "unknown address family %d", sa->sa_family);
- break;
- }
-}
-
-/*
- * Return the size of a `struct sockaddr' in `sa'.
- */
-
-size_t
-socket_sockaddr_size (const struct sockaddr *sa)
-{
- switch (sa->sa_family) {
- case AF_INET :
- return sizeof(struct sockaddr_in);
-#ifdef HAVE_IPV6
- case AF_INET6 :
- return sizeof(struct sockaddr_in6);
-#endif
- default :
- errx (1, "unknown address family %d", sa->sa_family);
- break;
- }
-}
-
-/*
- * Return the binary address of `sa'.
- */
-
-void *
-socket_get_address (struct sockaddr *sa)
-{
- switch (sa->sa_family) {
- case AF_INET : {
- struct sockaddr_in *sin = (struct sockaddr_in *)sa;
- return &sin->sin_addr;
- }
-#ifdef HAVE_IPV6
- case AF_INET6 : {
- struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa;
- return &sin6->sin6_addr;
- }
-#endif
- default :
- errx (1, "unknown address family %d", sa->sa_family);
- break;
- }
-}
-
-/*
- * Return the port number from `sa'.
- */
-
-int
-socket_get_port (const struct sockaddr *sa)
-{
- switch (sa->sa_family) {
- case AF_INET : {
- const struct sockaddr_in *sin = (const struct sockaddr_in *)sa;
- return sin->sin_port;
- }
-#ifdef HAVE_IPV6
- case AF_INET6 : {
- const struct sockaddr_in6 *sin6 = (const struct sockaddr_in6 *)sa;
- return sin6->sin6_port;
- }
-#endif
- default :
- errx (1, "unknown address family %d", sa->sa_family);
- break;
- }
-}
-
-/*
- * Set the port in `sa' to `port'.
- */
-
-void
-socket_set_port (struct sockaddr *sa, int port)
-{
- switch (sa->sa_family) {
- case AF_INET : {
- struct sockaddr_in *sin = (struct sockaddr_in *)sa;
- sin->sin_port = port;
- break;
- }
-#ifdef HAVE_IPV6
- case AF_INET6 : {
- struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)sa;
- sin6->sin6_port = port;
- break;
- }
-#endif
- default :
- errx (1, "unknown address family %d", sa->sa_family);
- break;
- }
-}
-
-/*
- * Enable debug on `sock'.
- */
-
-void
-socket_set_debug (int sock)
-{
- int on = 1;
-
-#if defined(SO_DEBUG) && defined(HAVE_SETSOCKOPT)
- if (setsockopt (sock, SOL_SOCKET, SO_DEBUG, (void *) &on, sizeof (on)) < 0)
- warn ("setsockopt SO_DEBUG (ignored)");
-#endif
-}
-
-/*
- * Set the type-of-service of `sock' to `tos'.
- */
-
-void
-socket_set_tos (int sock, int tos)
-{
-#if defined(IP_TOS) && defined(HAVE_SETSOCKOPT)
- if (setsockopt (sock, IPPROTO_IP, IP_TOS, (void *) &tos, sizeof (int)) < 0)
- warn ("setsockopt TOS (ignored)");
-#endif
-}
-
-/*
- * set the reuse of addresses on `sock' to `val'.
- */
-
-void
-socket_set_reuseaddr (int sock, int val)
-{
-#if defined(SO_REUSEADDR) && defined(HAVE_SETSOCKOPT)
- if(setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *)&val,
- sizeof(val)) < 0)
- err (1, "setsockopt SO_REUSEADDR");
-#endif
-}
diff --git a/crypto/kerberosIV/lib/roken/strlcat.c b/crypto/kerberosIV/lib/roken/strlcat.c
deleted file mode 100644
index d3c8baa6cc352..0000000000000
--- a/crypto/kerberosIV/lib/roken/strlcat.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 1995 - 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "roken.h"
-
-RCSID("$Id: strlcat.c,v 1.5 1999/12/02 16:58:53 joda Exp $");
-
-#ifndef HAVE_STRLCAT
-
-size_t
-strlcat (char *dst, const char *src, size_t dst_sz)
-{
- size_t len = strlen(dst);
-
- return len + strlcpy (dst + len, src, dst_sz - len);
-}
-#endif
diff --git a/crypto/kerberosIV/lib/roken/strlcpy.c b/crypto/kerberosIV/lib/roken/strlcpy.c
deleted file mode 100644
index 33cd9cb2af369..0000000000000
--- a/crypto/kerberosIV/lib/roken/strlcpy.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 1995 - 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "roken.h"
-
-RCSID("$Id: strlcpy.c,v 1.5 1999/12/02 16:58:53 joda Exp $");
-
-#ifndef HAVE_STRLCPY
-
-size_t
-strlcpy (char *dst, const char *src, size_t dst_sz)
-{
- size_t n;
- char *p;
-
- for (p = dst, n = 0;
- n + 1 < dst_sz && *src != '\0';
- ++p, ++src, ++n)
- *p = *src;
- *p = '\0';
- if (*src == '\0')
- return n;
- else
- return n + strlen (src);
-}
-
-#endif
diff --git a/crypto/kerberosIV/lib/roken/strncasecmp.c b/crypto/kerberosIV/lib/roken/strncasecmp.c
deleted file mode 100644
index 7c6474f78a3f8..0000000000000
--- a/crypto/kerberosIV/lib/roken/strncasecmp.c
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 1998 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: strncasecmp.c,v 1.2 1999/12/02 16:58:53 joda Exp $");
-#endif
-
-#include <string.h>
-#include <ctype.h>
-#include <stddef.h>
-
-#ifndef HAVE_STRNCASECMP
-
-int
-strncasecmp(const char *s1, const char *s2, size_t n)
-{
- while(n > 0 && toupper(*s1) == toupper(*s2)) {
- if(*s1 == '\0')
- return 0;
- s1++;
- s2++;
- n--;
- }
- if(n == 0)
- return 0;
- return toupper(*s1) - toupper(*s2);
-}
-
-#endif
diff --git a/crypto/kerberosIV/lib/roken/strndup.c b/crypto/kerberosIV/lib/roken/strndup.c
deleted file mode 100644
index 31e7e9f6a1c44..0000000000000
--- a/crypto/kerberosIV/lib/roken/strndup.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 1995 - 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: strndup.c,v 1.2 1999/12/02 16:58:53 joda Exp $");
-#endif
-#include <stdlib.h>
-#include <string.h>
-
-#include <roken.h>
-
-#ifndef HAVE_STRNDUP
-char *
-strndup(const char *old, size_t sz)
-{
- size_t len = strnlen (old, sz);
- char *t = malloc(len + 1);
-
- if (t != NULL) {
- memcpy (t, old, len);
- t[len] = '\0';
- }
- return t;
-}
-#endif /* HAVE_STRNDUP */
diff --git a/crypto/kerberosIV/lib/roken/strpftime-test.c b/crypto/kerberosIV/lib/roken/strpftime-test.c
deleted file mode 100644
index 7eb8fb85eb2a6..0000000000000
--- a/crypto/kerberosIV/lib/roken/strpftime-test.c
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * Copyright (c) 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 KTH 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 KTH AND ITS 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 KTH OR ITS 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. */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "roken.h"
-
-RCSID("$Id: strpftime-test.c,v 1.2 1999/11/12 15:29:55 assar Exp $");
-
-enum { MAXSIZE = 26 };
-
-static struct testcase {
- time_t t;
- struct {
- const char *format;
- const char *result;
- } vals[MAXSIZE];
-} tests[] = {
- {0,
- {
- {"%A", "Thursday"},
- {"%a", "Thu"},
- {"%B", "January"},
- {"%b", "Jan"},
- {"%C", "19"},
- {"%d", "01"},
- {"%e", " 1"},
- {"%H", "00"},
- {"%I", "12"},
- {"%j", "001"},
- {"%k", " 0"},
- {"%l", "12"},
- {"%M", "00"},
- {"%m", "01"},
- {"%n", "\n"},
- {"%p", "AM"},
- {"%S", "00"},
- {"%t", "\t"},
- {"%w", "4"},
- {"%Y", "1970"},
- {"%y", "70"},
- {"%U", "00"},
- {"%W", "00"},
- {"%V", "01"},
- {"%%", "%"},
- {NULL, NULL}}
- },
- {90000,
- {
- {"%A", "Friday"},
- {"%a", "Fri"},
- {"%B", "January"},
- {"%b", "Jan"},
- {"%C", "19"},
- {"%d", "02"},
- {"%e", " 2"},
- {"%H", "01"},
- {"%I", "01"},
- {"%j", "002"},
- {"%k", " 1"},
- {"%l", " 1"},
- {"%M", "00"},
- {"%m", "01"},
- {"%n", "\n"},
- {"%p", "AM"},
- {"%S", "00"},
- {"%t", "\t"},
- {"%w", "5"},
- {"%Y", "1970"},
- {"%y", "70"},
- {"%U", "00"},
- {"%W", "00"},
- {"%V", "01"},
- {"%%", "%"},
- {NULL, NULL}
- }
- },
- {216306,
- {
- {"%A", "Saturday"},
- {"%a", "Sat"},
- {"%B", "January"},
- {"%b", "Jan"},
- {"%C", "19"},
- {"%d", "03"},
- {"%e", " 3"},
- {"%H", "12"},
- {"%I", "12"},
- {"%j", "003"},
- {"%k", "12"},
- {"%l", "12"},
- {"%M", "05"},
- {"%m", "01"},
- {"%n", "\n"},
- {"%p", "PM"},
- {"%S", "06"},
- {"%t", "\t"},
- {"%w", "6"},
- {"%Y", "1970"},
- {"%y", "70"},
- {"%U", "00"},
- {"%W", "00"},
- {"%V", "01"},
- {"%%", "%"},
- {NULL, NULL}
- }
- },
- {259200,
- {
- {"%A", "Sunday"},
- {"%a", "Sun"},
- {"%B", "January"},
- {"%b", "Jan"},
- {"%C", "19"},
- {"%d", "04"},
- {"%e", " 4"},
- {"%H", "00"},
- {"%I", "12"},
- {"%j", "004"},
- {"%k", " 0"},
- {"%l", "12"},
- {"%M", "00"},
- {"%m", "01"},
- {"%n", "\n"},
- {"%p", "AM"},
- {"%S", "00"},
- {"%t", "\t"},
- {"%w", "0"},
- {"%Y", "1970"},
- {"%y", "70"},
- {"%U", "01"},
- {"%W", "00"},
- {"%V", "01"},
- {"%%", "%"},
- {NULL, NULL}
- }
- },
- {915148800,
- {
- {"%A", "Friday"},
- {"%a", "Fri"},
- {"%B", "January"},
- {"%b", "Jan"},
- {"%C", "19"},
- {"%d", "01"},
- {"%e", " 1"},
- {"%H", "00"},
- {"%I", "12"},
- {"%j", "001"},
- {"%k", " 0"},
- {"%l", "12"},
- {"%M", "00"},
- {"%m", "01"},
- {"%n", "\n"},
- {"%p", "AM"},
- {"%S", "00"},
- {"%t", "\t"},
- {"%w", "5"},
- {"%Y", "1999"},
- {"%y", "99"},
- {"%U", "00"},
- {"%W", "00"},
- {"%V", "53"},
- {"%%", "%"},
- {NULL, NULL}}
- },
- {942161105,
- {
-
- {"%A", "Tuesday"},
- {"%a", "Tue"},
- {"%B", "November"},
- {"%b", "Nov"},
- {"%C", "19"},
- {"%d", "09"},
- {"%e", " 9"},
- {"%H", "15"},
- {"%I", "03"},
- {"%j", "313"},
- {"%k", "15"},
- {"%l", " 3"},
- {"%M", "25"},
- {"%m", "11"},
- {"%n", "\n"},
- {"%p", "PM"},
- {"%S", "05"},
- {"%t", "\t"},
- {"%w", "2"},
- {"%Y", "1999"},
- {"%y", "99"},
- {"%U", "45"},
- {"%W", "45"},
- {"%V", "45"},
- {"%%", "%"},
- {NULL, NULL}
- }
- }
-};
-
-int
-main(int argc, char **argv)
-{
- int i, j;
- int ret = 0;
-
- for (i = 0; i < sizeof(tests)/sizeof(tests[0]); ++i) {
- struct tm *tm;
-
- tm = gmtime (&tests[i].t);
-
- for (j = 0; tests[i].vals[j].format != NULL; ++j) {
- char buf[128];
- size_t len;
- struct tm tm2;
- char *ptr;
-
- len = strftime (buf, sizeof(buf), tests[i].vals[j].format, tm);
- if (len != strlen (buf)) {
- printf ("length of strftime(\"%s\") = %d (\"%s\")\n",
- tests[i].vals[j].format, len,
- buf);
- ++ret;
- continue;
- }
- if (strcmp (buf, tests[i].vals[j].result) != 0) {
- printf ("result of strftime(\"%s\") = \"%s\" != \"%s\"\n",
- tests[i].vals[j].format, buf,
- tests[i].vals[j].result);
- ++ret;
- continue;
- }
- memset (&tm2, 0, sizeof(tm2));
- ptr = strptime (tests[i].vals[j].result,
- tests[i].vals[j].format,
- &tm2);
- if (ptr == NULL || *ptr != '\0') {
- printf ("bad return value from strptime("
- "\"%s\", \"%s\")\n",
- tests[i].vals[j].result,
- tests[i].vals[j].format);
- ++ret;
- }
- strftime (buf, sizeof(buf), tests[i].vals[j].format, &tm2);
- if (strcmp (buf, tests[i].vals[j].result) != 0) {
- printf ("reverse of \"%s\" failed: \"%s\" vs \"%s\"\n",
- tests[i].vals[j].format,
- buf, tests[i].vals[j].result);
- ++ret;
- }
- }
- }
- if (ret) {
- printf ("%d errors\n", ret);
- return 1;
- } else
- return 0;
-}
diff --git a/crypto/kerberosIV/lib/roken/strptime.c b/crypto/kerberosIV/lib/roken/strptime.c
deleted file mode 100644
index 36f0822431f85..0000000000000
--- a/crypto/kerberosIV/lib/roken/strptime.c
+++ /dev/null
@@ -1,444 +0,0 @@
-/*
- * Copyright (c) 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 KTH 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 KTH AND ITS 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 KTH OR ITS 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. */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include <ctype.h>
-#include "roken.h"
-
-RCSID("$Id: strptime.c,v 1.2 1999/11/12 15:29:55 assar Exp $");
-
-static const char *abb_weekdays[] = {
- "Sun",
- "Mon",
- "Tue",
- "Wed",
- "Thu",
- "Fri",
- "Sat",
- NULL
-};
-
-static const char *full_weekdays[] = {
- "Sunday",
- "Monday",
- "Tuesday",
- "Wednesday",
- "Thursday",
- "Friday",
- "Saturday",
- NULL
-};
-
-static const char *abb_month[] = {
- "Jan",
- "Feb",
- "Mar",
- "Apr",
- "May",
- "Jun",
- "Jul",
- "Aug",
- "Sep",
- "Oct",
- "Nov",
- "Dec",
- NULL
-};
-
-static const char *full_month[] = {
- "January",
- "February",
- "Mars",
- "April",
- "May",
- "June",
- "July",
- "August",
- "September",
- "October",
- "November",
- "December",
- NULL,
-};
-
-static const char *ampm[] = {
- "am",
- "pm",
- NULL
-};
-
-/*
- * Try to match `*buf' to one of the strings in `strs'. Return the
- * index of the matching string (or -1 if none). Also advance buf.
- */
-
-static int
-match_string (const char **buf, const char **strs)
-{
- int i = 0;
-
- for (i = 0; strs[i] != NULL; ++i) {
- int len = strlen (strs[i]);
-
- if (strncasecmp (*buf, strs[i], len) == 0) {
- *buf += len;
- return i;
- }
- }
- return -1;
-}
-
-/*
- * tm_year is relative this year */
-
-const int tm_year_base = 1900;
-
-/*
- * Return TRUE iff `year' was a leap year.
- */
-
-static int
-is_leap_year (int year)
-{
- return (year % 4) == 0 && ((year % 100) != 0 || (year % 400) == 0);
-}
-
-/*
- * Return the weekday [0,6] (0 = Sunday) of the first day of `year'
- */
-
-static int
-first_day (int year)
-{
- int ret = 4;
-
- for (; year > 1970; --year)
- ret = (ret + 365 + is_leap_year (year) ? 1 : 0) % 7;
- return ret;
-}
-
-/*
- * Set `timeptr' given `wnum' (week number [0, 53])
- */
-
-static void
-set_week_number_sun (struct tm *timeptr, int wnum)
-{
- int fday = first_day (timeptr->tm_year + tm_year_base);
-
- timeptr->tm_yday = wnum * 7 + timeptr->tm_wday - fday;
- if (timeptr->tm_yday < 0) {
- timeptr->tm_wday = fday;
- timeptr->tm_yday = 0;
- }
-}
-
-/*
- * Set `timeptr' given `wnum' (week number [0, 53])
- */
-
-static void
-set_week_number_mon (struct tm *timeptr, int wnum)
-{
- int fday = (first_day (timeptr->tm_year + tm_year_base) + 6) % 7;
-
- timeptr->tm_yday = wnum * 7 + (timeptr->tm_wday + 6) % 7 - fday;
- if (timeptr->tm_yday < 0) {
- timeptr->tm_wday = (fday + 1) % 7;
- timeptr->tm_yday = 0;
- }
-}
-
-/*
- * Set `timeptr' given `wnum' (week number [0, 53])
- */
-
-static void
-set_week_number_mon4 (struct tm *timeptr, int wnum)
-{
- int fday = (first_day (timeptr->tm_year + tm_year_base) + 6) % 7;
- int offset = 0;
-
- if (fday < 4)
- offset += 7;
-
- timeptr->tm_yday = offset + (wnum - 1) * 7 + timeptr->tm_wday - fday;
- if (timeptr->tm_yday < 0) {
- timeptr->tm_wday = fday;
- timeptr->tm_yday = 0;
- }
-}
-
-/*
- *
- */
-
-char *
-strptime (const char *buf, const char *format, struct tm *timeptr)
-{
- char c;
-
- for (; (c = *format) != '\0'; ++format) {
- char *s;
- int ret;
-
- if (isspace (c)) {
- while (isspace (*buf))
- ++buf;
- } else if (c == '%' && format[1] != '\0') {
- c = *++format;
- if (c == 'E' || c == 'O')
- c = *++format;
- switch (c) {
- case 'A' :
- ret = match_string (&buf, full_weekdays);
- if (ret < 0)
- return NULL;
- timeptr->tm_wday = ret;
- break;
- case 'a' :
- ret = match_string (&buf, abb_weekdays);
- if (ret < 0)
- return NULL;
- timeptr->tm_wday = ret;
- break;
- case 'B' :
- ret = match_string (&buf, full_month);
- if (ret < 0)
- return NULL;
- timeptr->tm_mon = ret;
- break;
- case 'b' :
- case 'h' :
- ret = match_string (&buf, abb_month);
- if (ret < 0)
- return NULL;
- timeptr->tm_mon = ret;
- break;
- case 'C' :
- ret = strtol (buf, &s, 10);
- if (s == buf)
- return NULL;
- timeptr->tm_year = (ret * 100) - tm_year_base;
- buf = s;
- break;
- case 'c' :
- abort ();
- case 'D' : /* %m/%d/%y */
- s = strptime (buf, "%m/%d/%y", timeptr);
- if (s == NULL)
- return NULL;
- buf = s;
- break;
- case 'd' :
- case 'e' :
- ret = strtol (buf, &s, 10);
- if (s == buf)
- return NULL;
- timeptr->tm_mday = ret;
- buf = s;
- break;
- case 'H' :
- case 'k' :
- ret = strtol (buf, &s, 10);
- if (s == buf)
- return NULL;
- timeptr->tm_hour = ret;
- buf = s;
- break;
- case 'I' :
- case 'l' :
- ret = strtol (buf, &s, 10);
- if (s == buf)
- return NULL;
- if (ret == 12)
- timeptr->tm_hour = 0;
- else
- timeptr->tm_hour = ret;
- buf = s;
- break;
- case 'j' :
- ret = strtol (buf, &s, 10);
- if (s == buf)
- return NULL;
- timeptr->tm_yday = ret - 1;
- buf = s;
- break;
- case 'm' :
- ret = strtol (buf, &s, 10);
- if (s == buf)
- return NULL;
- timeptr->tm_mon = ret - 1;
- buf = s;
- break;
- case 'M' :
- ret = strtol (buf, &s, 10);
- if (s == buf)
- return NULL;
- timeptr->tm_min = ret;
- buf = s;
- break;
- case 'n' :
- if (*buf == '\n')
- ++buf;
- else
- return NULL;
- break;
- case 'p' :
- ret = match_string (&buf, ampm);
- if (ret < 0)
- return NULL;
- if (timeptr->tm_hour == 0) {
- if (ret == 1)
- timeptr->tm_hour = 12;
- } else
- timeptr->tm_hour += 12;
- break;
- case 'r' : /* %I:%M:%S %p */
- s = strptime (buf, "%I:%M:%S %p", timeptr);
- if (s == NULL)
- return NULL;
- buf = s;
- break;
- case 'R' : /* %H:%M */
- s = strptime (buf, "%H:%M", timeptr);
- if (s == NULL)
- return NULL;
- buf = s;
- break;
- case 'S' :
- ret = strtol (buf, &s, 10);
- if (s == buf)
- return NULL;
- timeptr->tm_sec = ret;
- buf = s;
- break;
- case 't' :
- if (*buf == '\t')
- ++buf;
- else
- return NULL;
- break;
- case 'T' : /* %H:%M:%S */
- case 'X' :
- s = strptime (buf, "%H:%M:%S", timeptr);
- if (s == NULL)
- return NULL;
- buf = s;
- break;
- case 'u' :
- ret = strtol (buf, &s, 10);
- if (s == buf)
- return NULL;
- timeptr->tm_wday = ret - 1;
- buf = s;
- break;
- case 'w' :
- ret = strtol (buf, &s, 10);
- if (s == buf)
- return NULL;
- timeptr->tm_wday = ret;
- buf = s;
- break;
- case 'U' :
- ret = strtol (buf, &s, 10);
- if (s == buf)
- return NULL;
- set_week_number_sun (timeptr, ret);
- buf = s;
- break;
- case 'V' :
- ret = strtol (buf, &s, 10);
- if (s == buf)
- return NULL;
- set_week_number_mon4 (timeptr, ret);
- buf = s;
- break;
- case 'W' :
- ret = strtol (buf, &s, 10);
- if (s == buf)
- return NULL;
- set_week_number_mon (timeptr, ret);
- buf = s;
- break;
- case 'x' :
- s = strptime (buf, "%Y:%m:%d", timeptr);
- if (s == NULL)
- return NULL;
- buf = s;
- break;
- case 'y' :
- ret = strtol (buf, &s, 10);
- if (s == buf)
- return NULL;
- if (ret < 70)
- timeptr->tm_year = 100 + ret;
- else
- timeptr->tm_year = ret;
- buf = s;
- break;
- case 'Y' :
- ret = strtol (buf, &s, 10);
- if (s == buf)
- return NULL;
- timeptr->tm_year = ret - tm_year_base;
- buf = s;
- break;
- case 'Z' :
- abort ();
- case '\0' :
- --format;
- /* FALLTHROUGH */
- case '%' :
- if (*buf == '%')
- ++buf;
- else
- return NULL;
- break;
- default :
- if (*buf == '%' || *++buf == c)
- ++buf;
- else
- return NULL;
- break;
- }
- } else {
- if (*buf == c)
- ++buf;
- else
- return NULL;
- }
- }
- return (char *)buf;
-}
diff --git a/crypto/kerberosIV/lib/roken/strsep.c b/crypto/kerberosIV/lib/roken/strsep.c
deleted file mode 100644
index efc714a664269..0000000000000
--- a/crypto/kerberosIV/lib/roken/strsep.c
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 1997 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: strsep.c,v 1.3 1999/12/02 16:58:53 joda Exp $");
-#endif
-
-#include <string.h>
-
-#include "roken.h"
-
-#ifndef HAVE_STRSEP
-
-char *
-strsep(char **str, const char *delim)
-{
- char *save = *str;
- if(*str == NULL)
- return NULL;
- *str = *str + strcspn(*str, delim);
- if(**str == 0)
- *str = NULL;
- else{
- **str = 0;
- (*str)++;
- }
- return save;
-}
-
-#endif
diff --git a/crypto/kerberosIV/lib/roken/swab.c b/crypto/kerberosIV/lib/roken/swab.c
deleted file mode 100644
index c623bd0708e75..0000000000000
--- a/crypto/kerberosIV/lib/roken/swab.c
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-#include "roken.h"
-
-#ifndef HAVE_SWAB
-
-RCSID("$Id: swab.c,v 1.7 1999/12/02 16:58:53 joda Exp $");
-
-void
-swab (char *from, char *to, int nbytes)
-{
- while(nbytes >= 2) {
- *(to + 1) = *from;
- *to = *(from + 1);
- to += 2;
- from += 2;
- nbytes -= 2;
- }
-}
-#endif
diff --git a/crypto/kerberosIV/lib/roken/vsyslog.c b/crypto/kerberosIV/lib/roken/vsyslog.c
deleted file mode 100644
index 22e6a35a80c0d..0000000000000
--- a/crypto/kerberosIV/lib/roken/vsyslog.c
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 1997 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: vsyslog.c,v 1.3 1999/12/02 16:58:54 joda Exp $");
-#endif
-
-#ifndef HAVE_VSYSLOG
-
-#include <stdio.h>
-#include <syslog.h>
-#include <stdarg.h>
-
-#include "roken.h"
-
-void
-vsyslog(int pri, const char *fmt, va_list ap)
-{
- char *p;
-
- vasprintf (&p, fmt, ap);
- syslog (pri, "%s", p);
- free (p);
-}
-
-#endif
diff --git a/crypto/kerberosIV/lib/roken/writev.c b/crypto/kerberosIV/lib/roken/writev.c
deleted file mode 100644
index e3859bfe332c7..0000000000000
--- a/crypto/kerberosIV/lib/roken/writev.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright (c) 1995, 1996, 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.
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-RCSID("$Id: writev.c,v 1.3 1999/12/02 16:58:54 joda Exp $");
-#endif
-
-#include "roken.h"
-
-ssize_t
-writev(int d, const struct iovec *iov, int iovcnt)
-{
- ssize_t ret;
- size_t tot = 0;
- int i;
- char *buf, *p;
-
- for(i = 0; i < iovcnt; ++i)
- tot += iov[i].iov_len;
- buf = malloc(tot);
- if (tot != 0 && buf == NULL) {
- errno = ENOMEM;
- return -1;
- }
- p = buf;
- for (i = 0; i < iovcnt; ++i) {
- memcpy (p, iov[i].iov_base, iov[i].iov_len);
- p += iov[i].iov_len;
- }
- ret = write (d, buf, tot);
- free (buf);
- return ret;
-}
diff --git a/crypto/kerberosIV/lib/sl/ChangeLog b/crypto/kerberosIV/lib/sl/ChangeLog
deleted file mode 100644
index a8647de0ed27d..0000000000000
--- a/crypto/kerberosIV/lib/sl/ChangeLog
+++ /dev/null
@@ -1,112 +0,0 @@
-Thu Apr 1 17:03:59 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * make_cmds.c: use getarg
-
-Tue Mar 23 14:36:21 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * Makefile.am: don't rename
-
-Sun Mar 21 14:13:29 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * Makefile.am: don't roken-rename
-
-Sat Mar 20 03:43:30 1999 Assar Westerlund <assar@sics.se>
-
- * parse.y: replace return with YYACCEPT
-
-Fri Mar 19 14:53:20 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * Makefile.am: add libss; add version-info
-
-Thu Mar 18 15:07:06 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * Makefile.am: clean lex.c parse.c parse.h
-
- * Makefile.am: install ss.h
-
- * Makefile.am: include Makefile.am.common
-
-Thu Mar 11 15:01:01 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * parse.y: prototype for error_message
-
-Tue Feb 9 23:45:37 1999 Johan Danielsson <joda@hella.pdc.kth.se>
-
- * Makefile.in: add snprintf.o to make_cmds
-
-Sun Nov 22 10:46:23 1998 Assar Westerlund <assar@sics.se>
-
- * sl.c (sl_command_loop): remove unused variable
-
- * ss.c (ss_error): remove unused variable
-
- * make_cmds.c: include err.h
- (main): remove unused variable
-
- * Makefile.in (WFLAGS): set
-
-Sun Sep 27 01:28:21 1998 Assar Westerlund <assar@sics.se>
-
- * make_cmds.c: clean-up and simplification
-
-Mon May 25 02:54:13 1998 Assar Westerlund <assar@sics.se>
-
- * Makefile.in (clean): try to remove shared library debris
-
- * Makefile.in: make symlink magic work
-
-Sun Apr 19 10:00:26 1998 Assar Westerlund <assar@sics.se>
-
- * Makefile.in: add symlink magic for linux
-
-Sun Apr 5 09:21:43 1998 Assar Westerlund <assar@sics.se>
-
- * parse.y: define alloca to malloc in case we're using bison but
- don't have alloca
-
-Sat Mar 28 11:39:00 1998 Assar Westerlund <assar@sics.se>
-
- * sl.c (sl_loop): s/2/1
-
-Sat Mar 21 00:46:51 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * sl.c (sl_loop): check that there is at least one argument before
- calling sl_command
-
-Sun Mar 1 05:14:37 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * sl.c (sl_loop): Fix general broken-ness.
-
- * sl.c: Cleanup printing of help strings.
-
-Thu Feb 26 02:22:02 1998 Assar Westerlund <assar@sics.se>
-
- * Makefile.am: @LEXLIB@
-
-Sat Feb 21 15:18:21 1998 assar westerlund <assar@sics.se>
-
- * Makefile.in: set YACC and LEX
-
-Mon Feb 16 16:08:25 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * Makefile.am: Some fixes for ss/mk_cmds.
-
-Sun Feb 15 05:12:11 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * Makefile.in: Install libsl under the `libss' name too. Install
- mk_cmds, and ss.h.
-
- * make_cmds.c: A mk_cmds clone that creates SL structures.
-
- * ss.c: SS compatibility functions.
-
- * sl.c: Move command line split to function `sl_make_argv'.
-
-Tue Feb 3 16:45:44 1998 Johan Danielsson <joda@emma.pdc.kth.se>
-
- * sl.c: Add sl_command_loop, that is the loop body of sl_loop.
-
-Mon Oct 20 01:13:21 1997 Assar Westerlund <assar@sics.se>
-
- * sl.c (sl_help): actually use the `help' field of `SL_cmd'
-
diff --git a/crypto/kerberosIV/lib/sl/Makefile.am b/crypto/kerberosIV/lib/sl/Makefile.am
deleted file mode 100644
index 54bc75b033ca0..0000000000000
--- a/crypto/kerberosIV/lib/sl/Makefile.am
+++ /dev/null
@@ -1,44 +0,0 @@
-# $Id: Makefile.am,v 1.14 1999/04/09 18:28:29 assar Exp $
-
-include $(top_srcdir)/Makefile.am.common
-
-YFLAGS = -d
-
-include_HEADERS = sl.h
-
-lib_LTLIBRARIES = libsl.la libss.la
-libsl_la_LDFLAGS = -version-info 0:0:0
-libss_la_LDFLAGS = -version-info 0:0:0
-
-RENAME_SRC = roken_rename.h strtok_r.c snprintf.c
-
-libsl_la_SOURCES = sl_locl.h sl.c
-libss_la_SOURCES = $(libsl_la_SOURCES) ss.c ss.h
-
-EXTRA_libsl_la_SOURCES = strtok_r.c snprintf.c roken_rename.h
-
-# install these?
-
-noinst_PROGRAMS = mk_cmds
-
-mk_cmds_SOURCES = make_cmds.c make_cmds.h parse.y lex.l
-
-RENAME_mk_cmds_SRC = roken_rename.h snprintf.c
-
-EXTRA_mk_cmds_SOURCES = snprintf.c roken_rename.h
-
-ssincludedir = $(includedir)/ss
-ssinclude_HEADERS = ss.h
-
-CLEANFILES = lex.c parse.c parse.h snprintf.c strtok_r.c
-
-$(mk_cmds_OBJECTS): parse.h
-
-LDADD = \
- $(LIB_roken) \
- $(LEXLIB)
-
-strtok_r.c:
- $(LN_S) $(srcdir)/../roken/strtok_r.c .
-snprintf.c:
- $(LN_S) $(srcdir)/../roken/snprintf.c .
diff --git a/crypto/kerberosIV/lib/sl/lex.l b/crypto/kerberosIV/lib/sl/lex.l
deleted file mode 100644
index b7c1c44323463..0000000000000
--- a/crypto/kerberosIV/lib/sl/lex.l
+++ /dev/null
@@ -1,114 +0,0 @@
-%{
-/*
- * Copyright (c) 1998 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 "make_cmds.h"
-#include "parse.h"
-
-RCSID("$Id: lex.l,v 1.3 1999/12/02 16:58:55 joda Exp $");
-
-static unsigned lineno = 1;
-void error_message(char *, ...);
-int getstring(void);
-
-%}
-
-
-%%
-command_table { return TABLE; }
-request { return REQUEST; }
-unknown { return UNKNOWN; }
-unimplemented { return UNIMPLEMENTED; }
-end { return END; }
-#[^\n]* ;
-[ \t] ;
-\n { lineno++; }
-\" { return getstring(); }
-[a-zA-Z0-9_]+ { yylval.string = strdup(yytext); return STRING; }
-. { return *yytext; }
-%%
-
-#ifndef yywrap /* XXX */
-int
-yywrap ()
-{
- return 1;
-}
-#endif
-
-int
-getstring(void)
-{
- char x[128];
- int i = 0;
- int c;
- int backslash = 0;
- while((c = input()) != EOF){
- if(backslash) {
- if(c == 'n')
- c = '\n';
- else if(c == 't')
- c = '\t';
- x[i++] = c;
- backslash = 0;
- continue;
- }
- if(c == '\n'){
- error_message("unterminated string");
- lineno++;
- break;
- }
- if(c == '\\'){
- backslash++;
- continue;
- }
- if(c == '\"')
- break;
- x[i++] = c;
- }
- x[i] = '\0';
- yylval.string = strdup(x);
- return STRING;
-}
-
-void
-error_message (char *format, ...)
-{
- va_list args;
-
- va_start (args, format);
- fprintf (stderr, "%s:%d: ", filename, lineno);
- vfprintf (stderr, format, args);
- va_end (args);
- numerror++;
-}
diff --git a/crypto/kerberosIV/lib/sl/make_cmds.c b/crypto/kerberosIV/lib/sl/make_cmds.c
deleted file mode 100644
index 492e9e671272e..0000000000000
--- a/crypto/kerberosIV/lib/sl/make_cmds.c
+++ /dev/null
@@ -1,240 +0,0 @@
-/*
- * Copyright (c) 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 "make_cmds.h"
-#include <getarg.h>
-
-RCSID("$Id: make_cmds.c,v 1.6 1999/12/02 16:58:55 joda Exp $");
-
-#include <roken.h>
-#include <err.h>
-#include "parse.h"
-
-int numerror;
-extern FILE *yyin;
-FILE *c_file;
-
-extern void yyparse(void);
-
-#ifdef YYDEBUG
-extern int yydebug = 1;
-#endif
-
-char *filename;
-char *table_name;
-
-static struct command_list *commands;
-
-void
-add_command(char *function,
- char *help,
- struct string_list *aliases,
- unsigned flags)
-{
- struct command_list *cl = malloc(sizeof(*cl));
-
- if (cl == NULL)
- err (1, "malloc");
- cl->function = function;
- cl->help = help;
- cl->aliases = aliases;
- cl->flags = flags;
- cl->next = NULL;
- if(commands) {
- *commands->tail = cl;
- commands->tail = &cl->next;
- return;
- }
- cl->tail = &cl->next;
- commands = cl;
-}
-
-static char *
-quote(const char *str)
-{
- char buf[1024]; /* XXX */
- const char *p;
- char *q;
- q = buf;
-
- *q++ = '\"';
- for(p = str; *p != '\0'; p++) {
- if(*p == '\n') {
- *q++ = '\\';
- *q++ = 'n';
- continue;
- }
- if(*p == '\t') {
- *q++ = '\\';
- *q++ = 't';
- continue;
- }
- if(*p == '\"' || *p == '\\')
- *q++ = '\\';
- *q++ = *p;
- }
- *q++ = '\"';
- *q++ = '\0';
- return strdup(buf);
-}
-
-static void
-generate_commands(void)
-{
- char *base;
- char *cfn;
- char *p;
-
- p = strrchr(table_name, '/');
- if(p == NULL)
- p = table_name;
- else
- p++;
-
- base = strdup (p);
- if (base == NULL)
- err (1, "strdup");
-
- p = strrchr(base, '.');
- if(p)
- *p = '\0';
-
- asprintf(&cfn, "%s.c", base);
- if (cfn == NULL)
- err (1, "asprintf");
-
- c_file = fopen(cfn, "w");
- if (c_file == NULL)
- err (1, "cannot fopen %s", cfn);
-
- fprintf(c_file, "/* Generated from %s */\n", filename);
- fprintf(c_file, "\n");
- fprintf(c_file, "#include <stddef.h>\n");
- fprintf(c_file, "#include <sl.h>\n");
- fprintf(c_file, "\n");
-
- {
- struct command_list *cl, *xl;
- char *p, *q;
-
- for(cl = commands; cl; cl = cl->next) {
- for(xl = commands; xl != cl; xl = xl->next)
- if(strcmp(cl->function, xl->function) == 0)
- break;
- if(xl != cl)
- continue;
- /* XXX hack for ss_quit */
- if(strcmp(cl->function, "ss_quit") == 0) {
- fprintf(c_file, "int %s (int, char**);\n", cl->function);
- fprintf(c_file, "#define _ss_quit_wrap ss_quit\n\n");
- continue;
- }
- fprintf(c_file, "void %s (int, char**);\n", cl->function);
- fprintf(c_file, "static int _%s_wrap (int argc, char **argv)\n",
- cl->function);
- fprintf(c_file, "{\n");
- fprintf(c_file, " %s (argc, argv);\n", cl->function);
- fprintf(c_file, " return 0;\n");
- fprintf(c_file, "}\n\n");
- }
-
- fprintf(c_file, "SL_cmd %s[] = {\n", table_name);
- for(cl = commands; cl; cl = cl->next) {
- struct string_list *sl;
- sl = cl->aliases;
- p = quote(sl->string);
- q = quote(cl->help);
- fprintf(c_file, " { %s, _%s_wrap, %s },\n", p, cl->function, q);
- free(p);
- free(q);
-
- for(sl = sl->next; sl; sl = sl->next) {
- p = quote(sl->string);
- fprintf(c_file, " { %s },\n", p);
- free(p);
- }
- }
- fprintf(c_file, " { NULL },\n");
- fprintf(c_file, "};\n");
- fprintf(c_file, "\n");
- }
- fclose(c_file);
- free(base);
- free(cfn);
-}
-
-int version_flag;
-int help_flag;
-struct getargs args[] = {
- { "version", 0, arg_flag, &version_flag },
- { "help", 0, arg_flag, &help_flag }
-};
-int num_args = sizeof(args) / sizeof(args[0]);
-
-static void
-usage(int code)
-{
- arg_printusage(args, num_args, NULL, "command-table");
- exit(code);
-}
-
-int
-main(int argc, char **argv)
-{
- int optind = 0;
-
- set_progname(argv[0]);
- if(getarg(args, num_args, argc, argv, &optind))
- usage(1);
- if(help_flag)
- usage(0);
- if(version_flag) {
- print_version(NULL);
- exit(0);
- }
-
- if(argc == optind)
- usage(1);
- filename = argv[optind];
- yyin = fopen(filename, "r");
- if(yyin == NULL)
- err(1, "%s", filename);
-
- yyparse();
-
- generate_commands();
-
- if(numerror)
- return 1;
- return 0;
-}
diff --git a/crypto/kerberosIV/lib/sl/make_cmds.h b/crypto/kerberosIV/lib/sl/make_cmds.h
deleted file mode 100644
index 24dbd60d6c596..0000000000000
--- a/crypto/kerberosIV/lib/sl/make_cmds.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 1998 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: make_cmds.h,v 1.2 1999/12/02 16:58:55 joda Exp $ */
-
-#ifndef __MAKE_CMDS_H__
-#define __MAKE_CMDS_H__
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdarg.h>
-
-extern char *filename;
-extern char *table_name;
-extern int numerror;
-
-struct command_list {
- char *function;
- char *help;
- struct string_list *aliases;
- unsigned flags;
- struct command_list *next;
- struct command_list **tail;
-};
-
-struct string_list {
- char *string;
- struct string_list *next;
- struct string_list **tail;
-};
-
-void add_command(char*, char*, struct string_list*, unsigned);
-
-#endif /* __MAKE_CMDS_H__ */
diff --git a/crypto/kerberosIV/lib/sl/parse.y b/crypto/kerberosIV/lib/sl/parse.y
deleted file mode 100644
index b8b2d6335f71b..0000000000000
--- a/crypto/kerberosIV/lib/sl/parse.y
+++ /dev/null
@@ -1,194 +0,0 @@
-%{
-/*
- * Copyright (c) 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 "make_cmds.h"
-RCSID("$Id: parse.y,v 1.5 1999/12/02 16:58:55 joda Exp $");
-
-void yyerror (char *s);
-long name2number(const char *str);
-void error_message(char *, ...);
-
-struct string_list* append_string(struct string_list*, char*);
-void free_string_list(struct string_list *list);
-unsigned string_to_flag(const char *);
-
-/* This is for bison */
-
-#if !defined(alloca) && !defined(HAVE_ALLOCA)
-#define alloca(x) malloc(x)
-#endif
-
-%}
-
-%union {
- char *string;
- unsigned number;
- struct string_list *list;
-}
-
-%token TABLE REQUEST UNKNOWN UNIMPLEMENTED END
-%token <string> STRING
-%type <number> flag flags
-%type <list> aliases
-
-%%
-
-file : /* */
- | statements
- ;
-
-statements : statement
- | statements statement
- ;
-
-statement : TABLE STRING ';'
- {
- table_name = $2;
- }
- | REQUEST STRING ',' STRING ',' aliases ',' '(' flags ')' ';'
- {
- add_command($2, $4, $6, $9);
- }
- | REQUEST STRING ',' STRING ',' aliases ';'
- {
- add_command($2, $4, $6, 0);
- }
- | UNIMPLEMENTED STRING ',' STRING ',' aliases ';'
- {
- free($2);
- free($4);
- free_string_list($6);
- }
- | UNKNOWN aliases ';'
- {
- free_string_list($2);
- }
- | END ';'
- {
- YYACCEPT;
- }
- ;
-
-aliases : STRING
- {
- $$ = append_string(NULL, $1);
- }
- | aliases ',' STRING
- {
- $$ = append_string($1, $3);
- }
- ;
-
-flags : flag
- {
- $$ = $1;
- }
- | flags ',' flag
- {
- $$ = $1 | $3;
- }
- ;
-flag : STRING
- {
- $$ = string_to_flag($1);
- free($1);
- }
- ;
-
-
-
-%%
-
-long
-name2number(const char *str)
-{
- const char *p;
- long base = 0;
- const char *x = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "abcdefghijklmnopqrstuvwxyz0123456789_";
- if(strlen(str) > 4) {
- yyerror("table name too long");
- return 0;
- }
- for(p = str; *p; p++){
- char *q = strchr(x, *p);
- if(q == NULL) {
- yyerror("invalid character in table name");
- return 0;
- }
- base = (base << 6) + (q - x) + 1;
- }
- base <<= 8;
- if(base > 0x7fffffff)
- base = -(0xffffffff - base + 1);
- return base;
-}
-
-void
-yyerror (char *s)
-{
- error_message ("%s\n", s);
-}
-
-struct string_list*
-append_string(struct string_list *list, char *str)
-{
- struct string_list *sl = malloc(sizeof(*sl));
- sl->string = str;
- sl->next = NULL;
- if(list) {
- *list->tail = sl;
- list->tail = &sl->next;
- return list;
- }
- sl->tail = &sl->next;
- return sl;
-}
-
-void
-free_string_list(struct string_list *list)
-{
- while(list) {
- struct string_list *sl = list->next;
- free(list->string);
- free(list);
- list = sl;
- }
-}
-
-unsigned
-string_to_flag(const char *string)
-{
- return 0;
-}
diff --git a/crypto/kerberosIV/lib/sl/roken_rename.h b/crypto/kerberosIV/lib/sl/roken_rename.h
deleted file mode 100644
index c668802ac5d54..0000000000000
--- a/crypto/kerberosIV/lib/sl/roken_rename.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright (c) 1998 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: roken_rename.h,v 1.3 1999/12/02 16:58:55 joda Exp $ */
-
-#ifndef __roken_rename_h__
-#define __roken_rename_h__
-
-#ifndef HAVE_STRTOK_R
-#define strtok_r _sl_strtok_r
-#endif
-#ifndef HAVE_SNPRINTF
-#define snprintf _sl_snprintf
-#endif
-#ifndef HAVE_ASPRINTF
-#define asprintf _sl_asprintf
-#endif
-#ifndef HAVE_ASNPRINTF
-#define asnprintf _sl_asnprintf
-#endif
-#ifndef HAVE_VASPRINTF
-#define vasprintf _sl_vasprintf
-#endif
-#ifndef HAVE_VASNPRINTF
-#define vasnprintf _sl_vasnprintf
-#endif
-#ifndef HAVE_VSNPRINTF
-#define vsnprintf _sl_vsnprintf
-#endif
-
-#endif /* __roken_rename_h__ */
diff --git a/crypto/kerberosIV/lib/sl/ss.c b/crypto/kerberosIV/lib/sl/ss.c
deleted file mode 100644
index f3c0546b4d784..0000000000000
--- a/crypto/kerberosIV/lib/sl/ss.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright (c) 1998 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 "sl_locl.h"
-#include <com_err.h>
-#include "ss.h"
-
-RCSID("$Id: ss.c,v 1.4 1999/12/02 16:58:55 joda Exp $");
-
-struct ss_subst {
- char *name;
- char *version;
- char *info;
- ss_request_table *table;
-};
-
-static struct ss_subst subsystems[2];
-static int num_subsystems;
-
-int
-ss_create_invocation(const char *subsystem,
- const char *version,
- const char *info,
- ss_request_table *table,
- int *code)
-{
- struct ss_subst *ss;
- if(num_subsystems >= sizeof(subsystems) / sizeof(subsystems[0])) {
- *code = 17;
- return 0;
- }
- ss = &subsystems[num_subsystems];
- ss->name = subsystem ? strdup(subsystem) : NULL;
- ss->version = version ? strdup(version) : NULL;
- ss->info = info ? strdup(info) : NULL;
- ss->table = table;
- *code = 0;
- return num_subsystems++;
-}
-
-void
-ss_error (int index, long code, const char *fmt, ...)
-{
- va_list ap;
- va_start(ap, fmt);
- com_err_va (subsystems[index].name, code, fmt, ap);
- va_end(ap);
-}
-
-void
-ss_perror (int index, long code, const char *msg)
-{
- ss_error(index, code, "%s", msg);
-}
-
-int
-ss_execute_command(int index, char **argv)
-{
- int argc = 0;
- while(argv[argc++]);
- sl_command(subsystems[index].table, argc, argv);
- return 0;
-}
-
-int
-ss_execute_line (int index, const char *line)
-{
- char *buf = strdup(line);
- int argc;
- char **argv;
-
- sl_make_argv(buf, &argc, &argv);
- sl_command(subsystems[index].table, argc, argv);
- free(buf);
- return 0;
-}
-
-int
-ss_listen (int index)
-{
- char *prompt = malloc(strlen(subsystems[index].name) + 3);
- if(prompt == NULL) {
- abort();
- }
- strcpy(prompt, subsystems[index].name);
- strcat(prompt, ": ");
- sl_loop(subsystems[index].table, prompt);
- free(prompt);
- return 0;
-}
-
-int
-ss_list_requests(int argc, char **argv /* , int index, void *info */)
-{
- sl_help(subsystems[0 /* index */].table, argc, argv);
- return 0;
-}
-
-int
-ss_quit(int argc, char **argv)
-{
- return 1;
-}
diff --git a/crypto/kerberosIV/lib/sl/ss.h b/crypto/kerberosIV/lib/sl/ss.h
deleted file mode 100644
index 0d9d2977b7ac8..0000000000000
--- a/crypto/kerberosIV/lib/sl/ss.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 1998 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: ss.h,v 1.2 1999/12/02 16:58:55 joda Exp $ */
-
-/* SS compatibility for SL */
-
-#ifndef __ss_h__
-#define __ss_h__
-
-#include <sl.h>
-
-typedef SL_cmd ss_request_table;
-
-int ss_create_invocation (const char *, const char *, const char*,
- ss_request_table*, int*);
-
-void ss_error (int, long, const char*, ...);
-int ss_execute_command (int, char**);
-int ss_execute_line (int, const char*);
-int ss_list_requests (int argc, char**);
-int ss_listen (int);
-void ss_perror (int, long, const char*);
-int ss_quit (int argc, char**);
-
-#endif /* __ss_h__ */