Rename kcc to heimtools.
This should prevent naming clashes with other utilities named 'kcc'. Signed-off-by: Love Hörnquist Åstrand <lha@h5l.org>
This commit is contained in:

committed by
Love Hörnquist Åstrand

parent
4d749f20e6
commit
2b365b2327
2
.gitignore
vendored
2
.gitignore
vendored
@@ -160,7 +160,7 @@ asn1_*.[cx]
|
|||||||
/kpasswd/kpasswdd
|
/kpasswd/kpasswdd
|
||||||
/kuser/copy_cred_cache
|
/kuser/copy_cred_cache
|
||||||
/kuser/generate-requests
|
/kuser/generate-requests
|
||||||
/kuser/kcc
|
/kuser/heimtools
|
||||||
/kuser/kdecode_ticket
|
/kuser/kdecode_ticket
|
||||||
/kuser/kdestroy
|
/kuser/kdestroy
|
||||||
/kuser/kdigest
|
/kuser/kdigest
|
||||||
|
@@ -15,7 +15,7 @@ man_MANS = \
|
|||||||
kgetcred.1 \
|
kgetcred.1 \
|
||||||
kimpersonate.8
|
kimpersonate.8
|
||||||
|
|
||||||
bin_PROGRAMS = kinit kdestroy kgetcred kcc
|
bin_PROGRAMS = kinit kdestroy kgetcred heimtools
|
||||||
libexec_PROGRAMS = kdigest kimpersonate
|
libexec_PROGRAMS = kdigest kimpersonate
|
||||||
|
|
||||||
noinst_PROGRAMS = kverify kdecode_ticket generate-requests
|
noinst_PROGRAMS = kverify kdecode_ticket generate-requests
|
||||||
@@ -33,15 +33,15 @@ kdestroy_LDADD = $(kinit_LDADD)
|
|||||||
|
|
||||||
kimpersonate_LDADD = $(kinit_LDADD)
|
kimpersonate_LDADD = $(kinit_LDADD)
|
||||||
|
|
||||||
kcc_LDADD = \
|
heimtools_LDADD = \
|
||||||
$(top_builddir)/lib/sl/libsl.la \
|
$(top_builddir)/lib/sl/libsl.la \
|
||||||
$(kinit_LDADD) \
|
$(kinit_LDADD) \
|
||||||
$(LIB_readline)
|
$(LIB_readline)
|
||||||
|
|
||||||
dist_kcc_SOURCES = kcc.c klist.c kswitch.c copy_cred_cache.c
|
dist_heimtools_SOURCES = heimtools.c klist.c kswitch.c copy_cred_cache.c
|
||||||
nodist_kcc_SOURCES = kcc-commands.c
|
nodist_heimtools_SOURCES = heimtools-commands.c
|
||||||
|
|
||||||
$(kcc_OBJECTS): kcc-commands.h
|
$(heimtools_OBJECTS): heimtools-commands.h
|
||||||
|
|
||||||
dist_kdigest_SOURCES = kdigest.c
|
dist_kdigest_SOURCES = kdigest.c
|
||||||
nodist_kdigest_SOURCES = kdigest-commands.c
|
nodist_kdigest_SOURCES = kdigest-commands.c
|
||||||
@@ -58,13 +58,13 @@ $(kdigest_OBJECTS): kdigest-commands.h
|
|||||||
|
|
||||||
CLEANFILES = \
|
CLEANFILES = \
|
||||||
kdigest-commands.h kdigest-commands.c \
|
kdigest-commands.h kdigest-commands.c \
|
||||||
kcc-commands.h kcc-commands.c
|
heimtools-commands.h heimtools-commands.c
|
||||||
|
|
||||||
kdigest-commands.c kdigest-commands.h: kdigest-commands.in
|
kdigest-commands.c kdigest-commands.h: kdigest-commands.in
|
||||||
$(SLC) $(srcdir)/kdigest-commands.in
|
$(SLC) $(srcdir)/kdigest-commands.in
|
||||||
|
|
||||||
kcc-commands.c kcc-commands.h: kcc-commands.in
|
heimtools-commands.c heimtools-commands.h: heimtools-commands.in
|
||||||
$(SLC) $(srcdir)/kcc-commands.in
|
$(SLC) $(srcdir)/heimtools-commands.in
|
||||||
|
|
||||||
LDADD = \
|
LDADD = \
|
||||||
$(top_builddir)/lib/krb5/libkrb5.la \
|
$(top_builddir)/lib/krb5/libkrb5.la \
|
||||||
@@ -73,16 +73,16 @@ LDADD = \
|
|||||||
$(LIB_roken)
|
$(LIB_roken)
|
||||||
|
|
||||||
EXTRA_DIST = NTMakefile $(man_MANS) \
|
EXTRA_DIST = NTMakefile $(man_MANS) \
|
||||||
kcc-version.rc \
|
heimtools-version.rc \
|
||||||
kdestroy-version.rc \
|
kdestroy-version.rc \
|
||||||
kdigest-version.rc \
|
kdigest-version.rc \
|
||||||
kgetcred-version.rc \
|
kgetcred-version.rc \
|
||||||
kimpersonate-version.rc \
|
kimpersonate-version.rc \
|
||||||
kinit-version.rc \
|
kinit-version.rc \
|
||||||
kuser_locl.h kcc-commands.in kdigest-commands.in copy_cred_cache.1
|
kuser_locl.h heimtools-commands.in kdigest-commands.in copy_cred_cache.1
|
||||||
|
|
||||||
# make sure install-exec-hook doesn't have any commands in Makefile.am.common
|
# make sure install-exec-hook doesn't have any commands in Makefile.am.common
|
||||||
install-exec-hook:
|
install-exec-hook:
|
||||||
(cd $(DESTDIR)$(bindir) && rm -f klist && $(LN_S) kcc klist)
|
(cd $(DESTDIR)$(bindir) && rm -f klist && $(LN_S) heimtools klist)
|
||||||
(cd $(DESTDIR)$(bindir) && rm -f kswitch && $(LN_S) kcc kswitch)
|
(cd $(DESTDIR)$(bindir) && rm -f kswitch && $(LN_S) heimtools kswitch)
|
||||||
|
|
||||||
|
@@ -37,7 +37,7 @@ intcflags=-I$(OBJ)
|
|||||||
|
|
||||||
BINPROGRAMS=\
|
BINPROGRAMS=\
|
||||||
$(BINDIR)\kinit.exe \
|
$(BINDIR)\kinit.exe \
|
||||||
$(BINDIR)\kcc.exe \
|
$(BINDIR)\heimtools.exe \
|
||||||
$(BINDIR)\kdestroy.exe \
|
$(BINDIR)\kdestroy.exe \
|
||||||
$(BINDIR)\kgetcred.exe \
|
$(BINDIR)\kgetcred.exe \
|
||||||
$(BINDIR)\kvno.exe \
|
$(BINDIR)\kvno.exe \
|
||||||
@@ -73,18 +73,18 @@ $(BINDIR)\kinit.exe: $(OBJ)\kinit.obj $(BINLIBS) $(OBJ)\kinit-version.res
|
|||||||
$(EXECONLINK)
|
$(EXECONLINK)
|
||||||
$(EXEPREP)
|
$(EXEPREP)
|
||||||
|
|
||||||
KCC_OBJS = \
|
HEIMTOOLS_OBJS = \
|
||||||
$(OBJ)\kcc-commands.obj \
|
$(OBJ)\heimtools-commands.obj \
|
||||||
$(OBJ)\kcc.obj \
|
$(OBJ)\heimtools.obj \
|
||||||
$(OBJ)\kswitch.obj \
|
$(OBJ)\kswitch.obj \
|
||||||
$(OBJ)\klist.obj \
|
$(OBJ)\klist.obj \
|
||||||
$(OBJ)\copy_cred_cache.obj
|
$(OBJ)\copy_cred_cache.obj
|
||||||
|
|
||||||
KCCLIBS=\
|
HEIMTOOLSLIBS=\
|
||||||
$(BINLIBS) \
|
$(BINLIBS) \
|
||||||
$(LIBSL)
|
$(LIBSL)
|
||||||
|
|
||||||
$(BINDIR)\kcc.exe: $(KCC_OBJS) $(KCCLIBS) $(OBJ)\kcc-version.res
|
$(BINDIR)\heimtools.exe: $(HEIMTOOLS_OBJS) $(HEIMTOOLSLIBS) $(OBJ)\heimtools-version.res
|
||||||
$(EXECONLINK)
|
$(EXECONLINK)
|
||||||
$(EXEPREP)
|
$(EXEPREP)
|
||||||
|
|
||||||
@@ -112,10 +112,10 @@ $(OBJ)\kdigest-commands.c $(OBJ)\kdigest-commands.h: kdigest-commands.in
|
|||||||
$(BINDIR)\slc.exe kdigest-commands.in
|
$(BINDIR)\slc.exe kdigest-commands.in
|
||||||
cd $(SRCDIR)
|
cd $(SRCDIR)
|
||||||
|
|
||||||
$(OBJ)\kcc-commands.c $(OBJ)\kcc-commands.h: kcc-commands.in
|
$(OBJ)\heimtools-commands.c $(OBJ)\heimtools-commands.h: heimtools-commands.in
|
||||||
cd $(OBJ)
|
cd $(OBJ)
|
||||||
$(CP) $(SRCDIR)\kcc-commands.in $(OBJ)
|
$(CP) $(SRCDIR)\heimtools-commands.in $(OBJ)
|
||||||
$(BINDIR)\slc.exe kcc-commands.in
|
$(BINDIR)\slc.exe heimtools-commands.in
|
||||||
cd $(SRCDIR)
|
cd $(SRCDIR)
|
||||||
|
|
||||||
$(LIBEXECDIR)\kimpersonate.exe: $(OBJ)\kimpersonate.obj $(BINLIBS) $(OBJ)\kimpersonate-version.res
|
$(LIBEXECDIR)\kimpersonate.exe: $(OBJ)\kimpersonate.obj $(BINLIBS) $(OBJ)\kimpersonate-version.res
|
||||||
@@ -132,4 +132,4 @@ $(BINDIR)\kcpytkt.exe: $(OBJ)\kcpytkt.obj $(BINLIBS)
|
|||||||
|
|
||||||
$(BINDIR)\kdeltkt.exe: $(OBJ)\kdeltkt.obj $(BINLIBS)
|
$(BINDIR)\kdeltkt.exe: $(OBJ)\kdeltkt.obj $(BINLIBS)
|
||||||
$(EXECONLINK)
|
$(EXECONLINK)
|
||||||
$(EXEPREP)
|
$(EXEPREP)
|
||||||
|
@@ -35,7 +35,7 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <parse_units.h>
|
#include <parse_units.h>
|
||||||
#include <parse_time.h>
|
#include <parse_time.h>
|
||||||
#include "kcc-commands.h"
|
#include "heimtools-commands.h"
|
||||||
|
|
||||||
static int32_t
|
static int32_t
|
||||||
bitswap32(int32_t b)
|
bitswap32(int32_t b)
|
||||||
@@ -92,20 +92,20 @@ copy_cred_cache(struct copy_cred_cache_options *opt, int argc, char **argv)
|
|||||||
memset(&ctx, 0, sizeof(ctx));
|
memset(&ctx, 0, sizeof(ctx));
|
||||||
|
|
||||||
if (opt->service_string) {
|
if (opt->service_string) {
|
||||||
ret = krb5_parse_name(kcc_context, opt->service_string, &ctx.mcreds.server);
|
ret = krb5_parse_name(heimtools_context, opt->service_string, &ctx.mcreds.server);
|
||||||
if (ret)
|
if (ret)
|
||||||
krb5_err(kcc_context, 1, ret, "%s", opt->service_string);
|
krb5_err(heimtools_context, 1, ret, "%s", opt->service_string);
|
||||||
}
|
}
|
||||||
if (opt->enctype_string) {
|
if (opt->enctype_string) {
|
||||||
krb5_enctype enctype;
|
krb5_enctype enctype;
|
||||||
ret = krb5_string_to_enctype(kcc_context, opt->enctype_string, &enctype);
|
ret = krb5_string_to_enctype(heimtools_context, opt->enctype_string, &enctype);
|
||||||
if (ret)
|
if (ret)
|
||||||
krb5_err(kcc_context, 1, ret, "%s", opt->enctype_string);
|
krb5_err(heimtools_context, 1, ret, "%s", opt->enctype_string);
|
||||||
ctx.whichfields |= KRB5_TC_MATCH_KEYTYPE;
|
ctx.whichfields |= KRB5_TC_MATCH_KEYTYPE;
|
||||||
ctx.mcreds.session.keytype = enctype;
|
ctx.mcreds.session.keytype = enctype;
|
||||||
}
|
}
|
||||||
if (opt->flags_string) {
|
if (opt->flags_string) {
|
||||||
parse_ticket_flags(kcc_context, opt->flags_string, &ctx.mcreds.flags);
|
parse_ticket_flags(heimtools_context, opt->flags_string, &ctx.mcreds.flags);
|
||||||
ctx.whichfields |= KRB5_TC_MATCH_FLAGS;
|
ctx.whichfields |= KRB5_TC_MATCH_FLAGS;
|
||||||
}
|
}
|
||||||
if (opt->valid_for_string) {
|
if (opt->valid_for_string) {
|
||||||
@@ -116,48 +116,48 @@ copy_cred_cache(struct copy_cred_cache_options *opt, int argc, char **argv)
|
|||||||
ctx.whichfields |= KRB5_TC_MATCH_TIMES;
|
ctx.whichfields |= KRB5_TC_MATCH_TIMES;
|
||||||
}
|
}
|
||||||
if (opt->fcache_version_integer)
|
if (opt->fcache_version_integer)
|
||||||
krb5_set_fcache_version(kcc_context, opt->fcache_version_integer);
|
krb5_set_fcache_version(heimtools_context, opt->fcache_version_integer);
|
||||||
|
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
from_name = krb5_cc_default_name(kcc_context);
|
from_name = krb5_cc_default_name(heimtools_context);
|
||||||
to_name = argv[0];
|
to_name = argv[0];
|
||||||
} else {
|
} else {
|
||||||
from_name = argv[0];
|
from_name = argv[0];
|
||||||
to_name = argv[1];
|
to_name = argv[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = krb5_cc_resolve(kcc_context, from_name, &from_ccache);
|
ret = krb5_cc_resolve(heimtools_context, from_name, &from_ccache);
|
||||||
if (ret)
|
if (ret)
|
||||||
krb5_err(kcc_context, 1, ret, "%s", from_name);
|
krb5_err(heimtools_context, 1, ret, "%s", from_name);
|
||||||
|
|
||||||
if (opt->krbtgt_only_flag) {
|
if (opt->krbtgt_only_flag) {
|
||||||
krb5_principal client;
|
krb5_principal client;
|
||||||
ret = krb5_cc_get_principal(kcc_context, from_ccache, &client);
|
ret = krb5_cc_get_principal(heimtools_context, from_ccache, &client);
|
||||||
if (ret)
|
if (ret)
|
||||||
krb5_err(kcc_context, 1, ret, "getting default principal");
|
krb5_err(heimtools_context, 1, ret, "getting default principal");
|
||||||
ret = krb5_make_principal(kcc_context, &ctx.mcreds.server,
|
ret = krb5_make_principal(heimtools_context, &ctx.mcreds.server,
|
||||||
krb5_principal_get_realm(kcc_context, client),
|
krb5_principal_get_realm(heimtools_context, client),
|
||||||
KRB5_TGS_NAME,
|
KRB5_TGS_NAME,
|
||||||
krb5_principal_get_realm(kcc_context, client),
|
krb5_principal_get_realm(heimtools_context, client),
|
||||||
NULL);
|
NULL);
|
||||||
if (ret)
|
if (ret)
|
||||||
krb5_err(kcc_context, 1, ret, "constructing krbtgt principal");
|
krb5_err(heimtools_context, 1, ret, "constructing krbtgt principal");
|
||||||
krb5_free_principal(kcc_context, client);
|
krb5_free_principal(heimtools_context, client);
|
||||||
}
|
}
|
||||||
ret = krb5_cc_resolve(kcc_context, to_name, &to_ccache);
|
ret = krb5_cc_resolve(heimtools_context, to_name, &to_ccache);
|
||||||
if (ret)
|
if (ret)
|
||||||
krb5_err(kcc_context, 1, ret, "%s", to_name);
|
krb5_err(heimtools_context, 1, ret, "%s", to_name);
|
||||||
|
|
||||||
ret = krb5_cc_copy_match_f(kcc_context, from_ccache, to_ccache,
|
ret = krb5_cc_copy_match_f(heimtools_context, from_ccache, to_ccache,
|
||||||
matchfunc, &ctx, &matched);
|
matchfunc, &ctx, &matched);
|
||||||
if (ret)
|
if (ret)
|
||||||
krb5_err(kcc_context, 1, ret, "copying cred cache");
|
krb5_err(heimtools_context, 1, ret, "copying cred cache");
|
||||||
|
|
||||||
krb5_cc_close(kcc_context, from_ccache);
|
krb5_cc_close(heimtools_context, from_ccache);
|
||||||
if(matched == 0)
|
if(matched == 0)
|
||||||
krb5_cc_destroy(kcc_context, to_ccache);
|
krb5_cc_destroy(heimtools_context, to_ccache);
|
||||||
else
|
else
|
||||||
krb5_cc_close(kcc_context, to_ccache);
|
krb5_cc_close(heimtools_context, to_ccache);
|
||||||
|
|
||||||
return matched == 0;
|
return matched == 0;
|
||||||
}
|
}
|
||||||
|
239
kuser/heimtools-commands.in
Normal file
239
kuser/heimtools-commands.in
Normal file
@@ -0,0 +1,239 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2010 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
command = {
|
||||||
|
name = "klist"
|
||||||
|
name = "list"
|
||||||
|
help = "List kerberos tickets"
|
||||||
|
option = {
|
||||||
|
long = "cache"
|
||||||
|
short = "c"
|
||||||
|
type = "string"
|
||||||
|
help = "credential cache to list"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
name = "flags"
|
||||||
|
short = "f"
|
||||||
|
type = "flag"
|
||||||
|
help = "list flags"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
long = "test"
|
||||||
|
short = "t"
|
||||||
|
type = "flag"
|
||||||
|
help = "test for having tickets"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
name = "s"
|
||||||
|
short = "s"
|
||||||
|
type = "flag"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
long = "tokens"
|
||||||
|
short = "T"
|
||||||
|
type = "flag"
|
||||||
|
help = "display AFS tokens"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
long = "v5"
|
||||||
|
short = "5"
|
||||||
|
type = "flag"
|
||||||
|
default = "1"
|
||||||
|
help = "display v5 credential tokens"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
long = "all-content"
|
||||||
|
short = "A"
|
||||||
|
type = "flag"
|
||||||
|
help = "List all caches with their content"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
long = "list-all"
|
||||||
|
short = "l"
|
||||||
|
type = "flag"
|
||||||
|
help = "List all caches"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
long = "verbose"
|
||||||
|
short = "v"
|
||||||
|
type = "flag"
|
||||||
|
help = "Verbose output"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
name = "a"
|
||||||
|
short = "a"
|
||||||
|
type = "flag"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
name = "n"
|
||||||
|
short = "n"
|
||||||
|
type = "flag"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
long = "hidden"
|
||||||
|
type = "flag"
|
||||||
|
help = "Verbose output"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
command = {
|
||||||
|
name = "kgetcred"
|
||||||
|
help = "Acquire a Kerberos ticket"
|
||||||
|
option = {
|
||||||
|
long = "enctype"
|
||||||
|
short = "e"
|
||||||
|
type = "string"
|
||||||
|
argument = "enctype"
|
||||||
|
help = "Encryption type to use"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
long = "cache"
|
||||||
|
short = "c"
|
||||||
|
type = "string"
|
||||||
|
argument = "cachename"
|
||||||
|
help = "Credentials cache"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
command = {
|
||||||
|
name = "kswitch"
|
||||||
|
name = "switch"
|
||||||
|
help = "Switch default kerberos cache"
|
||||||
|
option = {
|
||||||
|
long = "type"
|
||||||
|
short = "t"
|
||||||
|
type = "string"
|
||||||
|
help = "type of credential cache"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
long = "cache"
|
||||||
|
short = "c"
|
||||||
|
type = "string"
|
||||||
|
help = "name of credential cache"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
long = "principal"
|
||||||
|
short = "p"
|
||||||
|
type = "string"
|
||||||
|
help = "name of principal"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
long = "interactive"
|
||||||
|
short = "i"
|
||||||
|
type = "flag"
|
||||||
|
help = "interactive selection"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
command = {
|
||||||
|
name = "kvno"
|
||||||
|
help = "Acquire a Kerberos ticket"
|
||||||
|
option = {
|
||||||
|
long = "enctype"
|
||||||
|
short = "e"
|
||||||
|
type = "string"
|
||||||
|
argument = "enctype"
|
||||||
|
help = "Encryption type to use"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
long = "cache"
|
||||||
|
short = "c"
|
||||||
|
type = "string"
|
||||||
|
argument = "cachename"
|
||||||
|
help = "Credentials cache"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
long = "keytab"
|
||||||
|
short = "k"
|
||||||
|
type = "string"
|
||||||
|
argument = "keytabname"
|
||||||
|
help = "Keytab to use"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
long = "server"
|
||||||
|
short = "S"
|
||||||
|
type = "string"
|
||||||
|
argument = "principal"
|
||||||
|
help = "Server to get ticket for"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
long = "quiet"
|
||||||
|
short = "q"
|
||||||
|
type = "flag"
|
||||||
|
help = "Quiet"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
command = {
|
||||||
|
name = "copy_cred_cache"
|
||||||
|
option = {
|
||||||
|
long = "krbtgt-only"
|
||||||
|
type = "flag"
|
||||||
|
help = "only copy local krbtgt"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
long = "service"
|
||||||
|
type = "string"
|
||||||
|
help = "limit to this service"
|
||||||
|
argument = "service"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
long = "enctype"
|
||||||
|
type = "string"
|
||||||
|
help = "limit to this enctype"
|
||||||
|
argument = "enctype"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
long = "flags"
|
||||||
|
type = "string"
|
||||||
|
help = "limit to these flags"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
long = "valid-for"
|
||||||
|
type = "string"
|
||||||
|
help = "limit to creds valid for at least this long"
|
||||||
|
argument = "time"
|
||||||
|
}
|
||||||
|
option = {
|
||||||
|
long = "fcache-version"
|
||||||
|
type = "integer"
|
||||||
|
help = "file cache version to create"
|
||||||
|
}
|
||||||
|
min_args = "1"
|
||||||
|
max_args = "2"
|
||||||
|
help = "Copies credential caches"
|
||||||
|
}
|
||||||
|
command = {
|
||||||
|
name = "help"
|
||||||
|
name = "?"
|
||||||
|
argument = "[command]"
|
||||||
|
min_args = "0"
|
||||||
|
max_args = "1"
|
||||||
|
help = "Help! I need somebody."
|
||||||
|
}
|
@@ -31,6 +31,6 @@
|
|||||||
|
|
||||||
#define RC_FILE_TYPE VFT_APP
|
#define RC_FILE_TYPE VFT_APP
|
||||||
#define RC_FILE_DESC_0409 "Ticket tool"
|
#define RC_FILE_DESC_0409 "Ticket tool"
|
||||||
#define RC_FILE_ORIG_0409 "kcc.exe"
|
#define RC_FILE_ORIG_0409 "heimtools.exe"
|
||||||
|
|
||||||
#include "../windows/version.rc"
|
#include "../windows/version.rc"
|
@@ -36,7 +36,7 @@
|
|||||||
#include "kuser_locl.h"
|
#include "kuser_locl.h"
|
||||||
#include "rtbl.h"
|
#include "rtbl.h"
|
||||||
#include "parse_units.h"
|
#include "parse_units.h"
|
||||||
#include "kcc-commands.h"
|
#include "heimtools-commands.h"
|
||||||
|
|
||||||
static char*
|
static char*
|
||||||
printable_time_internal(time_t t, int x)
|
printable_time_internal(time_t t, int x)
|
||||||
@@ -583,7 +583,7 @@ klist(struct klist_options *opt, int argc, char **argv)
|
|||||||
opt->s_flag;
|
opt->s_flag;
|
||||||
|
|
||||||
if (opt->list_all_flag) {
|
if (opt->list_all_flag) {
|
||||||
exit_status = list_caches(kcc_context);
|
exit_status = list_caches(heimtools_context);
|
||||||
return exit_status;
|
return exit_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -593,30 +593,30 @@ klist(struct klist_options *opt, int argc, char **argv)
|
|||||||
if (opt->all_content_flag) {
|
if (opt->all_content_flag) {
|
||||||
krb5_cc_cache_cursor cursor;
|
krb5_cc_cache_cursor cursor;
|
||||||
|
|
||||||
ret = krb5_cc_cache_get_first(kcc_context, NULL, &cursor);
|
ret = krb5_cc_cache_get_first(heimtools_context, NULL, &cursor);
|
||||||
if (ret)
|
if (ret)
|
||||||
krb5_err(kcc_context, 1, ret, "krb5_cc_cache_get_first");
|
krb5_err(heimtools_context, 1, ret, "krb5_cc_cache_get_first");
|
||||||
|
|
||||||
|
|
||||||
while (krb5_cc_cache_next(kcc_context, cursor, &id) == 0) {
|
while (krb5_cc_cache_next(heimtools_context, cursor, &id) == 0) {
|
||||||
exit_status |= display_v5_ccache(kcc_context, id, do_test,
|
exit_status |= display_v5_ccache(heimtools_context, id, do_test,
|
||||||
do_verbose, opt->flags_flag,
|
do_verbose, opt->flags_flag,
|
||||||
opt->hidden_flag);
|
opt->hidden_flag);
|
||||||
printf("\n\n");
|
printf("\n\n");
|
||||||
}
|
}
|
||||||
krb5_cc_cache_end_seq_get(kcc_context, cursor);
|
krb5_cc_cache_end_seq_get(heimtools_context, cursor);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if(opt->cache_string) {
|
if(opt->cache_string) {
|
||||||
ret = krb5_cc_resolve(kcc_context, opt->cache_string, &id);
|
ret = krb5_cc_resolve(heimtools_context, opt->cache_string, &id);
|
||||||
if (ret)
|
if (ret)
|
||||||
krb5_err(kcc_context, 1, ret, "%s", opt->cache_string);
|
krb5_err(heimtools_context, 1, ret, "%s", opt->cache_string);
|
||||||
} else {
|
} else {
|
||||||
ret = krb5_cc_default(kcc_context, &id);
|
ret = krb5_cc_default(heimtools_context, &id);
|
||||||
if (ret)
|
if (ret)
|
||||||
krb5_err(kcc_context, 1, ret, "krb5_cc_resolve");
|
krb5_err(heimtools_context, 1, ret, "krb5_cc_resolve");
|
||||||
}
|
}
|
||||||
exit_status = display_v5_ccache(kcc_context, id, do_test,
|
exit_status = display_v5_ccache(heimtools_context, id, do_test,
|
||||||
do_verbose, opt->flags_flag,
|
do_verbose, opt->flags_flag,
|
||||||
opt->hidden_flag);
|
opt->hidden_flag);
|
||||||
}
|
}
|
||||||
|
@@ -32,7 +32,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "kuser_locl.h"
|
#include "kuser_locl.h"
|
||||||
#include "kcc-commands.h"
|
#include "heimtools-commands.h"
|
||||||
|
|
||||||
#ifdef HAVE_READLINE
|
#ifdef HAVE_READLINE
|
||||||
char *readline(const char *prompt);
|
char *readline(const char *prompt);
|
||||||
@@ -63,7 +63,7 @@ kswitch(struct kswitch_options *opt, int argc, char **argv)
|
|||||||
krb5_ccache id = NULL;
|
krb5_ccache id = NULL;
|
||||||
|
|
||||||
if (opt->cache_string && opt->principal_string)
|
if (opt->cache_string && opt->principal_string)
|
||||||
krb5_errx(kcc_context, 1,
|
krb5_errx(heimtools_context, 1,
|
||||||
N_("Both --cache and --principal given, choose one", ""));
|
N_("Both --cache and --principal given, choose one", ""));
|
||||||
|
|
||||||
if (opt->interactive_flag) {
|
if (opt->interactive_flag) {
|
||||||
@@ -81,32 +81,32 @@ kswitch(struct kswitch_options *opt, int argc, char **argv)
|
|||||||
rtbl_add_column_by_id(ct, 2, "Type", 0);
|
rtbl_add_column_by_id(ct, 2, "Type", 0);
|
||||||
rtbl_set_column_affix_by_id(ct, 2, " ", "");
|
rtbl_set_column_affix_by_id(ct, 2, " ", "");
|
||||||
|
|
||||||
ret = krb5_cc_cache_get_first(kcc_context, NULL, &cursor);
|
ret = krb5_cc_cache_get_first(heimtools_context, NULL, &cursor);
|
||||||
if (ret)
|
if (ret)
|
||||||
krb5_err(kcc_context, 1, ret, "krb5_cc_cache_get_first");
|
krb5_err(heimtools_context, 1, ret, "krb5_cc_cache_get_first");
|
||||||
|
|
||||||
while (krb5_cc_cache_next(kcc_context, cursor, &id) == 0) {
|
while (krb5_cc_cache_next(heimtools_context, cursor, &id) == 0) {
|
||||||
krb5_principal p;
|
krb5_principal p;
|
||||||
char num[10];
|
char num[10];
|
||||||
|
|
||||||
ret = krb5_cc_get_principal(kcc_context, id, &p);
|
ret = krb5_cc_get_principal(heimtools_context, id, &p);
|
||||||
if (ret)
|
if (ret)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
ret = krb5_unparse_name(kcc_context, p, &name);
|
ret = krb5_unparse_name(heimtools_context, p, &name);
|
||||||
krb5_free_principal(kcc_context, p);
|
krb5_free_principal(heimtools_context, p);
|
||||||
|
|
||||||
snprintf(num, sizeof(num), "%d", (int)(len + 1));
|
snprintf(num, sizeof(num), "%d", (int)(len + 1));
|
||||||
rtbl_add_column_entry_by_id(ct, 0, num);
|
rtbl_add_column_entry_by_id(ct, 0, num);
|
||||||
rtbl_add_column_entry_by_id(ct, 1, name);
|
rtbl_add_column_entry_by_id(ct, 1, name);
|
||||||
rtbl_add_column_entry_by_id(ct, 2, krb5_cc_get_type(kcc_context, id));
|
rtbl_add_column_entry_by_id(ct, 2, krb5_cc_get_type(heimtools_context, id));
|
||||||
free(name);
|
free(name);
|
||||||
|
|
||||||
ids = erealloc(ids, (len + 1) * sizeof(ids[0]));
|
ids = erealloc(ids, (len + 1) * sizeof(ids[0]));
|
||||||
ids[len] = id;
|
ids[len] = id;
|
||||||
len++;
|
len++;
|
||||||
}
|
}
|
||||||
krb5_cc_cache_end_seq_get(kcc_context, cursor);
|
krb5_cc_cache_end_seq_get(heimtools_context, cursor);
|
||||||
|
|
||||||
rtbl_format(ct, stdout);
|
rtbl_format(ct, stdout);
|
||||||
rtbl_destroy(ct);
|
rtbl_destroy(ct);
|
||||||
@@ -115,59 +115,59 @@ kswitch(struct kswitch_options *opt, int argc, char **argv)
|
|||||||
if (name) {
|
if (name) {
|
||||||
i = atoi(name);
|
i = atoi(name);
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
krb5_errx(kcc_context, 1, "Cache number '%s' is invalid", name);
|
krb5_errx(heimtools_context, 1, "Cache number '%s' is invalid", name);
|
||||||
if (i > len)
|
if (i > len)
|
||||||
krb5_errx(kcc_context, 1, "Cache number '%s' is too large", name);
|
krb5_errx(heimtools_context, 1, "Cache number '%s' is too large", name);
|
||||||
|
|
||||||
id = ids[i - 1];
|
id = ids[i - 1];
|
||||||
ids[i - 1] = NULL;
|
ids[i - 1] = NULL;
|
||||||
} else
|
} else
|
||||||
krb5_errx(kcc_context, 1, "No cache selected");
|
krb5_errx(heimtools_context, 1, "No cache selected");
|
||||||
for (i = 0; i < len; i++)
|
for (i = 0; i < len; i++)
|
||||||
if (ids[i])
|
if (ids[i])
|
||||||
krb5_cc_close(kcc_context, ids[i]);
|
krb5_cc_close(heimtools_context, ids[i]);
|
||||||
|
|
||||||
} else if (opt->principal_string) {
|
} else if (opt->principal_string) {
|
||||||
krb5_principal p;
|
krb5_principal p;
|
||||||
|
|
||||||
ret = krb5_parse_name(kcc_context, opt->principal_string, &p);
|
ret = krb5_parse_name(heimtools_context, opt->principal_string, &p);
|
||||||
if (ret)
|
if (ret)
|
||||||
krb5_err(kcc_context, 1, ret, "krb5_parse_name: %s",
|
krb5_err(heimtools_context, 1, ret, "krb5_parse_name: %s",
|
||||||
opt->principal_string);
|
opt->principal_string);
|
||||||
|
|
||||||
ret = krb5_cc_cache_match(kcc_context, p, &id);
|
ret = krb5_cc_cache_match(heimtools_context, p, &id);
|
||||||
if (ret)
|
if (ret)
|
||||||
krb5_err(kcc_context, 1, ret,
|
krb5_err(heimtools_context, 1, ret,
|
||||||
N_("Did not find principal: %s", ""),
|
N_("Did not find principal: %s", ""),
|
||||||
opt->principal_string);
|
opt->principal_string);
|
||||||
|
|
||||||
krb5_free_principal(kcc_context, p);
|
krb5_free_principal(heimtools_context, p);
|
||||||
|
|
||||||
} else if (opt->cache_string) {
|
} else if (opt->cache_string) {
|
||||||
const krb5_cc_ops *ops;
|
const krb5_cc_ops *ops;
|
||||||
char *str;
|
char *str;
|
||||||
int aret;
|
int aret;
|
||||||
|
|
||||||
ops = krb5_cc_get_prefix_ops(kcc_context, opt->type_string);
|
ops = krb5_cc_get_prefix_ops(heimtools_context, opt->type_string);
|
||||||
if (ops == NULL)
|
if (ops == NULL)
|
||||||
krb5_err(kcc_context, 1, 0, "krb5_cc_get_prefix_ops");
|
krb5_err(heimtools_context, 1, 0, "krb5_cc_get_prefix_ops");
|
||||||
|
|
||||||
aret = asprintf(&str, "%s:%s", ops->prefix, opt->cache_string);
|
aret = asprintf(&str, "%s:%s", ops->prefix, opt->cache_string);
|
||||||
if (aret == -1)
|
if (aret == -1)
|
||||||
krb5_errx(kcc_context, 1, N_("out of memory", ""));
|
krb5_errx(heimtools_context, 1, N_("out of memory", ""));
|
||||||
|
|
||||||
ret = krb5_cc_resolve(kcc_context, str, &id);
|
ret = krb5_cc_resolve(heimtools_context, str, &id);
|
||||||
if (ret)
|
if (ret)
|
||||||
krb5_err(kcc_context, 1, ret, "krb5_cc_resolve: %s", str);
|
krb5_err(heimtools_context, 1, ret, "krb5_cc_resolve: %s", str);
|
||||||
|
|
||||||
free(str);
|
free(str);
|
||||||
} else {
|
} else {
|
||||||
krb5_errx(kcc_context, 1, "missing option for kswitch");
|
krb5_errx(heimtools_context, 1, "missing option for kswitch");
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = krb5_cc_switch(kcc_context, id);
|
ret = krb5_cc_switch(heimtools_context, id);
|
||||||
if (ret)
|
if (ret)
|
||||||
krb5_err(kcc_context, 1, ret, "krb5_cc_switch");
|
krb5_err(heimtools_context, 1, ret, "krb5_cc_switch");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@@ -103,6 +103,6 @@
|
|||||||
#define textdomain(package)
|
#define textdomain(package)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern krb5_context kcc_context;
|
extern krb5_context heimtools_context;
|
||||||
|
|
||||||
#endif /* __KUSER_LOCL_H__ */
|
#endif /* __KUSER_LOCL_H__ */
|
||||||
|
@@ -15,7 +15,7 @@
|
|||||||
<?define GuidKvno=2B932C2B-9167-4051-BDF7-A104E9983CE6 ?>
|
<?define GuidKvno=2B932C2B-9167-4051-BDF7-A104E9983CE6 ?>
|
||||||
<?define GuidKcpytkt=17734691-7CB3-4E9A-AADC-6D4205795F43 ?>
|
<?define GuidKcpytkt=17734691-7CB3-4E9A-AADC-6D4205795F43 ?>
|
||||||
<?define GuidKdeltkt=3E853905-8CDA-4E14-8EBA-C0C4EEDB811A ?>
|
<?define GuidKdeltkt=3E853905-8CDA-4E14-8EBA-C0C4EEDB811A ?>
|
||||||
<?define GuidKcc=F411A9F1-A186-40CB-B55B-CADBE0166268 ?>
|
<?define GuidHeimtools=F411A9F1-A186-40CB-B55B-CADBE0166268 ?>
|
||||||
|
|
||||||
<?define ConfigDir=INSTALLDIR64 ?>
|
<?define ConfigDir=INSTALLDIR64 ?>
|
||||||
|
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
<?define GuidKvno=4C6015BE-1347-4D12-8841-FF90E0B9D6A8 ?>
|
<?define GuidKvno=4C6015BE-1347-4D12-8841-FF90E0B9D6A8 ?>
|
||||||
<?define GuidKcpytkt=CBCDFC80-601B-4F26-A020-7D1278735B95 ?>
|
<?define GuidKcpytkt=CBCDFC80-601B-4F26-A020-7D1278735B95 ?>
|
||||||
<?define GuidKdeltkt=6450EE72-E472-4709-B457-B579BFB2472B ?>
|
<?define GuidKdeltkt=6450EE72-E472-4709-B457-B579BFB2472B ?>
|
||||||
<?define GuidKcc=11800964-4A5F-466E-B2FE-DD2EFC54DDB9 ?>
|
<?define GuidHeimtools=11800964-4A5F-466E-B2FE-DD2EFC54DDB9 ?>
|
||||||
|
|
||||||
<?define ConfigDir=INSTALLDIR32 ?>
|
<?define ConfigDir=INSTALLDIR32 ?>
|
||||||
|
|
||||||
@@ -187,14 +187,14 @@
|
|||||||
<File Name='kdeltkt.pdb' />
|
<File Name='kdeltkt.pdb' />
|
||||||
</Component>
|
</Component>
|
||||||
|
|
||||||
<Component Id='comp.kcc'
|
<Component Id='comp.heimtools'
|
||||||
Guid='$(var.GuidKcc)'
|
Guid='$(var.GuidHeimtools)'
|
||||||
Win64='$(var.Win64)'>
|
Win64='$(var.Win64)'>
|
||||||
<File Name='kcc.exe' KeyPath='yes'>
|
<File Name='heimtools.exe' KeyPath='yes'>
|
||||||
<CopyFile Id='klist.exe' DestinationName='klist.exe' DestinationProperty='$(var.ToolsBinDir)' />
|
<CopyFile Id='klist.exe' DestinationName='klist.exe' DestinationProperty='$(var.ToolsBinDir)' />
|
||||||
<CopyFile Id='kswitch.exe' DestinationName='kswitch.exe' DestinationProperty='$(var.ToolsBinDir)' />
|
<CopyFile Id='kswitch.exe' DestinationName='kswitch.exe' DestinationProperty='$(var.ToolsBinDir)' />
|
||||||
</File>
|
</File>
|
||||||
<File Name='kcc.pdb'>
|
<File Name='heimtools.pdb'>
|
||||||
<CopyFile Id='klist.pdb' DestinationName='klist.pdb' />
|
<CopyFile Id='klist.pdb' DestinationName='klist.pdb' />
|
||||||
<CopyFile Id='kswitch.pdb' DestinationName='kswitch.pdb' />
|
<CopyFile Id='kswitch.pdb' DestinationName='kswitch.pdb' />
|
||||||
</File>
|
</File>
|
||||||
@@ -370,7 +370,7 @@
|
|||||||
<ComponentRef Id='comp.krb5.ini.move' />
|
<ComponentRef Id='comp.krb5.ini.move' />
|
||||||
<ComponentRef Id='comp.ktutil' />
|
<ComponentRef Id='comp.ktutil' />
|
||||||
<ComponentRef Id='comp.kvno' />
|
<ComponentRef Id='comp.kvno' />
|
||||||
<ComponentRef Id='comp.kcc' />
|
<ComponentRef Id='comp.heimtool' />
|
||||||
|
|
||||||
<?ifdef LsaCache ?>
|
<?ifdef LsaCache ?>
|
||||||
<?ifdef Target64?>
|
<?ifdef Target64?>
|
||||||
|
@@ -25,10 +25,10 @@ kdigest="${TESTS_ENVIRONMENT} ${top_builddir}/kuser/kdigest"
|
|||||||
kgetcred="${TESTS_ENVIRONMENT} ${top_builddir}/kuser/kgetcred"
|
kgetcred="${TESTS_ENVIRONMENT} ${top_builddir}/kuser/kgetcred"
|
||||||
kimpersonate="${TESTS_ENVIRONMENT} ${top_builddir}/kuser/kimpersonate"
|
kimpersonate="${TESTS_ENVIRONMENT} ${top_builddir}/kuser/kimpersonate"
|
||||||
kinit="${TESTS_ENVIRONMENT} ${top_builddir}/kuser/kinit"
|
kinit="${TESTS_ENVIRONMENT} ${top_builddir}/kuser/kinit"
|
||||||
klist="${TESTS_ENVIRONMENT} ${top_builddir}/kuser/kcc klist"
|
klist="${TESTS_ENVIRONMENT} ${top_builddir}/kuser/heimtools klist"
|
||||||
kpasswd="${TESTS_ENVIRONMENT} ${top_builddir}/kpasswd/kpasswd"
|
kpasswd="${TESTS_ENVIRONMENT} ${top_builddir}/kpasswd/kpasswd"
|
||||||
kpasswdd="${TESTS_ENVIRONMENT} ${top_builddir}/kpasswd/kpasswdd"
|
kpasswdd="${TESTS_ENVIRONMENT} ${top_builddir}/kpasswd/kpasswdd"
|
||||||
kswitch="${TESTS_ENVIRONMENT} ${top_builddir}/kuser/kcc kswitch"
|
kswitch="${TESTS_ENVIRONMENT} ${top_builddir}/kuser/heimtools kswitch"
|
||||||
ktutil="${TESTS_ENVIRONMENT} ${top_builddir}/admin/ktutil"
|
ktutil="${TESTS_ENVIRONMENT} ${top_builddir}/admin/ktutil"
|
||||||
gsstool="${TESTS_ENVIRONMENT} ${top_builddir}/lib/gssapi/gsstool"
|
gsstool="${TESTS_ENVIRONMENT} ${top_builddir}/lib/gssapi/gsstool"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user