summaryrefslogtreecommitdiffstats
path: root/crypto/heimdal/kuser
diff options
context:
space:
mode:
authornectar <nectar@FreeBSD.org>2003-10-09 19:36:20 +0000
committernectar <nectar@FreeBSD.org>2003-10-09 19:36:20 +0000
commit5c90662d441c12cd30c694eb1172d6fea2f8f282 (patch)
treecb08d962a1d1ff9fd191e67849a7057861f42a50 /crypto/heimdal/kuser
parent12eb3dee85137da9effa7d2df35e855dd0a3814a (diff)
downloadFreeBSD-src-5c90662d441c12cd30c694eb1172d6fea2f8f282.zip
FreeBSD-src-5c90662d441c12cd30c694eb1172d6fea2f8f282.tar.gz
Vendor import of Heimdal 0.6.
Diffstat (limited to 'crypto/heimdal/kuser')
-rw-r--r--crypto/heimdal/kuser/Makefile.am4
-rw-r--r--crypto/heimdal/kuser/Makefile.in58
-rw-r--r--crypto/heimdal/kuser/kdestroy.133
-rw-r--r--crypto/heimdal/kuser/kdestroy.c13
-rw-r--r--crypto/heimdal/kuser/kgetcred.133
-rw-r--r--crypto/heimdal/kuser/kinit.137
-rw-r--r--crypto/heimdal/kuser/kinit.c19
-rw-r--r--crypto/heimdal/kuser/klist.133
-rw-r--r--crypto/heimdal/kuser/klist.c22
9 files changed, 190 insertions, 62 deletions
diff --git a/crypto/heimdal/kuser/Makefile.am b/crypto/heimdal/kuser/Makefile.am
index b77ec28..e33b948 100644
--- a/crypto/heimdal/kuser/Makefile.am
+++ b/crypto/heimdal/kuser/Makefile.am
@@ -1,8 +1,8 @@
-# $Id: Makefile.am,v 1.30 2001/09/02 17:12:23 joda Exp $
+# $Id: Makefile.am,v 1.31 2003/03/18 13:15:27 lha Exp $
include $(top_srcdir)/Makefile.am.common
-INCLUDES += $(INCLUDE_krb4)
+INCLUDES += $(INCLUDE_krb4) $(INCLUDE_des) -I$(srcdir)/../lib/krb5
man_MANS = kinit.1 klist.1 kdestroy.1 kgetcred.1
diff --git a/crypto/heimdal/kuser/Makefile.in b/crypto/heimdal/kuser/Makefile.in
index 89ca1b7..0a2324c 100644
--- a/crypto/heimdal/kuser/Makefile.in
+++ b/crypto/heimdal/kuser/Makefile.in
@@ -14,11 +14,11 @@
@SET_MAKE@
-# $Id: Makefile.am,v 1.30 2001/09/02 17:12:23 joda Exp $
+# $Id: Makefile.am,v 1.31 2003/03/18 13:15:27 lha Exp $
# $Id: Makefile.am.common,v 1.5 2002/05/19 18:35:37 joda Exp $
-# $Id: Makefile.am.common,v 1.36 2002/08/19 16:10:25 joda Exp $
+# $Id: Makefile.am.common,v 1.37.2.1 2003/05/08 17:08:09 joda Exp $
SHELL = @SHELL@
srcdir = @srcdir@
@@ -114,6 +114,7 @@ LIB_roken = @LIB_roken@
LIB_security = @LIB_security@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
NEED_WRITEAUTH_FALSE = @NEED_WRITEAUTH_FALSE@
NEED_WRITEAUTH_TRUE = @NEED_WRITEAUTH_TRUE@
NROFF = @NROFF@
@@ -142,7 +143,7 @@ AUTOMAKE_OPTIONS = foreign no-dependencies 1.6
SUFFIXES = .et .h .x .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8
-INCLUDES = -I$(top_builddir)/include $(INCLUDES_roken) $(INCLUDE_krb4)
+INCLUDES = -I$(top_builddir)/include $(INCLUDES_roken) $(INCLUDE_krb4) $(INCLUDE_des) -I$(srcdir)/../lib/krb5
@do_roken_rename_TRUE@ROKEN_RENAME = -DROKEN_RENAME
@@ -192,7 +193,7 @@ LIB_readline = @LIB_readline@
NROFF_MAN = groff -mandoc -Tascii
-@KRB4_TRUE@LIB_kafs = $(top_builddir)/lib/kafs/libkafs.la $(AIX_EXTRA_KAFS)
+LIB_kafs = $(top_builddir)/lib/kafs/libkafs.la $(AIX_EXTRA_KAFS)
@KRB5_TRUE@LIB_krb5 = $(top_builddir)/lib/krb5/libkrb5.la \
@KRB5_TRUE@ $(top_builddir)/lib/asn1/libasn1.la
@@ -250,11 +251,9 @@ kdecode_ticket_DEPENDENCIES = $(top_builddir)/lib/krb5/libkrb5.la \
kdecode_ticket_LDFLAGS =
kdestroy_SOURCES = kdestroy.c
kdestroy_OBJECTS = kdestroy.$(OBJEXT)
-@KRB4_TRUE@kdestroy_DEPENDENCIES = $(top_builddir)/lib/kafs/libkafs.la \
-@KRB4_TRUE@ $(top_builddir)/lib/krb5/libkrb5.la \
-@KRB4_TRUE@ $(top_builddir)/lib/asn1/libasn1.la
-@KRB4_FALSE@kdestroy_DEPENDENCIES = $(top_builddir)/lib/krb5/libkrb5.la \
-@KRB4_FALSE@ $(top_builddir)/lib/asn1/libasn1.la
+kdestroy_DEPENDENCIES = $(top_builddir)/lib/kafs/libkafs.la \
+ $(top_builddir)/lib/krb5/libkrb5.la \
+ $(top_builddir)/lib/asn1/libasn1.la
kdestroy_LDFLAGS =
kgetcred_SOURCES = kgetcred.c
kgetcred_OBJECTS = kgetcred.$(OBJEXT)
@@ -264,19 +263,15 @@ kgetcred_DEPENDENCIES = $(top_builddir)/lib/krb5/libkrb5.la \
kgetcred_LDFLAGS =
kinit_SOURCES = kinit.c
kinit_OBJECTS = kinit.$(OBJEXT)
-@KRB4_TRUE@kinit_DEPENDENCIES = $(top_builddir)/lib/kafs/libkafs.la \
-@KRB4_TRUE@ $(top_builddir)/lib/krb5/libkrb5.la \
-@KRB4_TRUE@ $(top_builddir)/lib/asn1/libasn1.la
-@KRB4_FALSE@kinit_DEPENDENCIES = $(top_builddir)/lib/krb5/libkrb5.la \
-@KRB4_FALSE@ $(top_builddir)/lib/asn1/libasn1.la
+kinit_DEPENDENCIES = $(top_builddir)/lib/kafs/libkafs.la \
+ $(top_builddir)/lib/krb5/libkrb5.la \
+ $(top_builddir)/lib/asn1/libasn1.la
kinit_LDFLAGS =
klist_SOURCES = klist.c
klist_OBJECTS = klist.$(OBJEXT)
-@KRB4_TRUE@klist_DEPENDENCIES = $(top_builddir)/lib/kafs/libkafs.la \
-@KRB4_TRUE@ $(top_builddir)/lib/krb5/libkrb5.la \
-@KRB4_TRUE@ $(top_builddir)/lib/asn1/libasn1.la
-@KRB4_FALSE@klist_DEPENDENCIES = $(top_builddir)/lib/krb5/libkrb5.la \
-@KRB4_FALSE@ $(top_builddir)/lib/asn1/libasn1.la
+klist_DEPENDENCIES = $(top_builddir)/lib/kafs/libkafs.la \
+ $(top_builddir)/lib/krb5/libkrb5.la \
+ $(top_builddir)/lib/asn1/libasn1.la
klist_LDFLAGS =
kverify_SOURCES = kverify.c
kverify_OBJECTS = kverify.$(OBJEXT)
@@ -310,10 +305,10 @@ all: all-am
.SUFFIXES:
.SUFFIXES: .et .h .x .1 .3 .5 .8 .cat1 .cat3 .cat5 .cat8 .c .lo .o .obj
-$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/cf/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/Makefile.am.common $(top_srcdir)/cf/Makefile.am.common $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --foreign kuser/Makefile
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
install-binPROGRAMS: $(bin_PROGRAMS)
@@ -545,7 +540,9 @@ info: info-am
info-am:
-install-data-am: install-data-local install-man
+install-data-am: install-man
+ @$(NORMAL_INSTALL)
+ $(MAKE) $(AM_MAKEFLAGS) install-data-hook
install-exec-am: install-binPROGRAMS
@$(NORMAL_INSTALL)
@@ -575,14 +572,13 @@ uninstall-man: uninstall-man1
clean-noinstPROGRAMS distclean distclean-compile \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am info info-am install install-am install-binPROGRAMS \
- install-data install-data-am install-data-local install-exec \
- install-exec-am install-info install-info-am install-man \
- install-man1 install-strip installcheck installcheck-am \
- installdirs maintainer-clean maintainer-clean-generic \
- mostlyclean mostlyclean-compile mostlyclean-generic \
- mostlyclean-libtool tags uninstall uninstall-am \
- uninstall-binPROGRAMS uninstall-info-am uninstall-man \
- uninstall-man1
+ install-data install-data-am install-exec install-exec-am \
+ install-info install-info-am install-man install-man1 \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+ tags uninstall uninstall-am uninstall-binPROGRAMS \
+ uninstall-info-am uninstall-man uninstall-man1
install-suid-programs:
@@ -708,7 +704,7 @@ dist-hook: dist-cat1-mans dist-cat3-mans dist-cat5-mans dist-cat8-mans
install-cat-mans:
$(SHELL) $(top_srcdir)/cf/install-catman.sh "$(INSTALL_DATA)" "$(mkinstalldirs)" "$(srcdir)" "$(DESTDIR)$(mandir)" '$(CATMANEXT)' $(man_MANS) $(man1_MANS) $(man3_MANS) $(man5_MANS) $(man8_MANS)
-install-data-local: install-cat-mans
+install-data-hook: install-cat-mans
.et.h:
$(COMPILE_ET) $<
diff --git a/crypto/heimdal/kuser/kdestroy.1 b/crypto/heimdal/kuser/kdestroy.1
index 8d8b430..8910e9a 100644
--- a/crypto/heimdal/kuser/kdestroy.1
+++ b/crypto/heimdal/kuser/kdestroy.1
@@ -1,4 +1,35 @@
-.\" $Id: kdestroy.1,v 1.3 2001/05/02 08:59:22 assar Exp $
+.\" Copyright (c) 1997, 1999, 2001 Kungliga Tekniska Högskolan
+.\" (Royal Institute of Technology, Stockholm, Sweden).
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\"
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\"
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" 3. Neither the name of the Institute nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $Id: kdestroy.1,v 1.4 2003/02/16 21:10:23 lha Exp $
.\"
.Dd August 27, 1997
.Dt KDESTROY 1
diff --git a/crypto/heimdal/kuser/kdestroy.c b/crypto/heimdal/kuser/kdestroy.c
index a1a5c0d..4d23245 100644
--- a/crypto/heimdal/kuser/kdestroy.c
+++ b/crypto/heimdal/kuser/kdestroy.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan
+ * Copyright (c) 1997 - 2000, 2003 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -32,7 +32,7 @@
*/
#include "kuser_locl.h"
-RCSID("$Id: kdestroy.c,v 1.13 2001/02/20 01:44:51 assar Exp $");
+RCSID("$Id: kdestroy.c,v 1.14.2.1 2003/05/08 18:59:17 lha Exp $");
static const char *cache;
static int help_flag;
@@ -91,8 +91,13 @@ main (int argc, char **argv)
if (ret)
errx (1, "krb5_init_context failed: %d", ret);
- if(cache == NULL)
+ if(cache == NULL) {
cache = krb5_cc_default_name(context);
+ if (cache == NULL) {
+ warnx ("krb5_cc_default_name: %s", krb5_get_err_text(context, ret));
+ exit(1);
+ }
+ }
ret = krb5_cc_resolve(context,
cache,
@@ -115,11 +120,11 @@ main (int argc, char **argv)
#if KRB4
if(dest_tkt_flag && dest_tkt ())
exit_val = 1;
+#endif
if (unlog_flag && k_hasafs ()) {
if (k_unlog ())
exit_val = 1;
}
-#endif
return exit_val;
}
diff --git a/crypto/heimdal/kuser/kgetcred.1 b/crypto/heimdal/kuser/kgetcred.1
index 2aff7ec..f69e411 100644
--- a/crypto/heimdal/kuser/kgetcred.1
+++ b/crypto/heimdal/kuser/kgetcred.1
@@ -1,4 +1,35 @@
-.\" $Id: kgetcred.1,v 1.5 2002/08/20 16:37:19 joda Exp $
+.\" Copyright (c) 1999, 2001 - 2002 Kungliga Tekniska Högskolan
+.\" (Royal Institute of Technology, Stockholm, Sweden).
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\"
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\"
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" 3. Neither the name of the Institute nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $Id: kgetcred.1,v 1.6 2003/02/16 21:10:24 lha Exp $
.\"
.Dd May 14, 1999
.Dt KGETCRED 1
diff --git a/crypto/heimdal/kuser/kinit.1 b/crypto/heimdal/kuser/kinit.1
index 59c2e63..97ed2af 100644
--- a/crypto/heimdal/kuser/kinit.1
+++ b/crypto/heimdal/kuser/kinit.1
@@ -1,4 +1,35 @@
-.\" $Id: kinit.1,v 1.20 2002/08/28 16:09:36 joda Exp $
+.\" Copyright (c) 1998 - 2002 Kungliga Tekniska Högskolan
+.\" (Royal Institute of Technology, Stockholm, Sweden).
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\"
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\"
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" 3. Neither the name of the Institute nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $Id: kinit.1,v 1.23 2003/04/06 17:49:05 lha Exp $
.\"
.Dd May 29, 1998
.Dt KINIT 1
@@ -58,7 +89,7 @@
.Op Ar principal Op Ar command
.Sh DESCRIPTION
.Nm
-is used to authenticate to the kerberos server as
+is used to authenticate to the Kerberos server as
.Ar principal ,
or if none is given, a system generated default (typically your login
name at the default realm), and acquire a ticket granting ticket that
@@ -91,7 +122,7 @@ Get ticket that can be forwarded to another host.
Don't ask for a password, but instead get the key from the specified
keytab.
.It Xo
-.Fl l Ar time Ns ,
+.Fl l Ar time ,
.Fl -lifetime= Ns Ar time
.Xc
Specifies the lifetime of the ticket. The argument can either be in
diff --git a/crypto/heimdal/kuser/kinit.c b/crypto/heimdal/kuser/kinit.c
index 5ce4642..0d40bbf 100644
--- a/crypto/heimdal/kuser/kinit.c
+++ b/crypto/heimdal/kuser/kinit.c
@@ -32,7 +32,7 @@
*/
#include "kuser_locl.h"
-RCSID("$Id: kinit.c,v 1.90 2002/09/09 22:17:53 joda Exp $");
+RCSID("$Id: kinit.c,v 1.90.4.1 2003/05/08 18:58:37 lha Exp $");
int forwardable_flag = -1;
int proxiable_flag = -1;
@@ -52,9 +52,9 @@ char *start_str = NULL;
struct getarg_strings etype_str;
int use_keytab = 0;
char *keytab_str = NULL;
+int do_afslog = -1;
#ifdef KRB4
int get_v4_tgt = -1;
-int do_afslog = -1;
int convert_524;
#endif
int fcache_version;
@@ -66,10 +66,10 @@ static struct getargs args[] = {
{ "524convert", '9', arg_flag, &convert_524,
"only convert ticket to version 4" },
-
+#endif
{ "afslog", 0 , arg_flag, &do_afslog,
"obtain afs tokens" },
-#endif
+
{ "cache", 'c', arg_string, &cred_cache,
"credentials cache", "cachename" },
@@ -370,16 +370,15 @@ renew_validate(krb5_context context,
}
ret = krb5_cc_store_cred(context, cache, out);
-#ifdef KRB4
if(ret == 0 && server == NULL) {
+#ifdef KRB4
/* only do this if it's a general renew-my-tgt request */
if(get_v4_tgt)
do_524init(context, cache, out, NULL);
-
+#endif
if(do_afslog && k_hasafs())
krb5_afslog(context, cache, NULL, NULL);
}
-#endif
krb5_free_creds (context, out);
if(ret) {
@@ -648,11 +647,11 @@ main (int argc, char **argv)
krb5_appdefault_boolean(context, "kinit",
krb5_principal_get_realm(context, principal),
"krb4_get_tickets", TRUE, &get_v4_tgt);
+#endif
if(do_afslog == -1)
krb5_appdefault_boolean(context, "kinit",
krb5_principal_get_realm(context, principal),
"afslog", TRUE, &do_afslog);
-#endif
if(!addrs_flag && extra_addresses.num_strings > 0)
krb5_errx(context, 1, "specifying both extra addresses and "
@@ -687,17 +686,17 @@ main (int argc, char **argv)
#ifdef KRB4
if(get_v4_tgt)
do_524init(context, ccache, NULL, server);
+#endif
if(do_afslog && k_hasafs())
krb5_afslog(context, ccache, NULL, NULL);
-#endif
if(argc > 1) {
simple_execvp(argv[1], argv+1);
krb5_cc_destroy(context, ccache);
#ifdef KRB4
dest_tkt();
+#endif
if(k_hasafs())
k_unlog();
-#endif
} else
krb5_cc_close (context, ccache);
krb5_free_principal(context, principal);
diff --git a/crypto/heimdal/kuser/klist.1 b/crypto/heimdal/kuser/klist.1
index a0997d7..a144365 100644
--- a/crypto/heimdal/kuser/klist.1
+++ b/crypto/heimdal/kuser/klist.1
@@ -1,4 +1,35 @@
-.\" $Id: klist.1,v 1.11 2002/08/20 17:07:14 joda Exp $
+.\" Copyright (c) 2000 - 2002 Kungliga Tekniska Högskolan
+.\" (Royal Institute of Technology, Stockholm, Sweden).
+.\" All rights reserved.
+.\"
+.\" Redistribution and use in source and binary forms, with or without
+.\" modification, are permitted provided that the following conditions
+.\" are met:
+.\"
+.\" 1. Redistributions of source code must retain the above copyright
+.\" notice, this list of conditions and the following disclaimer.
+.\"
+.\" 2. Redistributions in binary form must reproduce the above copyright
+.\" notice, this list of conditions and the following disclaimer in the
+.\" documentation and/or other materials provided with the distribution.
+.\"
+.\" 3. Neither the name of the Institute nor the names of its contributors
+.\" may be used to endorse or promote products derived from this software
+.\" without specific prior written permission.
+.\"
+.\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
+.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+.\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
+.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+.\" SUCH DAMAGE.
+.\"
+.\" $Id: klist.1,v 1.12 2003/02/16 21:10:26 lha Exp $
.\"
.Dd July 8, 2000
.Dt KLIST 1
diff --git a/crypto/heimdal/kuser/klist.c b/crypto/heimdal/kuser/klist.c
index dbee058..79a1fa4 100644
--- a/crypto/heimdal/kuser/klist.c
+++ b/crypto/heimdal/kuser/klist.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997-2002 Kungliga Tekniska Högskolan
+ * Copyright (c) 1997-2003 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -34,7 +34,7 @@
#include "kuser_locl.h"
#include "rtbl.h"
-RCSID("$Id: klist.c,v 1.67.2.1 2002/10/21 14:31:27 joda Exp $");
+RCSID("$Id: klist.c,v 1.68.2.1 2003/05/08 18:59:56 lha Exp $");
static char*
printable_time(time_t t)
@@ -466,6 +466,7 @@ display_v4_tickets (int do_verbose)
*/
return 0;
}
+#endif /* KRB4 */
/*
* Print a list of all AFS tokens
@@ -500,7 +501,7 @@ display_tokens(int do_verbose)
continue;
if(parms.out_size < sizeof(size_secret_tok))
continue;
- t[parms.out_size] = 0;
+ t[min(parms.out_size,sizeof(t)-1)] = 0;
memcpy(&size_secret_tok, r, sizeof(size_secret_tok));
/* dont bother about the secret token */
r += size_secret_tok + sizeof(size_secret_tok);
@@ -536,7 +537,6 @@ display_tokens(int do_verbose)
putchar('\n');
}
}
-#endif /* KRB4 */
/*
* display the ccache in `cred_cache'
@@ -596,8 +596,8 @@ static int do_verbose = 0;
static int do_test = 0;
#ifdef KRB4
static int do_v4 = 1;
-static int do_tokens = 0;
#endif
+static int do_tokens = 0;
static int do_v5 = 1;
static char *cred_cache;
static int do_flags = 0;
@@ -612,9 +612,9 @@ static struct getargs args[] = {
#ifdef KRB4
{ "v4", '4', arg_flag, &do_v4,
"display v4 tickets", NULL },
+#endif
{ "tokens", 'T', arg_flag, &do_tokens,
"display AFS tokens", NULL },
-#endif
{ "v5", '5', arg_flag, &do_v5,
"display v5 cred cache", NULL},
{ "verbose", 'v', arg_flag, &do_verbose,
@@ -666,20 +666,24 @@ main (int argc, char **argv)
exit_status = display_v5_ccache (cred_cache, do_test,
do_verbose, do_flags);
-#ifdef KRB4
if (!do_test) {
+#ifdef KRB4
if (do_v4) {
if (do_v5)
printf ("\n");
display_v4_tickets (do_verbose);
}
+#endif
if (do_tokens && k_hasafs ()) {
- if (do_v4 || do_v5)
+ if (do_v5)
printf ("\n");
+#ifdef KRB4
+ else if (do_v4)
+ printf ("\n");
+#endif
display_tokens (do_verbose);
}
}
-#endif
return exit_status;
}
OpenPOWER on IntegriCloud