From c365b64a31142a6ae4628741dd5b695ac66bb2a3 Mon Sep 17 00:00:00 2001 From: Keith Vetter Date: Fri, 31 Mar 1995 02:05:49 +0000 Subject: [PATCH] Commit on the whole tree to make a checkpoint for a working windows world git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5315 dc483132-0cff-0310-8789-dd5450dbe970 --- src/Makefile | 380 ++++++++++++++++++++++- src/include/krb5/ChangeLog | 4 + src/include/krb5/func-proto.h | 12 + src/lib/ChangeLog | 5 + src/lib/gssapi/krb5/ChangeLog | 5 + src/lib/gssapi/krb5/accept_sec_context.c | 2 +- src/lib/krb5/krb/ChangeLog | 4 + src/lib/krb5/krb/rd_req.c | 1 - src/lib/krb5/os/ChangeLog | 5 + src/lib/krb5/os/localaddr.c | 4 +- src/lib/libkrb5.def | 374 +--------------------- src/windows/cns/changelo | 11 +- src/windows/cns/cns.c | 120 ++++--- src/windows/cns/cns.h | 48 ++- src/windows/cns/cns.rc | 96 ++++-- src/windows/cns/makefile | 2 +- src/windows/cns/tktlist.c | 62 +++- 17 files changed, 661 insertions(+), 474 deletions(-) diff --git a/src/Makefile b/src/Makefile index f605e5a2e..2f2063505 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,4 +1,376 @@ -all: - @echo Please read the build instructions in ../doc/HOW_TO_BUILD - @echo before proceeding. You will need to run ./configure with - @echo the appropriate arguments. +## config/pre.in +## common prefix for all Makefile.in in the Kerberos V5 tree. + +WHAT = unix + +# Directory syntax: +R=/ +C=./ +S=/ +U=../ + +BUILDTOP = . +srcdir = . + +CPPFLAGS = +DEFS = -DHAVE_LIBNSL=1 $(CPPFLAGS) +CC = gcc +LD = $(PURE) gcc +CCOPTS = +LIBS = -lnsl +KRB5ROOT= /krb5 +KRB4=/usr/kerberos +INSTALL=@INSTALL@ +INSTALL_PROGRAM=@INSTALL_PROGRAM@ -s +INSTALL_DATA=@INSTALL_DATA@ +INSTALL_SETUID=$(INSTALL) -s -m 4755 + +KRB5MANROOT = $(KRB5ROOT)/man +ADMIN_BINDIR = $(KRB5ROOT)/admin +SERVER_BINDIR = $(KRB5ROOT)/sbin +CLIENT_BINDIR = $(KRB5ROOT)/bin +ADMIN_MANDIR = $(KRB5MANROOT)/man8 +SERVER_MANDIR = $(KRB5MANROOT)/man8 +CLIENT_MANDIR = $(KRB5MANROOT)/man1 +FILE_MANDIR = $(KRB5MANROOT)/man5 +KRB5_LIBDIR = $(KRB5ROOT)/lib +KRB5_INCDIR = $(KRB5ROOT)/include +KRB5_INCSUBDIRS = \ + $(KRB5_INCDIR)/krb5 \ + $(KRB5_INCDIR)/asn.1 \ + $(KRB5_INCDIR)/kerberosIV + + +RM = rm -f +CP = cp +MV = mv -f +CHMOD=chmod +RANLIB = @RANLIB@ +ARCHIVE = @ARCHIVE@ +ARADD = @ARADD@ +LN = @LN_S@ +AWK = @AWK@ +LEX = @LEX@ +LEXLIB = @LEXLIB@ +YACC = @YACC@ + +SRCTOP = $(srcdir)/$(BUILDTOP) +SUBDIRS = util include lib kdc admin kadmin slave clients appl tests + +TOPLIBD = $(BUILDTOP)/lib + +OBJEXT = o +LIBEXT = a +EXEEXT = + +all:: +# Generated automatically from Makefile.in by configure. +CFLAGS = $(CCOPTS) $(DEFS) + +##DOSBUILDTOP = . +##DOS!include $(BUILDTOP)\config\windows.in + +prefix = /usr/local +exec_prefix = $(prefix) +binprefix = +manprefix = + +bindir = $(exec_prefix)/bin +libdir = $(exec_prefix)/lib +mandir = $(prefix)/man/man1 +manext = 1 + +SRCS = +HDRS = + +DISTFILES = $(SRCS) $(HDRS) COPYING COPYING.LIB ChangeLog Makefile.in + +all:: all-$(WHAT) + +all-unix:: + +all-mac:: + +all-: all-windows + +all-windows:: makefile-windows + @echo Making in include + cd include + -$(MAKE) -$(MAKEFLAGS) + @echo Making in util\et + cd ..\util\et + -$(MAKE) -$(MAKEFLAGS) + @echo Making in lib + cd ..\..\lib + -$(MAKE) -$(MAKEFLAGS) + @echo Making in windows + cd ..\windows + -$(MAKE) -$(MAKEFLAGS) + cd .. + +world:: + date + make $(MFLAGS) mastermakefiles + make $(MFLAGS) depend + make $(MFLAGS) all + date + +INSTALLMKDIRS = $(KRB5ROOT) $(KRB5MANROOT) $(KRB5OTHERMKDIRS) \ + $(ADMIN_BINDIR) $(SERVER_BINDIR) $(CLIENT_BINDIR) \ + $(ADMIN_MANDIR) $(SERVER_MANDIR) $(CLIENT_MANDIR) \ + $(FILE_MANDIR) $(KRB5_LIBDIR) $(KRB5_INCDIR) \ + $(KRB5_INCSUBDIRS) + +install:: install-mkdirs + +depend:: includes + + +install-mkdirs: + @for i in $(INSTALLMKDIRS); do \ + if test -d $(DESTDIR)$$i; then :; else (set -x; mkdir $(DESTDIR)$$i); fi \ + done + +# install:: +# $(MAKE) $(MFLAGS) install.man + +# rebuild the Makefiles in the master source tree +mastermakefiles:: + -$(MV) Makefile Makefile.bak + $(MAKE) -f Makefile.bak Makefile + $(MAKE) Makefiles + +.c.o: + $(CC) -c $(CPPFLAGS) $(DEFS) -I$(srcdir) $(CFLAGS) $< + +TAGS: $(SRCS) + etags $(SRCS) + +clean:: clean-$(WHAT) + +clean-:: clean-unix +clean-mac:: clean-unix +clean-unix:: + $(RM) *.o core + +mostlyclean: clean + +distclean: clean + rm -f Makefile config.status + +realclean: distclean + rm -f TAGS + +dist: $(DISTFILES) + echo cpio-`sed -e '/version_string/!d' \ + -e 's/[^0-9.]*\([0-9.]*\).*/\1/' -e q version.c` > .fname + rm -rf `cat .fname` + mkdir `cat .fname` + -ln $(DISTFILES) `cat .fname` + for file in $(DISTFILES); do \ + test -r `cat .fname`/$$file || cp -p $$file `cat .fname`; \ + done + tar chzf `cat .fname`.tar.gz `cat .fname` + rm -rf `cat .fname` .fname + +# Macintosh build process... + +# Build all things for the Mac build, which need to be built on +# Unix first. +unixmac: + (cd lib/krb5/error_tables; make -f Makefile.in unixmac) + (cd lib/gssapi/generic; make -f Makefile.in unixmac) + + +# Microsoft Windows build process... + +# +# Windows configuration +# +makefile-windows:: wconfig.c config\pre.in config\post.in makefile.in \ + include\makefile.in include\krb5\makefile.in \ + lib\makefile.in lib\crypto\makefile.in \ + lib\crypto\crc32\makefile.in lib\crypto\des\makefile.in \ + lib\crypto\md4\makefile.in lib\crypto\md5\makefile.in \ + lib\crypto\os\makefile.in lib\des425\makefile.in \ + lib\gssapi\makefile.in lib\gssapi\generic\makefile.in \ + lib\gssapi\krb5\makefile.in lib\krb5\makefile.in \ + lib\krb5\asn.1\makefile.in lib\krb5\ccache\makefile.in \ + lib\krb5\ccache\file\makefile.in \ + lib\krb5\ccache\stdio\makefile.in \ + lib\krb5\error_ta\makefile.in \ + lib\krb5\free\makefile.in lib\krb5\keytab\makefile.in \ + lib\krb5\keytab\file\makefile.in lib\krb5\krb\makefile.in \ + lib\krb5\os\makefile.in lib\krb5\posix\makefile.in \ + lib\krb5\rcache\makefile.in \ + util\et\makefile.in + SET CL=/nologo + $(CC) /AL wconfig.c + copy Makefile Makefile.bak + .\wconfig config makefile + .\wconfig config include\makefile + .\wconfig config include\krb5\makefile + .\wconfig config lib\makefile + .\wconfig config lib\crypto\makefile + .\wconfig config lib\crypto\crc32\makefile + .\wconfig config lib\crypto\des\makefile + .\wconfig config lib\crypto\md4\makefile + .\wconfig config lib\crypto\md5\makefile + .\wconfig config lib\crypto\os\makefile + .\wconfig config lib\des425\makefile + .\wconfig config lib\gssapi\makefile + .\wconfig config lib\gssapi\generic\makefile + .\wconfig config lib\gssapi\krb5\makefile + .\wconfig config lib\krb5\makefile + .\wconfig config lib\krb5\asn.1\makefile + .\wconfig config lib\krb5\ccache\makefile + .\wconfig config lib\krb5\ccache\file\makefile + .\wconfig config lib\krb5\ccache\stdio\makefile + .\wconfig config lib\krb5\error_ta\makefile + .\wconfig config lib\krb5\free\makefile + .\wconfig config lib\krb5\keytab\makefile + .\wconfig config lib\krb5\keytab\file\makefile + .\wconfig config lib\krb5\krb\makefile + .\wconfig config lib\krb5\os\makefile + .\wconfig config lib\krb5\posix\makefile + .\wconfig config lib\krb5\rcache\makefile + .\wconfig config util\et\makefile + config\rm.bat wconfig.obj wconfig.exe msvc.pdb + +clean-windows:: + @echo Making clean in include + cd include + -$(MAKE) -$(MAKEFLAGS) clean + @echo Making clean in util\et + cd ..\util\et + -$(MAKE) -$(MAKEFLAGS) clean + @echo Making clean in lib + cd ..\..\lib + -$(MAKE) -$(MAKEFLAGS) clean + @echo Making clean in windows + cd ..\windows + -$(MAKE) -$(MAKEFLAGS) clean + cd .. + @echo Making clean locally + config\rm.bat *.obj msvc.pdb *.err wconfig.obj wconfig.exe + +# +# Builds the zip file that distributes Kerberos sources for DOS sites +# from the source tree on Unix. +# +ZIPFILES= ./* \ + config/* include/* include/krb5/* include/krb5/asn.1/* \ + include/krb5/stock/* include/sys/* lib/* lib/crypto/* \ + lib/crypto/crc32/* lib/crypto/des/* lib/crypto/md4/* \ + lib/crypto/md5/* lib/crypto/os/* lib/des425/* lib/gssapi/* \ + lib/gssapi/generic/* lib/gssapi/krb5/* lib/krb425/* \ + lib/krb5/* lib/krb5/asn.1/* lib/krb5/krb/* \ + lib/krb5/ccache/* lib/krb5/ccache/file/* \ + lib/krb5/ccache/stdio/* lib/krb5/error_tables/* \ + lib/krb5/free/* lib/krb5/keytab/* lib/krb5/keytab/file/* \ + lib/krb5/os/* lib/krb5/posix/* lib/krb5/rcache/* util/et/* \ + windows/* windows/cns/* windows/wintel/* + +ZIPBINARYFILES=windows/cns/*.ico windows/wintel/*.ico + +ZIPEXCLUDE= LIB/KRB5.SAB \ + INCLUDE/KRB5/AUTOCONF.H \ + LIB/CRYPTO/MD4/T_MDDRIV LIB/CRYPTO/MD5/T_MDDRIV \ + WINDOWS/CNS/*.ICO WINDOWS/WINTEL/*.ICO \ + *.O *.A + +kerbsrc.zip: awk-windows + rm -f kerbsrc.zip + zip -Dlk kerbsrc.zip $(ZIPFILES) -x $(ZIPEXCLUDE) + zip -Dk kerbsrc.zip $(ZIPBINARYFILES) +# +# Part of building the PC release has to be done on Unix. This includes +# anything the requires awk. +# +AH = util/et/et_h.awk +AC = util/et/et_c.awk +INC = include/krb5/ +ET = lib/krb5/error_tables/ +GG = lib/gssapi/generic/ +GK = lib/gssapi/krb5/ + +awk-windows: + gawk -f $(AH) outfile=$(INC)asn1_err.h $(ET)asn1_err.et + gawk -f $(AH) outfile=$(INC)kdb5_err.h $(ET)kdb5_err.et + gawk -f $(AH) outfile=$(INC)krb5_err.h $(ET)krb5_err.et + gawk -f $(AH) outfile=$(INC)kv5m_err.h $(ET)kv5m_err.et + gawk -f $(AH) outfile=$(INC)adm_err.h $(ET)adm_err.et + gawk -f $(AC) outfile=$(ET)asn1_err.c $(ET)asn1_err.et + gawk -f $(AC) outfile=$(ET)kdb5_err.c $(ET)kdb5_err.et + gawk -f $(AC) outfile=$(ET)krb5_err.c $(ET)krb5_err.et + gawk -f $(AC) outfile=$(ET)kv5m_err.c $(ET)kv5m_err.et + gawk -f $(AC) outfile=$(ET)adm_err.c $(ET)adm_err.et + gawk -f $(AH) outfile=$(GG)gssapi_err_generic.h $(GG)gssapi_err_generic.et + gawk -f $(AC) outfile=$(GG)gssapi_err_generic.c $(GG)gssapi_err_generic.et + gawk -f $(AH) outfile=$(GK)gssapi_err_krb5.h $(GK)gssapi_err_krb5.et + gawk -f $(AC) outfile=$(GK)gssapi_err_krb5.c $(GK)gssapi_err_krb5.et + +# config/post.in +# put all:: first just in case no other rules occur here +# +all:: + +check:: + +clean:: clean-$(WHAT) + $(RM) config.log pre.out post.out Makefile.out + +clean-unix:: + if test -n "$(OBJS)" ; then $(RM) $(OBJS); else :; fi + +clean-windows:: + $(RM) *.$(OBJEXT) + $(RM) msvc.pdb *.err +# [DIVERSION_MAKEFILE] contents + +SHELL=/bin/sh + +Makefile: $(srcdir)/Makefile.in config.status $(SRCTOP)/config/pre.in $(SRCTOP)/config/post.in + $(SHELL) config.status +config.status: $(srcdir)/configure + $(SHELL) config.status --recheck +$(srcdir)/configure: $(srcdir)/configure.in $(SRCTOP)/aclocal.m4 + cd $(srcdir); autoconf --localdir=$(BUILDTOP) --macrodir=$(BUILDTOP)/util/autoconf + + +all:: + @case '${MFLAGS}' in *[ik]*) set +e ;; esac; \ + for i in $(SUBDIRS) ;\ + do \ + (cd $$i ; echo "making" "in $(CURRENT_DIR)$$i..."; \ + $(MAKE) $(MFLAGS) CC="$(CC)" CCOPTS="$(CCOPTS)" \ + CURRENT_DIR=$(CURRENT_DIR)$$i/ all); \ + done + +clean:: + @case '${MFLAGS}' in *[ik]*) set +e ;; esac; \ + for i in $(SUBDIRS) ;\ + do \ + (cd $$i ; echo "cleaning" "in $(CURRENT_DIR)$$i..."; \ + $(MAKE) $(MFLAGS) CC="$(CC)" CCOPTS="$(CCOPTS)" \ + CURRENT_DIR=$(CURRENT_DIR)$$i/ clean); \ + done + +install:: + @case '${MFLAGS}' in *[ik]*) set +e ;; esac; \ + for i in $(SUBDIRS) ;\ + do \ + (cd $$i ; echo "installing" "in $(CURRENT_DIR)$$i..."; \ + $(MAKE) $(MFLAGS) CC="$(CC)" CCOPTS="$(CCOPTS)" \ + CURRENT_DIR=$(CURRENT_DIR)$$i/ install); \ + done + +check:: + @case '${MFLAGS}' in *[ik]*) set +e ;; esac; \ + for i in $(SUBDIRS) ;\ + do \ + (cd $$i ; echo "checking" "in $(CURRENT_DIR)$$i..."; \ + $(MAKE) $(MFLAGS) CC="$(CC)" CCOPTS="$(CCOPTS)" \ + CURRENT_DIR=$(CURRENT_DIR)$$i/ check); \ + done + diff --git a/src/include/krb5/ChangeLog b/src/include/krb5/ChangeLog index eadc4cd07..12c924bc3 100644 --- a/src/include/krb5/ChangeLog +++ b/src/include/krb5/ChangeLog @@ -1,3 +1,7 @@ +Thu Mar 30 15:57:22 1995 Keith Vetter (keithv@fusion.com) + + * func-proto.h: added 2 missing prototypes dealing with auth_con. + Tue Mar 28 19:53:09 1995 Keith Vetter (keithv@fusion.com) * Makefile.in: changed to reflect deletion of stock/osconf.win. diff --git a/src/include/krb5/func-proto.h b/src/include/krb5/func-proto.h index d3b1e1744..a28e9d126 100644 --- a/src/include/krb5/func-proto.h +++ b/src/include/krb5/func-proto.h @@ -669,6 +669,18 @@ krb5_error_code INTERFACE krb5_auth_con_getrcache krb5_auth_context *, krb5_rcache *)); +krb5_error_code INTERFACE krb5_auth_con_getauthenticator + PROTOTYPE((krb5_context, + krb5_auth_context *, + krb5_authenticator **)); + +krb5_error_code INTERFACE krb5_auth_con_getremotesubkey + PROTOTYPE((krb5_context, + krb5_auth_context *, + krb5_keyblock **)); + + + #define KRB5_REALM_BRANCH_CHAR '.' #endif /* KRB5_FUNC_PROTO__ */ diff --git a/src/lib/ChangeLog b/src/lib/ChangeLog index b535b3a90..9fb50b64b 100644 --- a/src/lib/ChangeLog +++ b/src/lib/ChangeLog @@ -1,3 +1,8 @@ +Thu Mar 30 15:46:23 1995 Keith Vetter (keithv@fusion.com) + + * libkrb5.def: removed the masses of exported files, leaving just + the ones needed by telnet and cns plus the gssapi ones. + Tue Mar 28 18:26:01 1995 John Gilmore (gnu at toad.com) * Makefile.in (clean-mac): Add. diff --git a/src/lib/gssapi/krb5/ChangeLog b/src/lib/gssapi/krb5/ChangeLog index 5a5aa5a88..d34555da7 100644 --- a/src/lib/gssapi/krb5/ChangeLog +++ b/src/lib/gssapi/krb5/ChangeLog @@ -1,3 +1,8 @@ +Thu Mar 30 16:00:30 1995 Keith Vetter (keithv@fusion.com) + + * accept_sec_context.c: fixed wrong level of indirection on a + parameter to getauthenticator. + Mon Mar 27 07:56:26 1995 Chris Provenzano (proven@mit.edu) * accept_sec_context.c: Use new calling convention for krb5_rd_req() diff --git a/src/lib/gssapi/krb5/accept_sec_context.c b/src/lib/gssapi/krb5/accept_sec_context.c index 29dedca3c..3f35197e5 100644 --- a/src/lib/gssapi/krb5/accept_sec_context.c +++ b/src/lib/gssapi/krb5/accept_sec_context.c @@ -142,7 +142,7 @@ krb5_gss_accept_sec_context(context, minor_status, context_handle, return(GSS_S_FAILURE); } - krb5_auth_con_getauthenticator(context, &auth_context, &authdat); + krb5_auth_con_getauthenticator(context, auth_context, &authdat); /* verify that the checksum is correct */ diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index b8dcaa646..5322c1463 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,7 @@ +Thu Mar 30 15:49:27 1995 Keith Vetter (keithv@fusion.com) + + * rd_req.c: removed unused local variable. + Tue Mar 28 18:34:20 1995 John Gilmore (gnu at toad.com) * rd_req_sim.c: Really remove the file. diff --git a/src/lib/krb5/krb/rd_req.c b/src/lib/krb5/krb/rd_req.c index 33f12cc71..7c569fb94 100644 --- a/src/lib/krb5/krb/rd_req.c +++ b/src/lib/krb5/krb/rd_req.c @@ -56,7 +56,6 @@ krb5_rd_req(context, auth_context, inbuf, server, keytab, krb5_error_code retval; krb5_ap_req * request; krb5_auth_context * new_auth_context; - krb5_rcache new_rcache; krb5_keytab new_keytab = NULL; if (!krb5_is_ap_req(inbuf)) diff --git a/src/lib/krb5/os/ChangeLog b/src/lib/krb5/os/ChangeLog index 69e77c55a..3fb5d675d 100644 --- a/src/lib/krb5/os/ChangeLog +++ b/src/lib/krb5/os/ChangeLog @@ -1,3 +1,8 @@ +Thu Mar 30 15:54:54 1995 Keith Vetter (keithv@fusion.com) + + * localaddr.c: in Windows/Mac code, fixed bug due to wrong level + of indirection on memcpy call. + Tue Mar 28 19:22:28 1995 Keith Vetter (keithv@fusion.com) For Windows, added calls to get the default config, realms and diff --git a/src/lib/krb5/os/localaddr.c b/src/lib/krb5/os/localaddr.c index 54ca6ea5e..f8fb0f93e 100644 --- a/src/lib/krb5/os/localaddr.c +++ b/src/lib/krb5/os/localaddr.c @@ -264,8 +264,8 @@ krb5_os_localaddr (krb5_address ***addr) { free(*addr); return ENOMEM; } else { - memcpy ((char *)(*addr)[0]->contents, - (char *)&hostrec->h_addr, + memcpy ((*addr)[0]->contents, + hostrec->h_addr, (*addr)[0]->length); } /* FIXME, deal with the case where gethostent returns multiple addrs */ diff --git a/src/lib/libkrb5.def b/src/lib/libkrb5.def index c566d5b3b..3afbd0c4a 100644 --- a/src/lib/libkrb5.def +++ b/src/lib/libkrb5.def @@ -12,385 +12,29 @@ HEAPSIZE 8192 EXPORTS WEP @1 RESIDENTNAME LIBMAIN @2 - ASN12KRB5_BUF - ASN1BUF_CREATE - ASN1BUF_DESTROY - ASN1BUF_ENSURE_SPACE - ASN1BUF_EXPAND - ASN1BUF_FREE - ASN1BUF_HEX_UNPARSE - ASN1BUF_IMBED - ASN1BUF_INSERT_CHARSTRING - ASN1BUF_INSERT_OCTET - ASN1BUF_INSERT_OCTETSTRING - ASN1BUF_LEN - ASN1BUF_REMAINS - ASN1BUF_REMOVE_CHARSTRING - ASN1BUF_REMOVE_OCTET - ASN1BUF_REMOVE_OCTETSTRING - ASN1BUF_SIZE - ASN1BUF_SYNC - ASN1BUF_UNPARSE - ASN1BUF_WRAP_DATA - ASN1_DECODE_ADDRTYPE - ASN1_DECODE_AP_OPTIONS - ASN1_DECODE_AUTHDATATYPE - ASN1_DECODE_AUTHDATA_ELT - ASN1_DECODE_AUTHORIZATION_DATA - ASN1_DECODE_CHARSTRING - ASN1_DECODE_CHECKSUM - ASN1_DECODE_CKSUMTYPE - ASN1_DECODE_ENCRYPTED_DATA - ASN1_DECODE_ENCRYPTION_KEY - ASN1_DECODE_ENCTYPE - ASN1_DECODE_ENC_KDC_REP_PART - ASN1_DECODE_GENERALSTRING - ASN1_DECODE_GENERALTIME - ASN1_DECODE_HOST_ADDRESS - ASN1_DECODE_HOST_ADDRESSES - ASN1_DECODE_IA5STRING - ASN1_DECODE_INT - ASN1_DECODE_INT32 - ASN1_DECODE_INTEGER - ASN1_DECODE_KDC_OPTIONS - ASN1_DECODE_KDC_REP - ASN1_DECODE_KDC_REQ - ASN1_DECODE_KDC_REQ_BODY - ASN1_DECODE_KERBEROS_TIME - ASN1_DECODE_KEYTYPE - ASN1_DECODE_KRB5_FLAGS - ASN1_DECODE_KRB_CRED_INFO - ASN1_DECODE_KRB_SAFE_BODY - ASN1_DECODE_KVNO - ASN1_DECODE_LAST_REQ - ASN1_DECODE_LAST_REQ_ENTRY - ASN1_DECODE_MSGTYPE - ASN1_DECODE_NULL - ASN1_DECODE_OCTET - ASN1_DECODE_OCTETSTRING - ASN1_DECODE_PASSWDSEQUENCE - ASN1_DECODE_PA_DATA - ASN1_DECODE_PRINCIPAL_NAME - ASN1_DECODE_PRINTABLESTRING - ASN1_DECODE_REALM - ASN1_DECODE_SEQUENCE_OF_ENCTYPE - ASN1_DECODE_SEQUENCE_OF_KRB_CRED_INFO - ASN1_DECODE_SEQUENCE_OF_PASSWDSEQUENCE - ASN1_DECODE_SEQUENCE_OF_PA_DATA - ASN1_DECODE_SEQUENCE_OF_TICKET - ASN1_DECODE_TICKET - ASN1_DECODE_TICKET_FLAGS - ASN1_DECODE_TRANSITED_ENCODING - ASN1_DECODE_UI_2 - ASN1_DECODE_UI_4 - ASN1_DECODE_UNSIGNED_INTEGER - ASN1_ENCODE_AP_OPTIONS - ASN1_ENCODE_AUTHORIZATION_DATA - ASN1_ENCODE_CHARSTRING - ASN1_ENCODE_CHECKSUM - ASN1_ENCODE_ENCRYPTED_DATA - ASN1_ENCODE_ENCRYPTION_KEY - ASN1_ENCODE_ENC_KDC_REP_PART - ASN1_ENCODE_GENERALSTRING - ASN1_ENCODE_GENERALTIME - ASN1_ENCODE_HOST_ADDRESS - ASN1_ENCODE_HOST_ADDRESSES - ASN1_ENCODE_IA5STRING - ASN1_ENCODE_INTEGER - ASN1_ENCODE_KDC_OPTIONS - ASN1_ENCODE_KDC_REP - ASN1_ENCODE_KDC_REQ - ASN1_ENCODE_KDC_REQ_BODY - ASN1_ENCODE_KERBEROS_TIME - ASN1_ENCODE_KRB5_AUTHDATA_ELT - ASN1_ENCODE_KRB5_FLAGS - ASN1_ENCODE_KRB_CRED_INFO - ASN1_ENCODE_KRB_SAFE_BODY - ASN1_ENCODE_LAST_REQ - ASN1_ENCODE_LAST_REQ_ENTRY - ASN1_ENCODE_NULL - ASN1_ENCODE_OCTETSTRING - ASN1_ENCODE_PASSWDSEQUENCE - ASN1_ENCODE_PA_DATA - ASN1_ENCODE_PRINCIPAL_NAME - ASN1_ENCODE_PRINTABLESTRING - ASN1_ENCODE_REALM - ASN1_ENCODE_SEQUENCE_OF_ENCTYPE - ASN1_ENCODE_SEQUENCE_OF_KRB_CRED_INFO - ASN1_ENCODE_SEQUENCE_OF_PASSWDSEQUENCE - ASN1_ENCODE_SEQUENCE_OF_PA_DATA - ASN1_ENCODE_SEQUENCE_OF_TICKET - ASN1_ENCODE_TICKET - ASN1_ENCODE_TICKET_FLAGS - ASN1_ENCODE_TRANSITED_ENCODING - ASN1_ENCODE_UI_4 - ASN1_ENCODE_UNSIGNED_INTEGER - ASN1_GET_ID - ASN1_GET_LENGTH - ASN1_GET_SEQUENCE - ASN1_GET_TAG - ASN1_KRB5_REALM_COPY - ASN1_MAKE_ETAG - ASN1_MAKE_ID - ASN1_MAKE_LENGTH - ASN1_MAKE_SEQUENCE - ASN1_MAKE_SET - ASN1_MAKE_STRING - ASN1_MAKE_TAG - DECODE_KRB5_AP_REP - DECODE_KRB5_AP_REP_ENC_PART - DECODE_KRB5_AP_REQ - DECODE_KRB5_AS_REP - DECODE_KRB5_AS_REQ - DECODE_KRB5_AUTHDATA - DECODE_KRB5_AUTHENTICATOR - DECODE_KRB5_CRED - DECODE_KRB5_ENCRYPTION_KEY - DECODE_KRB5_ENC_CRED_PART - DECODE_KRB5_ENC_KDC_REP_PART - DECODE_KRB5_ENC_PRIV_PART - DECODE_KRB5_ENC_TKT_PART - DECODE_KRB5_ERROR - DECODE_KRB5_KDC_REQ_BODY - DECODE_KRB5_PRIV - DECODE_KRB5_PWD_DATA - DECODE_KRB5_PWD_SEQUENCE - DECODE_KRB5_SAFE - DECODE_KRB5_TGS_REP - DECODE_KRB5_TGS_REQ - DECODE_KRB5_TICKET - ENCODE_KRB5_AP_REP - ENCODE_KRB5_AP_REP_ENC_PART - ENCODE_KRB5_AP_REQ - ENCODE_KRB5_AS_REP - ENCODE_KRB5_AS_REQ - ENCODE_KRB5_AUTHDATA - ENCODE_KRB5_AUTHENTICATOR - ENCODE_KRB5_CRED - ENCODE_KRB5_ENCRYPTION_KEY - ENCODE_KRB5_ENC_CRED_PART - ENCODE_KRB5_ENC_KDC_REP_PART - ENCODE_KRB5_ENC_PRIV_PART - ENCODE_KRB5_ENC_TKT_PART - ENCODE_KRB5_ERROR - ENCODE_KRB5_KDC_REQ_BODY - ENCODE_KRB5_PRIV - ENCODE_KRB5_PWD_DATA - ENCODE_KRB5_PWD_SEQUENCE - ENCODE_KRB5_SAFE - ENCODE_KRB5_TGS_REP - ENCODE_KRB5_TGS_REQ - ENCODE_KRB5_TICKET - GET_SECURID_PADATA - GET_UNIXTIME_PADATA - KEYTAB_KEYPROC - KRB5_425_CONV_PRINCIPAL - KRB5_524_CONV_PRINCIPAL - KRB5_ADDRESS_COMPARE - KRB5_ADDRESS_ORDER - KRB5_ADDRESS_SEARCH - KRB5_APPEND_ADDRESSES - KRB5_AUTH_TO_REP - KRB5_CHECK_TRANSITED_LIST - KRB5_COPY_ADDRESSES - KRB5_COPY_AUTHDATA - KRB5_COPY_AUTHENTICATOR - KRB5_COPY_CHECKSUM - KRB5_COPY_CREDS - KRB5_COPY_DATA - KRB5_COPY_KEYBLOCK - KRB5_COPY_KEYBLOCK_CONTENTS - KRB5_COPY_PRINCIPAL - KRB5_COPY_TICKET - KRB5_DECODE_KDC_REP - KRB5_DECRYPT_TKT_PART - KRB5_ENCODE_KDC_REP - KRB5_ENCRYPT_TKT_PART - KRB5_FREE_ADDRESS + _krb5_build_principal_ext + KRB5_CC_DEFAULT KRB5_FREE_ADDRESSES - KRB5_FREE_AP_REP KRB5_FREE_AP_REP_ENC_PART - KRB5_FREE_AP_REQ - KRB5_FREE_AUTHDATA - KRB5_FREE_AUTHENTICATOR - KRB5_FREE_AUTHENTICATOR_CONTENTS - KRB5_FREE_CHECKSUM - KRB5_FREE_CONTEXT - KRB5_FREE_CRED - KRB5_FREE_CREDS KRB5_FREE_CRED_CONTENTS - KRB5_FREE_CRED_ENC_PART - KRB5_FREE_ENC_KDC_REP_PART - KRB5_FREE_ENC_TKT_PART - KRB5_FREE_ERROR - KRB5_FREE_KDC_REP - KRB5_FREE_KDC_REQ - KRB5_FREE_KEYBLOCK - KRB5_FREE_LAST_REQ - KRB5_FREE_PA_DATA + KRB5_FREE_CREDS KRB5_FREE_PRINCIPAL - KRB5_FREE_PRIV - KRB5_FREE_PRIV_ENC_PART - KRB5_FREE_PWD_DATA - KRB5_FREE_PWD_SEQUENCES - KRB5_FREE_REALM_TREE - KRB5_FREE_SAFE - KRB5_FREE_TGT_CREDS - KRB5_FREE_TICKET - KRB5_FREE_TICKETS - KRB5_FREE_TKT_AUTHENT - KRB5_FULLADDR_ORDER - KRB5_GENERATE_SEQ_NUMBER - KRB5_GENERATE_SUBKEY KRB5_GET_CREDENTIALS - KRB5_GET_CRED_FROM_KDC - KRB5_GET_CRED_VIA_2TGT - KRB5_GET_CRED_VIA_TGT - KRB5_GET_DEFAULT_IN_TKT_ETYPES - KRB5_GET_FOR_CREDS - KRB5_GET_IN_TKT - KRB5_GET_IN_TKT_WITH_KEYTAB + KRB5_GET_DEFAULT_REALM KRB5_GET_IN_TKT_WITH_PASSWORD - KRB5_GET_IN_TKT_WITH_SKEY - KRB5_GET_SERVER_RCACHE + KRB5_GET_NOTIFICATION_MESSAGE KRB5_INIT_CONTEXT KRB5_INIT_ETS - KRB5_KDC_REP_DECRYPT_PROC - KRB5_KTFILEINT_CLOSE - KRB5_KTFILEINT_DELETE_ENTRY - KRB5_KTFILEINT_FIND_SLOT - KRB5_KTFILEINT_INTERNAL_READ_ENTRY - KRB5_KTFILEINT_OPENR - KRB5_KTFILEINT_OPENW - KRB5_KTFILEINT_READ_ENTRY - KRB5_KTFILEINT_SIZE_ENTRY - KRB5_KTFILEINT_WRITE_ENTRY - KRB5_KTFILE_ADD - KRB5_KTFILE_CLOSE - KRB5_KTFILE_END_GET - KRB5_KTFILE_GET_ENTRY - KRB5_KTFILE_GET_NAME - KRB5_KTFILE_GET_NEXT - KRB5_KTFILE_REMOVE - KRB5_KTFILE_RESOLVE - KRB5_KTFILE_START_SEQ_GET - KRB5_KTFILE_WRESOLVE - KRB5_KT_ADD_ENTRY - KRB5_KT_DEFAULT - KRB5_KT_FREE_ENTRY - KRB5_KT_READ_SERVICE_KEY - KRB5_KT_REGISTER - KRB5_KT_REMOVE_ENTRY - KRB5_KT_RESOLVE - KRB5_MK_CRED - KRB5_MK_ERROR - KRB5_MK_PRIV - KRB5_MK_REP - KRB5_MK_REQ KRB5_MK_REQ_EXTENDED - KRB5_MK_SAFE - KRB5_OBTAIN_PADATA + KRB5_OS_LOCALADDR KRB5_PARSE_NAME - KRB5_PRINCIPAL2SALT - KRB5_PRINCIPAL2SALT_INTERNAL - KRB5_PRINCIPAL2SALT_NOREALM - KRB5_PRINCIPAL_COMPARE - KRB5_RC_DEFAULT - KRB5_RC_DEFAULT_NAME - KRB5_RC_DEFAULT_TYPE - KRB5_RC_DFL_CLOSE - KRB5_RC_DFL_CLOSE_NO_FREE - KRB5_RC_DFL_DESTROY - KRB5_RC_DFL_EXPUNGE - KRB5_RC_DFL_GET_NAME - KRB5_RC_DFL_GET_SPAN - KRB5_RC_DFL_INIT - KRB5_RC_DFL_RECOVER - KRB5_RC_DFL_RESOLVE - KRB5_RC_DFL_STORE - KRB5_RC_FREE_ENTRY - KRB5_RC_GET_TYPE - KRB5_RC_IO_CLOSE - KRB5_RC_IO_CREAT - KRB5_RC_IO_DESTROY - KRB5_RC_IO_MARK - KRB5_RC_IO_MOVE - KRB5_RC_IO_OPEN - KRB5_RC_IO_READ - KRB5_RC_IO_SIZE - KRB5_RC_IO_SYNC - KRB5_RC_IO_UNMARK - KRB5_RC_IO_WRITE - KRB5_RC_REGISTER_TYPE - KRB5_RC_RESOLVE_FULL - KRB5_RC_RESOLVE_TYPE - KRB5_RD_CRED - KRB5_RD_ERROR - KRB5_RD_PRIV KRB5_RD_REP - KRB5_RD_REQ - KRB5_RD_REQ_DECODED - KRB5_RD_REQ_SIMPLE - KRB5_RD_SAFE - KRB5_REALM_COMPARE - KRB5_RECVAUTH - KRB5_SENDAUTH - KRB5_SEND_TGS - KRB5_SET_DEFAULT_IN_TKT_ETYPES - KRB5_TGTNAME + KRB5_SNAME_TO_PRINCIPAL + KRB5_TIMEOFDAY KRB5_UNPARSE_NAME - KRB5_UNPARSE_NAME_EXT - KRB5_VERIFY_PADATA - KRB5_WALK_REALM_TREE - PWD_KEYPROC - SKEY_KEYPROC - VERIFY_SECURID_PADATA - VERIFY_UNIXTIME_PADATA - KRB5_SNAME_TO_PRINCIPAL - KRB5_GET_DEFAULT_REALM - KRB5_GET_NOTIFiCATION_MESSAGE -;Crypto routines - CRC32_SUM_FUNC - KRB5_RANDOM_CONFOUNDER - MAKE_KEY_SCHED - MD4_CRYPTO_SUM_FUNC - MD4_SUM_FUNC - MD4FINAL - MD4INIT - MD4UPDATE - MD5_CRYPTO_SUM_FUNC - MD5_SUM_FUNC - MD5FINAL - MD5INIT - MD5UPDATE - MIT_DES_CBC_CHECKSUM - MIT_DES_CBC_CKSUM - MIT_DES_CBC_ENCRYPT - MIT_DES_CHECK_KEY_PARITY - MIT_DES_CRC_DECRYPT_FUNC - MIT_DES_CRC_ENCRYPT_FUNC - MIT_DES_ECB_ENCRYPT - MIT_DES_FINISH_KEY - MIT_DES_FINISH_RANDOM_KEY - MIT_DES_FIXUP_KEY_PARITY - MIT_DES_GENERATE_RANDOM_BLOCK - MIT_DES_INIT_RANDOM_KEY - MIT_DES_INIT_RANDOM_NUMBER_GENERATOR - MIT_DES_IS_WEAK_KEY - MIT_DES_KEY_SCHED - MIT_DES_MD5_DECRYPT_FUNC - MIT_DES_MD5_ENCRYPT_FUNC - MIT_DES_NEW_RANDOM_KEY - MIT_DES_PROCESS_KEY - MIT_DES_RANDOM_KEY - MIT_DES_SET_RANDOM_GENERATOR_SEED - MIT_DES_SET_SEQUENCE_NUMBER - MIT_DES_STRING_TO_KEY - MIT_RAW_DES_DECRYPT_FUNC - MIT_RAW_DES_ENCRYPT_FUNC ;Com_err routines - ERROR_MESSAGE _com_err + ERROR_MESSAGE ;GSSAPI GSS_ACCEPT_SEC_CONTEXT GSS_ACQUIRE_CRED diff --git a/src/windows/cns/changelo b/src/windows/cns/changelo index e61d607a4..b0795a0af 100644 --- a/src/windows/cns/changelo +++ b/src/windows/cns/changelo @@ -1,6 +1,13 @@ -Tue Mar 28 12:00:00 1995 Keith Vetter (keithv@fusion.com) +Thu Mar 30 16:11:27 1995 Keith Vetter (keithv@fusion.com) - * ChangeLog renamed to changelo to avoid having to always rename it. + * cns.h, cns.c, tktlist.c: improved error handling for a bad cache. + * cns.rc: conditionally removed more instance stuff. + +Tue Mar 28 21:52:01 1995 Keith Vetter (keithv@fusion.com) + + * cns.rc, cns.h, cns.c: removed instance edit box for K5. + * makefile: RFLAGS need version k4 or k5 set. + * tktlist.c: also displays ticket flags. Mon Mar 27 20:31:04 1995 Keith Vetter (keithv@fusion.com) diff --git a/src/windows/cns/cns.c b/src/windows/cns/cns.c index facd1a68f..f75c40a45 100644 --- a/src/windows/cns/cns.c +++ b/src/windows/cns/cns.c @@ -630,10 +630,12 @@ password_initdialog ( LPARAM lparam) { char name[ANAME_SZ]; - char instance[INST_SZ]; char realm[REALM_SZ]; HWND hwndparent; int id; + #ifdef KRB4 + char instance[INST_SZ]; + #endif center_dialog(hwnd); set_dialog_font(hwnd, hfontdialog); @@ -645,9 +647,11 @@ password_initdialog ( trim(name); SetDlgItemText(hwnd, IDD_PASSWORD_NAME, name); - GetDlgItemText(hwndparent, IDD_LOGIN_INSTANCE, instance, sizeof(instance)); - trim(instance); - SetDlgItemText(hwnd, IDD_PASSWORD_INSTANCE, instance); + #ifdef KRB4 + GetDlgItemText(hwndparent, IDD_LOGIN_INSTANCE, instance, sizeof(instance)); + trim(instance); + SetDlgItemText(hwnd, IDD_PASSWORD_INSTANCE, instance); + #endif GetDlgItemText(hwndparent, IDD_LOGIN_REALM, realm, sizeof(realm)); trim(realm); @@ -1262,9 +1266,12 @@ kwin_init_name ( SetDlgItemText(hwnd, IDD_LOGIN_NAME, name); name[0] = 0; GetDlgItemText(hwnd, IDD_LOGIN_NAME, name, sizeof(name)); - SetDlgItemText(hwnd, IDD_LOGIN_INSTANCE, instance); SetDlgItemText(hwnd, IDD_LOGIN_REALM, realm); + #ifdef KRB4 + SetDlgItemText(hwnd, IDD_LOGIN_INSTANCE, instance); + #endif + } /* kwin_init_name */ @@ -1572,26 +1579,21 @@ kwin_size ( } /* - * Edit fields + * Edit fields: stretch boxes, keeping the gap between boxes equal to + * what it was on entry. */ editbottom += r.top; - cx = 0; - for (i = IDD_MIN_EDIT; i <= IDD_MAX_EDIT; i++) { - hwnditem = GetDlgItem(hwnd, i); - windowrect(hwnditem, hwnd, &r); - - if (i == IDD_MIN_EDIT) { - gap = r.right; - hmargin = r.left; - editbottom += r.bottom; - titlebottom = -r.top; - } - if (i == IDD_MIN_EDIT + 1) - gap = r.left - gap; + hwnditem = GetDlgItem(hwnd, IDD_MIN_EDIT); + windowrect(hwnditem, hwnd, &r); + gap = r.right; + hmargin = r.left; + editbottom += r.bottom; + titlebottom = -r.top; - cx += r.right - r.left; - } + hwnditem = GetDlgItem(hwnd, IDD_MIN_EDIT + 1); + windowrect(hwnditem, hwnd, &r); + gap = r.left - gap; cx = cxdlg - 2 * hmargin - (IDD_MAX_EDIT - IDD_MIN_EDIT) * gap; cx = cx / (IDD_MAX_EDIT - IDD_MIN_EDIT + 1); @@ -1779,7 +1781,8 @@ kwin_timer ( break; } } - krb5_cc_end_seq_get(k5_context, k5_ccache, &cursor); + if (code == 0 || code == KRB5_CC_END) + krb5_cc_end_seq_get(k5_context, k5_ccache, &cursor); #endif @@ -1837,7 +1840,6 @@ kwin_command ( LPARAM lparam) { char name[ANAME_SZ]; - char instance[INST_SZ]; char realm[REALM_SZ]; char password[MAX_KPW_LEN]; HCURSOR hcursor; @@ -1846,6 +1848,7 @@ kwin_command ( char menuitem[MAX_K_NAME_SZ + 3]; char copyright[128]; #ifdef KRB4 + char instance[INST_SZ]; int lifetime; int krc; #endif @@ -1863,7 +1866,7 @@ kwin_command ( #endif #ifdef KRB5 - EnableWindow(GetDlgItem(hwnd, IDD_TICKET_DELETE), k5_get_num_cred() > 0); + EnableWindow(GetDlgItem(hwnd, IDD_TICKET_DELETE), k5_get_num_cred(0) > 0); #endif GetDlgItemText(hwnd, IDD_LOGIN_NAME, name, sizeof(name)); @@ -1917,13 +1920,16 @@ kwin_command ( GetDlgItemText(hwnd, IDD_LOGIN_NAME, name, sizeof(name)); trim(name); - GetDlgItemText(hwnd, IDD_LOGIN_INSTANCE, instance, sizeof(instance)); - trim(instance); GetDlgItemText(hwnd, IDD_LOGIN_REALM, realm, sizeof(realm)); trim(realm); GetDlgItemText(hwnd, IDD_LOGIN_PASSWORD, password, sizeof(password)); trim(password); + #ifdef KRB4 + GetDlgItemText(hwnd, IDD_LOGIN_INSTANCE, instance, sizeof(instance)); + trim(instance); + #endif + hcursor = SetCursor(LoadCursor(NULL, IDC_WAIT)); lifetime = GetPrivateProfileInt(INI_OPTIONS, INI_DURATION, DEFAULT_TKT_LIFE * 5, KERBEROS_INI); @@ -1973,7 +1979,7 @@ kwin_command ( if (server) krb5_free_principal(k5_context, server); - #endif + #endif /* KRB5 */ end_blocking_hook(); SetCursor(hcursor); @@ -2183,7 +2189,8 @@ kwin_paint ( break; } - krb5_cc_end_seq_get(k5_context, k5_ccache, &cursor); + if (code == 0 || code == KRB5_CC_END) + krb5_cc_end_seq_get(k5_context, k5_ccache, &cursor); #endif hdc = BeginPaint(hwnd, &ps); @@ -2496,6 +2503,14 @@ init_instance ( krb5_init_context(&k5_context); krb5_init_ets(k5_context); krb5_cc_default(k5_context, &k5_ccache); + + i = k5_get_num_cred (0); /* Test integrity */ + if (i == -1) { + remove (krb5_cc_get_name(k5_context, k5_ccache)); + i = k5_get_num_cred (1); + if (i == -1) + return FALSE; + } #endif return TRUE; @@ -2754,11 +2769,6 @@ WinMain ( #ifdef KRB5 -void -debugbox () { - MessageBox (NULL, "foobar", "FOOBAR", IDOK | MB_ICONINFORMATION); -} - /*+ * Function: destroys all tickets in a k5 ccache * @@ -2795,35 +2805,52 @@ k5_dest_tkt (void) { * * k5_get_num_cred * - * Returns: number of creds in the credential cache + * Returns: number of creds in the credential cache, -1 on error * */ static int -k5_get_num_cred () { +k5_get_num_cred (int verbose) { krb5_error_code code; krb5_cc_cursor cursor; krb5_creds c; int ncreds = 0; + /* Turn off OPENCLOSE and leave open while we use ccache */ + if (code = krb5_cc_set_flags(k5_context, k5_ccache, 0)) { + if (code == KRB5_FCC_NOFILE) + return 0; + if (verbose) + com_err (NULL, code, + "while setting cache flags (ticket cache %s)", + krb5_cc_get_name(k5_context, k5_ccache)); + return -1; + } + if (code = krb5_cc_start_seq_get(k5_context, k5_ccache, &cursor)) { - if (code != KRB5_FCC_NOFILE) - com_err (NULL, code, "while starting to retrieve tickets"); - return 0; + if (verbose) + com_err (NULL, code, "while starting to retrieve tickets."); + return -1; } - while (1) { + while (1) { /* Loop and get creds */ code = krb5_cc_next_cred(k5_context, k5_ccache, &cursor, &c); if (code) break; ++ncreds; } - if (code == KRB5_CC_END) { /* End of ccache */ - if (code = krb5_cc_end_seq_get(k5_context, k5_ccache, &cursor)) - com_err (NULL, code, "while finishing ticket retrieval"); - } else { - com_err (NULL, code, "while retrieving a ticket"); - return 0; + if (code != KRB5_CC_END) { /* Error while looping??? */ + if (verbose) + com_err (NULL, code, "while retrieving a ticket."); + return -1; + } + + if (code = krb5_cc_end_seq_get(k5_context, k5_ccache, &cursor)) { + if (verbose) + com_err (NULL, code, "while closing ccache."); + } else if (code = krb5_cc_set_flags(k5_context, k5_ccache, KRB5_TC_OPENCLOSE)) { + if (verbose) + com_err(NULL, code, "while closing ccache."); } return ncreds; @@ -2846,7 +2873,8 @@ k5_get_num_cred2 () { break; ++ncreds; } - krb5_cc_end_seq_get(k5_context, k5_ccache, &cursor); + if (code == KRB5_CC_END) + krb5_cc_end_seq_get(k5_context, k5_ccache, &cursor); return ncreds; } diff --git a/src/windows/cns/cns.h b/src/windows/cns/cns.h index 006804d12..7579400b8 100644 --- a/src/windows/cns/cns.h +++ b/src/windows/cns/cns.h @@ -37,19 +37,39 @@ #define IDD_TICKET_LIST_TITLE 101 #define IDD_TICKET_LIST 102 - #define IDD_MIN_TITLE 103 - #define IDD_LOGIN_NAME_TITLE 103 - #define IDD_LOGIN_INSTANCE_TITLE 104 - #define IDD_LOGIN_REALM_TITLE 105 - #define IDD_LOGIN_PASSWORD_TITLE 106 - #define IDD_MAX_TITLE 106 - - #define IDD_MIN_EDIT 107 - #define IDD_LOGIN_NAME 107 - #define IDD_LOGIN_INSTANCE 108 - #define IDD_LOGIN_REALM 109 - #define IDD_LOGIN_PASSWORD 110 - #define IDD_MAX_EDIT 110 + #ifdef KRB4 + + #define IDD_MIN_TITLE 103 + #define IDD_LOGIN_NAME_TITLE 103 + #define IDD_LOGIN_INSTANCE_TITLE 104 + #define IDD_LOGIN_REALM_TITLE 105 + #define IDD_LOGIN_PASSWORD_TITLE 106 + #define IDD_MAX_TITLE 106 + + #define IDD_MIN_EDIT 107 + #define IDD_LOGIN_NAME 107 + #define IDD_LOGIN_INSTANCE 108 + #define IDD_LOGIN_REALM 109 + #define IDD_LOGIN_PASSWORD 110 + #define IDD_MAX_EDIT 110 + + #endif + + #ifdef KRB5 + + #define IDD_MIN_TITLE 103 + #define IDD_LOGIN_NAME_TITLE 103 + #define IDD_LOGIN_REALM_TITLE 104 + #define IDD_LOGIN_PASSWORD_TITLE 105 + #define IDD_MAX_TITLE 105 + + #define IDD_MIN_EDIT 107 + #define IDD_LOGIN_NAME 107 + #define IDD_LOGIN_REALM 108 + #define IDD_LOGIN_PASSWORD 109 + #define IDD_MAX_EDIT 109 + + #endif #define IDD_MIN_BUTTON 111 #define IDD_CHANGE_PASSWORD 111 @@ -124,7 +144,7 @@ time_t kwin_get_epoch(void); #ifdef KRB5 static krb5_error_code k5_dest_tkt (void); - static int k5_get_num_cred (void); + static int k5_get_num_cred (int verbose); static int k5_kname_parse (char *name, char *realm, char *fullname); static int k5_get_lrealm (char *realm); #endif diff --git a/src/windows/cns/cns.rc b/src/windows/cns/cns.rc index 7780b53b0..55137252d 100644 --- a/src/windows/cns/cns.rc +++ b/src/windows/cns/cns.rc @@ -49,49 +49,83 @@ FONT 8, "Arial" BEGIN CONTROL " Start Time End Time Ticket", IDD_TICKET_LIST_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 16, 7, 240, 8 CONTROL "", IDD_TICKET_LIST, "LISTBOX", LBS_NOTIFY | LBS_DISABLENOSCROLL | LBS_OWNERDRAWFIXED | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_VSCROLL, 8, 18, 261, 52 - CONTROL "&Name", IDD_LOGIN_NAME_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 6, 69, 27, 8 - CONTROL "&Instance", IDD_LOGIN_INSTANCE_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 73, 69, 36, 8 - CONTROL "&Realm", IDD_LOGIN_REALM_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 140, 69, 26, 8 - CONTROL "&Password", IDD_LOGIN_PASSWORD_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 207, 69, 36, 8 - CONTROL "", IDD_LOGIN_NAME, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 6, 79, 62, 12 - CONTROL "", IDD_LOGIN_INSTANCE, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 73, 79, 62, 12 - CONTROL "", IDD_LOGIN_REALM, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_UPPERCASE | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 140, 79, 62, 12 - CONTROL "", IDD_LOGIN_PASSWORD, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 207, 79, 62, 12 + #ifdef KRB4 + CONTROL "&Name", IDD_LOGIN_NAME_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 6, 69, 27, 8 + CONTROL "&Instance", IDD_LOGIN_INSTANCE_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 73, 69, 36, 8 + CONTROL "&Realm", IDD_LOGIN_REALM_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 140, 69, 26, 8 + CONTROL "&Password", IDD_LOGIN_PASSWORD_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 207, 69, 36, 8 + CONTROL "", IDD_LOGIN_NAME, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 6, 79, 62, 12 + CONTROL "", IDD_LOGIN_INSTANCE, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 73, 79, 62, 12 + CONTROL "", IDD_LOGIN_REALM, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_UPPERCASE | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 140, 79, 62, 12 + CONTROL "", IDD_LOGIN_PASSWORD, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 207, 79, 62, 12 + #endif + #ifdef KRB5 + CONTROL "&Name", IDD_LOGIN_NAME_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 6, 69, 27, 8 + CONTROL "&Realm", IDD_LOGIN_REALM_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 140, 69, 26, 8 + CONTROL "&Password", IDD_LOGIN_PASSWORD_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 207, 69, 36, 8 + CONTROL "", IDD_LOGIN_NAME, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 6, 79, 62, 12 + CONTROL "", IDD_LOGIN_REALM, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_UPPERCASE | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 73, 79, 62, 12 + CONTROL "", IDD_LOGIN_PASSWORD, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 207, 79, 62, 12 + #endif CONTROL "&Change Password...", IDD_CHANGE_PASSWORD, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 6, 96, 74, 14 CONTROL "&Delete", IDD_TICKET_DELETE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 122, 96, 52, 14 CONTROL "&Login", IDD_LOGIN, "BUTTON", BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 216, 96, 52, 14 END -ID_PASSWORD DIALOG 96, 50, 143, 129 -STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU -CAPTION "Change Password" -FONT 8, "Arial" -BEGIN - CONTROL "&Name:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 9, 53, 8 - CONTROL "", IDD_PASSWORD_NAME, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_GROUP | WS_TABSTOP, 61, 6, 76, 12 - CONTROL "&Instance:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 26, 53, 8 - CONTROL "", IDD_PASSWORD_INSTANCE, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 61, 23, 76, 12 - CONTROL "&Realm:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 43, 53, 8 - CONTROL "", IDD_PASSWORD_REALM, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 61, 40, 76, 12 - CONTROL "&Old Password:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 60, 53, 8 - CONTROL "", IDD_OLD_PASSWORD, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 61, 57, 76, 12 - CONTROL "&New Password:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 77, 53, 8 - CONTROL "", IDD_NEW_PASSWORD1, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 61, 74, 76, 12 - CONTROL "&New Password:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 94, 53, 8 - CONTROL "", IDD_NEW_PASSWORD2, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 61, 91, 76, 12 - CONTROL "", IDD_PASSWORD_CR, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE, 5000, 5000, 0, 0 - CONTROL "OK", IDOK, "BUTTON", BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 13, 110, 52, 14 - CONTROL "Cancel", IDCANCEL, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 77, 110, 52, 14 -END +#ifdef KRB4 + ID_PASSWORD DIALOG 96, 50, 143, 129 + STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU + CAPTION "Change Password" + FONT 8, "Arial" + BEGIN + CONTROL "&Name:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 9, 53, 8 + CONTROL "", IDD_PASSWORD_NAME, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_GROUP | WS_TABSTOP, 61, 6, 76, 12 + CONTROL "&Instance:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 26, 53, 8 + CONTROL "", IDD_PASSWORD_INSTANCE, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 61, 23, 76, 12 + CONTROL "&Realm:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 43, 53, 8 + CONTROL "", IDD_PASSWORD_REALM, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 61, 40, 76, 12 + CONTROL "&Old Password:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 60, 53, 8 + CONTROL "", IDD_OLD_PASSWORD, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 61, 57, 76, 12 + CONTROL "&New Password:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 77, 53, 8 + CONTROL "", IDD_NEW_PASSWORD1, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 61, 74, 76, 12 + CONTROL "&New Password:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 94, 53, 8 + CONTROL "", IDD_NEW_PASSWORD2, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 61, 91, 76, 12 + CONTROL "", IDD_PASSWORD_CR, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE, 5000, 5000, 0, 0 + CONTROL "OK", IDOK, "BUTTON", BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 13, 110, 52, 14 + CONTROL "Cancel", IDCANCEL, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 77, 110, 52, 14 + END +#endif /* KRB4 */ + +#ifdef KRB5 + ID_PASSWORD DIALOG 96, 50, 143, 112 + STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU + CAPTION "Change Password" + FONT 8, "Arial" + BEGIN + CONTROL "&Name:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 9, 53, 8 + CONTROL "", IDD_PASSWORD_NAME, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_GROUP | WS_TABSTOP, 61, 6, 76, 12 + CONTROL "&Realm:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 26, 53, 8 + CONTROL "", IDD_PASSWORD_REALM, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 61, 23, 76, 12 + CONTROL "&Old Password:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 43, 53, 8 + CONTROL "", IDD_OLD_PASSWORD, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 61, 40, 76, 12 + CONTROL "&New Password:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 60, 53, 8 + CONTROL "", IDD_NEW_PASSWORD1, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 61, 57, 76, 12 + CONTROL "&New Password:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 77, 53, 8 + CONTROL "", IDD_NEW_PASSWORD2, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 61, 74, 76, 12 + CONTROL "", IDD_PASSWORD_CR, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE, 5000, 5000, 0, 0 + CONTROL "OK", IDOK, "BUTTON", BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 13, 93, 52, 14 + CONTROL "Cancel", IDCANCEL, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 77, 93, 52, 14 + END +#endif /* KRB5 */ ID_OPTS DIALOG 97, 52, 148, 107 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Kerberos Options" FONT 8, "Arial" BEGIN - CONTROL "&conf file:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 9, 40, 8 + CONTROL "&Conf file:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 9, 40, 8 CONTROL "", IDD_CONF, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 60, 6, 82, 12 - CONTROL "&realms file:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 26, 40, 8 + CONTROL "&Realms file:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 26, 40, 8 CONTROL "", IDD_REALMS, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 60, 23, 82, 12 CONTROL "&Ticket lifetime:", -1, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE, 5, 43, 53, 8 CONTROL "", IDD_LIFETIME, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 60, 40, 20, 12 diff --git a/src/windows/cns/makefile b/src/windows/cns/makefile index 7c81c7308..e743cd702 100644 --- a/src/windows/cns/makefile +++ b/src/windows/cns/makefile @@ -39,7 +39,7 @@ CFLAGS = $(CFLAGS_RELEASE) $(INCLUDES) /D$(KRB)=1 ##### RC Compiler RC = rc -RFLAGS = /nologo $(INCLUDES) +RFLAGS = /nologo /D$(KRB)=1 $(INCLUDES) ##### Linker LINK = link diff --git a/src/windows/cns/tktlist.c b/src/windows/cns/tktlist.c index 8eb94a52f..8f258c640 100644 --- a/src/windows/cns/tktlist.c +++ b/src/windows/cns/tktlist.c @@ -112,6 +112,7 @@ ticket_init_list ( krb5_creds c; krb5_flags flags; char *sname; /* Name of the service */ + char *flags_string(krb5_creds *cred); #endif SendMessage(hwnd, WM_SETREDRAW, FALSE, 0); @@ -168,14 +169,14 @@ ticket_init_list ( flags = 0; if (code = krb5_cc_set_flags(k5_context, k5_ccache, flags)) { if (code != KRB5_FCC_NOFILE) { - com_err (NULL, code, - "while setting cache flags (ticket cache %s)", - krb5_cc_get_name(k5_context, k5_ccache)); + //com_err (NULL, code, + // "while setting cache flags (ticket cache %s)", + // krb5_cc_get_name(k5_context, k5_ccache)); return -1; } } else { if (code = krb5_cc_start_seq_get(k5_context, k5_ccache, &cursor)) { - com_err (NULL, code, "while starting to retrieve tickets"); + //com_err (NULL, code, "while starting to retrieve tickets"); return -1; } @@ -191,6 +192,7 @@ ticket_init_list ( strcat (buf, short_date (c.times.endtime - kwin_get_epoch())); strcat (buf, " "); + /* Add ticket service name and realm */ code = krb5_unparse_name (k5_context, c.server, &sname); if (code) { com_err (NULL, code, "while unparsing server name"); @@ -198,6 +200,7 @@ ticket_init_list ( } strcat (buf, sname); free (sname); + strcat (buf, flags_string (&c)); /* Add flag info */ l = strlen(buf); lpinfo = (LPTICKETINFO) malloc(sizeof(TICKETINFO) + l + 1); @@ -220,16 +223,16 @@ ticket_init_list ( if (code == KRB5_CC_END) { /* End of ccache */ if (code = krb5_cc_end_seq_get(k5_context, k5_ccache, &cursor)) { - com_err(NULL, code, "while finishing ticket retrieval"); + //com_err(NULL, code, "while finishing ticket retrieval"); return -1; } flags = KRB5_TC_OPENCLOSE; /* turns on OPENCLOSE mode */ if (code = krb5_cc_set_flags(k5_context, k5_ccache, flags)) { - com_err(NULL, code, "while closing ccache"); + //com_err(NULL, code, "while closing ccache"); return -1; } } else { - com_err(NULL, code, "while retrieving a ticket"); + //com_err(NULL, code, "while retrieving a ticket"); return -1; } } @@ -425,3 +428,48 @@ LONG ticket_drawitem( return TRUE; } /* ticket_drawitem */ + + +#ifdef KRB5 + +/*+ + * + * Flags_string + * + * Return buffer with the current flags for the credential + * + */ +char * +flags_string(krb5_creds *cred) { + static char buf[32]; + int i = 0; + + buf[i++] = ' '; + if (cred->ticket_flags & TKT_FLG_FORWARDABLE) + buf[i++] = 'F'; + if (cred->ticket_flags & TKT_FLG_FORWARDED) + buf[i++] = 'f'; + if (cred->ticket_flags & TKT_FLG_PROXIABLE) + buf[i++] = 'P'; + if (cred->ticket_flags & TKT_FLG_PROXY) + buf[i++] = 'p'; + if (cred->ticket_flags & TKT_FLG_MAY_POSTDATE) + buf[i++] = 'D'; + if (cred->ticket_flags & TKT_FLG_POSTDATED) + buf[i++] = 'd'; + if (cred->ticket_flags & TKT_FLG_INVALID) + buf[i++] = 'i'; + if (cred->ticket_flags & TKT_FLG_RENEWABLE) + buf[i++] = 'R'; + if (cred->ticket_flags & TKT_FLG_INITIAL) + buf[i++] = 'I'; + if (cred->ticket_flags & TKT_FLG_HW_AUTH) + buf[i++] = 'H'; + if (cred->ticket_flags & TKT_FLG_PRE_AUTH) + buf[i++] = 'A'; + + buf[i] = '\0'; + return(buf); +} + +#endif /* KRB5 */ -- 2.26.2