+++ /dev/null
-# Sanitize.in for Kerberos V5
-
-# Each directory to survive it's way into a release will need a file
-# like this one called "./.Sanitize". All keyword lines must exist,
-# and must exist in the order specified by this file. Each directory
-# in the tree will be processed, top down, in the following order.
-
-# Hash started lines like this one are comments and will be deleted
-# before anything else is done. Blank lines will also be squashed
-# out.
-
-# The lines between the "Do-first:" line and the "Things-to-keep:"
-# line are executed as a /bin/sh shell script before anything else is
-# done in this
-
-Do-first:
-
-# All files listed between the "Things-to-keep:" line and the
-# "Files-to-sed:" line will be kept. All other files will be removed.
-# Directories listed in this section will have their own Sanitize
-# called. Directories not listed will be removed in their entirety
-# with rm -rf.
-
-Things-to-keep:
-
-ChangeLog
-HOW_TO_BUILD
-INCOMPATIBILITY
-Makefile
-OS-notes
-SOURCE-TREE
-TREE-GRAPH
-api
-implement
-install.texi
-install.ps
-kadmin
-krb5-protocol
-old-V4-docs
-texinfo.tex
-
-Things-to-lose:
-
-Do-last:
-
-# End of file.
+++ /dev/null
-# Sanitize.in for Kerberos V5
-
-# Each directory to survive it's way into a release will need a file
-# like this one called "./.Sanitize". All keyword lines must exist,
-# and must exist in the order specified by this file. Each directory
-# in the tree will be processed, top down, in the following order.
-
-# Hash started lines like this one are comments and will be deleted
-# before anything else is done. Blank lines will also be squashed
-# out.
-
-# The lines between the "Do-first:" line and the "Things-to-keep:"
-# line are executed as a /bin/sh shell script before anything else is
-# done in this
-
-Do-first:
-
-# All files listed between the "Things-to-keep:" line and the
-# "Files-to-sed:" line will be kept. All other files will be removed.
-# Directories listed in this section will have their own Sanitize
-# called. Directories not listed will be removed in their entirety
-# with rm -rf.
-
-Things-to-keep:
-
-ChangeLog
-Makefile
-ccache.tex
-changebar.sty
-errors.tex
-fancyheadings.sty
-fixunder.sty
-free.tex
-functions.sty
-intro.tex
-keytab.tex
-krb5.tex
-libdes.tex
-libos.tex
-library.tex
-rcache.tex
-tables.tex
-
-Things-to-lose:
-
-Do-last:
-
-# End of file.
+++ /dev/null
-# Sanitize.in for Kerberos V5
-
-# Each directory to survive it's way into a release will need a file
-# like this one called "./.Sanitize". All keyword lines must exist,
-# and must exist in the order specified by this file. Each directory
-# in the tree will be processed, top down, in the following order.
-
-# Hash started lines like this one are comments and will be deleted
-# before anything else is done. Blank lines will also be squashed
-# out.
-
-# The lines between the "Do-first:" line and the "Things-to-keep:"
-# line are executed as a /bin/sh shell script before anything else is
-# done in this
-
-Do-first:
-
-# All files listed between the "Things-to-keep:" line and the
-# "Files-to-sed:" line will be kept. All other files will be removed.
-# Directories listed in this section will have their own Sanitize
-# called. Directories not listed will be removed in their entirety
-# with rm -rf.
-
-Things-to-keep:
-
-ChangeLog
-Makefile
-ccache-i.tex
-changebar.sty
-cksum-i.tex
-crc-32-i.tex
-encrypt-i.tex
-fancyheadings.sty
-fixunder.sty
-functions.sty
-implement.tex
-kdb-i.tex
-keytab-i.tex
-libos-i.tex
-rcache-i.tex
-
-Things-to-lose:
-
-Do-last:
-
-# End of file.
+++ /dev/null
-# Sanitize.in for Kerberos V5
-
-# Each directory to survive it's way into a release will need a file
-# like this one called "./.Sanitize". All keyword lines must exist,
-# and must exist in the order specified by this file. Each directory
-# in the tree will be processed, top down, in the following order.
-
-# Hash started lines like this one are comments and will be deleted
-# before anything else is done. Blank lines will also be squashed
-# out.
-
-# The lines between the "Do-first:" line and the "Things-to-keep:"
-# line are executed as a /bin/sh shell script before anything else is
-# done in this
-
-Do-first:
-
-# All files listed between the "Things-to-keep:" line and the
-# "Files-to-sed:" line will be kept. All other files will be removed.
-# Directories listed in this section will have their own Sanitize
-# called. Directories not listed will be removed in their entirety
-# with rm -rf.
-
-Things-to-keep:
-
-kpasswd.protocol
-kadmin.protocol
-
-Things-to-lose:
-
-Do-last:
-
-# End of file.
+++ /dev/null
-# Sanitize.in for Kerberos V5
-
-# Each directory to survive it's way into a release will need a file
-# like this one called "./.Sanitize". All keyword lines must exist,
-# and must exist in the order specified by this file. Each directory
-# in the tree will be processed, top down, in the following order.
-
-# Hash started lines like this one are comments and will be deleted
-# before anything else is done. Blank lines will also be squashed
-# out.
-
-# The lines between the "Do-first:" line and the "Things-to-keep:"
-# line are executed as a /bin/sh shell script before anything else is
-# done in this
-
-Do-first:
-
-# All files listed between the "Things-to-keep:" line and the
-# "Files-to-sed:" line will be kept. All other files will be removed.
-# Directories listed in this section will have their own Sanitize
-# called. Directories not listed will be removed in their entirety
-# with rm -rf.
-
-Things-to-keep:
-
-krb5.constants
-rfc1510.errata
-rfc1510.txt
-3-des.txt
-
-Things-to-lose:
-
-Do-last:
-
-# End of file.
+++ /dev/null
-# Sanitize.in for Kerberos V5
-
-# Each directory to survive it's way into a release will need a file
-# like this one called "./.Sanitize". All keyword lines must exist,
-# and must exist in the order specified by this file. Each directory
-# in the tree will be processed, top down, in the following order.
-
-# Hash started lines like this one are comments and will be deleted
-# before anything else is done. Blank lines will also be squashed
-# out.
-
-# The lines between the "Do-first:" line and the "Things-to-keep:"
-# line are executed as a /bin/sh shell script before anything else is
-# done in this
-
-Do-first:
-
-# All files listed between the "Things-to-keep:" line and the
-# "Files-to-sed:" line will be kept. All other files will be removed.
-# Directories listed in this section will have their own Sanitize
-# called. Directories not listed will be removed in their entirety
-# with rm -rf.
-
-Things-to-keep:
-
-README
-installation.PS
-installation.mss
-operation.PS
-operation.mss
-
-Things-to-lose:
-
-Do-last:
-
-# End of file.
lib\des425\Makefile \
lib\gssapi\Makefile lib\gssapi\generic\Makefile \
lib\gssapi\krb5\Makefile lib\gssapi\mechglue\Makefile \
+ lib\gssapi\spnego\Makefile \
lib\krb4\Makefile lib\krb5\Makefile \
lib\krb5\asn.1\Makefile lib\krb5\ccache\Makefile \
lib\krb5\ccache\ccapi\Makefile \
##DOS## $(WCONFIG) config < $@.in > $@
##DOS##lib\gssapi\mechglue\Makefile: lib\gssapi\mechglue\Makefile.in $(MKFDEP)
##DOS## $(WCONFIG) config < $@.in > $@
+##DOS##lib\gssapi\spnego\Makefile: lib\gssapi\spnego\Makefile.in $(MKFDEP)
+##DOS## $(WCONFIG) config < $@.in > $@
##DOS##lib\gssapi\krb5\Makefile: lib\gssapi\krb5\Makefile.in $(MKFDEP)
##DOS## $(WCONFIG) config < $@.in > $@
##DOS##lib\krb4\Makefile: lib\krb4\Makefile.in $(MKFDEP)
lib/crypto/sha1/* lib/crypto/arcfour/* lib/crypto/md4/* \
lib/crypto/md5/* lib/crypto/yarrow/* \
lib/des425/* lib/gssapi/* lib/gssapi/generic/* lib/gssapi/krb5/* \
- lib/gssapi/mechglue/* lib/krb4/* \
+ lib/gssapi/mechglue/* lib/gssapi/spnego/* lib/krb4/* \
lib/krb5/* lib/krb5/asn.1/* lib/krb5/krb/* \
lib/krb5/ccache/* lib/krb5/ccache/ccapi/* \
lib/krb5/error_tables/* \
$(GK)gssapi_err_krb5.h $(GK)gssapi_err_krb5.c \
lib/krb4/krb_err_txt.c
-HOUT = $(INC)krb5.h $(GG)gssapi.h $(PR)profile.h
+HOUT = $(INC)krb5\krb5.h $(GG)gssapi.h $(PR)profile.h
CLEANUP= Makefile $(ETOUT) $(HOUT) \
include/profile.h include/osconf.h \
@if not exist "$(KRB_INSTALL_DIR)\$(NULL)" @echo The directory $(KRB_INSTALL_DIR) does not exist. Please create it.
@if not exist "$(KRB_INSTALL_DIR)\$(NULL)" @dir /b $(KRB_INSTALL_DIR)\nul
@if not exist "$(KRB_INSTALL_DIR)\include\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\include"
+ @if not exist "$(KRB_INSTALL_DIR)\include\krb5\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\include\krb5"
@if not exist "$(KRB_INSTALL_DIR)\include\gssapi\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\include\gssapi"
@if not exist "$(KRB_INSTALL_DIR)\lib\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\lib"
@if not exist "$(KRB_INSTALL_DIR)\bin\$(NULL)" @mkdir "$(KRB_INSTALL_DIR)\bin"
$(CP) include\krb5.h "$(KRB_INSTALL_DIR)\include\."
+ $(CP) include\krb5\krb5.h "$(KRB_INSTALL_DIR)\include\krb5\."
$(CP) include\win-mac.h "$(KRB_INSTALL_DIR)\include\."
$(CP) include\profile.h "$(KRB_INSTALL_DIR)\include\."
$(CP) include\com_err.h "$(KRB_INSTALL_DIR)\include\."
for (;;) {
FD_ZERO(&waitread);
FD_SET(0, &waitread);
- n = select(8*sizeof(waitread), &waitread, 0, 0, 0, 0);
+ n = select(1, &waitread, 0, 0, 0, 0);
if (n < 0 && errno == EINTR)
continue;
if (n > 0)
}
}
- if (select(8*sizeof(ibits), &ibits, &obits, &ebits, 0) < 0) {
+ if (select(((p > f) ? p : f) + 1, &ibits, &obits, &ebits, 0) < 0) {
if (errno == EINTR)
continue;
fatalperror(f, "select");
rewrite:
FD_ZERO(&rembits);
FD_SET(rem, &rembits);
- if (select(8*sizeof(rembits), 0, &rembits, 0, 0) < 0) {
+ if (select(rem + 1, 0, &rembits, 0, 0) < 0) {
if (errno != EINTR) {
perror("select");
exit(1);
FD_SET(rem, &readfrom);
do {
ready = readfrom;
- if (select(8*sizeof(ready), &ready, 0, 0, 0) < 0) {
+ if (select(((rfd2 > rem) ? rfd2 : rem) + 1, &ready, 0, 0, 0) < 0) {
if (errno != EINTR) {
perror("select");
exit(1);
fd = 0;
}
+/*
+ * AIX passes an IPv4-mapped IPv6 address back from getpeername, but if
+ * that address is later used in connect(), it returns an error. Convert
+ * IPv4-mapped IPv6 addresses to simple IPv4 addresses on AIX (but don't
+ * do this everywhere since it isn't always the right thing to do, just
+ * the least wrong on AIX).
+ */
+#if defined(_AIX) && defined(KRB5_USE_INET6)
+ if (((struct sockaddr*)&from)->sa_family == AF_INET6 && IN6_IS_ADDR_V4MAPPED(&sa2sin6(&from)->sin6_addr)) {
+ sa2sin(&from)->sin_len = sizeof(struct sockaddr_in);
+ sa2sin(&from)->sin_family = AF_INET;
+ sa2sin(&from)->sin_port = sa2sin6(&from)->sin6_port;
+ memmove(&(sa2sin(&from)->sin_addr.s_addr), &(sa2sin6(&from)->sin6_addr.u6_addr.u6_addr8[12]), 4);
+ }
+#endif
+
if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (char *)&on,
sizeof (on)) < 0)
syslog(LOG_WARNING, "setsockopt (SO_KEEPALIVE): %m");
goto signout_please;
}
if (pid) {
+ int maxfd;
#ifdef POSIX_SIGNALS
sa.sa_handler = cleanup;
(void)sigaction(SIGINT, &sa, (struct sigaction *)0);
FD_ZERO(&readfrom);
FD_SET(f, &readfrom);
+ maxfd = f;
if(port) {
FD_SET(s, &readfrom);
+ if (s > maxfd)
+ maxfd = s;
FD_SET(pv[0], &readfrom);
+ if (pv[0] > maxfd)
+ maxfd = pv[0];
}
FD_SET(pw[0], &readfrom);
+ if (pw[0] > maxfd)
+ maxfd = pw[0];
/* read from f, write to px[1] -- child stdin */
/* read from s, signal child */
do {
ready = readfrom;
- if (select(8*sizeof(ready), &ready, (fd_set *)0,
+ if (select(maxfd + 1, &ready, (fd_set *)0,
(fd_set *)0, (struct timeval *)0) < 0) {
if (errno == EINTR) {
continue;
struct hostent *hp;
KTEXT_ST ticket;
AUTH_DAT authdata;
- unsigned long addr;
+ unsigned KRB4_32 addr;
static /*const*/ char rcmd_str[] = "rcmd";
#if 0
char key[8];
#
# appl/gssftp/ftp/Makefile.in
#
-DEFINES = -DGSSAPI -DFTP_BUFSIZ=10240
+DEFINES = -DGSSAPI -DFTP_BUFSIZ=65535
PROG_LIBPATH=-L$(TOPLIBD)
PROG_RPATH=$(KRB5_LIBDIR)
if (mflag && confirm(argv[0], cp)) {
tp = cp;
if (mcase) {
- while (*tp && !islower((int) (*tp))) {
+ while (*tp && !islower((unsigned char) (*tp))) {
tp++;
}
if (!*tp) {
tp = cp;
tp2 = tmpbuf;
while ((*tp2 = *tp) != 0) {
- if (isupper((int) *tp2)) {
+ if (isupper((unsigned char) *tp2)) {
*tp2 = 'a' + *tp2 - 'A';
}
tp++;
if (loc && mcase) {
char *tp = argv[1], *tp2, tmpbuf[MAXPATHLEN];
- while (*tp && !islower((int) *tp)) {
+ while (*tp && !islower((unsigned char) *tp)) {
tp++;
}
if (!*tp) {
tp = argv[2];
tp2 = tmpbuf;
while ((*tp2 = *tp) != 0) {
- if (isupper((int) *tp2)) {
+ if (isupper((unsigned char) *tp2)) {
*tp2 = 'a' + *tp2 - 'A';
}
tp++;
if (mflag && confirm(argv[0], cp)) {
tp = cp;
if (mcase) {
- while (*tp && !islower((int) *tp)) {
+ while (*tp && !islower((unsigned char) *tp)) {
tp++;
}
if (!*tp) {
tp = cp;
tp2 = tmpbuf;
while ((*tp2 = *tp) != 0) {
- if (isupper((int) *tp2)) {
+ if (isupper((unsigned char) *tp2)) {
*tp2 = 'a' + *tp2 - 'A';
}
tp++;
* getline - a hacked up version of fgets to ignore TELNET escape codes.
*/
char *
-getline(s, n, iop)
+ftpd_getline(s, n, iop)
char *s;
int n;
register FILE *iop;
case CMD:
(void) signal(SIGALRM, toolong);
(void) alarm((unsigned) timeout);
- if (getline(cbuf, sizeof(cbuf)-1, stdin) == NULL) {
+ if (ftpd_getline(cbuf, sizeof(cbuf)-1, stdin) == NULL) {
reply(221, "You could at least say goodbye.");
dologout(0);
}
extern char *home; /* pointer to home directory for glob */
extern FILE *ftpd_popen(), *fopen(), *freopen();
extern int ftpd_pclose(), fclose();
-extern char *getline();
extern char cbuf[];
extern off_t restart_point;
if (!transflag)
return;
cp = tmpline;
- if (getline(cp, sizeof(tmpline), stdin) == NULL) {
+ if (ftpd_getline(cp, sizeof(tmpline), stdin) == NULL) {
reply(221, "You could at least say goodbye.");
dologout(0);
}
/* ftpcmd.y */
void upper(char *);
-char *getline(char *, int, FILE *);
+char *ftpd_getline(char *, int, FILE *);
#endif /* FTPD_VAR_H__ */
/* popen.c */
(cd $(BUILDTOP)/include; $(MAKE) autoconf.h)
-# @lib_frag@
-# @libobj_frag@
+@lib_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
#
AC_CHECK_HEADERS(utmp.h utmpx.h)
-AC_CHECK_FUNCS(setutent setutxent updwtmp updwtmpx logwtmp getutmp getutmpx)
+AC_CHECK_FUNCS(setutent setutxent setutsent updwtmp updwtmpx logwtmp getutmp getutmpx)
AC_CHECK_FUNCS(utmpname utmpxname)
AC_DEFUN(K5_CHECK_UT_MEMBER,
*
* There is no wtmpx file, despite there being utmp and utmpx files.
*
+ * HP-UX 11.23:
+ *
+ * In addition to other HP-UX issues, 11.23 includes yet another utmp
+ * management interface in utmps.h. This interface updates a umtpd
+ * daemon which then manages local files. Directly accessing the files
+ * through the existing, yet deprecated, utmp.h interface results in
+ * nothing.
+ *
* Irix 6.x:
*
* In utmpx, ut_exit contains __e_termination and __e_exit, which get
/*
* The following grossness exists to avoid duplicating lots of code
* between the cases where we have an old-style sysV utmp and where we
- * have a modern (Unix98 or XPG4) utmpx. See the above history rant
- * for further explanation.
+ * have a modern (Unix98 or XPG4) utmpx, or the new (hp-ux 11.23) utmps.
+ * See the above history rant for further explanation.
*/
-#if defined(HAVE_SETUTXENT) || defined(HAVE_SETUTENT)
+#if defined(HAVE_SETUTXENT) || defined(HAVE_SETUTENT) || defined(HAVE_SETUTSENT)
+#ifdef HAVE_SETUTSENT
+#include <utmps.h>
+#define PTY_STRUCT_UTMPX struct utmps
+#define PTY_SETUTXENT setutsent
+#define PTY_GETUTXENT GETUTSENT
+#define PTY_GETUTXLINE GETUTSLINE
+#define PTY_PUTUTXLINE PUTUTSLINE
+#define PTY_ENDUTXENT endutsent
+#else
#ifdef HAVE_SETUTXENT
#define PTY_STRUCT_UTMPX struct utmpx
#define PTY_SETUTXENT setutxent
#define PTY_PUTUTXLINE pututline
#define PTY_ENDUTXENT endutent
#endif
-
+#endif
static int better(const PTY_STRUCT_UTMPX *, const PTY_STRUCT_UTMPX *,
const PTY_STRUCT_UTMPX *);
static int match_pid(const PTY_STRUCT_UTMPX *,
+++ /dev/null
-# @(#)Makefile 8.2 (Berkeley) 12/15/93
-
-LIB= telnet
-SRCS= auth.c encrypt.c genget.c getent.c misc.c
-SRCS+= kerberos.c enc_des.c
-#SRCS+= kerberos5.c
-CFLAGS+= -DENCRYPTION -DAUTHENTICATION -DHAS_CGETENT
-CFLAGS+= -DKRB4 -DDES_ENCRYPTION -I/usr/include/kerberosIV
-
-# These are the sources that have encryption stuff in them.
-CRYPT_SRC= auth.c enc-proto.h enc_des.c encrypt.c
-CRYPT_SRC+= encrypt.h kerberos.c kerberos5.c krb4encpwd.c
-CRYPT_SRC+= misc.c spx.c Makefile
-NOCRYPT_DIR=${.CURDIR}/Nocrypt
-
-.include <bsd.lib.mk>
-
-nocrypt:
-#ifdef ENCRYPTION
- @for i in ${CRYPT_SRC}; do \
- if [ ! -d ${NOCRYPT_DIR} ]; then \
- echo Creating subdirectory ${NOCRYPT_DIR}; \
- mkdir ${NOCRYPT_DIR}; \
- fi; \
- echo ${NOCRYPT_DIR}/$$i; \
- unifdef -UENCRYPTION ${.CURDIR}/$$i | \
- sed "s/ || defined(ENCRYPTION)//" > ${NOCRYPT_DIR}/$$i; \
- done
-
-placeholder:
-#else /* ENCRYPTION */
- @echo "Encryption code already removed."
-#endif /* ENCRYPTION */
+++ /dev/null
-#
-# Copyright (c) 1991 The Regents of the University of California.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms are permitted provided
-# that: (1) source distributions retain this entire copyright notice and
-# comment, and (2) distributions including binaries display the following
-# acknowledgement: ``This product includes software developed by the
-# University of California, Berkeley and its contributors'' in the
-# documentation or other materials provided with the distribution and in
-# all advertising materials mentioning features or use of this software.
-# Neither the name of the University nor the names of its contributors may
-# be used to endorse or promote products derived from this software without
-# specific prior written permission.
-# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-#
-# @(#)Makefile.generic 5.5 (Berkeley) 3/1/91
-#
-
-LIB= libtelnet.a
-SRCS= auth.c encrypt.c genget.c \
- misc.c kerberos.c kerberos5.c forward.c spx.c enc_des.c \
- rsaencpwd.c krb4encpwd.c read_password.c \
- setenv.c getent.c strdup.c strcasecmp.c \
- strchr.c strrchr.c strftime.c strerror.c \
- ${LIB_SRC}
-
-OBJS= auth.o encrypt.o genget.o \
- misc.o kerberos.o kerberos5.o forward.o spx.o enc_des.o \
- rsaencpwd.o krb4encpwd.o read_password.o \
- ${LIB_OBJ}
-
-TELNET_H= ../arpa/telnet.h
-
-CFLAGS= ${LCCFLAGS} ${DEFINES} ${INCLUDES}
-
-${LIB}: ${OBJS}
- rm -f ${LIB}
- ${AR} ${ARFLAGS} ${LIB} `lorder ${OBJS} | tsort`
- @if [ ${RANLIB} != NONE ]; \
- then echo ${RANLIB} ${LIB}; ${RANLIB} ${LIB}; fi
-
-clean cleandir:
- rm -f *.o ${LIB} core a.out
-
-auth.o: ${TELNET_H}
-auth.o: encrypt.h
-auth.o: auth.h
-auth.o: misc-proto.h
-encrypt.o: ${TELNET_H}
-encrypt.o: encrypt.h
-encrypt.o: misc.h
-kerberos.o: ${TELNET_H}
-kerberos.o: encrypt.h
-kerberos.o: auth.h
-kerberos.o: misc.h
-kerberos5.o: ${TELNET_H}
-kerberos5.o: encrypt.h
-kerberos5.o: auth.h
-kerberos5.o: misc.h
-misc.o: misc.h
-enc_des.o: ${TELNET_H}
-enc_des.o: encrypt.h
-enc_des.o: key-proto.h
-enc_des.o: misc-proto.h
AUTH_DEF=-DAUTHENTICATION -DENCRYPTION -DDES_ENCRYPTION -DKRB5 -DFORWARD \
-UNO_LOGIN_F -DLOGIN_CAP_F -DLOGIN_PROGRAM=KRB5_PATH_LOGIN
LOCALINCLUDES=-I.. -I$(srcdir)/.. @KRB4_INCLUDES@
-DEFINES = $(AUTH_DEF)
+DEFINES = -DTELNET_BUFSIZE=65535 $(AUTH_DEF)
LIBOBJS=@LIBOBJS@
SETENVSRC=@SETENVSRC@
enc_des.o: misc-proto.h
install::
-# @lib_frag@
-# @libobj_frag@
+@lib_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
#endif /* FORWARD */
-static unsigned char str_data[8192] = {IAC, SB, TELOPT_AUTHENTICATION, 0,
+static unsigned char str_data[TELNET_BUFSIZE] = {IAC, SB, TELOPT_AUTHENTICATION, 0,
AUTHTYPE_KERBEROS_V5, };
/*static unsigned char str_name[1024] = { IAC, SB, TELOPT_AUTHENTICATION,
TELQUAL_NAME, };*/
+++ /dev/null
-#
-# Copyright (c) 1990 The Regents of the University of California.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1. Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-# notice, this list of conditions and the following disclaimer in the
-# documentation and/or other materials provided with the distribution.
-# 3. All advertising materials mentioning features or use of this software
-# must display the following acknowledgement:
-# This product includes software developed by the University of
-# California, Berkeley and its contributors.
-# 4. Neither the name of the University nor the names of its contributors
-# may be used to endorse or promote products derived from this software
-# without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# @(#)Makefile 8.1 (Berkeley) 6/6/93
-#
-
-PROG= telnet
-
-CFLAGS+=-DTERMCAP -DKLUDGELINEMODE -DUSE_TERMIO -DAUTHENTICATION -DENCRYPTION
-CFLAGS+=-DENV_HACK
-CFLAGS+=-I${.CURDIR}/../../lib
-
-CFLAGS+= -DKRB4
-
-LDADD= -ltermcap -ltelnet
-LDADD+= -lkrb -ldes
-DPADD= ${LIBTERMCAP}
-
-SRCS= authenc.c commands.c main.c network.c ring.c sys_bsd.c telnet.c \
- terminal.c tn3270.c utilities.c
-
-# These are the sources that have encryption stuff in them.
-CRYPT_SRC= authenc.c commands.c externs.h main.c network.c
-CRYPT_SRC+= ring.c ring.h telnet.c terminal.c utilities.c Makefile
-NOCRYPT_DIR=${.CURDIR}/Nocrypt
-
-.include <bsd.prog.mk>
-
-nocrypt:
-#ifdef ENCRYPTION
- @for i in ${CRYPT_SRC}; do \
- if [ ! -d ${NOCRYPT_DIR} ]; then \
- echo Creating subdirectory ${NOCRYPT_DIR}; \
- mkdir ${NOCRYPT_DIR}; \
- fi; \
- echo ${NOCRYPT_DIR}/$$i; \
- unifdef -UENCRYPTION ${.CURDIR}/$$i | \
- sed "s/ || defined(ENCRYPTION)//" > ${NOCRYPT_DIR}/$$i; \
- done
-
-placeholder:
-#else /* ENCRYPTION */
- @echo "Encryption code already removed."
-#endif /* ENCRYPTION */
+++ /dev/null
-#
-# Copyright (c) 1991 The Regents of the University of California.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms are permitted provided
-# that: (1) source distributions retain this entire copyright notice and
-# comment, and (2) distributions including binaries display the following
-# acknowledgement: ``This product includes software developed by the
-# University of California, Berkeley and its contributors'' in the
-# documentation or other materials provided with the distribution and in
-# all advertising materials mentioning features or use of this software.
-# Neither the name of the University nor the names of its contributors may
-# be used to endorse or promote products derived from this software without
-# specific prior written permission.
-# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-#
-# @(#)Makefile.generic 5.5 (Berkeley) 3/1/91
-#
-
-INCLUDES= -I..
-ARPA_TELNET= ../arpa/telnet.h
-
-SRCS= commands.c main.c network.c ring.c \
- sys_bsd.c telnet.c terminal.c \
- utilities.c ${GETOPT_SRC}
-
-CFLAGS= ${LCCFLAGS} ${INCLUDES} ${DEFINES}
-
-ALLHC= ${SRCS} \
- defines.h externs.h fdset.h general.h \
- ring.h types.h
-
-OBJS= authenc.o commands.o main.o network.o ring.o sys_bsd.o \
- telnet.o terminal.o utilities.o ${GETOPT_OBJ}
-MAN= telnet.0
-
-#
-# These next three lines are not needed in 4.4BSD
-#
-.SUFFIXES: .0 .1
-.1.0:
- nroff -man -h $< > $@
-
-all: telnet
-
-telnet: ${OBJS} ${LIBPATH}
- ${CC} -o $@ ${CFLAGS} ${OBJS} ${LIBS}
-
-clean: FRC
- rm -f ${OBJS} core errs l.errs telnet
-
-cleandir: clean
- rm -f ${MAN} tags .depend
-
-clist: FRC ${SRCS}
- @for i in ${SRCS} ; \
- do (echo ${DIRPATH}$$i); done
-
-hclist: FRC ${ALLHC}
- @for i in ${ALLHC} ; \
- do (echo ${DIRPATH}$$i); done
-
-depend: FRC ${SRCS}
- mkdep ${CFLAGS} `make clist`
-
-install: ${MAN} FRC
- install -s -o bin -g bin -m 755 telnet ${DEST}
- install -c -o bin -g bin -m 444 telnet.0 ${DESTDIR}/usr/man/cat1
-
-lint: FRC ${SRCS}
- lint ${CFLAGS} `make clist`
-
-tags: FRC ${SRCS}
- ctags `make hclist`
-
-FRC:
-
-authenc.o: defines.h externs.h general.h ring.h types.h ${ARPA_TELNET}
-commands.o: defines.h externs.h general.h ring.h types.h ${ARPA_TELNET}
-main.o: defines.h externs.h ring.h
-network.o: defines.h externs.h fdset.h ring.h ${ARPA_TELNET}
-ring.o: general.h ring.h
-sys_bsd.o: defines.h externs.h fdset.h ring.h types.h ${ARPA_TELNET}
-telnet.o: defines.h externs.h general.h ring.h types.h ${ARPA_TELNET}
-terminal.o: externs.h ring.h types.h ${ARPA_TELNET}
-tn3270.o: defines.h externs.h fdset.h general.h ring.h ${ARPA_TELNET}
-utilities.o: defines.h externs.h fdset.h general.h ring.h ${ARPA_TELNET}
AUTH_DEF=-DAUTHENTICATION -DENCRYPTION -DKRB5 -DFORWARD -UNO_LOGIN_F -DLOGIN_CAP_F -DLOGIN_PROGRAM=KRB5_PATH_LOGIN
OTHERDEFS=-DLINEMODE -DKLUDGELINEMODE -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON
LOCALINCLUDES=-I.. -I$(srcdir)/..
-DEFINES = $(AUTH_DEF) $(OTHERDEFS)
+DEFINES = -DTELNET_BUFSIZE=65535 $(AUTH_DEF) $(OTHERDEFS)
ARPA_TELNET= $(srcdir)/../arpa/telnet.h
PROG_LIBPATH=-L$(TOPLIBD)
#include "fdset.h"
Ring netoring, netiring;
-unsigned char netobuf[2*BUFSIZ], netibuf[BUFSIZ];
+unsigned char netobuf[2*TELNET_BUFSIZE], netibuf[TELNET_BUFSIZE];
/*
* Initialize internal network data structures.
*/
if ((c == ' ') || !isascii(c))
n = 1;
- else if (islower((int) c))
- *cp = toupper((int) c);
+ else if (islower((unsigned char) c))
+ *cp = toupper((unsigned char) c);
}
/*
+++ /dev/null
-# @(#)Makefile 8.2 (Berkeley) 12/15/93
-
-PROG= telnetd
-CFLAGS+=-DLINEMODE -DKLUDGELINEMODE -DUSE_TERMIO -DDIAGNOSTICS
-CFLAGS+=-DOLD_ENVIRON -DENV_HACK
-CFLAGS+=-DAUTHENTICATION -DENCRYPTION -I${.CURDIR}/../../lib
-SRCS= authenc.c global.c slc.c state.c sys_term.c telnetd.c \
- termstat.c utility.c
-DPADD= ${LIBUTIL} ${LIBTERM}
-LDADD= -lutil -ltermcap -ltelnet
-LDADD+= -lkrb -ldes
-MAN8= telnetd.0
-
-# These are the sources that have encryption stuff in them.
-CRYPT_SRC= authenc.c ext.h state.c telnetd.c termstat.c
-CRYPT_SRC+= utility.c Makefile
-NOCRYPT_DIR=${.CURDIR}/Nocrypt
-
-.include <bsd.prog.mk>
-
-nocrypt:
-#ifdef ENCRYPTION
- @for i in ${CRYPT_SRC}; do \
- if [ ! -d ${NOCRYPT_DIR} ]; then \
- echo Creating subdirectory ${NOCRYPT_DIR}; \
- mkdir ${NOCRYPT_DIR}; \
- fi; \
- echo ${NOCRYPT_DIR}/$$i; \
- unifdef -UENCRYPTION ${.CURDIR}/$$i | \
- sed "s/ || defined(ENCRYPTION)//" > ${NOCRYPT_DIR}/$$i; \
- done
-
-placeholder:
-#else /* ENCRYPTION */
- @echo "Encryption code already removed."
-#endif /* ENCRYPTION */
+++ /dev/null
-#
-# Copyright (c) 1991 The Regents of the University of California.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms are permitted provided
-# that: (1) source distributions retain this entire copyright notice and
-# comment, and (2) distributions including binaries display the following
-# acknowledgement: ``This product includes software developed by the
-# University of California, Berkeley and its contributors'' in the
-# documentation or other materials provided with the distribution and in
-# all advertising materials mentioning features or use of this software.
-# Neither the name of the University nor the names of its contributors may
-# be used to endorse or promote products derived from this software without
-# specific prior written permission.
-# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-#
-# @(#)Makefile.generic 5.5 (Berkeley) 3/1/91
-#
-
-SRC1= telnetd.c state.c termstat.c slc.c sys_term.c utility.c global.c authenc.c
-OBJ1= telnetd.o state.o termstat.o slc.o sys_term.o utility.o global.o authenc.o
-
-OBJS= ${OBJ1} ${GETTYOBJ}
-SRCS= ${SRC1} ${GETTYSRC}
-
-MAN= telnetd.0
-CFLAGS= ${LCCFLAGS} ${INCLUDES} ${DEFINES}
-ARPA_TELNET = ../arpa/telnet.h
-
-#
-# These next three lines are not needed in 4.4BSD
-#
-.SUFFIXES: .0 .8
-.8.0:
- nroff -man -h $< > $@
-
-
-all: telnetd
-
-telnetd: ${OBJS} ${LIBPATH}
- ${CC} -o $@ ${CFLAGS} ${OBJS} ${LIBS}
-
-clean:
- rm -f ${OBJS} core telnetd
-
-cleandir: clean
- rm -f ${MAN} tags .depend
-
-depend: ${SRCS}
- mkdep ${CFLAGS} ${SRCS}
-
-install: ${MAN}
- install -s -o bin -g bin -m 755 telnetd ${LIBEXEC}
- install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat8
-
-lint: ${SRCS}
- lint ${CFLAGS} ${SRCS}
-
-tags: ${SRCS}
- ctags ${SRCS}
-
-authenc.o: telnetd.h
-global.o: defs.h ext.h ${ARPA_TELNET}
-slc.o: telnetd.h defs.h ext.h ${ARPA_TELNET}
-state.o: telnetd.h defs.h ext.h ${ARPA_TELNET}
-sys_term.o: telnetd.h pathnames.h defs.h ext.h ${ARPA_TELNET}
-telnetd.o: telnetd.h defs.h ext.h ${ARPA_TELNET}
-termstat.o: telnetd.h defs.h ext.h ${ARPA_TELNET}
-utility.o: telnetd.h defs.h ext.h ${ARPA_TELNET}
AUTH_DEF=-DAUTHENTICATION -DENCRYPTION -DKRB5 -DFORWARD -UNO_LOGIN_F -ULOGIN_CAP_F -DLOGIN_PROGRAM=KRB5_PATH_LOGIN
OTHERDEFS=-DKLUDGELINEMODE -DDIAGNOSTICS -DENV_HACK -DOLD_ENVIRON
LOCALINCLUDES=-I.. -I$(srcdir)/..
-DEFINES = $(AUTH_DEF) $(OTHERDEFS)
+DEFINES = -DTELNET_BUFSIZE=65535 $(AUTH_DEF) $(OTHERDEFS)
ARPA_TELNET= $(srcdir)/../arpa/telnet.h
PROG_LIBPATH=-L$(TOPLIBD) $(KRB4_LIBPATH)
* Buffer for sub-options, and macros
* for suboptions buffer manipulations
*/
-unsigned char subbuffer[4096], *subpointer= subbuffer, *subend= subbuffer;
+unsigned char subbuffer[TELNET_BUFSIZE], *subpointer= subbuffer, *subend= subbuffer;
#define SB_CLEAR() subpointer = subbuffer
#define SB_TERM() { subend = subpointer; SB_CLEAR(); }
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+# Inc.
-timestamp='2003-10-03'
+timestamp='2006-06-06'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
+
# Originally written by Per Bothner <per@bothner.com>.
# Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry.
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
+ echo "$timestamp" ; exit ;;
--version | -v )
- echo "$version" ; exit 0 ;;
+ echo "$version" ; exit ;;
--help | --h* | -h )
- echo "$usage"; exit 0 ;;
+ echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ;'
+esac ; set_cc_for_build= ;'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
- exit 0 ;;
- amiga:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- arc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- hp300:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mac68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- macppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme68k:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvme88k:OpenBSD:*:*)
- echo m88k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- mvmeppc:OpenBSD:*:*)
- echo powerpc-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- pmax:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sgi:OpenBSD:*:*)
- echo mipseb-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- sun3:OpenBSD:*:*)
- echo m68k-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
- wgrisc:OpenBSD:*:*)
- echo mipsel-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:OpenBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
- exit 0 ;;
+ UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+ exit ;;
+ *:ekkoBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+ exit ;;
+ *:SolidBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+ exit ;;
+ macppc:MirBSD:*:*)
+ echo powerppc-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
+ *:MirBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+ exit ;;
alpha:OSF1:*:*)
- if test $UNAME_RELEASE = "V4.0"; then
+ case $UNAME_RELEASE in
+ *4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
- fi
+ ;;
+ *5.*)
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+ ;;
+ esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
esac
+ # A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- exit 0 ;;
- Alpha*:OpenVMS:*:*)
- echo alpha-hp-vms
- exit 0 ;;
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
- exit 0 ;;
+ exit ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
- exit 0 ;;
+ exit ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
- exit 0;;
+ exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
- exit 0 ;;
+ exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-morphos
- exit 0 ;;
+ exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
- exit 0 ;;
+ exit ;;
+ *:z/VM:*:*)
+ echo s390-ibm-zvmoe
+ exit ;;
+ *:OS400:*:*)
+ echo powerpc-ibm-os400
+ exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
- exit 0;;
+ exit ;;
+ arm:riscos:*:*|arm:RISCOS:*:*)
+ echo arm-unknown-riscos
+ exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
- exit 0;;
+ exit ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
else
echo pyramid-pyramid-bsd
fi
- exit 0 ;;
+ exit ;;
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
- exit 0 ;;
+ exit ;;
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
- exit 0 ;;
- DRS?6000:UNIX_SV:4.2*:7*)
+ exit ;;
+ DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7 && exit 0 ;;
+ sparc) echo sparc-icl-nx7; exit ;;
esac ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
i86pc:SunOS:5.*:*)
echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit 0 ;;
+ exit ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
echo sparc-sun-sunos${UNAME_RELEASE}
;;
esac
- exit 0 ;;
+ exit ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
+ m68k:machten:*:*)
+ echo m68k-apple-machten${UNAME_RELEASE}
+ exit ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
- exit 0 ;;
+ exit ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
exit (-1);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c \
- && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
- && exit 0
+ $CC_FOR_BUILD -o $dummy $dummy.c &&
+ dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`$dummy $dummyarg` &&
+ { echo "$SYSTEM_NAME"; exit; }
echo mips-mips-riscos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
- exit 0 ;;
+ exit ;;
Motorola:*:4.3:PL8-*)
echo powerpc-harris-powermax
- exit 0 ;;
+ exit ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
echo powerpc-harris-powermax
- exit 0 ;;
+ exit ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
- exit 0 ;;
+ exit ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
- exit 0 ;;
+ exit ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
- exit 0 ;;
+ exit ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
- exit 0 ;;
+ exit ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
- exit 0 ;;
+ exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
- exit 0 ;;
+ exit ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
- exit 0 ;;
+ exit ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
- exit 0 ;;
+ exit ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
- exit 0 ;;
+ exit ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit 0 ;;
+ exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
- exit 0 ;;
+ exit ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit 0 ;;
+ exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval $set_cc_for_build
exit(0);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
- echo rs6000-ibm-aix3.2.5
+ if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ then
+ echo "$SYSTEM_NAME"
+ else
+ echo rs6000-ibm-aix3.2.5
+ fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
- exit 0 ;;
+ exit ;;
*:AIX:*:[45])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit 0 ;;
+ exit ;;
*:AIX:*:*)
echo rs6000-ibm-aix
- exit 0 ;;
+ exit ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
- exit 0 ;;
+ exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit 0 ;; # report: romp-ibm BSD 4.3
+ exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
- exit 0 ;;
+ exit ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
- exit 0 ;;
+ exit ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
- exit 0 ;;
+ exit ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
- exit 0 ;;
+ exit ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
esac
if [ ${HP_ARCH} = "hppa2.0w" ]
then
- # avoid double evaluation of $set_cc_for_build
- test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+ eval $set_cc_for_build
+
+ # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+ # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
+ # generating 64-bit code. GNU and HP use different nomenclature:
+ #
+ # $ CC_FOR_BUILD=cc ./config.guess
+ # => hppa2.0w-hp-hpux11.23
+ # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+ # => hppa64-hp-hpux11.23
+
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ grep __LP64__ >/dev/null
then
HP_ARCH="hppa2.0w"
else
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit 0 ;;
+ exit ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
- exit 0 ;;
+ exit ;;
3050*:HI-UX:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
exit (0);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
- exit 0 ;;
+ exit ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
- exit 0 ;;
+ exit ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
- exit 0 ;;
+ exit ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
- exit 0 ;;
+ exit ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
- exit 0 ;;
+ exit ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
- exit 0 ;;
+ exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
echo ${UNAME_MACHINE}-unknown-osf1
fi
- exit 0 ;;
+ exit ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
- exit 0 ;;
+ exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
- exit 0 ;;
+ exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
- exit 0 ;;
+ exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
- exit 0 ;;
+ exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
- exit 0 ;;
+ exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
- exit 0 ;;
+ exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ exit ;;
*:UNICOS/mp:*:*)
- echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit 0 ;;
+ echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit 0 ;;
+ exit ;;
+ 5000:UNIX_System_V:4.*:*)
+ FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit 0 ;;
- *:FreeBSD:*:*|*:GNU/FreeBSD:*:*)
- # Determine whether the default compiler uses glibc.
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #include <features.h>
- #if __GLIBC__ >= 2
- LIBC=gnu
- #else
- LIBC=
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- # GNU/FreeBSD systems have a "k" prefix to indicate we are using
- # FreeBSD's kernel, but not the complete OS.
- case ${LIBC} in gnu) kernel_only='k' ;; esac
- echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
- exit 0 ;;
+ exit ;;
+ *:FreeBSD:*:*)
+ case ${UNAME_MACHINE} in
+ pc98)
+ echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ amd64)
+ echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ *)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ esac
+ exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
- exit 0 ;;
+ exit ;;
i*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
- exit 0 ;;
+ exit ;;
+ i*:windows32*:*)
+ # uname -m includes "-pc" on this system.
+ echo ${UNAME_MACHINE}-mingw32
+ exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
- exit 0 ;;
- x86:Interix*:[34]*)
- echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
- exit 0 ;;
+ exit ;;
+ x86:Interix*:[345]*)
+ echo i586-pc-interix${UNAME_RELEASE}
+ exit ;;
+ EM64T:Interix*:[345]*)
+ echo x86_64-unknown-interix${UNAME_RELEASE}
+ exit ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
- exit 0 ;;
+ exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i586-pc-interix
- exit 0 ;;
+ exit ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
- exit 0 ;;
+ exit ;;
+ amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+ echo x86_64-unknown-cygwin
+ exit ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
- exit 0 ;;
+ exit ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit 0 ;;
+ exit ;;
*:GNU:*:*)
+ # the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit 0 ;;
+ exit ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
- exit 0 ;;
+ exit ;;
arm*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
+ avr32*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
cris:Linux:*:*)
echo cris-axis-linux-gnu
- exit 0 ;;
+ exit ;;
+ crisv32:Linux:*:*)
+ echo crisv32-axis-linux-gnu
+ exit ;;
+ frv:Linux:*:*)
+ echo frv-unknown-linux-gnu
+ exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
+ m32r*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
mips:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#endif
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^CPU/{
+ s: ::g
+ p
+ }'`"
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
mips64:Linux:*:*)
eval $set_cc_for_build
#endif
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
- test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^CPU/{
+ s: ::g
+ p
+ }'`"
+ test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
+ or32:Linux:*:*)
+ echo or32-unknown-linux-gnu
+ exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit 0 ;;
+ exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
esac
- exit 0 ;;
+ exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
- exit 0 ;;
+ exit ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
+ vax:Linux:*:*)
+ echo ${UNAME_MACHINE}-dec-linux-gnu
+ exit ;;
x86_64:Linux:*:*)
echo x86_64-unknown-linux-gnu
- exit 0 ;;
+ exit ;;
i*86:Linux:*:*)
# The BFD linker knows what the default object file format is, so
# first see if it will tell us. cd to the root directory to prevent
;;
a.out-i386-linux)
echo "${UNAME_MACHINE}-pc-linux-gnuaout"
- exit 0 ;;
+ exit ;;
coff-i386)
echo "${UNAME_MACHINE}-pc-linux-gnucoff"
- exit 0 ;;
+ exit ;;
"")
# Either a pre-BFD a.out linker (linux-gnuoldld) or
# one that does not give us useful --help.
echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
- exit 0 ;;
+ exit ;;
esac
# Determine whether the default compiler is a.out or elf
eval $set_cc_for_build
LIBC=gnulibc1
# endif
#else
- #ifdef __INTEL_COMPILER
+ #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
LIBC=gnu
#else
LIBC=gnuaout
LIBC=dietlibc
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
- test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
- test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+ eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n '
+ /^LIBC/{
+ s: ::g
+ p
+ }'`"
+ test x"${LIBC}" != x && {
+ echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+ exit
+ }
+ test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
echo i386-sequent-sysv4
- exit 0 ;;
+ exit ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit 0 ;;
+ exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
- exit 0 ;;
+ exit ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
- exit 0 ;;
+ exit ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
- exit 0 ;;
+ exit ;;
+ i*86:syllable:*:*)
+ echo ${UNAME_MACHINE}-pc-syllable
+ exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit 0 ;;
+ exit ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
- exit 0 ;;
- i*86:*:5:[78]*)
+ exit ;;
+ i*86:*:5:[678]*)
+ # UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit 0 ;;
+ exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
- exit 0 ;;
+ exit ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i386.
echo i386-pc-msdosdjgpp
- exit 0 ;;
+ exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
- exit 0 ;;
+ exit ;;
paragon:*:*:*)
echo i860-intel-osf1
- exit 0 ;;
+ exit ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
- exit 0 ;;
+ exit ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
- exit 0 ;;
+ exit ;;
mc68k:UNIX:SYSTEM5:3.51m)
echo m68k-convergent-sysv
- exit 0 ;;
+ exit ;;
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
- exit 0 ;;
- M68*:*:R3V[567]*:*)
- test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
- 3[34]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
+ exit ;;
+ M68*:*:R3V[5678]*:*)
+ test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+ && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && echo i486-ncr-sysv4 && exit 0 ;;
+ && { echo i486-ncr-sysv4; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
- exit 0 ;;
+ exit ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
- exit 0 ;;
+ exit ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
- exit 0 ;;
+ exit ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
else
echo ns32k-sni-sysv
fi
- exit 0 ;;
+ exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
echo i586-unisys-sysv4
- exit 0 ;;
+ exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes <hewes@openmarket.com>.
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
- exit 0 ;;
+ exit ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
- exit 0 ;;
+ exit ;;
+ i*86:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo ${UNAME_MACHINE}-stratus-vos
+ exit ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
- exit 0 ;;
+ exit ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
- exit 0 ;;
+ exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
- exit 0 ;;
+ exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
- exit 0 ;;
+ exit ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos
- exit 0 ;;
+ exit ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
- exit 0 ;;
+ exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:Darwin:*:*)
- case `uname -p` in
- *86) UNAME_PROCESSOR=i686 ;;
- powerpc) UNAME_PROCESSOR=powerpc ;;
+ UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ case $UNAME_PROCESSOR in
+ unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
UNAME_MACHINE=pc
fi
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:QNX:*:4*)
echo i386-pc-qnx
- exit 0 ;;
- NSR-[DGKLNPTVWY]:NONSTOP_KERNEL:*:*)
+ exit ;;
+ NSE-?:NONSTOP_KERNEL:*:*)
+ echo nse-tandem-nsk${UNAME_RELEASE}
+ exit ;;
+ NSR-?:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
- exit 0 ;;
+ exit ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
- exit 0 ;;
+ exit ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
UNAME_MACHINE="$cputype"
fi
echo ${UNAME_MACHINE}-unknown-plan9
- exit 0 ;;
+ exit ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
- exit 0 ;;
+ exit ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
- exit 0 ;;
+ exit ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
- exit 0 ;;
+ exit ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
- exit 0 ;;
+ exit ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
- exit 0 ;;
+ exit ;;
*:ITS:*:*)
echo pdp10-unknown-its
- exit 0 ;;
+ exit ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
- exit 0 ;;
+ exit ;;
+ *:DragonFly:*:*)
+ echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit ;;
+ *:*VMS:*:*)
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ case "${UNAME_MACHINE}" in
+ A*) echo alpha-dec-vms ; exit ;;
+ I*) echo ia64-dec-vms ; exit ;;
+ V*) echo vax-dec-vms ; exit ;;
+ esac ;;
+ *:XENIX:*:SysV)
+ echo i386-pc-xenix
+ exit ;;
+ i*86:skyos:*:*)
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ exit ;;
+ i*86:rdos:*:*)
+ echo ${UNAME_MACHINE}-pc-rdos
+ exit ;;
esac
#echo '(No uname command or uname output not recognized.)' 1>&2
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix"); exit (0);
+ printf ("arm-acorn-riscix\n"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
}
EOF
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+ { echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
# Convex versions that predate uname can use getsysinfo(1)
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
- exit 0 ;;
+ exit ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
- exit 0 ;;
+ exit ;;
c34*)
echo c34-convex-bsd
- exit 0 ;;
+ exit ;;
c38*)
echo c38-convex-bsd
- exit 0 ;;
+ exit ;;
c4*)
echo c4-convex-bsd
- exit 0 ;;
+ exit ;;
esac
fi
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
- ftp://ftp.gnu.org/pub/gnu/config/
+ http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+ http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+# Inc.
-timestamp='2003-08-18'
+timestamp='2006-06-06'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330,
-# Boston, MA 02111-1307, USA.
-
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
+
# Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry.
#
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
- echo "$timestamp" ; exit 0 ;;
+ echo "$timestamp" ; exit ;;
--version | -v )
- echo "$version" ; exit 0 ;;
+ echo "$version" ; exit ;;
--help | --h* | -h )
- echo "$usage"; exit 0 ;;
+ echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
*local*)
# First pass through any local machine types.
echo $1
- exit 0;;
+ exit ;;
* )
break ;;
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | linux-dietlibc | kfreebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \
+ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \
+ storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
- -apple | -axis)
+ -apple | -axis | -knuth | -cray)
os=
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
+ -sco6)
+ os=-sco5v6
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
-sco5)
os=-sco3.2v5
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;;
+ -sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
-sco*)
os=-sco3.2v2
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+ | bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
- | m32r | m68000 | m68k | m88k | mcore \
+ | m32c | m32r | m32rle | m68000 | m68k | m88k \
+ | maxq | mb | microblaze | mcore \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
+ | mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa64 | mipsisa64el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
+ | mt \
| msp430 \
+ | nios | nios2 \
| ns16k | ns32k \
- | openrisc | or32 \
+ | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
- | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
- | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
- | strongarm \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+ | spu | strongarm \
| tahoe | thumb | tic4x | tic80 | tron \
| v850 | v850e \
| we32k \
- | x86 | xscale | xstormy16 | xtensa \
+ | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
| z8k)
basic_machine=$basic_machine-unknown
;;
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
+ ms1)
+ basic_machine=mt-unknown
+ ;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* \
- | bs2000-* \
+ | avr-* | avr32-* \
+ | bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
- | clipper-* | cydra-* \
+ | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
- | m32r-* \
+ | m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | mcore-* \
+ | m88110-* | m88k-* | maxq-* | mcore-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
+ | mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipstx39-* | mipstx39el-* \
+ | mmix-* \
+ | mt-* \
| msp430-* \
- | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
+ | nios-* | nios2-* \
+ | none-* | np1-* | ns16k-* | ns32k-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
- | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
- | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+ | sparclite-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
- | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
- | xtensa-* \
+ | x86-* | x86_64-* | xps100-* | xscale-* | xscalee[bl]-* \
+ | xstormy16-* | xtensa-* \
| ymp-* \
| z8k-*)
;;
basic_machine=a29k-amd
os=-udi
;;
+ abacus)
+ basic_machine=abacus-unknown
+ ;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
amd64)
basic_machine=x86_64-pc
;;
+ amd64-*)
+ basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
amdahl)
basic_machine=580-amdahl
os=-sysv
basic_machine=j90-cray
os=-unicos
;;
+ craynv)
+ basic_machine=craynv-cray
+ os=-unicosmp
+ ;;
+ cr16c)
+ basic_machine=cr16c-unknown
+ os=-elf
+ ;;
crds | unos)
basic_machine=m68k-crds
;;
+ crisv32 | crisv32-* | etraxfs*)
+ basic_machine=crisv32-axis
+ ;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
+ crx)
+ basic_machine=crx-unknown
+ os=-elf
+ ;;
da30 | da30-*)
basic_machine=m68k-da30
;;
basic_machine=m88k-motorola
os=-sysv3
;;
+ djgpp)
+ basic_machine=i586-pc
+ os=-msdosdjgpp
+ ;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
mips3*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;;
- mmix*)
- basic_machine=mmix-knuth
- os=-mmixware
- ;;
monitor)
basic_machine=m68k-rom68k
os=-coff
basic_machine=i386-pc
os=-msdos
;;
+ ms1-*)
+ basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+ ;;
mvs)
basic_machine=i370-ibm
os=-mvs
np1)
basic_machine=np1-gould
;;
- nv1)
- basic_machine=nv1-cray
- os=-unicosmp
- ;;
nsr-tandem)
basic_machine=nsr-tandem
;;
basic_machine=hppa1.1-oki
os=-proelf
;;
- or32 | or32-*)
+ openrisc | openrisc-*)
basic_machine=or32-unknown
- os=-coff
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ os=-os400
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
+ pc98)
+ basic_machine=i386-pc
+ ;;
+ pc98-*)
+ basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
basic_machine=i586-unknown
os=-pw32
;;
+ rdos)
+ basic_machine=i386-pc
+ os=-rdos
+ ;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
tower | tower-32)
basic_machine=m68k-ncr
;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
udi29k)
basic_machine=a29k-amd
os=-udi
basic_machine=hppa1.1-winbond
os=-proelf
;;
+ xbox)
+ basic_machine=i686-pc
+ os=-mingw32
+ ;;
xps | xps100)
basic_machine=xps100-honeywell
;;
romp)
basic_machine=romp-ibm
;;
+ mmix)
+ basic_machine=mmix-knuth
+ ;;
rs6000)
basic_machine=rs6000-ibm
;;
we32k)
basic_machine=we32k-att
;;
- sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+ sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
- sh64)
- basic_machine=sh64-unknown
- ;;
- sparc | sparcv9 | sparcv9b)
+ sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
basic_machine=sparc-sun
;;
cydra)
| -aos* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
- | -hiux* | -386bsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
- | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+ | -openbsd* | -solidbsd* \
+ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+ | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
- | -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+ | -skyos* | -haiku* | -rdos*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
-opened*)
os=-openedition
;;
+ -os400*)
+ os=-os400
+ ;;
-wince*)
os=-wince
;;
-atheos*)
os=-atheos
;;
+ -syllable*)
+ os=-syllable
+ ;;
-386bsd)
os=-bsd
;;
-sinix*)
os=-sysv4
;;
+ -tpf*)
+ os=-tpf
+ ;;
-triton*)
os=-sysv3
;;
-kaos*)
os=-kaos
;;
+ -zvmoe)
+ os=-zvmoe
+ ;;
-none)
;;
*)
# system, and we'll never get to this point.
case $basic_machine in
+ spu-*)
+ os=-elf
+ ;;
*-acorn)
os=-riscix1.2
;;
arm*-semi)
os=-aout
;;
- c4x-* | tic4x-*)
- os=-coff
- ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
*-be)
os=-beos
;;
+ *-haiku)
+ os=-haiku
+ ;;
*-ibm)
os=-aix
;;
+ *-knuth)
+ os=-mmixware
+ ;;
*-wec)
os=-proelf
;;
-mvs* | -opened*)
vendor=ibm
;;
+ -os400*)
+ vendor=ibm
+ ;;
-ptx*)
vendor=sequent
;;
+ -tpf*)
+ vendor=ibm
+ ;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
esac
echo $basic_machine$os
-exit 0
+exit
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
else :; fi; \
done; echo "$$a" >> hpux10.tmp
echo "+e errno" >> hpux10.tmp
+ echo "+e _GLOBAL__FD_lib$(LIBBASE)_$(LIBMAJOR)_$(LIBMINOR)" >> hpux10.tmp
+ echo "+e _GLOBAL__FI_lib$(LIBBASE)_$(LIBMAJOR)_$(LIBMINOR)" >> hpux10.tmp
mv -f hpux10.tmp hpux10.exports
lib$(LIBBASE)$(PFLIBEXT): $(PFOBJLISTS)
else :; fi
DEPTARGETS = .depend .d .dtmp $(DEP_VERIFY)
+DEPTARGETS_CLEAN = .depend .d .dtmp $(DEPTARGETS_@srcdir@_@CONFIG_RELTOPDIR@)
+DEPTARGETS_@top_srcdir@_. = $(DEP_VERIFY)
#
# end dependency generation
clean:: clean-$(WHAT)
clean-unix::
- $(RM) $(OBJS) $(DEPTARGETS) $(EXTRA_FILES)
+ $(RM) $(OBJS) $(DEPTARGETS_CLEAN) $(EXTRA_FILES)
-$(RM) -r $(srcdir)/$(thisconfigdir)/autom4te.cache
clean-windows::
# HESIOD_LIBS is -lhesiod...
HESIOD_LIBS = @HESIOD_LIBS@
-KRB5_BASE_LIBS = $(KRB5_LIB) $(K5CRYPTO_LIB) $(COM_ERR_LIB) $(SUPPORT_LIB) $(GEN_LIB) $(LIBS)
+KRB5_BASE_LIBS = $(KRB5_LIB) $(K5CRYPTO_LIB) $(COM_ERR_LIB) $(SUPPORT_LIB) $(GEN_LIB) $(LIBS) $(DL_LIB)
KRB4COMPAT_LIBS = $(KRB4_LIB) $(DES425_LIB) $(KRB5_BASE_LIBS)
KDB5_LIBS = $(KDB5_LIB)
GSS_LIBS = $(GSS_KRB5_LIB)
# libraries, without adding them to the dependency list. We need this because
# the direct dependent libraries contain the pathname where the indirect
# dependent libraries will be installed (but haven't been yet).
- LDCOMBINE_TAIL='-dylib_file "$(KRB5_LIBDIR)/libkrb5support.1.0.dylib":$(TOPLIBD)/libkrb5support.1.0.dylib'
+ LDCOMBINE_TAIL='-dylib_file "$(KRB5_LIBDIR)/libkrb5support.1.1.dylib":$(TOPLIBD)/libkrb5support.1.1.dylib'
CC_LINK_SHARED='$(CC) $(PROG_LIBPATH) -dynamic $(CFLAGS) $(LDFLAGS)'
CC_LINK_STATIC='$(CC) $(PROG_LIBPATH) $(CFLAGS) $(LDFLAGS)'
RUN_ENV='DYLD_LIBRARY_PATH=`echo $(PROG_LIBPATH) | sed -e "s/-L//g" -e "s/ /:/g"`; export DYLD_LIBRARY_PATH;'
HOST_TYPE=$krb5_cv_host
AC_SUBST(HOST_TYPE)
dnl
+dnl Sadly, we seem to have accidentally committed ourselves in 1.4 to
+dnl an ABI that includes the existence of libkrb5support.0 even
+dnl though random apps should never use anything from it. And on
+dnl the Mac, to which that didn't apply, we can't use major version 0.
+dnl
+case $krb5_cv_host in
+*-*-darwin* | *-*-rhapsody*) SUPPORTLIB_MAJOR=1 ;;
+*) SUPPORTLIB_MAJOR=0 ;;
+esac
+AC_SUBST(SUPPORTLIB_MAJOR)
+dnl
dnl
if test "$COM_ERR_VERSION" = k5 ; then
dnl AC_CONFIG_SUBDIRS(util/et)
all-unix:: autoconf.h $(BUILT_HEADERS)
all-windows:: autoconf.h $(BUILT_HEADERS)
+all-unix:: @MAINT@ verify-calling-conventions-krb5
+
$(srcdir)/autoconf.h.in: @MAINT@ $(srcdir)/autoconf.stmp
$(srcdir)/autoconf.stmp: $(srcdir)/$(thisconfigdir)/configure.in $(SRCTOP)/aclocal.m4
$(RM) -r $(srcdir)/$(thisconfigdir)/autom4te.cache
cat $(srcdir)/krb5/krb5.hin krb5_err.h kdb5_err.h kv5m_err.h krb524_err.h \
asn1_err.h >> krb5/krb5.h
+verify-calling-conventions-krb5: krb5/krb5.h
+ $(PERL) -w $(SRCTOP)/util/def-check.pl krb5/krb5.h $(SRCTOP)/lib/krb5_32.def
+
#
# Build the error table include files:
# asn1_err.h kdb5_err.h krb5_err.h kv5m_err.h krb524_err.h
extern int krb5int_crypto_init (void);
extern int krb5int_prng_init(void);
+#define krb5_copy_error_state(CTX, OCTX) \
+ krb5int_set_error(&(CTX)->errinfo, (OCTX)->errinfo.code, "%s", (OCTX)->errinfo.msg)
+
#endif /* _KRB5_INT_H */
(krb5_context *);
void KRB5_CALLCONV krb5_free_context
(krb5_context);
+krb5_error_code KRB5_CALLCONV krb5_copy_context
+ (krb5_context, krb5_context *);
#if KRB5_PRIVATE
krb5_error_code krb5_set_default_in_tkt_ktypes
(krb5_context context);
/* Error reporting */
-void
+void KRB5_CALLCONV_C
krb5_set_error_message (krb5_context, krb5_error_code, const char *, ...);
#ifdef va_start
-void
+void KRB5_CALLCONV
krb5_vset_error_message (krb5_context, krb5_error_code, const char *, va_list);
#endif
-char *
+/*
+ * The behavior of krb5_get_error_message is only defined the first
+ * time it is called after a failed call to a krb5 function using the
+ * same context, and only when the error code passed in is the same as
+ * that returned by the krb5 function. Future versions may return the
+ * same string for the second and following calls.
+ *
+ * The string returned by this function must be freed using
+ * krb5_free_error_message.
+ */
+char * KRB5_CALLCONV
krb5_get_error_message (krb5_context, krb5_error_code);
-void
+void KRB5_CALLCONV
krb5_free_error_message (krb5_context, char *);
-void
+void KRB5_CALLCONV
krb5_clear_error_message (krb5_context);
static void extended_com_err_fn (const char *myprog, errcode_t code,
const char *fmt, va_list args)
{
- const char *emsg;
- emsg = krb5_get_error_message (context, code);
- fprintf (stderr, "%s: %s ", myprog, emsg);
- krb5_free_error_message (context, emsg);
+ if (code) {
+ const char *emsg;
+ emsg = krb5_get_error_message (context, code);
+ fprintf (stderr, "%s: %s ", myprog, emsg);
+ krb5_free_error_message (context, emsg);
+ } else {
+ fprintf (stderr, "%s: ", myprog);
+ }
vfprintf (stderr, fmt, args);
fprintf (stderr, "\n");
}
if (realm - canon && *(realm - 1) != '\\')
break;
else
- realm = strchr(realm, '@');
+ realm = strchr(realm+1, '@');
}
if (realm)
*realm++ = '\0';
if (cp - canon && *(cp - 1) != '\\')
break;
else
- cp = strchr(cp, '/');
+ cp = strchr(cp+1, '/');
}
if (cp != NULL)
*cp = '\0';
}
goto usage;
}
+ if (*argv == NULL) {
+ com_err("change_password", 0, "missing principal name");
+ goto usage;
+ }
retval = kadmin_parse_name(*argv, &princ);
if (retval) {
com_err("change_password", retval, "while parsing principal name");
verbose = 1;
else if (!strcmp(argv[aindex], updateoption))
update = 1;
- else if (!strcmp(argv[aindex], hashoption))
- {
- db5util_db_args_size++;
- {
- char **temp = realloc( db5util_db_args, sizeof(char*) * (db5util_db_args_size+1)); /* one for NULL */
- if( temp == NULL )
- {
- com_err(progname, ENOMEM, "while parsing command arguments\n");
- exit(1);
- }
-
- db5util_db_args = temp;
+ else if (!strcmp(argv[aindex], hashoption)) {
+ if (!add_db_arg("hash=true")) {
+ com_err(progname, ENOMEM, "while parsing command arguments\n");
+ exit(1);
}
- db5util_db_args[db5util_db_args_size-1] = "hash=true";
- db5util_db_args[db5util_db_args_size] = NULL;
- }
- else
+ } else
break;
}
if ((argc - aindex) != 1) {
do_stash++;
break;
case 'h':
- db5util_db_args_size++;
- {
- char **temp = realloc( db5util_db_args, sizeof(char*) * (db5util_db_args_size+1)); /* one for NULL */
- if( temp == NULL )
- {
- com_err(progname, ENOMEM, "while parsing command arguments\n");
- exit(1);
- }
-
- db5util_db_args = temp;
+ if (!add_db_arg("hash=true")) {
+ com_err(progname, ENOMEM, "while parsing command arguments\n");
+ exit(1);
}
- db5util_db_args[db5util_db_args_size-1] = "hash=true";
- db5util_db_args[db5util_db_args_size] = NULL;
+ break;
case '?':
default:
usage();
const char *fmt, va_list args)
{
const char *emsg;
- emsg = krb5_get_error_message (util_context, code);
- fprintf (stderr, "%s: %s ", myprog, emsg);
- krb5_free_error_message (util_context, emsg);
+ if (code) {
+ emsg = krb5_get_error_message (util_context, code);
+ fprintf (stderr, "%s: %s ", myprog, emsg);
+ krb5_free_error_message (util_context, emsg);
+ } else {
+ fprintf (stderr, "%s: ", myprog);
+ }
vfprintf (stderr, fmt, args);
fprintf (stderr, "\n");
}
+int add_db_arg(char *arg)
+{
+ char **temp;
+ db5util_db_args_size++;
+ temp = realloc(db5util_db_args,
+ sizeof(char *) * (db5util_db_args_size + 1));
+ if (temp == NULL)
+ return 0;
+ db5util_db_args = temp;
+ db5util_db_args[db5util_db_args_size-1] = arg;
+ db5util_db_args[db5util_db_args_size] = NULL;
+ return 1;
+}
+
int main(argc, argv)
int argc;
char *argv[];
strcpy( db_name_tmp, "dbname=");
strcat( db_name_tmp, global_params.dbname );
- db5util_db_args_size++;
- {
- char **temp = realloc( db5util_db_args, sizeof(char*) * (db5util_db_args_size+1)); /* one for NULL */
- if( temp == NULL )
- {
- com_err(progname, ENOMEM, "while parsing command arguments\n");
- exit(1);
- }
-
- db5util_db_args = temp;
+ if (!add_db_arg(db_name_tmp)) {
+ com_err(progname, ENOMEM, "while parsing command arguments\n");
+ exit(1);
}
- db5util_db_args[db5util_db_args_size-1] = db_name_tmp;
- db5util_db_args[db5util_db_args_size] = NULL;
} else if (strcmp(*argv, "-x") == 0 && ARG_VAL) {
db5util_db_args_size++;
- {
- char **temp = realloc( db5util_db_args, sizeof(char*) * (db5util_db_args_size+1)); /* one for NULL */
- if( temp == NULL )
- {
- fprintf(stderr,"%s: Cannot initialize. Not enough memory\n",
- argv[0]);
- exit(1);
- }
-
- db5util_db_args = temp;
+ if (!add_db_arg(koptarg)) {
+ fprintf(stderr,"%s: Cannot initialize. Not enough memory\n",
+ argv[0]);
+ exit(1);
}
- db5util_db_args[db5util_db_args_size-1] = koptarg;
- db5util_db_args[db5util_db_args_size] = NULL;
} else if (strcmp(*argv, "-r") == 0 && ARG_VAL) {
global_params.realm = koptarg;
extern krb5_db_entry master_db;
extern char **db5util_db_args;
extern int db5util_db_args_size;
+extern int add_db_arg(char *arg);
extern void usage(void);
$(SRCTOP)/include/k5-err.h $(SRCTOP)/include/k5-int.h \
$(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
$(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/kdb.h \
- $(SRCTOP)/include/kerberosIV/des.h $(SRCTOP)/include/kerberosIV/kdc.h \
- $(SRCTOP)/include/kerberosIV/klog.h $(SRCTOP)/include/kerberosIV/krb.h \
- $(SRCTOP)/include/kerberosIV/krb_db.h $(SRCTOP)/include/kerberosIV/prot.h \
- $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
- $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
- $(SRCTOP)/include/syslog.h extern.h kdc_util.h kerberos_v4.c
+ $(SRCTOP)/include/kerberosIV/des.h $(SRCTOP)/include/kerberosIV/klog.h \
+ $(SRCTOP)/include/kerberosIV/krb.h $(SRCTOP)/include/kerberosIV/krb_db.h \
+ $(SRCTOP)/include/kerberosIV/prot.h $(SRCTOP)/include/krb5.h \
+ $(SRCTOP)/include/krb5/locate_plugin.h $(SRCTOP)/include/port-sockets.h \
+ $(SRCTOP)/include/socket-utils.h $(SRCTOP)/include/syslog.h \
+ extern.h kdc_util.h kerberos_v4.c
#include <klog.h>
#include <prot.h>
#include <krb_db.h>
-#include <kdc.h>
#ifdef NEED_SWAB_PROTO
extern void swab(const void *, void *, size_t );
static int compat_decrypt_key (krb5_key_data *, C_Block,
krb5_keyblock *, int);
-static int kerb_get_principal (char *, char *, Principal *, int,
+static int kerb_get_principal (char *, char *, Principal *,
int *, krb5_keyblock *, krb5_kvno,
int, krb5_deltat *);
static int check_princ (char *, char *, int, Principal *,
static int
kerb_get_principal(char *name, char *inst, /* could have wild cards */
Principal *principal,
- int maxn, /* max # name structs to return */
int *more, /* more tuples than room for */
krb5_keyblock *k5key, krb5_kvno kvno,
int issrv, /* true if retrieving a service key */
krb5_error_code retval;
*more = 0;
- if ( maxn > 1) {
- lt = klog(L_DEATH_REQ, "KDC V4 is requesting too many principals");
- return( 0);
- }
/* begin setting up the principal structure
* with the first info we have:
*/
krb5_free_principal(kdc_context, search);
if (nprinc < 1) {
- *more = (int)more5 || (nprinc > maxn);
+ *more = (int)more5 || (nprinc > 1);
return(nprinc);
}
* this routine clears the keyblock's contents for us.
*/
krb5_db_free_principal(kdc_context, &entries, nprinc);
- *more = (int) more5 || (nprinc > maxn);
+ *more = (int) more5 || (nprinc > 1);
return( nprinc);
}
req_realm_ptr, req_time_ws, 0, a_name_data.exp_date,
a_name_data.key_version, ciph);
krb4_sendto(f, (char *) rpkt->dat, rpkt->length, 0,
- (struct sockaddr *) client, S_AD_SZ);
+ (struct sockaddr *) client, sizeof (struct sockaddr_in));
memset(&a_name_data, 0, sizeof(a_name_data));
memset(&s_name_data, 0, sizeof(s_name_data));
break;
ad->prealm, time_ws,
0, 0, 0, ciph);
krb4_sendto(f, (char *) rpkt->dat, rpkt->length, 0,
- (struct sockaddr *) client, S_AD_SZ);
+ (struct sockaddr *) client, sizeof (struct sockaddr_in));
memset(&s_name_data, 0, sizeof(s_name_data));
break;
}
cr_err_reply(e_pkt, req_name_ptr, req_inst_ptr, req_realm_ptr,
req_time_ws, err, e_msg);
krb4_sendto(f, (char *) e_pkt->dat, e_pkt->length, 0,
- (struct sockaddr *) client, S_AD_SZ);
+ (struct sockaddr *) client, sizeof (struct sockaddr_in));
}
static int more;
/* long trans; */
- n = kerb_get_principal(p_name, instance, p, 1, &more, k5key, 0,
+ n = kerb_get_principal(p_name, instance, p, &more, k5key, 0,
issrv, k5life);
klog(L_ALL_REQ,
"Principal: \"%s\", Instance: \"%s\" Lifetime = %d n = %d",
/* log("Getting key for %s", r); */
- n = kerb_get_principal("krbtgt", r, p, 1, &more, &k5key, kvno, 1, NULL);
+ n = kerb_get_principal("krbtgt", r, p, &more, &k5key, kvno, 1, NULL);
if (n == 0)
return (KFAILURE);
tcp_data_counter--;
}
+static krb5_error_code
+make_toolong_error (krb5_data **out)
+{
+ krb5_error errpkt;
+ krb5_error_code retval;
+ krb5_data *scratch;
+
+ retval = krb5_us_timeofday(kdc_context, &errpkt.stime, &errpkt.susec);
+ if (retval)
+ return retval;
+ errpkt.error = KRB_ERR_FIELD_TOOLONG;
+ errpkt.server = tgs_server;
+ errpkt.client = NULL;
+ errpkt.text.length = 0;
+ errpkt.text.data = 0;
+ errpkt.e_data.length = 0;
+ errpkt.e_data.data = 0;
+ scratch = malloc(sizeof(*scratch));
+ if (scratch == NULL)
+ return ENOMEM;
+ retval = krb5_mk_error(kdc_context, &errpkt, scratch);
+ if (retval) {
+ free(scratch);
+ return retval;
+ }
+
+ *out = scratch;
+ return 0;
+}
+
static void
process_tcp_connection(struct connection *conn, const char *prog, int selflags)
{
}
if (conn->u.tcp.sgnum == 0) {
/* finished sending */
- /* should go back to reading */
+ /* We should go back to reading, though if we sent a
+ FIELD_TOOLONG error in reply to a length with the high
+ bit set, RFC 4120 says we have to close the TCP
+ stream. */
goto kill_tcp_connection;
}
} else if (selflags & SSF_READ) {
| (p[2] << 8)
| p[3]);
if (conn->u.tcp.msglen > conn->u.tcp.bufsiz - 4) {
+ krb5_error_code err;
/* message too big */
krb5_klog_syslog(LOG_ERR, "TCP client %s wants %lu bytes, cap is %lu",
conn->u.tcp.addrbuf, (unsigned long) conn->u.tcp.msglen,
(unsigned long) conn->u.tcp.bufsiz - 4);
/* XXX Should return an error. */
- goto kill_tcp_connection;
+ err = make_toolong_error (&conn->u.tcp.response);
+ if (err) {
+ krb5_klog_syslog(LOG_ERR,
+ "error constructing KRB_ERR_FIELD_TOOLONG error! %s",
+ error_message(err));
+ goto kill_tcp_connection;
+ }
+ goto have_response;
}
}
} else {
com_err(prog, err, "while dispatching (tcp)");
goto kill_tcp_connection;
}
+ have_response:
conn->u.tcp.lenbuf[0] = 0xff & (conn->u.tcp.response->length >> 24);
conn->u.tcp.lenbuf[1] = 0xff & (conn->u.tcp.response->length >> 16);
conn->u.tcp.lenbuf[2] = 0xff & (conn->u.tcp.response->length >> 8);
LDFLAGS='@LDFLAGS@'
RPATH_FLAG='@RPATH_FLAG@'
PTHREAD_CFLAGS='@PTHREAD_CFLAGS@'
+DL_LIB='@DL_LIB@'
LIBS='@LIBS@'
GEN_LIB=@GEN_LIB@
fi
if test $library = 'krb5'; then
- lib_flags="$lib_flags -lkrb5 -lk5crypto -lcom_err -lkrb5support $GEN_LIB $LIBS"
+ lib_flags="$lib_flags -lkrb5 -lk5crypto -lcom_err $GEN_LIB $LIBS $DL_LIB"
fi
echo $lib_flags
SRCS= $(srcdir)/daemon.c \
$(srcdir)/dummy.c
-# @lib_frag@
-# @libobj_frag@
+@lib_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
--- /dev/null
+CD = cd\r
+\r
+all:\r
+ $(CD) common\r
+ $(MAKE) -f NTMakefile all\r
+ $(CD) ../client\r
+ $(MAKE) -f NTMakefile all\r
+ $(CD) ../server\r
+ $(MAKE) -f NTMakefile all\r
+ $(CD) ../windows\r
+ $(MAKE) -f NTMakefile all\r
+ $(CD) ..\r
+\r
+clean:\r
+ $(CD) common\r
+ $(MAKE) -f NTMakefile clean\r
+ $(CD) ../client\r
+ $(MAKE) -f NTMakefile clean\r
+ $(CD) ../server\r
+ $(MAKE) -f NTMakefile clean\r
+ $(CD) ../windows\r
+ $(MAKE) -f NTMakefile clean\r
+ $(CD) ..\r
+\r
+\r
!INCLUDE <WIN32.MAK>
-CFLAGS = -I../include
+CFLAGS = -I../include $(cdebug) $(cflags) $(cvarsmt)
-CCAPI_OBJS = cacheapi.obj context.obj ccache.obj credentials.obj ccache_iterator.obj \
- credentials_iterator.obj ccstring.obj marshall.obj msg.obj
+CC_CLIENT_OBJS = cacheapi.obj context.obj ccache.obj credentials.obj ccache_iterator.obj \
+ credentials_iterator.obj ccstring.obj ccapiv2.obj
-CCAPI_LIB = ccapi.lib
-
-$(CCAPI_LIB): $(CCAPI_OBJS)
- $(implib) /NOLOGO /OUT:$@ $**
-
-CCAPI_DLLFILE = krbcc32.dll
+CC_CLIENT_LIB = cc_client.lib
+CC_COMMON_LIB = ..\common\cc_common.lib
+$(CC_CLIENT_LIB): $(CC_CLIENT_OBJS)
+ $(implib) /NOLOGO /OUT:$@ $**
-$(CCAPI_DLLFILE): $(CCAPI_LIB)
- $(DLLGUILINK) -def:windows\krbcc32.def
- $(DLLPREP)
+all: $(CC_CLIENT_LIB)
clean:
del *.obj *.lib
/* $Copyright:
*
- * Copyright 2004 by the Massachusetts Institute of Technology.
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.
*
* All rights reserved.
*
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include <CredentialsCache.h>
#include "ccache.h"
#include "ccache_iterator.h"
#include "context.h"
+#include "cc_rpc.h"
#include "msg.h"
#include "msg_headers.h"
-cc_int32
+/*! \fn cc_initialize
+ * \brief A function that initializes a ccapi context for the caller.
+ * \param[out] outContext a cc_context_t pointer to which is assigned the newly created context upon success.
+ * \param[in] inVersion a cc_int32 that specifies the
+ */
+
+CCACHE_API cc_int32
cc_initialize ( cc_context_t* outContext,
cc_int32 inVersion,
cc_int32* outSupportedVersion,
char const** outVendor)
{
static char vendor[128] = "";
- cc_msg_t *request;
+ cc_msg_t *request = NULL;
ccmsg_init_t *request_header;
- cc_msg_t *response;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
ccmsg_init_resp_t *response_header;
cc_int32 code;
if ((inVersion != ccapi_version_2) &&
(inVersion != ccapi_version_3) &&
(inVersion != ccapi_version_4) &&
- (inVersion != ccapi_version_5)) {
+ (inVersion != ccapi_version_5) &&
+ (inVersion != ccapi_version_6)) {
if (outSupportedVersion != NULL) {
- *outSupportedVersion = ccapi_version_5;
+ *outSupportedVersion = ccapi_version_6;
}
return ccErrBadAPIVersion;
}
if (request_header == NULL)
return ccErrNoMem;
- request_header->in_version = inVersion;
+ /* If the version number is 2, the caller will be passing
+ * the structure into the v2 compatibility functions which
+ * in turn will call the v6 functions. Set the version to
+ * ccapi_version_max since that is what the compatibility
+ * functions will be expecting.
+ */
+ if (inVersion == ccapi_version_2)
+ inVersion = ccapi_version_max;
+
+ /* Construct the request */
+ request_header->in_version = htonl(inVersion);
code = cci_msg_new(ccmsg_INIT, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_init_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
response_header = (ccmsg_init_resp_t *)response->header;
- *outSupportedVersion = response_header->out_version;
- code = cc_context_int_new(outContext, response_header->out_ctx, response_header->out_version);
+ *outSupportedVersion = ntohl(response_header->out_version);
+ code = cc_int_context_new(outContext, ntohll(response_header->out_ctx), ntohl(response_header->out_version));
if (!vendor[0]) {
char * string;
- code = cci_msg_retrieve_blob(response, response_header->vendor_offset, response_header->vendor_length, &string);
+ code = cci_msg_retrieve_blob(response, ntohl(response_header->vendor_offset), ntohl(response_header->vendor_length), &string);
strncpy(vendor, string, sizeof(vendor)-1);
vendor[sizeof(vendor)-1] = '\0';
free(string);
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
/* $Copyright:
*
- * Copyright 2004 by the Massachusetts Institute of Technology.
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.
*
* All rights reserved.
*
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include <CredentialsCache.h>
#include "credentials.h"
+#include "credentials_iterator.h"
#include "ccache.h"
+#include "cc_rpc.h"
#include "msg.h"
#include "msg_headers.h"
+#include "ccstring.h"
+
+/*
+ * cc_int_ccache_new
+ *
+ * Input parameters in host order.
+ */
cc_int32
cc_int_ccache_new( cc_ccache_t * pccache, cc_handle hctx, cc_handle hccache )
cc_int32
cc_int_ccache_release( cc_ccache_t ccache )
{
- cc_int_ccache_t int_ccache;
- cc_msg_t *request;
- ccmsg_ccache_release_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_ccache_t int_ccache;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_release_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( ccache == NULL )
return ccErrBadParam;
request_header = (ccmsg_ccache_release_t*)malloc(sizeof(ccmsg_ccache_release_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_ccache->ctx;
- request_header->ccache = int_ccache->handle;
+ request_header->ctx = htonll(int_ccache->ctx);
+ request_header->ccache = htonll(int_ccache->handle);
code = cci_msg_new(ccmsg_CCACHE_RELEASE, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_release_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
- free(int_ccache->functions);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
+ if (int_ccache->functions)
+ free(int_ccache->functions);
free(int_ccache);
return code;
}
cc_int32
cc_int_ccache_destroy( cc_ccache_t ccache )
{
- cc_int_ccache_t int_ccache;
- cc_msg_t *request;
- ccmsg_ccache_destroy_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_ccache_t int_ccache;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_destroy_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( ccache == NULL )
return ccErrBadParam;
request_header = (ccmsg_ccache_destroy_t*)malloc(sizeof(ccmsg_ccache_destroy_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_ccache->ctx;
- request_header->ccache = int_ccache->handle;
+ request_header->ctx = htonll(int_ccache->ctx);
+ request_header->ccache = htonll(int_ccache->handle);
code = cci_msg_new(ccmsg_CCACHE_DESTROY, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_destroy_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
free(ccache);
return code;
}
cc_int32
cc_int_ccache_set_default( cc_ccache_t ccache )
{
- cc_int_ccache_t int_ccache;
- cc_msg_t *request;
- ccmsg_ccache_set_default_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_ccache_t int_ccache;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_set_default_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( ccache == NULL )
return ccErrBadParam;
request_header = (ccmsg_ccache_set_default_t*)malloc(sizeof(ccmsg_ccache_set_default_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_ccache->ctx;
- request_header->ccache = int_ccache->handle;
+ request_header->ctx = htonll(int_ccache->ctx);
+ request_header->ccache = htonll(int_ccache->handle);
code = cci_msg_new(ccmsg_CCACHE_SET_DEFAULT, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_set_default_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_int_ccache_get_credentials_version( cc_ccache_t ccache,
cc_uint32* credentials_version)
{
- cc_int_ccache_t int_ccache;
- cc_msg_t *request;
- ccmsg_ccache_get_creds_version_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_ccache_t int_ccache;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_get_creds_version_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( ccache == NULL )
return ccErrBadParam;
request_header = (ccmsg_ccache_get_creds_version_t*)malloc(sizeof(ccmsg_ccache_get_creds_version_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_ccache->ctx;
- request_header->ccache = int_ccache->handle;
+ request_header->ctx = htonll(int_ccache->ctx);
+ request_header->ccache = htonll(int_ccache->handle);
code = cci_msg_new(ccmsg_CCACHE_GET_CREDS_VERSION, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_get_creds_version_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
ccmsg_ccache_get_creds_version_resp_t * response_header = (ccmsg_ccache_get_creds_version_resp_t*)response->header;
- *credentials_version = response_header->version;
+ *credentials_version = ntohl(response_header->version);
code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_int32
-cc_int_ccache_get_name( cc_ccache_t ccache,
- cc_string_t* name )
+cc_int_ccache_get_name( cc_ccache_t ccache, cc_string_t* name )
{
- cc_int_ccache_t int_ccache;
- cc_msg_t *request;
- ccmsg_ccache_get_name_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_ccache_t int_ccache;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_get_name_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( ccache == NULL )
return ccErrBadParam;
request_header = (ccmsg_ccache_get_name_t*)malloc(sizeof(ccmsg_ccache_get_name_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_ccache->ctx;
- request_header->ccache = int_ccache->handle;
+ request_header->ctx = htonll(int_ccache->ctx);
+ request_header->ccache = htonll(int_ccache->handle);
code = cci_msg_new(ccmsg_CCACHE_GET_NAME, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_get_name_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
char * string;
ccmsg_ccache_get_name_resp_t * response_header = (ccmsg_ccache_get_name_resp_t*)response->header;
code = cci_msg_retrieve_blob(response, response_header->name_offset,
response_header->name_len, &string);
if (code == ccNoError) {
- code = cc_string_new(&name, string);
+ code = cci_string_new(name, string);
free(string);
}
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_uint32 credentials_version,
cc_string_t* principal )
{
- cc_int_ccache_t int_ccache;
- cc_msg_t *request;
- ccmsg_ccache_get_principal_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_ccache_t int_ccache;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_get_principal_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( ccache == NULL )
return ccErrBadParam;
request_header = (ccmsg_ccache_get_principal_t*)malloc(sizeof(ccmsg_ccache_get_principal_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_ccache->ctx;
- request_header->ccache = int_ccache->handle;
- request_header->version = credentials_version;
+ request_header->ctx = htonll(int_ccache->ctx);
+ request_header->ccache = htonll(int_ccache->handle);
+ request_header->version = htonl(credentials_version);
code = cci_msg_new(ccmsg_CCACHE_GET_PRINCIPAL, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_get_principal_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
char * string;
ccmsg_ccache_get_principal_resp_t * response_header = (ccmsg_ccache_get_principal_resp_t*)response->header;
code = cci_msg_retrieve_blob(response, response_header->principal_offset,
response_header->principal_len, &string);
if (code == ccNoError) {
- code = cc_string_new(&principal, string);
+ code = cci_string_new(principal, string);
free(string);
}
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_uint32 credentials_version,
const char* principal )
{
- cc_uint32 blob_pos;
- cc_int_ccache_t int_ccache;
- cc_msg_t *request;
- ccmsg_ccache_set_principal_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_uint32 blob_pos;
+ cc_int_ccache_t int_ccache;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_set_principal_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( ccache == NULL )
return ccErrBadParam;
request_header = (ccmsg_ccache_set_principal_t*)malloc(sizeof(ccmsg_ccache_set_principal_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_ccache->ctx;
- request_header->ccache = int_ccache->handle;
- request_header->version = credentials_version;
+ request_header->ctx = htonll(int_ccache->ctx);
+ request_header->ccache = htonll(int_ccache->handle);
+ request_header->version = htonl(credentials_version);
code = cci_msg_new(ccmsg_CCACHE_GET_PRINCIPAL, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_data_blob(request, (void*)principal, strlen(principal) + 1, &blob_pos);
- if (code != ccNoError) {
- cci_msg_destroy(request);
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
- request_header->principal_offset = blob_pos;
- request_header->principal_len = strlen(principal) + 1;
+ request_header->principal_offset = htonl(blob_pos);
+ request_header->principal_len = htonl(strlen(principal) + 1);
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_set_principal_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_int_ccache_new_credentials_iterator( cc_ccache_t ccache,
cc_credentials_iterator_t* iterator )
{
- cc_int_ccache_t int_ccache;
- cc_msg_t *request;
- ccmsg_ccache_creds_iterator_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_ccache_t int_ccache;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_creds_iterator_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( ccache == NULL )
return ccErrBadParam;
request_header = (ccmsg_ccache_creds_iterator_t*)malloc(sizeof(ccmsg_ccache_creds_iterator_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_ccache->ctx;
- request_header->ccache = int_ccache->handle;
+ request_header->ctx = htonll(int_ccache->ctx);
+ request_header->ccache = htonll(int_ccache->handle);
- code = cci_msg_new(ccmsg_CCACHE_CREDS_ITERATOR, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ code = cci_msg_new(ccmsg_CCACHE_NEW_CREDS_ITERATOR, &request);
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_creds_iterator_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
ccmsg_ccache_creds_iterator_resp_t * response_header = (ccmsg_ccache_creds_iterator_resp_t*)response->header;
- code = cc_int_credentials_iterator_new(iterator, response_header->iterator);
+ code = cc_int_credentials_iterator_new(iterator, int_ccache->ctx, int_ccache->handle,
+ ntohll(response_header->iterator));
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_int_ccache_store_credentials( cc_ccache_t ccache,
const cc_credentials_union* credentials )
{
- cc_int_ccache_t int_ccache;
- cc_msg_t *request;
- ccmsg_ccache_store_creds_t *request_header;
- cc_msg_t *response;
- char *flat_cred = 0;
- cc_uint32 flat_cred_len = 0;
- cc_uint32 blob_pos;
- cc_int32 code;
+ cc_int_ccache_t int_ccache;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_store_creds_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ char *flat_cred = 0;
+ cc_uint32 flat_cred_len = 0;
+ cc_uint32 blob_pos;
+ cc_uint32 type;
+ cc_int32 code;
if ( ccache == NULL || credentials == NULL )
return ccErrBadParam;
request_header = (ccmsg_ccache_store_creds_t*)malloc(sizeof(ccmsg_ccache_store_creds_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_ccache->ctx;
- request_header->ccache = int_ccache->handle;
+ request_header->ctx = htonll(int_ccache->ctx);
+ request_header->ccache = htonll(int_ccache->handle);
code = cci_msg_new(ccmsg_CCACHE_STORE_CREDS, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
switch ( credentials->version ) {
case cc_credentials_v4:
code = cci_creds_v5_marshall(credentials->credentials.credentials_v5, &flat_cred, &flat_cred_len);
break;
default:
- cci_msg_destroy(request);
- free(request_header);
- return ccErrBadCredentialsVersion;
- }
- if (code != ccNoError) {
- cci_msg_destroy(request);
- free(request_header);
- return code;
+ code = ccErrBadCredentialsVersion;
}
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_data_blob(request, (void*)flat_cred, flat_cred_len, &blob_pos);
- if (code != ccNoError) {
- cci_msg_destroy(request);
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
- request_header->creds_version = credentials->version;
- request_header->creds_offset = blob_pos;
- request_header->creds_len = flat_cred_len;
+ request_header->creds_version = htonl(credentials->version);
+ request_header->creds_offset = htonl(blob_pos);
+ request_header->creds_len = htonl(flat_cred_len);
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_store_creds_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- free(flat_cred);
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (flat_cred)
+ free(flat_cred);
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_int_ccache_remove_credentials( cc_ccache_t ccache,
cc_credentials_t credentials )
{
- cc_int_ccache_t int_ccache;
- cc_int_credentials_t int_creds;
- cc_msg_t *request;
- ccmsg_ccache_rem_creds_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_ccache_t int_ccache;
+ cc_int_credentials_t int_creds;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_rem_creds_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( ccache == NULL || credentials == NULL )
return ccErrBadParam;
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_ccache->ctx;
- request_header->ccache = int_ccache->handle;
- request_header->creds = int_creds->handle;
+ request_header->ctx = htonll(int_ccache->ctx);
+ request_header->ccache = htonll(int_ccache->handle);
+ request_header->creds = htonll(int_creds->handle);
code = cci_msg_new(ccmsg_CCACHE_REM_CREDS, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_rem_creds_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_int_ccache_move( cc_ccache_t source,
cc_ccache_t destination )
{
- cc_int_ccache_t int_ccache_source;
- cc_int_ccache_t int_ccache_dest;
- cc_msg_t *request;
- ccmsg_ccache_move_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_ccache_t int_ccache_source;
+ cc_int_ccache_t int_ccache_dest;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_move_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( source == NULL || destination == NULL )
return ccErrBadParam;
return ccErrNoMem;
code = cci_msg_new(ccmsg_CCACHE_MOVE, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
- request_header->ctx = int_ccache_source->ctx;
- request_header->ccache_source = int_ccache_source->handle;
- request_header->ccache_dest = int_ccache_dest->handle;
+ request_header->ctx = htonll(int_ccache_source->ctx);
+ request_header->ccache_source = htonll(int_ccache_source->handle);
+ request_header->ccache_dest = htonll(int_ccache_dest->handle);
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_move_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_uint32 lock_type,
cc_uint32 block )
{
- cc_int_ccache_t int_ccache;
- cc_msg_t *request;
- ccmsg_ccache_lock_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_ccache_t int_ccache;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_lock_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( ccache == NULL ||
- (lock_type != cc_lock_read && lock_type != cc_lock_write) ||
+ (lock_type != cc_lock_read && lock_type != cc_lock_write &&
+ lock_type != cc_lock_upgrade && lock_type != cc_lock_downgrade) ||
(block != cc_lock_block && block != cc_lock_noblock) )
return ccErrBadParam;
return ccErrNoMem;
code = cci_msg_new(ccmsg_CCACHE_LOCK, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
- request_header->ctx = int_ccache->ctx;
- request_header->ccache = int_ccache->handle;
- request_header->lock_type;
+ request_header->ctx = htonll(int_ccache->ctx);
+ request_header->ccache = htonll(int_ccache->handle);
+ request_header->lock_type = htonl(lock_type);
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_lock_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
+ code = ntohl(nack_header->err_code);
// TODO: if (block == cc_lock_block) .....
} else if (response->type == ccmsg_ACK) {
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_int32
cc_int_ccache_unlock( cc_ccache_t ccache )
{
- cc_int_ccache_t int_ccache;
- cc_msg_t *request;
- ccmsg_ccache_unlock_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_ccache_t int_ccache;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_unlock_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( ccache == NULL )
return ccErrBadParam;
return ccErrNoMem;
code = cci_msg_new(ccmsg_CCACHE_UNLOCK, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
- request_header->ctx = int_ccache->ctx;
- request_header->ccache = int_ccache->handle;
+ request_header->ctx = htonll(int_ccache->ctx);
+ request_header->ccache = htonll(int_ccache->handle);
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_unlock_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = htonl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = htonl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_int32
cc_int_ccache_get_last_default_time( cc_ccache_t ccache,
- cc_time_t* time_offset )
+ cc_time* time_offset )
{
- cc_int_ccache_t int_ccache;
- cc_msg_t *request;
- ccmsg_ccache_get_last_default_time_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_ccache_t int_ccache;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_get_last_default_time_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_time64 t64;
+ cc_int32 code;
if ( ccache == NULL )
return ccErrBadParam;
request_header = (ccmsg_ccache_get_last_default_time_t*)malloc(sizeof(ccmsg_ccache_get_last_default_time_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_ccache->ctx;
- request_header->ccache = int_ccache->handle;
+ request_header->ctx = htonll(int_ccache->ctx);
+ request_header->ccache = htonll(int_ccache->handle);
code = cci_msg_new(ccmsg_CCACHE_GET_LAST_DEFAULT_TIME, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_get_last_default_time_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
ccmsg_ccache_get_last_default_time_resp_t * response_header = (ccmsg_ccache_get_last_default_time_resp_t*)response->header;
- *time_offset = response_header->last_default_time;
- code = ccNoError;
+ t64 = ntohll(response_header->last_default_time);
+ /* TODO: validate that we do not overflow the max value of time_offset */
+ *time_offset = t64;
+ code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_int32
-cc_int_ccache_get_change_time( cc_ccache_t ccache,
- cc_time_t* time )
+cc_int_ccache_get_change_time( cc_ccache_t ccache, cc_time* time )
{
- cc_int_ccache_t int_ccache;
- cc_msg_t *request;
- ccmsg_ccache_get_change_time_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_ccache_t int_ccache;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_get_change_time_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_time64 t64;
+ cc_uint32 type;
+ cc_int32 code;
if ( ccache == NULL )
return ccErrBadParam;
request_header = (ccmsg_ccache_get_change_time_t*)malloc(sizeof(ccmsg_ccache_get_change_time_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_ccache->ctx;
- request_header->ccache = int_ccache->handle;
+ request_header->ctx = htonll(int_ccache->ctx);
+ request_header->ccache = htonll(int_ccache->handle);
code = cci_msg_new(ccmsg_CCACHE_GET_CHANGE_TIME, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_get_change_time_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
ccmsg_ccache_get_change_time_resp_t * response_header = (ccmsg_ccache_get_change_time_resp_t*)response->header;
- *time = response_header->time;
+ t64 = htonll(response_header->time);
+ /* TODO: validate that we do not overflow 'time' */
+ *time = t64;
code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_ccache_t compare_to,
cc_uint32* equal )
{
- cc_int_ccache_t int_ccache;
- cc_int_ccache_t int_compare_to;
- cc_msg_t *request;
- ccmsg_ccache_compare_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_ccache_t int_ccache;
+ cc_int_ccache_t int_compare_to;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_compare_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( ccache == NULL )
return ccErrBadParam;
request_header = (ccmsg_ccache_compare_t*)malloc(sizeof(ccmsg_ccache_compare_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_ccache->ctx;
- request_header->ccache1 = int_ccache->handle;
- request_header->ccache2 = int_compare_to->handle;
+ request_header->ctx = htonll(int_ccache->ctx);
+ request_header->ccache1 = htonll(int_ccache->handle);
+ request_header->ccache2 = htonll(int_compare_to->handle);
code = cci_msg_new(ccmsg_CCACHE_COMPARE, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_compare_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
ccmsg_ccache_compare_resp_t * response_header = (ccmsg_ccache_compare_resp_t*)response->header;
- *equal = response_header->is_equal;
+ *equal = ntohl(response_header->is_equal);
code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_int32
cc_int_ccache_get_kdc_time_offset( cc_ccache_t ccache,
cc_int32 credentials_version,
- cc_time_t* time_offset )
+ cc_time* time_offset )
{
- cc_int_ccache_t int_ccache;
- cc_msg_t *request;
- ccmsg_ccache_get_kdc_time_offset_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_ccache_t int_ccache;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_get_kdc_time_offset_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( ccache == NULL )
return ccErrBadParam;
request_header = (ccmsg_ccache_get_kdc_time_offset_t*)malloc(sizeof(ccmsg_ccache_get_kdc_time_offset_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_ccache->ctx;
- request_header->ccache = int_ccache->handle;
- request_header->creds_version = credentials_version;
+ request_header->ctx = htonll(int_ccache->ctx);
+ request_header->ccache = htonll(int_ccache->handle);
+ request_header->creds_version = htonl(credentials_version);
code = cci_msg_new(ccmsg_CCACHE_GET_KDC_TIME_OFFSET, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_get_kdc_time_offset_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
+ code = ntohl(nack_header->err_code);
} else if (response->type == ccmsg_ACK) {
ccmsg_ccache_get_kdc_time_offset_resp_t * response_header = (ccmsg_ccache_get_kdc_time_offset_resp_t*)response->header;
- *time_offset = response_header->offset;
+ *time_offset = (cc_time64)ntohll(response_header->offset);
code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_int32
cc_int_ccache_set_kdc_time_offset( cc_ccache_t ccache,
cc_int32 credentials_version,
- cc_time_t time_offset )
+ cc_time time_offset )
{
- cc_int_ccache_t int_ccache;
- cc_msg_t *request;
- ccmsg_ccache_set_kdc_time_offset_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_ccache_t int_ccache;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_set_kdc_time_offset_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_int64 t64;
+ cc_uint32 type;
+ cc_int32 code;
if ( ccache == NULL )
return ccErrBadParam;
request_header = (ccmsg_ccache_set_kdc_time_offset_t*)malloc(sizeof(ccmsg_ccache_set_kdc_time_offset_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_ccache->ctx;
- request_header->ccache = int_ccache->handle;
- request_header->creds_version = credentials_version;
+ request_header->ctx = htonll(int_ccache->ctx);
+ request_header->ccache = htonll(int_ccache->handle);
+ request_header->creds_version = htonl(credentials_version);
+ t64 = time_offset;
+ request_header->offset = htonll(t64);
code = cci_msg_new(ccmsg_CCACHE_SET_KDC_TIME_OFFSET, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_set_kdc_time_offset_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_int_ccache_clear_kdc_time_offset( cc_ccache_t ccache,
cc_int32 credentials_version )
{
- cc_int_ccache_t int_ccache;
- cc_msg_t *request;
- ccmsg_ccache_clear_kdc_time_offset_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_ccache_t int_ccache;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_clear_kdc_time_offset_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( ccache == NULL )
return ccErrBadParam;
request_header = (ccmsg_ccache_clear_kdc_time_offset_t*)malloc(sizeof(ccmsg_ccache_clear_kdc_time_offset_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_ccache->ctx;
- request_header->ccache = int_ccache->handle;
- request_header->creds_version = credentials_version;
+ request_header->ctx = htonll(int_ccache->ctx);
+ request_header->ccache = htonll(int_ccache->handle);
+ request_header->creds_version = htonl(credentials_version);
code = cci_msg_new(ccmsg_CCACHE_CLEAR_KDC_TIME_OFFSET, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_clear_kdc_time_offset_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
-
-
/* $Copyright:
*
- * Copyright 2004 by the Massachusetts Institute of Technology.
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.
*
* All rights reserved.
*
cc_int32
cc_int_ccache_get_last_default_time( cc_ccache_t ccache,
- cc_time_t* time );
+ cc_time* time );
cc_int32
cc_int_ccache_get_change_time( cc_ccache_t ccache,
- cc_time_t* time );
+ cc_time* time );
cc_int32
cc_int_ccache_compare( cc_ccache_t ccache,
cc_int32
cc_int_ccache_get_kdc_time_offset( cc_ccache_t ccache,
cc_int32 credentials_version,
- cc_time_t* time_offset );
+ cc_time* time_offset );
cc_int32
cc_int_ccache_set_kdc_time_offset( cc_ccache_t ccache,
cc_int32 credentials_version,
- cc_time_t time_offset );
+ cc_time time_offset );
cc_int32
cc_int_ccache_clear_kdc_time_offset( cc_ccache_t ccache,
/* $Copyright:
*
- * Copyright 2004 by the Massachusetts Institute of Technology.
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.
*
* All rights reserved.
*
#include <stdlib.h>
#include <stdio.h>
#include <CredentialsCache.h>
+#include "ccache.h"
#include "ccache_iterator.h"
+#include "cc_rpc.h"
#include "msg.h"
#include "msg_headers.h"
cc_handle ctx,
cc_handle handle )
{
- cc_int_ccache_iterator_t iter;
+ cc_int_ccache_iterator_t iter = NULL;
if ( piter == NULL )
return ccErrBadParam;
return ccErrNoMem;
iter->functions = (cc_ccache_iterator_f*)malloc( sizeof(cc_ccache_iterator_f));
- if ( iter->functions ) {
+ if ( iter->functions == NULL ) {
free(iter);
return ccErrNoMem;
}
cc_int32
cc_int_ccache_iterator_release( cc_ccache_iterator_t iter )
{
- cc_int_ccache_iterator_t int_iter;
- cc_msg_t *request;
- ccmsg_ccache_iterator_release_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_ccache_iterator_t int_iter;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_iterator_release_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( iter == NULL )
request_header = (ccmsg_ccache_iterator_release_t*)malloc(sizeof(ccmsg_ccache_iterator_release_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_iter->ctx;
- request_header->iterator = int_iter->handle;
+ request_header->ctx = htonll(int_iter->ctx);
+ request_header->iterator = htonll(int_iter->handle);
code = cci_msg_new(ccmsg_CCACHE_ITERATOR_RELEASE, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_iterator_release_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
- free(int_iter->functions);
- free(int_iter);
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
+
+ if (int_iter->functions)
+ free(int_iter->functions);
+ if (iter)
+ free(int_iter);
return ccNoError;
}
cc_int_ccache_iterator_next( cc_ccache_iterator_t iter,
cc_ccache_t * ccache )
{
- cc_int_ccache_iterator_t int_iter;
- cc_msg_t *request;
- ccmsg_ccache_iterator_next_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_ccache_iterator_t int_iter;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_iterator_next_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( ccache == NULL )
return ccErrBadParam;
request_header = (ccmsg_ccache_iterator_next_t*)malloc(sizeof(ccmsg_ccache_iterator_next_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_iter->ctx;
- request_header->iterator = int_iter->handle;
+ request_header->ctx = htonll(int_iter->ctx);
+ request_header->iterator = htonll(int_iter->handle);
code = cci_msg_new(ccmsg_CCACHE_ITERATOR_NEXT, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_iterator_next_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ } else if (type == ccmsg_ACK) {
ccmsg_ccache_iterator_next_resp_t * response_header = (ccmsg_ccache_iterator_next_resp_t*)response->header;
- code = cc_ccache_new(ccache, int_iter->ctx, response_header->ccache);
+ code = cc_int_ccache_new(ccache, int_iter->ctx, ntohll(response_header->ccache));
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
+ return code;
+}
+
+cc_int32
+cc_int_ccache_iterator_clone( cc_ccache_iterator_t iter,
+ cc_ccache_iterator_t * new_iter )
+{
+ cc_int_ccache_iterator_t int_iter;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_iterator_clone_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
+
+ if ( iter == NULL || new_iter == NULL )
+ return ccErrBadParam;
+
+ int_iter = (cc_int_ccache_iterator_t)iter;
+
+ if ( int_iter->magic != CC_CCACHE_ITER_MAGIC )
+ return ccErrInvalidCCacheIterator;
+
+ request_header = (ccmsg_ccache_iterator_clone_t*)malloc(sizeof(ccmsg_ccache_iterator_clone_t));
+ if (request_header == NULL)
+ return ccErrNoMem;
+ request_header->ctx = htonll(int_iter->ctx);
+ request_header->iterator = htonll(int_iter->handle);
+
+ code = cci_msg_new(ccmsg_CCACHE_ITERATOR_CLONE, &request);
+ if (code != ccNoError)
+ goto cleanup;
+
+ code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_iterator_clone_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
+
+ code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
+
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
+ ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
+ ccmsg_ccache_iterator_clone_resp_t * response_header = (ccmsg_ccache_iterator_clone_resp_t*)response->header;
+ code = cc_int_ccache_iterator_new(new_iter, int_iter->ctx, ntohll(response_header->iterator));
+ } else {
+ code = ccErrBadInternalMessage;
+ }
+
+ cleanup:
+ if (request_header)
+ free(request);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
/* $Copyright:
*
- * Copyright 2004 by the Massachusetts Institute of Technology.
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.
*
* All rights reserved.
*
cc_int_ccache_iterator_next( cc_ccache_iterator_t iter,
cc_ccache_t * ccache );
+cc_int32
+cc_int_ccache_iterator_clone( cc_ccache_iterator_t iter,
+ cc_ccache_iterator_t * iter_new );
+
cc_int32
cc_int_ccache_iterator_set_repeat_count( cc_int_ccache_iterator_t iter,
cc_uint32 count );
--- /dev/null
+/* $Copyright:\r
+ *\r
+ * Copyright 1998-2006 by the Massachusetts Institute of Technology.\r
+ * \r
+ * All rights reserved.\r
+ * \r
+ * Export of this software from the United States of America may require a\r
+ * specific license from the United States Government. It is the\r
+ * responsibility of any person or organization contemplating export to\r
+ * obtain such a license before exporting.\r
+ * \r
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute\r
+ * this software and its documentation for any purpose and without fee is\r
+ * hereby granted, provided that the above copyright notice appear in all\r
+ * copies and that both that copyright notice and this permission notice\r
+ * appear in supporting documentation, and that the name of M.I.T. not be\r
+ * used in advertising or publicity pertaining to distribution of the\r
+ * software without specific, written prior permission. Furthermore if you\r
+ * modify this software you must label your software as modified software\r
+ * and not distribute it in such a fashion that it might be confused with\r
+ * the original MIT software. M.I.T. makes no representations about the\r
+ * suitability of this software for any purpose. It is provided "as is"\r
+ * without express or implied warranty.\r
+ * \r
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED\r
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF\r
+ * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\r
+ * \r
+ * Individual source code files are copyright MIT, Cygnus Support,\r
+ * OpenVision, Oracle, Sun Soft, FundsXpress, and others.\r
+ * \r
+ * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,\r
+ * and Zephyr are trademarks of the Massachusetts Institute of Technology\r
+ * (MIT). No commercial use of these trademarks may be made without prior\r
+ * written permission of MIT.\r
+ * \r
+ * "Commercial use" means use of a name in a product or other for-profit\r
+ * manner. It does NOT prevent a commercial firm from referring to the MIT\r
+ * trademarks in order to convey information (although in doing so,\r
+ * recognition of their trademark status should be given).\r
+ * $\r
+ */\r
+/*\r
+ * This is backwards compatibility for CCache API v2 clients to be able to run \r
+ * against the CCache API v3 library\r
+ */\r
+ \r
+#include "CredentialsCache2.h"\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif /* __cplusplus */\r
+\r
+CCACHE_API cc_int32 cc_shutdown (\r
+ apiCB** ioContext)\r
+{\r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+ \r
+CCACHE_API cc_int32 cc_get_NC_info (\r
+ apiCB* inContext,\r
+ infoNC*** outInfo)\r
+{\r
+ \r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+ \r
+CCACHE_API cc_int32 cc_get_change_time (\r
+ apiCB* inContext,\r
+ cc_time* outTime)\r
+{\r
+ \r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+ \r
+CCACHE_API cc_int32 cc_open (\r
+ apiCB* inContext,\r
+ const char* inName,\r
+ cc_int32 inVersion,\r
+ cc_uint32 inFlags,\r
+ ccache_p** outCCache)\r
+{\r
+ if (inVersion != CC_CRED_V4 && inVersion != CC_CRED_V5)\r
+ return CC_ERR_CRED_VERSION;\r
+\r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+ \r
+CCACHE_API cc_int32 cc_create (\r
+ apiCB* inContext,\r
+ const char* inName,\r
+ const char* inPrincipal,\r
+ cc_int32 inVersion,\r
+ cc_uint32 inFlags,\r
+ ccache_p** outCCache)\r
+{\r
+ if (inVersion != CC_CRED_V4 && inVersion != CC_CRED_V5)\r
+ return CC_ERR_CRED_VERSION;\r
+ \r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+ \r
+CCACHE_API cc_int32 cc_close (\r
+ apiCB* inContext,\r
+ ccache_p** ioCCache)\r
+{\r
+ \r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+ \r
+CCACHE_API cc_int32 cc_destroy (\r
+ apiCB* inContext,\r
+ ccache_p** ioCCache)\r
+{\r
+ \r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+ \r
+CCACHE_API cc_int32 cc_seq_fetch_NCs_begin (\r
+ apiCB* inContext,\r
+ ccache_cit** outIterator)\r
+{\r
+ \r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+\r
+CCACHE_API cc_int32 cc_seq_fetch_NCs_next (\r
+ apiCB* inContext,\r
+ ccache_p** outCCache,\r
+ ccache_cit* inIterator)\r
+{\r
+ \r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+\r
+CCACHE_API cc_int32 cc_seq_fetch_NCs_end (\r
+ apiCB* inContext,\r
+ ccache_cit** ioIterator)\r
+{\r
+ \r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+\r
+CCACHE_API cc_int32 cc_get_name (\r
+ apiCB* inContext,\r
+ ccache_p* inCCache,\r
+ char** outName)\r
+{\r
+ \r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+ \r
+CCACHE_API cc_int32 cc_get_cred_version (\r
+ apiCB* inContext,\r
+ ccache_p* inCCache,\r
+ cc_int32* outVersion)\r
+{\r
+ \r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+ \r
+CCACHE_API cc_int32 cc_set_principal (\r
+ apiCB* inContext,\r
+ ccache_p* inCCache,\r
+ cc_int32 inVersion,\r
+ char* inPrincipal)\r
+{\r
+ if (inVersion != CC_CRED_V4 && inVersion != CC_CRED_V5)\r
+ return CC_ERR_CRED_VERSION;\r
+ \r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+ \r
+CCACHE_API cc_int32 cc_get_principal (\r
+ apiCB* inContext,\r
+ ccache_p* inCCache,\r
+ char** outPrincipal)\r
+{\r
+ \r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+ \r
+CCACHE_API cc_int32 cc_store (\r
+ apiCB* inContext,\r
+ ccache_p* inCCache,\r
+ cred_union inCredentials)\r
+{\r
+ \r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+\r
+CCACHE_API cc_int32 cc_remove_cred (\r
+ apiCB* inContext,\r
+ ccache_p* inCCache,\r
+ cred_union inCredentials)\r
+{\r
+ \r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+\r
+CCACHE_API cc_int32 cc_seq_fetch_creds_begin (\r
+ apiCB* inContext,\r
+ const ccache_p* inCCache,\r
+ ccache_cit** outIterator)\r
+{\r
+ \r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+\r
+CCACHE_API cc_int32 cc_seq_fetch_creds_next (\r
+ apiCB* inContext,\r
+ cred_union** outCreds,\r
+ ccache_cit* inIterator)\r
+{\r
+ \r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+ \r
+CCACHE_API cc_int32 cc_seq_fetch_creds_end (\r
+ apiCB* inContext,\r
+ ccache_cit** ioIterator)\r
+{\r
+ \r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+ \r
+CCACHE_API cc_int32 cc_free_principal (\r
+ apiCB* inContext,\r
+ char** ioPrincipal)\r
+{\r
+ \r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+\r
+CCACHE_API cc_int32 cc_free_name (\r
+ apiCB* inContext,\r
+ char** ioName)\r
+{\r
+ \r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+\r
+CCACHE_API cc_int32 cc_free_creds (\r
+ apiCB* inContext,\r
+ cred_union** creds)\r
+{\r
+ \r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+\r
+CCACHE_API cc_int32 cc_free_NC_info (\r
+ apiCB* inContext,\r
+ infoNC*** ioInfo)\r
+{\r
+ \r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+\r
+CCACHE_API cc_int32 cc_lock_request(\r
+ apiCB* inContext,\r
+ const ccache_p* inCCache,\r
+ const cc_int32 lock_type)\r
+{\r
+ /* replace this return value when the function is implemented */\r
+ return CC_NOT_SUPP;\r
+}\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif /* __cplusplus */\r
+\r
#include "ccstring.h"
cc_int32
-cc_int_string_new( cc_string_t * pstring, char * data )
+cci_string_new( cc_string_t * pstring, char * data )
{
- cc_int_string_t string = (cc_int_string_t)malloc(sizeof(cc_int_string_d));
+ cci_string_t string = (cci_string_t)malloc(sizeof(cci_string_d));
if ( string == NULL )
return ccErrNoMem;
}
string->magic = CC_STRING_MAGIC;
- string->functions->release = cc_int_string_release;
+ string->functions->release = cci_string_release;
string->data = strdup(data);
if ( string->data == NULL ) {
}
cc_int32
-cc_int_string_release( cc_string_t str )
+cci_string_release( cc_string_t str )
{
- cc_int_string_t int_string;
+ cci_string_t int_string;
if ( str == NULL )
return ccErrBadParam;
- int_string = (cc_int_string_t)str;
+ int_string = (cci_string_t)str;
if ( int_string->magic != CC_STRING_MAGIC )
return ccErrInvalidString;
#define CC_STRING_MAGIC ('S'<<24 | 'T'<<16 | 'R'<<8 | 'I')
-struct cc_int_string_d {
+struct cci_string_d {
char* data;
cc_string_f* functions;
#if TARGET_OS_MAC
#endif
cc_uint32 magic;
};
-typedef struct cc_int_string_d cc_int_string_d;
-typedef cc_int_string_d* cc_int_string_t;
+typedef struct cci_string_d cci_string_d;
+typedef cci_string_d* cci_string_t;
cc_int32
-cc_int_string_new( cc_string_t * pstring, char * data );
+cci_string_new( cc_string_t * pstring, char * data );
cc_int32
-cc_int_string_release( cc_string_t string );
+cci_string_release( cc_string_t string );
/* $Copyright:
*
- * Copyright 2004 by the Massachusetts Institute of Technology.
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.
*
* All rights reserved.
*
#include <stdlib.h>
#include <stdio.h>
+#include <string.h>
#include <CredentialsCache.h>
#include "context.h"
+#include "ccache.h"
+#include "ccache_iterator.h"
+#include "cc_rpc.h"
#include "msg.h"
#include "msg_headers.h"
+#include "ccstring.h"
+
+/* cc_int_context_new
+ *
+ * input parameters (handle, version) are in host order
+ */
cc_int32
cc_int_context_new( cc_context_t * pcontext, cc_handle handle, cc_uint32 version )
cc_int32
cc_int_context_release( cc_context_t context )
{
- cc_int_context_t int_context;
- cc_msg_t *request;
- ccmsg_ctx_release_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_context_t int_context;
+ cc_msg_t *request = NULL;
+ ccmsg_ctx_release_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( context == NULL )
return ccErrBadParam;
request_header = (ccmsg_ctx_release_t*)malloc(sizeof(ccmsg_ctx_release_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_context->handle;
+ request_header->ctx = htonll(int_context->handle);
code = cci_msg_new(ccmsg_CTX_RELEASE, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ctx_release_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ request_header = NULL;
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
free(int_context->functions);
free(int_context);
return code;
cc_int32
cc_int_context_get_change_time( cc_context_t context,
- cc_time_t* time)
+ cc_time* time)
{
- cc_int_context_t int_context;
- cc_msg_t *request;
- ccmsg_ctx_get_change_time_t *request_header;
- cc_msg_t *response;
+ cc_int_context_t int_context;
+ cc_msg_t *request = NULL;
+ ccmsg_ctx_get_change_time_t *request_header = NULL;
+ cc_msg_t *response = NULL;
ccmsg_ctx_get_change_time_resp_t *response_header;
- cc_int32 code;
+ cc_time64 t64;
+ cc_uint32 type;
+ cc_int32 code;
if ( context == NULL || time == NULL )
return ccErrBadParam;
request_header = (ccmsg_ctx_get_change_time_t*)malloc(sizeof(ccmsg_ctx_get_change_time_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_context->handle;
+ request_header->ctx = htonll(int_context->handle);
code = cci_msg_new(ccmsg_CTX_GET_CHANGE_TIME, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ctx_get_change_time_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
+ code = ntohl(nack_header->err_code);
} else if (response->type == ccmsg_ACK) {
response_header = (ccmsg_ctx_get_change_time_resp_t*)response->header;
- *time = response_header->time;
+ t64 = ntohll(response_header->time);
+ /* TODO: validate that value is not greater than can fit in cc_time */
+ *time = (cc_time)t64;
code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_int_context_get_default_ccache_name( cc_context_t context,
cc_string_t* name )
{
- cc_int_context_t int_context;
- cc_msg_t *request;
- ccmsg_ctx_get_default_ccache_name_t *request_header;
- cc_msg_t *response;
+ cc_int_context_t int_context;
+ cc_msg_t *request = NULL;
+ ccmsg_ctx_get_default_ccache_name_t *request_header = NULL;
+ cc_msg_t *response = NULL;
ccmsg_ctx_get_default_ccache_name_resp_t *response_header;
- cc_int32 code;
+ char *string = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( context == NULL || name == NULL )
return ccErrBadParam;
request_header = (ccmsg_ctx_get_default_ccache_name_t*)malloc(sizeof(ccmsg_ctx_get_default_ccache_name_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_context->handle;
+ request_header->ctx = htonll(int_context->handle);
code = cci_msg_new(ccmsg_CTX_GET_DEFAULT_CCACHE_NAME, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ctx_get_default_ccache_name_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
- char * string;
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
response_header = (ccmsg_ctx_get_default_ccache_name_resp_t*)response->header;
code = cci_msg_retrieve_blob(response, response_header->name_offset,
response_header->name_len, &string);
- if (code == ccNoError) {
- code = cc_string_new(&name, string);
- free(string);
- }
+ if (code == ccNoError)
+ code = cci_string_new(name, string);
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (string)
+ free(string);
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_uint32* equal )
{
cc_int_context_t int_context, int_compare_to;
- cc_msg_t *request;
- ccmsg_ctx_compare_t *request_header;
- cc_msg_t *response;
+ cc_msg_t *request = NULL;
+ ccmsg_ctx_compare_t *request_header = NULL;
+ cc_msg_t *response = NULL;
ccmsg_ctx_compare_resp_t *response_header;
- cc_int32 code;
+ cc_uint32 type;
+ cc_int32 code;
if ( context == NULL || compare_to == NULL ||
equal == NULL )
request_header = (ccmsg_ctx_compare_t*)malloc(sizeof(ccmsg_ctx_compare_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx1 = int_context->handle;
- request_header->ctx2 = int_compare_to->handle;
+ request_header->ctx1 = htonll(int_context->handle);
+ request_header->ctx2 = htonll(int_compare_to->handle);
code = cci_msg_new(ccmsg_CTX_COMPARE, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ctx_compare_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
response_header = (ccmsg_ctx_compare_resp_t*)response->header;
- *equal = response_header->is_equal;
+ *equal = ntohl(response_header->is_equal);
code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_int_context_new_ccache_iterator( cc_context_t context,
cc_ccache_iterator_t* iterator )
{
- cc_int_context_t int_context;
- cc_msg_t *request;
- ccmsg_ctx_new_ccache_iterator_t *request_header;
- cc_msg_t *response;
+ cc_int_context_t int_context;
+ cc_msg_t *request = NULL;
+ ccmsg_ctx_new_ccache_iterator_t *request_header = NULL;
+ cc_msg_t *response = NULL;
ccmsg_ctx_new_ccache_iterator_resp_t *response_header;
- cc_int32 code;
+ cc_uint32 type;
+ cc_int32 code;
if ( context == NULL || iterator == NULL )
return ccErrBadParam;
request_header = (ccmsg_ctx_new_ccache_iterator_t*)malloc(sizeof(ccmsg_ctx_new_ccache_iterator_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_context->handle;
+ request_header->ctx = htonll(int_context->handle);
code = cci_msg_new(ccmsg_CTX_NEW_CCACHE_ITERATOR, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ctx_new_ccache_iterator_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
response_header = (ccmsg_ctx_new_ccache_iterator_resp_t*)response->header;
- code = cc_int_ccache_iterator_new(iterator, int_context->handle, response_header->iterator);
+ code = cc_int_ccache_iterator_new(iterator, int_context->handle,
+ ntohll(response_header->iterator));
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
const char* name,
cc_ccache_t* ccache )
{
- cc_uint32 blob_pos;
- cc_int_context_t int_context;
- cc_msg_t *request;
- ccmsg_ccache_open_t *request_header;
- cc_msg_t *response;
+ cc_uint32 blob_pos;
+ cc_int_context_t int_context;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_open_t *request_header = NULL;
+ cc_msg_t *response = NULL;
ccmsg_ccache_open_resp_t *response_header;
- cc_int32 code;
+ cc_uint32 type;
+ cc_int32 code;
if ( context == NULL || name == NULL || ccache == NULL )
return ccErrBadParam;
if (request_header == NULL)
return ccErrNoMem;
- code = cci_msg_new(ccmsg_CCACHE_OPEN, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ code = cci_msg_new(ccmsg_CTX_CCACHE_OPEN, &request);
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_data_blob(request, (void *)name, strlen(name) + 1, &blob_pos);
- if (code != ccNoError) {
- cci_msg_destroy(request);
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
- request_header->ctx = int_context->handle;
- request_header->name_offset = blob_pos;
- request_header->name_len = strlen(name) + 1;
+ request_header->ctx = htonll(int_context->handle);
+ request_header->name_offset = htonl(blob_pos);
+ request_header->name_len = htonl(strlen(name) + 1);
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_open_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
response_header = (ccmsg_ccache_open_resp_t*)response->header;
- code = cc_cache_new(ccache, response_header->ccache);
+ code = cc_int_ccache_new(ccache, int_context->handle, ntohll(response_header->ccache));
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_int_context_open_default_ccache( cc_context_t context,
cc_ccache_t* ccache)
{
- cc_int_context_t int_context;
- cc_msg_t *request;
- ccmsg_ccache_open_default_t *request_header;
- cc_msg_t *response;
+ cc_int_context_t int_context;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_open_default_t *request_header = NULL;
+ cc_msg_t *response = NULL;
ccmsg_ccache_open_resp_t *response_header;
- cc_int32 code;
+ cc_uint32 type;
+ cc_int32 code;
if ( context == NULL || ccache == NULL )
return ccErrBadParam;
if (request_header == NULL)
return ccErrNoMem;
- code = cci_msg_new(ccmsg_CCACHE_OPEN_DEFAULT, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ code = cci_msg_new(ccmsg_CTX_CCACHE_OPEN_DEFAULT, &request);
+ if (code != ccNoError)
+ goto cleanup;
- request_header->ctx = int_context->handle;
+ request_header->ctx = htonll(int_context->handle);
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_open_default_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
response_header = (ccmsg_ccache_open_resp_t*)response->header;
- code = cc_cache_new(ccache, response_header->ccache);
+ code = cc_int_ccache_new(ccache, int_context->handle, ntohll(response_header->ccache));
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
const char* principal,
cc_ccache_t* ccache )
{
- cc_uint32 blob_pos;
- cc_int_context_t int_context;
- cc_msg_t *request;
- ccmsg_ccache_create_t *request_header;
- cc_msg_t *response;
+ cc_uint32 blob_pos;
+ cc_int_context_t int_context;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_create_t *request_header = NULL;
+ cc_msg_t *response = NULL;
ccmsg_ccache_create_resp_t *response_header;
- cc_int32 code;
+ cc_uint32 type;
+ cc_int32 code;
if ( context == NULL || name == NULL ||
cred_vers == 0 || cred_vers > cc_credentials_v4_v5 ||
if (request_header == NULL)
return ccErrNoMem;
- code = cci_msg_new(ccmsg_CCACHE_CREATE, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ code = cci_msg_new(ccmsg_CTX_CCACHE_CREATE, &request);
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_data_blob(request, (void *)name, strlen(name) + 1, &blob_pos);
- if (code != ccNoError) {
- cci_msg_destroy(request);
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
- request_header->ctx = int_context->handle;
- request_header->version = cred_vers;
- request_header->name_offset = blob_pos;
- request_header->name_len = strlen(name) + 1;
+ request_header->ctx = htonll(int_context->handle);
+ request_header->version = htonl(cred_vers);
+ request_header->name_offset = htonl(blob_pos);
+ request_header->name_len = htonl(strlen(name) + 1);
code = cci_msg_add_data_blob(request, (void *)principal, strlen(principal) + 1, &blob_pos);
- if (code != ccNoError) {
- cci_msg_destroy(request);
- free(request_header);
- return code;
- }
- request_header->principal_offset = blob_pos;
- request_header->principal_len = strlen(principal) + 1;
+ if (code != ccNoError)
+ goto cleanup;
+
+ request_header->principal_offset = htonl(blob_pos);
+ request_header->principal_len = htonl(strlen(principal) + 1);
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_create_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
response_header = (ccmsg_ccache_create_resp_t*)response->header;
- code = cc_cache_new(ccache, response_header->ccache);
+ code = cc_int_ccache_new(ccache, int_context->handle, ntohll(response_header->ccache));
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
const char* principal,
cc_ccache_t* ccache )
{
- cc_uint32 blob_pos;
- cc_int_context_t int_context;
- cc_msg_t *request;
- ccmsg_ccache_create_default_t *request_header;
- cc_msg_t *response;
+ cc_uint32 blob_pos;
+ cc_int_context_t int_context;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_create_default_t *request_header = NULL;
+ cc_msg_t *response = NULL;
ccmsg_ccache_create_resp_t *response_header;
- cc_int32 code;
+ cc_uint32 type;
+ cc_int32 code;
if ( context == NULL ||
cred_vers == 0 || cred_vers > cc_credentials_v4_v5 ||
if (request_header == NULL)
return ccErrNoMem;
- code = cci_msg_new(ccmsg_CCACHE_CREATE_DEFAULT, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ code = cci_msg_new(ccmsg_CTX_CCACHE_CREATE_DEFAULT, &request);
+ if (code != ccNoError)
+ goto cleanup;
- request_header->ctx = int_context->handle;
- request_header->version = cred_vers;
+ request_header->ctx = htonll(int_context->handle);
+ request_header->version = htonl(cred_vers);
code = cci_msg_add_data_blob(request, (void *)principal, strlen(principal) + 1, &blob_pos);
- if (code != ccNoError) {
- cci_msg_destroy(request);
- free(request_header);
- return code;
- }
- request_header->principal_offset = blob_pos;
- request_header->principal_len = strlen(principal) + 1;
+ if (code != ccNoError)
+ goto cleanup;
+
+ request_header->principal_offset = htonl(blob_pos);
+ request_header->principal_len = htonl(strlen(principal) + 1);
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_create_default_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
response_header = (ccmsg_ccache_create_resp_t*)response->header;
- code = cc_cache_new(ccache, response_header->ccache);
+ code = cc_int_ccache_new(ccache, int_context->handle, ntohll(response_header->ccache));
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
const char* principal,
cc_ccache_t* ccache )
{
- cc_uint32 blob_pos;
- cc_int_context_t int_context;
- cc_msg_t *request;
- ccmsg_ccache_create_unique_t *request_header;
- cc_msg_t *response;
+ cc_uint32 blob_pos;
+ cc_int_context_t int_context;
+ cc_msg_t *request = NULL;
+ ccmsg_ccache_create_unique_t *request_header = NULL;
+ cc_msg_t *response = NULL;
ccmsg_ccache_create_resp_t *response_header;
- cc_int32 code;
+ cc_uint32 type;
+ cc_int32 code;
if ( context == NULL ||
cred_vers == 0 || cred_vers > cc_credentials_v4_v5 ||
if (request_header == NULL)
return ccErrNoMem;
- code = cci_msg_new(ccmsg_CCACHE_CREATE_UNIQUE, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ code = cci_msg_new(ccmsg_CTX_CCACHE_CREATE_UNIQUE, &request);
+ if (code != ccNoError)
+ goto cleanup;
- request_header->ctx = int_context->handle;
- request_header->version = cred_vers;
+ request_header->ctx = htonll(int_context->handle);
+ request_header->version = htonl(cred_vers);
code = cci_msg_add_data_blob(request, (void *)principal, strlen(principal) + 1, &blob_pos);
- if (code != ccNoError) {
- cci_msg_destroy(request);
- free(request_header);
- return code;
- }
- request_header->principal_offset = blob_pos;
- request_header->principal_len = strlen(principal) + 1;
+ if (code != ccNoError)
+ goto cleanup;
+
+ request_header->principal_offset = htonl(blob_pos);
+ request_header->principal_len = htonl(strlen(principal) + 1);
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ccache_create_unique_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = htonl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
response_header = (ccmsg_ccache_create_resp_t*)response-> header;
- code = cc_cache_new(ccache, response_header->ccache);
+ code = cc_int_ccache_new(ccache, int_context->handle, ntohll(response_header->ccache));
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_uint32 lock_type,
cc_uint32 block )
{
- cc_int_context_t int_context;
- cc_msg_t *request;
- ccmsg_ctx_lock_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_context_t int_context;
+ cc_msg_t *request = NULL;
+ ccmsg_ctx_lock_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( context == NULL ||
- (lock_type != cc_lock_read && lock_type != cc_lock_write) ||
+ (lock_type != cc_lock_read && lock_type != cc_lock_write &&
+ lock_type != cc_lock_upgrade && lock_type != cc_lock_downgrade) ||
(block != cc_lock_block && block != cc_lock_noblock) )
return ccErrBadParam;
return ccErrNoMem;
code = cci_msg_new(ccmsg_CTX_LOCK, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
- request_header->ctx = int_context->handle;
- request_header->lock_type;
+ request_header->ctx = htonll(int_context->handle);
+ request_header->lock_type = htonl(lock_type);
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ctx_lock_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
+ code = ntohl(nack_header->err_code);
// TODO: if (block == cc_lock_block) .....
- } else if (response->type == ccmsg_ACK) {
+ } else if (type == ccmsg_ACK) {
code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_int32
cc_int_context_unlock( cc_context_t context )
{
- cc_int_context_t int_context;
- cc_msg_t *request;
- ccmsg_ctx_unlock_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_int_context_t int_context;
+ cc_msg_t *request = NULL;
+ ccmsg_ctx_unlock_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( context == NULL )
return ccErrBadParam;
return ccErrNoMem;
code = cci_msg_new(ccmsg_CTX_UNLOCK, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
- request_header->ctx = int_context->handle;
+ request_header->ctx = htonll(int_context->handle);
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ctx_unlock_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_int32* supportedVersion,
char const** vendor )
{
- cc_int_context_t int_context, new_context;
- static char vendor_st[128] = "";
- cc_msg_t *request;
- ccmsg_clone_t *request_header;
- cc_msg_t *response;
- ccmsg_clone_resp_t *response_header;
- cc_int32 code;
+ cc_int_context_t int_context;
+ static char vendor_st[128] = "";
+ cc_msg_t *request = NULL;
+ ccmsg_ctx_clone_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ ccmsg_ctx_clone_resp_t *response_header;
+ char *string = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( inContext == NULL ||
outContext == NULL ||
supportedVersion == NULL )
return ccErrBadParam;
- int_context = (cc_int_context_t)context;
+ int_context = (cc_int_context_t)inContext;
if ( int_context->magic != CC_CONTEXT_MAGIC )
return ccErrInvalidContext;
if ((requestedVersion != ccapi_version_2) &&
(requestedVersion != ccapi_version_3) &&
(requestedVersion != ccapi_version_4) &&
- (requestedVersion != ccapi_version_5)) {
+ (requestedVersion != ccapi_version_5) &&
+ (requestedVersion != ccapi_version_6)) {
if (supportedVersion != NULL) {
- *supportedVersion = ccapi_version_5;
+ *supportedVersion = ccapi_version_max;
}
return ccErrBadAPIVersion;
}
- request_header = (ccmsg_clone_t*)malloc(sizeof(ccmsg_clone_t));
+ request_header = (ccmsg_ctx_clone_t*)malloc(sizeof(ccmsg_ctx_clone_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_context->handle;
- request_header->in_version = requestedVersion;
+ request_header->ctx = htonll(int_context->handle);
+ request_header->in_version = htonl(requestedVersion);
code = cci_msg_new(ccmsg_INIT, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
- code = cci_msg_add_header(request, request_header, sizeof(ccmsg_init_t));
+ code = cci_msg_add_header(request, request_header, sizeof(ccmsg_ctx_clone_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
- response_header = (ccmsg_clone_resp_t *)response->header;
- *supportedVersion = response_header->out_version;
- code = cc_int_context_new(outContext, response_header->out_ctx, response_header->out_version);
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
+ response_header = (ccmsg_ctx_clone_resp_t *)response->header;
+ *supportedVersion = ntohl(response_header->out_version);
+ code = cc_int_context_new(outContext, ntohll(response_header->out_ctx), ntohl(response_header->out_version));
if (!vendor_st[0]) {
- char * string;
- code = cci_msg_retrieve_blob(response, response_header->vendor_offset, response_header->vendor_length, &string);
+ code = cci_msg_retrieve_blob(response, ntohl(response_header->vendor_offset), ntohl(response_header->vendor_length), &string);
strncpy(vendor_st, string, sizeof(vendor_st)-1);
vendor_st[sizeof(vendor_st)-1] = '\0';
- free(string);
}
*vendor = vendor_st;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (string)
+ free(string);
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
cc_int32* version )
{
cc_int_context_t int_context;
- cc_int32 code;
if ( context == NULL ||
version == NULL )
cc_int32
cc_int_context_get_change_time( cc_context_t context,
- cc_time_t* time);
+ cc_time* time);
cc_int32
cc_int_context_get_default_ccache_name( cc_context_t context,
/* $Copyright:
*
- * Copyright 2004 by the Massachusetts Institute of Technology.
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.
*
* All rights reserved.
*
switch ( version ) {
case cc_credentials_v4:
- code = cci_cred_v4_unmarshall(data, len, credentials->data);
+ code = cci_creds_v4_unmarshall(data, len, credentials->data);
break;
case cc_credentials_v5:
- code = cci_cred_v5_unmarshall(data, len, credentials->data);
+ code = cci_creds_v5_unmarshall(data, len, credentials->data);
break;
default:
free(credentials);
cc_int32
cc_int_credentials_compare( cc_credentials_t credentials,
- cc_credentials_t compare_to,
- cc_uint32* equal )
+ cc_credentials_t compare_to,
+ cc_uint32* equal )
{
cc_int_credentials_t int_credentials;
cc_int_credentials_t int_compare_to;
if ( credentials == NULL || compare_to == NULL || equal == NULL )
return ccErrBadParam;
-
+ int_credentials = (cc_int_credentials_t)credentials;
+ int_compare_to = (cc_int_credentials_t)compare_to;
+
if ( int_credentials->magic != CC_CREDS_MAGIC ||
int_compare_to->magic != CC_CREDS_MAGIC )
return ccErrInvalidCredentials;
- int_credentials = (cc_int_credentials_t)credentials;
- int_compare_to = (cc_int_credentials_t)compare_to;
-
*equal = (int_credentials->handle == int_compare_to->handle);
+
return ccNoError;
}
/* $Copyright:
*
- * Copyright 2004 by the Massachusetts Institute of Technology.
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.
*
* All rights reserved.
*
cc_int32
cci_creds_v4_unmarshall( char * flat,
- cc_uint32 len,
- cc_credentials_union * creds);
+ cc_uint32 len,
+ cc_credentials_union * creds);
cc_int32
cci_creds_v5_unmarshall( char * flat,
/* $Copyright:
*
- * Copyright 2004 by the Massachusetts Institute of Technology.
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.
*
* All rights reserved.
*
#include <stdlib.h>
#include <stdio.h>
#include <CredentialsCache.h>
+#include "credentials.h"
#include "credentials_iterator.h"
+#include "cc_rpc.h"
#include "msg.h"
#include "msg_headers.h"
iter->functions->release = cc_int_credentials_iterator_release;
iter->functions->next = cc_int_credentials_iterator_next;
+ iter->functions->clone = cc_int_credentials_iterator_clone;
iter->magic = CC_CREDS_ITER_MAGIC;
iter->ctx = ctx;
iter->ccache = ccache;
cc_int_credentials_iterator_release( cc_credentials_iterator_t iter )
{
cc_int_credentials_iterator_t int_iter;
- cc_msg_t *request;
- ccmsg_creds_iterator_release_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_msg_t *request = NULL;
+ ccmsg_creds_iterator_release_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( iter == NULL )
return ccErrBadParam;
request_header = (ccmsg_creds_iterator_release_t*)malloc(sizeof(ccmsg_creds_iterator_release_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_iter->ctx;
- request_header->ccache = int_iter->ccache;
- request_header->iterator = int_iter->handle;
+ request_header->ctx = htonll(int_iter->ctx);
+ request_header->ccache = htonll(int_iter->ccache);
+ request_header->iterator = htonll(int_iter->handle);
+
code = cci_msg_new(ccmsg_CREDS_ITERATOR_RELEASE, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_creds_iterator_release_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = htonl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = htonl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
code = ccNoError;
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
free(int_iter->functions);
free(int_iter);
cc_credentials_t * credentials )
{
cc_int_credentials_iterator_t int_iter;
- cc_msg_t *request;
- ccmsg_creds_iterator_next_t *request_header;
- cc_msg_t *response;
- cc_int32 code;
+ cc_msg_t *request = NULL;
+ ccmsg_creds_iterator_next_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
if ( credentials == NULL )
return ccErrBadParam;
request_header = (ccmsg_creds_iterator_next_t*)malloc(sizeof(ccmsg_creds_iterator_next_t));
if (request_header == NULL)
return ccErrNoMem;
- request_header->ctx = int_iter->ctx;
- request_header->ccache = int_iter->ccache;
- request_header->iterator = int_iter->handle;
+ request_header->ctx = htonll(int_iter->ctx);
+ request_header->ccache = htonll(int_iter->ccache);
+ request_header->iterator = htonll(int_iter->handle);
code = cci_msg_new(ccmsg_CREDS_ITERATOR_NEXT, &request);
- if (code != ccNoError) {
- free(request_header);
- return code;
- }
+ if (code != ccNoError)
+ goto cleanup;
code = cci_msg_add_header(request, request_header, sizeof(ccmsg_creds_iterator_next_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
- if (response->type == ccmsg_NACK) {
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
- code = nack_header->err_code;
- } else if (response->type == ccmsg_ACK) {
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
char * blob;
ccmsg_creds_iterator_next_resp_t * response_header = (ccmsg_creds_iterator_next_resp_t*)response->header;
- code = cci_msg_retrieve_blob(response, response_header->creds_offset, response_header->creds_len, &blob);
- code = cc_credentials_new(credentials, response_header->version,
- int_iter->ctx, int_iter->ccache, response_header->creds_handle,
- blob, response_header->creds_len);
+ code = cci_msg_retrieve_blob(response, ntohl(response_header->creds_offset), ntohl(response_header->creds_len), &blob);
+ code = cc_int_credentials_new(credentials, ntohl(response_header->version),
+ int_iter->ctx, int_iter->ccache, ntohll(response_header->creds_handle),
+ blob, ntohl(response_header->creds_len));
free(blob);
} else {
code = ccErrBadInternalMessage;
}
- cci_msg_destroy(request);
- cci_msg_destroy(response);
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
+ return code;
+}
+
+cc_int32
+cc_int_credentials_iterator_clone( cc_credentials_iterator_t iter,
+ cc_credentials_iterator_t* new_iter)
+{
+ cc_int_credentials_iterator_t int_iter;
+ cc_msg_t *request = NULL;
+ ccmsg_creds_iterator_clone_t *request_header = NULL;
+ cc_msg_t *response = NULL;
+ cc_uint32 type;
+ cc_int32 code;
+
+ if ( iter == NULL || new_iter == NULL )
+ return ccErrBadParam;
+
+ int_iter = (cc_int_credentials_iterator_t)iter;
+
+ if ( int_iter->magic != CC_CREDS_ITER_MAGIC )
+ return ccErrInvalidCCacheIterator;
+
+ request_header = (ccmsg_creds_iterator_clone_t*)malloc(sizeof(ccmsg_creds_iterator_clone_t));
+ if (request_header == NULL)
+ return ccErrNoMem;
+ request_header->ctx = htonll(int_iter->ctx);
+ request_header->iterator = htonll(int_iter->handle);
+
+ code = cci_msg_new(ccmsg_CREDS_ITERATOR_CLONE, &request);
+ if (code != ccNoError)
+ goto cleanup;
+
+ code = cci_msg_add_header(request, request_header, sizeof(ccmsg_creds_iterator_clone_t));
+ if (code != ccNoError)
+ goto cleanup;
+ request_header = NULL;
+
+ code = cci_perform_rpc(request, &response);
+ if (code != ccNoError)
+ goto cleanup;
+
+ type = ntohl(response->type);
+ if (type == ccmsg_NACK) {
+ ccmsg_nack_t * nack_header = (ccmsg_nack_t *)response->header;
+ code = ntohl(nack_header->err_code);
+ } else if (type == ccmsg_ACK) {
+ ccmsg_creds_iterator_clone_resp_t * response_header = (ccmsg_creds_iterator_clone_resp_t*)response->header;
+ code = cc_int_credentials_iterator_new(new_iter, int_iter->ctx, int_iter->ccache, ntohll(response_header->iterator));
+ } else {
+ code = ccErrBadInternalMessage;
+ }
+
+ cleanup:
+ if (request_header)
+ free(request_header);
+ if (request)
+ cci_msg_destroy(request);
+ if (response)
+ cci_msg_destroy(response);
return code;
}
+
/* $Copyright:
*
- * Copyright 2004 by the Massachusetts Institute of Technology.
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.
*
* All rights reserved.
*
cc_int_credentials_iterator_next( cc_credentials_iterator_t iter,
cc_credentials_t * credentials );
+cc_int32
+cc_int_credentials_iterator_clone( cc_credentials_iterator_t iter,
+ cc_credentials_iterator_t * new_iter );
+
--- /dev/null
+!INCLUDE <WIN32.MAK>\r
+\r
+CFLAGS = -I../include $(cdebug) $(cflags) $(cvarsmt)\r
+\r
+CC_COMMON_OBJS = marshall.obj msg.obj generic_lists.obj\r
+\r
+CC_COMMON_LIB = cc_common.lib\r
+\r
+$(CC_COMMON_LIB): $(CC_COMMON_OBJS)\r
+ $(implib) /NOLOGO /OUT:$@ $**\r
+\r
+all: $(CC_COMMON_LIB)\r
+\r
+clean:\r
+ del *.obj *.lib\r
--- /dev/null
+/* $Copyright:\r
+*\r
+* Copyright 2004-2006 by the Massachusetts Institute of Technology.\r
+* \r
+* All rights reserved.\r
+* \r
+* Export of this software from the United States of America may require a\r
+* specific license from the United States Government. It is the\r
+* responsibility of any person or organization contemplating export to\r
+* obtain such a license before exporting.\r
+* \r
+* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute\r
+* this software and its documentation for any purpose and without fee is\r
+* hereby granted, provided that the above copyright notice appear in all\r
+* copies and that both that copyright notice and this permission notice\r
+* appear in supporting documentation, and that the name of M.I.T. not be\r
+* used in advertising or publicity pertaining to distribution of the\r
+* software without specific, written prior permission. Furthermore if you\r
+* modify this software you must label your software as modified software\r
+* and not distribute it in such a fashion that it might be confused with\r
+* the original MIT software. M.I.T. makes no representations about the\r
+* suitability of this software for any purpose. It is provided "as is"\r
+* without express or implied warranty.\r
+* \r
+* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED\r
+* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF\r
+* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\r
+* \r
+* Individual source code files are copyright MIT, Cygnus Support,\r
+* OpenVision, Oracle, Sun Soft, FundsXpress, and others.\r
+* \r
+* Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,\r
+* and Zephyr are trademarks of the Massachusetts Institute of Technology\r
+* (MIT). No commercial use of these trademarks may be made without prior\r
+* written permission of MIT.\r
+* \r
+* "Commercial use" means use of a name in a product or other for-profit\r
+* manner. It does NOT prevent a commercial firm from referring to the MIT\r
+* trademarks in order to convey information (although in doing so,\r
+* recognition of their trademark status should be given).\r
+* $\r
+*/\r
+\r
+\r
+/*\r
+ * Lists implementation.\r
+ * \r
+ */\r
+\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include <memory.h>\r
+\r
+#include "CredentialsCache.h"\r
+#include "generic_lists.h"\r
+\r
+/**\r
+ * cci_generic_iterate_has_next()\r
+ *\r
+ * Purpose: Determine if an iterator has a next element\r
+ *\r
+ * Return: 1 if another element exists\r
+ * 0 if no additional elements exist\r
+ *\r
+ * Errors: None\r
+ *\r
+ */\r
+cc_int32 \r
+cci_generic_iterate_has_next(cc_generic_iterate_t *iterate) \r
+{\r
+ return ((iterate == NULL || iterate->next == NULL) ? 0 : 1);\r
+}\r
+\r
+/**\r
+ * cci_generic_iterate_next()\r
+ *\r
+ * Purpose: Retrieve the next element from an iterator and advance\r
+ * the iterator\r
+ *\r
+ * Return: non-NULL, the next element in the iterator\r
+ * NULL, the iterator list is empty or iterator is invalid\r
+ *\r
+ * Errors: ccErrBadParam\r
+ *\r
+ */\r
+cc_int32\r
+cci_generic_iterate_next(cc_generic_iterate_t *iterator, cc_generic_list_node_t** nodepp) \r
+{\r
+ cc_generic_list_node_t* ret;\r
+ \r
+ if (iterator == NULL || nodepp == NULL)\r
+ return ccErrBadParam;\r
+\r
+ ret = iterator->next;\r
+ if (iterator->next != NULL)\r
+ iterator->next = iterator->next->next;\r
+\r
+ *nodepp = ret;\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * cci_generic_list_new()\r
+ *\r
+ * Purpose: Allocate new generic list\r
+ *\r
+ * Return: non-NULL, an empty list\r
+ * NULL, failure\r
+ *\r
+ * Errors: ccErrNoMem\r
+ *\r
+ */\r
+cc_int32\r
+cci_generic_list_new(cc_generic_list_head_t ** listpp) \r
+{\r
+ cc_generic_list_head_t* ret = (cc_generic_list_head_t *)malloc(sizeof(cc_generic_list_head_t));\r
+ if (ret == NULL)\r
+ return ccErrNoMem;\r
+ \r
+ ret->type = generic;\r
+ ret->head = ret->tail = NULL;\r
+ *listpp = ret;\r
+\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * cci_generic_list_append()\r
+ *\r
+ * Purpose: Appends a new node containing a copy of 'len' bytes of 'data' \r
+ *\r
+ * Return: non-NULL, a pointer to the newly allocated node\r
+ * NULL, failure\r
+ *\r
+ * Errors: ccErrNoMem,ccErrBadParam\r
+ *\r
+ */\r
+cc_int32\r
+cci_generic_list_append(cc_generic_list_head_t *head, void *data, cc_uint32 len, cc_generic_list_node_t** nodepp) \r
+{\r
+ cc_generic_list_node_t* new_node;\r
+\r
+ if ( data == NULL || len == 0 )\r
+ return ccErrBadParam;\r
+\r
+ new_node = (cc_generic_list_node_t *)malloc(sizeof(cc_generic_list_node_t));\r
+ if (new_node == NULL)\r
+ return ccErrNoMem;\r
+\r
+ new_node->data = malloc(len);\r
+ if ( new_node->data == NULL ) {\r
+ free(new_node);\r
+ return ccErrNoMem; \r
+ }\r
+ \r
+ memcpy(new_node->data,data,len);\r
+ new_node->len = len;\r
+\r
+ if (head->head == NULL) { /*empty list*/\r
+ head->head = new_node;\r
+ head->tail = new_node;\r
+ new_node->next = new_node->prev = NULL;\r
+ } else {\r
+ new_node->prev = head->tail;\r
+ head->tail->next = new_node;\r
+ head->tail = new_node;\r
+ new_node->next = NULL;\r
+ }\r
+ if (nodepp != NULL)\r
+ *nodepp = new_node;\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * cci_generic_list_prepend()\r
+ *\r
+ * Purpose: Prepends a new node containing a copy of 'len' bytes of 'data'\r
+ *\r
+ * Return: non-NULL, a pointer to the newly allocated node\r
+ * NULL, failure\r
+ *\r
+ * Errors: ccErrNoMem, ccErrBadParam\r
+ *\r
+ */\r
+cc_int32 \r
+cci_generic_list_prepend(cc_generic_list_head_t *head, void *data, cc_uint32 len, cc_generic_list_node_t** nodepp) \r
+{\r
+ cc_generic_list_node_t* new_node;\r
+\r
+ if ( data == NULL || len == 0 )\r
+ return ccErrBadParam;\r
+\r
+ new_node = (cc_generic_list_node_t *)malloc(sizeof(cc_generic_list_node_t));\r
+ if (new_node == NULL)\r
+ return ccErrNoMem;\r
+\r
+ new_node->data = malloc(len);\r
+ if ( new_node->data == NULL ) {\r
+ free(new_node);\r
+ return ccErrNoMem;\r
+ }\r
+ \r
+ memcpy(new_node->data,data,len);\r
+ new_node->len = len;\r
+ \r
+ if (head->head == NULL) { /*empty list*/\r
+ head->head = new_node;\r
+ head->tail = new_node;\r
+ new_node->prev = new_node->next = NULL;\r
+ } else {\r
+ new_node->next = head->head;\r
+ head->head->prev = new_node;\r
+ new_node->prev = NULL;\r
+ head->head = new_node;\r
+ }\r
+\r
+ if (nodepp != NULL)\r
+ *nodepp = new_node;\r
+\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * cci_generic_list_remove_element()\r
+ *\r
+ * Purpose: Remove a node from the list\r
+ *\r
+ * Return: 0, success\r
+ * -1, failure\r
+ *\r
+ * Errors: ccErrBadParam\r
+ *\r
+ */\r
+cc_int32 \r
+cci_generic_list_remove_element(cc_generic_list_head_t* head, cc_generic_list_node_t* rem) \r
+{\r
+ if (head->head == NULL || rem == NULL)\r
+ return ccErrBadParam;\r
+\r
+ if (head->head == rem && head->tail == rem) { /*removing only element of list*/\r
+ head->head = head->tail = NULL;\r
+ } else if (head->head == rem) { /*removing head*/\r
+ head->head = head->head->next;\r
+ } else if (head->tail == rem) { /*removing tail*/\r
+ head->tail = head->tail->prev;\r
+ head->tail->next = NULL;\r
+ } else {\r
+ rem->prev->next = rem->next;\r
+ rem->next->prev = rem->prev;\r
+ }\r
+ free(rem);\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * cci_generic_free_element()\r
+ *\r
+ * Purpose: Free the memory associated with a node\r
+ *\r
+ * Return: 0, success\r
+ * -1, failure\r
+ *\r
+ * Errors: ccErrBadParam\r
+ *\r
+ */\r
+cc_int32\r
+cci_generic_free_element(cc_generic_list_node_t* node)\r
+{\r
+ if ( node == NULL )\r
+ return ccErrBadParam;\r
+\r
+ if ( node->data ) {\r
+ free(node->data);\r
+ node->data = NULL;\r
+ }\r
+ node->len = 0;\r
+ node->next = node->prev = NULL;\r
+ free(node);\r
+ return ccNoError;\r
+}\r
+\r
+\r
+/**\r
+ * cci_generic_list_destroy()\r
+ *\r
+ * Purpose: Deallocate a list and all of its contents\r
+ *\r
+ * Return: 0, success\r
+ * -1, failure\r
+ *\r
+ * Errors: ccErrBadParam\r
+ */\r
+cc_int32\r
+cci_generic_list_destroy(cc_generic_list_head_t* head) \r
+{\r
+ cc_generic_list_node_t *cur, *next;\r
+ cc_int32 ret = ccNoError;\r
+\r
+ if ( head == NULL )\r
+ return ccErrBadParam;\r
+ \r
+ for (cur = head->head; ret == ccNoError && cur != NULL; cur = next) {\r
+ next = cur->next;\r
+ ret = cci_generic_free_element(cur);\r
+ } \r
+ free(head);\r
+ return(ret);\r
+}\r
+\r
+/**\r
+ * cci_generic_list_copy()\r
+ *\r
+ * Purpose: Copy a list\r
+ *\r
+ * Return: non-NULL, a new list\r
+ * NULL, failure\r
+ *\r
+ * Errors: ccErrBadParam, ccErrNoMem\r
+ *\r
+ */\r
+cc_int32\r
+cci_generic_list_copy(cc_generic_list_head_t* head, cc_generic_list_head_t** headpp) \r
+{\r
+ cc_generic_list_head_t* copy;\r
+ cc_generic_list_node_t *src_node, *dst_node;\r
+ cc_int32 code;\r
+\r
+ if (head == NULL || headpp == NULL)\r
+ return ccErrBadParam;\r
+\r
+ code = cci_generic_list_new(©);\r
+ if (code != ccNoError)\r
+ return code;\r
+\r
+ for (src_node = head->head; src_node != NULL; src_node = src_node->next) {\r
+ code = cci_generic_list_append(copy, src_node->data, src_node->len, &dst_node);\r
+ if (code != ccNoError) {\r
+ cci_generic_list_destroy(copy);\r
+ return code;\r
+ }\r
+ }\r
+ *headpp = copy;\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * cci_generic_list_iterator()\r
+ *\r
+ * Purpose: Allocate an iterator for the specified list\r
+ *\r
+ * Return: non-NULL, an iterator\r
+ * NULL, failure\r
+ *\r
+ * Errors: ccErrNoMem\r
+ *\r
+ */\r
+cc_int32\r
+cci_generic_list_iterator(cc_generic_list_head_t *head, cc_generic_iterate_t** headpp) \r
+{\r
+ cc_generic_iterate_t* iterator;\r
+\r
+ if ( head == NULL || headpp == NULL )\r
+ return ccErrBadParam;\r
+\r
+ iterator = (cc_generic_iterate_t*)malloc(sizeof(cc_generic_iterate_t));\r
+ if (iterator == NULL)\r
+ return ccErrNoMem;\r
+ \r
+ iterator->next = head->head;\r
+ *headpp = iterator;\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * cci_generic_free_iterator()\r
+ *\r
+ * Purpose: Deallocate memory associated with an iterator\r
+ *\r
+ * Return: 0, success\r
+ * -1, failure\r
+ *\r
+ * Errors: ccErrBadParam\r
+ *\r
+ */\r
+cc_int32\r
+cci_generic_free_iterator(cc_generic_iterate_t* iterator)\r
+{\r
+ if ( iterator == NULL )\r
+ return ccErrBadParam;\r
+\r
+ iterator->next = NULL;\r
+ free(iterator);\r
+ return ccNoError;\r
+}\r
+\r
+\r
+\r
--- /dev/null
+/* $Copyright:
+ *
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.
+ *
+ * All rights reserved.
+ *
+ * Export of this software from the United States of America may require a
+ * specific license from the United States Government. It is the
+ * responsibility of any person or organization contemplating export to
+ * obtain such a license before exporting.
+ *
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute
+ * this software and its documentation for any purpose and without fee is
+ * hereby granted, provided that the above copyright notice appear in all
+ * copies and that both that copyright notice and this permission notice
+ * appear in supporting documentation, and that the name of M.I.T. not be
+ * used in advertising or publicity pertaining to distribution of the
+ * software without specific, written prior permission. Furthermore if you
+ * modify this software you must label your software as modified software
+ * and not distribute it in such a fashion that it might be confused with
+ * the original MIT software. M.I.T. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+ * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * Individual source code files are copyright MIT, Cygnus Support,
+ * OpenVision, Oracle, Sun Soft, FundsXpress, and others.
+ *
+ * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,
+ * and Zephyr are trademarks of the Massachusetts Institute of Technology
+ * (MIT). No commercial use of these trademarks may be made without prior
+ * written permission of MIT.
+ *
+ * "Commercial use" means use of a name in a product or other for-profit
+ * manner. It does NOT prevent a commercial firm from referring to the MIT
+ * trademarks in order to convey information (although in doing so,
+ * recognition of their trademark status should be given).
+ * $
+ */
+
+import "mig_types.h";
+
+#include <mach/std_types.defs>
+#include <mach/mach_types.defs>
+
+subsystem ccapi 128;
+
+type msg_request_t = array [] of char;
+type msg_reply_t = array [] of char;
+type msg_error_t = int32;
+
+routine ccapi_msg (in_server_port : mach_port_t;
+ in_request : msg_request_t;
+ out out_reply : msg_reply_t;
+ out out_error : msg_error_t);
--- /dev/null
+/* $Copyright:
+*
+* Copyright 2004-2006 by the Massachusetts Institute of Technology.
+*
+* All rights reserved.
+*
+* Export of this software from the United States of America may require a
+* specific license from the United States Government. It is the
+* responsibility of any person or organization contemplating export to
+* obtain such a license before exporting.
+*
+* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute
+* this software and its documentation for any purpose and without fee is
+* hereby granted, provided that the above copyright notice appear in all
+* copies and that both that copyright notice and this permission notice
+* appear in supporting documentation, and that the name of M.I.T. not be
+* used in advertising or publicity pertaining to distribution of the
+* software without specific, written prior permission. Furthermore if you
+* modify this software you must label your software as modified software
+* and not distribute it in such a fashion that it might be confused with
+* the original MIT software. M.I.T. makes no representations about the
+* suitability of this software for any purpose. It is provided "as is"
+* without express or implied warranty.
+*
+* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
+* WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
+* MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+*
+* Individual source code files are copyright MIT, Cygnus Support,
+* OpenVision, Oracle, Sun Soft, FundsXpress, and others.
+*
+* Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,
+* and Zephyr are trademarks of the Massachusetts Institute of Technology
+* (MIT). No commercial use of these trademarks may be made without prior
+* written permission of MIT.
+*
+* "Commercial use" means use of a name in a product or other for-profit
+* manner. It does NOT prevent a commercial firm from referring to the MIT
+* trademarks in order to convey information (although in doing so,
+* recognition of their trademark status should be given).
+* $
+*/
+
+#include "CredentialsCache.h"
+
+typedef const char *msg_request_t;
+typedef char *msg_reply_t;
+typedef cc_int32 msg_error_t;
--- /dev/null
+/* $Copyright:\r
+ *\r
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.\r
+ * \r
+ * All rights reserved.\r
+ * \r
+ * Export of this software from the United States of America may require a\r
+ * specific license from the United States Government. It is the\r
+ * responsibility of any person or organization contemplating export to\r
+ * obtain such a license before exporting.\r
+ * \r
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute\r
+ * this software and its documentation for any purpose and without fee is\r
+ * hereby granted, provided that the above copyright notice appear in all\r
+ * copies and that both that copyright notice and this permission notice\r
+ * appear in supporting documentation, and that the name of M.I.T. not be\r
+ * used in advertising or publicity pertaining to distribution of the\r
+ * software without specific, written prior permission. Furthermore if you\r
+ * modify this software you must label your software as modified software\r
+ * and not distribute it in such a fashion that it might be confused with\r
+ * the original MIT software. M.I.T. makes no representations about the\r
+ * suitability of this software for any purpose. It is provided "as is"\r
+ * without express or implied warranty.\r
+ * \r
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED\r
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF\r
+ * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\r
+ * \r
+ * Individual source code files are copyright MIT, Cygnus Support,\r
+ * OpenVision, Oracle, Sun Soft, FundsXpress, and others.\r
+ * \r
+ * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,\r
+ * and Zephyr are trademarks of the Massachusetts Institute of Technology\r
+ * (MIT). No commercial use of these trademarks may be made without prior\r
+ * written permission of MIT.\r
+ * \r
+ * "Commercial use" means use of a name in a product or other for-profit\r
+ * manner. It does NOT prevent a commercial firm from referring to the MIT\r
+ * trademarks in order to convey information (although in doing so,\r
+ * recognition of their trademark status should be given).\r
+ * $\r
+ */\r
+\r
+/* marshall.c */\r
+\r
+#include <stdlib.h>\r
+#include <stdio.h>\r
+#include <string.h>\r
+#include <CredentialsCache.h>\r
+#include "msg.h"\r
+#include "msg_headers.h"\r
+#include "marshall.h"\r
+\r
+cc_int32\r
+cci_creds_v4_marshall( cc_credentials_v4_t * creds, \r
+ char ** pflat, \r
+ cc_uint32 * plen)\r
+{\r
+ cc_uint32 len;\r
+ char * flat;\r
+ cci_flat_creds_v4_t * header;\r
+ cc_time64 t64;\r
+\r
+ if ( creds == NULL || pflat == NULL || plen == NULL )\r
+ return ccErrBadParam;\r
+\r
+ len = sizeof(cci_flat_creds_v4_t);\r
+ flat = (char *)malloc(len);\r
+ if ( flat == NULL )\r
+ return ccErrNoMem;\r
+ memset(flat, 0, len);\r
+\r
+ header = (cci_flat_creds_v4_t *)flat;\r
+ header->version = htonl(creds->version);\r
+ memcpy(header->principal, creds->principal, cc_v4_name_size);\r
+ memcpy(header->principal_instance, creds->principal_instance, cc_v4_instance_size);\r
+ memcpy(header->service, creds->service, cc_v4_name_size);\r
+ memcpy(header->service_instance, creds->service_instance, cc_v4_instance_size);\r
+ memcpy(header->realm, creds->realm, cc_v4_realm_size);\r
+ memcpy(header->session_key, creds->session_key, cc_v4_key_size);\r
+ header->kvno = htonl(creds->kvno);\r
+ header->string_to_key_type = htonl(creds->string_to_key_type);\r
+ t64 = creds->issue_date;\r
+ header->issue_date = htonll(t64);\r
+ header->lifetime = htonl(creds->lifetime);\r
+ /* TODO: verify that address is stored in host order */\r
+ header->address = htonl(creds->address);\r
+ header->ticket_size = htonl(creds->ticket_size);\r
+ memcpy(header->ticket, creds->ticket, cc_v4_ticket_size);\r
+\r
+ *pflat = flat;\r
+ *plen = len;\r
+\r
+ return ccNoError; \r
+}\r
+\r
+cc_int32\r
+cci_creds_v4_unmarshall( char * flat, \r
+ cc_uint32 len,\r
+ cc_credentials_union * creds_union)\r
+{\r
+ struct cci_flat_creds_v4 * header;\r
+ cc_credentials_v4_t * creds;\r
+ cc_time64 t64;\r
+\r
+ if ( flat == NULL || len == 0 || creds_union == NULL )\r
+ return ccErrBadParam;\r
+\r
+ creds_union->version = cc_credentials_v4;\r
+\r
+ header = (cci_flat_creds_v4_t *)flat;\r
+\r
+ creds = (cc_credentials_v4_t *)malloc(sizeof(cc_credentials_v4_t));\r
+ if ( creds == NULL )\r
+ return ccErrNoMem;\r
+\r
+ creds->version = ntohl(header->version);\r
+ memcpy(creds->principal, header->principal, cc_v4_name_size);\r
+ memcpy(creds->principal_instance, header->principal_instance, cc_v4_instance_size);\r
+ memcpy(creds->service, header->service, cc_v4_name_size);\r
+ memcpy(creds->service_instance, header->service_instance, cc_v4_instance_size);\r
+ memcpy(creds->realm, header->realm, cc_v4_realm_size);\r
+ memcpy(creds->session_key, header->session_key, cc_v4_key_size);\r
+ creds->kvno = htonl(header->kvno);\r
+ creds->string_to_key_type = htonl(header->string_to_key_type);\r
+ t64 = header->issue_date;\r
+ creds->issue_date = (cc_time64)ntohll(t64);\r
+ creds->lifetime = (cc_int32)ntohl(header->lifetime);\r
+ /* TODO: verify that address is stored in host order */\r
+ creds->address = ntohl(header->address);\r
+ creds->ticket_size = ntohl(header->ticket_size);\r
+ memcpy(creds->ticket, header->ticket, cc_v4_ticket_size);\r
+\r
+ creds_union->credentials.credentials_v4 = creds;\r
+\r
+ return ccNoError;\r
+}\r
+\r
+\r
+cc_int32\r
+cci_creds_cc_data_array_count_entries( cc_data ** array, cc_uint32 * pcount)\r
+{\r
+ cc_uint32 count;\r
+\r
+ if (array == NULL) {\r
+ *pcount = 0;\r
+ return ccNoError;\r
+ }\r
+\r
+ for ( count=0; array[count] != NULL ; count++) ;\r
+\r
+ *pcount = count;\r
+ return ccNoError;\r
+}\r
+\r
+cc_int32\r
+cci_creds_v5_compute_flat_size( cc_credentials_v5_t * creds, cc_uint32 * plen)\r
+{\r
+ cc_uint32 len;\r
+ cc_uint32 i, count;\r
+\r
+ len = sizeof(struct cci_flat_creds_v5);\r
+\r
+ if (creds->client)\r
+ len += strlen(creds->client) + 1;\r
+\r
+ if (creds->server)\r
+ len += strlen(creds->server) + 1;\r
+\r
+ len += creds->keyblock.length;\r
+\r
+ cci_creds_cc_data_array_count_entries( creds->addresses, &count );\r
+ len += count * sizeof(cc_flat_data);\r
+ for ( i=0; i<count; i++ ) {\r
+ len += creds->addresses[i]->length;\r
+ }\r
+\r
+ len += creds->ticket.length;\r
+ len += creds->second_ticket.length;\r
+\r
+ cci_creds_cc_data_array_count_entries( creds->authdata, &count );\r
+ len += count * sizeof(cc_flat_data);\r
+ for ( i=0; i<count; i++ ) {\r
+ len += creds->authdata[i]->length;\r
+ }\r
+\r
+ *plen = len;\r
+ return ccNoError;\r
+}\r
+\r
+cc_int32\r
+cci_creds_v5_marshall( cc_credentials_v5_t * creds, \r
+ char ** pflat, \r
+ cc_uint32 * plen)\r
+{\r
+ cc_uint32 len;\r
+ char * flat;\r
+ struct cci_flat_creds_v5 * header;\r
+ cc_uint32 length;\r
+ cc_uint32 offset;\r
+ cc_time64 t64;\r
+ cc_uint32 count;\r
+ cc_uint32 i;\r
+\r
+ if ( creds == NULL || pflat == NULL || plen == NULL )\r
+ return ccErrBadParam;\r
+\r
+ cci_creds_v5_compute_flat_size(creds, &len);\r
+\r
+ flat = (char *)malloc(len);\r
+ if ( flat == NULL )\r
+ return ccErrNoMem;\r
+ memset(flat, 0, len);\r
+\r
+ offset = sizeof(struct cci_flat_creds_v5);\r
+ header = (struct cci_flat_creds_v5 *)flat;\r
+ header->version = htonl(FLAT_CREDS_V5_VERSION);\r
+ if (creds->client) {\r
+ length = strlen(creds->client) + 1;\r
+ header->client.length = htonl(length);\r
+ header->client.data = htonl(offset);\r
+ memcpy(flat + offset, creds->client, length);\r
+ offset += length;\r
+ }\r
+\r
+ if (creds->server) {\r
+ length = strlen(creds->server) + 1;\r
+ header->server.length = htonl(length);\r
+ header->server.data = htonl(offset);\r
+ memcpy(flat + offset, creds->server, length);\r
+ offset += length;\r
+ }\r
+\r
+ header->keyblock.type = htonl(creds->keyblock.type);\r
+ if (creds->keyblock.length) {\r
+ length = creds->keyblock.length;\r
+ header->keyblock.length = htonl(length);\r
+ header->keyblock.data = htonl(offset);\r
+ memcpy(flat + offset, creds->keyblock.data, length);\r
+ offset += length;\r
+ } \r
+\r
+ t64 = creds->authtime;\r
+ header->authtime = htonll(t64);\r
+ t64 = creds->starttime;\r
+ header->starttime = htonll(t64);\r
+ t64 = creds->endtime;\r
+ header->endtime = htonll(t64);\r
+ t64 = creds->renew_till;\r
+ header->renew_till = htonll(t64);\r
+\r
+ header->is_skey = htonl(creds->is_skey);\r
+ header->ticket_flags = htonl(creds->ticket_flags);\r
+\r
+ cci_creds_cc_data_array_count_entries( creds->addresses, &count );\r
+ if ( count ) {\r
+ cc_flat_data * addresses = (cc_flat_data *)flat + offset;\r
+ header->address_count = htonl(count);\r
+ header->addresses = htonl(offset);\r
+ offset += count * sizeof(cc_flat_data);\r
+\r
+ for ( i=0; i < count; i++ ) {\r
+ addresses[i].type = htonl(creds->addresses[i]->type);\r
+ if (creds->addresses[i]->length) {\r
+ length = creds->addresses[i]->length;\r
+ addresses[i].length = htonl(length);\r
+ addresses[i].data = htonl(offset);\r
+ /* TODO: verify that addresses are stored in network order */\r
+ memcpy(flat + offset, creds->addresses[i]->data, length);\r
+ offset += length;\r
+ }\r
+ }\r
+ }\r
+\r
+ header->ticket.type = htonl(creds->ticket.type);\r
+ if (creds->ticket.length) {\r
+ length = creds->ticket.length;\r
+ header->ticket.length = htonl(length);\r
+ header->ticket.data = htonl(offset);\r
+ memcpy(flat + offset, creds->ticket.data, length);\r
+ offset += length;\r
+ } \r
+\r
+ header->second_ticket.type = htonl(creds->second_ticket.type);\r
+ if (creds->second_ticket.length) {\r
+ length = creds->second_ticket.length;\r
+ header->second_ticket.length = htonl(length);\r
+ header->second_ticket.data = htonl(offset);\r
+ memcpy(flat + offset, creds->second_ticket.data, length);\r
+ offset += length;\r
+ } \r
+\r
+ cci_creds_cc_data_array_count_entries( creds->authdata, &count );\r
+ if ( count ) {\r
+ cc_flat_data * authdata = (cc_flat_data *)flat + offset;\r
+\r
+ header->authdata_count = htonl(count);\r
+ header->authdata = (offset);\r
+ offset += count * sizeof(cc_flat_data);\r
+\r
+ for ( i=0; i < count; i++ ) {\r
+ authdata[i].type = htonl(creds->authdata[i]->type);\r
+ if (creds->authdata[i]->length) {\r
+ length = creds->authdata[i]->length;\r
+ authdata[i].length = htonl(length);\r
+ authdata[i].data = htonl(offset);\r
+ memcpy(flat + offset, creds->authdata[i]->data, length);\r
+ offset += length;\r
+ }\r
+ }\r
+ }\r
+\r
+ *pflat = flat;\r
+ *plen = len;\r
+ return ccNoError;\r
+}\r
+\r
+\r
+// TODO: a much better job of checking for out of memory errors\r
+// and validating that we do not read beyond the flat input\r
+// data buffer\r
+\r
+cc_int32\r
+cci_creds_v5_unmarshall( char * flat, \r
+ cc_uint32 len,\r
+ cc_credentials_union * creds_union)\r
+{\r
+ struct cci_flat_creds_v5 * header;\r
+ cc_credentials_v5_t * creds;\r
+ cc_flat_data * flat_data;\r
+ cc_time64 t64;\r
+ cc_uint32 length;\r
+ cc_uint32 count;\r
+ cc_uint32 i;\r
+\r
+ if ( flat == NULL || len == 0 || creds_union == NULL )\r
+ return ccErrBadParam;\r
+\r
+ creds_union->version = cc_credentials_v5;\r
+\r
+ header = (struct cci_flat_creds_v5 *)flat;\r
+\r
+ if ( ntohl(header->version) != FLAT_CREDS_V5_VERSION )\r
+ return ccErrBadParam;\r
+\r
+ creds = (cc_credentials_v5_t *)malloc(sizeof(cc_credentials_v5_t));\r
+ if ( creds == NULL )\r
+ return ccErrNoMem;\r
+ memset(creds, 0, sizeof(cc_credentials_v5_t));\r
+\r
+ if ( header->client.length ) {\r
+ length = ntohl(header->client.length);\r
+ creds->client = (char *)malloc(length);\r
+ memcpy(creds->client, flat + header->client.data, length);\r
+ }\r
+\r
+ if ( header->server.length ) {\r
+ length = ntohl(header->server.length);\r
+ creds->server = (char *)malloc(length);\r
+ memcpy(creds->server, flat + header->server.data, length);\r
+ }\r
+\r
+ creds->keyblock.type = ntohl(header->keyblock.type);\r
+ if ( header->keyblock.length ) {\r
+ length = ntohl(header->keyblock.length);\r
+ creds->keyblock.length = length;\r
+ creds->keyblock.data = malloc(length);\r
+ memcpy(creds->keyblock.data, flat + header->keyblock.data, length);\r
+ }\r
+\r
+ /* TODO: need to perform overflow validation checks to ensure\r
+ * that we do not attempt to store too large a value into cc_time_t\r
+ * when it is a 32-bit field.\r
+ */\r
+ t64 = ntohll(header->authtime);\r
+ creds->authtime = (cc_time)t64;\r
+ t64 = ntohll(header->starttime);\r
+ creds->starttime = (cc_time)t64;\r
+ t64 = ntohll(header->endtime);\r
+ creds->endtime = (cc_time)t64;\r
+ t64 = ntohll(header->renew_till);\r
+ creds->renew_till = (cc_time)t64;\r
+\r
+ creds->is_skey = ntohl(header->is_skey);\r
+ creds->ticket_flags = ntohl(header->ticket_flags);\r
+\r
+ count = ntohl(header->address_count);\r
+ creds->addresses = (cc_data **) malloc((count + 1) * sizeof(cc_data *));\r
+ flat_data = (cc_flat_data *)flat + header->addresses;\r
+ for ( i=0 ; i < count ; i++ ) {\r
+ creds->addresses[i] = (cc_data *)malloc(sizeof(cc_data));\r
+ creds->addresses[i]->type = ntohl(flat_data[i].type);\r
+ length = ntohl(flat_data[i].length);\r
+ creds->addresses[i]->length = length;\r
+ if ( length ) {\r
+ creds->addresses[i]->data = malloc(length);\r
+ /* TODO: verify that addresses are stored in network order */\r
+ memcpy(creds->addresses[i]->data, flat + flat_data[i].data, length);\r
+ } else {\r
+ creds->addresses[i]->data = NULL;\r
+ }\r
+ }\r
+ creds->addresses[i] = NULL;\r
+\r
+ creds->ticket.type = ntohl(header->ticket.type);\r
+ length = ntohl(header->ticket.length);\r
+ if ( length ) {\r
+ creds->ticket.length = length;\r
+ creds->ticket.data = malloc(length);\r
+ memcpy(creds->ticket.data, flat + header->ticket.data, length);\r
+ }\r
+\r
+ creds->second_ticket.type = header->second_ticket.type;\r
+ if ( header->second_ticket.length ) {\r
+ creds->second_ticket.length = header->second_ticket.length;\r
+ creds->second_ticket.data = malloc(creds->second_ticket.length);\r
+ memcpy(creds->second_ticket.data, flat + header->second_ticket.data, creds->second_ticket.length);\r
+ }\r
+\r
+ count = ntohl(header->authdata_count);\r
+ creds->authdata = (cc_data **) malloc((count + 1) * sizeof(cc_data *));\r
+ flat_data = (cc_flat_data *)flat + header->authdata;\r
+ for ( i=0 ; i < count ; i++ ) {\r
+ creds->authdata[i] = (cc_data *)malloc(sizeof(cc_data));\r
+ creds->authdata[i]->type = ntohl(flat_data[i].type);\r
+ length = ntohl(flat_data[i].length);\r
+ creds->authdata[i]->length = length;\r
+ if ( length ) {\r
+ creds->authdata[i]->data = malloc(length);\r
+ memcpy(creds->authdata[i]->data, flat + flat_data[i].data, length);\r
+ } else {\r
+ creds->authdata[i]->data = NULL;\r
+ }\r
+ }\r
+ creds->authdata[i] = NULL;\r
+\r
+ creds_union->credentials.credentials_v5 = creds;\r
+\r
+ return ccNoError;\r
+}\r
+\r
-/* $Copyright:
- *
- * Copyright 2004 by the Massachusetts Institute of Technology.
- *
- * All rights reserved.
- *
- * Export of this software from the United States of America may require a
- * specific license from the United States Government. It is the
- * responsibility of any person or organization contemplating export to
- * obtain such a license before exporting.
- *
- * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute
- * this software and its documentation for any purpose and without fee is
- * hereby granted, provided that the above copyright notice appear in all
- * copies and that both that copyright notice and this permission notice
- * appear in supporting documentation, and that the name of M.I.T. not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. Furthermore if you
- * modify this software you must label your software as modified software
- * and not distribute it in such a fashion that it might be confused with
- * the original MIT software. M.I.T. makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Individual source code files are copyright MIT, Cygnus Support,
- * OpenVision, Oracle, Sun Soft, FundsXpress, and others.
- *
- * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,
- * and Zephyr are trademarks of the Massachusetts Institute of Technology
- * (MIT). No commercial use of these trademarks may be made without prior
- * written permission of MIT.
- *
- * "Commercial use" means use of a name in a product or other for-profit
- * manner. It does NOT prevent a commercial firm from referring to the MIT
- * trademarks in order to convey information (although in doing so,
- * recognition of their trademark status should be given).
- * $
- */
-
-/*
- * Verifiable, extensible message format.
- */
-
-#include "CredentialsCache.h"
-#include "msg.h"
-#include "datastore.h"
-
-#include <stdlib.h>
-#include <memory.h>
-#include <stdio.h>
-#include <string.h>
-
-/**
- * cci_msg_new()
- *
- * Purpose: Allocate and initialize a new cc_msg_t structure
- *
- * Return: non-NULL, the msg
- * NULL, failure
- *
- * Errors: ccErrNoMem
- *
- */
-cc_int32
-cci_msg_new(cc_uint32 type, cc_msg_t** msgpp)
-{
- // type should be validated. If invalid set error to ccErrBadParam
- cc_msg_t* msg;
-
- if ( type > CC_MSG_MAX_TYPE || msgpp == NULL )
- return ccErrBadParam;
-
- msg = (cc_msg_t*)malloc(sizeof(cc_msg_t));
- if (msg == NULL)
- return ccErrNoMem;
-
- msg->type = type;
- msg->flat = NULL;
- msg->header = NULL;
- msg->flat_len = 0;
- msg->header_len = 0;
- msg->magic = 0;
- cci_generic_list_new(&msg->data_blobs);
- if (msg->data_blobs == NULL) {
- // pass on error from previous call
- free(msg);
- return ccErrNoMem;
- }
-
- *msgpp = msg;
- return ccNoError;
-}
-
-/**
- * cci_msg_calc_header_size()
- *
- * Purpose: Calculates the size of the header
- *
- * Return: the size in bytes
- *
- * Errors: ccErrBadParam
- *
- */
-cc_int32
-cci_msg_calc_header_size(cc_msg_t* msg, cc_uint32 * lenp)
-{
- int header_len = 12; /* header size, entire size, type */
-
- if ( msg == NULL || lenp == NULL )
- return ccErrBadParam;
-
- header_len += msg->header_len;
- *lenp = header_len;
- return ccNoError;
-}
-
-/**
- * cci_msg_calc_size()
- *
- * Purpose: Calculates the size of the message
- * (does not include the magic bytes)
- *
- * Return: the size in bytes
- *
- * Errors: ccErrBadParam
- *
- */
-cc_int32
-cci_msg_calc_size(cc_msg_t* msg, cc_uint32 * lenp)
-{
- cc_uint32 flat_len;
- cc_generic_list_node_t* gen_node;
- cc_generic_iterate_t* gen_iterator;
- cc_int32 code;
-
- if ( msg == NULL || lenp == NULL )
- return ccErrBadParam;
-
- code = cci_msg_calc_header_size(msg, &flat_len);
- if (code != ccNoError)
- goto bad;
-
- code = cci_generic_list_iterator(msg->data_blobs, &gen_iterator);
- if ( code != ccNoError )
- goto bad;
-
- while (cci_generic_iterate_has_next(gen_iterator)) {
- code = cci_generic_iterate_next(gen_iterator, &gen_node);
- if (code != ccNoError)
- break;
- flat_len += gen_node->len + BLOB_LEN;
- }
- cci_generic_free_iterator(gen_iterator);
- if (code != ccNoError)
- goto bad;
-
- flat_len += MAGIC_HEAD_LEN + MAGIC_DATA_LEN;
- *lenp = flat_len;
-
- bad:
- return code;
-}
-
-/**
- * cci_msg_add_data_blob()
- *
- * Purpose: Adds 'len' bytes of data to the msg
- *
- * Return:
- *
- * Errors:
- *
- */
-cc_int32
-cci_msg_add_data_blob(cc_msg_t* msg, void *data, cc_uint32 len, cc_uint32 *lenp)
-{
- cc_int32 code;
-
- if (msg == NULL || data == NULL || len <= 0 || lenp == NULL)
- return ccErrBadParam;
-
- code = cci_generic_list_append(msg->data_blobs, data, len, NULL);
- if ( code != ccNoError )
- return code;
- return cci_msg_calc_blob_pos(msg, data, len, lenp);
-}
-
-/**
- * cc_msg_
- *
- * Purpose:
- *
- * Return:
- *
- * Errors:
- *
- */
-cc_int32
-cci_msg_calc_blob_pos(cc_msg_t* msg, void *data, cc_uint32 len, cc_uint32 * posp)
-{
- cc_uint32 pos;
- cc_generic_list_node_t* gen_node;
- cc_generic_iterate_t* gen_iterator;
- cc_int32 code;
-
- code = cci_msg_calc_header_size(msg, &pos);
- pos += sizeof(cc_uint32); /*+ sizeof(cc_uint32) for magic*/
-
- code = cci_generic_list_iterator(msg->data_blobs, &gen_iterator);
- while (cci_generic_iterate_has_next(gen_iterator)) {
- code = cci_generic_iterate_next(gen_iterator, &gen_node);
- if (gen_node->len != len && gen_node->data != data) {
- pos += gen_node->len + sizeof(cc_uint32);
- } else {
- cci_generic_free_iterator(gen_iterator);
- *posp = pos + sizeof(cc_uint32);
- return ccNoError;
- }
- }
-
- cci_generic_free_iterator(gen_iterator);
- return ccIteratorEnd;
-}
-
-/**
- * cc_msg_
- *
- * Purpose:
- *
- * Return:
- *
- * Errors:
- *
- */
-cc_int32
-cci_msg_add_header(cc_msg_t* msg, void *header, cc_uint32 header_len)
-{
- if ( msg == NULL || header == NULL )
- return ccErrBadParam;
-
- msg->header = header;
- msg->header_len = header_len;
- return ccNoError;
-}
-
-
-/**
- * cc_msg_
- *
- * Purpose:
- *
- * Return:
- *
- * Errors:
- *
- */
-cc_int32
-cci_msg_flatten(cc_msg_t* msg, void **flatpp)
-{
- cc_generic_list_node_t* gen_node;
- cc_generic_iterate_t* gen_iterator;
- char *cur_pos;
- cc_uint32 zero = 0;
- cc_uint32 magic = 0;
- cc_uint32 msg_len;
- cc_int32 code;
-
- if (msg == NULL || flatpp == NULL)
- return ccErrBadParam;
-
- code = cci_msg_calc_size(msg,&msg->flat_len);
- if ( code != ccNoError )
- return code;
-
- if (msg->flat_len > CC_MSG_MAX_SIZE)
- return ccErrBadParam;
-
- msg->flat = (void *)malloc(msg->flat_len);
- if (msg->flat == NULL)
- return ccErrNoMem;
-
- cur_pos = msg->flat;
-
- memcpy(cur_pos,&msg->header_len,sizeof(cc_uint32));
- cur_pos+=sizeof(cc_uint32);
-
- memcpy(cur_pos,&msg->flat_len,sizeof(cc_uint32));
- cur_pos+=sizeof(cc_uint32);
-
- memcpy(cur_pos,&msg->type,sizeof(cc_uint32));
- cur_pos+=sizeof(cc_uint32);
-
- memcpy(cur_pos, msg->header, msg->header_len);
- cur_pos += msg->header_len;
-
- memcpy(cur_pos, &zero, sizeof(cc_uint32)); /*will be magic number later*/
- cur_pos += sizeof(cc_uint32);
-
- code = cci_generic_list_iterator(msg->data_blobs,&gen_iterator);
- if ( code != ccNoError ) {
- free(msg->flat);
- return code;
- }
-
- while (cci_generic_iterate_has_next(gen_iterator)) {
- code = cci_generic_iterate_next(gen_iterator, &gen_node);
- if (code != ccNoError) {
- free(gen_iterator);
- free(msg->flat);
- return code;
- }
- memcpy(cur_pos, &gen_node->len, sizeof(cc_uint32));
- cur_pos+=sizeof(cc_uint32);
-
- memcpy(cur_pos, gen_node->data, gen_node->len);
- cur_pos += gen_node->len;
- }
- free(gen_iterator);
-
- memcpy(cur_pos, &zero, sizeof(cc_uint32)); /*magic number will go here later*/
- cur_pos += sizeof(cc_uint32);
-
- if (cur_pos - (char *)msg->flat != msg->flat_len) {
- printf("ERRORR cur_pos - msg->flat = %d\n",msg->flat_len);
- }
-
- cci_msg_calc_magic(msg->flat, msg->flat_len, &magic);
- printf("magic = %d\n",magic);
-
- cci_msg_calc_header_size(msg, &msg_len);
- memcpy((char *)msg->flat + msg_len, &magic, sizeof(cc_uint32));
- memcpy((char *)msg->flat + msg->flat_len - sizeof(cc_uint32), &magic, sizeof(cc_uint32));
-
- if ( flatpp != NULL )
- *flatpp = msg->flat;
- return ccNoError;
-}
-
-/**
- * cc_msg_
- *
- * Purpose:
- *
- * Return:
- *
- * Errors:
- *
- */
-cc_int32
-cci_msg_calc_magic(void *flat, int flat_len, cc_uint32 * magicp)
-{
- cc_uint32 magic = 0;
- int i;
-
- for (i = 0; i < flat_len; i += sizeof(cc_uint32)) {
- magic = magic ^ *(int *)((char *)flat + i);
- }
- *magicp = magic;
- return ccNoError;
-}
-
-/**
- * cc_msg_
- *
- * Purpose:
- *
- * Return:
- *
- * Errors:
- *
- */
-cc_int32
-cci_msg_verify(void *flat, int flat_len, cc_uint32 * validp)
-{
- cc_uint32 *magic1, *magic2;
- cc_uint32 *pheader_len;
- cc_uint32 *ptotal_len;
- cc_uint32 *pblob_len;
- cc_uint32 *ptype;
- cc_uint32 num_blobs = 0;
- cc_uint32 zero = 0;
- cc_uint32 msg_magic, msg_magic2;
-
- if (flat == NULL || flat_len <= 0 || validp == NULL)
- return ccErrBadParam;
-
- pheader_len = flat;
- ptotal_len = (cc_uint32 *)((char *)pheader_len + sizeof(cc_uint32));
- ptype = (cc_uint32 *)((char *)ptotal_len + sizeof(cc_uint32));
-
- if (*ptotal_len != flat_len) {
- *validp = 0;
- return ccNoError;
- }
-
- if (*pheader_len > flat_len) {
- /*too weak. We could verify header_len against type spec header.*/
- *validp = 0;
- return ccNoError;
- }
- if (*ptype > CC_MSG_MAX_TYPE) {
- *validp = 0;
- return ccNoError;
- }
-
- magic1 = (cc_uint32 *)((char *)ptype + sizeof(cc_uint32) + *pheader_len);
- if ((char *)magic1 - (char *)flat == (flat_len - 8)) {
- /*There are no data blobs*/
- magic2 = (cc_uint32 *)((char *)magic1 + sizeof(cc_uint32));
- num_blobs = 0;
- } else {
- pblob_len = (cc_uint32 *)((char *)magic1 + sizeof(cc_uint32));
- num_blobs = 1;
-
- while (*pblob_len + sizeof(cc_uint32) + ((char *)pblob_len - (char *)flat) < (flat_len - sizeof(cc_uint32))) {
- pblob_len = (cc_uint32 *)((char *)pblob_len + *pblob_len + sizeof(cc_uint32));
- num_blobs++;
- }
-
- if (*pblob_len + sizeof(cc_uint32) + ((char *)pblob_len - (char *)flat) != (flat_len - sizeof(cc_uint32))) {
- /*blobs didn't line up*/
- *validp = 0;
- return ccNoError;
- }
- magic2 = (cc_uint32 *)((char *)pblob_len + *pblob_len + sizeof(cc_uint32)); /*2nd magic should be directly after the last blob*/
- }
-
- if (*magic1 != *magic2) {
- *validp = 0;
- return ccNoError;
- }
- msg_magic = *magic1;
-
- printf("%d %d\n", (char *)magic1 - (char *)flat, (char *)magic2 - (char *)flat);
-
- memcpy(magic1, &zero, sizeof(cc_uint32));
- memcpy(magic2, &zero, sizeof(cc_uint32));
- cci_msg_calc_magic(flat, flat_len, &msg_magic2);
- if (msg_magic != msg_magic2) {
- *validp = 0;
- return ccNoError;
- }
- memcpy(magic1, &msg_magic, sizeof(cc_uint32));
- memcpy(magic2, &msg_magic, sizeof(cc_uint32));
-
- *validp = 1;
- return ccNoError;
-}
-
-/**
- * cc_msg_
- *
- * Purpose:
- *
- * Return:
- *
- * Errors:
- *
- */
-cc_int32
-cci_msg_unflatten(void *flat, int flat_len, cc_msg_t** msgpp)
-{
- cc_msg_t* msg;
- char *cur_pos;
- cc_uint32 blob_len;
- char *blob;
- cc_uint32 valid;
- cc_int32 code;
-
- if ( flat == NULL || flat_len <= 0 || msgpp == NULL )
- return ccErrBadParam;
-
- code = cci_msg_new(0, &msg);
- if (code)
- return code;
-
- cci_msg_verify(flat, flat_len, &valid);
- if (valid != 1) {
- cci_msg_destroy(msg);
- return ccErrBadParam;
- }
-
- cur_pos = flat;
- msg->flat = flat;
-
- msg->header_len = *(cc_uint32 *)cur_pos;
- cur_pos += sizeof(cc_uint32);
-
- msg->flat_len = *(cc_uint32 *)cur_pos;
- cur_pos += sizeof(cc_uint32);
-
- msg->type = *(cc_uint32 *)cur_pos;
- cur_pos += sizeof(cc_uint32);
-
- msg->header = (void *)malloc(msg->header_len);
- if (msg->header == NULL) {
- cci_msg_destroy(msg);
- return ccErrNoMem;
- }
- memcpy(msg->header, cur_pos, msg->header_len);
- cur_pos += msg->header_len;
-
- msg->magic = *(cc_uint32 *)cur_pos;
- cur_pos += sizeof(cc_uint32);
-
- if (cur_pos - (char *)flat != flat_len - 8) { /*at least 1 blob*/
- blob_len = *(cc_uint32 *)cur_pos;
- while (blob_len + (cur_pos - (char *)flat) + sizeof(cc_uint32) <= flat_len - sizeof(cc_uint32)) {
- blob = (void *)malloc(blob_len);
- if (blob == NULL) {
- cci_msg_destroy(msg);
- return ccErrNoMem;
- }
- memcpy(blob, cur_pos + sizeof(cc_uint32), blob_len);
- cci_generic_list_append(msg->data_blobs, blob, blob_len, NULL);
-
- cur_pos += sizeof(cc_uint32) + blob_len;
- blob_len = *(int *)cur_pos;
- }
- }
- *msgpp = msg;
- return ccNoError;
-}
-
-cc_int32
-cci_msg_retrieve_blob(cc_msg_t* msg, cc_uint32 blob_offset, cc_uint32 blob_len, void **blobp)
-{
- cc_generic_iterate_t* gen_iterator;
- cc_generic_list_node_t* gen_node;
- void *ret;
- cc_uint32 blob_pos;
- cc_int32 code;
-
- /*Ensure that the message has been unflattened*/
- if ( msg == NULL || msg->flat == NULL || blob_offset > msg->flat_len ||
- blob_len > msg->flat_len - blob_offset || blobp == NULL)
- return ccErrBadParam;
-
- code = cci_generic_list_iterator(msg->data_blobs, &gen_iterator);
- while (cci_generic_iterate_has_next(gen_iterator)) {
- code = cci_generic_iterate_next(gen_iterator, &gen_node);
- code = cci_msg_calc_blob_pos(msg, gen_node->data, gen_node->len, &blob_pos);
- if (blob_pos == blob_offset && gen_node->len == blob_len) {
- free(gen_iterator);
- ret = (void *)malloc(blob_len);
- if (ret == NULL)
- return ccErrNoMem;
- memcpy(ret,(char *)msg->flat + blob_offset, blob_len);
- *blobp = ret;
- return ccNoError;
- }
- }
- free(gen_iterator);
- return ccIteratorEnd;
-}
-
-/**
- * cc_msg_
- *
- * Purpose:
- *
- * Return:
- *
- * Errors:
- *
- */
-cc_int32
-cci_msg_destroy(cc_msg_t* msg)
-{
- if (msg->flat != NULL)
- free(msg->flat);
- if (msg->header != NULL)
- free(msg->flat);
- cci_generic_list_destroy(msg->data_blobs);
- free(msg);
- return ccNoError;
-}
-
+/* $Copyright:\r
+ *\r
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.\r
+ * \r
+ * All rights reserved.\r
+ * \r
+ * Export of this software from the United States of America may require a\r
+ * specific license from the United States Government. It is the\r
+ * responsibility of any person or organization contemplating export to\r
+ * obtain such a license before exporting.\r
+ * \r
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute\r
+ * this software and its documentation for any purpose and without fee is\r
+ * hereby granted, provided that the above copyright notice appear in all\r
+ * copies and that both that copyright notice and this permission notice\r
+ * appear in supporting documentation, and that the name of M.I.T. not be\r
+ * used in advertising or publicity pertaining to distribution of the\r
+ * software without specific, written prior permission. Furthermore if you\r
+ * modify this software you must label your software as modified software\r
+ * and not distribute it in such a fashion that it might be confused with\r
+ * the original MIT software. M.I.T. makes no representations about the\r
+ * suitability of this software for any purpose. It is provided "as is"\r
+ * without express or implied warranty.\r
+ * \r
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED\r
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF\r
+ * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\r
+ * \r
+ * Individual source code files are copyright MIT, Cygnus Support,\r
+ * OpenVision, Oracle, Sun Soft, FundsXpress, and others.\r
+ * \r
+ * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,\r
+ * and Zephyr are trademarks of the Massachusetts Institute of Technology\r
+ * (MIT). No commercial use of these trademarks may be made without prior\r
+ * written permission of MIT.\r
+ * \r
+ * "Commercial use" means use of a name in a product or other for-profit\r
+ * manner. It does NOT prevent a commercial firm from referring to the MIT\r
+ * trademarks in order to convey information (although in doing so,\r
+ * recognition of their trademark status should be given).\r
+ * $\r
+ */\r
+\r
+/*\r
+ * Verifiable, extensible message format.\r
+ *\r
+ * Format:\r
+ * <size of header block (header_len)>\r
+ * <size of *entire* message, including previous field (flat_len)>\r
+ * <message type (type)>\r
+ * <type specific header (header)>\r
+ * <magic number (magic)>\r
+ * <data blob 1 length>\r
+ * <data blob 1>\r
+ * <data blob 2 length>\r
+ * <data blob 2>\r
+ * ...\r
+ * <magic number (magic)>\r
+ *\r
+ * If the header has variable length data it is included in the data blobs. \r
+ * The header field has the offset from the beginning of the message of the 1st \r
+ * byte of the data and the length of the data.\r
+ */\r
+\r
+#include "CredentialsCache.h"\r
+#include "msg.h"\r
+#include "generic_lists.h"\r
+\r
+#include <stdlib.h>\r
+#include <memory.h>\r
+#include <stdio.h>\r
+#include <string.h>\r
+\r
+/**\r
+ * cci_msg_new()\r
+ *\r
+ * Purpose: Allocate and initialize a new cc_msg_t structure\r
+ *\r
+ * Input parameter (type) in host order\r
+ *\r
+ * Return: non-NULL, the msg\r
+ * NULL, failure\r
+ *\r
+ * Errors: ccErrNoMem\r
+ *\r
+ */\r
+cc_int32\r
+cci_msg_new(cc_uint32 type, cc_msg_t** msgpp) \r
+{\r
+ // type should be validated. If invalid set error to ccErrBadParam\r
+ cc_msg_t* msg;\r
+ \r
+ if ( type > CC_MSG_MAX_TYPE || msgpp == NULL )\r
+ return ccErrBadParam;\r
+\r
+ msg = (cc_msg_t*)malloc(sizeof(cc_msg_t));\r
+ if (msg == NULL)\r
+ return ccErrNoMem;\r
+\r
+ msg->type = type;\r
+ msg->flat = NULL;\r
+ msg->header = NULL;\r
+ msg->flat_len = 0;\r
+ msg->header_len = 0;\r
+ msg->magic = 0;\r
+ cci_generic_list_new(&msg->data_blobs);\r
+ if (msg->data_blobs == NULL) {\r
+ // pass on error from previous call\r
+ free(msg);\r
+ return ccErrNoMem;\r
+ }\r
+\r
+ *msgpp = msg; \r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * cci_msg_calc_header_size()\r
+ *\r
+ * Purpose: Calculates the size of the header\r
+ *\r
+ * Return: the size in bytes\r
+ *\r
+ * Errors: ccErrBadParam\r
+ *\r
+ */\r
+cc_int32\r
+cci_msg_calc_header_size(cc_msg_t* msg, cc_uint32 * lenp) \r
+{\r
+ int header_len = 12; /* header size, entire size, type */\r
+\r
+ if ( msg == NULL || lenp == NULL )\r
+ return ccErrBadParam;\r
+\r
+ header_len += msg->header_len;\r
+ *lenp = header_len;\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * cci_msg_calc_size()\r
+ *\r
+ * Purpose: Calculates the size of the message\r
+ * (does not include the magic bytes)\r
+ *\r
+ * Return: the size in bytes\r
+ *\r
+ * Errors: ccErrBadParam\r
+ *\r
+ */\r
+cc_int32 \r
+cci_msg_calc_size(cc_msg_t* msg, cc_uint32 * lenp) \r
+{\r
+ cc_uint32 flat_len;\r
+ cc_generic_list_node_t* gen_node;\r
+ cc_generic_iterate_t* gen_iterator;\r
+ cc_int32 code;\r
+\r
+ if ( msg == NULL || lenp == NULL ) \r
+ return ccErrBadParam;\r
+\r
+ code = cci_msg_calc_header_size(msg, &flat_len);\r
+ if (code != ccNoError)\r
+ goto bad;\r
+\r
+ code = cci_generic_list_iterator(msg->data_blobs, &gen_iterator);\r
+ if ( code != ccNoError )\r
+ goto bad;\r
+\r
+ while (cci_generic_iterate_has_next(gen_iterator)) {\r
+ code = cci_generic_iterate_next(gen_iterator, &gen_node);\r
+ if (code != ccNoError)\r
+ break;\r
+ flat_len += gen_node->len + BLOB_LEN;\r
+ }\r
+ cci_generic_free_iterator(gen_iterator);\r
+ if (code != ccNoError)\r
+ goto bad;\r
+\r
+ flat_len += MAGIC_HEAD_LEN + MAGIC_DATA_LEN;\r
+ *lenp = flat_len;\r
+\r
+ bad:\r
+ return code;\r
+}\r
+\r
+/**\r
+ * cci_msg_add_data_blob()\r
+ *\r
+ * Purpose: Adds 'len' bytes of data to the msg\r
+ *\r
+ * Return: \r
+ *\r
+ * Errors: \r
+ *\r
+ */\r
+cc_int32 \r
+cci_msg_add_data_blob(cc_msg_t* msg, void *data, cc_uint32 len, cc_uint32 *lenp) \r
+{\r
+ cc_int32 code;\r
+\r
+ if (msg == NULL || data == NULL || len <= 0 || lenp == NULL)\r
+ return ccErrBadParam;\r
+\r
+ code = cci_generic_list_append(msg->data_blobs, data, len, NULL);\r
+ if ( code != ccNoError )\r
+ return code;\r
+ return cci_msg_calc_blob_pos(msg, data, len, lenp);\r
+}\r
+\r
+/**\r
+ * cc_msg_\r
+ *\r
+ * Purpose:\r
+ *\r
+ * Return: \r
+ *\r
+ * Errors: \r
+ *\r
+ */\r
+cc_int32 \r
+cci_msg_calc_blob_pos(cc_msg_t* msg, void *data, cc_uint32 len, cc_uint32 * posp) \r
+{\r
+ cc_uint32 pos;\r
+ cc_generic_list_node_t* gen_node;\r
+ cc_generic_iterate_t* gen_iterator;\r
+ cc_int32 code;\r
+\r
+ code = cci_msg_calc_header_size(msg, &pos);\r
+ pos += sizeof(cc_uint32); /*+ sizeof(cc_uint32) for magic*/\r
+\r
+ code = cci_generic_list_iterator(msg->data_blobs, &gen_iterator);\r
+ while (cci_generic_iterate_has_next(gen_iterator)) {\r
+ code = cci_generic_iterate_next(gen_iterator, &gen_node);\r
+ if (gen_node->len != len && gen_node->data != data) {\r
+ pos += gen_node->len + sizeof(cc_uint32);\r
+ } else {\r
+ cci_generic_free_iterator(gen_iterator);\r
+ *posp = pos + sizeof(cc_uint32);\r
+ return ccNoError;\r
+ }\r
+ }\r
+ \r
+ cci_generic_free_iterator(gen_iterator);\r
+ return ccIteratorEnd;\r
+}\r
+\r
+/**\r
+ * cc_msg_\r
+ *\r
+ * Purpose:\r
+ *\r
+ * Return: \r
+ *\r
+ * Errors: \r
+ *\r
+ */\r
+cc_int32 \r
+cci_msg_add_header(cc_msg_t* msg, void *header, cc_uint32 header_len) \r
+{\r
+ if ( msg == NULL || header == NULL )\r
+ return ccErrBadParam;\r
+\r
+ msg->header = header;\r
+ msg->header_len = header_len;\r
+ return ccNoError;\r
+}\r
+\r
+\r
+/**\r
+ * cc_msg_\r
+ *\r
+ * Purpose:\r
+ *\r
+ * Return: \r
+ *\r
+ * Errors: \r
+ *\r
+ */\r
+cc_int32\r
+cci_msg_flatten(cc_msg_t* msg, void **flatpp) \r
+{\r
+ cc_generic_list_node_t* gen_node;\r
+ cc_generic_iterate_t* gen_iterator;\r
+ char *cur_pos;\r
+ cc_uint32 zero = 0;\r
+ cc_uint32 magic = 0;\r
+ cc_uint32 msg_len;\r
+ cc_uint32 u32;\r
+ cc_int32 code;\r
+\r
+ if (msg == NULL)\r
+ return ccErrBadParam;\r
+\r
+ code = cci_msg_calc_size(msg,&msg->flat_len);\r
+ if ( code != ccNoError )\r
+ return code;\r
+\r
+ if (msg->flat_len > CC_MSG_MAX_SIZE)\r
+ return ccErrBadParam;\r
+\r
+ msg->flat = (void *)malloc(msg->flat_len);\r
+ if (msg->flat == NULL)\r
+ return ccErrNoMem;\r
+ \r
+ cur_pos = msg->flat;\r
+\r
+ u32 = htonl(msg->header_len);\r
+ memcpy(cur_pos,&u32,sizeof(cc_uint32));\r
+ cur_pos+=sizeof(cc_uint32);\r
+\r
+ u32 = htonl(msg->flat_len);\r
+ memcpy(cur_pos,&u32,sizeof(cc_uint32));\r
+ cur_pos+=sizeof(cc_uint32);\r
+\r
+ u32 = htonl(msg->type);\r
+ memcpy(cur_pos,&u32,sizeof(cc_uint32));\r
+ cur_pos+=sizeof(cc_uint32);\r
+\r
+ /* header data is already in network order */\r
+ memcpy(cur_pos, msg->header, msg->header_len);\r
+ cur_pos += msg->header_len;\r
+\r
+ u32 = htonl(zero);\r
+ memcpy(cur_pos, &u32, sizeof(cc_uint32)); /*will be magic number later*/\r
+ cur_pos += sizeof(cc_uint32);\r
+\r
+ code = cci_generic_list_iterator(msg->data_blobs, &gen_iterator);\r
+ if ( code != ccNoError ) {\r
+ free(msg->flat);\r
+ return code;\r
+ }\r
+\r
+ while (cci_generic_iterate_has_next(gen_iterator)) {\r
+ code = cci_generic_iterate_next(gen_iterator, &gen_node);\r
+ if (code != ccNoError) {\r
+ free(gen_iterator);\r
+ free(msg->flat);\r
+ return code;\r
+ }\r
+ u32 = htonl(gen_node->len);\r
+ memcpy(cur_pos, &u32, sizeof(cc_uint32));\r
+ cur_pos+=sizeof(cc_uint32);\r
+ \r
+ /* data already in network order */\r
+ memcpy(cur_pos, gen_node->data, gen_node->len);\r
+ cur_pos += gen_node->len;\r
+ }\r
+ free(gen_iterator);\r
+\r
+ u32 = htonl(zero);\r
+ memcpy(cur_pos, &u32, sizeof(cc_uint32)); /*magic number will go here later*/\r
+ cur_pos += sizeof(cc_uint32);\r
+\r
+ if (cur_pos - (char *)msg->flat != msg->flat_len) {\r
+ fprintf(stderr, "ERROR cur_pos - msg->flat = %d\n",msg->flat_len);\r
+ }\r
+\r
+ cci_msg_calc_magic(msg->flat, msg->flat_len, &magic);\r
+ printf("magic = %d\n",magic);\r
+ \r
+ cci_msg_calc_header_size(msg, &msg_len);\r
+ memcpy((char *)msg->flat + msg_len, &magic, sizeof(cc_uint32));\r
+ memcpy((char *)msg->flat + msg->flat_len - sizeof(cc_uint32), &magic, sizeof(cc_uint32));\r
+\r
+ if ( flatpp != NULL )\r
+ *flatpp = msg->flat;\r
+\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * cc_msg_\r
+ *\r
+ * Purpose:\r
+ *\r
+ * Return: \r
+ *\r
+ * Errors: \r
+ *\r
+ */\r
+cc_int32\r
+cci_msg_calc_magic(void *flat, int flat_len, cc_uint32 * magicp)\r
+{\r
+ cc_uint32 magic = 0;\r
+ int i;\r
+ \r
+ for (i = 0; i < flat_len; i += sizeof(cc_uint32)) {\r
+ magic = magic ^ *(int *)((char *)flat + i);\r
+ }\r
+ *magicp = htonl(magic);\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * cc_msg_\r
+ *\r
+ * Purpose:\r
+ *\r
+ * Return: \r
+ *\r
+ * Errors: \r
+ *\r
+ */\r
+cc_int32 \r
+cci_msg_verify(void *flat, int flat_len, cc_uint32 * validp) \r
+{\r
+ cc_uint32 *magic1, *magic2;\r
+ cc_uint32 *pheader_len;\r
+ cc_uint32 header_len;\r
+ cc_uint32 *ptotal_len;\r
+ cc_uint32 total_len;\r
+ cc_uint32 *pblob_len;\r
+ cc_uint32 blob_len;\r
+ cc_uint32 *ptype;\r
+ cc_uint32 type;\r
+ cc_uint32 num_blobs = 0;\r
+ cc_uint32 zero = 0;\r
+ cc_uint32 msg_magic, msg_magic2;\r
+\r
+ if (flat == NULL || flat_len <= 0 || validp == NULL)\r
+ return ccErrBadParam;\r
+\r
+ pheader_len = flat;\r
+ ptotal_len = (cc_uint32 *)((char *)pheader_len + sizeof(cc_uint32));\r
+ ptype = (cc_uint32 *)((char *)ptotal_len + sizeof(cc_uint32));\r
+\r
+ header_len = ntohl(*pheader_len);\r
+ total_len = ntohl(*ptotal_len);\r
+ type = ntohl(*ptype);\r
+\r
+ if (total_len != flat_len) {\r
+ *validp = 0;\r
+ return ccNoError;\r
+ }\r
+ \r
+ if (header_len > flat_len) {\r
+ /*too weak. We could verify header_len against type spec header.*/\r
+ *validp = 0;\r
+ return ccNoError;\r
+ }\r
+ if (type > CC_MSG_MAX_TYPE) {\r
+ *validp = 0;\r
+ return ccNoError;\r
+ }\r
+\r
+ magic1 = (cc_uint32 *)((char *)ptype + sizeof(cc_uint32) + header_len); \r
+ if ((char *)magic1 - (char *)flat == (flat_len - 8)) {\r
+ /*There are no data blobs*/\r
+ magic2 = (cc_uint32 *)((char *)magic1 + sizeof(cc_uint32));\r
+ num_blobs = 0;\r
+ } else {\r
+ pblob_len = (cc_uint32 *)((char *)magic1 + sizeof(cc_uint32));\r
+ num_blobs = 1;\r
+ blob_len = ntohl(*pblob_len);\r
+\r
+ while (blob_len + sizeof(cc_uint32) + ((char *)pblob_len - (char *)flat) < (flat_len - sizeof(cc_uint32))) {\r
+ pblob_len = (cc_uint32 *)((char *)pblob_len + blob_len + sizeof(cc_uint32));\r
+ num_blobs++;\r
+ blob_len = ntohl(*pblob_len);\r
+ }\r
+\r
+ if (blob_len + sizeof(cc_uint32) + ((char *)pblob_len - (char *)flat) != (flat_len - sizeof(cc_uint32))) {\r
+ /*blobs didn't line up*/\r
+ *validp = 0;\r
+ return ccNoError;\r
+ }\r
+ magic2 = (cc_uint32 *)((char *)pblob_len + blob_len + sizeof(cc_uint32)); /*2nd magic should be directly after the last blob*/\r
+ }\r
+ \r
+ if (*magic1 != *magic2) {\r
+ *validp = 0;\r
+ return ccNoError;\r
+ }\r
+ msg_magic = *magic1;\r
+\r
+ printf("%d %d\n", (char *)magic1 - (char *)flat, (char *)magic2 - (char *)flat);\r
+\r
+ memcpy(magic1, &zero, sizeof(cc_uint32));\r
+ memcpy(magic2, &zero, sizeof(cc_uint32));\r
+ cci_msg_calc_magic(flat, flat_len, &msg_magic2);\r
+ /* both msg_magic and msg_magic2 are in network order */\r
+ if (msg_magic != msg_magic2) {\r
+ *validp = 0;\r
+ return ccNoError;\r
+ }\r
+ memcpy(magic1, &msg_magic, sizeof(cc_uint32));\r
+ memcpy(magic2, &msg_magic, sizeof(cc_uint32));\r
+\r
+ *validp = 1;\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * cc_msg_\r
+ *\r
+ * Purpose:\r
+ *\r
+ * Return: \r
+ *\r
+ * Errors: \r
+ *\r
+ */\r
+cc_int32\r
+cci_msg_unflatten(void *flat, int flat_len, cc_msg_t** msgpp) \r
+{\r
+ cc_msg_t* msg;\r
+ char *cur_pos;\r
+ cc_uint32 blob_len;\r
+ char *blob;\r
+ cc_uint32 valid;\r
+ cc_int32 code;\r
+\r
+ if ( flat == NULL || flat_len <= 0 || msgpp == NULL )\r
+ return ccErrBadParam;\r
+\r
+ code = cci_msg_new(0, &msg);\r
+ if (code)\r
+ return code;\r
+\r
+ cci_msg_verify(flat, flat_len, &valid);\r
+ if (valid != 1) {\r
+ cci_msg_destroy(msg);\r
+ return ccErrBadParam;\r
+ }\r
+\r
+ cur_pos = flat;\r
+ msg->flat = flat;\r
+\r
+ msg->header_len = ntohl(*(cc_uint32 *)cur_pos);\r
+ cur_pos += sizeof(cc_uint32);\r
+\r
+ msg->flat_len = ntohl(*(cc_uint32 *)cur_pos);\r
+ cur_pos += sizeof(cc_uint32);\r
+\r
+ msg->type = ntohl(*(cc_uint32 *)cur_pos);\r
+ cur_pos += sizeof(cc_uint32);\r
+\r
+ msg->header = (void *)malloc(msg->header_len);\r
+ if (msg->header == NULL) {\r
+ cci_msg_destroy(msg);\r
+ return ccErrNoMem;\r
+ }\r
+ memcpy(msg->header, cur_pos, msg->header_len);\r
+ cur_pos += msg->header_len;\r
+ \r
+ msg->magic = ntohl(*(cc_uint32 *)cur_pos);\r
+ cur_pos += sizeof(cc_uint32);\r
+\r
+ if (cur_pos - (char *)flat != flat_len - 8) { /*at least 1 blob*/\r
+ blob_len = ntohl(*(cc_uint32 *)cur_pos);\r
+ while (blob_len + (cur_pos - (char *)flat) + sizeof(cc_uint32) <= flat_len - sizeof(cc_uint32)) {\r
+ blob = (void *)malloc(blob_len);\r
+ if (blob == NULL) {\r
+ cci_msg_destroy(msg);\r
+ return ccErrNoMem;\r
+ }\r
+ memcpy(blob, cur_pos + sizeof(cc_uint32), blob_len);\r
+ cci_generic_list_append(msg->data_blobs, blob, blob_len, NULL);\r
+\r
+ cur_pos += sizeof(cc_uint32) + blob_len;\r
+ blob_len = ntohl(*(int *)cur_pos);\r
+ }\r
+ }\r
+ *msgpp = msg;\r
+ return ccNoError;\r
+}\r
+\r
+cc_int32\r
+cci_msg_retrieve_blob(cc_msg_t* msg, cc_uint32 blob_offset, cc_uint32 blob_len, char **blobp) \r
+{\r
+ cc_generic_iterate_t* gen_iterator;\r
+ cc_generic_list_node_t* gen_node;\r
+ void *ret;\r
+ cc_uint32 blob_pos;\r
+ cc_int32 code;\r
+\r
+ /*Ensure that the message has been unflattened*/\r
+ if ( msg == NULL || msg->flat == NULL || blob_offset > msg->flat_len || \r
+ blob_len > msg->flat_len - blob_offset || blobp == NULL)\r
+ return ccErrBadParam;\r
+\r
+ code = cci_generic_list_iterator(msg->data_blobs, &gen_iterator);\r
+ while (cci_generic_iterate_has_next(gen_iterator)) {\r
+ code = cci_generic_iterate_next(gen_iterator, &gen_node);\r
+ code = cci_msg_calc_blob_pos(msg, gen_node->data, gen_node->len, &blob_pos);\r
+ if (blob_pos == blob_offset && gen_node->len == blob_len) {\r
+ free(gen_iterator);\r
+ ret = (void *)malloc(blob_len);\r
+ if (ret == NULL)\r
+ return ccErrNoMem;\r
+ memcpy(ret,(char *)msg->flat + blob_offset, blob_len); \r
+ *blobp = ret;\r
+ return ccNoError;\r
+ }\r
+ }\r
+ free(gen_iterator);\r
+ return ccIteratorEnd;\r
+}\r
+\r
+/**\r
+ * cc_msg_\r
+ *\r
+ * Purpose:\r
+ *\r
+ * Return: \r
+ *\r
+ * Errors: \r
+ *\r
+ */\r
+cc_int32 \r
+cci_msg_destroy(cc_msg_t* msg) \r
+{\r
+ if (msg->flat != NULL) \r
+ free(msg->flat);\r
+ if (msg->header != NULL)\r
+ free(msg->header);\r
+ cci_generic_list_destroy(msg->data_blobs);\r
+ free(msg);\r
+ return ccNoError;\r
+}\r
+\r
--- /dev/null
+The following are notes describing the requirements of the Platform\r
+Specific code necessary for constructing a Portable CCAPI.\r
+\r
+Directory structure:\r
+\r
+ lib/ccapi/client - platform independent client library\r
+ lib/ccapi/common - platform independent common library\r
+ lib/ccapi/include - platform independent header files\r
+ lib/ccapi/mac - macosx specific headers, libraries, executables\r
+ lib/ccapi/server - platform independent server library\r
+ lib/ccapi/windows - windows specific headers, libraries, executables\r
+\r
+\r
+Platform Independent Design:\r
+\r
+The functionality of the Portable CCAPI is implemented in the platform\r
+independent libraries. The common library encapsulates the functions\r
+for managing generic lists, iterators, and messages as well as routines\r
+formarshalling and unmarshalling. The client library provides the\r
+client side routines for issuing requests to the ccapi server minus the\r
+platform dependent glue required for shared library initialization,\r
+cleanup, and interprocess communications. The server library provides\r
+server side functionality for managing credential cache collections,\r
+caches, credentials, iterators, and their handles minus the platform\r
+dependent glue for process initialization, interprocess communication,\r
+session security, and critical section enforcement.\r
+\r
+\r
+Platform Dependent Design Requirements:\r
+\r
+The platform dependent code is responsible for producing a shared\r
+client library:\r
+\r
+ + the shared library is built from cc_client.lib and cc_common.lib plus\r
+ platform dependent glue\r
+\r
+ - [windows] link cc_client.lib and cc_common.lib with platform\r
+ dependent routines and export list (.def) to produce\r
+ krbcc32.{lib,dll}\r
+\r
+ + initialization and cleanup\r
+\r
+ - [windows] provide DllMain entry point providing Process and Thread\r
+ attachment and detachment routines\r
+\r
+ + implement cci_perform_rpc() function used by cc_client.lib\r
+ cc_int32 cci_perform_rpc(cc_msg_t *request, cc_msg_t **response)\r
+\r
+ - cci_perform_rpc() takes an input request cc_msg_t object, flattens\r
+ it with cci_msg_flatten() and sends the contents of unsigned char\r
+ buffer request->flat of length request->flat_len to the server\r
+ utilizing a platform specific interprocess communication method.\r
+\r
+ - upon IPC success, cci_perform_rpc() unflattens the response buffer\r
+ with cci_msg_unflatten() and returns the new cc_msg_t response\r
+ object to the caller.\r
+\r
+ - cci_perform_rpc() is responsible for performing any necessary\r
+ session security management. For example, on Windows the Logon\r
+ Provider executes under the local machine's "SYSTEM" account within\r
+ session 0 and not under the account of the user that is logging in\r
+ nor within the session the user's desktop and applications will be\r
+ running within. It is the responsibility of cci_perform_rpc() and\r
+ the platform dependent IPC mechanism to communicate the user's\r
+ security identifiers to the server.\r
+\r
+ For Windows, this means that the platform specific IPC messaging\r
+ allows a username and session identifier to be sent separate from\r
+ the username and session identifier that will be obtained via the\r
+ use of Local RPC. If the Local RPC authenticates the user as\r
+ "SYSTEM" and session 0, then the communicated values (if provided)\r
+ will be used instead.\r
+\r
+ + implement client side of IPC routine.\r
+\r
+ - [windows] the client side IPC routine is produced by compiling a\r
+ IDL file. The IDL defines an interface with a single function:\r
+\r
+ __int32 ccapi_Message (\r
+ [in] handle_t h,\r
+ [in, string] unsigned char * client_name,\r
+ [in] struct _LUID luid,\r
+ [in] __int32 in_len,\r
+ [in, string, size_is(in_len)] unsigned char * in_buf,\r
+ [in] __int32 out_size,\r
+ [out] __int32 * out_len,\r
+ [out, string, size_is(out_size)] unsigned char\r
+ out_buf[*]);\r
+\r
+ The handle is a Local RPC specific handle used to identify the\r
+ request. The client_name and luid are the override values for the\r
+ username and session identifier for use during Windows login. The\r
+ rest of the parameters provide the input and output buffers as well\r
+ as allow communication of the actual length of the message data\r
+ that is required by cci_msg_unflatten().\r
+\r
+ + if the CCAPI server is per-session, the shared client library is\r
+ responsible for ensuring that an instance of the server is running in\r
+ the current session. If not, the library must initiate an instance\r
+ of the CCAPI server prior to performing any IPC requests.\r
+\r
+The platform dependent code is responsible for producing a server\r
+executable:\r
+\r
+ + The server executable is built from cc_server.lib and cc_common.lib\r
+ plus platform dependent glue.\r
+\r
+ - [windows] The Windows CCAPI Server is being built using the\r
+ per-system model. The platform specific code is responsible for\r
+ providing NT Service Management routines for installation and\r
+ removal as well as the NT Service Entry Points used when the\r
+ process is started as an NT Service.\r
+\r
+ link cc_server.lib and cc_common.lib with platform dependent\r
+ routines to produce krbcc32s.exe.\r
+\r
+ + Based upon the platform requirements, the server may be constructed\r
+ to be per-session or per-system. The selected IPC mechanism must\r
+ enforce the appropriate scoping.\r
+\r
+ + The platform dependent startup routines will perform platform\r
+ specific initialization including the IPC engine and call the\r
+ platform independent initialization routine ccs_serv_initialize()\r
+\r
+ + The platform dependent shutdown routines will perform platform\r
+ specific cleanup including the IPC engine and call the platform\r
+ independent function ccs_serv_cleanup() prior to process termination.\r
+\r
+ + For each inbound CCAPI request, the server will unmarshall the\r
+ request using cci_msg_unflatten() to produce a cc_msg_t object,\r
+ construct cc_auth_info_t and cc_session_info_t objects to represent\r
+ the platform dependent authentication and session data, call\r
+ ccs_serv_process_msg() to process the request, call cci_msg_flatten()\r
+ to marhall the response, transmit the response to the caller, and\r
+ then cleanup the request and response cc_msg_t objects with\r
+ cci_msg_destroy().\r
+\r
+ + The cc_auth_info_t and cc_session_info_t objects are structures\r
+ storing opaque binary (data, length) representations of the\r
+ authentication and session data. These are stored as part of ccache\r
+ collection and ccaches. ccs_serv_process_msg() will perform a binary\r
+ comparison of the stored data with the data provided in the current\r
+ request. If they do not match, the request will be denied. It is\r
+ necessary that the data generated data always be the same. If\r
+ username strings are not case-sensitive, they should be normalized\r
+ before being passed to ccs_serv_process_msg().\r
+\r
+ + The current cc_server.lib routines assume that one request at a time\r
+ is being processed. If the IPC engine allows for more than one\r
+ request to be simultaneously received in separate threads, then the\r
+ call to ccs_serv_process_msg() must be wrapped by a critical section.\r
+ Future enhancements to cc_server.lib will allow for per-object\r
+ mutexes. When available the platform specific glue must provide\r
+ functions to create, obtain, release, and destroy mutex objects.\r
+\r
+\r
/* $Copyright:
*
- * Copyright 1998-2004 by the Massachusetts Institute of Technology.
+ * Copyright 1998-2006 by the Massachusetts Institute of Technology.
*
* All rights reserved.
*
/*
* Declarations for Credentials Cache API Library
*
- * API specification: <http://web.mit.edu/pismere/kerberos/ccache-api-v2.html>
+ * API specification: <http://web.mit.edu/pismere/kerberos/ccache-api-v3.html>
*
* Revision 1: Frank Dabek, 6/4/1998
* Revision 2: meeroh, 2/24/1999
* Revision 3: meeroh, 11/12/1999
- * Revision 4: jaltman, 10/27/2004
+ * Revision 6: jaltman, 10/27/2004
*
*/
#define __CREDENTIALSCACHE__
#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))
- #include <TargetConditionals.h>
- #if TARGET_RT_MAC_CFM
- #error "Use KfM 4.0 SDK headers for CFM compilation."
- #endif
+#include <TargetConditionals.h>
#endif
-#if TARGET_OS_MAC
- #include <sys/types.h>
+#if defined(_WIN32)
+#include <winsock.h>
#endif
#ifdef __cplusplus
#endif /* __cplusplus */
#if TARGET_OS_MAC
- #if defined(__MWERKS__)
- #pragma import on
- #pragma enumsalwaysint on
- #endif
- #pragma options align=mac68k
+#pragma options align=mac68k
+#endif
+
+#if defined(_WIN32)
+#define CCACHE_API __declspec(dllexport)
+
+#if _INTEGRAL_MAX_BITS >= 64 && _MSC_VER >= 1400 && !defined(_WIN64) && !defined(_USE_32BIT_TIME_T)
+#if defined(_TIME_T_DEFINED) || defined(_INC_IO) || defined(_INC_TIME) || defined(_INC_WCHAR)
+#error time_t has been defined as a 64-bit integer which is incompatible with Kerberos on this platform.
+#endif /* _TIME_T_DEFINED */
+#define _USE_32BIT_TIME_T
+#endif
+#else
+#define CCACHE_API
#endif
#include <time.h>
ccapi_version_2 = 2,
ccapi_version_3 = 3,
ccapi_version_4 = 4,
- ccapi_version_5 = 5
+ ccapi_version_5 = 5,
+ ccapi_version_6 = 6,
+ ccapi_version_max = ccapi_version_6
};
/* Errors */
enum {
- ccNoError = 0,
+ ccNoError = 0,
- ccIteratorEnd = 201,
+ ccIteratorEnd = 201,
ccErrBadParam,
ccErrNoMem,
ccErrInvalidContext,
ccErrInvalidCredentialsIterator,
ccErrInvalidLock,
- ccErrBadName, /* 211 */
+ ccErrBadName, /* 211 */
ccErrBadCredentialsVersion,
ccErrBadAPIVersion,
ccErrContextLocked,
ccErrNeverDefault,
ccErrCredentialsNotFound,
- ccErrCCacheNotFound, /* 221 */
+ ccErrCCacheNotFound, /* 221 */
ccErrContextNotFound,
ccErrServerUnavailable,
ccErrServerInsecure,
};
/* Credentials versions */
-enum {
+enum cc_credential_versions {
cc_credentials_v4 = 1,
cc_credentials_v5 = 2,
cc_credentials_v4_v5 = 3
};
/* Lock types */
-enum {
- cc_lock_read = 1,
- cc_lock_write = 2
+enum cc_lock_types {
+ cc_lock_read = 0,
+ cc_lock_write = 1,
+ cc_lock_upgrade = 2,
+ cc_lock_downgrade = 3
};
/* Locking Modes */
-enum {
+enum cc_lock_modes {
cc_lock_noblock = 0,
cc_lock_block = 1
};
* Basic types
*/
-typedef char cc_int8;
-typedef unsigned char cc_uint8;
-typedef int cc_int32;
-typedef unsigned int cc_uint32;
-typedef time_t cc_time_t;
-typedef void * cc_handle;
+typedef char cc_int8;
+typedef unsigned char cc_uint8;
+typedef int cc_int32;
+typedef unsigned int cc_uint32;
+#if defined (WIN32)
+typedef __int64 cc_int64;
+typedef unsigned __int64 cc_uint64;
+#else
+typedef long long cc_int64;
+typedef unsigned long long cc_uint64;
+#endif
+typedef time_t cc_time;
+typedef cc_int64 cc_time64;
+typedef cc_uint64 cc_handle;
/*
* API types
/* Credentials types */
enum { /* Make sure all of these are multiples of four (for alignment sanity) */
- cc_v4_name_size = 40,
+ cc_v4_name_size = 40,
cc_v4_instance_size = 40,
cc_v4_realm_size = 40,
- cc_v4_ticket_size = 1254
+ cc_v4_ticket_size = 1254,
+ cc_v4_key_size = 8
};
enum cc_string_to_key_type {
char service [cc_v4_name_size];
char service_instance [cc_v4_instance_size];
char realm [cc_v4_realm_size];
- unsigned char session_key [8];
+ unsigned char session_key [cc_v4_key_size];
cc_int32 kvno;
cc_int32 string_to_key_type;
- cc_time_t issue_date;
+ cc_time issue_date;
cc_int32 lifetime;
cc_uint32 address;
cc_int32 ticket_size;
char* client;
char* server;
cc_data keyblock;
- cc_time_t authtime;
- cc_time_t starttime;
- cc_time_t endtime;
- cc_time_t renew_till;
+ cc_time authtime;
+ cc_time starttime;
+ cc_time endtime;
+ cc_time renew_till;
cc_uint32 is_skey;
cc_uint32 ticket_flags;
cc_data** addresses;
cc_context_t context);
cc_int32 (*get_change_time) (
cc_context_t context,
- cc_time_t* time);
+ cc_time* time);
cc_int32 (*get_default_ccache_name) (
cc_context_t context,
cc_string_t* name);
cc_ccache_t destination);
cc_int32 (*lock) (
cc_ccache_t ccache,
- cc_uint32 block,
- cc_uint32 lock_type);
+ cc_uint32 lock_type,
+ cc_uint32 block);
cc_int32 (*unlock) (
cc_ccache_t ccache);
cc_int32 (*get_last_default_time) (
cc_ccache_t ccache,
- cc_time_t* time);
+ cc_time* time);
cc_int32 (*get_change_time) (
cc_ccache_t ccache,
- cc_time_t* time);
+ cc_time* time);
cc_int32 (*compare) (
cc_ccache_t ccache,
cc_ccache_t compare_to,
cc_int32 (*get_kdc_time_offset) (
cc_ccache_t ccache,
cc_int32 credentials_version,
- cc_time_t* time_offset);
+ cc_time* time_offset);
cc_int32 (*set_kdc_time_offset) (
cc_ccache_t ccache,
cc_int32 credentials_version,
- cc_time_t time_offset);
+ cc_time time_offset);
cc_int32 (*clear_kdc_time_offset) (
cc_ccache_t ccache,
cc_int32 (*next) (
cc_ccache_iterator_t iter,
cc_ccache_t* ccache);
+
+ cc_int32 (*clone) ( cc_ccache_iterator_t iter,
+ cc_ccache_iterator_t* new_iter);
};
struct cc_credentials_iterator_f {
cc_credentials_iterator_t iter);
cc_int32 (*next) (
cc_credentials_iterator_t iter,
- cc_credentials_t* ccache);
+ cc_credentials_t* cred);
+
+ cc_int32 (*clone) ( cc_credentials_iterator_t iter,
+ cc_credentials_iterator_t* new_iter);
};
/*
* API functions
*/
-cc_int32 cc_initialize (
+CCACHE_API cc_int32 cc_initialize (
cc_context_t* outContext,
- cc_int32 inVersion,
- cc_int32* outSupportedVersion,
+ cc_int32 inVersion,
+ cc_int32* outSupportedVersion,
char const** outVendor);
/*
((context) -> functions -> create_new_ccache (context, version, principal, ccache))
#define cc_context_new_ccache_iterator(context, iterator) \
((context) -> functions -> new_ccache_iterator (context, iterator))
-#define cc_context_lock(context, type, lock) \
- ((context) -> functions -> lock (context, type, lock))
+#define cc_context_lock(context, type, block) \
+ ((context) -> functions -> lock (context, type, block))
#define cc_context_unlock(context) \
((context) -> functions -> unlock (context))
#define cc_context_compare(context, compare_to, equal) \
((ccache) -> functions -> remove_credentials (ccache, credentials))
#define cc_ccache_new_credentials_iterator(ccache, iterator) \
((ccache) -> functions -> new_credentials_iterator (ccache, iterator))
-#define cc_ccache_lock(ccache, lock) \
- ((ccache) -> functions -> lock (ccache, lock))
+#define cc_ccache_lock(ccache, type, block) \
+ ((ccache) -> functions -> lock (ccache, type, block))
#define cc_ccache_unlock(ccache, unlock) \
((ccache) -> functions -> unlock (ccache, unlock))
#define cc_ccache_get_last_default_time(ccache, time) \
#define cc_ccache_compare(ccache, compare_to, equal) \
((ccache) -> functions -> compare (ccache, compare_to, equal))
#define cc_ccache_get_kdc_time_offset(ccache, version, time) \
- ((ccache) -> functions -> get_kdc_time_offset (version, time))
+ ((ccache) -> functions -> get_kdc_time_offset (version, time))
#define cc_ccache_set_kdc_time_offset(ccache, version, time) \
- ((ccache) -> functions -> set_kdc_time_offset (version, time))
+ ((ccache) -> functions -> set_kdc_time_offset (version, time))
#define cc_ccache_clear_kdc_time_offset(ccache, version) \
- ((ccache) -> functions -> clear_kdc_time_offset (version))
+ ((ccache) -> functions -> clear_kdc_time_offset (version))
#define cc_string_release(string) \
((string) -> functions -> release (string))
((iterator) -> functions -> release (iterator))
#define cc_ccache_iterator_next(iterator, ccache) \
((iterator) -> functions -> next (iterator, ccache))
+#define cc_ccache_iterator_clone(iterator, new_iter) \
+ ((iterator) -> functions -> clone (iterator, new_iter))
#define cc_credentials_iterator_release(iterator) \
((iterator) -> functions -> release (iterator))
#define cc_credentials_iterator_next(iterator, credentials) \
((iterator) -> functions -> next (iterator, credentials))
+#define cc_credentials_iterator_clone(iterator, new_iter) \
+ ((iterator) -> functions -> clone (iterator, new_iter))
#if TARGET_OS_MAC
- #if defined(__MWERKS__)
- #pragma enumsalwaysint reset
- #pragma import reset
- #endif
- #pragma options align=reset
+#pragma options align=reset
#endif
#ifdef __cplusplus
/* $Copyright:
*
- * Copyright 1998-2004 by the Massachusetts Institute of Technology.
+ * Copyright 1998-2006 by the Massachusetts Institute of Technology.
*
* All rights reserved.
*
#ifndef __CREDENTIALSCACHE2__
#define __CREDENTIALSCACHE2__
-#include <Kerberos/CredentialsCache.h>
+#include "CredentialsCache.h"
+
#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__))
- #include <TargetConditionals.h>
- #if TARGET_RT_MAC_CFM
- #error "Use KfM 4.0 SDK headers for CFM compilation."
- #endif
+#include <TargetConditionals.h>
#endif
#ifdef __cplusplus
#endif /* __cplusplus */
#if TARGET_OS_MAC
- #if defined(__MWERKS__)
- #pragma import on
- #pragma enumsalwaysint on
- #endif
- #pragma options align=mac68k
+#pragma options align=mac68k
#endif
-
+
/* Some old types get directly mapped to new types */
typedef cc_context_d apiCB;
char* client;
char* server;
cc_data_compat keyblock;
- cc_time_t authtime;
- cc_time_t starttime;
- cc_time_t endtime;
- cc_time_t renew_till;
+ cc_time authtime;
+ cc_time starttime;
+ cc_time endtime;
+ cc_time renew_till;
cc_uint32 is_skey;
cc_uint32 ticket_flags;
cc_data_compat** addresses;
CC_CRED_MAX
};
-cc_int32 cc_shutdown (
+enum {
+ CC_LOCK_UNLOCK = 1,
+ CC_LOCK_READER = 2,
+ CC_LOCK_WRITER = 3,
+ CC_LOCK_NOBLOCK = 16
+};
+
+CCACHE_API cc_int32 cc_shutdown (
apiCB** ioContext);
-cc_int32 cc_get_NC_info (
+CCACHE_API cc_int32 cc_get_NC_info (
apiCB* inContext,
infoNC*** outInfo);
-cc_int32 cc_get_change_time (
+CCACHE_API cc_int32 cc_get_change_time (
apiCB* inContext,
- cc_time_t* outTime);
+ cc_time* outTime);
-cc_int32 cc_open (
+CCACHE_API cc_int32 cc_open (
apiCB* inContext,
const char* inName,
cc_int32 inVersion,
cc_uint32 inFlags,
ccache_p** outCCache);
-cc_int32 cc_create (
+CCACHE_API cc_int32 cc_create (
apiCB* inContext,
const char* inName,
const char* inPrincipal,
cc_uint32 inFlags,
ccache_p** outCCache);
-cc_int32 cc_close (
+CCACHE_API cc_int32 cc_close (
apiCB* inContext,
ccache_p** ioCCache);
-cc_int32 cc_destroy (
+CCACHE_API cc_int32 cc_destroy (
apiCB* inContext,
ccache_p** ioCCache);
-cc_int32 cc_seq_fetch_NCs_begin (
+CCACHE_API cc_int32 cc_seq_fetch_NCs_begin (
apiCB* inContext,
- ccache_cit** outIterator);
+ ccache_cit** outIterator);
-cc_int32 cc_seq_fetch_NCs_next (
+CCACHE_API cc_int32 cc_seq_fetch_NCs_next (
apiCB* inContext,
ccache_p** outCCache,
ccache_cit* inIterator);
-cc_int32 cc_seq_fetch_NCs_end (
+CCACHE_API cc_int32 cc_seq_fetch_NCs_end (
apiCB* inContext,
- ccache_cit** ioIterator);
+ ccache_cit** ioIterator);
-cc_int32 cc_get_name (
+CCACHE_API cc_int32 cc_get_name (
apiCB* inContext,
ccache_p* inCCache,
char** outName);
-cc_int32 cc_get_cred_version (
+CCACHE_API cc_int32 cc_get_cred_version (
apiCB* inContext,
ccache_p* inCCache,
cc_int32* outVersion);
-cc_int32 cc_set_principal (
+CCACHE_API cc_int32 cc_set_principal (
apiCB* inContext,
ccache_p* inCCache,
cc_int32 inVersion,
char* inPrincipal);
-cc_int32 cc_get_principal (
+CCACHE_API cc_int32 cc_get_principal (
apiCB* inContext,
ccache_p* inCCache,
char** outPrincipal);
-cc_int32 cc_store (
+CCACHE_API cc_int32 cc_store (
apiCB* inContext,
ccache_p* inCCache,
cred_union inCredentials);
-cc_int32 cc_remove_cred (
+CCACHE_API cc_int32 cc_remove_cred (
apiCB* inContext,
ccache_p* inCCache,
cred_union inCredentials);
-cc_int32 cc_seq_fetch_creds_begin (
+CCACHE_API cc_int32 cc_seq_fetch_creds_begin (
apiCB* inContext,
- const ccache_p* inCCache,
- ccache_cit** outIterator);
+ const ccache_p* inCCache,
+ ccache_cit** outIterator);
-cc_int32 cc_seq_fetch_creds_next (
+CCACHE_API cc_int32 cc_seq_fetch_creds_next (
apiCB* inContext,
- cred_union** outCreds,
+ cred_union** outCreds,
ccache_cit* inIterator);
-cc_int32 cc_seq_fetch_creds_end (
+CCACHE_API cc_int32 cc_seq_fetch_creds_end (
apiCB* inContext,
- ccache_cit** ioIterator);
+ ccache_cit** ioIterator);
-cc_int32 cc_free_principal (
+CCACHE_API cc_int32 cc_free_principal (
apiCB* inContext,
char** ioPrincipal);
-cc_int32 cc_free_name (
+CCACHE_API cc_int32 cc_free_name (
apiCB* inContext,
char** ioName);
-cc_int32 cc_free_creds (
+CCACHE_API cc_int32 cc_free_creds (
apiCB* inContext,
- cred_union** creds);
+ cred_union** creds);
-cc_int32 cc_free_NC_info (
+CCACHE_API cc_int32 cc_free_NC_info (
apiCB* inContext,
infoNC*** ioInfo);
+CCACHE_API cc_int32 cc_lock_request(
+ apiCB* inContext,
+ const ccache_p* inCCache,
+ const cc_int32 lock_type);
+
#if TARGET_OS_MAC
- #if defined(__MWERKS__)
- #pragma enumsalwaysint reset
- #pragma import reset
- #endif
- #pragma options align=reset
+#pragma options align=reset
#endif
#ifdef __cplusplus
--- /dev/null
+/* $Copyright:\r
+ *\r
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.\r
+ * \r
+ * All rights reserved.\r
+ * \r
+ * Export of this software from the United States of America may require a\r
+ * specific license from the United States Government. It is the\r
+ * responsibility of any person or organization contemplating export to\r
+ * obtain such a license before exporting.\r
+ * \r
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute\r
+ * this software and its documentation for any purpose and without fee is\r
+ * hereby granted, provided that the above copyright notice appear in all\r
+ * copies and that both that copyright notice and this permission notice\r
+ * appear in supporting documentation, and that the name of M.I.T. not be\r
+ * used in advertising or publicity pertaining to distribution of the\r
+ * software without specific, written prior permission. Furthermore if you\r
+ * modify this software you must label your software as modified software\r
+ * and not distribute it in such a fashion that it might be confused with\r
+ * the original MIT software. M.I.T. makes no representations about the\r
+ * suitability of this software for any purpose. It is provided "as is"\r
+ * without express or implied warranty.\r
+ * \r
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED\r
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF\r
+ * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\r
+ * \r
+ * Individual source code files are copyright MIT, Cygnus Support,\r
+ * OpenVision, Oracle, Sun Soft, FundsXpress, and others.\r
+ * \r
+ * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,\r
+ * and Zephyr are trademarks of the Massachusetts Institute of Technology\r
+ * (MIT). No commercial use of these trademarks may be made without prior\r
+ * written permission of MIT.\r
+ * \r
+ * "Commercial use" means use of a name in a product or other for-profit\r
+ * manner. It does NOT prevent a commercial firm from referring to the MIT\r
+ * trademarks in order to convey information (although in doing so,\r
+ * recognition of their trademark status should be given).\r
+ * $\r
+ */\r
+\r
+\r
+#ifndef __CC_RPC_H__\r
+#define __CC_RPC_H__\r
+\r
+#include "msg.h"\r
+\r
+cc_int32 cci_perform_rpc(cc_msg_t *request, cc_msg_t **response);\r
+\r
+#endif /* __CC_RPC_H__ */\r
/* $Copyright:
*
- * Copyright 2004 by the Massachusetts Institute of Technology.
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.
*
* All rights reserved.
*
#include "CredentialsCache.h"
#include "rpc_auth.h"
-
-enum cc_list_type {
- generic = 0,
- context,
- cache,
- credentials
-};
-
-struct cc_generic_list_node_t {
- cc_uint8* data;
- cc_uint32 len;
- struct cc_generic_list_node_t* next;
- struct cc_generic_list_node_t* prev;
-};
-typedef struct cc_generic_list_node_t cc_generic_list_node_t;
-
-struct cc_generic_list_head_t {
- enum cc_list_type type;
- cc_generic_list_node_t* head;
- cc_generic_list_node_t* tail;
-};
-typedef struct cc_generic_list_head_t cc_generic_list_head_t;
-
-
-struct cc_generic_iterate_t {
- cc_generic_list_node_t* next;
-};
-typedef struct cc_generic_iterate_t cc_generic_iterate_t;
-
-typedef cc_generic_list_head_t cc_context_list_head_t;
-typedef cc_generic_list_node_t cc_context_list_node_t;
-
-typedef cc_generic_list_head_t cc_ccache_list_head_t;
-typedef cc_generic_list_node_t cc_ccache_list_node_t;
-
-typedef cc_generic_list_head_t cc_credentials_list_head_t;
-typedef cc_generic_list_node_t cc_credentials_list_node_t;
+#include "generic_lists.h"
struct cc_context_iterate_t {
cc_context_list_node_t* next;
};
typedef struct cc_credentials_iterate_t cc_credentials_iterate_t;
-struct cc_lock_t {
+struct cc_lock {
cc_uint32 read_locks; /* count of read locks (>= 0) */
cc_uint32 write_locks; /* count of write locks (0 or 1) */
void * platform_data; /* platform specific implementation data */
cc_int32 api_version; /*Version our client passed in on init (ccapi_version_X) */
cc_auth_info_t* auth_info; /*auth info passed in from RPC*/
cc_session_info_t* session_info; /*session info passed in from RPC*/
- cc_time_t changed; /*date of last change to this context*/
+ cc_time64 changed; /*date of last change to this context*/
cc_int32 error; /*last error code*/
cc_lock_t locks; /*are we locked?*/
};
char* principal_v4; /*v4 principal associated with this cache*/
char* principal_v5; /*v5 principal associated with this cache*/
cc_uint32 versions; /*versions of creds supported (from cc_credentials enum in CredentialsCache.h)*/
- cc_time_t changed; /*date of last change to ccache*/
+ cc_time64 changed; /*date of last change to ccache*/
cc_int32 kdc_set; /*is the KDC time offset initialized?*/
- cc_time_t kdc_offset; /*offset of our clock relative kdc*/
- cc_time_t last_default; /*the last date when we were default*/
+ cc_time64 kdc_offset; /*offset of our clock relative kdc*/
+ cc_time64 last_default; /*the last date when we were default*/
cc_int32 is_default; /*is this the default cred on this ccache?*/
cc_generic_list_head_t* active_iterators; /*iterators which clients have opened on this cache*/
cc_credentials_list_head_t* creds; /*list of creds stored in this ccache*/
/*Note: cci means Credential Cache Internal, to differentiate from exported API macros*/
-cc_int32 cci_generic_iterate_has_next(cc_generic_iterate_t *iterate);
-cc_int32 cci_generic_iterate_next(cc_generic_iterate_t *iterate, cc_generic_list_node_t**);
-
-cc_int32 cci_generic_list_new(cc_generic_list_head_t **);
-cc_int32 cci_generic_list_append(cc_generic_list_head_t *head, void *data, cc_uint32 len, cc_generic_list_node_t**);
-cc_int32 cci_generic_list_prepend(cc_generic_list_head_t *head, void *data, cc_uint32 len, cc_generic_list_node_t**);
-cc_int32 cci_generic_list_remove_element(cc_generic_list_head_t* head, cc_generic_list_node_t* rem);
-cc_int32 cci_generic_free_element(cc_generic_list_node_t* node);
-cc_int32 cci_generic_list_destroy(cc_generic_list_head_t* head);
-cc_int32 cci_generic_list_copy(cc_generic_list_head_t* head, cc_generic_list_head_t**);
-cc_int32 cci_generic_list_iterator(cc_generic_list_head_t *head, cc_generic_iterate_t**);
-cc_int32 cci_generic_free_iterator(cc_generic_iterate_t* iterator);
-
-cc_int32 cci_context_iterate_has_next(struct cc_context_iterate_t *iterate);
-cc_int32 cci_context_iterate_next(struct cc_context_iterate_t *iterate, cc_context_list_node_t**);
-
-cc_int32 cci_ccache_iterate_has_next(struct cc_ccache_iterate_t *iterate);
-cc_int32 cci_ccache_iterate_next(struct cc_ccache_iterate_t *iterate, cc_ccache_list_node_t**);
-
-cc_int32 cci_credentials_iterate_has_next(cc_credentials_iterate_t *iterate);
-cc_int32 cci_credentials_iterate_next(cc_credentials_iterate_t *iterate, cc_credentials_list_node_t **);
-
-cc_int32 cci_context_list_new(cc_context_list_head_t**);
-cc_int32 cci_context_list_append(cc_context_list_head_t *head, cc_server_context_t *data, cc_context_list_node_t**);
-cc_int32 cci_context_list_prepend(cc_context_list_head_t *head, cc_server_context_t *data, cc_context_list_node_t**);
-cc_int32 cci_context_list_remove_element(cc_context_list_head_t* head, cc_context_list_node_t* rem);
-cc_int32 cci_context_list_iterator(cc_context_list_head_t *head, struct cc_context_iterate_t**);
-cc_int32 cci_context_free_iterator(struct cc_context_iterate_t *iterator);
-cc_int32 cci_context_list_destroy(cc_context_list_head_t* head) ;
-cc_int32 cci_context_list_copy(cc_context_list_head_t* head, cc_context_list_head_t**);
-
-cc_int32 cci_ccache_list_new(cc_ccache_list_head_t**);
-cc_int32 cci_ccache_list_append(cc_ccache_list_head_t *head, cc_server_ccache_t *data, cc_ccache_list_node_t**);
-cc_int32 cci_ccache_list_prepend(cc_ccache_list_head_t *head, cc_server_ccache_t *data, cc_ccache_list_node_t**);
-cc_int32 cci_ccache_list_remove_element(cc_ccache_list_head_t* head, cc_ccache_list_node_t* rem);
-cc_int32 cci_ccache_list_iterator(cc_ccache_list_head_t *head, struct cc_ccache_iterate_t**);
-cc_int32 cci_ccache_free_iterator(struct cc_ccache_iterate_t *iterator);
-cc_int32 cci_ccache_list_destroy(cc_ccache_list_head_t* head) ;
-cc_int32 cci_ccache_list_copy(cc_ccache_list_head_t* head, cc_ccache_list_head_t**);
-
-
-cc_int32 cci_credentials_list_new(cc_credentials_list_head_t**);
-cc_int32 cci_credentials_list_append(cc_credentials_list_head_t *head, cc_server_credentials_t *data, cc_credentials_list_node_t**);
-cc_int32 cci_credentials_list_prepend(cc_credentials_list_head_t *head, cc_server_credentials_t *data, cc_credentials_list_node_t**);
-cc_int32 cci_credentials_list_remove_element(cc_credentials_list_head_t* head, cc_credentials_list_node_t* rem);
-cc_int32 cci_credentials_list_iterator(cc_credentials_list_head_t *head, cc_credentials_iterate_t**);
-cc_int32 cci_credentials_free_iterator(cc_credentials_iterate_t* iterator);
-cc_int32 cci_credentials_list_destroy(cc_credentials_list_head_t* head) ;
-cc_int32 cci_credentials_list_copy(cc_credentials_list_head_t* head, cc_credentials_list_head_t**) ;
-
-
-cc_int32 cci_context_new(int api_version, cc_auth_info_t* auth_info, cc_session_info_t* session_info, cc_server_context_t** ) ;
-cc_int32 cci_context_get_default_ccache_name(cc_server_context_t* ctx, char **);
-cc_int32 cci_context_find_ccache(cc_server_context_t* ctx, char *name, cc_server_ccache_t**);
-cc_int32 cci_context_open_ccache(cc_server_context_t* ctx, char *name, cc_server_ccache_t** );
-cc_int32 cci_context_create_ccache(cc_server_context_t* ctx, char *name, int creds_version, char *principal, cc_server_ccache_t**);
-cc_int32 cci_context_create_default_ccache(cc_server_context_t* ctx, int creds_version, char *principal, cc_server_ccache_t**);
-cc_int32 cci_context_ccache_iterator(cc_server_context_t* ctx, cc_ccache_iterate_t**);
-cc_int32 cci_context_compare(cc_server_context_t* a, cc_server_context_t* b);
-cc_int32 cci_context_destroy(cc_server_context_t* ctx);
-cc_int32 cci_context_rem_ccache(cc_server_context_t* ctx, cc_server_ccache_t* ccache);
-
-cc_int32 cci_ccache_new(char *name, char *principal, int cred_vers, cc_server_ccache_t**);
-cc_int32 cci_ccache_check_version(const cc_server_ccache_t *ccache, const cc_credentials_union* creds, cc_uint32* compat);
-cc_int32 cci_ccache_check_principal(const cc_server_ccache_t *ccache, const cc_credentials_union* creds, cc_uint32* compat);
-cc_int32 cci_ccache_store_creds(cc_server_ccache_t *ccache, const cc_credentials_union* credentials);
-cc_int32 cci_ccache_rem_creds(cc_server_ccache_t *ccache, const cc_credentials_union* credentials);
-cc_int32 cci_ccache_move(cc_server_ccache_t *source, cc_server_ccache_t* destination);
-cc_int32 cci_ccache_get_kdc_time_offset(cc_server_ccache_t* ccache, cc_time_t* offset);
-cc_int32 cci_ccache_set_kdc_time_offset(cc_server_ccache_t* ccache, cc_time_t offset);
-cc_int32 cci_ccache_clear_kdc_time_offset(cc_server_ccache_t* ccache);
-cc_int32 cci_ccache_new_iterator(cc_server_ccache_t* ccache, cc_credentials_iterate_t** iterator);
-cc_int32 cci_ccache_get_principal(cc_server_ccache_t* ccache, cc_int32 version, char ** principal);
-cc_int32 cci_ccache_set_principal(cc_server_ccache_t* ccache, cc_int32 version, char * principal);
-cc_int32 cci_ccache_free_principal(char * principal);
-cc_int32 cci_ccache_destroy(cc_server_ccache_t* ccache);
-void cci_ccache_changed(cc_server_ccache_t* ccache);
-cc_int32 cci_ccache_compare(cc_server_ccache_t* ccache1, cc_server_ccache_t* ccache2, cc_uint32 *result);
+cc_int32 ccs_context_iterate_has_next(struct cc_context_iterate_t *iterate);
+cc_int32 ccs_context_iterate_next(struct cc_context_iterate_t *iterate, cc_context_list_node_t**);
+
+cc_int32 ccs_ccache_iterate_has_next(struct cc_ccache_iterate_t *iterate);
+cc_int32 ccs_ccache_iterate_next(struct cc_ccache_iterate_t *iterate, cc_ccache_list_node_t**);
+
+cc_int32 ccs_credentials_iterate_has_next(cc_credentials_iterate_t *iterate);
+cc_int32 ccs_credentials_iterate_next(cc_credentials_iterate_t *iterate, cc_credentials_list_node_t **);
+
+cc_int32 ccs_context_list_new(cc_context_list_head_t**);
+cc_int32 ccs_context_list_append(cc_context_list_head_t *head, cc_server_context_t *data, cc_context_list_node_t**);
+cc_int32 ccs_context_list_prepend(cc_context_list_head_t *head, cc_server_context_t *data, cc_context_list_node_t**);
+cc_int32 ccs_context_list_remove_element(cc_context_list_head_t* head, cc_context_list_node_t* rem);
+cc_int32 ccs_context_list_iterator(cc_context_list_head_t *head, struct cc_context_iterate_t**);
+cc_int32 ccs_context_free_iterator(struct cc_context_iterate_t *iterator);
+cc_int32 ccs_context_list_destroy(cc_context_list_head_t* head) ;
+cc_int32 ccs_context_list_copy(cc_context_list_head_t* head, cc_context_list_head_t**);
+
+cc_int32 ccs_ccache_list_new(cc_ccache_list_head_t**);
+cc_int32 ccs_ccache_list_append(cc_ccache_list_head_t *head, cc_server_ccache_t *data, cc_ccache_list_node_t**);
+cc_int32 ccs_ccache_list_prepend(cc_ccache_list_head_t *head, cc_server_ccache_t *data, cc_ccache_list_node_t**);
+cc_int32 ccs_ccache_list_remove_element(cc_ccache_list_head_t* head, cc_ccache_list_node_t* rem);
+cc_int32 ccs_ccache_list_iterator(cc_ccache_list_head_t *head, struct cc_ccache_iterate_t**);
+cc_int32 ccs_ccache_free_iterator(struct cc_ccache_iterate_t *iterator);
+cc_int32 ccs_ccache_list_destroy(cc_ccache_list_head_t* head) ;
+cc_int32 ccs_ccache_list_copy(cc_ccache_list_head_t* head, cc_ccache_list_head_t**);
+
+
+cc_int32 ccs_credentials_list_new(cc_credentials_list_head_t**);
+cc_int32 ccs_credentials_list_append(cc_credentials_list_head_t *head, cc_server_credentials_t *data, cc_credentials_list_node_t**);
+cc_int32 ccs_credentials_list_prepend(cc_credentials_list_head_t *head, cc_server_credentials_t *data, cc_credentials_list_node_t**);
+cc_int32 ccs_credentials_list_remove_element(cc_credentials_list_head_t* head, cc_credentials_list_node_t* rem);
+cc_int32 ccs_credentials_list_iterator(cc_credentials_list_head_t *head, cc_credentials_iterate_t**);
+cc_int32 ccs_credentials_free_iterator(cc_credentials_iterate_t* iterator);
+cc_int32 ccs_credentials_list_destroy(cc_credentials_list_head_t* head) ;
+cc_int32 ccs_credentials_list_copy(cc_credentials_list_head_t* head, cc_credentials_list_head_t**) ;
+
+
+cc_int32 ccs_context_new(int api_version, cc_auth_info_t* auth_info, cc_session_info_t* session_info, cc_server_context_t** ) ;
+cc_int32 ccs_context_get_default_ccache_name(cc_server_context_t* ctx, char **);
+cc_int32 ccs_context_find_ccache(cc_server_context_t* ctx, char *name, cc_server_ccache_t**);
+cc_int32 ccs_context_open_ccache(cc_server_context_t* ctx, char *name, cc_server_ccache_t** );
+cc_int32 ccs_context_create_ccache(cc_server_context_t* ctx, char *name, int creds_version, char *principal, cc_server_ccache_t**);
+cc_int32 ccs_context_create_default_ccache(cc_server_context_t* ctx, int creds_version, char *principal, cc_server_ccache_t**);
+cc_int32 ccs_context_ccache_iterator(cc_server_context_t* ctx, cc_ccache_iterate_t**);
+cc_int32 ccs_context_compare(cc_server_context_t* a, cc_server_context_t* b);
+cc_int32 ccs_context_destroy(cc_server_context_t* ctx);
+cc_int32 ccs_context_rem_ccache(cc_server_context_t* ctx, cc_server_ccache_t* ccache);
+
+cc_int32 ccs_ccache_new(char *name, char *principal, int cred_vers, cc_server_ccache_t**);
+cc_int32 ccs_ccache_check_version(const cc_server_ccache_t *ccache, const cc_credentials_union* creds, cc_uint32* compat);
+cc_int32 ccs_ccache_check_principal(const cc_server_ccache_t *ccache, const cc_credentials_union* creds, cc_uint32* compat);
+cc_int32 ccs_ccache_store_creds(cc_server_ccache_t *ccache, const cc_credentials_union* credentials);
+cc_int32 ccs_ccache_rem_creds(cc_server_ccache_t *ccache, const cc_credentials_union* credentials);
+cc_int32 ccs_ccache_move(cc_server_ccache_t *source, cc_server_ccache_t* destination);
+cc_int32 ccs_ccache_get_kdc_time_offset(cc_server_ccache_t* ccache, cc_time64* offset);
+cc_int32 ccs_ccache_set_kdc_time_offset(cc_server_ccache_t* ccache, cc_time64 offset);
+cc_int32 ccs_ccache_clear_kdc_time_offset(cc_server_ccache_t* ccache);
+cc_int32 ccs_ccache_new_iterator(cc_server_ccache_t* ccache, cc_credentials_iterate_t** iterator);
+cc_int32 ccs_ccache_get_principal(cc_server_ccache_t* ccache, cc_int32 version, char ** principal);
+cc_int32 ccs_ccache_set_principal(cc_server_ccache_t* ccache, cc_int32 version, char * principal);
+cc_int32 ccs_ccache_free_principal(char * principal);
+cc_int32 ccs_ccache_destroy(cc_server_ccache_t* ccache);
+void ccs_ccache_changed(cc_server_ccache_t* ccache);
+cc_int32 ccs_ccache_compare(cc_server_ccache_t* ccache1, cc_server_ccache_t* ccache2, cc_uint32 *result);
#endif /*__CCDATASTOREH__*/
--- /dev/null
+/* $Copyright:\r
+ *\r
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.\r
+ * \r
+ * All rights reserved.\r
+ * \r
+ * Export of this software from the United States of America may require a\r
+ * specific license from the United States Government. It is the\r
+ * responsibility of any person or organization contemplating export to\r
+ * obtain such a license before exporting.\r
+ * \r
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute\r
+ * this software and its documentation for any purpose and without fee is\r
+ * hereby granted, provided that the above copyright notice appear in all\r
+ * copies and that both that copyright notice and this permission notice\r
+ * appear in supporting documentation, and that the name of M.I.T. not be\r
+ * used in advertising or publicity pertaining to distribution of the\r
+ * software without specific, written prior permission. Furthermore if you\r
+ * modify this software you must label your software as modified software\r
+ * and not distribute it in such a fashion that it might be confused with\r
+ * the original MIT software. M.I.T. makes no representations about the\r
+ * suitability of this software for any purpose. It is provided "as is"\r
+ * without express or implied warranty.\r
+ * \r
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED\r
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF\r
+ * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\r
+ * \r
+ * Individual source code files are copyright MIT, Cygnus Support,\r
+ * OpenVision, Oracle, Sun Soft, FundsXpress, and others.\r
+ * \r
+ * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,\r
+ * and Zephyr are trademarks of the Massachusetts Institute of Technology\r
+ * (MIT). No commercial use of these trademarks may be made without prior\r
+ * written permission of MIT.\r
+ * \r
+ * "Commercial use" means use of a name in a product or other for-profit\r
+ * manner. It does NOT prevent a commercial firm from referring to the MIT\r
+ * trademarks in order to convey information (although in doing so,\r
+ * recognition of their trademark status should be given).\r
+ * $\r
+ */\r
+/*\r
+ * Prototypes and data structures for datastore.\r
+ *\r
+ */\r
+\r
+\r
+#ifndef __CC_GENERIC_LISTS_H_\r
+#define __CC_GENERIC_LISTS_H_\r
+\r
+enum cc_list_type {\r
+ generic = 0,\r
+ context,\r
+ cache,\r
+ credentials\r
+};\r
+\r
+struct cc_generic_list_node_t {\r
+ cc_uint8* data;\r
+ cc_uint32 len;\r
+ struct cc_generic_list_node_t* next;\r
+ struct cc_generic_list_node_t* prev;\r
+};\r
+typedef struct cc_generic_list_node_t cc_generic_list_node_t;\r
+\r
+struct cc_generic_list_head_t {\r
+ enum cc_list_type type;\r
+ cc_generic_list_node_t* head;\r
+ cc_generic_list_node_t* tail; \r
+}; \r
+typedef struct cc_generic_list_head_t cc_generic_list_head_t;\r
+\r
+\r
+struct cc_generic_iterate_t {\r
+ cc_generic_list_node_t* next;\r
+};\r
+typedef struct cc_generic_iterate_t cc_generic_iterate_t;\r
+\r
+typedef cc_generic_list_head_t cc_context_list_head_t;\r
+typedef cc_generic_list_node_t cc_context_list_node_t;\r
+\r
+typedef cc_generic_list_head_t cc_ccache_list_head_t;\r
+typedef cc_generic_list_node_t cc_ccache_list_node_t;\r
+\r
+typedef cc_generic_list_head_t cc_credentials_list_head_t;\r
+typedef cc_generic_list_node_t cc_credentials_list_node_t;\r
+\r
+cc_int32 cci_generic_iterate_has_next(cc_generic_iterate_t *iterate);\r
+cc_int32 cci_generic_iterate_next(cc_generic_iterate_t *iterate, cc_generic_list_node_t**);\r
+\r
+cc_int32 cci_generic_list_new(cc_generic_list_head_t **);\r
+cc_int32 cci_generic_list_append(cc_generic_list_head_t *head, void *data, cc_uint32 len, cc_generic_list_node_t**);\r
+cc_int32 cci_generic_list_prepend(cc_generic_list_head_t *head, void *data, cc_uint32 len, cc_generic_list_node_t**);\r
+cc_int32 cci_generic_list_remove_element(cc_generic_list_head_t* head, cc_generic_list_node_t* rem);\r
+cc_int32 cci_generic_free_element(cc_generic_list_node_t* node);\r
+cc_int32 cci_generic_list_destroy(cc_generic_list_head_t* head);\r
+cc_int32 cci_generic_list_copy(cc_generic_list_head_t* head, cc_generic_list_head_t**);\r
+cc_int32 cci_generic_list_iterator(cc_generic_list_head_t *head, cc_generic_iterate_t**);\r
+cc_int32 cci_generic_free_iterator(cc_generic_iterate_t* iterator);\r
+\r
+#endif /* __CC_GENERIC_LISTS_H_ */\r
/* $Copyright:
*
- * Copyright 2004 by the Massachusetts Institute of Technology.
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.
*
* All rights reserved.
*
* $
*/
-#define FLAT_CREDS_V5_VERSION 1
struct cc_flat_data {
cc_uint32 type;
cc_uint32 length;
};
typedef struct cc_flat_data cc_flat_data;
+#define FLAT_CREDS_V5_VERSION 1
struct cci_flat_creds_v5 {
cc_uint32 version; /* version of this structure */
cc_flat_data client;
cc_flat_data server;
cc_flat_data keyblock;
- cc_time_t authtime;
- cc_time_t starttime;
- cc_time_t endtime;
- cc_time_t renew_till;
+ cc_time64 authtime;
+ cc_time64 starttime;
+ cc_time64 endtime;
+ cc_time64 renew_till;
cc_uint32 is_skey;
cc_uint32 ticket_flags;
cc_uint32 address_count;
cc_uint32 authdata_count;
cc_uint32 authdata; /* offset to array */
};
+typedef struct cci_flat_creds_v5 cci_flat_creds_v5_t;
+
+struct cci_flat_creds_v4 {
+ cc_uint32 version;
+ char principal [cc_v4_name_size];
+ char principal_instance [cc_v4_instance_size];
+ char service [cc_v4_name_size];
+ char service_instance [cc_v4_instance_size];
+ char realm [cc_v4_realm_size];
+ unsigned char session_key [cc_v4_key_size];
+ cc_int32 kvno;
+ cc_int32 string_to_key_type;
+ cc_time64 issue_date;
+ cc_int32 lifetime;
+ cc_uint32 address;
+ cc_int32 ticket_size;
+ unsigned char ticket [cc_v4_ticket_size];
+};
+typedef struct cci_flat_creds_v4 cci_flat_creds_v4_t;
cc_int32
cci_creds_v4_marshall( cc_credentials_v4_t * creds,
/* $Copyright:
*
- * Copyright 2004 by the Massachusetts Institute of Technology.
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.
*
* All rights reserved.
*
/*
* Verifiable, extensible message format.
- *
+ *
* Format:
* <size of header block (header_len)>
* <size of *entire* message, including previous field (flat_len)>
* If the header has variable length data it is included in the data blobs.
* The header field has the offset from the beginning of the message of the 1st
* byte of the data and the length of the data.
- *
*/
#ifndef __CC_MSG_H__
#define __CC_MSG_H__
#include "CredentialsCache.h"
+#include "generic_lists.h"
struct cc_msg_t {
cc_uint32 type; /*type of message*/
ccmsg_CTX_RELEASE,
ccmsg_CTX_GET_CHANGE_TIME,
ccmsg_CTX_GET_DEFAULT_CCACHE_NAME,
- ccmsg_CTX_COMPARE,
+ ccmsg_CTX_CCACHE_OPEN,
+ ccmsg_CTX_CCACHE_OPEN_DEFAULT,
+ ccmsg_CTX_CCACHE_CREATE,
+ ccmsg_CTX_CCACHE_CREATE_DEFAULT,
+ ccmsg_CTX_CCACHE_CREATE_UNIQUE,
ccmsg_CTX_NEW_CCACHE_ITERATOR,
ccmsg_CTX_LOCK,
ccmsg_CTX_UNLOCK,
- ccmsg_CTX_CLONE,
- ccmsg_CCACHE_OPEN,
- ccmsg_CCACHE_OPEN_DEFAULT,
- ccmsg_CCACHE_CREATE,
- ccmsg_CCACHE_CREATE_DEFAULT,
- ccmsg_CCACHE_CREATE_UNIQUE,
+ ccmsg_CTX_COMPARE,
ccmsg_CCACHE_RELEASE,
ccmsg_CCACHE_DESTROY,
ccmsg_CCACHE_SET_DEFAULT,
ccmsg_CCACHE_GET_NAME,
ccmsg_CCACHE_GET_PRINCIPAL,
ccmsg_CCACHE_SET_PRINCIPAL,
- ccmsg_CCACHE_CREDS_ITERATOR,
+ ccmsg_CCACHE_NEW_CREDS_ITERATOR,
ccmsg_CCACHE_STORE_CREDS,
ccmsg_CCACHE_REM_CREDS,
+ ccmsg_CCACHE_MOVE,
+ ccmsg_CCACHE_LOCK,
+ ccmsg_CCACHE_UNLOCK,
ccmsg_CCACHE_GET_LAST_DEFAULT_TIME,
ccmsg_CCACHE_GET_CHANGE_TIME,
- ccmsg_CCACHE_MOVE,
ccmsg_CCACHE_COMPARE,
ccmsg_CCACHE_GET_KDC_TIME_OFFSET,
ccmsg_CCACHE_SET_KDC_TIME_OFFSET,
ccmsg_CCACHE_CLEAR_KDC_TIME_OFFSET,
ccmsg_CCACHE_ITERATOR_RELEASE,
ccmsg_CCACHE_ITERATOR_NEXT,
- ccmsg_CCACHE_LOCK,
- ccmsg_CCACHE_UNLOCK,
+ ccmsg_CCACHE_ITERATOR_CLONE,
ccmsg_CREDS_ITERATOR_RELEASE,
ccmsg_CREDS_ITERATOR_NEXT,
- ccmsg_CREDS_RELEASE,
- ccmsg_CREDS_V4,
- ccmsg_CREDS_V5
+ ccmsg_CREDS_ITERATOR_CLONE
};
#define CC_MSG_MAX_SIZE 1073741824 /*2^30*/
-#define CC_MSG_MAX_TYPE ccmsg_CREDS_V5
+#define CC_MSG_MAX_TYPE ccmsg_CREDS_ITERATOR_CLONE
#define BLOB_LEN (sizeof(cc_uint32))
#define MAGIC_DATA_LEN (sizeof(cc_uint32))
#define MAGIC_HEAD_LEN (sizeof(cc_uint32))
cc_int32 cci_msg_calc_magic(void *flat, int flat_len, cc_uint32 * sizep);
cc_int32 cci_msg_verify(void* flat, int flat_len, cc_uint32 * sizep);
cc_int32 cci_msg_unflatten(void *flat, int flat_len, cc_msg_t** msgpp);
-cc_int32 cci_msg_retrieve_blob(cc_msg_t* msg, cc_uint32 blob_offset, cc_uint32 blob_len, void **);
+cc_int32 cci_msg_retrieve_blob(cc_msg_t* msg, cc_uint32 blob_offset, cc_uint32 blob_len, char **);
cc_int32 cci_msg_destroy(cc_msg_t* msg);
+
+/* Add missing byte swapping macros for 64-bit values */
+#ifdef MAC
+#define htonll(x) OSSwapHostToBigInt64(x)
+#define ntohll(x) OSSwapBigToHostInt64(x)
+#else
+#ifdef _WIN32
+#ifdef _M_IX86
+#define htonll(x) _byteswap_uint64(x)
+#define ntohll(x) _byteswap_uint64(x)
+#else
+#define htonll(x) (x)
+#define ntohll(x) (x)
+#endif
+#endif
+#endif
+
#endif /*__CC_MSG_H__*/
/* $Copyright:
*
- * Copyright 2004 by the Massachusetts Institute of Technology.
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.
*
* All rights reserved.
*
* size divisible by 4. This is to ensure correct alignment
* and stop different compilers from inserting padding bytes in
* different places.
+ *
+ * All values are stored in network byte order.
*/
struct ccmsg_ctx_only_t {
typedef struct ccmsg_init_t ccmsg_init_t;
typedef struct ccmsg_init_resp_t ccmsg_init_resp_t;
-struct ccmsg_clone_t {
+struct ccmsg_ctx_clone_t {
cc_handle ctx;
cc_uint32 in_version; /*client API version*/
};
-struct ccmsg_clone_resp_t {
+struct ccmsg_ctx_clone_resp_t {
cc_handle out_ctx; /*handle on this ctx*/
cc_uint32 out_version; /*server API version*/
cc_uint32 vendor_offset; /*offset of vendor blob*/
cc_uint32 vendor_length; /*length of vendor blob*/
};
-typedef struct ccmsg_clone_t ccmsg_clone_t;
-typedef struct ccmsg_clone_resp_t ccmsg_clone_resp_t;
+typedef struct ccmsg_ctx_clone_t ccmsg_ctx_clone_t;
+typedef struct ccmsg_ctx_clone_resp_t ccmsg_ctx_clone_resp_t;
struct ccmsg_ctx_release_t {
cc_handle ctx; /*# of ctx to release*/
cc_handle ctx;
};
struct ccmsg_ctx_get_change_time_resp_t {
- cc_time_t time;
+ cc_time64 time;
};
typedef struct ccmsg_ctx_get_change_time_t ccmsg_ctx_get_change_time_t;
typedef struct ccmsg_ctx_get_change_time_resp_t ccmsg_ctx_get_change_time_resp_t;
cc_handle ccache;
};
struct ccmsg_ccache_get_last_default_time_resp_t {
- cc_time_t last_default_time;
+ cc_time64 last_default_time;
};
typedef struct ccmsg_ccache_get_last_default_time_t ccmsg_ccache_get_last_default_time_t;
typedef struct ccmsg_ccache_get_last_default_time_resp_t ccmsg_ccache_get_last_default_time_resp_t;
cc_handle ccache;
};
struct ccmsg_ccache_get_change_time_resp_t {
- cc_time_t time;
+ cc_time64 time;
};
typedef struct ccmsg_ccache_get_change_time_t ccmsg_ccache_get_change_time_t;
typedef struct ccmsg_ccache_get_change_time_resp_t ccmsg_ccache_get_change_time_resp_t;
cc_int32 creds_version;
};
struct ccmsg_ccache_get_kdc_time_offset_resp_t {
- cc_time_t offset;
+ cc_time64 offset;
};
typedef struct ccmsg_ccache_get_kdc_time_offset_t ccmsg_ccache_get_kdc_time_offset_t;
typedef struct ccmsg_ccache_get_kdc_time_offset_resp_t ccmsg_ccache_get_kdc_time_offset_resp_t;
struct ccmsg_ccache_set_kdc_time_offset_t {
cc_handle ctx;
cc_handle ccache;
- cc_time_t offset;
+ cc_time64 offset;
cc_int32 creds_version;
};
typedef struct ccmsg_ccache_set_kdc_time_offset_t ccmsg_ccache_set_kdc_time_offset_t;
typedef struct ccmsg_ccache_iterator_next_t ccmsg_ccache_iterator_next_t;
typedef struct ccmsg_ccache_iterator_next_resp_t ccmsg_ccache_iterator_next_resp_t;
+struct ccmsg_ccache_iterator_clone_t {
+ cc_handle ctx;
+ cc_handle iterator;
+};
+struct ccmsg_ccache_iterator_clone_resp_t {
+ cc_handle iterator;
+};
+typedef struct ccmsg_ccache_iterator_clone_t ccmsg_ccache_iterator_clone_t;
+typedef struct ccmsg_ccache_iterator_clone_resp_t ccmsg_ccache_iterator_clone_resp_t;
+
struct ccmsg_creds_iterator_release_t {
cc_handle ctx;
cc_handle ccache;
typedef struct ccmsg_creds_iterator_next_t ccmsg_creds_iterator_next_t;
typedef struct ccmsg_creds_iterator_next_resp_t ccmsg_creds_iterator_next_resp_t;
-struct ccmsg_creds_v4_t {
- cc_uint32 offset;
- cc_uint32 len;
-};
-typedef struct ccmsg_creds_v4_t ccmsg_creds_v4_t;
-
-struct ccmsg_creds_v5_t {
- cc_uint32 client_offset;
- cc_uint32 client_len;
- cc_uint32 server_offset;
- cc_uint32 server_len;
- cc_uint32 keyblock_offset;
- cc_uint32 keyblock_len;
- cc_time_t authtime;
- cc_time_t starttime;
- cc_time_t endtime;
- cc_time_t renewtime;
- cc_uint32 is_skey;
- cc_uint32 ticket_flags;
- cc_uint32 address_count;
- cc_uint32 address_offset;
- cc_uint32 address_len;
- cc_uint32 ticket_offset;
- cc_uint32 ticket_len;
- cc_uint32 ticket2_offset;
- cc_uint32 ticket2_len;
- cc_uint32 authdata_count;
- cc_uint32 authdata_offset;
- cc_uint32 authdata_len;
-};
-typedef struct ccmsg_creds_v5_t ccmsg_creds_v5_t;
-
+struct ccmsg_creds_iterator_clone_t {
+ cc_handle ctx;
+ cc_handle iterator;
+};
+struct ccmsg_creds_iterator_clone_resp_t {
+ cc_handle iterator;
+};
+typedef struct ccmsg_creds_iterator_clone_t ccmsg_creds_iterator_clone_t;
+typedef struct ccmsg_creds_iterator_clone_resp_t ccmsg_creds_iterator_clone_resp_t;
#endif /*__MSG_HEADERS_H__*/
/* $Copyright:
*
- * Copyright 2004 by the Massachusetts Institute of Technology.
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.
*
* All rights reserved.
*
};
typedef struct cc_session_info_t cc_session_info_t;
-cc_int32 cci_rpc_is_authorized(cc_auth_info_t* msg_auth, cc_session_info_t* msg_session, cc_auth_info_t* stored_auth, cc_session_info_t* stored_session, cc_uint32 *authorizedp);
+cc_int32 ccs_rpc_is_authorized(cc_auth_info_t* msg_auth, cc_session_info_t* msg_session, cc_auth_info_t* stored_auth, cc_session_info_t* stored_session, cc_uint32 *authorizedp);
#endif /*__RPC_AUTH_H__*/
--- /dev/null
+// !$*UTF8*$!
+{
+ 08FB7793FE84155DC02AAC07 /* Project object */ = {
+ activeBuildConfigurationName = Debug;
+ activeExecutable = A1E70D5E0A38B796007BE3E3 /* CCacheServer */;
+ activeTarget = A1E70D5C0A38B796007BE3E3 /* CCacheServer */;
+ addToTargets = (
+ );
+ breakpoints = (
+ );
+ breakpointsGroup = A1E70D500A38B5F3007BE3E3 /* XCBreakpointsBucket */;
+ codeSenseManager = A1E70CFE0A38B536007BE3E3 /* Code sense */;
+ executables = (
+ A1E70D5E0A38B796007BE3E3 /* CCacheServer */,
+ );
+ perUserDictionary = {
+ PBXConfiguration.PBXFileTableDataSource3.PBXFileTableDataSource = {
+ PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
+ PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
+ PBXFileTableDataSourceColumnWidthsKey = (
+ 20,
+ 811,
+ 20,
+ 48,
+ 43,
+ 43,
+ 20,
+ );
+ PBXFileTableDataSourceColumnsKey = (
+ PBXFileDataSource_FiletypeID,
+ PBXFileDataSource_Filename_ColumnID,
+ PBXFileDataSource_Built_ColumnID,
+ PBXFileDataSource_ObjectSize_ColumnID,
+ PBXFileDataSource_Errors_ColumnID,
+ PBXFileDataSource_Warnings_ColumnID,
+ PBXFileDataSource_Target_ColumnID,
+ );
+ };
+ PBXConfiguration.PBXTargetDataSource.PBXTargetDataSource = {
+ PBXFileTableDataSourceColumnSortingDirectionKey = "-1";
+ PBXFileTableDataSourceColumnSortingKey = PBXFileDataSource_Filename_ColumnID;
+ PBXFileTableDataSourceColumnWidthsKey = (
+ 20,
+ 200,
+ 608,
+ 20,
+ 48,
+ 43,
+ 43,
+ );
+ PBXFileTableDataSourceColumnsKey = (
+ PBXFileDataSource_FiletypeID,
+ PBXFileDataSource_Filename_ColumnID,
+ PBXTargetDataSource_PrimaryAttribute,
+ PBXFileDataSource_Built_ColumnID,
+ PBXFileDataSource_ObjectSize_ColumnID,
+ PBXFileDataSource_Errors_ColumnID,
+ PBXFileDataSource_Warnings_ColumnID,
+ );
+ };
+ PBXPerProjectTemplateStateSaveDate = 171582174;
+ PBXWorkspaceStateSaveDate = 171582174;
+ };
+ perUserProjectItems = {
+ A1E70DF70A38C765007BE3E3 /* PBXTextBookmark */ = A1E70DF70A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70DF80A38C765007BE3E3 /* PBXTextBookmark */ = A1E70DF80A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70DF90A38C765007BE3E3 /* PBXTextBookmark */ = A1E70DF90A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70DFA0A38C765007BE3E3 /* PBXTextBookmark */ = A1E70DFA0A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70DFB0A38C765007BE3E3 /* PBXTextBookmark */ = A1E70DFB0A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70DFD0A38C765007BE3E3 /* PBXTextBookmark */ = A1E70DFD0A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E010A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E010A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E020A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E020A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E060A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E060A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E090A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E090A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E0A0A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E0A0A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E0B0A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E0B0A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E0C0A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E0C0A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E100A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E100A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E110A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E110A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E120A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E120A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E130A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E130A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E140A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E140A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E150A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E150A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E160A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E160A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E170A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E170A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E180A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E180A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E1B0A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E1B0A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E1E0A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E1E0A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E1F0A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E1F0A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E200A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E200A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E250A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E250A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E260A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E260A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E290A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E290A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E2A0A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E2A0A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E2B0A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E2B0A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E2D0A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E2D0A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E2E0A38C765007BE3E3 /* PBXTextBookmark */ = A1E70E2E0A38C765007BE3E3 /* PBXTextBookmark */;
+ A1E70E380A38C778007BE3E3 /* PBXTextBookmark */ = A1E70E380A38C778007BE3E3 /* PBXTextBookmark */;
+ A1E70E3D0A38C78C007BE3E3 /* PBXTextBookmark */ = A1E70E3D0A38C78C007BE3E3 /* PBXTextBookmark */;
+ A1E70E410A38C78C007BE3E3 /* PBXTextBookmark */ = A1E70E410A38C78C007BE3E3 /* PBXTextBookmark */;
+ A1E70E430A38C791007BE3E3 /* PBXTextBookmark */ = A1E70E430A38C791007BE3E3 /* PBXTextBookmark */;
+ A1E70E450A38C791007BE3E3 /* PBXTextBookmark */ = A1E70E450A38C791007BE3E3 /* PBXTextBookmark */;
+ A1E70E4A0A38C7BE007BE3E3 /* PBXTextBookmark */ = A1E70E4A0A38C7BE007BE3E3 /* PBXTextBookmark */;
+ A1E70E520A38C9FD007BE3E3 /* PBXTextBookmark */ = A1E70E520A38C9FD007BE3E3 /* PBXTextBookmark */;
+ A1E70E530A38C9FD007BE3E3 /* PBXTextBookmark */ = A1E70E530A38C9FD007BE3E3 /* PBXTextBookmark */;
+ A1E70E560A38C9FD007BE3E3 /* PBXTextBookmark */ = A1E70E560A38C9FD007BE3E3 /* PBXTextBookmark */;
+ A1E70E580A38C9FD007BE3E3 /* PBXTextBookmark */ = A1E70E580A38C9FD007BE3E3 /* PBXTextBookmark */;
+ A1E70E6F0A38CA08007BE3E3 /* PBXTextBookmark */ = A1E70E6F0A38CA08007BE3E3 /* PBXTextBookmark */;
+ A1E70E770A38CA55007BE3E3 /* PBXTextBookmark */ = A1E70E770A38CA55007BE3E3 /* PBXTextBookmark */;
+ A1E70E7D0A38CA55007BE3E3 /* PBXTextBookmark */ = A1E70E7D0A38CA55007BE3E3 /* PBXTextBookmark */;
+ A1E70E9C0A38CAF1007BE3E3 /* PBXTextBookmark */ = A1E70E9C0A38CAF1007BE3E3 /* PBXTextBookmark */;
+ A1E70EA80A38CB24007BE3E3 /* PBXTextBookmark */ = A1E70EA80A38CB24007BE3E3 /* PBXTextBookmark */;
+ A1E70EAB0A38CB24007BE3E3 /* PBXTextBookmark */ = A1E70EAB0A38CB24007BE3E3 /* PBXTextBookmark */;
+ A1E70EB50A38CB4D007BE3E3 /* PBXTextBookmark */ = A1E70EB50A38CB4D007BE3E3 /* PBXTextBookmark */;
+ A1E70EC30A38CC14007BE3E3 /* PBXTextBookmark */ = A1E70EC30A38CC14007BE3E3 /* PBXTextBookmark */;
+ A1E70ECB0A38CC4C007BE3E3 /* PBXTextBookmark */ = A1E70ECB0A38CC4C007BE3E3 /* PBXTextBookmark */;
+ A1E70ED70A38CCB6007BE3E3 /* PBXTextBookmark */ = A1E70ED70A38CCB6007BE3E3 /* PBXTextBookmark */;
+ A1E70EE20A38CCD6007BE3E3 /* PBXTextBookmark */ = A1E70EE20A38CCD6007BE3E3 /* PBXTextBookmark */;
+ A1E70EFE0A38CD66007BE3E3 /* PBXTextBookmark */ = A1E70EFE0A38CD66007BE3E3 /* PBXTextBookmark */;
+ A1E70F0F0A38CE21007BE3E3 /* PBXTextBookmark */ = A1E70F0F0A38CE21007BE3E3 /* PBXTextBookmark */;
+ A1E70F440A38D252007BE3E3 /* PBXTextBookmark */ = A1E70F440A38D252007BE3E3 /* PBXTextBookmark */;
+ A1E70F450A38D252007BE3E3 /* PBXTextBookmark */ = A1E70F450A38D252007BE3E3 /* PBXTextBookmark */;
+ A1E70F8B0A38D3B4007BE3E3 /* PBXTextBookmark */ = A1E70F8B0A38D3B4007BE3E3 /* PBXTextBookmark */;
+ A1E70F9C0A38D41E007BE3E3 /* PBXTextBookmark */ = A1E70F9C0A38D41E007BE3E3 /* PBXTextBookmark */;
+ A1E70F9D0A38D41E007BE3E3 /* PBXTextBookmark */ = A1E70F9D0A38D41E007BE3E3 /* PBXTextBookmark */;
+ A1E70FC60A38D560007BE3E3 /* PBXTextBookmark */ = A1E70FC60A38D560007BE3E3 /* PBXTextBookmark */;
+ A1E70FC80A38D560007BE3E3 /* PBXTextBookmark */ = A1E70FC80A38D560007BE3E3 /* PBXTextBookmark */;
+ A1E70FC90A38D560007BE3E3 /* PBXTextBookmark */ = A1E70FC90A38D560007BE3E3 /* PBXTextBookmark */;
+ A1E70FCA0A38D560007BE3E3 /* PBXTextBookmark */ = A1E70FCA0A38D560007BE3E3 /* PBXTextBookmark */;
+ A1E70FCD0A38D560007BE3E3 /* PBXTextBookmark */ = A1E70FCD0A38D560007BE3E3 /* PBXTextBookmark */;
+ A1E70FD80A38D573007BE3E3 /* PBXTextBookmark */ = A1E70FD80A38D573007BE3E3 /* PBXTextBookmark */;
+ A1E70FEE0A38D7C0007BE3E3 /* PBXTextBookmark */ = A1E70FEE0A38D7C0007BE3E3 /* PBXTextBookmark */;
+ A1E70FEF0A38D7C0007BE3E3 /* PBXTextBookmark */ = A1E70FEF0A38D7C0007BE3E3 /* PBXTextBookmark */;
+ A1E70FF00A38D7C0007BE3E3 /* PBXTextBookmark */ = A1E70FF00A38D7C0007BE3E3 /* PBXTextBookmark */;
+ A1E70FFA0A38D806007BE3E3 /* PBXTextBookmark */ = A1E70FFA0A38D806007BE3E3 /* PBXTextBookmark */;
+ A1E70FFC0A38D806007BE3E3 /* PBXTextBookmark */ = A1E70FFC0A38D806007BE3E3 /* PBXTextBookmark */;
+ A1E70FFF0A38D806007BE3E3 /* PBXTextBookmark */ = A1E70FFF0A38D806007BE3E3 /* PBXTextBookmark */;
+ A1E710010A38D814007BE3E3 /* PBXTextBookmark */ = A1E710010A38D814007BE3E3 /* PBXTextBookmark */;
+ A1E7100A0A38D888007BE3E3 /* PBXTextBookmark */ = A1E7100A0A38D888007BE3E3 /* PBXTextBookmark */;
+ A1E7100C0A38D888007BE3E3 /* PBXTextBookmark */ = A1E7100C0A38D888007BE3E3 /* PBXTextBookmark */;
+ A1E7100D0A38D888007BE3E3 /* PBXTextBookmark */ = A1E7100D0A38D888007BE3E3 /* PBXTextBookmark */;
+ A1E710110A38D888007BE3E3 /* PBXTextBookmark */ = A1E710110A38D888007BE3E3 /* PBXTextBookmark */;
+ A1E710140A38D888007BE3E3 /* PBXTextBookmark */ = A1E710140A38D888007BE3E3 /* PBXTextBookmark */;
+ A1E7103C0A38DE0B007BE3E3 /* PBXTextBookmark */ = A1E7103C0A38DE0B007BE3E3 /* PBXTextBookmark */;
+ A1E710400A38DE0B007BE3E3 /* PBXTextBookmark */ = A1E710400A38DE0B007BE3E3 /* PBXTextBookmark */;
+ A1E710530A39EC0B007BE3E3 /* PBXTextBookmark */ = A1E710530A39EC0B007BE3E3 /* PBXTextBookmark */;
+ A1E7105A0A39ED89007BE3E3 /* PBXTextBookmark */ = A1E7105A0A39ED89007BE3E3 /* PBXTextBookmark */;
+ A1E7105D0A39ED89007BE3E3 /* PBXTextBookmark */ = A1E7105D0A39ED89007BE3E3 /* PBXTextBookmark */;
+ A1E7105E0A39ED89007BE3E3 /* PBXTextBookmark */ = A1E7105E0A39ED89007BE3E3 /* PBXTextBookmark */;
+ A1E710680A39F102007BE3E3 /* PBXTextBookmark */ = A1E710680A39F102007BE3E3 /* PBXTextBookmark */;
+ A1E710840A3A1CFB007BE3E3 /* PBXTextBookmark */ = A1E710840A3A1CFB007BE3E3 /* PBXTextBookmark */;
+ A1E710860A3A1CFB007BE3E3 /* PBXTextBookmark */ = A1E710860A3A1CFB007BE3E3 /* PBXTextBookmark */;
+ A1E710870A3A1CFB007BE3E3 /* PBXTextBookmark */ = A1E710870A3A1CFB007BE3E3 /* PBXTextBookmark */;
+ A1E710890A3A1D04007BE3E3 /* PBXTextBookmark */ = A1E710890A3A1D04007BE3E3 /* PBXTextBookmark */;
+ A1E7108B0A3A1D04007BE3E3 /* PBXTextBookmark */ = A1E7108B0A3A1D04007BE3E3 /* PBXTextBookmark */;
+ A1E7108D0A3A1D06007BE3E3 /* PBXTextBookmark */ = A1E7108D0A3A1D06007BE3E3 /* PBXTextBookmark */;
+ A1E710930A3A1D22007BE3E3 /* PBXTextBookmark */ = A1E710930A3A1D22007BE3E3 /* PBXTextBookmark */;
+ A1E710940A3A1D22007BE3E3 /* PBXTextBookmark */ = A1E710940A3A1D22007BE3E3 /* PBXTextBookmark */;
+ A1E710950A3A1D22007BE3E3 /* PBXTextBookmark */ = A1E710950A3A1D22007BE3E3 /* PBXTextBookmark */;
+ A1E710960A3A1D22007BE3E3 /* PBXTextBookmark */ = A1E710960A3A1D22007BE3E3 /* PBXTextBookmark */;
+ A1E710970A3A1D22007BE3E3 /* PBXTextBookmark */ = A1E710970A3A1D22007BE3E3 /* PBXTextBookmark */;
+ A1E7109C0A3A1D2B007BE3E3 /* PBXTextBookmark */ = A1E7109C0A3A1D2B007BE3E3 /* PBXTextBookmark */;
+ A1E7109D0A3A1D2B007BE3E3 /* PBXTextBookmark */ = A1E7109D0A3A1D2B007BE3E3 /* PBXTextBookmark */;
+ A1E7109F0A3A1DD0007BE3E3 /* PBXTextBookmark */ = A1E7109F0A3A1DD0007BE3E3 /* PBXTextBookmark */;
+ A1E710A00A3A1DD0007BE3E3 /* PBXTextBookmark */ = A1E710A00A3A1DD0007BE3E3 /* PBXTextBookmark */;
+ A1E710A50A3A22E1007BE3E3 /* PBXTextBookmark */ = A1E710A50A3A22E1007BE3E3 /* PBXTextBookmark */;
+ A1E710AB0A3A22F5007BE3E3 /* PBXTextBookmark */ = A1E710AB0A3A22F5007BE3E3 /* PBXTextBookmark */;
+ A1E710AC0A3A22F5007BE3E3 /* PBXTextBookmark */ = A1E710AC0A3A22F5007BE3E3 /* PBXTextBookmark */;
+ A1E710AD0A3A22F5007BE3E3 /* PBXTextBookmark */ = A1E710AD0A3A22F5007BE3E3 /* PBXTextBookmark */;
+ A1E710AF0A3A22FE007BE3E3 /* PBXTextBookmark */ = A1E710AF0A3A22FE007BE3E3 /* PBXTextBookmark */;
+ A1E710B30A3A22FF007BE3E3 /* PBXTextBookmark */ = A1E710B30A3A22FF007BE3E3 /* PBXTextBookmark */;
+ A1E710B90A3A23FB007BE3E3 /* PBXTextBookmark */ = A1E710B90A3A23FB007BE3E3 /* PBXTextBookmark */;
+ A1E710BC0A3A2415007BE3E3 /* PBXTextBookmark */ = A1E710BC0A3A2415007BE3E3 /* PBXTextBookmark */;
+ A1E710BD0A3A2415007BE3E3 /* PBXTextBookmark */ = A1E710BD0A3A2415007BE3E3 /* PBXTextBookmark */;
+ A1E710BE0A3A2415007BE3E3 /* PBXTextBookmark */ = A1E710BE0A3A2415007BE3E3 /* PBXTextBookmark */;
+ A1E710BF0A3A2415007BE3E3 /* PBXTextBookmark */ = A1E710BF0A3A2415007BE3E3 /* PBXTextBookmark */;
+ A1E710C00A3A2415007BE3E3 /* PBXTextBookmark */ = A1E710C00A3A2415007BE3E3 /* PBXTextBookmark */;
+ A1E710C60A3A2441007BE3E3 /* PBXTextBookmark */ = A1E710C60A3A2441007BE3E3 /* PBXTextBookmark */;
+ A1E710C70A3A2441007BE3E3 /* PBXTextBookmark */ = A1E710C70A3A2441007BE3E3 /* PBXTextBookmark */;
+ A1E710C80A3A2441007BE3E3 /* PBXTextBookmark */ = A1E710C80A3A2441007BE3E3 /* PBXTextBookmark */;
+ A1E710C90A3A2441007BE3E3 /* PBXTextBookmark */ = A1E710C90A3A2441007BE3E3 /* PBXTextBookmark */;
+ A1E710CA0A3A244D007BE3E3 /* PBXTextBookmark */ = A1E710CA0A3A244D007BE3E3 /* PBXTextBookmark */;
+ A1E710CB0A3A244D007BE3E3 /* PBXTextBookmark */ = A1E710CB0A3A244D007BE3E3 /* PBXTextBookmark */;
+ A1E710CC0A3A244D007BE3E3 /* PBXTextBookmark */ = A1E710CC0A3A244D007BE3E3 /* PBXTextBookmark */;
+ A1E710CD0A3A244D007BE3E3 /* PBXTextBookmark */ = A1E710CD0A3A244D007BE3E3 /* PBXTextBookmark */;
+ A1E710CE0A3A244D007BE3E3 /* PBXTextBookmark */ = A1E710CE0A3A244D007BE3E3 /* PBXTextBookmark */;
+ A1E710D00A3A2456007BE3E3 /* PBXTextBookmark */ = A1E710D00A3A2456007BE3E3 /* PBXTextBookmark */;
+ A1E710D10A3A2456007BE3E3 /* PBXTextBookmark */ = A1E710D10A3A2456007BE3E3 /* PBXTextBookmark */;
+ A1E710D20A3A2456007BE3E3 /* PBXTextBookmark */ = A1E710D20A3A2456007BE3E3 /* PBXTextBookmark */;
+ A1E710D30A3A2456007BE3E3 /* PBXTextBookmark */ = A1E710D30A3A2456007BE3E3 /* PBXTextBookmark */;
+ A1E710D40A3A2456007BE3E3 /* PBXTextBookmark */ = A1E710D40A3A2456007BE3E3 /* PBXTextBookmark */;
+ A1E710D70A3A2465007BE3E3 /* PBXTextBookmark */ = A1E710D70A3A2465007BE3E3 /* PBXTextBookmark */;
+ A1E710D80A3A2465007BE3E3 /* PBXTextBookmark */ = A1E710D80A3A2465007BE3E3 /* PBXTextBookmark */;
+ A1E710D90A3A2465007BE3E3 /* PBXTextBookmark */ = A1E710D90A3A2465007BE3E3 /* PBXTextBookmark */;
+ A1E710DB0A3A246E007BE3E3 /* PBXTextBookmark */ = A1E710DB0A3A246E007BE3E3 /* PBXTextBookmark */;
+ A1E710DF0A3A247D007BE3E3 /* PBXTextBookmark */ = A1E710DF0A3A247D007BE3E3 /* PBXTextBookmark */;
+ A1E710E00A3A247D007BE3E3 /* PBXTextBookmark */ = A1E710E00A3A247D007BE3E3 /* PBXTextBookmark */;
+ A1E710E10A3A247D007BE3E3 /* PBXTextBookmark */ = A1E710E10A3A247D007BE3E3 /* PBXTextBookmark */;
+ A1E710E20A3A247D007BE3E3 /* PBXTextBookmark */ = A1E710E20A3A247D007BE3E3 /* PBXTextBookmark */;
+ A1E710E30A3A247D007BE3E3 /* PBXTextBookmark */ = A1E710E30A3A247D007BE3E3 /* PBXTextBookmark */;
+ A1E710E50A3A248A007BE3E3 /* PBXTextBookmark */ = A1E710E50A3A248A007BE3E3 /* PBXTextBookmark */;
+ A1E710E60A3A248A007BE3E3 /* PBXTextBookmark */ = A1E710E60A3A248A007BE3E3 /* PBXTextBookmark */;
+ A1E710E70A3A24A4007BE3E3 /* PBXTextBookmark */ = A1E710E70A3A24A4007BE3E3 /* PBXTextBookmark */;
+ A1E710E80A3A24A5007BE3E3 /* PBXTextBookmark */ = A1E710E80A3A24A5007BE3E3 /* PBXTextBookmark */;
+ A1E710E90A3A24A5007BE3E3 /* PBXTextBookmark */ = A1E710E90A3A24A5007BE3E3 /* PBXTextBookmark */;
+ A1E710EA0A3A2521007BE3E3 /* PBXTextBookmark */ = A1E710EA0A3A2521007BE3E3 /* PBXTextBookmark */;
+ A1E710EB0A3A2521007BE3E3 /* PBXTextBookmark */ = A1E710EB0A3A2521007BE3E3 /* PBXTextBookmark */;
+ A1E710EC0A3A2521007BE3E3 /* PBXTextBookmark */ = A1E710EC0A3A2521007BE3E3 /* PBXTextBookmark */;
+ A1E710ED0A3A2521007BE3E3 /* PBXTextBookmark */ = A1E710ED0A3A2521007BE3E3 /* PBXTextBookmark */;
+ A1E710EE0A3A2521007BE3E3 /* PBXTextBookmark */ = A1E710EE0A3A2521007BE3E3 /* PBXTextBookmark */;
+ A1E710EF0A3A2521007BE3E3 /* PBXTextBookmark */ = A1E710EF0A3A2521007BE3E3 /* PBXTextBookmark */;
+ A1E710F00A3A2521007BE3E3 /* PBXTextBookmark */ = A1E710F00A3A2521007BE3E3 /* PBXTextBookmark */;
+ A1E710F10A3A2521007BE3E3 /* PBXTextBookmark */ = A1E710F10A3A2521007BE3E3 /* PBXTextBookmark */;
+ A1E710F40A3A253F007BE3E3 /* PBXTextBookmark */ = A1E710F40A3A253F007BE3E3 /* PBXTextBookmark */;
+ A1E710F50A3A253F007BE3E3 /* PBXTextBookmark */ = A1E710F50A3A253F007BE3E3 /* PBXTextBookmark */;
+ };
+ sourceControlManager = A1E70CFD0A38B536007BE3E3 /* Source Control */;
+ userBuildSettings = {
+ };
+ };
+ A1E70CFD0A38B536007BE3E3 /* Source Control */ = {
+ isa = PBXSourceControlManager;
+ fallbackIsa = XCSourceControlManager;
+ isSCMEnabled = 0;
+ scmConfiguration = {
+ };
+ scmType = "";
+ };
+ A1E70CFE0A38B536007BE3E3 /* Code sense */ = {
+ isa = PBXCodeSenseManager;
+ indexTemplatePath = "";
+ };
+ A1E70D000A38B5BB007BE3E3 /* cacheapi.c */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {1087, 2100}}";
+ sepNavSelRange = "{4787, 139}";
+ sepNavVisRect = "{{0, 1547}, {1087, 448}}";
+ };
+ };
+ A1E70D010A38B5BB007BE3E3 /* ccache.c */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {1003, 18424}}";
+ sepNavSelRange = "{11919, 0}";
+ sepNavVisRect = "{{0, 5185}, {1003, 481}}";
+ };
+ };
+ A1E70D020A38B5BB007BE3E3 /* ccache.h */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {980, 2058}}";
+ sepNavSelRange = "{2339, 9}";
+ sepNavVisRect = "{{0, 556}, {980, 387}}";
+ };
+ };
+ A1E70D080A38B5BB007BE3E3 /* context.c */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {980, 13958}}";
+ sepNavSelRange = "{29891, 21}";
+ sepNavVisRect = "{{0, 13156}, {980, 387}}";
+ };
+ };
+ A1E70D0B0A38B5BB007BE3E3 /* credentials.h */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {621, 1330}}";
+ sepNavSelRange = "{0, 2110}";
+ sepNavVisRect = "{{0, 235}, {621, 499}}";
+ };
+ };
+ A1E70D0C0A38B5BB007BE3E3 /* credentials_iterator.c */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {980, 3836}}";
+ sepNavSelRange = "{6723, 21}";
+ sepNavVisRect = "{{0, 2544}, {980, 387}}";
+ };
+ };
+ A1E70D0F0A38B5BB007BE3E3 /* NTMakefile */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {734, 998}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRect = "{{0, 0}, {734, 998}}";
+ sepNavWindowFrame = "{{15, 46}, {779, 1127}}";
+ };
+ };
+ A1E70D120A38B5BB007BE3E3 /* generic_lists.c */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {1003, 5572}}";
+ sepNavSelRange = "{2282, 0}";
+ sepNavVisRect = "{{0, 489}, {1003, 521}}";
+ };
+ };
+ A1E70D130A38B5BB007BE3E3 /* marshall.c */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {980, 6188}}";
+ sepNavSelRange = "{11995, 68}";
+ sepNavVisRect = "{{0, 4756}, {980, 387}}";
+ };
+ };
+ A1E70D140A38B5BB007BE3E3 /* msg.c */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {1087, 8722}}";
+ sepNavSelRange = "{15262, 21}";
+ sepNavVisRect = "{{0, 7868}, {1087, 448}}";
+ };
+ };
+ A1E70D150A38B5BB007BE3E3 /* NTMakefile */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {621, 499}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRect = "{{0, 0}, {621, 499}}";
+ };
+ };
+ A1E70D190A38B5BB007BE3E3 /* cc_rpc.h */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {888, 742}}";
+ sepNavSelRange = "{2202, 18}";
+ sepNavVisRect = "{{0, 453}, {888, 289}}";
+ };
+ };
+ A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {1003, 8302}}";
+ sepNavSelRange = "{2631, 0}";
+ sepNavVisRect = "{{0, 958}, {1003, 521}}";
+ };
+ };
+ A1E70D1B0A38B5BB007BE3E3 /* CredentialsCache2.h */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {1003, 4340}}";
+ sepNavSelRange = "{7813, 0}";
+ sepNavVisRect = "{{0, 422}, {1003, 521}}";
+ };
+ };
+ A1E70D1C0A38B5BB007BE3E3 /* datastore.h */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {888, 2562}}";
+ sepNavSelRange = "{2301, 0}";
+ sepNavVisRect = "{{0, 573}, {888, 436}}";
+ };
+ };
+ A1E70D1D0A38B5BB007BE3E3 /* generic_lists.h */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {1003, 1442}}";
+ sepNavSelRange = "{2369, 0}";
+ sepNavVisRect = "{{0, 545}, {1003, 521}}";
+ };
+ };
+ A1E70D1F0A38B5BB007BE3E3 /* msg.h */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {1003, 2268}}";
+ sepNavSelRange = "{5529, 0}";
+ sepNavVisRect = "{{0, 1721}, {1003, 521}}";
+ };
+ };
+ A1E70D260A38B5BB007BE3E3 /* NTMakefile */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {621, 499}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRect = "{{0, 0}, {621, 499}}";
+ };
+ };
+ A1E70D280A38B5BB007BE3E3 /* ccs_ccache.c */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {1003, 9856}}";
+ sepNavSelRange = "{9783, 0}";
+ sepNavVisRect = "{{0, 3674}, {1003, 730}}";
+ };
+ };
+ A1E70D2C0A38B5BB007BE3E3 /* main.c */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {621, 910}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRect = "{{0, 134}, {621, 727}}";
+ };
+ };
+ A1E70D2F0A38B5BB007BE3E3 /* serv_ops.c */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {1087, 22204}}";
+ sepNavSelRange = "{36879, 21}";
+ sepNavVisRect = "{{0, 14168}, {1087, 448}}";
+ };
+ };
+ A1E70D3B0A38B5BB007BE3E3 /* client.c */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {804, 1988}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRect = "{{0, 0}, {804, 503}}";
+ };
+ };
+ A1E70D460A38B5BC007BE3E3 /* server.c */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {621, 9520}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRect = "{{0, 0}, {621, 499}}";
+ };
+ };
+ A1E70D500A38B5F3007BE3E3 /* XCBreakpointsBucket */ = {
+ isa = XCBreakpointsBucket;
+ name = CCAPI;
+ objects = (
+ );
+ };
+ A1E70D5C0A38B796007BE3E3 /* CCacheServer */ = {
+ activeExec = 0;
+ executables = (
+ A1E70D5E0A38B796007BE3E3 /* CCacheServer */,
+ );
+ };
+ A1E70D5E0A38B796007BE3E3 /* CCacheServer */ = {
+ isa = PBXExecutable;
+ activeArgIndex = 2147483647;
+ activeArgIndices = (
+ );
+ argumentStrings = (
+ );
+ autoAttachOnCrash = 1;
+ configStateDict = {
+ };
+ customDataFormattersEnabled = 1;
+ debuggerPlugin = GDBDebugging;
+ disassemblyDisplayState = 0;
+ enableDebugStr = 1;
+ environmentEntries = (
+ );
+ executableSystemSymbolLevel = 0;
+ executableUserSymbolLevel = 0;
+ libgmallocEnabled = 0;
+ name = CCacheServer;
+ sourceDirectories = (
+ );
+ };
+ A1E70D930A38BB67007BE3E3 /* main.c */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {980, 476}}";
+ sepNavSelRange = "{316, 42}";
+ sepNavVisRect = "{{0, 24}, {980, 387}}";
+ };
+ };
+ A1E70D9E0A38BCAD007BE3E3 /* mig.defs */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {804, 826}}";
+ sepNavSelRange = "{2123, 0}";
+ sepNavVisRect = "{{0, 400}, {804, 391}}";
+ };
+ };
+ A1E70DB10A38C01E007BE3E3 /* mig_types.h */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {804, 686}}";
+ sepNavSelRange = "{2188, 0}";
+ sepNavVisRect = "{{0, 281}, {804, 391}}";
+ };
+ };
+ A1E70DE10A38C6FD007BE3E3 /* kipc_common.h */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {888, 1078}}";
+ sepNavSelRange = "{1293, 0}";
+ sepNavVisRect = "{{0, 206}, {888, 470}}";
+ };
+ };
+ A1E70DE40A38C6FD007BE3E3 /* kipc_client.c */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {804, 1218}}";
+ sepNavSelRange = "{1240, 34}";
+ sepNavVisRect = "{{0, 235}, {804, 329}}";
+ };
+ };
+ A1E70DE50A38C6FD007BE3E3 /* kipc_common.c */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {632, 1316}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRect = "{{0, 0}, {621, 499}}";
+ };
+ };
+ A1E70DE60A38C6FD007BE3E3 /* kipc_server.c */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {728, 4396}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRect = "{{0, 0}, {621, 499}}";
+ };
+ };
+ A1E70DE70A38C6FD007BE3E3 /* kipc_session.c */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {698, 1988}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRect = "{{0, 0}, {621, 499}}";
+ };
+ };
+ A1E70DE80A38C6FD007BE3E3 /* notify.defs */ = {
+ uiCtxt = {
+ sepNavIntBoundsRect = "{{0, 0}, {621, 518}}";
+ sepNavSelRange = "{0, 0}";
+ sepNavVisRect = "{{0, 0}, {621, 499}}";
+ };
+ };
+ A1E70DF70A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D150A38B5BB007BE3E3 /* NTMakefile */;
+ name = "NTMakefile: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 308;
+ vrLoc = 0;
+ };
+ A1E70DF80A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D3B0A38B5BB007BE3E3 /* client.c */;
+ name = "client.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 903;
+ vrLoc = 0;
+ };
+ A1E70DF90A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D3C0A38B5BB007BE3E3 /* dllmain.c */;
+ name = "dllmain.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 298;
+ vrLoc = 0;
+ };
+ A1E70DFA0A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D3A0A38B5BB007BE3E3 /* cacheapi.def */;
+ name = "cacheapi.def: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 847;
+ vrLoc = 0;
+ };
+ A1E70DFB0A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D460A38B5BC007BE3E3 /* server.c */;
+ name = "server.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 756;
+ vrLoc = 0;
+ };
+ A1E70DFD0A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D120A38B5BB007BE3E3 /* generic_lists.c */;
+ name = "generic_lists.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1826;
+ vrLoc = 0;
+ };
+ A1E70E010A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D0B0A38B5BB007BE3E3 /* credentials.h */;
+ name = "credentials.h: 1";
+ rLen = 2110;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1604;
+ vrLoc = 749;
+ };
+ A1E70E020A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D2C0A38B5BB007BE3E3 /* main.c */;
+ name = "main.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1306;
+ vrLoc = 202;
+ };
+ A1E70E060A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1B0A38B5BB007BE3E3 /* CredentialsCache2.h */;
+ name = "CredentialsCache2.h: 303";
+ rLen = 0;
+ rLoc = 7813;
+ rType = 0;
+ vrLen = 1128;
+ vrLoc = 6802;
+ };
+ A1E70E090A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70DE80A38C6FD007BE3E3 /* notify.defs */;
+ name = "notify.defs: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1437;
+ vrLoc = 0;
+ };
+ A1E70E0A0A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70DE60A38C6FD007BE3E3 /* kipc_server.c */;
+ name = "kipc_server.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1538;
+ vrLoc = 0;
+ };
+ A1E70E0B0A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70DE70A38C6FD007BE3E3 /* kipc_session.c */;
+ name = "kipc_session.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1461;
+ vrLoc = 0;
+ };
+ A1E70E0C0A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70DE50A38C6FD007BE3E3 /* kipc_common.c */;
+ name = "kipc_common.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1496;
+ vrLoc = 0;
+ };
+ A1E70E100A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D150A38B5BB007BE3E3 /* NTMakefile */;
+ name = "NTMakefile: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 308;
+ vrLoc = 0;
+ };
+ A1E70E110A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D120A38B5BB007BE3E3 /* generic_lists.c */;
+ name = "generic_lists.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1826;
+ vrLoc = 0;
+ };
+ A1E70E120A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D3B0A38B5BB007BE3E3 /* client.c */;
+ name = "client.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 903;
+ vrLoc = 0;
+ };
+ A1E70E130A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D3C0A38B5BB007BE3E3 /* dllmain.c */;
+ name = "dllmain.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 298;
+ vrLoc = 0;
+ };
+ A1E70E140A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D3A0A38B5BB007BE3E3 /* cacheapi.def */;
+ name = "cacheapi.def: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 847;
+ vrLoc = 0;
+ };
+ A1E70E150A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D460A38B5BC007BE3E3 /* server.c */;
+ name = "server.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 756;
+ vrLoc = 0;
+ };
+ A1E70E160A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D2C0A38B5BB007BE3E3 /* main.c */;
+ name = "main.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 954;
+ vrLoc = 0;
+ };
+ A1E70E170A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D2F0A38B5BB007BE3E3 /* serv_ops.c */;
+ name = "serv_ops.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1825;
+ vrLoc = 0;
+ };
+ A1E70E180A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D280A38B5BB007BE3E3 /* ccs_ccache.c */;
+ name = "ccs_ccache.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1861;
+ vrLoc = 0;
+ };
+ A1E70E1B0A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D930A38BB67007BE3E3 /* main.c */;
+ name = "main.c: 22";
+ rLen = 0;
+ rLoc = 509;
+ rType = 0;
+ vrLen = 954;
+ vrLoc = 0;
+ };
+ A1E70E1E0A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D0B0A38B5BB007BE3E3 /* credentials.h */;
+ name = "credentials.h: 1";
+ rLen = 2110;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1604;
+ vrLoc = 749;
+ };
+ A1E70E1F0A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D130A38B5BB007BE3E3 /* marshall.c */;
+ name = cci_creds_v5_marshall;
+ rLen = 21;
+ rLoc = 6670;
+ rType = 0;
+ vrLen = 1513;
+ vrLoc = 6116;
+ };
+ A1E70E200A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D140A38B5BB007BE3E3 /* msg.c */;
+ name = cci_msg_flatten;
+ rLen = 15;
+ rLoc = 7396;
+ rType = 0;
+ vrLen = 1003;
+ vrLoc = 7034;
+ };
+ A1E70E250A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */;
+ name = "CredentialsCache.h: 583";
+ rLen = 0;
+ rLoc = 20525;
+ rType = 0;
+ vrLen = 2454;
+ vrLoc = 18163;
+ };
+ A1E70E260A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D9E0A38BCAD007BE3E3 /* mig.defs */;
+ name = "ccapi_ipc.defs: 55";
+ rLen = 0;
+ rLoc = 2520;
+ rType = 0;
+ vrLen = 1955;
+ vrLoc = 87;
+ };
+ A1E70E290A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70DE40A38C6FD007BE3E3 /* kipc_client.c */;
+ name = "kipc_client.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1544;
+ vrLoc = 0;
+ };
+ A1E70E2A0A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70DE50A38C6FD007BE3E3 /* kipc_common.c */;
+ name = "kipc_common.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1496;
+ vrLoc = 0;
+ };
+ A1E70E2B0A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70DE80A38C6FD007BE3E3 /* notify.defs */;
+ name = "notify.defs: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1437;
+ vrLoc = 0;
+ };
+ A1E70E2D0A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70DE60A38C6FD007BE3E3 /* kipc_server.c */;
+ name = "kipc_server.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1538;
+ vrLoc = 0;
+ };
+ A1E70E2E0A38C765007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70DE70A38C6FD007BE3E3 /* kipc_session.c */;
+ name = "kipc_session.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1461;
+ vrLoc = 0;
+ };
+ A1E70E380A38C778007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D000A38B5BB007BE3E3 /* cacheapi.c */;
+ name = "#include <CredentialsCache.h>";
+ rLen = 30;
+ rLoc = 2170;
+ rType = 0;
+ vrLen = 696;
+ vrLoc = 1821;
+ };
+ A1E70E3D0A38C78C007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D260A38B5BB007BE3E3 /* NTMakefile */;
+ name = "NTMakefile: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 437;
+ vrLoc = 0;
+ };
+ A1E70E410A38C78C007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D260A38B5BB007BE3E3 /* NTMakefile */;
+ name = "NTMakefile: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 437;
+ vrLoc = 0;
+ };
+ A1E70E430A38C791007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D0F0A38B5BB007BE3E3 /* NTMakefile */;
+ name = "NTMakefile: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 432;
+ vrLoc = 0;
+ };
+ A1E70E450A38C791007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D0F0A38B5BB007BE3E3 /* NTMakefile */;
+ name = "NTMakefile: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 432;
+ vrLoc = 0;
+ };
+ A1E70E4A0A38C7BE007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D0F0A38B5BB007BE3E3 /* NTMakefile */;
+ name = "NTMakefile: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 432;
+ vrLoc = 0;
+ };
+ A1E70E520A38C9FD007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D150A38B5BB007BE3E3 /* NTMakefile */;
+ name = "NTMakefile: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 308;
+ vrLoc = 0;
+ };
+ A1E70E530A38C9FD007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1C0A38B5BB007BE3E3 /* datastore.h */;
+ name = cc_list_type;
+ rLen = 0;
+ rLoc = 2301;
+ rType = 0;
+ vrLen = 425;
+ vrLoc = 2113;
+ };
+ A1E70E560A38C9FD007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1D0A38B5BB007BE3E3 /* generic_lists.h */;
+ name = cc_list_type;
+ rLen = 12;
+ rLoc = 2736;
+ rType = 0;
+ vrLen = 728;
+ vrLoc = 2219;
+ };
+ A1E70E580A38C9FD007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1C0A38B5BB007BE3E3 /* datastore.h */;
+ name = cc_list_type;
+ rLen = 0;
+ rLoc = 2301;
+ rType = 0;
+ vrLen = 425;
+ vrLoc = 2113;
+ };
+ A1E70E6F0A38CA08007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1F0A38B5BB007BE3E3 /* msg.h */;
+ name = "#include \"generic_lists.h\"";
+ rLen = 27;
+ rLoc = 2765;
+ rType = 0;
+ vrLen = 755;
+ vrLoc = 2478;
+ };
+ A1E70E770A38CA55007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D190A38B5BB007BE3E3 /* cc_rpc.h */;
+ name = "#include \"msg.h\"";
+ rLen = 18;
+ rLoc = 2202;
+ rType = 0;
+ vrLen = 644;
+ vrLoc = 1674;
+ };
+ A1E70E7D0A38CA55007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D190A38B5BB007BE3E3 /* cc_rpc.h */;
+ name = "#include \"msg.h\"";
+ rLen = 18;
+ rLoc = 2202;
+ rType = 0;
+ vrLen = 644;
+ vrLoc = 1674;
+ };
+ A1E70E9C0A38CAF1007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D120A38B5BB007BE3E3 /* generic_lists.c */;
+ name = "generic_lists.c: 56";
+ rLen = 0;
+ rLoc = 2280;
+ rType = 0;
+ vrLen = 463;
+ vrLoc = 2119;
+ };
+ A1E70EA80A38CB24007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1D0A38B5BB007BE3E3 /* generic_lists.h */;
+ name = "generic_lists.h: cc_generic_list_node_t";
+ rLen = 0;
+ rLoc = 2452;
+ rType = 0;
+ vrLen = 598;
+ vrLoc = 2206;
+ };
+ A1E70EAB0A38CB24007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D080A38B5BB007BE3E3 /* context.c */;
+ name = "code = cci_msg_add_data_blob(request, (void *)name, strlen(name) + 1, &blob_pos);";
+ rLen = 86;
+ rLoc = 14073;
+ rType = 0;
+ vrLen = 704;
+ vrLoc = 13925;
+ };
+ A1E70EB50A38CB4D007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D000A38B5BB007BE3E3 /* cacheapi.c */;
+ name = "strncpy(vendor, string, sizeof(vendor)-1);";
+ rLen = 55;
+ rLoc = 4926;
+ rType = 0;
+ vrLen = 780;
+ vrLoc = 1821;
+ };
+ A1E70EC30A38CC14007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D010A38B5BB007BE3E3 /* ccache.c */;
+ name = "ccache.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 1115;
+ vrLoc = 0;
+ };
+ A1E70ECB0A38CC4C007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70DE40A38C6FD007BE3E3 /* kipc_client.c */;
+ name = "#include <Kerberos/kipc_client.h>";
+ rLen = 34;
+ rLoc = 1240;
+ rType = 0;
+ vrLen = 891;
+ vrLoc = 724;
+ };
+ A1E70ED70A38CCB6007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70DE40A38C6FD007BE3E3 /* kipc_client.c */;
+ name = "#include <Kerberos/kipc_client.h>";
+ rLen = 34;
+ rLoc = 1240;
+ rType = 0;
+ vrLen = 1069;
+ vrLoc = 582;
+ };
+ A1E70EE20A38CCD6007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70DB10A38C01E007BE3E3 /* mig_types.h */;
+ name = "ccapi_ipc.h: 39";
+ rLen = 0;
+ rLoc = 1957;
+ rType = 0;
+ vrLen = 892;
+ vrLoc = 1209;
+ };
+ A1E70EFE0A38CD66007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70DE10A38C6FD007BE3E3 /* kipc_common.h */;
+ name = "#include <Kerberos/KerberosDebug.h>";
+ rLen = 36;
+ rLoc = 1293;
+ rType = 0;
+ vrLen = 609;
+ vrLoc = 1011;
+ };
+ A1E70F0F0A38CE21007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D3B0A38B5BB007BE3E3 /* client.c */;
+ name = "client.c: 1";
+ rLen = 0;
+ rLoc = 0;
+ rType = 0;
+ vrLen = 903;
+ vrLoc = 0;
+ };
+ A1E70F440A38D252007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70DB10A38C01E007BE3E3 /* mig_types.h */;
+ name = "msg_ipc.h: 48";
+ rLen = 0;
+ rLoc = 2188;
+ rType = 0;
+ vrLen = 793;
+ vrLoc = 1409;
+ };
+ A1E70F450A38D252007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70DE10A38C6FD007BE3E3 /* kipc_common.h */;
+ name = "kipc_common.h: 32";
+ rLen = 0;
+ rLoc = 1293;
+ rType = 0;
+ vrLen = 1252;
+ vrLoc = 450;
+ };
+ A1E70F8B0A38D3B4007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D9E0A38BCAD007BE3E3 /* mig.defs */;
+ name = "msg_ipc.defs: 43";
+ rLen = 0;
+ rLoc = 2111;
+ rType = 0;
+ vrLen = 1149;
+ vrLoc = 1378;
+ };
+ A1E70F9C0A38D41E007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70DB10A38C01E007BE3E3 /* mig_types.h */;
+ name = "mig_types.h: 48";
+ rLen = 0;
+ rLoc = 2188;
+ rType = 0;
+ vrLen = 1178;
+ vrLoc = 1024;
+ };
+ A1E70F9D0A38D41E007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D9E0A38BCAD007BE3E3 /* mig.defs */;
+ name = "mig.defs: 44";
+ rLen = 0;
+ rLoc = 2123;
+ rType = 0;
+ vrLen = 1034;
+ vrLoc = 1439;
+ };
+ A1E70FC60A38D560007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70FC70A38D560007BE3E3 /* migServer.h */;
+ name = ccapi_server;
+ rLen = 12;
+ rLoc = 1268;
+ rType = 0;
+ vrLen = 879;
+ vrLoc = 942;
+ };
+ A1E70FC70A38D560007BE3E3 /* migServer.h */ = {
+ isa = PBXFileReference;
+ name = migServer.h;
+ path = "/Volumes/Ra-Tilt/Users/lxs/Builds/CCAPI.build/Debug/CCacheServer.build/DerivedSources/migServer.h";
+ sourceTree = "<absolute>";
+ };
+ A1E70FC80A38D560007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D930A38BB67007BE3E3 /* main.c */;
+ name = "main.c: 23";
+ rLen = 0;
+ rLoc = 495;
+ rType = 0;
+ vrLen = 691;
+ vrLoc = 0;
+ };
+ A1E70FC90A38D560007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1C0A38B5BB007BE3E3 /* datastore.h */;
+ name = "datastore.h: 55";
+ rLen = 0;
+ rLoc = 2301;
+ rType = 0;
+ vrLen = 805;
+ vrLoc = 2101;
+ };
+ A1E70FCA0A38D560007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1D0A38B5BB007BE3E3 /* generic_lists.h */;
+ name = "generic_lists.h: 52";
+ rLen = 0;
+ rLoc = 2371;
+ rType = 0;
+ vrLen = 757;
+ vrLoc = 2012;
+ };
+ A1E70FCD0A38D560007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D930A38BB67007BE3E3 /* main.c */;
+ name = "main.c: 23";
+ rLen = 0;
+ rLoc = 495;
+ rType = 0;
+ vrLen = 691;
+ vrLoc = 0;
+ };
+ A1E70FD80A38D573007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D930A38BB67007BE3E3 /* main.c */;
+ name = "syslog (LOG_INFO, \"Starting up.\");";
+ rLen = 42;
+ rLoc = 316;
+ rType = 0;
+ vrLen = 628;
+ vrLoc = 21;
+ };
+ A1E70FEE0A38D7C0007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D130A38B5BB007BE3E3 /* marshall.c */;
+ name = "marshall.c: 48";
+ rLen = 0;
+ rLoc = 2234;
+ rType = 0;
+ vrLen = 831;
+ vrLoc = 1674;
+ };
+ A1E70FEF0A38D7C0007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D010A38B5BB007BE3E3 /* ccache.c */;
+ name = "ccache.c: 49";
+ rLen = 0;
+ rLoc = 2186;
+ rType = 0;
+ vrLen = 432;
+ vrLoc = 2106;
+ };
+ A1E70FF00A38D7C0007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D080A38B5BB007BE3E3 /* context.c */;
+ name = "code = cci_msg_retrieve_blob(response, ntohl(response_header->vendor_offset), ntohl(response_header->vendor_length), &string);";
+ rLen = 139;
+ rLoc = 29872;
+ rType = 0;
+ vrLen = 757;
+ vrLoc = 27442;
+ };
+ A1E70FFA0A38D806007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D130A38B5BB007BE3E3 /* marshall.c */;
+ name = "memcpy(creds->client, flat + header->client.data, length);";
+ rLen = 68;
+ rLoc = 11995;
+ rType = 0;
+ vrLen = 1038;
+ vrLoc = 11543;
+ };
+ A1E70FFC0A38D806007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D020A38B5BB007BE3E3 /* ccache.h */;
+ name = cc_handle;
+ rLen = 9;
+ rLoc = 2339;
+ rType = 0;
+ vrLen = 663;
+ vrLoc = 2042;
+ };
+ A1E70FFF0A38D806007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D020A38B5BB007BE3E3 /* ccache.h */;
+ name = cc_handle;
+ rLen = 9;
+ rLoc = 2339;
+ rType = 0;
+ vrLen = 663;
+ vrLoc = 2042;
+ };
+ A1E710010A38D814007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */;
+ name = cc_handle;
+ rLen = 9;
+ rLoc = 5095;
+ rType = 0;
+ vrLen = 617;
+ vrLoc = 4722;
+ };
+ A1E7100A0A38D888007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */;
+ name = cc_handle;
+ rLen = 9;
+ rLoc = 5095;
+ rType = 0;
+ vrLen = 619;
+ vrLoc = 4720;
+ };
+ A1E7100C0A38D888007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D080A38B5BB007BE3E3 /* context.c */;
+ name = cci_msg_retrieve_blob;
+ rLen = 21;
+ rLoc = 29891;
+ rType = 0;
+ vrLen = 1038;
+ vrLoc = 29282;
+ };
+ A1E7100D0A38D888007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D0C0A38B5BB007BE3E3 /* credentials_iterator.c */;
+ name = cci_msg_retrieve_blob;
+ rLen = 21;
+ rLoc = 6723;
+ rType = 0;
+ vrLen = 1080;
+ vrLoc = 6223;
+ };
+ A1E710110A38D888007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D2F0A38B5BB007BE3E3 /* serv_ops.c */;
+ name = cci_msg_retrieve_blob;
+ rLen = 21;
+ rLoc = 22827;
+ rType = 0;
+ vrLen = 921;
+ vrLoc = 22183;
+ };
+ A1E710140A38D888007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D0C0A38B5BB007BE3E3 /* credentials_iterator.c */;
+ name = cci_msg_retrieve_blob;
+ rLen = 21;
+ rLoc = 6723;
+ rType = 0;
+ vrLen = 1080;
+ vrLoc = 6223;
+ };
+ A1E7103C0A38DE0B007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1F0A38B5BB007BE3E3 /* msg.h */;
+ name = "msg.h: 142";
+ rLen = 0;
+ rLoc = 5529;
+ rType = 0;
+ vrLen = 1239;
+ vrLoc = 4630;
+ };
+ A1E710400A38DE0B007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D140A38B5BB007BE3E3 /* msg.c */;
+ name = "msg.c: cci_msg_retrieve_blob";
+ rLen = 0;
+ rLoc = 15353;
+ rType = 0;
+ vrLen = 962;
+ vrLoc = 14947;
+ };
+ A1E710530A39EC0B007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D2F0A38B5BB007BE3E3 /* serv_ops.c */;
+ name = "serv_ops.c: 322";
+ rLen = 0;
+ rLoc = 12676;
+ rType = 0;
+ vrLen = 1049;
+ vrLoc = 12199;
+ };
+ A1E7105A0A39ED89007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D000A38B5BB007BE3E3 /* cacheapi.c */;
+ name = "code = cci_msg_retrieve_blob(response, ntohl(response_header->vendor_offset), ntohl(response_header->vendor_length), &string);";
+ rLen = 139;
+ rLoc = 4787;
+ rType = 0;
+ vrLen = 1079;
+ vrLoc = 4176;
+ };
+ A1E7105D0A39ED89007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D000A38B5BB007BE3E3 /* cacheapi.c */;
+ name = "code = cci_msg_retrieve_blob(response, ntohl(response_header->vendor_offset), ntohl(response_header->vendor_length), &string);";
+ rLen = 139;
+ rLoc = 4787;
+ rType = 0;
+ vrLen = 1079;
+ vrLoc = 4176;
+ };
+ A1E7105E0A39ED89007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D140A38B5BB007BE3E3 /* msg.c */;
+ name = "cur_pos = msg->flat;";
+ rLen = 25;
+ rLoc = 7704;
+ rType = 0;
+ vrLen = 835;
+ vrLoc = 7353;
+ };
+ A1E710680A39F102007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D2F0A38B5BB007BE3E3 /* serv_ops.c */;
+ name = "resp_header->ccache = htonll((cc_handle) ccache);";
+ rLen = 54;
+ rLoc = 23249;
+ rType = 0;
+ vrLen = 1200;
+ vrLoc = 22714;
+ };
+ A1E710840A3A1CFB007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D010A38B5BB007BE3E3 /* ccache.c */;
+ name = "ccache.c: 378";
+ rLen = 0;
+ rLoc = 11919;
+ rType = 0;
+ vrLen = 1092;
+ vrLoc = 11685;
+ };
+ A1E710860A3A1CFB007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D140A38B5BB007BE3E3 /* msg.c */;
+ name = "msg.c: 585";
+ rLen = 0;
+ rLoc = 15353;
+ rType = 0;
+ vrLen = 1129;
+ vrLoc = 14797;
+ };
+ A1E710870A3A1CFB007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D010A38B5BB007BE3E3 /* ccache.c */;
+ name = "ccache.c: 378";
+ rLen = 0;
+ rLoc = 11919;
+ rType = 0;
+ vrLen = 1092;
+ vrLoc = 11685;
+ };
+ A1E710890A3A1D04007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D280A38B5BB007BE3E3 /* ccs_ccache.c */;
+ name = "ccs_ccache.c: 289";
+ rLen = 0;
+ rLoc = 9783;
+ rType = 0;
+ vrLen = 919;
+ vrLoc = 9327;
+ };
+ A1E7108B0A3A1D04007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D280A38B5BB007BE3E3 /* ccs_ccache.c */;
+ name = "ccs_ccache.c: 289";
+ rLen = 0;
+ rLoc = 9783;
+ rType = 0;
+ vrLen = 919;
+ vrLoc = 9327;
+ };
+ A1E7108D0A3A1D06007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D280A38B5BB007BE3E3 /* ccs_ccache.c */;
+ name = "ccs_ccache.c: 289";
+ rLen = 0;
+ rLoc = 9783;
+ rType = 0;
+ vrLen = 1441;
+ vrLoc = 9196;
+ };
+ A1E710930A3A1D22007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D2F0A38B5BB007BE3E3 /* serv_ops.c */;
+ name = cci_msg_retrieve_blob;
+ rLen = 21;
+ rLoc = 36879;
+ rType = 0;
+ vrLen = 1393;
+ vrLoc = 35980;
+ };
+ A1E710940A3A1D22007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1F0A38B5BB007BE3E3 /* msg.h */;
+ name = "msg.h: 142";
+ rLen = 0;
+ rLoc = 5529;
+ rType = 0;
+ vrLen = 1480;
+ vrLoc = 4457;
+ };
+ A1E710950A3A1D22007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D140A38B5BB007BE3E3 /* msg.c */;
+ rLen = 21;
+ rLoc = 14700;
+ rType = 0;
+ };
+ A1E710960A3A1D22007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D2F0A38B5BB007BE3E3 /* serv_ops.c */;
+ name = cci_msg_retrieve_blob;
+ rLen = 21;
+ rLoc = 36879;
+ rType = 0;
+ vrLen = 1393;
+ vrLoc = 35980;
+ };
+ A1E710970A3A1D22007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1F0A38B5BB007BE3E3 /* msg.h */;
+ name = "msg.h: 142";
+ rLen = 0;
+ rLoc = 5529;
+ rType = 0;
+ vrLen = 1480;
+ vrLoc = 4457;
+ };
+ A1E7109C0A3A1D2B007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D2F0A38B5BB007BE3E3 /* serv_ops.c */;
+ name = cci_msg_retrieve_blob;
+ rLen = 21;
+ rLoc = 36879;
+ rType = 0;
+ vrLen = 1196;
+ vrLoc = 36344;
+ };
+ A1E7109D0A3A1D2B007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ comments = "error: conflicting types for 'cci_msg_retrieve_blob'";
+ fRef = A1E70D140A38B5BB007BE3E3 /* msg.c */;
+ rLen = 1;
+ rLoc = 570;
+ rType = 1;
+ };
+ A1E7109F0A3A1DD0007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D140A38B5BB007BE3E3 /* msg.c */;
+ name = "msg.c: 1248";
+ rLen = 0;
+ rLoc = 16800;
+ rType = 0;
+ vrLen = 1576;
+ vrLoc = 14015;
+ };
+ A1E710A00A3A1DD0007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D140A38B5BB007BE3E3 /* msg.c */;
+ name = "msg.c: 1248";
+ rLen = 0;
+ rLoc = 16800;
+ rType = 0;
+ vrLen = 1582;
+ vrLoc = 0;
+ };
+ A1E710A50A3A22E1007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D140A38B5BB007BE3E3 /* msg.c */;
+ name = "msg.c: 623";
+ rLen = 0;
+ rLoc = 16800;
+ rType = 0;
+ vrLen = 1674;
+ vrLoc = 0;
+ };
+ A1E710AB0A3A22F5007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D140A38B5BB007BE3E3 /* msg.c */;
+ name = "msg.c: 623";
+ rLen = 0;
+ rLoc = 16800;
+ rType = 0;
+ vrLen = 2012;
+ vrLoc = 0;
+ };
+ A1E710AC0A3A22F5007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D140A38B5BB007BE3E3 /* msg.c */;
+ name = "msg.c: cci_msg_retrieve_blob";
+ rLen = 0;
+ rLoc = 15346;
+ rType = 0;
+ vrLen = 1284;
+ vrLoc = 15187;
+ };
+ A1E710AD0A3A22F5007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D140A38B5BB007BE3E3 /* msg.c */;
+ name = "msg.c: cci_msg_retrieve_blob";
+ rLen = 0;
+ rLoc = 15346;
+ rType = 0;
+ vrLen = 1209;
+ vrLoc = 15187;
+ };
+ A1E710AF0A3A22FE007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D140A38B5BB007BE3E3 /* msg.c */;
+ name = "msg.c: cci_msg_retrieve_blob";
+ rLen = 0;
+ rLoc = 15346;
+ rType = 0;
+ vrLen = 1589;
+ vrLoc = 14614;
+ };
+ A1E710B30A3A22FF007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D140A38B5BB007BE3E3 /* msg.c */;
+ name = "msg.c: cci_msg_retrieve_blob";
+ rLen = 0;
+ rLoc = 15346;
+ rType = 0;
+ vrLen = 1209;
+ vrLoc = 15187;
+ };
+ A1E710B90A3A23FB007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D140A38B5BB007BE3E3 /* msg.c */;
+ name = cci_msg_retrieve_blob;
+ rLen = 21;
+ rLoc = 15262;
+ rType = 0;
+ vrLen = 1209;
+ vrLoc = 15187;
+ };
+ A1E710BC0A3A2415007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D140A38B5BB007BE3E3 /* msg.c */;
+ name = cci_msg_retrieve_blob;
+ rLen = 21;
+ rLoc = 15262;
+ rType = 0;
+ vrLen = 1356;
+ vrLoc = 15083;
+ };
+ A1E710BD0A3A2415007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D120A38B5BB007BE3E3 /* generic_lists.c */;
+ name = "generic_lists.c: 56";
+ rLen = 0;
+ rLoc = 2280;
+ rType = 0;
+ vrLen = 873;
+ vrLoc = 1826;
+ };
+ A1E710BE0A3A2415007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D140A38B5BB007BE3E3 /* msg.c */;
+ name = cci_msg_retrieve_blob;
+ rLen = 21;
+ rLoc = 15262;
+ rType = 0;
+ vrLen = 1356;
+ vrLoc = 15083;
+ };
+ A1E710BF0A3A2415007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D120A38B5BB007BE3E3 /* generic_lists.c */;
+ name = "generic_lists.c: 56";
+ rLen = 0;
+ rLoc = 2280;
+ rType = 0;
+ vrLen = 863;
+ vrLoc = 1826;
+ };
+ A1E710C00A3A2415007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D140A38B5BB007BE3E3 /* msg.c */;
+ name = cci_msg_retrieve_blob;
+ rLen = 21;
+ rLoc = 15262;
+ rType = 0;
+ vrLen = 1209;
+ vrLoc = 15187;
+ };
+ A1E710C60A3A2441007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D120A38B5BB007BE3E3 /* generic_lists.c */;
+ name = "generic_lists.c: 56";
+ rLen = 0;
+ rLoc = 2280;
+ rType = 0;
+ vrLen = 863;
+ vrLoc = 1826;
+ };
+ A1E710C70A3A2441007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1D0A38B5BB007BE3E3 /* generic_lists.h */;
+ name = "generic_lists.h: 54";
+ rLen = 0;
+ rLoc = 2452;
+ rType = 0;
+ vrLen = 1215;
+ vrLoc = 1674;
+ };
+ A1E710C80A3A2441007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D120A38B5BB007BE3E3 /* generic_lists.c */;
+ name = "generic_lists.c: 56";
+ rLen = 0;
+ rLoc = 2280;
+ rType = 0;
+ vrLen = 863;
+ vrLoc = 1826;
+ };
+ A1E710C90A3A2441007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1D0A38B5BB007BE3E3 /* generic_lists.h */;
+ name = "generic_lists.h: 58";
+ rLen = 0;
+ rLoc = 2369;
+ rType = 0;
+ vrLen = 939;
+ vrLoc = 1935;
+ };
+ A1E710CA0A3A244D007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D140A38B5BB007BE3E3 /* msg.c */;
+ name = cci_msg_retrieve_blob;
+ rLen = 21;
+ rLoc = 15262;
+ rType = 0;
+ vrLen = 1209;
+ vrLoc = 15187;
+ };
+ A1E710CB0A3A244D007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1D0A38B5BB007BE3E3 /* generic_lists.h */;
+ name = "generic_lists.h: 58";
+ rLen = 0;
+ rLoc = 2369;
+ rType = 0;
+ vrLen = 696;
+ vrLoc = 2147;
+ };
+ A1E710CC0A3A244D007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ comments = "error: CredentialsCache.h: No such file or directory";
+ fRef = A1E70D120A38B5BB007BE3E3 /* generic_lists.c */;
+ rLen = 1;
+ rLoc = 53;
+ rType = 1;
+ };
+ A1E710CD0A3A244D007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1D0A38B5BB007BE3E3 /* generic_lists.h */;
+ name = "generic_lists.h: 58";
+ rLen = 0;
+ rLoc = 2369;
+ rType = 0;
+ vrLen = 696;
+ vrLoc = 2147;
+ };
+ A1E710CE0A3A244D007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D120A38B5BB007BE3E3 /* generic_lists.c */;
+ name = "#include \"CredentialsCache.h\"";
+ rLen = 31;
+ rLoc = 2221;
+ rType = 0;
+ vrLen = 608;
+ vrLoc = 2043;
+ };
+ A1E710D00A3A2456007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1D0A38B5BB007BE3E3 /* generic_lists.h */;
+ name = "generic_lists.h: 58";
+ rLen = 0;
+ rLoc = 2369;
+ rType = 0;
+ vrLen = 906;
+ vrLoc = 2012;
+ };
+ A1E710D10A3A2456007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D120A38B5BB007BE3E3 /* generic_lists.c */;
+ name = "#include \"CredentialsCache.h\"";
+ rLen = 31;
+ rLoc = 2221;
+ rType = 0;
+ vrLen = 861;
+ vrLoc = 1792;
+ };
+ A1E710D20A3A2456007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */;
+ name = cc_handle;
+ rLen = 9;
+ rLoc = 5095;
+ rType = 0;
+ vrLen = 822;
+ vrLoc = 4694;
+ };
+ A1E710D30A3A2456007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D120A38B5BB007BE3E3 /* generic_lists.c */;
+ name = "#include \"CredentialsCache.h\"";
+ rLen = 31;
+ rLoc = 2221;
+ rType = 0;
+ vrLen = 861;
+ vrLoc = 1792;
+ };
+ A1E710D40A3A2456007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */;
+ name = cc_handle;
+ rLen = 9;
+ rLoc = 5095;
+ rType = 0;
+ vrLen = 822;
+ vrLoc = 4694;
+ };
+ A1E710D70A3A2465007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */;
+ name = cc_handle;
+ rLen = 9;
+ rLoc = 5095;
+ rType = 0;
+ vrLen = 802;
+ vrLoc = 4694;
+ };
+ A1E710D80A3A2465007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D120A38B5BB007BE3E3 /* generic_lists.c */;
+ name = "#include \"CredentialsCache.h\"";
+ rLen = 31;
+ rLoc = 2221;
+ rType = 0;
+ vrLen = 683;
+ vrLoc = 1899;
+ };
+ A1E710D90A3A2465007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */;
+ name = cc_handle;
+ rLen = 9;
+ rLoc = 5095;
+ rType = 0;
+ vrLen = 726;
+ vrLoc = 4701;
+ };
+ A1E710DB0A3A246E007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */;
+ name = cc_handle;
+ rLen = 9;
+ rLoc = 5095;
+ rType = 0;
+ vrLen = 726;
+ vrLoc = 4701;
+ };
+ A1E710DF0A3A247D007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1B0A38B5BB007BE3E3 /* CredentialsCache2.h */;
+ name = "CredentialsCache2.h: 303";
+ rLen = 0;
+ rLoc = 7813;
+ rType = 0;
+ vrLen = 786;
+ vrLoc = 7144;
+ };
+ A1E710E00A3A247D007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */;
+ name = cc_handle;
+ rLen = 9;
+ rLoc = 5095;
+ rType = 0;
+ vrLen = 802;
+ vrLoc = 4694;
+ };
+ A1E710E10A3A247D007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */;
+ name = cc_handle;
+ rLen = 9;
+ rLoc = 5095;
+ rType = 0;
+ vrLen = 802;
+ vrLoc = 4694;
+ };
+ A1E710E20A3A247D007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1B0A38B5BB007BE3E3 /* CredentialsCache2.h */;
+ name = "CredentialsCache2.h: 303";
+ rLen = 0;
+ rLoc = 7813;
+ rType = 0;
+ vrLen = 786;
+ vrLoc = 7144;
+ };
+ A1E710E30A3A247D007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */;
+ name = "CredentialsCache.h: 67";
+ rLen = 0;
+ rLoc = 2631;
+ rType = 0;
+ vrLen = 836;
+ vrLoc = 2610;
+ };
+ A1E710E50A3A248A007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */;
+ name = "CredentialsCache.h: 67";
+ rLen = 0;
+ rLoc = 2631;
+ rType = 0;
+ vrLen = 1007;
+ vrLoc = 2180;
+ };
+ A1E710E60A3A248A007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */;
+ name = "CredentialsCache.h: 67";
+ rLen = 0;
+ rLoc = 2631;
+ rType = 0;
+ vrLen = 750;
+ vrLoc = 2696;
+ };
+ A1E710E70A3A24A4007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */;
+ name = "CredentialsCache.h: 67";
+ rLen = 0;
+ rLoc = 2631;
+ rType = 0;
+ vrLen = 750;
+ vrLoc = 2696;
+ };
+ A1E710E80A3A24A5007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */;
+ name = "CredentialsCache.h: 67";
+ rLen = 0;
+ rLoc = 2631;
+ rType = 0;
+ vrLen = 825;
+ vrLoc = 2639;
+ };
+ A1E710E90A3A24A5007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */;
+ name = "CredentialsCache.h: 67";
+ rLen = 0;
+ rLoc = 2631;
+ rType = 0;
+ vrLen = 750;
+ vrLoc = 2696;
+ };
+ A1E710EA0A3A2521007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */;
+ name = "CredentialsCache.h: 67";
+ rLen = 0;
+ rLoc = 2631;
+ rType = 0;
+ vrLen = 825;
+ vrLoc = 2639;
+ };
+ A1E710EB0A3A2521007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1B0A38B5BB007BE3E3 /* CredentialsCache2.h */;
+ name = "CredentialsCache2.h: 303";
+ rLen = 0;
+ rLoc = 7813;
+ rType = 0;
+ vrLen = 1103;
+ vrLoc = 1564;
+ };
+ A1E710EC0A3A2521007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1D0A38B5BB007BE3E3 /* generic_lists.h */;
+ name = "generic_lists.h: 58";
+ rLen = 0;
+ rLoc = 2369;
+ rType = 0;
+ vrLen = 906;
+ vrLoc = 2012;
+ };
+ A1E710ED0A3A2521007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */;
+ name = "CredentialsCache.h: 67";
+ rLen = 0;
+ rLoc = 2631;
+ rType = 0;
+ vrLen = 825;
+ vrLoc = 2639;
+ };
+ A1E710EE0A3A2521007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1B0A38B5BB007BE3E3 /* CredentialsCache2.h */;
+ name = "CredentialsCache2.h: 303";
+ rLen = 0;
+ rLoc = 7813;
+ rType = 0;
+ vrLen = 1103;
+ vrLoc = 1564;
+ };
+ A1E710EF0A3A2521007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1D0A38B5BB007BE3E3 /* generic_lists.h */;
+ name = "generic_lists.h: 58";
+ rLen = 0;
+ rLoc = 2369;
+ rType = 0;
+ vrLen = 906;
+ vrLoc = 2012;
+ };
+ A1E710F00A3A2521007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D120A38B5BB007BE3E3 /* generic_lists.c */;
+ name = "generic_lists.c: 56";
+ rLen = 0;
+ rLoc = 2280;
+ rType = 0;
+ vrLen = 842;
+ vrLoc = 1792;
+ };
+ A1E710F10A3A2521007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */;
+ name = "CredentialsCache.h: 67";
+ rLen = 0;
+ rLoc = 2631;
+ rType = 0;
+ vrLen = 750;
+ vrLoc = 2696;
+ };
+ A1E710F40A3A253F007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D120A38B5BB007BE3E3 /* generic_lists.c */;
+ name = "generic_lists.c: 57";
+ rLen = 0;
+ rLoc = 2282;
+ rType = 0;
+ vrLen = 861;
+ vrLoc = 1792;
+ };
+ A1E710F50A3A253F007BE3E3 /* PBXTextBookmark */ = {
+ isa = PBXTextBookmark;
+ fRef = A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */;
+ name = "CredentialsCache.h: 67";
+ rLen = 0;
+ rLoc = 2631;
+ rType = 0;
+ vrLen = 750;
+ vrLoc = 2696;
+ };
+ D2AAC045055464E500DB518D /* CCAPI */ = {
+ activeExec = 0;
+ };
+}
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>ActivePerspectiveName</key>
+ <string>Project</string>
+ <key>AllowedModules</key>
+ <array>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXSmartGroupTreeModule</string>
+ <key>Name</key>
+ <string>Groups and Files Outline View</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXNavigatorGroup</string>
+ <key>Name</key>
+ <string>Editor</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>XCTaskListModule</string>
+ <key>Name</key>
+ <string>Task List</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>XCDetailModule</string>
+ <key>Name</key>
+ <string>File and Smart Group Detail Viewer</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>1</string>
+ <key>Module</key>
+ <string>PBXBuildResultsModule</string>
+ <key>Name</key>
+ <string>Detailed Build Results Viewer</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>1</string>
+ <key>Module</key>
+ <string>PBXProjectFindModule</string>
+ <key>Name</key>
+ <string>Project Batch Find Tool</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXRunSessionModule</string>
+ <key>Name</key>
+ <string>Run Log</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXBookmarksModule</string>
+ <key>Name</key>
+ <string>Bookmarks Tool</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXClassBrowserModule</string>
+ <key>Name</key>
+ <string>Class Browser</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXCVSModule</string>
+ <key>Name</key>
+ <string>Source Code Control Tool</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXDebugBreakpointsModule</string>
+ <key>Name</key>
+ <string>Debug Breakpoints Tool</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>XCDockableInspector</string>
+ <key>Name</key>
+ <string>Inspector</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>n</string>
+ <key>Module</key>
+ <string>PBXOpenQuicklyModule</string>
+ <key>Name</key>
+ <string>Open Quickly Tool</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>1</string>
+ <key>Module</key>
+ <string>PBXDebugSessionModule</string>
+ <key>Name</key>
+ <string>Debugger</string>
+ </dict>
+ <dict>
+ <key>BundleLoadPath</key>
+ <string></string>
+ <key>MaxInstances</key>
+ <string>1</string>
+ <key>Module</key>
+ <string>PBXDebugCLIModule</string>
+ <key>Name</key>
+ <string>Debug Console</string>
+ </dict>
+ </array>
+ <key>Description</key>
+ <string>AIODescriptionKey</string>
+ <key>DockingSystemVisible</key>
+ <false/>
+ <key>Extension</key>
+ <string>perspective</string>
+ <key>FavBarConfig</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>A1E70E750A38CA08007BE3E3</string>
+ <key>XCBarModuleItemNames</key>
+ <dict/>
+ <key>XCBarModuleItems</key>
+ <array/>
+ </dict>
+ <key>FirstTimeWindowDisplayed</key>
+ <false/>
+ <key>Identifier</key>
+ <string>com.apple.perspectives.project.default</string>
+ <key>MajorVersion</key>
+ <integer>33</integer>
+ <key>MinorVersion</key>
+ <integer>0</integer>
+ <key>Name</key>
+ <string>All-In-One</string>
+ <key>Notifications</key>
+ <array>
+ <dict>
+ <key>XCObserverAutoDisconnectKey</key>
+ <true/>
+ <key>XCObserverDefintionKey</key>
+ <dict/>
+ <key>XCObserverFactoryKey</key>
+ <string>XCPerspectivesSpecificationIdentifier</string>
+ <key>XCObserverGUIDKey</key>
+ <string>XCObserverProjectIdentifier</string>
+ <key>XCObserverNotificationKey</key>
+ <string>PBXStatusBuildStateMessageNotification</string>
+ <key>XCObserverTargetKey</key>
+ <string>XCMainBuildResultsModuleGUID</string>
+ <key>XCObserverTriggerKey</key>
+ <string>awakenModuleWithObserver:</string>
+ <key>XCObserverValidationKey</key>
+ <dict/>
+ </dict>
+ </array>
+ <key>OpenEditors</key>
+ <array/>
+ <key>PerspectiveWidths</key>
+ <array>
+ <integer>1340</integer>
+ <integer>1340</integer>
+ <integer>1340</integer>
+ </array>
+ <key>Perspectives</key>
+ <array>
+ <dict>
+ <key>ChosenToolbarItems</key>
+ <array>
+ <string>XCToolbarPerspectiveControl</string>
+ <string>NSToolbarSeparatorItem</string>
+ <string>active-target-popup</string>
+ <string>action</string>
+ <string>NSToolbarFlexibleSpaceItem</string>
+ <string>buildOrClean</string>
+ <string>build-and-runOrDebug</string>
+ <string>com.apple.ide.PBXToolbarStopButton</string>
+ <string>get-info</string>
+ <string>toggle-editor</string>
+ <string>NSToolbarFlexibleSpaceItem</string>
+ <string>com.apple.pbx.toolbar.searchfield</string>
+ </array>
+ <key>ControllerClassBaseName</key>
+ <string></string>
+ <key>IconName</key>
+ <string>WindowOfProject</string>
+ <key>Identifier</key>
+ <string>perspective.project</string>
+ <key>IsVertical</key>
+ <false/>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXBottomSmartGroupGIDs</key>
+ <array>
+ <string>1C37FBAC04509CD000000102</string>
+ <string>1C37FAAC04509CD000000102</string>
+ <string>1C08E77C0454961000C914BD</string>
+ <string>1C37FABC05509CD000000102</string>
+ <string>1C37FABC05539CD112110102</string>
+ <string>E2644B35053B69B200211256</string>
+ <string>1C37FABC04509CD000100104</string>
+ <string>1CC0EA4004350EF90044410B</string>
+ <string>1CC0EA4004350EF90041110B</string>
+ <string>1C77FABC04509CD000000102</string>
+ </array>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CA23ED40692098700951B8B</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Files</string>
+ <key>PBXProjectStructureProvided</key>
+ <string>yes</string>
+ <key>PBXSmartGroupTreeModuleColumnData</key>
+ <dict>
+ <key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
+ <array>
+ <real>268</real>
+ </array>
+ <key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
+ <array>
+ <string>MainColumn</string>
+ </array>
+ </dict>
+ <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
+ <dict>
+ <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
+ <array>
+ <string>08FB7794FE84155DC02AAC07</string>
+ <string>A1E70CFF0A38B5BB007BE3E3</string>
+ <string>A1E70D110A38B5BB007BE3E3</string>
+ <string>A1E70D7E0A38BAC5007BE3E3</string>
+ <string>A1E70D180A38B5BB007BE3E3</string>
+ <string>A1E70D270A38B5BB007BE3E3</string>
+ <string>A1E70D2B0A38B5BB007BE3E3</string>
+ <string>A1E70D390A38B5BB007BE3E3</string>
+ <string>1C37FBAC04509CD000000102</string>
+ </array>
+ <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
+ <array>
+ <array>
+ <integer>24</integer>
+ <integer>19</integer>
+ <integer>0</integer>
+ </array>
+ </array>
+ <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
+ <string>{{0, 0}, {268, 841}}</string>
+ </dict>
+ <key>PBXTopSmartGroupGIDs</key>
+ <array/>
+ <key>XCIncludePerspectivesSwitch</key>
+ <false/>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {285, 859}}</string>
+ <key>GroupTreeTableConfiguration</key>
+ <array>
+ <string>MainColumn</string>
+ <real>268</real>
+ </array>
+ <key>RubberWindowFrame</key>
+ <string>170 278 1340 900 0 0 1920 1178 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXSmartGroupTreeModule</string>
+ <key>Proportion</key>
+ <string>285pt</string>
+ </dict>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>BecomeActive</key>
+ <true/>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>A1E70DF50A38C765007BE3E3</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>generic_lists.c</string>
+ <key>PBXSplitModuleInNavigatorKey</key>
+ <dict>
+ <key>Split0</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>A1E70DF60A38C765007BE3E3</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>generic_lists.c</string>
+ <key>_historyCapacity</key>
+ <integer>0</integer>
+ <key>bookmark</key>
+ <string>A1E710F40A3A253F007BE3E3</string>
+ <key>history</key>
+ <array>
+ <string>A1E70DF90A38C765007BE3E3</string>
+ <string>A1E70DFA0A38C765007BE3E3</string>
+ <string>A1E70DFB0A38C765007BE3E3</string>
+ <string>A1E70E010A38C765007BE3E3</string>
+ <string>A1E70E020A38C765007BE3E3</string>
+ <string>A1E70E090A38C765007BE3E3</string>
+ <string>A1E70E0A0A38C765007BE3E3</string>
+ <string>A1E70E0B0A38C765007BE3E3</string>
+ <string>A1E70E0C0A38C765007BE3E3</string>
+ <string>A1E70E3D0A38C78C007BE3E3</string>
+ <string>A1E70E4A0A38C7BE007BE3E3</string>
+ <string>A1E70E520A38C9FD007BE3E3</string>
+ <string>A1E70E530A38C9FD007BE3E3</string>
+ <string>A1E70E770A38CA55007BE3E3</string>
+ <string>A1E70EB50A38CB4D007BE3E3</string>
+ <string>A1E70ED70A38CCB6007BE3E3</string>
+ <string>A1E70EFE0A38CD66007BE3E3</string>
+ <string>A1E70F0F0A38CE21007BE3E3</string>
+ <string>A1E70F9C0A38D41E007BE3E3</string>
+ <string>A1E70F9D0A38D41E007BE3E3</string>
+ <string>A1E70FC60A38D560007BE3E3</string>
+ <string>A1E70FD80A38D573007BE3E3</string>
+ <string>A1E70FFA0A38D806007BE3E3</string>
+ <string>A1E70FFC0A38D806007BE3E3</string>
+ <string>A1E7100C0A38D888007BE3E3</string>
+ <string>A1E7100D0A38D888007BE3E3</string>
+ <string>A1E710840A3A1CFB007BE3E3</string>
+ <string>A1E7108D0A3A1D06007BE3E3</string>
+ <string>A1E710930A3A1D22007BE3E3</string>
+ <string>A1E710940A3A1D22007BE3E3</string>
+ <string>A1E710BC0A3A2415007BE3E3</string>
+ <string>A1E710EA0A3A2521007BE3E3</string>
+ <string>A1E710EB0A3A2521007BE3E3</string>
+ <string>A1E710EC0A3A2521007BE3E3</string>
+ <string>A1E710D10A3A2456007BE3E3</string>
+ </array>
+ <key>prevStack</key>
+ <array>
+ <string>A1E70E100A38C765007BE3E3</string>
+ <string>A1E70E110A38C765007BE3E3</string>
+ <string>A1E70E120A38C765007BE3E3</string>
+ <string>A1E70E130A38C765007BE3E3</string>
+ <string>A1E70E140A38C765007BE3E3</string>
+ <string>A1E70E150A38C765007BE3E3</string>
+ <string>A1E70E160A38C765007BE3E3</string>
+ <string>A1E70E180A38C765007BE3E3</string>
+ <string>A1E70E1B0A38C765007BE3E3</string>
+ <string>A1E70E1E0A38C765007BE3E3</string>
+ <string>A1E70E1F0A38C765007BE3E3</string>
+ <string>A1E70E200A38C765007BE3E3</string>
+ <string>A1E70E250A38C765007BE3E3</string>
+ <string>A1E70E260A38C765007BE3E3</string>
+ <string>A1E70E290A38C765007BE3E3</string>
+ <string>A1E70E2A0A38C765007BE3E3</string>
+ <string>A1E70E2B0A38C765007BE3E3</string>
+ <string>A1E70E2D0A38C765007BE3E3</string>
+ <string>A1E70E2E0A38C765007BE3E3</string>
+ <string>A1E70E380A38C778007BE3E3</string>
+ <string>A1E70E410A38C78C007BE3E3</string>
+ <string>A1E70E450A38C791007BE3E3</string>
+ <string>A1E70E560A38C9FD007BE3E3</string>
+ <string>A1E70E580A38C9FD007BE3E3</string>
+ <string>A1E70E6F0A38CA08007BE3E3</string>
+ <string>A1E70E7D0A38CA55007BE3E3</string>
+ <string>A1E70EAB0A38CB24007BE3E3</string>
+ <string>A1E70EC30A38CC14007BE3E3</string>
+ <string>A1E70EE20A38CCD6007BE3E3</string>
+ <string>A1E70FFF0A38D806007BE3E3</string>
+ <string>A1E710110A38D888007BE3E3</string>
+ <string>A1E710140A38D888007BE3E3</string>
+ <string>A1E710BE0A3A2415007BE3E3</string>
+ <string>A1E710C80A3A2441007BE3E3</string>
+ <string>A1E710D30A3A2456007BE3E3</string>
+ <string>A1E710E10A3A247D007BE3E3</string>
+ <string>A1E710E20A3A247D007BE3E3</string>
+ <string>A1E710ED0A3A2521007BE3E3</string>
+ <string>A1E710EE0A3A2521007BE3E3</string>
+ <string>A1E710EF0A3A2521007BE3E3</string>
+ </array>
+ </dict>
+ <key>SplitCount</key>
+ <string>1</string>
+ </dict>
+ <key>StatusBarVisibility</key>
+ <true/>
+ <key>XCSharingToken</key>
+ <string>com.apple.Xcode.CommonNavigatorGroupSharingToken</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {1050, 553}}</string>
+ <key>RubberWindowFrame</key>
+ <string>170 278 1340 900 0 0 1920 1178 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXNavigatorGroup</string>
+ <key>Proportion</key>
+ <string>553pt</string>
+ </dict>
+ <dict>
+ <key>Proportion</key>
+ <string>301pt</string>
+ <key>Tabs</key>
+ <array>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CA23EDF0692099D00951B8B</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Detail</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{10, 27}, {1050, 274}}</string>
+ <key>RubberWindowFrame</key>
+ <string>170 278 1340 900 0 0 1920 1178 </string>
+ </dict>
+ <key>Module</key>
+ <string>XCDetailModule</string>
+ </dict>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CA23EE00692099D00951B8B</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Project Find</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{10, 27}, {1050, 274}}</string>
+ </dict>
+ <key>Module</key>
+ <string>PBXProjectFindModule</string>
+ </dict>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CA23EE10692099D00951B8B</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>SCM Results</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{10, 31}, {603, 297}}</string>
+ </dict>
+ <key>Module</key>
+ <string>PBXCVSModule</string>
+ </dict>
+ </array>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>1050pt</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Project</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>XCModuleDock</string>
+ <string>PBXSmartGroupTreeModule</string>
+ <string>XCModuleDock</string>
+ <string>PBXNavigatorGroup</string>
+ <string>XCDockableTabModule</string>
+ <string>XCDetailModule</string>
+ <string>PBXProjectFindModule</string>
+ <string>PBXCVSModule</string>
+ </array>
+ <key>TableOfContents</key>
+ <array>
+ <string>A1E710B00A3A22FE007BE3E3</string>
+ <string>1CA23ED40692098700951B8B</string>
+ <string>A1E710B10A3A22FE007BE3E3</string>
+ <string>A1E70DF50A38C765007BE3E3</string>
+ <string>A1E710B20A3A22FE007BE3E3</string>
+ <string>1CA23EDF0692099D00951B8B</string>
+ <string>1CA23EE00692099D00951B8B</string>
+ <string>1CA23EE10692099D00951B8B</string>
+ </array>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.default</string>
+ </dict>
+ <dict>
+ <key>ChosenToolbarItems</key>
+ <array>
+ <string>XCToolbarPerspectiveControl</string>
+ <string>NSToolbarSeparatorItem</string>
+ <string>active-target-popup</string>
+ <string>active-executable-popup</string>
+ <string>active-buildstyle-popup</string>
+ <string>NSToolbarFlexibleSpaceItem</string>
+ <string>build</string>
+ <string>clean</string>
+ <string>NSToolbarSeparatorItem</string>
+ <string>run</string>
+ <string>debug</string>
+ </array>
+ <key>ControllerClassBaseName</key>
+ <string></string>
+ <key>IconName</key>
+ <string>BuildTabIcon</string>
+ <key>Identifier</key>
+ <string>perspective.build</string>
+ <key>IsVertical</key>
+ <false/>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXBottomSmartGroupGIDs</key>
+ <array/>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CA23EE50692099D00951B8B</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Files</string>
+ <key>PBXProjectStructureProvided</key>
+ <string>yes</string>
+ <key>PBXSmartGroupTreeModuleColumnData</key>
+ <dict>
+ <key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
+ <array>
+ <real>184</real>
+ </array>
+ <key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
+ <array>
+ <string>MainColumn</string>
+ </array>
+ </dict>
+ <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
+ <dict>
+ <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
+ <array/>
+ <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
+ <array>
+ <array>
+ <integer>0</integer>
+ </array>
+ </array>
+ <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
+ <string>{{0, 0}, {184, 841}}</string>
+ </dict>
+ <key>PBXTopSmartGroupGIDs</key>
+ <array/>
+ <key>XCIncludePerspectivesSwitch</key>
+ <false/>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {201, 859}}</string>
+ <key>GroupTreeTableConfiguration</key>
+ <array>
+ <string>MainColumn</string>
+ <real>184</real>
+ </array>
+ </dict>
+ <key>Module</key>
+ <string>PBXSmartGroupTreeModule</string>
+ <key>Proportion</key>
+ <string>201pt</string>
+ </dict>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>A1E70DF50A38C765007BE3E3</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>CredentialsCache.h</string>
+ <key>PBXSplitModuleInNavigatorKey</key>
+ <dict>
+ <key>Split0</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>A1E70DF60A38C765007BE3E3</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>CredentialsCache.h</string>
+ <key>_historyCapacity</key>
+ <integer>0</integer>
+ <key>bookmark</key>
+ <string>A1E710F50A3A253F007BE3E3</string>
+ <key>history</key>
+ <array>
+ <string>A1E70DF70A38C765007BE3E3</string>
+ <string>A1E70DF80A38C765007BE3E3</string>
+ <string>A1E70DF90A38C765007BE3E3</string>
+ <string>A1E70DFA0A38C765007BE3E3</string>
+ <string>A1E70DFB0A38C765007BE3E3</string>
+ <string>A1E70E010A38C765007BE3E3</string>
+ <string>A1E70E020A38C765007BE3E3</string>
+ <string>A1E70E060A38C765007BE3E3</string>
+ <string>A1E70E090A38C765007BE3E3</string>
+ <string>A1E70E0A0A38C765007BE3E3</string>
+ <string>A1E70E0B0A38C765007BE3E3</string>
+ <string>A1E70E0C0A38C765007BE3E3</string>
+ <string>A1E70E3D0A38C78C007BE3E3</string>
+ <string>A1E70E430A38C791007BE3E3</string>
+ <string>A1E70E770A38CA55007BE3E3</string>
+ <string>A1E70ECB0A38CC4C007BE3E3</string>
+ <string>A1E70F440A38D252007BE3E3</string>
+ <string>A1E70F450A38D252007BE3E3</string>
+ <string>A1E70F8B0A38D3B4007BE3E3</string>
+ <string>A1E70FC60A38D560007BE3E3</string>
+ <string>A1E70FC80A38D560007BE3E3</string>
+ <string>A1E70FC90A38D560007BE3E3</string>
+ <string>A1E70FEE0A38D7C0007BE3E3</string>
+ <string>A1E70FEF0A38D7C0007BE3E3</string>
+ <string>A1E70FF00A38D7C0007BE3E3</string>
+ <string>A1E70FFC0A38D806007BE3E3</string>
+ <string>A1E7100D0A38D888007BE3E3</string>
+ <string>A1E7103C0A38DE0B007BE3E3</string>
+ <string>A1E7105A0A39ED89007BE3E3</string>
+ <string>A1E710890A3A1D04007BE3E3</string>
+ <string>A1E7109C0A3A1D2B007BE3E3</string>
+ <string>A1E710CA0A3A244D007BE3E3</string>
+ <string>A1E710CB0A3A244D007BE3E3</string>
+ <string>A1E710D80A3A2465007BE3E3</string>
+ <string>A1E710E30A3A247D007BE3E3</string>
+ </array>
+ <key>prevStack</key>
+ <array>
+ <string>A1E70E100A38C765007BE3E3</string>
+ <string>A1E70E110A38C765007BE3E3</string>
+ <string>A1E70E120A38C765007BE3E3</string>
+ <string>A1E70E130A38C765007BE3E3</string>
+ <string>A1E70E140A38C765007BE3E3</string>
+ <string>A1E70E150A38C765007BE3E3</string>
+ <string>A1E70E160A38C765007BE3E3</string>
+ <string>A1E70E170A38C765007BE3E3</string>
+ <string>A1E70E180A38C765007BE3E3</string>
+ <string>A1E70E1E0A38C765007BE3E3</string>
+ <string>A1E70E1F0A38C765007BE3E3</string>
+ <string>A1E70E250A38C765007BE3E3</string>
+ <string>A1E70E260A38C765007BE3E3</string>
+ <string>A1E70E290A38C765007BE3E3</string>
+ <string>A1E70E2A0A38C765007BE3E3</string>
+ <string>A1E70E2B0A38C765007BE3E3</string>
+ <string>A1E70E2D0A38C765007BE3E3</string>
+ <string>A1E70E2E0A38C765007BE3E3</string>
+ <string>A1E70E380A38C778007BE3E3</string>
+ <string>A1E70E410A38C78C007BE3E3</string>
+ <string>A1E70E450A38C791007BE3E3</string>
+ <string>A1E70E560A38C9FD007BE3E3</string>
+ <string>A1E70E580A38C9FD007BE3E3</string>
+ <string>A1E70E7D0A38CA55007BE3E3</string>
+ <string>A1E70EAB0A38CB24007BE3E3</string>
+ <string>A1E70EC30A38CC14007BE3E3</string>
+ <string>A1E70EE20A38CCD6007BE3E3</string>
+ <string>A1E70FCD0A38D560007BE3E3</string>
+ <string>A1E70FFF0A38D806007BE3E3</string>
+ <string>A1E710140A38D888007BE3E3</string>
+ <string>A1E710400A38DE0B007BE3E3</string>
+ <string>A1E70E6F0A38CA08007BE3E3</string>
+ <string>A1E710CD0A3A244D007BE3E3</string>
+ <string>A1E710E20A3A247D007BE3E3</string>
+ </array>
+ </dict>
+ <key>SplitCount</key>
+ <string>1</string>
+ </dict>
+ <key>StatusBarVisibility</key>
+ <true/>
+ <key>XCSharingToken</key>
+ <string>com.apple.Xcode.CommonNavigatorGroupSharingToken</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {1134, 480}}</string>
+ </dict>
+ <key>Module</key>
+ <string>PBXNavigatorGroup</string>
+ <key>Proportion</key>
+ <string>480pt</string>
+ </dict>
+ <dict>
+ <key>Proportion</key>
+ <string>374pt</string>
+ <key>Tabs</key>
+ <array>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>XCMainBuildResultsModuleGUID</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Build</string>
+ <key>XCBuildResultsTrigger_Collapse</key>
+ <integer>1021</integer>
+ <key>XCBuildResultsTrigger_Open</key>
+ <integer>1010</integer>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{10, 27}, {1134, 347}}</string>
+ </dict>
+ <key>Module</key>
+ <string>PBXBuildResultsModule</string>
+ </dict>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>LauncherConfigVersion</key>
+ <string>3</string>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CA23EE80692099D00951B8B</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Run</string>
+ <key>Runner</key>
+ <dict>
+ <key>HorizontalSplitView</key>
+ <dict>
+ <key>_collapsingFrameDimension</key>
+ <real>0.0</real>
+ <key>_indexOfCollapsedView</key>
+ <integer>0</integer>
+ <key>_percentageOfCollapsedView</key>
+ <real>0.0</real>
+ <key>isCollapsed</key>
+ <string>yes</string>
+ <key>sizes</key>
+ <array>
+ <string>{{0, 0}, {365, 167}}</string>
+ <string>{{0, 176}, {365, 267}}</string>
+ </array>
+ </dict>
+ <key>VerticalSplitView</key>
+ <dict>
+ <key>_collapsingFrameDimension</key>
+ <real>0.0</real>
+ <key>_indexOfCollapsedView</key>
+ <integer>0</integer>
+ <key>_percentageOfCollapsedView</key>
+ <real>0.0</real>
+ <key>isCollapsed</key>
+ <string>yes</string>
+ <key>sizes</key>
+ <array>
+ <string>{{0, 0}, {405, 443}}</string>
+ <string>{{414, 0}, {514, 443}}</string>
+ </array>
+ </dict>
+ </dict>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {0, 0}}</string>
+ </dict>
+ <key>Module</key>
+ <string>PBXRunSessionModule</string>
+ </dict>
+ </array>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>1134pt</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Build</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>XCModuleDock</string>
+ <string>PBXSmartGroupTreeModule</string>
+ <string>XCModuleDock</string>
+ <string>PBXNavigatorGroup</string>
+ <string>XCDockableTabModule</string>
+ <string>PBXBuildResultsModule</string>
+ <string>PBXRunSessionModule</string>
+ <string>XCConsole</string>
+ </array>
+ <key>TableOfContents</key>
+ <array>
+ <string>A1E710B40A3A22FF007BE3E3</string>
+ <string>1CA23EE50692099D00951B8B</string>
+ <string>A1E710B50A3A22FF007BE3E3</string>
+ <string>A1E70DF50A38C765007BE3E3</string>
+ <string>A1E710B60A3A22FF007BE3E3</string>
+ <string>XCMainBuildResultsModuleGUID</string>
+ <string>1CA23EE80692099D00951B8B</string>
+ <string>A1E710B70A3A22FF007BE3E3</string>
+ </array>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.buildAndRun</string>
+ </dict>
+ <dict>
+ <key>ChosenToolbarItems</key>
+ <array>
+ <string>XCToolbarPerspectiveControl</string>
+ <string>NSToolbarSeparatorItem</string>
+ <string>build-and-debug</string>
+ <string>debug</string>
+ <string>NSToolbarFlexibleSpaceItem</string>
+ <string>debugger-fix-and-continue</string>
+ <string>debugger-restart-executable</string>
+ <string>debugger-pause</string>
+ <string>debugger-continue</string>
+ <string>debugger-step-over</string>
+ <string>debugger-step-into</string>
+ <string>debugger-step-out</string>
+ <string>debugger-step-instruction</string>
+ <string>NSToolbarFlexibleSpaceItem</string>
+ </array>
+ <key>ControllerClassBaseName</key>
+ <string>PBXDebugSessionModule</string>
+ <key>IconName</key>
+ <string>DebugTabIcon</string>
+ <key>Identifier</key>
+ <string>perspective.debug</string>
+ <key>IsVertical</key>
+ <integer>1</integer>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CCC7628064C1048000F2A68</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Debugger Console</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {810, 0}}</string>
+ </dict>
+ <key>Module</key>
+ <string>PBXDebugCLIModule</string>
+ <key>Proportion</key>
+ <string>0%</string>
+ </dict>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>Debugger</key>
+ <dict>
+ <key>HorizontalSplitView</key>
+ <dict>
+ <key>_collapsingFrameDimension</key>
+ <real>0.0</real>
+ <key>_indexOfCollapsedView</key>
+ <integer>0</integer>
+ <key>_percentageOfCollapsedView</key>
+ <real>0.0</real>
+ <key>isCollapsed</key>
+ <string>yes</string>
+ <key>sizes</key>
+ <array>
+ <string>{{0, 0}, {395, 213}}</string>
+ <string>{{395, 0}, {415, 213}}</string>
+ </array>
+ </dict>
+ <key>VerticalSplitView</key>
+ <dict>
+ <key>_collapsingFrameDimension</key>
+ <real>0.0</real>
+ <key>_indexOfCollapsedView</key>
+ <integer>0</integer>
+ <key>_percentageOfCollapsedView</key>
+ <real>0.0</real>
+ <key>isCollapsed</key>
+ <string>yes</string>
+ <key>sizes</key>
+ <array>
+ <string>{{0, 0}, {810, 213}}</string>
+ <string>{{0, 213}, {810, 225}}</string>
+ </array>
+ </dict>
+ </dict>
+ <key>LauncherConfigVersion</key>
+ <string>8</string>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CCC7629064C1048000F2A68</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Debug</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>DebugConsoleDrawerSize</key>
+ <string>{100, 120}</string>
+ <key>DebugConsoleVisible</key>
+ <string>None</string>
+ <key>DebugConsoleWindowFrame</key>
+ <string>{{200, 200}, {500, 300}}</string>
+ <key>DebugSTDIOWindowFrame</key>
+ <string>{{200, 200}, {500, 300}}</string>
+ <key>Frame</key>
+ <string>{{0, 7}, {810, 438}}</string>
+ </dict>
+ <key>Module</key>
+ <string>PBXDebugSessionModule</string>
+ <key>Proportion</key>
+ <string>443pt</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Debug</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>XCModuleDock</string>
+ <string>XCModuleDock</string>
+ <string>PBXDebugCLIModule</string>
+ <string>PBXDebugSessionModule</string>
+ <string>XCConsole</string>
+ </array>
+ <key>TableOfContents</key>
+ <array>
+ <string>1CC8E6A5069209BD00BB180A</string>
+ <string>1CC8E6A6069209BD00BB180A</string>
+ <string>1CCC7628064C1048000F2A68</string>
+ <string>1CCC7629064C1048000F2A68</string>
+ <string>1CC8E6A7069209BD00BB180A</string>
+ </array>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.debug</string>
+ </dict>
+ </array>
+ <key>PerspectivesBarVisible</key>
+ <true/>
+ <key>ShelfIsVisible</key>
+ <false/>
+ <key>SourceDescription</key>
+ <string>file at '/System/Library/PrivateFrameworks/DevToolsInterface.framework/Versions/A/Resources/XCPerspectivesSpecification.xcperspec'</string>
+ <key>StatusbarIsVisible</key>
+ <true/>
+ <key>TimeStamp</key>
+ <real>171582783.00723499</real>
+ <key>ToolbarDisplayMode</key>
+ <integer>1</integer>
+ <key>ToolbarIsVisible</key>
+ <true/>
+ <key>ToolbarSizeMode</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Perspectives</string>
+ <key>UpdateMessage</key>
+ <string></string>
+ <key>WindowJustification</key>
+ <integer>5</integer>
+ <key>WindowOrderList</key>
+ <array>
+ <string>/Volumes/Ra-Tilt/Users/lxs/KfM/CCAPI/src/lib/ccapi/mac/CCAPI.xcodeproj</string>
+ </array>
+ <key>WindowString</key>
+ <string>170 278 1340 900 0 0 1920 1178 </string>
+ <key>WindowTools</key>
+ <array>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.find</string>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CDD528C0622207200134675</string>
+ <key>PBXProjectModuleLabel</key>
+ <string><No Editor></string>
+ <key>PBXSplitModuleInNavigatorKey</key>
+ <dict>
+ <key>Split0</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CD0528D0623707200166675</string>
+ </dict>
+ <key>SplitCount</key>
+ <string>1</string>
+ </dict>
+ <key>StatusBarVisibility</key>
+ <integer>1</integer>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {781, 167}}</string>
+ <key>RubberWindowFrame</key>
+ <string>62 385 781 470 0 0 1440 878 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXNavigatorGroup</string>
+ <key>Proportion</key>
+ <string>781pt</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>50%</string>
+ </dict>
+ <dict>
+ <key>BecomeActive</key>
+ <integer>1</integer>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CD0528E0623707200166675</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Project Find</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{8, 0}, {773, 254}}</string>
+ <key>RubberWindowFrame</key>
+ <string>62 385 781 470 0 0 1440 878 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXProjectFindModule</string>
+ <key>Proportion</key>
+ <string>50%</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>428pt</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Project Find</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>PBXProjectFindModule</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <integer>1</integer>
+ <key>TableOfContents</key>
+ <array>
+ <string>1C530D57069F1CE1000CFCEE</string>
+ <string>1C530D58069F1CE1000CFCEE</string>
+ <string>1C530D59069F1CE1000CFCEE</string>
+ <string>1CDD528C0622207200134675</string>
+ <string>1C530D5A069F1CE1000CFCEE</string>
+ <string>1CE0B1FE06471DED0097A5F4</string>
+ <string>1CD0528E0623707200166675</string>
+ </array>
+ <key>WindowString</key>
+ <string>62 385 781 470 0 0 1440 878 </string>
+ <key>WindowToolGUID</key>
+ <string>1C530D57069F1CE1000CFCEE</string>
+ <key>WindowToolIsVisible</key>
+ <integer>0</integer>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.run</string>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>LauncherConfigVersion</key>
+ <string>3</string>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CD0528B0623707200166675</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Run - cocoapp112 - cocoapp112</string>
+ <key>Runner</key>
+ <dict>
+ <key>HorizontalSplitView</key>
+ <dict>
+ <key>_collapsingFrameDimension</key>
+ <real>0.0</real>
+ <key>_indexOfCollapsedView</key>
+ <integer>0</integer>
+ <key>_percentageOfCollapsedView</key>
+ <real>0.0</real>
+ <key>isCollapsed</key>
+ <string>yes</string>
+ <key>sizes</key>
+ <array>
+ <string>{{0, 0}, {365, 167}}</string>
+ <string>{{0, 176}, {365, 267}}</string>
+ </array>
+ </dict>
+ <key>VerticalSplitView</key>
+ <dict>
+ <key>_collapsingFrameDimension</key>
+ <real>0.0</real>
+ <key>_indexOfCollapsedView</key>
+ <integer>0</integer>
+ <key>_percentageOfCollapsedView</key>
+ <real>0.0</real>
+ <key>isCollapsed</key>
+ <string>yes</string>
+ <key>sizes</key>
+ <array>
+ <string>{{0, 0}, {405, 443}}</string>
+ <string>{{414, 0}, {514, 443}}</string>
+ </array>
+ </dict>
+ </dict>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {456, 192}}</string>
+ <key>RubberWindowFrame</key>
+ <string>741 130 456 234 0 0 1280 1002 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXRunSessionModule</string>
+ <key>Proportion</key>
+ <string>192pt</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>192pt</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Run Log</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>PBXRunSessionModule</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <integer>1</integer>
+ <key>TableOfContents</key>
+ <array>
+ <string>1C78EAAF065D492600B07095</string>
+ <string>1C78EAB0065D492600B07095</string>
+ <string>1CD0528B0623707200166675</string>
+ <string>1C78EAB1065D492600B07095</string>
+ </array>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.run</string>
+ <key>WindowString</key>
+ <string>741 130 456 234 0 0 1280 1002 </string>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.scm</string>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1C78EAB2065D492600B07095</string>
+ <key>PBXProjectModuleLabel</key>
+ <string><No Editor></string>
+ <key>PBXSplitModuleInNavigatorKey</key>
+ <dict>
+ <key>Split0</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1C78EAB3065D492600B07095</string>
+ </dict>
+ <key>SplitCount</key>
+ <string>1</string>
+ </dict>
+ <key>StatusBarVisibility</key>
+ <integer>1</integer>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {452, 0}}</string>
+ <key>RubberWindowFrame</key>
+ <string>743 379 452 308 0 0 1280 1002 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXNavigatorGroup</string>
+ <key>Proportion</key>
+ <string>0pt</string>
+ </dict>
+ <dict>
+ <key>BecomeActive</key>
+ <integer>1</integer>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CD052920623707200166675</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>SCM</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>ConsoleFrame</key>
+ <string>{{0, 259}, {452, 0}}</string>
+ <key>Frame</key>
+ <string>{{0, 7}, {452, 259}}</string>
+ <key>RubberWindowFrame</key>
+ <string>743 379 452 308 0 0 1280 1002 </string>
+ <key>TableConfiguration</key>
+ <array>
+ <string>Status</string>
+ <real>30</real>
+ <string>FileName</string>
+ <real>199</real>
+ <string>Path</string>
+ <real>197.09500122070312</real>
+ </array>
+ <key>TableFrame</key>
+ <string>{{0, 0}, {452, 250}}</string>
+ </dict>
+ <key>Module</key>
+ <string>PBXCVSModule</string>
+ <key>Proportion</key>
+ <string>262pt</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>266pt</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>SCM</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>PBXCVSModule</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <integer>1</integer>
+ <key>TableOfContents</key>
+ <array>
+ <string>1C78EAB4065D492600B07095</string>
+ <string>1C78EAB5065D492600B07095</string>
+ <string>1C78EAB2065D492600B07095</string>
+ <string>1CD052920623707200166675</string>
+ </array>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.scm</string>
+ <key>WindowString</key>
+ <string>743 379 452 308 0 0 1280 1002 </string>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.breakpoints</string>
+ <key>IsVertical</key>
+ <integer>0</integer>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>BecomeActive</key>
+ <integer>1</integer>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXBottomSmartGroupGIDs</key>
+ <array>
+ <string>1C77FABC04509CD000000102</string>
+ </array>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CE0B1FE06471DED0097A5F4</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Files</string>
+ <key>PBXProjectStructureProvided</key>
+ <string>no</string>
+ <key>PBXSmartGroupTreeModuleColumnData</key>
+ <dict>
+ <key>PBXSmartGroupTreeModuleColumnWidthsKey</key>
+ <array>
+ <real>168</real>
+ </array>
+ <key>PBXSmartGroupTreeModuleColumnsKey_v4</key>
+ <array>
+ <string>MainColumn</string>
+ </array>
+ </dict>
+ <key>PBXSmartGroupTreeModuleOutlineStateKey_v7</key>
+ <dict>
+ <key>PBXSmartGroupTreeModuleOutlineStateExpansionKey</key>
+ <array>
+ <string>1C77FABC04509CD000000102</string>
+ </array>
+ <key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
+ <array>
+ <array>
+ <integer>0</integer>
+ </array>
+ </array>
+ <key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
+ <string>{{0, 0}, {168, 350}}</string>
+ </dict>
+ <key>PBXTopSmartGroupGIDs</key>
+ <array/>
+ <key>XCIncludePerspectivesSwitch</key>
+ <integer>0</integer>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{0, 0}, {185, 368}}</string>
+ <key>GroupTreeTableConfiguration</key>
+ <array>
+ <string>MainColumn</string>
+ <real>168</real>
+ </array>
+ <key>RubberWindowFrame</key>
+ <string>315 424 744 409 0 0 1440 878 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXSmartGroupTreeModule</string>
+ <key>Proportion</key>
+ <string>185pt</string>
+ </dict>
+ <dict>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CA1AED706398EBD00589147</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Detail</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>Frame</key>
+ <string>{{190, 0}, {554, 368}}</string>
+ <key>RubberWindowFrame</key>
+ <string>315 424 744 409 0 0 1440 878 </string>
+ </dict>
+ <key>Module</key>
+ <string>XCDetailModule</string>
+ <key>Proportion</key>
+ <string>554pt</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>368pt</string>
+ </dict>
+ </array>
+ <key>MajorVersion</key>
+ <integer>2</integer>
+ <key>MinorVersion</key>
+ <integer>0</integer>
+ <key>Name</key>
+ <string>Breakpoints</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>PBXSmartGroupTreeModule</string>
+ <string>XCDetailModule</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <integer>1</integer>
+ <key>TableOfContents</key>
+ <array>
+ <string>1CDDB66807F98D9800BB5817</string>
+ <string>1CDDB66907F98D9800BB5817</string>
+ <string>1CE0B1FE06471DED0097A5F4</string>
+ <string>1CA1AED706398EBD00589147</string>
+ </array>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.breakpoints</string>
+ <key>WindowString</key>
+ <string>315 424 744 409 0 0 1440 878 </string>
+ <key>WindowToolGUID</key>
+ <string>1CDDB66807F98D9800BB5817</string>
+ <key>WindowToolIsVisible</key>
+ <integer>1</integer>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.debugAnimator</string>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>Module</key>
+ <string>PBXNavigatorGroup</string>
+ <key>Proportion</key>
+ <string>100%</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>100%</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Debug Visualizer</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>PBXNavigatorGroup</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <integer>1</integer>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.debugAnimator</string>
+ <key>WindowString</key>
+ <string>100 100 700 500 0 0 1280 1002 </string>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.bookmarks</string>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>Module</key>
+ <string>PBXBookmarksModule</string>
+ <key>Proportion</key>
+ <string>166pt</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>166pt</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Bookmarks</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>PBXBookmarksModule</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <integer>0</integer>
+ <key>WindowString</key>
+ <string>538 42 401 187 0 0 1280 1002 </string>
+ </dict>
+ <dict>
+ <key>Identifier</key>
+ <string>windowTool.classBrowser</string>
+ <key>Layout</key>
+ <array>
+ <dict>
+ <key>Dock</key>
+ <array>
+ <dict>
+ <key>BecomeActive</key>
+ <integer>1</integer>
+ <key>ContentConfiguration</key>
+ <dict>
+ <key>OptionsSetName</key>
+ <string>Hierarchy, all classes</string>
+ <key>PBXProjectModuleGUID</key>
+ <string>1CA6456E063B45B4001379D8</string>
+ <key>PBXProjectModuleLabel</key>
+ <string>Class Browser - NSObject</string>
+ </dict>
+ <key>GeometryConfiguration</key>
+ <dict>
+ <key>ClassesFrame</key>
+ <string>{{0, 0}, {369, 96}}</string>
+ <key>ClassesTreeTableConfiguration</key>
+ <array>
+ <string>PBXClassNameColumnIdentifier</string>
+ <real>208</real>
+ <string>PBXClassBookColumnIdentifier</string>
+ <real>22</real>
+ </array>
+ <key>Frame</key>
+ <string>{{0, 0}, {616, 353}}</string>
+ <key>MembersFrame</key>
+ <string>{{0, 105}, {369, 395}}</string>
+ <key>MembersTreeTableConfiguration</key>
+ <array>
+ <string>PBXMemberTypeIconColumnIdentifier</string>
+ <real>22</real>
+ <string>PBXMemberNameColumnIdentifier</string>
+ <real>216</real>
+ <string>PBXMemberTypeColumnIdentifier</string>
+ <real>94</real>
+ <string>PBXMemberBookColumnIdentifier</string>
+ <real>22</real>
+ </array>
+ <key>PBXModuleWindowStatusBarHidden2</key>
+ <integer>1</integer>
+ <key>RubberWindowFrame</key>
+ <string>597 125 616 374 0 0 1280 1002 </string>
+ </dict>
+ <key>Module</key>
+ <string>PBXClassBrowserModule</string>
+ <key>Proportion</key>
+ <string>354pt</string>
+ </dict>
+ </array>
+ <key>Proportion</key>
+ <string>354pt</string>
+ </dict>
+ </array>
+ <key>Name</key>
+ <string>Class Browser</string>
+ <key>ServiceClasses</key>
+ <array>
+ <string>PBXClassBrowserModule</string>
+ </array>
+ <key>StatusbarIsVisible</key>
+ <integer>0</integer>
+ <key>TableOfContents</key>
+ <array>
+ <string>1C78EABA065D492600B07095</string>
+ <string>1C78EABB065D492600B07095</string>
+ <string>1CA6456E063B45B4001379D8</string>
+ </array>
+ <key>ToolbarConfiguration</key>
+ <string>xcode.toolbar.config.classbrowser</string>
+ <key>WindowString</key>
+ <string>597 125 616 374 0 0 1280 1002 </string>
+ </dict>
+ </array>
+</dict>
+</plist>
--- /dev/null
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 42;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ A1E70D480A38B5D5007BE3E3 /* cacheapi.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D000A38B5BB007BE3E3 /* cacheapi.c */; };
+ A1E70D490A38B5D5007BE3E3 /* ccache.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D010A38B5BB007BE3E3 /* ccache.c */; };
+ A1E70D4A0A38B5D5007BE3E3 /* ccache_iterator.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D030A38B5BB007BE3E3 /* ccache_iterator.c */; };
+ A1E70D4B0A38B5D5007BE3E3 /* ccapiv2.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D050A38B5BB007BE3E3 /* ccapiv2.c */; };
+ A1E70D4C0A38B5D5007BE3E3 /* ccstring.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D060A38B5BB007BE3E3 /* ccstring.c */; };
+ A1E70D4D0A38B5D5007BE3E3 /* context.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D080A38B5BB007BE3E3 /* context.c */; };
+ A1E70D4E0A38B5D5007BE3E3 /* credentials.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D0A0A38B5BB007BE3E3 /* credentials.c */; };
+ A1E70D4F0A38B5D5007BE3E3 /* credentials_iterator.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D0C0A38B5BB007BE3E3 /* credentials_iterator.c */; };
+ A1E70D510A38B60C007BE3E3 /* generic_lists.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D120A38B5BB007BE3E3 /* generic_lists.c */; };
+ A1E70D520A38B60C007BE3E3 /* marshall.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D130A38B5BB007BE3E3 /* marshall.c */; };
+ A1E70D530A38B60C007BE3E3 /* msg.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D140A38B5BB007BE3E3 /* msg.c */; };
+ A1E70D890A38BB47007BE3E3 /* ccs_ccache.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D280A38B5BB007BE3E3 /* ccs_ccache.c */; };
+ A1E70D8A0A38BB47007BE3E3 /* ccs_context.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D290A38B5BB007BE3E3 /* ccs_context.c */; };
+ A1E70D8B0A38BB47007BE3E3 /* ccs_lists.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D2A0A38B5BB007BE3E3 /* ccs_lists.c */; };
+ A1E70D8C0A38BB47007BE3E3 /* rpc_auth.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D2E0A38B5BB007BE3E3 /* rpc_auth.c */; };
+ A1E70D8D0A38BB47007BE3E3 /* serv_ops.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D2F0A38B5BB007BE3E3 /* serv_ops.c */; };
+ A1E70D8E0A38BB4F007BE3E3 /* generic_lists.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D120A38B5BB007BE3E3 /* generic_lists.c */; };
+ A1E70D8F0A38BB4F007BE3E3 /* marshall.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D130A38B5BB007BE3E3 /* marshall.c */; };
+ A1E70D900A38BB4F007BE3E3 /* msg.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D140A38B5BB007BE3E3 /* msg.c */; };
+ A1E70D9B0A38BBE2007BE3E3 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D930A38BB67007BE3E3 /* main.c */; };
+ A1E70D9F0A38BCAD007BE3E3 /* mig.defs in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D9E0A38BCAD007BE3E3 /* mig.defs */; };
+ A1E70DA00A38BCAD007BE3E3 /* mig.defs in Sources */ = {isa = PBXBuildFile; fileRef = A1E70D9E0A38BCAD007BE3E3 /* mig.defs */; settings = {ATTRIBUTES = (Server, ); }; };
+ A1E70DEA0A38C710007BE3E3 /* kipc_client.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70DE40A38C6FD007BE3E3 /* kipc_client.c */; };
+ A1E70DEB0A38C710007BE3E3 /* kipc_common.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70DE50A38C6FD007BE3E3 /* kipc_common.c */; };
+ A1E70DEC0A38C710007BE3E3 /* kipc_session.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70DE70A38C6FD007BE3E3 /* kipc_session.c */; };
+ A1E70DED0A38C71D007BE3E3 /* kipc_common.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70DE50A38C6FD007BE3E3 /* kipc_common.c */; };
+ A1E70DEE0A38C71D007BE3E3 /* kipc_server.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70DE60A38C6FD007BE3E3 /* kipc_server.c */; };
+ A1E70DEF0A38C71D007BE3E3 /* kipc_session.c in Sources */ = {isa = PBXBuildFile; fileRef = A1E70DE70A38C6FD007BE3E3 /* kipc_session.c */; };
+ A1E70DF00A38C71D007BE3E3 /* notify.defs in Sources */ = {isa = PBXBuildFile; fileRef = A1E70DE80A38C6FD007BE3E3 /* notify.defs */; settings = {ATTRIBUTES = (Server, ); }; };
+/* End PBXBuildFile section */
+
+/* Begin PBXFileReference section */
+ A1E70D000A38B5BB007BE3E3 /* cacheapi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = cacheapi.c; sourceTree = "<group>"; };
+ A1E70D010A38B5BB007BE3E3 /* ccache.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ccache.c; sourceTree = "<group>"; };
+ A1E70D020A38B5BB007BE3E3 /* ccache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccache.h; sourceTree = "<group>"; };
+ A1E70D030A38B5BB007BE3E3 /* ccache_iterator.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ccache_iterator.c; sourceTree = "<group>"; };
+ A1E70D040A38B5BB007BE3E3 /* ccache_iterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccache_iterator.h; sourceTree = "<group>"; };
+ A1E70D050A38B5BB007BE3E3 /* ccapiv2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ccapiv2.c; sourceTree = "<group>"; };
+ A1E70D060A38B5BB007BE3E3 /* ccstring.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ccstring.c; sourceTree = "<group>"; };
+ A1E70D070A38B5BB007BE3E3 /* ccstring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ccstring.h; sourceTree = "<group>"; };
+ A1E70D080A38B5BB007BE3E3 /* context.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = context.c; sourceTree = "<group>"; };
+ A1E70D090A38B5BB007BE3E3 /* context.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = context.h; sourceTree = "<group>"; };
+ A1E70D0A0A38B5BB007BE3E3 /* credentials.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = credentials.c; sourceTree = "<group>"; };
+ A1E70D0B0A38B5BB007BE3E3 /* credentials.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = credentials.h; sourceTree = "<group>"; };
+ A1E70D0C0A38B5BB007BE3E3 /* credentials_iterator.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = credentials_iterator.c; sourceTree = "<group>"; };
+ A1E70D0D0A38B5BB007BE3E3 /* credentials_iterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = credentials_iterator.h; sourceTree = "<group>"; };
+ A1E70D0F0A38B5BB007BE3E3 /* NTMakefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NTMakefile; sourceTree = "<group>"; };
+ A1E70D120A38B5BB007BE3E3 /* generic_lists.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = generic_lists.c; sourceTree = "<group>"; };
+ A1E70D130A38B5BB007BE3E3 /* marshall.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = marshall.c; sourceTree = "<group>"; };
+ A1E70D140A38B5BB007BE3E3 /* msg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = msg.c; sourceTree = "<group>"; };
+ A1E70D150A38B5BB007BE3E3 /* NTMakefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NTMakefile; sourceTree = "<group>"; };
+ A1E70D170A38B5BB007BE3E3 /* implementation-notes.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "implementation-notes.txt"; sourceTree = "<group>"; };
+ A1E70D190A38B5BB007BE3E3 /* cc_rpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = cc_rpc.h; sourceTree = "<group>"; };
+ A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CredentialsCache.h; sourceTree = "<group>"; };
+ A1E70D1B0A38B5BB007BE3E3 /* CredentialsCache2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CredentialsCache2.h; sourceTree = "<group>"; };
+ A1E70D1C0A38B5BB007BE3E3 /* datastore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = datastore.h; sourceTree = "<group>"; };
+ A1E70D1D0A38B5BB007BE3E3 /* generic_lists.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = generic_lists.h; sourceTree = "<group>"; };
+ A1E70D1E0A38B5BB007BE3E3 /* marshall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = marshall.h; sourceTree = "<group>"; };
+ A1E70D1F0A38B5BB007BE3E3 /* msg.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = msg.h; sourceTree = "<group>"; };
+ A1E70D200A38B5BB007BE3E3 /* msg_headers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = msg_headers.h; sourceTree = "<group>"; };
+ A1E70D210A38B5BB007BE3E3 /* rpc_auth.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rpc_auth.h; sourceTree = "<group>"; };
+ A1E70D260A38B5BB007BE3E3 /* NTMakefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = NTMakefile; path = ../NTMakefile; sourceTree = SOURCE_ROOT; };
+ A1E70D280A38B5BB007BE3E3 /* ccs_ccache.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ccs_ccache.c; sourceTree = "<group>"; };
+ A1E70D290A38B5BB007BE3E3 /* ccs_context.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ccs_context.c; sourceTree = "<group>"; };
+ A1E70D2A0A38B5BB007BE3E3 /* ccs_lists.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ccs_lists.c; sourceTree = "<group>"; };
+ A1E70D2C0A38B5BB007BE3E3 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
+ A1E70D2D0A38B5BB007BE3E3 /* NTMakefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NTMakefile; sourceTree = "<group>"; };
+ A1E70D2E0A38B5BB007BE3E3 /* rpc_auth.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rpc_auth.c; sourceTree = "<group>"; };
+ A1E70D2F0A38B5BB007BE3E3 /* serv_ops.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = serv_ops.c; sourceTree = "<group>"; };
+ A1E70D300A38B5BB007BE3E3 /* serv_ops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = serv_ops.h; sourceTree = "<group>"; };
+ A1E70D330A38B5BB007BE3E3 /* NTMakefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NTMakefile; sourceTree = "<group>"; };
+ A1E70D340A38B5BB007BE3E3 /* t_ccache.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = t_ccache.c; sourceTree = "<group>"; };
+ A1E70D350A38B5BB007BE3E3 /* t_context.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = t_context.c; sourceTree = "<group>"; };
+ A1E70D360A38B5BB007BE3E3 /* t_lists.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = t_lists.c; sourceTree = "<group>"; };
+ A1E70D370A38B5BB007BE3E3 /* t_msg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = t_msg.c; sourceTree = "<group>"; };
+ A1E70D380A38B5BB007BE3E3 /* t_server.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = t_server.c; sourceTree = "<group>"; };
+ A1E70D3A0A38B5BB007BE3E3 /* cacheapi.def */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cacheapi.def; sourceTree = "<group>"; };
+ A1E70D3B0A38B5BB007BE3E3 /* client.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = client.c; sourceTree = "<group>"; };
+ A1E70D3C0A38B5BB007BE3E3 /* dllmain.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = dllmain.c; sourceTree = "<group>"; };
+ A1E70D3D0A38B5BC007BE3E3 /* ntccrpc.acf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ntccrpc.acf; sourceTree = "<group>"; };
+ A1E70D3E0A38B5BC007BE3E3 /* ntccrpc.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ntccrpc.idl; sourceTree = "<group>"; };
+ A1E70D3F0A38B5BC007BE3E3 /* NTMakefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NTMakefile; sourceTree = "<group>"; };
+ A1E70D410A38B5BC007BE3E3 /* client.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = client.c; sourceTree = "<group>"; };
+ A1E70D420A38B5BC007BE3E3 /* cstest.acf */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cstest.acf; sourceTree = "<group>"; };
+ A1E70D430A38B5BC007BE3E3 /* cstest.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cstest.idl; sourceTree = "<group>"; };
+ A1E70D440A38B5BC007BE3E3 /* NTMakefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NTMakefile; sourceTree = "<group>"; };
+ A1E70D450A38B5BC007BE3E3 /* server.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = server.c; sourceTree = "<group>"; };
+ A1E70D460A38B5BC007BE3E3 /* server.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = server.c; sourceTree = "<group>"; };
+ A1E70D5D0A38B796007BE3E3 /* CCacheServer.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = CCacheServer.app; sourceTree = BUILT_PRODUCTS_DIR; };
+ A1E70D910A38BB67007BE3E3 /* CCacheServer.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = CCacheServer.plist; sourceTree = "<group>"; };
+ A1E70D920A38BB67007BE3E3 /* CCacheServerInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = CCacheServerInfo.plist; sourceTree = "<group>"; };
+ A1E70D930A38BB67007BE3E3 /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = "<group>"; };
+ A1E70D9E0A38BCAD007BE3E3 /* mig.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = mig.defs; sourceTree = "<group>"; };
+ A1E70DB10A38C01E007BE3E3 /* mig_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mig_types.h; sourceTree = "<group>"; };
+ A1E70DE00A38C6FD007BE3E3 /* kipc_client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kipc_client.h; sourceTree = "<group>"; };
+ A1E70DE10A38C6FD007BE3E3 /* kipc_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kipc_common.h; sourceTree = "<group>"; };
+ A1E70DE20A38C6FD007BE3E3 /* kipc_server.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kipc_server.h; sourceTree = "<group>"; };
+ A1E70DE30A38C6FD007BE3E3 /* kipc_session.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = kipc_session.h; sourceTree = "<group>"; };
+ A1E70DE40A38C6FD007BE3E3 /* kipc_client.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = kipc_client.c; sourceTree = "<group>"; };
+ A1E70DE50A38C6FD007BE3E3 /* kipc_common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = kipc_common.c; sourceTree = "<group>"; };
+ A1E70DE60A38C6FD007BE3E3 /* kipc_server.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = kipc_server.c; sourceTree = "<group>"; };
+ A1E70DE70A38C6FD007BE3E3 /* kipc_session.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = kipc_session.c; sourceTree = "<group>"; };
+ A1E70DE80A38C6FD007BE3E3 /* notify.defs */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.mig; path = notify.defs; sourceTree = "<group>"; };
+ A1E70DE90A38C6FD007BE3E3 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = "<group>"; };
+ D2AAC046055464E500DB518D /* libCCAPI.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libCCAPI.a; sourceTree = BUILT_PRODUCTS_DIR; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ A1E70D5B0A38B796007BE3E3 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ D289987405E68DCB004EDB86 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 08FB7794FE84155DC02AAC07 /* CCAPI */ = {
+ isa = PBXGroup;
+ children = (
+ A1E70CFF0A38B5BB007BE3E3 /* client */,
+ A1E70D110A38B5BB007BE3E3 /* common */,
+ A1E70D160A38B5BB007BE3E3 /* doc */,
+ A1E70D180A38B5BB007BE3E3 /* include */,
+ A1E70D260A38B5BB007BE3E3 /* NTMakefile */,
+ A1E70D270A38B5BB007BE3E3 /* server */,
+ A1E70D320A38B5BB007BE3E3 /* unit-test */,
+ A1E70D390A38B5BB007BE3E3 /* windows */,
+ 1AB674ADFE9D54B511CA2CBB /* Products */,
+ );
+ name = CCAPI;
+ sourceTree = "<group>";
+ };
+ 1AB674ADFE9D54B511CA2CBB /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ D2AAC046055464E500DB518D /* libCCAPI.a */,
+ A1E70D5D0A38B796007BE3E3 /* CCacheServer.app */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ A1E70CFF0A38B5BB007BE3E3 /* client */ = {
+ isa = PBXGroup;
+ children = (
+ A1E70D000A38B5BB007BE3E3 /* cacheapi.c */,
+ A1E70D010A38B5BB007BE3E3 /* ccache.c */,
+ A1E70D020A38B5BB007BE3E3 /* ccache.h */,
+ A1E70D030A38B5BB007BE3E3 /* ccache_iterator.c */,
+ A1E70D040A38B5BB007BE3E3 /* ccache_iterator.h */,
+ A1E70D050A38B5BB007BE3E3 /* ccapiv2.c */,
+ A1E70D060A38B5BB007BE3E3 /* ccstring.c */,
+ A1E70D070A38B5BB007BE3E3 /* ccstring.h */,
+ A1E70D080A38B5BB007BE3E3 /* context.c */,
+ A1E70D090A38B5BB007BE3E3 /* context.h */,
+ A1E70D0A0A38B5BB007BE3E3 /* credentials.c */,
+ A1E70D0B0A38B5BB007BE3E3 /* credentials.h */,
+ A1E70D0C0A38B5BB007BE3E3 /* credentials_iterator.c */,
+ A1E70D0D0A38B5BB007BE3E3 /* credentials_iterator.h */,
+ A1E70D0E0A38B5BB007BE3E3 /* mac */,
+ A1E70D0F0A38B5BB007BE3E3 /* NTMakefile */,
+ A1E70D100A38B5BB007BE3E3 /* windows */,
+ );
+ name = client;
+ path = ../client;
+ sourceTree = SOURCE_ROOT;
+ };
+ A1E70D0E0A38B5BB007BE3E3 /* mac */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ path = mac;
+ sourceTree = "<group>";
+ };
+ A1E70D100A38B5BB007BE3E3 /* windows */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ path = windows;
+ sourceTree = "<group>";
+ };
+ A1E70D110A38B5BB007BE3E3 /* common */ = {
+ isa = PBXGroup;
+ children = (
+ A1E70D7E0A38BAC5007BE3E3 /* mac */,
+ A1E70D120A38B5BB007BE3E3 /* generic_lists.c */,
+ A1E70D130A38B5BB007BE3E3 /* marshall.c */,
+ A1E70D140A38B5BB007BE3E3 /* msg.c */,
+ A1E70D150A38B5BB007BE3E3 /* NTMakefile */,
+ );
+ name = common;
+ path = ../common;
+ sourceTree = SOURCE_ROOT;
+ };
+ A1E70D160A38B5BB007BE3E3 /* doc */ = {
+ isa = PBXGroup;
+ children = (
+ A1E70D170A38B5BB007BE3E3 /* implementation-notes.txt */,
+ );
+ name = doc;
+ path = ../doc;
+ sourceTree = SOURCE_ROOT;
+ };
+ A1E70D180A38B5BB007BE3E3 /* include */ = {
+ isa = PBXGroup;
+ children = (
+ A1E70D190A38B5BB007BE3E3 /* cc_rpc.h */,
+ A1E70D1A0A38B5BB007BE3E3 /* CredentialsCache.h */,
+ A1E70D1B0A38B5BB007BE3E3 /* CredentialsCache2.h */,
+ A1E70D1C0A38B5BB007BE3E3 /* datastore.h */,
+ A1E70D1D0A38B5BB007BE3E3 /* generic_lists.h */,
+ A1E70D1E0A38B5BB007BE3E3 /* marshall.h */,
+ A1E70D1F0A38B5BB007BE3E3 /* msg.h */,
+ A1E70D200A38B5BB007BE3E3 /* msg_headers.h */,
+ A1E70D210A38B5BB007BE3E3 /* rpc_auth.h */,
+ );
+ name = include;
+ path = ../include;
+ sourceTree = SOURCE_ROOT;
+ };
+ A1E70D270A38B5BB007BE3E3 /* server */ = {
+ isa = PBXGroup;
+ children = (
+ A1E70D280A38B5BB007BE3E3 /* ccs_ccache.c */,
+ A1E70D290A38B5BB007BE3E3 /* ccs_context.c */,
+ A1E70D2A0A38B5BB007BE3E3 /* ccs_lists.c */,
+ A1E70D2B0A38B5BB007BE3E3 /* mac */,
+ A1E70D2C0A38B5BB007BE3E3 /* main.c */,
+ A1E70D2D0A38B5BB007BE3E3 /* NTMakefile */,
+ A1E70D2E0A38B5BB007BE3E3 /* rpc_auth.c */,
+ A1E70D2F0A38B5BB007BE3E3 /* serv_ops.c */,
+ A1E70D300A38B5BB007BE3E3 /* serv_ops.h */,
+ A1E70D310A38B5BB007BE3E3 /* windows */,
+ );
+ name = server;
+ path = ../server;
+ sourceTree = SOURCE_ROOT;
+ };
+ A1E70D2B0A38B5BB007BE3E3 /* mac */ = {
+ isa = PBXGroup;
+ children = (
+ A1E70D910A38BB67007BE3E3 /* CCacheServer.plist */,
+ A1E70D920A38BB67007BE3E3 /* CCacheServerInfo.plist */,
+ A1E70D930A38BB67007BE3E3 /* main.c */,
+ );
+ path = mac;
+ sourceTree = "<group>";
+ };
+ A1E70D310A38B5BB007BE3E3 /* windows */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ path = windows;
+ sourceTree = "<group>";
+ };
+ A1E70D320A38B5BB007BE3E3 /* unit-test */ = {
+ isa = PBXGroup;
+ children = (
+ A1E70D330A38B5BB007BE3E3 /* NTMakefile */,
+ A1E70D340A38B5BB007BE3E3 /* t_ccache.c */,
+ A1E70D350A38B5BB007BE3E3 /* t_context.c */,
+ A1E70D360A38B5BB007BE3E3 /* t_lists.c */,
+ A1E70D370A38B5BB007BE3E3 /* t_msg.c */,
+ A1E70D380A38B5BB007BE3E3 /* t_server.c */,
+ );
+ name = "unit-test";
+ path = "../unit-test";
+ sourceTree = SOURCE_ROOT;
+ };
+ A1E70D390A38B5BB007BE3E3 /* windows */ = {
+ isa = PBXGroup;
+ children = (
+ A1E70D3A0A38B5BB007BE3E3 /* cacheapi.def */,
+ A1E70D3B0A38B5BB007BE3E3 /* client.c */,
+ A1E70D3C0A38B5BB007BE3E3 /* dllmain.c */,
+ A1E70D3D0A38B5BC007BE3E3 /* ntccrpc.acf */,
+ A1E70D3E0A38B5BC007BE3E3 /* ntccrpc.idl */,
+ A1E70D3F0A38B5BC007BE3E3 /* NTMakefile */,
+ A1E70D400A38B5BC007BE3E3 /* rpcsstest */,
+ A1E70D460A38B5BC007BE3E3 /* server.c */,
+ );
+ name = windows;
+ path = ../windows;
+ sourceTree = SOURCE_ROOT;
+ };
+ A1E70D400A38B5BC007BE3E3 /* rpcsstest */ = {
+ isa = PBXGroup;
+ children = (
+ A1E70D410A38B5BC007BE3E3 /* client.c */,
+ A1E70D420A38B5BC007BE3E3 /* cstest.acf */,
+ A1E70D430A38B5BC007BE3E3 /* cstest.idl */,
+ A1E70D440A38B5BC007BE3E3 /* NTMakefile */,
+ A1E70D450A38B5BC007BE3E3 /* server.c */,
+ );
+ path = rpcsstest;
+ sourceTree = "<group>";
+ };
+ A1E70D7E0A38BAC5007BE3E3 /* mac */ = {
+ isa = PBXGroup;
+ children = (
+ A1E70DDE0A38C6FD007BE3E3 /* KerberosIPC */,
+ A1E70D9E0A38BCAD007BE3E3 /* mig.defs */,
+ A1E70DB10A38C01E007BE3E3 /* mig_types.h */,
+ );
+ path = mac;
+ sourceTree = "<group>";
+ };
+ A1E70DDE0A38C6FD007BE3E3 /* KerberosIPC */ = {
+ isa = PBXGroup;
+ children = (
+ A1E70DDF0A38C6FD007BE3E3 /* Kerberos */,
+ A1E70DE40A38C6FD007BE3E3 /* kipc_client.c */,
+ A1E70DE50A38C6FD007BE3E3 /* kipc_common.c */,
+ A1E70DE60A38C6FD007BE3E3 /* kipc_server.c */,
+ A1E70DE70A38C6FD007BE3E3 /* kipc_session.c */,
+ A1E70DE80A38C6FD007BE3E3 /* notify.defs */,
+ A1E70DE90A38C6FD007BE3E3 /* README */,
+ );
+ path = KerberosIPC;
+ sourceTree = "<group>";
+ };
+ A1E70DDF0A38C6FD007BE3E3 /* Kerberos */ = {
+ isa = PBXGroup;
+ children = (
+ A1E70DE00A38C6FD007BE3E3 /* kipc_client.h */,
+ A1E70DE10A38C6FD007BE3E3 /* kipc_common.h */,
+ A1E70DE20A38C6FD007BE3E3 /* kipc_server.h */,
+ A1E70DE30A38C6FD007BE3E3 /* kipc_session.h */,
+ );
+ path = Kerberos;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ D2AAC043055464E500DB518D /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ A1E70D5C0A38B796007BE3E3 /* CCacheServer */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = A1E70D600A38B797007BE3E3 /* Build configuration list for PBXNativeTarget "CCacheServer" */;
+ buildPhases = (
+ A1E70D590A38B796007BE3E3 /* Resources */,
+ A1E70D5A0A38B796007BE3E3 /* Sources */,
+ A1E70D5B0A38B796007BE3E3 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = CCacheServer;
+ productName = CCacheServer;
+ productReference = A1E70D5D0A38B796007BE3E3 /* CCacheServer.app */;
+ productType = "com.apple.product-type.application";
+ };
+ D2AAC045055464E500DB518D /* CCAPI */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "CCAPI" */;
+ buildPhases = (
+ D2AAC043055464E500DB518D /* Headers */,
+ D2AAC044055464E500DB518D /* Sources */,
+ D289987405E68DCB004EDB86 /* Frameworks */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = CCAPI;
+ productName = CCAPI;
+ productReference = D2AAC046055464E500DB518D /* libCCAPI.a */;
+ productType = "com.apple.product-type.library.static";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 08FB7793FE84155DC02AAC07 /* Project object */ = {
+ isa = PBXProject;
+ buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "CCAPI" */;
+ hasScannedForEncodings = 1;
+ mainGroup = 08FB7794FE84155DC02AAC07 /* CCAPI */;
+ projectDirPath = "";
+ targets = (
+ D2AAC045055464E500DB518D /* CCAPI */,
+ A1E70D5C0A38B796007BE3E3 /* CCacheServer */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ A1E70D590A38B796007BE3E3 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ A1E70D5A0A38B796007BE3E3 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ A1E70DA00A38BCAD007BE3E3 /* mig.defs in Sources */,
+ A1E70DF00A38C71D007BE3E3 /* notify.defs in Sources */,
+ A1E70D9B0A38BBE2007BE3E3 /* main.c in Sources */,
+ A1E70D890A38BB47007BE3E3 /* ccs_ccache.c in Sources */,
+ A1E70D8A0A38BB47007BE3E3 /* ccs_context.c in Sources */,
+ A1E70D8B0A38BB47007BE3E3 /* ccs_lists.c in Sources */,
+ A1E70D8C0A38BB47007BE3E3 /* rpc_auth.c in Sources */,
+ A1E70D8D0A38BB47007BE3E3 /* serv_ops.c in Sources */,
+ A1E70D8E0A38BB4F007BE3E3 /* generic_lists.c in Sources */,
+ A1E70D8F0A38BB4F007BE3E3 /* marshall.c in Sources */,
+ A1E70D900A38BB4F007BE3E3 /* msg.c in Sources */,
+ A1E70DED0A38C71D007BE3E3 /* kipc_common.c in Sources */,
+ A1E70DEE0A38C71D007BE3E3 /* kipc_server.c in Sources */,
+ A1E70DEF0A38C71D007BE3E3 /* kipc_session.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ D2AAC044055464E500DB518D /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ A1E70D9F0A38BCAD007BE3E3 /* mig.defs in Sources */,
+ A1E70D480A38B5D5007BE3E3 /* cacheapi.c in Sources */,
+ A1E70D490A38B5D5007BE3E3 /* ccache.c in Sources */,
+ A1E70D4A0A38B5D5007BE3E3 /* ccache_iterator.c in Sources */,
+ A1E70D4B0A38B5D5007BE3E3 /* ccapiv2.c in Sources */,
+ A1E70D4C0A38B5D5007BE3E3 /* ccstring.c in Sources */,
+ A1E70D4D0A38B5D5007BE3E3 /* context.c in Sources */,
+ A1E70D4E0A38B5D5007BE3E3 /* credentials.c in Sources */,
+ A1E70D4F0A38B5D5007BE3E3 /* credentials_iterator.c in Sources */,
+ A1E70D510A38B60C007BE3E3 /* generic_lists.c in Sources */,
+ A1E70D520A38B60C007BE3E3 /* marshall.c in Sources */,
+ A1E70D530A38B60C007BE3E3 /* msg.c in Sources */,
+ A1E70DEA0A38C710007BE3E3 /* kipc_client.c in Sources */,
+ A1E70DEB0A38C710007BE3E3 /* kipc_common.c in Sources */,
+ A1E70DEC0A38C710007BE3E3 /* kipc_session.c in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin XCBuildConfiguration section */
+ 1DEB91EC08733DB70010E9CD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ GCC_DYNAMIC_NO_PIC = NO;
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ ../client,
+ ../client/mac,
+ ../common,
+ ../common/mac,
+ ../common/mac/KerberosIPC,
+ );
+ PRODUCT_NAME = CCAPI;
+ };
+ name = Debug;
+ };
+ 1DEB91ED08733DB70010E9CD /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ ../client,
+ ../client/mac,
+ ../common,
+ ../common/mac,
+ ../common/mac/KerberosIPC,
+ );
+ PRODUCT_NAME = CCAPI;
+ };
+ name = Release;
+ };
+ 1DEB91F008733DB70010E9CD /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = (
+ i386,
+ ppc,
+ );
+ COPY_PHASE_STRIP = NO;
+ GCC_ENABLE_FIX_AND_CONTINUE = YES;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ PREBINDING = NO;
+ ZERO_LINK = YES;
+ };
+ name = Debug;
+ };
+ 1DEB91F108733DB70010E9CD /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ARCHS = "$(NATIVE_ARCH)";
+ COPY_PHASE_STRIP = YES;
+ GCC_ENABLE_FIX_AND_CONTINUE = NO;
+ GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
+ GCC_OPTIMIZATION_LEVEL = 3;
+ PREBINDING = NO;
+ ZERO_LINK = NO;
+ };
+ name = Release;
+ };
+ A1E70D610A38B797007BE3E3 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ ../server,
+ ../server/mac,
+ ../common,
+ ../common/mac,
+ ../common/mac/KerberosIPC,
+ );
+ INFOPLIST_FILE = ../server/mac/CCacheServerInfo.plist;
+ INSTALL_PATH = /System/Library/CoreServices;
+ PRODUCT_NAME = CCacheServer;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Debug;
+ };
+ A1E70D620A38B797007BE3E3 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ HEADER_SEARCH_PATHS = (
+ "$(inherited)",
+ ../server,
+ ../server/mac,
+ ../common,
+ ../common/mac,
+ ../common/mac/KerberosIPC,
+ );
+ INFOPLIST_FILE = ../server/mac/CCacheServerInfo.plist;
+ INSTALL_PATH = /System/Library/CoreServices;
+ PRODUCT_NAME = CCacheServer;
+ WRAPPER_EXTENSION = app;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "CCAPI" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1DEB91EC08733DB70010E9CD /* Debug */,
+ 1DEB91ED08733DB70010E9CD /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "CCAPI" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 1DEB91F008733DB70010E9CD /* Debug */,
+ 1DEB91F108733DB70010E9CD /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ A1E70D600A38B797007BE3E3 /* Build configuration list for PBXNativeTarget "CCacheServer" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ A1E70D610A38B797007BE3E3 /* Debug */,
+ A1E70D620A38B797007BE3E3 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
+}
+++ /dev/null
-/* $Copyright:
- *
- * Copyright 2004 by the Massachusetts Institute of Technology.
- *
- * All rights reserved.
- *
- * Export of this software from the United States of America may require a
- * specific license from the United States Government. It is the
- * responsibility of any person or organization contemplating export to
- * obtain such a license before exporting.
- *
- * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute
- * this software and its documentation for any purpose and without fee is
- * hereby granted, provided that the above copyright notice appear in all
- * copies and that both that copyright notice and this permission notice
- * appear in supporting documentation, and that the name of M.I.T. not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. Furthermore if you
- * modify this software you must label your software as modified software
- * and not distribute it in such a fashion that it might be confused with
- * the original MIT software. M.I.T. makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Individual source code files are copyright MIT, Cygnus Support,
- * OpenVision, Oracle, Sun Soft, FundsXpress, and others.
- *
- * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,
- * and Zephyr are trademarks of the Massachusetts Institute of Technology
- * (MIT). No commercial use of these trademarks may be made without prior
- * written permission of MIT.
- *
- * "Commercial use" means use of a name in a product or other for-profit
- * manner. It does NOT prevent a commercial firm from referring to the MIT
- * trademarks in order to convey information (although in doing so,
- * recognition of their trademark status should be given).
- * $
- */
-
-/* marshall.c */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <CredentialsCache.h>
-#include "msg.h"
-#include "msg_headers.h"
-#include "marshall.h"
-
-cc_int32
-cci_creds_v4_marshall( cc_credentials_v4_t * creds,
- char ** flat,
- cc_uint32 * len)
-{
- cc_msg_t * msg;
- ccmsg_creds_v4_t * header;
- cc_uint32 blob_pos;
- cc_int32 code;
-
- if ( creds == NULL || flat == NULL || len == NULL )
- return ccErrBadParam;
-
- header = (ccmsg_creds_v4_t *)malloc(sizeof(ccmsg_creds_v4_t));
- if ( header == NULL )
- return ccErrNoMem;
-
- code = cci_msg_new(ccmsg_CREDS_V4, &msg);
-
- code = cci_msg_add_header(msg, header, sizeof(ccmsg_creds_v4_t));
-
- code = cci_msg_add_data_blob(msg, creds, sizeof(cc_credentials_v4_t), &blob_pos);
-
- header->offset = blob_pos;
- header->len = sizeof(cc_credentials_v4_t);
-
- code = cci_msg_flatten( msg, NULL );
-
- *flat = msg->flat;
- *len = msg->flat_len;
- msg->flat = NULL;
- msg->flat_len = 0;
-
- cci_msg_destroy(msg);
-
- return ccNoError;
-}
-
-cc_int32
-cci_creds_v4_unmarshall( char * flat,
- cc_uint32 len,
- cc_credentials_union * creds)
-{
- cc_msg_t * msg;
- ccmsg_creds_v4_t * header;
- cc_int32 code;
-
- if ( flat == NULL || len == 0 || creds == NULL )
- return ccErrBadParam;
-
- code = cci_msg_unflatten( flat, len, &msg );
-
- header = (ccmsg_creds_v4_t *)msg->header;
-
- creds->version = cc_credentials_v4;
- code = cci_msg_retrieve_blob(msg, header->offset, header->len, &creds->credentials.credentials_v4);
-
- cci_msg_destroy(msg);
-
- return ccNoError;
-}
-
-
-cc_int32
-cci_creds_cc_data_array_count_entries( cc_data ** array, cc_uint32 * pcount)
-{
- cc_uint32 count;
-
- if (array == NULL) {
- *pcount = 0;
- return ccNoError;
- }
-
- for ( count=0; array[count] != NULL ; count++) ;
-
- *pcount = count;
- return ccNoError;
-}
-
-cc_int32
-cci_creds_v5_compute_flat_size( cc_credentials_v5_t * creds, cc_uint32 * plen)
-{
- cc_uint32 len;
- cc_uint32 i, count;
-
- len = sizeof(struct cci_flat_creds_v5);
-
- if (creds->client)
- len += strlen(creds->client) + 1;
-
- if (creds->server)
- len += strlen(creds->server) + 1;
-
- len += creds->keyblock.length;
-
- cci_creds_cc_data_array_count_entries( creds->addresses, &count );
- len += count * sizeof(cc_flat_data);
- for ( i=0; i<count; i++ ) {
- len += creds->addresses[i]->length;
- }
-
- len += creds->ticket.length;
- len += creds->second_ticket.length;
-
- cci_creds_cc_data_array_count_entries( creds->authdata, &count );
- len += count * sizeof(cc_flat_data);
- for ( i=0; i<count; i++ ) {
- len += creds->authdata[i]->length;
- }
-
- *plen = len;
- return ccNoError;
-}
-
-cc_int32
-cci_creds_v5_marshall( cc_credentials_v5_t * creds,
- char ** pflat,
- cc_uint32 * plen)
-{
- cc_uint32 len;
- char * flat;
- struct cci_flat_creds_v5 * header;
- cc_uint32 offset;
- cc_uint32 i;
-
- if ( creds == NULL || pflat == NULL || plen == NULL )
- return ccErrBadParam;
-
- cci_creds_v5_compute_flat_size(creds, &len);
-
- flat = (char *)malloc(len);
- if ( flat == NULL )
- return ccErrNoMem;
- memset(flat, 0, len);
-
- offset = sizeof(struct cci_flat_creds_v5);
- header = (struct cci_flat_creds_v5 *)flat;
- header->version = FLAT_CREDS_V5_VERSION;
- if (creds->client) {
- header->client.length = strlen(creds->client) + 1;
- header->client.data = offset;
- memcpy(flat + offset, creds->client, header->client.length);
- offset += header->client.length;
- }
-
- if (creds->server) {
- header->server.length = strlen(creds->server) + 1;
- header->server.data = offset;
- memcpy(flat + offset, creds->server, header->server.length);
- offset += header->server.length;
- }
-
- header->keyblock.type = creds->keyblock.type;
- if (creds->keyblock.length) {
- header->keyblock.length = creds->keyblock.length;
- header->keyblock.data = offset;
- memcpy(flat + offset, creds->keyblock.data, header->keyblock.length);
- offset += header->keyblock.length;
- }
-
- header->authtime = creds->authtime;
- header->starttime = creds->starttime;
- header->endtime = creds->endtime;
- header->renew_till = creds->renew_till;
- header->is_skey = creds->is_skey;
- header->ticket_flags = creds->ticket_flags;
-
- cci_creds_cc_data_array_count_entries( creds->addresses, &header->address_count );
- if ( header->address_count ) {
- cc_flat_data * addresses = (cc_flat_data *)flat + offset;
- header->addresses = offset;
- offset += header->address_count * sizeof(cc_flat_data);
-
- for ( i=0; i<header->address_count; i++ ) {
- addresses[i].type = creds->addresses[i]->type;
- if (creds->addresses[i]->length) {
- addresses[i].length = creds->addresses[i]->length;
- addresses[i].data = offset;
- memcpy(flat + offset, creds->addresses[i]->data, addresses[i].length);
- offset += addresses[i].length;
- }
- }
- }
-
- header->ticket.type = creds->ticket.type;
- if (creds->ticket.length) {
- header->ticket.length = creds->ticket.length;
- header->ticket.data = offset;
- memcpy(flat + offset, creds->ticket.data, header->ticket.length);
- offset += header->ticket.length;
- }
-
- header->second_ticket.type = creds->second_ticket.type;
- if (creds->second_ticket.length) {
- header->second_ticket.length = creds->second_ticket.length;
- header->second_ticket.data = offset;
- memcpy(flat + offset, creds->second_ticket.data, header->second_ticket.length);
- offset += header->second_ticket.length;
- }
-
- cci_creds_cc_data_array_count_entries( creds->authdata, &header->authdata_count );
- if ( header->authdata_count ) {
- cc_flat_data * authdata = (cc_flat_data *)flat + offset;
- header->authdata = offset;
- offset += header->authdata_count * sizeof(cc_flat_data);
-
- for ( i=0; i<header->authdata_count; i++ ) {
- authdata[i].type = creds->authdata[i]->type;
- if (creds->authdata[i]->length) {
- authdata[i].length = creds->authdata[i]->length;
- authdata[i].data = offset;
- memcpy(flat + offset, creds->authdata[i]->data, authdata[i].length);
- offset += authdata[i].length;
- }
- }
- }
-
- *pflat = flat;
- *plen = len;
- return ccNoError;
-}
-
-
-// TODO: a much better job of checking for out of memory errors
-// and validating that we do not read beyond the flat input
-// data buffer
-
-cc_int32
-cci_creds_v5_unmarshall( char * flat,
- cc_uint32 len,
- cc_credentials_union * creds_union)
-{
- struct cci_flat_creds_v5 * header;
- cc_credentials_v5_t * creds;
- cc_flat_data * flat_data;
- cc_uint32 i;
- cc_int32 code;
-
- if ( flat == NULL || len == 0 || creds_union == NULL )
- return ccErrBadParam;
-
- creds_union->version = cc_credentials_v5;
-
- header = (struct cci_flat_creds_v5 *)flat;
-
- if ( header->version != FLAT_CREDS_V5_VERSION )
- return ccErrBadParam;
-
- creds = (cc_credentials_v5_t *)malloc(sizeof(cc_credentials_v5_t));
- if ( creds == NULL )
- return ccErrNoMem;
- memset(creds, 0, sizeof(ccmsg_creds_v5_t));
-
- if ( header->client.length ) {
- creds->client = (char *)malloc(header->client.length);
- memcpy(creds->client, flat + header->client.data, header->client.length);
- }
-
- if ( header->server.length ) {
- creds->server = (char *)malloc(header->server.length);
- memcpy(creds->server, flat + header->server.data, header->server.length);
- }
-
- creds->keyblock.type = header->keyblock.type;
- if ( header->keyblock.length ) {
- creds->keyblock.length = header->keyblock.length;
- creds->keyblock.data = malloc(creds->keyblock.length);
- memcpy(creds->keyblock.data, flat + header->keyblock.data, creds->keyblock.length);
- }
-
- creds->authtime = header->authtime;
- creds->starttime = header->starttime;
- creds->endtime = header->endtime;
- creds->renew_till = header->renew_till;
- creds->is_skey = header->is_skey;
- creds->ticket_flags = header->ticket_flags;
-
- creds->addresses = (cc_data **) malloc((header->address_count + 1) * sizeof(cc_data *));
- flat_data = (cc_flat_data *)flat + header->addresses;
- for ( i=0 ; i < header->address_count ; i++ ) {
- creds->addresses[i] = (cc_data *)malloc(sizeof(cc_data));
- creds->addresses[i]->type = flat_data[i].type;
- creds->addresses[i]->length = flat_data[i].length;
- if ( flat_data[i].length ) {
- creds->addresses[i]->data = malloc(flat_data[i].length);
- memcpy(creds->addresses[i]->data, flat + flat_data[i].data, flat_data[i].length);
- } else {
- creds->addresses[i]->data = NULL;
- }
- }
- creds->addresses[i] = NULL;
-
- creds->ticket.type = header->ticket.type;
- if ( header->ticket.length ) {
- creds->ticket.length = header->ticket.length;
- creds->ticket.data = malloc(creds->ticket.length);
- memcpy(creds->ticket.data, flat + header->ticket.data, creds->ticket.length);
- }
-
- creds->second_ticket.type = header->second_ticket.type;
- if ( header->second_ticket.length ) {
- creds->second_ticket.length = header->second_ticket.length;
- creds->second_ticket.data = malloc(creds->second_ticket.length);
- memcpy(creds->second_ticket.data, flat + header->second_ticket.data, creds->second_ticket.length);
- }
-
- creds->authdata = (cc_data **) malloc((header->authdata_count + 1) * sizeof(cc_data *));
- flat_data = (cc_flat_data *)flat + header->authdata;
- for ( i=0 ; i < header->authdata_count ; i++ ) {
- creds->authdata[i] = (cc_data *)malloc(sizeof(cc_data));
- creds->authdata[i]->type = flat_data[i].type;
- creds->authdata[i]->length = flat_data[i].length;
- if ( flat_data[i].length ) {
- creds->authdata[i]->data = malloc(flat_data[i].length);
- memcpy(creds->authdata[i]->data, flat + flat_data[i].data, flat_data[i].length);
- } else {
- creds->authdata[i]->data = NULL;
- }
- }
- creds->authdata[i] = NULL;
-
- creds_union->credentials.credentials_v5 = creds;
-
- return ccNoError;
-}
-
-# Makefile for the CCAPI Generic Server
+# Makefile for the CCAPI Server Library
!INCLUDE <WIN32.MAK>
-CFLAGS = -I../include
+CFLAGS = -I../include $(cdebug) $(cflags) $(cvarsmt)
-CCAPI_LIB = ../lib/ccapi.lib
-WINLIBS = user32.lib advapi32.lib
-CCSOBJS = context.obj ccache.obj lists.obj rpc_auth.obj serv_ops.obj
+CC_SERVER_OBJS = ccs_context.obj ccs_ccache.obj ccs_lists.obj rpc_auth.obj serv_ops.obj
-all: t_lists.exe t_msg.exe t_ccache.exe t_context.exe ccapi_server.exe
+CC_SERVER_LIB = cc_server.lib
-t_lists.exe: t_lists.obj $(CCSOBJS) $(CCAPI_LIB)
- link -out:$@ t_lists.obj $(CCSOBJS) $(CCAPI_LIB) $(WINLIBS)
+CC_COMMON_LIB = ../common/cc_common.lib
-t_msg.exe: t_msg.obj $(CCSOBJS) $(CCAPI_LIB)
- link -out:$@ t_msg.obj $(CCSOBJS) $(CCAPI_LIB) $(WINLIBS)
+$(CC_SERVER_LIB): $(CC_SERVER_OBJS)
+ $(implib) /NOLOGO /OUT:$@ $**
-t_ccache.exe: t_ccache.obj $(CCSOBJS) $(CCAPI_LIB)
- link -out:$@ t_ccache.obj $(CCSOBJS) $(CCAPI_LIB) $(WINLIBS)
-
-t_context.exe: t_context.obj $(CCSOBJS) $(CCAPI_LIB)
- link -out:$@ t_context.obj $(CCSOBJS) $(CCAPI_LIB) $(WINLIBS)
-
-ccapi_server.exe: main.obj $(CCSOBJS) $(CCAPI_LIB)
- link -out:$@ main.obj $(CCSOBJS) $(CCAPI_LIB) $(WINLIBS)
+all: $(CC_SERVER_LIB)
clean:
- del *.obj *.exe
+ del *.obj *.lib
+
\ No newline at end of file
-/* $Copyright:
- *
- * Copyright 2004 by the Massachusetts Institute of Technology.
- *
- * All rights reserved.
- *
- * Export of this software from the United States of America may require a
- * specific license from the United States Government. It is the
- * responsibility of any person or organization contemplating export to
- * obtain such a license before exporting.
- *
- * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute
- * this software and its documentation for any purpose and without fee is
- * hereby granted, provided that the above copyright notice appear in all
- * copies and that both that copyright notice and this permission notice
- * appear in supporting documentation, and that the name of M.I.T. not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. Furthermore if you
- * modify this software you must label your software as modified software
- * and not distribute it in such a fashion that it might be confused with
- * the original MIT software. M.I.T. makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Individual source code files are copyright MIT, Cygnus Support,
- * OpenVision, Oracle, Sun Soft, FundsXpress, and others.
- *
- * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,
- * and Zephyr are trademarks of the Massachusetts Institute of Technology
- * (MIT). No commercial use of these trademarks may be made without prior
- * written permission of MIT.
- *
- * "Commercial use" means use of a name in a product or other for-profit
- * manner. It does NOT prevent a commercial firm from referring to the MIT
- * trademarks in order to convey information (although in doing so,
- * recognition of their trademark status should be given).
- * $
- */
-
-/*
- * Manages ccache objects.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include "CredentialsCache.h"
-#include "datastore.h"
-
-/**
- * ccache_new()
- *
- * Purpose: Allocate and initialize new credentials cache for the specified principal
- * and version
- *
- * Return: ccNoError - success
- * ccErrInvalidString - name or principal is NULL
- * ccErrBadCredentialsVersion - unsupported creds type
- * ccErrBadParam - outCcachepp is NULL
- * ccErrNoMem - malloc failed
- */
-cc_int32
-cci_ccache_new( char *name, char *principal, int cred_vers,
- cc_server_ccache_t** outCCachepp)
-{
- cc_server_ccache_t* ccache;
-
- if (name == NULL || principal == NULL)
- return ccErrInvalidString;
-
- if (cred_vers != cc_credentials_v4 && cred_vers != cc_credentials_v5 &&
- cred_vers != cc_credentials_v4_v5)
- return ccErrBadCredentialsVersion;
-
- if (outCCachepp == NULL)
- return ccErrBadParam;
-
- ccache = (cc_server_ccache_t*)malloc(sizeof(cc_server_ccache_t));
- if (ccache == NULL)
- return ccErrNoMem;
-
- ccache->name = name;
- ccache->principal_v4 = NULL;
- ccache->principal_v5 = NULL;
- ccache->changed = time(NULL);
- ccache->kdc_offset = 0;
- ccache->last_default = 0;
- cci_generic_list_new(&ccache->active_iterators);
- cci_credentials_list_new(&ccache->creds);
- ccache->is_default = 0;
- ccache->kdc_set = 0;
- ccache->versions = cred_vers;
- ccache->mycontext = NULL;
-
- cci_ccache_set_principal(ccache, cred_vers, principal);
- *outCCachepp = ccache;
- return ccNoError;
-}
-
-/**
- * cci_ccache_check_version()
- *
- * Purpose: Check to see if the ccache and the creds have compatible versions.
- *
- * Return: ccNoError and compat = 1 if they are compatible
- * ccNoError and compat = 0 if they are not compatible
- *
- * Errors: ccErrInvalidCCache - ccache is NULL
- * ccErrBadParam - either creds or compat are NULL
- */
-cc_int32
-cci_ccache_check_version( const cc_server_ccache_t *ccache,
- const cc_credentials_union* creds,
- cc_uint32* compat)
-{
- if (ccache == NULL)
- return ccErrInvalidCCache;
-
- if (creds == NULL || compat == NULL)
- return ccErrBadParam;
-
- if (ccache->versions == cc_credentials_v4_v5)
- *compat = 1;
- else if (ccache->versions == creds->version)
- *compat = 1;
- else
- *compat = 0;
-
- return ccNoError;
-}
-
-/**
-cci_ccache_check_principal()
-
-Check to see if the client principal from the credentials matches
-the principal associated with the cache.
-
-* Return: ccNoError and compat = 1 if they are compatible
-* ccNoError and compat = 0 if they are not compatible
-*
-* Errors: ccErrInvalidCCache - ccache is NULL
-* ccErrBadParam - either creds or compat are NULL
-* ccErrBadCredentialVersion - unsupported credential type
-*/
-cc_int32
-cci_ccache_check_principal( const cc_server_ccache_t *ccache,
- const cc_credentials_union* creds,
- cc_uint32* compat)
-{
- if (ccache == NULL)
- return ccErrInvalidCCache;
-
- if (creds == NULL || compat == NULL)
- return ccErrBadParam;
-
- if (creds->version == cc_credentials_v4) {
- if (strcmp(creds->credentials.credentials_v4->principal, ccache->principal_v4) == 0)
- *compat = 1;
- else
- *compat = 0;
- } else if (creds->version == cc_credentials_v5) {
- if (strcmp(creds->credentials.credentials_v5->client, ccache->principal_v5) == 0)
- *compat = 1;
- else
- *compat = 0;
- } else {
- return ccErrBadCredentialsVersion;
- }
- return ccNoError;
-}
-
-
-/**
- * cci_ccache_store_creds()
- *
- * Purpose: Stores the provided credentials into the provided cache. Validates the
- * ability of the cache to store credentials of the given version and client
- * principal.
- *
- * Return: 0 on success
- * -1 on error
- *
- * Errors: ccErrNoMem
- * ccErrBadCredentialsVersion
- * ccErrBadInvalidCredentials
- * ccErrInvalidCache
- * ccErrBadParam
- */
-cc_int32
-cci_ccache_store_creds(cc_server_ccache_t *ccache, const cc_credentials_union* credentials)
-{
- cc_server_credentials_t* stored_cred=NULL;
- cc_uint32 valid_version, valid_principal;
- cc_int32 code;
-
- if (ccache == NULL)
- return ccErrInvalidCCache;
-
- if (credentials == NULL)
- return ccErrBadParam;
-
- code = cci_ccache_check_version(ccache, credentials, &valid_version);
- if (code != ccNoError) {
- /* pass error on to caller */
- goto bad;
- }
- code = cci_ccache_check_principal(ccache, credentials, &valid_principal);
- if (code != ccNoError) {
- /* pass error on to caller */
- goto bad;
- }
- if (valid_version && valid_principal) {
- stored_cred = (cc_server_credentials_t*)malloc(sizeof(cc_server_credentials_t));
- if (stored_cred == NULL) {
- code = ccErrNoMem;
- goto bad;
- }
- memcpy(&stored_cred->creds, credentials, sizeof(cc_credentials_union));
-
- if (credentials->version == cc_credentials_v4) {
- stored_cred->creds.credentials.credentials_v4 = (cc_credentials_v4_t*)malloc(sizeof(cc_credentials_v4_t));
- if (stored_cred->creds.credentials.credentials_v4 == NULL) {
- code = ccErrNoMem;
- goto bad;
- }
-
- memcpy(stored_cred->creds.credentials.credentials_v4, credentials->credentials.credentials_v4, sizeof(cc_credentials_v4_t));
- } else if (credentials->version == cc_credentials_v5) {
- stored_cred->creds.credentials.credentials_v5 = (cc_credentials_v5_t*)malloc(sizeof(cc_credentials_v5_t));
- if (stored_cred->creds.credentials.credentials_v5 == NULL) {
- code = ccErrNoMem;
- goto bad;
- }
-
- memcpy(stored_cred->creds.credentials.credentials_v5, credentials->credentials.credentials_v5, sizeof(cc_credentials_v5_t));
- } else {
- code = ccErrBadCredentialsVersion;
- goto bad;
- }
-
- code = cci_credentials_list_append(ccache->creds, stored_cred, NULL);
- if ( code != ccNoError ) {
- /* pass error on to caller */
- goto bad;
- }
- if (ccache->creds->head->data == (cc_uint8 *)stored_cred)
- stored_cred->is_default = 1; /*we're first on the list, so we're default*/
-
- cci_ccache_changed(ccache);
- return ccNoError;
- } else {
-#ifdef DEBUG
- printf("vers: %d\tprincipal: %d\n",
- valid_version, valid_principal);
-#endif /* DEBUG */
- code = ccErrInvalidCredentials;
- goto bad;
- }
-
- bad:
- if (stored_cred)
- free(stored_cred);
- return code; /* error */
-}
-
-/**
- * cci_ccache_changed()
- *
- * Purpose: Updates the last update time for the ccache and its associated context.
- * Provides a location from which interested parties should be notified
- * of cache updates.
- *
- * Return: none
- *
- * Errors: none
- */
-void
-cci_ccache_changed(cc_server_ccache_t* ccache)
-{
- ccache->changed = time(NULL);
- if (ccache->mycontext != NULL)
- ccache->mycontext->changed = time(NULL);
-
- /* XXX - notify registered listeners when implemented */
-}
-
-/**
- * cci_ccache_rem_creds()
- *
- * Purpose: Removes the specified credential object from the specified cache if
- * it exists
- *
- * Return: 0 on success (credential is not in the cache)
- * -1 on error
- *
- * Errors: ccErrBadParam, ccErrNoMem (from cc_credentials_list_iterator)
- *
- * Verify: does the memory associated with stored_cred->creds need to be freed?
- *
- */
-cc_int32
-cci_ccache_rem_creds(cc_server_ccache_t *ccache, const cc_credentials_union* credentials)
-{
- cc_credentials_iterate_t* credentials_iterator=NULL, *active;
- cc_generic_iterate_t* generic_iterator=NULL;
- cc_credentials_list_node_t* credentials_node;
- cc_generic_list_node_t* generic_node;
- cc_server_credentials_t* stored_cred;
- cc_int8 changed = 0;
- cc_int32 code = 0;
-
- if (ccache == NULL)
- return ccErrInvalidCCache;
-
- if (credentials == NULL)
- return ccErrBadParam;
-
- code = cci_credentials_list_iterator(ccache->creds, &credentials_iterator);
- if (code != ccNoError) {
- /* pass error to caller */
- goto cleanup;
- }
-
- while (cci_credentials_iterate_has_next(credentials_iterator)) {
- code = cci_credentials_iterate_next(credentials_iterator, &credentials_node);
- stored_cred = (cc_server_credentials_t*)credentials_node->data;
- if (memcmp(&stored_cred->creds,credentials,sizeof(cc_credentials_union)) == 0) {
- /* XXX - do we need to free(stored_cred->creds) ? */
- free(credentials_node->data);
- changed = 1;
-
- /*If any iterator's next points to the deleted node, make it point to the next node*/
- code = cci_generic_list_iterator(ccache->active_iterators, &generic_iterator);
- while (cci_generic_iterate_has_next(generic_iterator)) {
- code = cci_generic_iterate_next(generic_iterator, &generic_node);
- active = (cc_credentials_iterate_t*)generic_node->data;
- if (active->next == credentials_node)
- active->next = active->next->next;
- }
- code = cci_generic_free_iterator(generic_iterator);
- generic_iterator = NULL;
-
- if (credentials_node == ccache->creds->head) { /*removing the default, must make next cred default*/
- code = cci_credentials_list_remove_element(ccache->creds, credentials_node);
-
- if (ccache->creds->head != NULL)
- ((cc_server_credentials_t*)ccache->creds->head->data)->is_default = 1;
- } else {
- code = cci_credentials_list_remove_element(ccache->creds, credentials_node);
- }
- break;
- }
- }
-
- cleanup:
- if (changed)
- cci_ccache_changed(ccache);
- if (credentials_iterator)
- cci_credentials_free_iterator(credentials_iterator);
- if (generic_iterator)
- cci_generic_free_iterator(generic_iterator);
- return code;
-}
-
-/**
- * cci_ccache_move()
- *
- * Purpose: Destroys the existing contents of the destination and copies
- * all credentials from the source to the destination
- *
- * Return: 0 on success
- * -1 on error
- *
- * Errors: ccBadNoMem
- *
- */
-
-cc_int32
-cci_ccache_move(cc_server_ccache_t *source, cc_server_ccache_t* destination)
-{
- cc_generic_list_node_t* node;
- cc_generic_iterate_t* iterator;
- cc_credentials_iterate_t* cur;
- cc_int32 code;
-
- if (source == NULL || destination == NULL)
- return ccErrBadParam;
-
- code = cci_credentials_list_destroy(destination->creds);
- if ( code != ccNoError )
- return code;
-
- code = cci_credentials_list_copy(source->creds, &destination->creds);
- if ( code != ccNoError )
- return code;
-
- destination->versions = source->versions;
- destination->kdc_offset = source->kdc_offset;
- destination->last_default = 0;
-
- /*reset all active iterators to point to the head of the new creds list*/
- if (destination->active_iterators->head != NULL) {
- code = cci_generic_list_iterator(destination->active_iterators, &iterator);
- while (cci_generic_iterate_has_next(iterator)) {
- code = cci_generic_iterate_next(iterator, &node);
- cur = (cc_credentials_iterate_t*)node->data;
- cur->next = destination->creds->head;
- }
- code = cci_generic_free_iterator(iterator);
- }
-
- cci_ccache_changed(destination);
- return code;
-}
-
-/**
- * cci_ccache_get_kdc_time_offset()
- *
- * Purpose: Retrieves the kdc_time_offset from the ccache if set
- *
- * Return: 0 on success
- * -1 on error
- *
- * Errors: ccErrBadParam, ccErrTimeOffsetNotSet
- *
- */
-cc_int32
-cci_ccache_get_kdc_time_offset(cc_server_ccache_t* ccache, cc_time_t* offset)
-{
- if (ccache == NULL)
- return ccErrInvalidCCache;
-
- if (offset == NULL)
- return ccErrBadParam;
-
- if (!ccache->kdc_set)
- return ccErrTimeOffsetNotSet;
-
- *offset = ccache->kdc_offset;
- return ccNoError;
-}
-
-/**
- * cci_ccache_set_kdc_time_offset()
- *
- * Purpose: Sets the kdc time offset in the designated ccache
- *
- * Return: 0 on success
- * -1 on error
- *
- * Errors: ccErrBadParam
- *
- */
-cc_int32
-cci_ccache_set_kdc_time_offset(cc_server_ccache_t* ccache, cc_time_t offset)
-{
- if (ccache == NULL)
- return ccErrInvalidCCache;
-
- ccache->kdc_offset = offset;
- ccache->kdc_set = 1;
- cci_ccache_changed(ccache);
-
- return ccNoError;
-}
-
-/**
- * cci_ccache_clear_kdc_time_offset()
- *
- * Purpose: Clear the kdc time offset in the designated ccache
- *
- * Return: 0 on success
- * -1 on error
- *
- * Errors: ccErrBadParam
- */
-cc_int32
-cci_ccache_clear_kdc_time_offset(cc_server_ccache_t* ccache)
-{
- if (ccache == NULL)
- return ccErrInvalidCCache;
-
- ccache->kdc_offset = 0;
- ccache->kdc_set = 0;
- cci_ccache_changed(ccache);
-
- return ccNoError;
-}
-
-/**
- * cci_ccache_new_iterator()
- *
- * Purpose: Retrieve an iterator for the designated cache
- *
- * Return: 0 on success
- * -1 on error
- *
- * Errors: ccErrBadParam, ccBadNoMem
- */
-cc_int32
-cci_ccache_new_iterator(cc_server_ccache_t* ccache, cc_credentials_iterate_t** iterator)
-{
- cc_int32 code;
-
- if (ccache == NULL)
- return ccErrInvalidCCache;
-
- if (iterator == NULL)
- return ccErrBadParam;
-
- code = cci_credentials_list_iterator(ccache->creds, iterator);
- if (code != ccNoError)
- return code;
-
- code = cci_generic_list_prepend(ccache->active_iterators, *iterator, sizeof(cc_credentials_iterate_t), NULL);
- if (code != ccNoError)
- return code;
-
- return ccNoError;
-}
-
-/**
- * cci_ccache_get_principal()
- *
- * Purpose: Retrieves the client principal associated with the designated cache.
- * The value is returned
- * Return:
- *
- * Errors:
- */
-cc_int32
-cci_ccache_get_principal(cc_server_ccache_t* ccache, cc_int32 version, char ** principal)
-{
- char *p = NULL;
-
- switch ( version ) {
- case cc_credentials_v4:
- p = ccache->principal_v4;
- break;
- case cc_credentials_v5:
- p = ccache->principal_v5;
- break;
- default:
- return ccErrBadCredentialsVersion;
- }
-
- *principal = (char *)malloc(strlen(p)+1);
- if ( *principal == NULL )
- return ccErrNoMem;
-
- strcpy(*principal, p);
- return ccNoError;
-}
-
-/**
- * Purpose: Releases the memory associated with a ccache principal
- *
- * Return:
- *
- * Errors:
- *
- */
-cc_int32
-cci_ccache_free_principal(char * principal)
-{
- if ( principal == NULL )
- return ccErrBadParam;
-
- free(principal);
- return ccNoError;
-}
-
-/**
- * ccache_set_principal()
- *
- * Purpose: Assigns a principal to the designated ccache and credential version.
- * If the api version is 2, the cache is cleared of all existing
- * credentials.
- *
- * Return: 0 on success
- * -1 on error
- *
- * Errors: ccErrNoMem, ccErrBadCredentialsVersion
- */
-cc_int32
-cci_ccache_set_principal( cc_server_ccache_t* ccache, cc_int32 cred_version,
- char* principal)
-{
- cc_generic_iterate_t* generic_iterator;
- cc_generic_list_node_t* generic_node;
- cc_ccache_iterate_t* ccache_iterator;
- cc_int32 code = ccNoError;
-
- if (ccache == NULL)
- return ccErrInvalidCCache;
-
- if (principal == NULL)
- return ccErrInvalidString;
-
- switch (cred_version) {
- case cc_credentials_v4:
- case cc_credentials_v4_v5:
- ccache->principal_v4 = (char *)malloc(strlen(principal) + 1);
- if (ccache->principal_v4 == NULL)
- return ccErrNoMem;
- strcpy(ccache->principal_v4, principal);
- if (cred_version != cc_credentials_v4_v5)
- break;
- /* fall-through if we are v4_v5 */
- case cc_credentials_v5:
- ccache->principal_v5 = (char *)malloc(strlen(principal) + 1);
- if (ccache->principal_v5 == NULL) {
- if (cred_version == cc_credentials_v4_v5) {
- free(ccache->principal_v4);
- ccache->principal_v4 = NULL;
- }
- return ccErrNoMem;
- }
- strcpy(ccache->principal_v5, principal);
- break;
- default:
- return ccErrBadCredentialsVersion;
- }
-
- /*For API version 2 clients set_principal implies a flush of all creds*/
- if (ccache->mycontext != NULL && ccache->mycontext->api_version == ccapi_version_2) {
- cci_credentials_list_destroy(ccache->creds);
- cci_credentials_list_new(&ccache->creds);
-
- /*clean up active_iterators*/
- code = cci_generic_list_iterator(ccache->active_iterators, &generic_iterator);
- if (code == ccNoError) {
- while (cci_generic_iterate_has_next(generic_iterator)) {
- code = cci_generic_iterate_next(generic_iterator, &generic_node);
- ccache_iterator = (cc_ccache_iterate_t*)generic_node->data;
- ccache_iterator->next = NULL;
- }
- }
- }
-
- cci_ccache_changed(ccache);
-
- return code;
-}
-
-/**
- * cci_ccache_destroy()
- *
- * Purpose: Destroys an existing ccache
- *
- * Return: 0 on success
- * -1 on errors
- *
- * Errors: ccErrBadParam
- */
-cc_int32
-cci_ccache_destroy(cc_server_ccache_t* ccache)
-{
- cc_int32 code;
-
- if ( ccache == NULL )
- return ccErrInvalidCCache;
-
- code = cci_generic_list_destroy(ccache->active_iterators);
- code = cci_credentials_list_destroy(ccache->creds);
-
- if (ccache->mycontext != NULL)
- code = cci_context_rem_ccache(ccache->mycontext, ccache);
-
- return code;
-}
-
-/**
- * cci_ccache_compare()
- *
- * Purpose: Returns a boolean value indicating if two caches are identical
- * Implemented as pointer equivalence.
- *
- * Return: 1 if TRUE
- * 0 if FALSE
- *
- * Errors: No errors
- */
-cc_int32
-cci_ccache_compare(cc_server_ccache_t* ccache1, cc_server_ccache_t* ccache2, cc_uint32 *result)
-{
- if ( ccache1 == NULL || ccache2 == NULL )
- return ccErrInvalidCCache;
-
- if (ccache1 == ccache2)
- *result = 1;
- else
- *result = 0;
-
- return ccNoError;
-}
-
+/* $Copyright:\r
+ *\r
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.\r
+ * \r
+ * All rights reserved.\r
+ * \r
+ * Export of this software from the United States of America may require a\r
+ * specific license from the United States Government. It is the\r
+ * responsibility of any person or organization contemplating export to\r
+ * obtain such a license before exporting.\r
+ * \r
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute\r
+ * this software and its documentation for any purpose and without fee is\r
+ * hereby granted, provided that the above copyright notice appear in all\r
+ * copies and that both that copyright notice and this permission notice\r
+ * appear in supporting documentation, and that the name of M.I.T. not be\r
+ * used in advertising or publicity pertaining to distribution of the\r
+ * software without specific, written prior permission. Furthermore if you\r
+ * modify this software you must label your software as modified software\r
+ * and not distribute it in such a fashion that it might be confused with\r
+ * the original MIT software. M.I.T. makes no representations about the\r
+ * suitability of this software for any purpose. It is provided "as is"\r
+ * without express or implied warranty.\r
+ * \r
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED\r
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF\r
+ * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\r
+ * \r
+ * Individual source code files are copyright MIT, Cygnus Support,\r
+ * OpenVision, Oracle, Sun Soft, FundsXpress, and others.\r
+ * \r
+ * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,\r
+ * and Zephyr are trademarks of the Massachusetts Institute of Technology\r
+ * (MIT). No commercial use of these trademarks may be made without prior\r
+ * written permission of MIT.\r
+ * \r
+ * "Commercial use" means use of a name in a product or other for-profit\r
+ * manner. It does NOT prevent a commercial firm from referring to the MIT\r
+ * trademarks in order to convey information (although in doing so,\r
+ * recognition of their trademark status should be given).\r
+ * $\r
+ */\r
+\r
+/*\r
+ * Manages ccache objects.\r
+ *\r
+ */\r
+\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include <string.h>\r
+#include <time.h>\r
+#include "CredentialsCache.h"\r
+#include "datastore.h"\r
+\r
+/**\r
+ * ccache_new()\r
+ * \r
+ * Purpose: Allocate and initialize new credentials cache for the specified principal\r
+ * and version\r
+ * \r
+ * Return: ccNoError - success\r
+ * ccErrInvalidString - name or principal is NULL\r
+ * ccErrBadCredentialsVersion - unsupported creds type\r
+ * ccErrBadParam - outCcachepp is NULL\r
+ * ccErrNoMem - malloc failed\r
+ */\r
+cc_int32\r
+ccs_ccache_new( char *name, char *principal, int cred_vers, \r
+ cc_server_ccache_t** outCCachepp)\r
+{\r
+ cc_server_ccache_t* ccache;\r
+\r
+ if (name == NULL || principal == NULL)\r
+ return ccErrInvalidString;\r
+\r
+ if (cred_vers != cc_credentials_v4 && cred_vers != cc_credentials_v5 && \r
+ cred_vers != cc_credentials_v4_v5)\r
+ return ccErrBadCredentialsVersion;\r
+\r
+ if (outCCachepp == NULL)\r
+ return ccErrBadParam;\r
+\r
+ ccache = (cc_server_ccache_t*)malloc(sizeof(cc_server_ccache_t));\r
+ if (ccache == NULL)\r
+ return ccErrNoMem;\r
+\r
+ ccache->name = name;\r
+ ccache->principal_v4 = NULL;\r
+ ccache->principal_v5 = NULL;\r
+ ccache->changed = time(NULL);\r
+ ccache->kdc_offset = 0;\r
+ ccache->last_default = 0;\r
+ cci_generic_list_new(&ccache->active_iterators);\r
+ ccs_credentials_list_new(&ccache->creds);\r
+ ccache->is_default = 0;\r
+ ccache->kdc_set = 0;\r
+ ccache->versions = cred_vers;\r
+ ccache->mycontext = NULL;\r
+\r
+ ccs_ccache_set_principal(ccache, cred_vers, principal);\r
+ *outCCachepp = ccache;\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * ccs_ccache_check_version()\r
+ * \r
+ * Purpose: Check to see if the ccache and the creds have compatible versions. \r
+ * \r
+ * Return: ccNoError and compat = 1 if they are compatible \r
+ * ccNoError and compat = 0 if they are not compatible\r
+ * \r
+ * Errors: ccErrInvalidCCache - ccache is NULL\r
+ * ccErrBadParam - either creds or compat are NULL\r
+ */\r
+cc_int32 \r
+ccs_ccache_check_version( const cc_server_ccache_t *ccache,\r
+ const cc_credentials_union* creds,\r
+ cc_uint32* compat)\r
+{\r
+ if (ccache == NULL)\r
+ return ccErrInvalidCCache;\r
+\r
+ if (creds == NULL || compat == NULL)\r
+ return ccErrBadParam;\r
+\r
+ if (ccache->versions == cc_credentials_v4_v5)\r
+ *compat = 1;\r
+ else if (ccache->versions == creds->version)\r
+ *compat = 1;\r
+ else\r
+ *compat = 0;\r
+\r
+ return ccNoError;\r
+}\r
+\r
+/** \r
+ccs_ccache_check_principal()\r
+\r
+Check to see if the client principal from the credentials matches\r
+the principal associated with the cache.\r
+\r
+* Return: ccNoError and compat = 1 if they are compatible \r
+* ccNoError and compat = 0 if they are not compatible\r
+* \r
+* Errors: ccErrInvalidCCache - ccache is NULL\r
+* ccErrBadParam - either creds or compat are NULL\r
+* ccErrBadCredentialVersion - unsupported credential type\r
+*/\r
+cc_int32 \r
+ccs_ccache_check_principal( const cc_server_ccache_t *ccache,\r
+ const cc_credentials_union* creds,\r
+ cc_uint32* compat)\r
+{\r
+ if (ccache == NULL)\r
+ return ccErrInvalidCCache;\r
+\r
+ if (creds == NULL || compat == NULL)\r
+ return ccErrBadParam;\r
+\r
+ if (creds->version == cc_credentials_v4) {\r
+ if (strcmp(creds->credentials.credentials_v4->principal, ccache->principal_v4) == 0) \r
+ *compat = 1;\r
+ else \r
+ *compat = 0;\r
+ } else if (creds->version == cc_credentials_v5) {\r
+ if (strcmp(creds->credentials.credentials_v5->client, ccache->principal_v5) == 0)\r
+ *compat = 1;\r
+ else \r
+ *compat = 0;\r
+ } else { \r
+ return ccErrBadCredentialsVersion;\r
+ }\r
+ return ccNoError;\r
+}\r
+\r
+\r
+/** \r
+ * ccs_ccache_store_creds()\r
+ *\r
+ * Purpose: Stores the provided credentials into the provided cache. Validates the\r
+ * ability of the cache to store credentials of the given version and client\r
+ * principal.\r
+ *\r
+ * Return: 0 on success\r
+ * -1 on error\r
+ *\r
+ * Errors: ccErrNoMem\r
+ * ccErrBadCredentialsVersion\r
+ * ccErrBadInvalidCredentials\r
+ * ccErrInvalidCache\r
+ * ccErrBadParam\r
+ */\r
+cc_int32 \r
+ccs_ccache_store_creds(cc_server_ccache_t *ccache, const cc_credentials_union* credentials) \r
+{\r
+ cc_server_credentials_t* stored_cred=NULL;\r
+ cc_uint32 valid_version, valid_principal;\r
+ cc_int32 code;\r
+\r
+ if (ccache == NULL)\r
+ return ccErrInvalidCCache;\r
+ \r
+ if (credentials == NULL)\r
+ return ccErrBadParam;\r
+\r
+ code = ccs_ccache_check_version(ccache, credentials, &valid_version);\r
+ if (code != ccNoError) {\r
+ /* pass error on to caller */\r
+ goto bad;\r
+ }\r
+ code = ccs_ccache_check_principal(ccache, credentials, &valid_principal);\r
+ if (code != ccNoError) {\r
+ /* pass error on to caller */\r
+ goto bad;\r
+ }\r
+ if (valid_version && valid_principal) {\r
+ stored_cred = (cc_server_credentials_t*)malloc(sizeof(cc_server_credentials_t));\r
+ if (stored_cred == NULL) {\r
+ code = ccErrNoMem;\r
+ goto bad;\r
+ }\r
+ memcpy(&stored_cred->creds, credentials, sizeof(cc_credentials_union));\r
+\r
+ if (credentials->version == cc_credentials_v4) {\r
+ stored_cred->creds.credentials.credentials_v4 = (cc_credentials_v4_t*)malloc(sizeof(cc_credentials_v4_t));\r
+ if (stored_cred->creds.credentials.credentials_v4 == NULL) {\r
+ code = ccErrNoMem;\r
+ goto bad;\r
+ }\r
+\r
+ memcpy(stored_cred->creds.credentials.credentials_v4, credentials->credentials.credentials_v4, sizeof(cc_credentials_v4_t));\r
+ } else if (credentials->version == cc_credentials_v5) {\r
+ stored_cred->creds.credentials.credentials_v5 = (cc_credentials_v5_t*)malloc(sizeof(cc_credentials_v5_t));\r
+ if (stored_cred->creds.credentials.credentials_v5 == NULL) {\r
+ code = ccErrNoMem;\r
+ goto bad;\r
+ }\r
+\r
+ memcpy(stored_cred->creds.credentials.credentials_v5, credentials->credentials.credentials_v5, sizeof(cc_credentials_v5_t));\r
+ } else {\r
+ code = ccErrBadCredentialsVersion;\r
+ goto bad;\r
+ }\r
+\r
+ code = ccs_credentials_list_append(ccache->creds, stored_cred, NULL);\r
+ if ( code != ccNoError ) {\r
+ /* pass error on to caller */\r
+ goto bad;\r
+ }\r
+ if (ccache->creds->head->data == (cc_uint8 *)stored_cred) \r
+ stored_cred->is_default = 1; /*we're first on the list, so we're default*/\r
+\r
+ ccs_ccache_changed(ccache);\r
+ return ccNoError;\r
+ } else {\r
+#ifdef DEBUG\r
+ printf("vers: %d\tprincipal: %d\n",\r
+ valid_version, valid_principal);\r
+#endif /* DEBUG */\r
+ code = ccErrInvalidCredentials;\r
+ goto bad;\r
+ }\r
+\r
+ bad:\r
+ if (stored_cred)\r
+ free(stored_cred);\r
+ return code; /* error */\r
+}\r
+\r
+/**\r
+ * ccs_ccache_changed()\r
+ *\r
+ * Purpose: Updates the last update time for the ccache and its associated context.\r
+ * Provides a location from which interested parties should be notified\r
+ * of cache updates.\r
+ *\r
+ * Return: none\r
+ *\r
+ * Errors: none\r
+ */\r
+void \r
+ccs_ccache_changed(cc_server_ccache_t* ccache) \r
+{\r
+ ccache->changed = time(NULL);\r
+ if (ccache->mycontext != NULL)\r
+ ccache->mycontext->changed = time(NULL);\r
+\r
+ /* XXX - notify registered listeners when implemented */\r
+}\r
+\r
+/**\r
+ * ccs_ccache_rem_creds()\r
+ *\r
+ * Purpose: Removes the specified credential object from the specified cache if\r
+ * it exists\r
+ *\r
+ * Return: 0 on success (credential is not in the cache)\r
+ * -1 on error\r
+ *\r
+ * Errors: ccErrBadParam, ccErrNoMem (from cc_credentials_list_iterator)\r
+ *\r
+ * Verify: does the memory associated with stored_cred->creds need to be freed?\r
+ *\r
+ */\r
+cc_int32 \r
+ccs_ccache_rem_creds(cc_server_ccache_t *ccache, const cc_credentials_union* credentials) \r
+{\r
+ cc_credentials_iterate_t* credentials_iterator=NULL, *active;\r
+ cc_generic_iterate_t* generic_iterator=NULL;\r
+ cc_credentials_list_node_t* credentials_node;\r
+ cc_generic_list_node_t* generic_node;\r
+ cc_server_credentials_t* stored_cred;\r
+ cc_int8 changed = 0;\r
+ cc_int32 code = 0;\r
+\r
+ if (ccache == NULL)\r
+ return ccErrInvalidCCache;\r
+\r
+ if (credentials == NULL)\r
+ return ccErrBadParam;\r
+\r
+ code = ccs_credentials_list_iterator(ccache->creds, &credentials_iterator);\r
+ if (code != ccNoError) {\r
+ /* pass error to caller */\r
+ goto cleanup;\r
+ }\r
+\r
+ while (ccs_credentials_iterate_has_next(credentials_iterator)) {\r
+ code = ccs_credentials_iterate_next(credentials_iterator, &credentials_node);\r
+ stored_cred = (cc_server_credentials_t*)credentials_node->data;\r
+ if (memcmp(&stored_cred->creds,credentials,sizeof(cc_credentials_union)) == 0) {\r
+ /* XXX - do we need to free(stored_cred->creds) ? */\r
+ free(credentials_node->data);\r
+ changed = 1;\r
+ \r
+ /*If any iterator's next points to the deleted node, make it point to the next node*/\r
+ code = cci_generic_list_iterator(ccache->active_iterators, &generic_iterator);\r
+ while (cci_generic_iterate_has_next(generic_iterator)) {\r
+ code = cci_generic_iterate_next(generic_iterator, &generic_node); \r
+ active = (cc_credentials_iterate_t*)generic_node->data;\r
+ if (active->next == credentials_node) \r
+ active->next = active->next->next;\r
+ }\r
+ code = cci_generic_free_iterator(generic_iterator);\r
+ generic_iterator = NULL;\r
+\r
+ if (credentials_node == ccache->creds->head) { /*removing the default, must make next cred default*/\r
+ code = ccs_credentials_list_remove_element(ccache->creds, credentials_node);\r
+\r
+ if (ccache->creds->head != NULL)\r
+ ((cc_server_credentials_t*)ccache->creds->head->data)->is_default = 1;\r
+ } else {\r
+ code = ccs_credentials_list_remove_element(ccache->creds, credentials_node);\r
+ }\r
+ break;\r
+ }\r
+ }\r
+\r
+ cleanup:\r
+ if (changed)\r
+ ccs_ccache_changed(ccache);\r
+ if (credentials_iterator)\r
+ ccs_credentials_free_iterator(credentials_iterator);\r
+ if (generic_iterator)\r
+ cci_generic_free_iterator(generic_iterator);\r
+ return code;\r
+}\r
+\r
+/**\r
+ * ccs_ccache_move()\r
+ * \r
+ * Purpose: Destroys the existing contents of the destination and copies\r
+ * all credentials from the source to the destination\r
+ *\r
+ * Return: 0 on success\r
+ * -1 on error\r
+ *\r
+ * Errors: ccBadNoMem\r
+ *\r
+ */\r
+\r
+cc_int32 \r
+ccs_ccache_move(cc_server_ccache_t *source, cc_server_ccache_t* destination) \r
+{\r
+ cc_generic_list_node_t* node;\r
+ cc_generic_iterate_t* iterator;\r
+ cc_credentials_iterate_t* cur;\r
+ cc_int32 code;\r
+\r
+ if (source == NULL || destination == NULL)\r
+ return ccErrBadParam;\r
+ \r
+ code = ccs_credentials_list_destroy(destination->creds);\r
+ if ( code != ccNoError )\r
+ return code;\r
+\r
+ code = ccs_credentials_list_copy(source->creds, &destination->creds);\r
+ if ( code != ccNoError ) \r
+ return code;\r
+\r
+ destination->versions = source->versions;\r
+ destination->kdc_offset = source->kdc_offset;\r
+ destination->last_default = 0;\r
+\r
+ /*reset all active iterators to point to the head of the new creds list*/\r
+ if (destination->active_iterators->head != NULL) {\r
+ code = cci_generic_list_iterator(destination->active_iterators, &iterator);\r
+ while (cci_generic_iterate_has_next(iterator)) {\r
+ code = cci_generic_iterate_next(iterator, &node);\r
+ cur = (cc_credentials_iterate_t*)node->data;\r
+ cur->next = destination->creds->head;\r
+ }\r
+ code = cci_generic_free_iterator(iterator);\r
+ }\r
+\r
+ ccs_ccache_changed(destination);\r
+ return code;\r
+}\r
+\r
+/**\r
+ * ccs_ccache_get_kdc_time_offset()\r
+ * \r
+ * Purpose: Retrieves the kdc_time_offset from the ccache if set\r
+ *\r
+ * Return: 0 on success\r
+ * -1 on error\r
+ *\r
+ * Errors: ccErrBadParam, ccErrTimeOffsetNotSet\r
+ *\r
+ */\r
+cc_int32 \r
+ccs_ccache_get_kdc_time_offset(cc_server_ccache_t* ccache, cc_time64* offset) \r
+{\r
+ if (ccache == NULL)\r
+ return ccErrInvalidCCache;\r
+ \r
+ if (offset == NULL)\r
+ return ccErrBadParam;\r
+\r
+ if (!ccache->kdc_set)\r
+ return ccErrTimeOffsetNotSet;\r
+\r
+ *offset = ccache->kdc_offset;\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * ccs_ccache_set_kdc_time_offset()\r
+ *\r
+ * Purpose: Sets the kdc time offset in the designated ccache\r
+ * \r
+ * Return: 0 on success\r
+ * -1 on error\r
+ * \r
+ * Errors: ccErrBadParam\r
+ *\r
+ */\r
+cc_int32 \r
+ccs_ccache_set_kdc_time_offset(cc_server_ccache_t* ccache, cc_time64 offset) \r
+{\r
+ if (ccache == NULL)\r
+ return ccErrInvalidCCache;\r
+\r
+ ccache->kdc_offset = offset;\r
+ ccache->kdc_set = 1;\r
+ ccs_ccache_changed(ccache);\r
+\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * ccs_ccache_clear_kdc_time_offset()\r
+ *\r
+ * Purpose: Clear the kdc time offset in the designated ccache\r
+ *\r
+ * Return: 0 on success\r
+ * -1 on error\r
+ *\r
+ * Errors: ccErrBadParam\r
+ */\r
+cc_int32 \r
+ccs_ccache_clear_kdc_time_offset(cc_server_ccache_t* ccache) \r
+{\r
+ if (ccache == NULL)\r
+ return ccErrInvalidCCache;\r
+\r
+ ccache->kdc_offset = 0;\r
+ ccache->kdc_set = 0;\r
+ ccs_ccache_changed(ccache);\r
+\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * ccs_ccache_new_iterator()\r
+ *\r
+ * Purpose: Retrieve an iterator for the designated cache\r
+ *\r
+ * Return: 0 on success\r
+ * -1 on error\r
+ *\r
+ * Errors: ccErrBadParam, ccBadNoMem\r
+ */\r
+cc_int32 \r
+ccs_ccache_new_iterator(cc_server_ccache_t* ccache, cc_credentials_iterate_t** iterator)\r
+{\r
+ cc_int32 code;\r
+\r
+ if (ccache == NULL)\r
+ return ccErrInvalidCCache;\r
+\r
+ if (iterator == NULL)\r
+ return ccErrBadParam;\r
+\r
+ code = ccs_credentials_list_iterator(ccache->creds, iterator);\r
+ if (code != ccNoError)\r
+ return code;\r
+\r
+ code = cci_generic_list_prepend(ccache->active_iterators, *iterator, sizeof(cc_credentials_iterate_t), NULL);\r
+ if (code != ccNoError)\r
+ return code;\r
+\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * ccs_ccache_get_principal()\r
+ * \r
+ * Purpose: Retrieves the client principal associated with the designated cache.\r
+ * The value is returned \r
+ * Return:\r
+ *\r
+ * Errors:\r
+ */\r
+cc_int32 \r
+ccs_ccache_get_principal(cc_server_ccache_t* ccache, cc_int32 version, char ** principal) \r
+{\r
+ char *p = NULL;\r
+ \r
+ switch ( version ) {\r
+ case cc_credentials_v4:\r
+ p = ccache->principal_v4;\r
+ break;\r
+ case cc_credentials_v5:\r
+ p = ccache->principal_v5;\r
+ break;\r
+ default:\r
+ return ccErrBadCredentialsVersion;\r
+ }\r
+\r
+ *principal = (char *)malloc(strlen(p)+1);\r
+ if ( *principal == NULL )\r
+ return ccErrNoMem;\r
+\r
+ strcpy(*principal, p);\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * Purpose: Releases the memory associated with a ccache principal\r
+ * \r
+ * Return:\r
+ *\r
+ * Errors:\r
+ *\r
+ */\r
+cc_int32\r
+ccs_ccache_free_principal(char * principal)\r
+{\r
+ if ( principal == NULL )\r
+ return ccErrBadParam;\r
+\r
+ free(principal);\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * ccache_set_principal()\r
+ *\r
+ * Purpose: Assigns a principal to the designated ccache and credential version.\r
+ * If the api version is 2, the cache is cleared of all existing\r
+ * credentials.\r
+ *\r
+ * Return: 0 on success\r
+ * -1 on error\r
+ *\r
+ * Errors: ccErrNoMem, ccErrBadCredentialsVersion\r
+ */\r
+cc_int32 \r
+ccs_ccache_set_principal( cc_server_ccache_t* ccache, cc_int32 cred_version, \r
+ char* principal)\r
+{\r
+ cc_generic_iterate_t* generic_iterator;\r
+ cc_generic_list_node_t* generic_node;\r
+ cc_ccache_iterate_t* ccache_iterator;\r
+ cc_int32 code = ccNoError;\r
+\r
+ if (ccache == NULL)\r
+ return ccErrInvalidCCache;\r
+ \r
+ if (principal == NULL)\r
+ return ccErrInvalidString;\r
+\r
+ switch (cred_version) {\r
+ case cc_credentials_v4:\r
+ case cc_credentials_v4_v5:\r
+ ccache->principal_v4 = (char *)malloc(strlen(principal) + 1);\r
+ if (ccache->principal_v4 == NULL)\r
+ return ccErrNoMem;\r
+ strcpy(ccache->principal_v4, principal);\r
+ if (cred_version != cc_credentials_v4_v5)\r
+ break;\r
+ /* fall-through if we are v4_v5 */\r
+ case cc_credentials_v5:\r
+ ccache->principal_v5 = (char *)malloc(strlen(principal) + 1);\r
+ if (ccache->principal_v5 == NULL) {\r
+ if (cred_version == cc_credentials_v4_v5) {\r
+ free(ccache->principal_v4);\r
+ ccache->principal_v4 = NULL;\r
+ }\r
+ return ccErrNoMem;\r
+ }\r
+ strcpy(ccache->principal_v5, principal);\r
+ break;\r
+ default:\r
+ return ccErrBadCredentialsVersion;\r
+ }\r
+\r
+ /*For API version 2 clients set_principal implies a flush of all creds*/\r
+ if (ccache->mycontext != NULL && ccache->mycontext->api_version == ccapi_version_2) {\r
+ ccs_credentials_list_destroy(ccache->creds);\r
+ ccs_credentials_list_new(&ccache->creds);\r
+\r
+ /*clean up active_iterators*/\r
+ code = cci_generic_list_iterator(ccache->active_iterators, &generic_iterator);\r
+ if (code == ccNoError) {\r
+ while (cci_generic_iterate_has_next(generic_iterator)) {\r
+ code = cci_generic_iterate_next(generic_iterator, &generic_node);\r
+ ccache_iterator = (cc_ccache_iterate_t*)generic_node->data;\r
+ ccache_iterator->next = NULL;\r
+ }\r
+ }\r
+ }\r
+\r
+ ccs_ccache_changed(ccache);\r
+\r
+ return code;\r
+}\r
+\r
+/**\r
+ * ccs_ccache_destroy()\r
+ *\r
+ * Purpose: Destroys an existing ccache \r
+ *\r
+ * Return: 0 on success\r
+ * -1 on errors\r
+ *\r
+ * Errors: ccErrBadParam\r
+ */\r
+cc_int32 \r
+ccs_ccache_destroy(cc_server_ccache_t* ccache) \r
+{\r
+ cc_int32 code;\r
+\r
+ if ( ccache == NULL )\r
+ return ccErrInvalidCCache;\r
+\r
+ code = cci_generic_list_destroy(ccache->active_iterators);\r
+ code = ccs_credentials_list_destroy(ccache->creds);\r
+\r
+ if (ccache->mycontext != NULL)\r
+ code = ccs_context_rem_ccache(ccache->mycontext, ccache);\r
+\r
+ return code;\r
+}\r
+\r
+/**\r
+ * ccs_ccache_compare()\r
+ *\r
+ * Purpose: Returns a boolean value indicating if two caches are identical\r
+ * Implemented as pointer equivalence.\r
+ *\r
+ * Return: 1 if TRUE\r
+ * 0 if FALSE\r
+ *\r
+ * Errors: No errors\r
+ */\r
+cc_int32 \r
+ccs_ccache_compare(cc_server_ccache_t* ccache1, cc_server_ccache_t* ccache2, cc_uint32 *result) \r
+{\r
+ if ( ccache1 == NULL || ccache2 == NULL )\r
+ return ccErrInvalidCCache;\r
+\r
+ if (ccache1 == ccache2)\r
+ *result = 1;\r
+ else \r
+ *result = 0;\r
+\r
+ return ccNoError;\r
+}\r
+\r
-/* $Copyright:
- *
- * Copyright 2004 by the Massachusetts Institute of Technology.
- *
- * All rights reserved.
- *
- * Export of this software from the United States of America may require a
- * specific license from the United States Government. It is the
- * responsibility of any person or organization contemplating export to
- * obtain such a license before exporting.
- *
- * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute
- * this software and its documentation for any purpose and without fee is
- * hereby granted, provided that the above copyright notice appear in all
- * copies and that both that copyright notice and this permission notice
- * appear in supporting documentation, and that the name of M.I.T. not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. Furthermore if you
- * modify this software you must label your software as modified software
- * and not distribute it in such a fashion that it might be confused with
- * the original MIT software. M.I.T. makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Individual source code files are copyright MIT, Cygnus Support,
- * OpenVision, Oracle, Sun Soft, FundsXpress, and others.
- *
- * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,
- * and Zephyr are trademarks of the Massachusetts Institute of Technology
- * (MIT). No commercial use of these trademarks may be made without prior
- * written permission of MIT.
- *
- * "Commercial use" means use of a name in a product or other for-profit
- * manner. It does NOT prevent a commercial firm from referring to the MIT
- * trademarks in order to convey information (although in doing so,
- * recognition of their trademark status should be given).
- * $
- */
-
-/*
- * Functions to manipulate datastore layer contexts.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-#include <string.h>
-
-#include "CredentialsCache.h"
-#include "datastore.h"
-
-int cc_myversion = 5;
-char cc_vendor[] = "MIT C lang CCache V5";
-char cc_default_ccache_name[] = "krb5cc";
-
-
-cc_int32
-cci_context_new( int api_version, cc_auth_info_t* auth_info,
- cc_session_info_t* session_info, cc_server_context_t** outContextpp )
-{
- cc_server_context_t* ctx;
-
- if ( outContextpp == NULL )
- return ccErrBadParam;
-
- ctx = (cc_server_context_t*)malloc(sizeof(cc_server_context_t));
- if (ctx == NULL)
- return ccErrNoMem;
-
- cci_ccache_list_new(&ctx->ccaches);
- cci_generic_list_new(&ctx->active_iterators);
- ctx->api_version = api_version;
- ctx->auth_info = auth_info;
- ctx->session_info = session_info;
- ctx->changed = time(NULL);
-
- *outContextpp = ctx;
- return ccNoError;
-}
-
-cc_int32
-cci_context_get_default_ccache_name(cc_server_context_t* ctx, char ** outNamepp)
-{
- cc_server_ccache_t* default_ccache;
-
- if (outNamepp == NULL)
- return ccErrBadParam;
-
- if (ctx == NULL)
- return ccErrInvalidContext;
-
- if (ctx->ccaches->head != NULL) {
- default_ccache = (cc_server_ccache_t*)ctx->ccaches->head->data;
- *outNamepp = default_ccache->name;
- } else {
- *outNamepp = cc_default_ccache_name;
- }
- return ccNoError;
-}
-
-
-cc_int32
-cci_context_find_ccache( cc_server_context_t* ctx, char *name,
- cc_server_ccache_t** outCcachepp )
-{
- cc_ccache_iterate_t* ccache_iterator;
- cc_ccache_list_node_t* ccache_node;
- cc_server_ccache_t* ccache;
- cc_int32 code;
-
- if (ctx == NULL)
- return ccErrInvalidContext;
-
- if (name == NULL)
- return ccErrInvalidString;
-
- if (outCcachepp == NULL)
- return ccErrBadParam;
-
- code = cci_ccache_list_iterator(ctx->ccaches, &ccache_iterator);
- while (cci_ccache_iterate_has_next(ccache_iterator)) {
- code = cci_ccache_iterate_next(ccache_iterator, &ccache_node);
- ccache = (cc_server_ccache_t *)ccache_node->data;
- if (strcmp(ccache->name, name) == 0) {
- free(ccache_iterator);
- *outCcachepp = ccache;
- return ccNoError;
- }
- }
- free(ccache_iterator);
- return ccErrCCacheNotFound;
-}
-
-cc_int32
-cci_context_open_ccache( cc_server_context_t* ctx, char *name,
- cc_server_ccache_t** outCcachepp )
-{
- return cci_context_find_ccache(ctx, name, outCcachepp);
-}
-
-
-cc_int32
-cci_context_create_ccache( cc_server_context_t* ctx, char *name, int creds_version,
- char *principal, cc_server_ccache_t** outCcachepp )
-{
- cc_server_ccache_t* ccache;
- cc_int32 code;
-
- if (ctx == NULL)
- return ccErrInvalidContext;
-
- if (outCcachepp == NULL)
- return ccErrBadParam;
-
- if (name == NULL || principal == NULL)
- return ccErrInvalidString;
-
- if (creds_version != cc_credentials_v4 && creds_version != cc_credentials_v5 &&
- creds_version != cc_credentials_v4_v5)
- return ccErrBadCredentialsVersion;
-
- code = cci_context_find_ccache(ctx, name, &ccache);
- if (code == ccNoError) {
- code = cci_ccache_set_principal(ccache, creds_version, principal);
- } else {
- code = cci_ccache_new(name, principal, creds_version, &ccache);
- if (code != ccNoError)
- return code; /*let caller deal with error*/
-
- ccache->mycontext = ctx;
- ctx->changed = time(NULL);
- cci_ccache_list_append(ctx->ccaches, ccache, NULL);
-
- if (ctx->ccaches->head->data == (cc_uint8 *)ccache) {
- ccache->is_default = 1;
- }
- }
- *outCcachepp = ccache;
- return ccNoError;
-}
-
-cc_int32
-cci_context_create_default_ccache( cc_server_context_t* ctx, int creds_version,
- char *principal, cc_server_ccache_t** outCcachepp )
-{
- cc_server_ccache_t* ccache, *old_default;
- cc_int32 code;
-
- if (ctx == NULL)
- return ccErrInvalidContext;
-
- if (outCcachepp == NULL)
- return ccErrBadParam;
-
- if (principal == NULL)
- return ccErrInvalidString;
-
- if (creds_version != cc_credentials_v4 && creds_version != cc_credentials_v5 &&
- creds_version != cc_credentials_v4_v5)
- return ccErrBadCredentialsVersion;
-
- code = cci_context_find_ccache(ctx, cc_default_ccache_name, &ccache);
- if (code == ccNoError) {
- cci_ccache_set_principal(ccache, creds_version, principal);
- } else {
- code = cci_ccache_new(cc_default_ccache_name, principal, creds_version, &ccache);
- if (code != ccNoError)
- return code; /*let caller deal with error*/
-
- ccache->mycontext = ctx;
- ccache->is_default = 1;
- ctx->changed = time(NULL);
-
- if (ctx->ccaches->head != NULL) {
- old_default = (cc_server_ccache_t *)ctx->ccaches->head->data;
- old_default->is_default = 0;
- old_default->last_default = time(NULL);
- }
-
- cci_ccache_list_prepend(ctx->ccaches, ccache, NULL);
- }
- *outCcachepp = ccache;
- return ccNoError;
-}
-
-cc_int32
-cci_context_ccache_iterator(cc_server_context_t* ctx, cc_ccache_iterate_t** iterpp)
-{
- cc_ccache_iterate_t* ccache_iterator;
- cc_int32 code;
-
- if (ctx == NULL)
- return ccErrInvalidContext;
-
- if (iterpp == NULL)
- return ccErrBadParam;
-
- code = cci_ccache_list_iterator(ctx->ccaches, &ccache_iterator);
- if (code != ccNoError)
- return code;
- cci_generic_list_prepend(ctx->active_iterators, ccache_iterator, sizeof(cc_ccache_iterate_t), NULL);
-
- *iterpp = ccache_iterator;
- return ccNoError;
-}
-
-cc_int32
-cci_context_compare(cc_server_context_t* a, cc_server_context_t* b)
-{
- if (a == b)
- return 1;
- else
- return 0;
-}
-
-cc_int32
-cci_context_destroy(cc_server_context_t* ctx)
-{
- cc_ccache_iterate_t* ccache_iterator;
- cc_ccache_list_node_t* ccache_node;
- cc_server_ccache_t* ccache;
- cc_int32 code;
-
- if (ctx == NULL)
- return ccErrInvalidContext;
-
- cci_generic_list_destroy(ctx->active_iterators);
-
- code = cci_ccache_list_iterator(ctx->ccaches, &ccache_iterator);
- while (cci_ccache_iterate_has_next(ccache_iterator)) {
- code = cci_ccache_iterate_next(ccache_iterator, &ccache_node);
- ccache = (cc_server_ccache_t *)ccache_node->data;
- ccache_node->data = NULL;
- cci_ccache_destroy(ccache);
- }
- cci_ccache_list_destroy(ctx->ccaches);
-
- return ccNoError;
-}
-
-cc_int32
-cci_context_rem_ccache(cc_server_context_t* ctx, cc_server_ccache_t* ccache)
-{
- cc_ccache_iterate_t* ccache_iterator;
- cc_ccache_iterate_t* active_ccache_iterator;
- cc_ccache_list_node_t* ccache_node;
- cc_server_ccache_t* list_ccache;
- cc_generic_list_node_t* gen_node;
- cc_generic_iterate_t* gen_iterator;
- cc_int32 code;
-
- if (ctx == NULL)
- return ccErrInvalidContext;
-
- if (ccache == NULL)
- return ccErrInvalidCCache;
-
- code = cci_ccache_list_iterator(ctx->ccaches, &ccache_iterator);
- while (cci_ccache_iterate_has_next(ccache_iterator)) {
- code = cci_ccache_iterate_next(ccache_iterator, &ccache_node);
- list_ccache = (cc_server_ccache_t *)ccache_node->data;
-
- if (list_ccache == ccache) {
- code = cci_generic_list_iterator(ctx->active_iterators, &gen_iterator);
- while (cci_generic_iterate_has_next(gen_iterator)) {
- code = cci_generic_iterate_next(gen_iterator, &gen_node);
- active_ccache_iterator = (cc_server_ccache_t *)gen_node->data;
- if (active_ccache_iterator->next == ccache_node) {
- active_ccache_iterator->next = active_ccache_iterator->next->next;
- }
- }
- free(gen_iterator);
- code = cci_ccache_list_remove_element(ctx->ccaches, ccache_node);
- break;
- }
- }
- free(ccache_iterator);
- return ccNoError;
-}
-
+/* $Copyright:\r
+ *\r
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.\r
+ * \r
+ * All rights reserved.\r
+ * \r
+ * Export of this software from the United States of America may require a\r
+ * specific license from the United States Government. It is the\r
+ * responsibility of any person or organization contemplating export to\r
+ * obtain such a license before exporting.\r
+ * \r
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute\r
+ * this software and its documentation for any purpose and without fee is\r
+ * hereby granted, provided that the above copyright notice appear in all\r
+ * copies and that both that copyright notice and this permission notice\r
+ * appear in supporting documentation, and that the name of M.I.T. not be\r
+ * used in advertising or publicity pertaining to distribution of the\r
+ * software without specific, written prior permission. Furthermore if you\r
+ * modify this software you must label your software as modified software\r
+ * and not distribute it in such a fashion that it might be confused with\r
+ * the original MIT software. M.I.T. makes no representations about the\r
+ * suitability of this software for any purpose. It is provided "as is"\r
+ * without express or implied warranty.\r
+ * \r
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED\r
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF\r
+ * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\r
+ * \r
+ * Individual source code files are copyright MIT, Cygnus Support,\r
+ * OpenVision, Oracle, Sun Soft, FundsXpress, and others.\r
+ * \r
+ * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,\r
+ * and Zephyr are trademarks of the Massachusetts Institute of Technology\r
+ * (MIT). No commercial use of these trademarks may be made without prior\r
+ * written permission of MIT.\r
+ * \r
+ * "Commercial use" means use of a name in a product or other for-profit\r
+ * manner. It does NOT prevent a commercial firm from referring to the MIT\r
+ * trademarks in order to convey information (although in doing so,\r
+ * recognition of their trademark status should be given).\r
+ * $\r
+ */\r
+\r
+/*\r
+ * Functions to manipulate datastore layer contexts.\r
+ *\r
+ */\r
+\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include <time.h>\r
+#include <string.h>\r
+\r
+#include "CredentialsCache.h"\r
+#include "datastore.h"\r
+\r
+int cc_myversion = 5;\r
+char cc_vendor[] = "MIT C lang CCache V5";\r
+char cc_default_ccache_name[] = "krb5cc";\r
+\r
+\r
+cc_int32\r
+ccs_context_new( int api_version, cc_auth_info_t* auth_info, \r
+ cc_session_info_t* session_info, cc_server_context_t** outContextpp )\r
+{\r
+ cc_server_context_t* ctx;\r
+ \r
+ if ( outContextpp == NULL )\r
+ return ccErrBadParam;\r
+\r
+ ctx = (cc_server_context_t*)malloc(sizeof(cc_server_context_t));\r
+ if (ctx == NULL)\r
+ return ccErrNoMem;\r
+ \r
+ ccs_ccache_list_new(&ctx->ccaches);\r
+ cci_generic_list_new(&ctx->active_iterators); \r
+ ctx->api_version = api_version;\r
+ ctx->auth_info = auth_info;\r
+ ctx->session_info = session_info;\r
+ ctx->changed = time(NULL);\r
+\r
+ *outContextpp = ctx;\r
+ return ccNoError;\r
+}\r
+\r
+cc_int32\r
+ccs_context_get_default_ccache_name(cc_server_context_t* ctx, char ** outNamepp) \r
+{\r
+ cc_server_ccache_t* default_ccache;\r
+\r
+ if (outNamepp == NULL)\r
+ return ccErrBadParam;\r
+ \r
+ if (ctx == NULL)\r
+ return ccErrInvalidContext;\r
+\r
+ if (ctx->ccaches->head != NULL) {\r
+ default_ccache = (cc_server_ccache_t*)ctx->ccaches->head->data;\r
+ *outNamepp = default_ccache->name;\r
+ } else {\r
+ *outNamepp = cc_default_ccache_name;\r
+ }\r
+ return ccNoError;\r
+}\r
+\r
+\r
+cc_int32\r
+ccs_context_find_ccache( cc_server_context_t* ctx, char *name, \r
+ cc_server_ccache_t** outCcachepp )\r
+{\r
+ cc_ccache_iterate_t* ccache_iterator;\r
+ cc_ccache_list_node_t* ccache_node;\r
+ cc_server_ccache_t* ccache;\r
+ cc_int32 code;\r
+\r
+ if (ctx == NULL) \r
+ return ccErrInvalidContext;\r
+ \r
+ if (name == NULL)\r
+ return ccErrInvalidString;\r
+\r
+ if (outCcachepp == NULL)\r
+ return ccErrBadParam;\r
+\r
+ code = ccs_ccache_list_iterator(ctx->ccaches, &ccache_iterator);\r
+ while (ccs_ccache_iterate_has_next(ccache_iterator)) {\r
+ code = ccs_ccache_iterate_next(ccache_iterator, &ccache_node);\r
+ ccache = (cc_server_ccache_t *)ccache_node->data;\r
+ if (strcmp(ccache->name, name) == 0) {\r
+ free(ccache_iterator);\r
+ *outCcachepp = ccache;\r
+ return ccNoError;\r
+ }\r
+ }\r
+ free(ccache_iterator);\r
+ return ccErrCCacheNotFound;\r
+} \r
+\r
+cc_int32\r
+ccs_context_open_ccache( cc_server_context_t* ctx, char *name, \r
+ cc_server_ccache_t** outCcachepp )\r
+{\r
+ return ccs_context_find_ccache(ctx, name, outCcachepp);\r
+}\r
+\r
+\r
+cc_int32\r
+ccs_context_create_ccache( cc_server_context_t* ctx, char *name, int creds_version, \r
+ char *principal, cc_server_ccache_t** outCcachepp )\r
+{\r
+ cc_server_ccache_t* ccache;\r
+ cc_int32 code;\r
+\r
+ if (ctx == NULL) \r
+ return ccErrInvalidContext;\r
+ \r
+ if (outCcachepp == NULL)\r
+ return ccErrBadParam;\r
+\r
+ if (name == NULL || principal == NULL)\r
+ return ccErrInvalidString;\r
+\r
+ if (creds_version != cc_credentials_v4 && creds_version != cc_credentials_v5 && \r
+ creds_version != cc_credentials_v4_v5)\r
+ return ccErrBadCredentialsVersion;\r
+ \r
+ code = ccs_context_find_ccache(ctx, name, &ccache);\r
+ if (code == ccNoError) {\r
+ code = ccs_ccache_set_principal(ccache, creds_version, principal);\r
+ } else {\r
+ code = ccs_ccache_new(name, principal, creds_version, &ccache);\r
+ if (code != ccNoError)\r
+ return code; /*let caller deal with error*/\r
+\r
+ ccache->mycontext = ctx;\r
+ ctx->changed = time(NULL);\r
+ ccs_ccache_list_append(ctx->ccaches, ccache, NULL);\r
+\r
+ if (ctx->ccaches->head->data == (cc_uint8 *)ccache) {\r
+ ccache->is_default = 1;\r
+ }\r
+ }\r
+ *outCcachepp = ccache;\r
+ return ccNoError;\r
+}\r
+\r
+cc_int32\r
+ccs_context_create_default_ccache( cc_server_context_t* ctx, int creds_version, \r
+ char *principal, cc_server_ccache_t** outCcachepp )\r
+{\r
+ cc_server_ccache_t* ccache, *old_default;\r
+ cc_int32 code;\r
+\r
+ if (ctx == NULL) \r
+ return ccErrInvalidContext;\r
+ \r
+ if (outCcachepp == NULL)\r
+ return ccErrBadParam;\r
+\r
+ if (principal == NULL)\r
+ return ccErrInvalidString;\r
+\r
+ if (creds_version != cc_credentials_v4 && creds_version != cc_credentials_v5 && \r
+ creds_version != cc_credentials_v4_v5)\r
+ return ccErrBadCredentialsVersion;\r
+ \r
+ code = ccs_context_find_ccache(ctx, cc_default_ccache_name, &ccache);\r
+ if (code == ccNoError) {\r
+ ccs_ccache_set_principal(ccache, creds_version, principal);\r
+ } else {\r
+ code = ccs_ccache_new(cc_default_ccache_name, principal, creds_version, &ccache);\r
+ if (code != ccNoError)\r
+ return code; /*let caller deal with error*/\r
+\r
+ ccache->mycontext = ctx;\r
+ ccache->is_default = 1;\r
+ ctx->changed = time(NULL);\r
+ \r
+ if (ctx->ccaches->head != NULL) {\r
+ old_default = (cc_server_ccache_t *)ctx->ccaches->head->data;\r
+ old_default->is_default = 0;\r
+ old_default->last_default = time(NULL);\r
+ }\r
+\r
+ ccs_ccache_list_prepend(ctx->ccaches, ccache, NULL);\r
+ }\r
+ *outCcachepp = ccache;\r
+ return ccNoError;\r
+}\r
+\r
+cc_int32\r
+ccs_context_ccache_iterator(cc_server_context_t* ctx, cc_ccache_iterate_t** iterpp) \r
+{\r
+ cc_ccache_iterate_t* ccache_iterator;\r
+ cc_int32 code;\r
+\r
+ if (ctx == NULL) \r
+ return ccErrInvalidContext;\r
+ \r
+ if (iterpp == NULL)\r
+ return ccErrBadParam;\r
+\r
+ code = ccs_ccache_list_iterator(ctx->ccaches, &ccache_iterator);\r
+ if (code != ccNoError)\r
+ return code;\r
+ cci_generic_list_prepend(ctx->active_iterators, ccache_iterator, sizeof(cc_ccache_iterate_t), NULL);\r
+\r
+ *iterpp = ccache_iterator;\r
+ return ccNoError;\r
+}\r
+\r
+cc_int32 \r
+ccs_context_compare(cc_server_context_t* a, cc_server_context_t* b) \r
+{\r
+ if (a == b)\r
+ return 1;\r
+ else\r
+ return 0;\r
+}\r
+\r
+cc_int32 \r
+ccs_context_destroy(cc_server_context_t* ctx) \r
+{\r
+ cc_ccache_iterate_t* ccache_iterator;\r
+ cc_ccache_list_node_t* ccache_node;\r
+ cc_server_ccache_t* ccache;\r
+ cc_int32 code;\r
+\r
+ if (ctx == NULL) \r
+ return ccErrInvalidContext;\r
+\r
+ cci_generic_list_destroy(ctx->active_iterators);\r
+ \r
+ code = ccs_ccache_list_iterator(ctx->ccaches, &ccache_iterator);\r
+ while (ccs_ccache_iterate_has_next(ccache_iterator)) {\r
+ code = ccs_ccache_iterate_next(ccache_iterator, &ccache_node);\r
+ ccache = (cc_server_ccache_t *)ccache_node->data;\r
+ ccache_node->data = NULL;\r
+ ccs_ccache_destroy(ccache);\r
+ }\r
+ ccs_ccache_list_destroy(ctx->ccaches);\r
+\r
+ return ccNoError;\r
+}\r
+\r
+cc_int32 \r
+ccs_context_rem_ccache(cc_server_context_t* ctx, cc_server_ccache_t* ccache) \r
+{\r
+ cc_ccache_iterate_t* ccache_iterator;\r
+ cc_ccache_iterate_t* active_ccache_iterator;\r
+ cc_ccache_list_node_t* ccache_node;\r
+ cc_server_ccache_t* list_ccache;\r
+ cc_generic_list_node_t* gen_node;\r
+ cc_generic_iterate_t* gen_iterator;\r
+ cc_int32 code;\r
+\r
+ if (ctx == NULL) \r
+ return ccErrInvalidContext;\r
+\r
+ if (ccache == NULL) \r
+ return ccErrInvalidCCache;\r
+\r
+ code = ccs_ccache_list_iterator(ctx->ccaches, &ccache_iterator);\r
+ while (ccs_ccache_iterate_has_next(ccache_iterator)) {\r
+ code = ccs_ccache_iterate_next(ccache_iterator, &ccache_node);\r
+ list_ccache = (cc_server_ccache_t *)ccache_node->data;\r
+\r
+ if (list_ccache == ccache) {\r
+ code = cci_generic_list_iterator(ctx->active_iterators, &gen_iterator);\r
+ while (cci_generic_iterate_has_next(gen_iterator)) {\r
+ code = cci_generic_iterate_next(gen_iterator, &gen_node);\r
+ active_ccache_iterator = (cc_ccache_iterate_t *)gen_node->data;\r
+ if (active_ccache_iterator->next == ccache_node) {\r
+ active_ccache_iterator->next = active_ccache_iterator->next->next;\r
+ }\r
+ }\r
+ free(gen_iterator);\r
+ code = ccs_ccache_list_remove_element(ctx->ccaches, ccache_node);\r
+ break;\r
+ }\r
+ }\r
+ free(ccache_iterator);\r
+ return ccNoError;\r
+}\r
+\r
-/* $Copyright:
- *
- * Copyright 2004 by the Massachusetts Institute of Technology.
- *
- * All rights reserved.
- *
- * Export of this software from the United States of America may require a
- * specific license from the United States Government. It is the
- * responsibility of any person or organization contemplating export to
- * obtain such a license before exporting.
- *
- * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute
- * this software and its documentation for any purpose and without fee is
- * hereby granted, provided that the above copyright notice appear in all
- * copies and that both that copyright notice and this permission notice
- * appear in supporting documentation, and that the name of M.I.T. not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. Furthermore if you
- * modify this software you must label your software as modified software
- * and not distribute it in such a fashion that it might be confused with
- * the original MIT software. M.I.T. makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Individual source code files are copyright MIT, Cygnus Support,
- * OpenVision, Oracle, Sun Soft, FundsXpress, and others.
- *
- * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,
- * and Zephyr are trademarks of the Massachusetts Institute of Technology
- * (MIT). No commercial use of these trademarks may be made without prior
- * written permission of MIT.
- *
- * "Commercial use" means use of a name in a product or other for-profit
- * manner. It does NOT prevent a commercial firm from referring to the MIT
- * trademarks in order to convey information (although in doing so,
- * recognition of their trademark status should be given).
- * $
- */
-
-
-/*
- * Lists implementation.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <memory.h>
-
-#include "CredentialsCache.h"
-#include "datastore.h"
-
-/**
- * cci_generic_iterate_has_next()
- *
- * Purpose: Determine if an iterator has a next element
- *
- * Return: 1 if another element exists
- * 0 if no additional elements exist
- *
- * Errors: None
- *
- */
-cc_int32
-cci_generic_iterate_has_next(cc_generic_iterate_t *iterate)
-{
- return ((iterate == NULL || iterate->next == NULL) ? 0 : 1);
-}
-
-/**
- * cci_generic_iterate_next()
- *
- * Purpose: Retrieve the next element from an iterator and advance
- * the iterator
- *
- * Return: non-NULL, the next element in the iterator
- * NULL, the iterator list is empty or iterator is invalid
- *
- * Errors: ccErrBadParam
- *
- */
-cc_int32
-cci_generic_iterate_next(cc_generic_iterate_t *iterator, cc_generic_list_node_t** nodepp)
-{
- cc_generic_list_node_t* ret;
-
- if (iterator == NULL || nodepp == NULL)
- return ccErrBadParam;
-
- ret = iterator->next;
- if (iterator->next != NULL)
- iterator->next = iterator->next->next;
-
- *nodepp = ret;
- return ccNoError;
-}
-
-/**
- * cci_context_iterate_has_next()
- *
- * Purpose: Determine if a context iterator has a next element
- *
- * Return: 1 if another element exists
- * 0 if no additional elements exist
- */
-cc_int32
-cci_context_iterate_has_next(cc_context_iterate_t *iterate)
-{
- if ( iterate == NULL )
- return 0;
-
- return cci_generic_iterate_has_next((cc_generic_iterate_t*)iterate);
-}
-
-/**
- * cci_context_iterate_next()
- *
- * Purpose: Retrieve the next element from a context iterator and advance
- * the iterator
- *
- * Return: non-NULL, the next element in the iterator
- * NULL, the iterator list is empty or iterator is invalid
- *
- * Errors: ccErrBadParam
- *
- */
-cc_int32
-cci_context_iterate_next(cc_context_iterate_t *iterate, cc_context_list_node_t ** nodepp)
-{
- if ( iterate == NULL || nodepp == NULL)
- return ccErrBadParam;
-
- return cci_generic_iterate_next((cc_generic_iterate_t*)iterate,(cc_context_list_node_t**)nodepp);
-}
-
-/**
- * cci_ccache_iterate_has_next()
- *
- * Purpose: Determine if a cache iterator has a next element
- *
- * Return: 1 if another element exists
- * 0 if no additional elements exist
- * -1 if error
- *
- * Errors: ccErrBadParam
- *
- */
-cc_int32
-cci_ccache_iterate_has_next(cc_ccache_iterate_t *iterate)
-{
- if ( iterate == NULL )
- return 0;
- return cci_generic_iterate_has_next((cc_generic_iterate_t*)iterate);
-}
-
-/**
- * cci_ccache_iterate_next()
- *
- * Purpose: Retrieve the next element from a ccache iterator and advance
- * the iterator
- *
- * Return: non-NULL, the next element in the iterator
- * NULL, the iterator list is empty or iterator is invalid
- *
- * Errors: ccErrBadParam
- *
- */
-cc_int32
-cci_ccache_iterate_next(cc_ccache_iterate_t *iterate, cc_ccache_list_node_t ** nodepp)
-{
- if ( iterate == NULL || nodepp == NULL)
- return ccErrBadParam;
-
- return cci_generic_iterate_next((cc_generic_iterate_t*)iterate, (cc_ccache_list_node_t**)nodepp);
-}
-
-/**
- * cci_credentials_iterate_has_next()
- *
- * Purpose: Determine if a credentials iterator has a next element
- *
- * Return: 1 if another element exists
- * 0 if no additional elements exist
- * -1 if error
- *
- * Errors: ccErrBadParam
- *
- */
-cc_int32
-cci_credentials_iterate_has_next(cc_credentials_iterate_t *iterate)
-{
- if ( iterate == NULL )
- return 0;
-
- return cci_generic_iterate_has_next((cc_generic_iterate_t*)iterate);
-}
-
-/**
- * cci_credentials_iterate_next()
- *
- * Purpose: Retrieve the next element from a credentials iterator and advance
- * the iterator
- *
- * Return: non-NULL, the next element in the iterator
- * NULL, the iterator list is empty or iterator is invalid
- *
- * Errors: ccErrBadParam
- *
- */
-cc_int32
-cci_credentials_iterate_next(cc_credentials_iterate_t *iterate, cc_credentials_list_node_t** nodepp)
-{
- if ( iterate == NULL || nodepp == NULL )
- return ccErrBadParam;
- return cci_generic_iterate_next((cc_generic_iterate_t*)iterate, (cc_credentials_list_node_t**)nodepp);
-}
-
-/**
- * cci_generic_list_new()
- *
- * Purpose: Allocate new generic list
- *
- * Return: non-NULL, an empty list
- * NULL, failure
- *
- * Errors: ccErrNoMem
- *
- */
-cc_int32
-cci_generic_list_new(cc_generic_list_head_t ** listpp)
-{
- cc_generic_list_head_t* ret = (cc_generic_list_head_t *)malloc(sizeof(cc_generic_list_head_t));
- if (ret == NULL)
- return ccErrNoMem;
-
- ret->type = generic;
- ret->head = ret->tail = NULL;
- *listpp = ret;
-
- return ccNoError;
-}
-
-/**
- * cci_generic_list_append()
- *
- * Purpose: Appends a new node containing a copy of 'len' bytes of 'data'
- *
- * Return: non-NULL, a pointer to the newly allocated node
- * NULL, failure
- *
- * Errors: ccErrNoMem,ccErrBadParam
- *
- */
-cc_int32
-cci_generic_list_append(cc_generic_list_head_t *head, void *data, cc_uint32 len, cc_generic_list_node_t** nodepp)
-{
- cc_generic_list_node_t* new_node;
-
- if ( data == NULL || len == 0 )
- return ccErrBadParam;
-
- new_node = (cc_generic_list_node_t *)malloc(sizeof(cc_generic_list_node_t));
- if (new_node == NULL)
- return ccErrNoMem;
-
- new_node->data = malloc(len);
- if ( new_node->data == NULL ) {
- free(new_node);
- return ccErrNoMem;
- }
-
- memcpy(new_node->data,data,len);
- new_node->len = len;
-
- if (head->head == NULL) { /*empty list*/
- head->head = new_node;
- head->tail = new_node;
- new_node->next = new_node->prev = NULL;
- } else {
- new_node->prev = head->tail;
- head->tail->next = new_node;
- head->tail = new_node;
- new_node->next = NULL;
- }
- if (nodepp != NULL)
- *nodepp = new_node;
- return ccNoError;
-}
-
-/**
- * cci_generic_list_prepend()
- *
- * Purpose: Prepends a new node containing a copy of 'len' bytes of 'data'
- *
- * Return: non-NULL, a pointer to the newly allocated node
- * NULL, failure
- *
- * Errors: ccErrNoMem, ccErrBadParam
- *
- */
-cc_int32
-cci_generic_list_prepend(cc_generic_list_head_t *head, void *data, cc_uint32 len, cc_generic_list_node_t** nodepp)
-{
- cc_generic_list_node_t* new_node;
-
- if ( data == NULL || len == 0 )
- return ccErrBadParam;
-
- new_node = (cc_generic_list_node_t *)malloc(sizeof(cc_generic_list_node_t));
- if (new_node == NULL)
- return ccErrNoMem;
-
- new_node->data = malloc(len);
- if ( new_node->data == NULL ) {
- free(new_node);
- return ccErrNoMem;
- }
-
- memcpy(new_node->data,data,len);
- new_node->len = len;
-
- if (head->head == NULL) { /*empty list*/
- head->head = new_node;
- head->tail = new_node;
- new_node->prev = new_node->next = NULL;
- } else {
- new_node->next = head->head;
- head->head->prev = new_node;
- new_node->prev = NULL;
- head->head = new_node;
- }
-
- if (nodepp != NULL)
- *nodepp = new_node;
-
- return ccNoError;
-}
-
-/**
- * cci_generic_list_remove_element()
- *
- * Purpose: Remove a node from the list
- *
- * Return: 0, success
- * -1, failure
- *
- * Errors: ccErrBadParam
- *
- */
-cc_int32
-cci_generic_list_remove_element(cc_generic_list_head_t* head, cc_generic_list_node_t* rem)
-{
- if (head->head == NULL || rem == NULL)
- return ccErrBadParam;
-
- if (head->head == rem && head->tail == rem) { /*removing only element of list*/
- head->head = head->tail = NULL;
- } else if (head->head == rem) { /*removing head*/
- head->head = head->head->next;
- } else if (head->tail == rem) { /*removing tail*/
- head->tail = head->tail->prev;
- head->tail->next = NULL;
- } else {
- rem->prev->next = rem->next;
- rem->next->prev = rem->prev;
- }
- free(rem);
- return ccNoError;
-}
-
-/**
- * cci_generic_free_element()
- *
- * Purpose: Free the memory associated with a node
- *
- * Return: 0, success
- * -1, failure
- *
- * Errors: ccErrBadParam
- *
- */
-cc_int32
-cci_generic_free_element(cc_generic_list_node_t* node)
-{
- if ( node == NULL )
- return ccErrBadParam;
-
- if ( node->data ) {
- free(node->data);
- node->data = NULL;
- }
- node->len = 0;
- node->next = node->prev = NULL;
- free(node);
- return ccNoError;
-}
-
-
-/**
- * cci_generic_list_destroy()
- *
- * Purpose: Deallocate a list and all of its contents
- *
- * Return: 0, success
- * -1, failure
- *
- * Errors: ccErrBadParam
- */
-cc_int32
-cci_generic_list_destroy(cc_generic_list_head_t* head)
-{
- cc_generic_list_node_t *cur, *next;
- cc_int32 ret = ccNoError;
-
- if ( head == NULL )
- return ccErrBadParam;
-
- for (cur = head->head; ret == ccNoError && cur != NULL; cur = next) {
- next = cur->next;
- ret = cci_generic_free_element(cur);
- }
- free(head);
- return(ret);
-}
-
-/**
- * cci_context_list_destroy()
- *
- * Purpose: Deallocate a list and all of its contents
- *
- * Return: 0, success
- * -1, failure
- *
- * Errors: ccErrBadParam
- */
-cc_int32
-cci_context_list_destroy(cc_context_list_head_t* head)
-{
- return cci_generic_list_destroy((cc_generic_list_head_t*)head);
-}
-
-/**
- * cci_ccache_list_destroy()
- *
- * Purpose: Deallocate a list and all of its contents
- *
- * Return: 0, success
- * -1, failure
- *
- * Errors: ccErrBadParam
- */
-cc_int32
-cci_ccache_list_destroy(cc_ccache_list_head_t* head)
-{
- return cci_generic_list_destroy((cc_generic_list_head_t*)head);
-}
-
-/**
- * cci_credentials_list_destroy()
- *
- * Purpose: Deallocate a list and all of its contents
- *
- * Return: 0, success
- * -1, failure
- *
- * Errors: ccErrBadParam
- */
-cc_int32
-cci_credentials_list_destroy(cc_credentials_list_head_t* head)
-{
- return cci_generic_list_destroy((cc_generic_list_head_t*)head);
-}
-
-/**
- * cci_generic_list_copy()
- *
- * Purpose: Copy a list
- *
- * Return: non-NULL, a new list
- * NULL, failure
- *
- * Errors: ccErrBadParam, ccErrNoMem
- *
- */
-cc_int32
-cci_generic_list_copy(cc_generic_list_head_t* head, cc_generic_list_head_t** headpp)
-{
- cc_generic_list_head_t* copy;
- cc_generic_list_node_t *src_node, *dst_node;
- cc_int32 code;
-
- if (head == NULL || headpp == NULL)
- return ccErrBadParam;
-
- code = cci_generic_list_new(©);
- if (code != ccNoError)
- return code;
-
- for (src_node = head->head; src_node != NULL; src_node = src_node->next) {
- code = cci_generic_list_append(copy, src_node->data, src_node->len, &dst_node);
- if (code != ccNoError) {
- cci_generic_list_destroy(copy);
- return code;
- }
- }
- *headpp = copy;
- return ccNoError;
-}
-
-/**
- * cci_context_list_copy()
- *
- * Purpose: Copy a list
- *
- * Return: non-NULL, a new list
- * NULL, failure
- *
- * Errors: ccErrBadParam, ccErrNoMem
- *
- */
-cc_int32
-cci_context_list_copy(cc_context_list_head_t* head, cc_context_list_head_t** headpp )
-{
- return cci_generic_list_copy((cc_generic_list_head_t*)head, (cc_context_list_head_t **)headpp);
-}
-
-/**
- * cci_ccache_list_copy()
- *
- * Purpose: Copy a list
- *
- * Return: non-NULL, a new list
- * NULL, failure
- *
- * Errors: ccErrBadParam, ccErrNoMem
- */
-cc_int32
-cci_ccache_list_copy(cc_ccache_list_head_t* head, cc_ccache_list_head_t** headpp)
-{
- return cci_generic_list_copy((cc_generic_list_head_t*)head, (cc_ccache_list_head_t **)headpp);
-}
-
-/**
- * cci_credentials_list_copy()
- *
- * Purpose: Copy a list
- *
- * Return: non-NULL, a new list
- * NULL, failure
- *
- * Errors: ccErrBadParam, ccErrNoMem
- *
- */
-cc_int32
-cci_credentials_list_copy(cc_credentials_list_head_t* head, cc_credentials_list_head_t** headpp)
-{
- return cci_generic_list_copy((cc_generic_list_head_t*)head, (cc_credentials_list_head_t **)headpp);
-}
-
-
-/**
- * cci_generic_list_iterator()
- *
- * Purpose: Allocate an iterator for the specified list
- *
- * Return: non-NULL, an iterator
- * NULL, failure
- *
- * Errors: ccErrNoMem
- *
- */
-cc_int32
-cci_generic_list_iterator(cc_generic_list_head_t *head, cc_generic_iterate_t** headpp)
-{
- cc_generic_iterate_t* iterator;
-
- if ( head == NULL || headpp == NULL )
- return ccErrBadParam;
-
- iterator = (cc_generic_iterate_t*)malloc(sizeof(cc_generic_iterate_t));
- if (iterator == NULL)
- return ccErrNoMem;
-
- iterator->next = head->head;
- *headpp = iterator;
- return ccNoError;
-}
-
-/**
- * cci_generic_free_iterator()
- *
- * Purpose: Deallocate memory associated with an iterator
- *
- * Return: 0, success
- * -1, failure
- *
- * Errors: ccErrBadParam
- *
- */
-cc_int32
-cci_generic_free_iterator(cc_generic_iterate_t* iterator)
-{
- if ( iterator == NULL )
- return ccErrBadParam;
-
- iterator->next = NULL;
- free(iterator);
- return ccNoError;
-}
-
-
-/**
- * cci_context_list_new()
- *
- * Purpose: Allocate a new context list
- *
- * Return: non-NULL, a new list
- * NULL, failure
- *
- * Errors: ccErrNoMem
- *
- */
-cc_int32
-cci_context_list_new(cc_context_list_head_t ** headpp)
-{
- cc_context_list_head_t *ret;
-
- if ( headpp == NULL )
- return ccErrBadParam;
-
- ret = (cc_context_list_head_t *)malloc(sizeof(cc_context_list_head_t));
- if (ret == NULL)
- return ccErrNoMem;
- ret->head = ret->tail = NULL;
- *headpp = ret;
- return ccNoError;
-}
-
-/**
- * cci_context_list_append()
- *
- * Purpose: Appends a new node containing a copy of 'len' bytes of 'data'
- *
- * Return: non-NULL, a pointer to the newly allocated node
- * NULL, failure
- *
- * Errors: ccErrNoMem,ccErrBadParam
- *
- */
-cc_int32
-cci_context_list_append(cc_context_list_head_t *head, cc_server_context_t *data, cc_context_list_node_t** nodepp)
-{
- return cci_generic_list_append((cc_generic_list_head_t *)head, (void *)data, sizeof(cc_server_context_t), (cc_context_list_node_t**)nodepp);
-}
-
-/**
- * cci_context_list_prepend()
- *
- * Purpose: Prepends a new node containing a copy of 'len' bytes of 'data'
- *
- * Return: non-NULL, a pointer to the newly allocated node
- * NULL, failure
- *
- * Errors: ccErrNoMem,ccErrBadParam
- *
- */
-cc_int32
-cci_context_list_prepend(cc_context_list_head_t *head, cc_server_context_t *data, cc_context_list_node_t** nodepp )
-{
- return cci_generic_list_prepend((cc_generic_list_head_t *)head, (void *)data, sizeof(cc_server_context_t), (cc_context_list_node_t**)nodepp);
-}
-
-/**
- * cci_context_list_remove_element
- *
- * Purpose: Remove a node from the list
- *
- * Return: 0, success
- * -1, failure
- *
- * Errors: ccErrBadParam
- */
-cc_int32
-cci_context_list_remove_element(cc_context_list_head_t* head, cc_context_list_node_t* rem)
-{
- return cci_generic_list_remove_element((cc_generic_list_head_t*)head, (cc_generic_list_node_t*)rem);
-}
-
-/**
- * cci_context_list_iterator()
- *
- * Purpose: Allocate an iterator for the specified list
- *
- * Return: non-NULL, an iterator
- * NULL, failure
- *
- * Errors: ccErrNoMem
- *
- */
-cc_int32
-cci_context_list_iterator(cc_context_list_head_t *head, cc_context_iterate_t** iterpp)
-{
- cc_context_iterate_t* iterator;
-
- if ( head == NULL || iterpp == NULL )
- return ccErrBadParam;
-
- iterator = (cc_context_iterate_t*)malloc(sizeof(cc_context_iterate_t));
- if (iterator == NULL)
- return ccErrNoMem;
-
- iterator->next = head->head;
- *iterpp = iterator;
- return ccNoError;
-}
-
-/**
- * cci_context_free_iterator()
- *
- * Purpose: Deallocate memory associated with an iterator
- *
- * Return: 0, success
- * -1, failure
- *
- * Errors: ccErrBadParam
- *
- */
-cc_int32
-cci_context_free_iterator(cc_context_iterate_t* iterator)
-{
- if ( iterator == NULL )
- return ccErrBadParam;
-
- iterator->next = NULL;
- free(iterator);
- return ccNoError;
-}
-
-/**
- * cci_ccache_list_new()
- *
- * Purpose: Allocate a new ccache list
- *
- * Return: non-NULL, a new list
- * NULL, failure
- *
- * Errors: ccErrNoMem
- */
-cc_int32
-cci_ccache_list_new(cc_ccache_list_head_t ** listpp)
-{
- cc_ccache_list_head_t *ret;
-
- if ( listpp == NULL )
- return ccErrBadParam;
-
- ret = (cc_ccache_list_head_t *)malloc(sizeof(cc_ccache_list_head_t));
- if (ret == NULL)
- return ccErrNoMem;
-
- ret->head = ret->tail = NULL;
- *listpp = ret;
- return ccNoError;
-}
-
-/**
- * cci_ccache_list_append()
- *
- * Purpose: Appends a new node containing a copy of 'len' bytes of 'data'
- *
- * Return: non-NULL, a pointer to the newly allocated node
- * NULL, failure
- *
- * Errors: ccErrNoMem,ccErrBadParam
- *
- */
-cc_int32
-cci_ccache_list_append(cc_ccache_list_head_t *head, cc_server_ccache_t *data, cc_ccache_list_node_t** nodepp)
-{
- return cci_generic_list_append((cc_generic_list_head_t *)head, (void *)data, sizeof(cc_server_ccache_t), (cc_ccache_list_node_t**)nodepp);
-}
-
-/**
- * cci_ccache_list_prepend()
- *
- * Purpose: Prepends a new node containing a copy of 'len' bytes of 'data'
- *
- * Return: non-NULL, a pointer to the newly allocated node
- * NULL, failure
- *
- * Errors: ccErrNoMem,ccErrBadParam
- *
- */
-cc_int32
-cci_ccache_list_prepend(cc_ccache_list_head_t *head, cc_server_ccache_t *data, cc_ccache_list_node_t** nodepp)
-{
- return cci_generic_list_prepend((cc_generic_list_head_t *)head, (void *)data, sizeof(cc_server_ccache_t), (cc_ccache_list_node_t**)nodepp);
-}
-
-/**
- * cci_ccache_list_remove_element()
- *
- * Purpose: Remove a node from the list
- *
- * Return: 0, success
- * -1, failure
- *
- * Errors: ccErrBadParam
- *
- */
-cc_int32
-cci_ccache_list_remove_element(cc_ccache_list_head_t* head, cc_ccache_list_node_t* rem)
-{
- return cci_generic_list_remove_element((cc_generic_list_head_t*)head, (cc_generic_list_node_t*)rem);
-}
-
-/**
- * cci_ccache_list_iterator()
- *
- * Purpose: Allocate an iterator for the specified list
- *
- * Return: non-NULL, an iterator
- * NULL, failure
- *
- * Errors: ccErrNoMem
- *
- */
-cc_int32
-cci_ccache_list_iterator(cc_ccache_list_head_t *head, cc_ccache_iterate_t** iterpp)
-{
- cc_ccache_iterate_t* iterator;
-
- if ( head == NULL || iterpp == NULL )
- return ccErrBadParam;
-
- iterator = (cc_ccache_iterate_t*)malloc(sizeof(cc_ccache_iterate_t));
- if (iterator == NULL)
- return ccErrNoMem;
-
- iterator->next = head->head;
- *iterpp = iterator;
- return ccNoError;
-}
-
-/**
- * cci_ccache_free_iterator()
- *
- * Purpose: Deallocate memory associated with an iterator
- *
- * Return: 0, success
- * -1, failure
- *
- * Errors: ccErrBadParam
- *
- */
-cc_int32
-cci_ccache_free_iterator(cc_ccache_iterate_t* iterator)
-{
- if ( iterator == NULL )
- return ccErrBadParam;
-
- iterator->next = NULL;
- free(iterator);
- return ccNoError;
-}
-
-/**
- * cci_credentials_list_new()
- *
- * Purpose: Allocate a new ccache list
- *
- * Return: non-NULL, a new list
- * NULL, failure
- *
- * Errors: ccErrNoMem
- *
- */
-cc_int32
-cci_credentials_list_new(cc_credentials_list_head_t ** list)
-{
- if ( list == NULL )
- return ccErrBadParam;
-
- *list = (cc_credentials_list_head_t *)malloc(sizeof(cc_credentials_list_head_t));
- if (*list == NULL)
- return ccErrNoMem;
-
- (*list)->head = (*list)->tail = NULL;
- return ccNoError;
-}
-
-/**
- * cci_credentials_list_append()
- *
- * Purpose: Appends a new node containing a copy of 'len' bytes of 'data'
- *
- * Return: non-NULL, a pointer to the newly allocated node
- * NULL, failure
- *
- * Errors: ccErrNoMem,ccErrBadParam
- *
- */
-cc_int32
-cci_credentials_list_append(cc_credentials_list_head_t *head, cc_server_credentials_t *data, cc_credentials_list_node_t** nodepp )
-{
- return cci_generic_list_append((cc_generic_list_head_t *)head, (void *)data, sizeof(cc_server_credentials_t), (cc_credentials_list_node_t**)nodepp);
-}
-
-/**
- * cci_credentials_list_prepend()
- *
- * Purpose: Prepends a new node containing a copy of 'len' bytes of 'data'
- *
- * Return: non-NULL, a pointer to the newly allocated node
- * NULL, failure
- *
- * Errors: ccErrNoMem,ccErrBadParam
- *
- */
-cc_int32
-cci_credentials_list_prepend(cc_credentials_list_head_t *head, cc_server_credentials_t *data, cc_credentials_list_node_t** nodepp)
-{
- return cci_generic_list_prepend((cc_generic_list_head_t *)head, (void *)data, sizeof(cc_server_credentials_t), (cc_credentials_list_node_t**)nodepp);
-}
-
-/**
- * cci_credentials_list_remove_element()
- *
- * Purpose: Remove a node from the list
- *
- * Return: 0, success
- * -1, failure
- *
- * Errors: ccErrBadParam
- *
- */
-cc_int32
-cci_credentials_list_remove_element(cc_credentials_list_head_t* head, cc_credentials_list_node_t* rem)
-{
- return cci_generic_list_remove_element((cc_generic_list_head_t*)head, (cc_generic_list_node_t*)rem);
-}
-
-/**
- * cci_credentials_list_iterator()
- *
- * Purpose: Allocate an iterator for the specified list
- *
- * Return: non-NULL, an iterator
- * NULL, failure
- *
- * Errors: ccErrNoMem
- *
- */
-cc_int32
-cci_credentials_list_iterator(cc_credentials_list_head_t *head, cc_credentials_iterate_t** iterpp)
-{
- cc_credentials_iterate_t* iterator;
-
- if ( head == NULL || iterpp == NULL )
- return ccErrBadParam;
-
- iterator = (cc_credentials_iterate_t*)malloc(sizeof(cc_credentials_iterate_t));
- if (iterator == NULL)
- return ccErrNoMem;
-
- iterator->next = head->head;
- *iterpp = iterator;
- return ccNoError;
-}
-
-/**
- * cci_credentials_free_iterator()
- *
- * Purpose: Deallocate memory associated with an iterator
- *
- * Return: 0, success
- * -1, failure
- *
- * Errors: ccErrBadParam
- *
- */
-cc_int32
-cci_credentials_free_iterator(cc_credentials_iterate_t* iterator)
-{
- if ( iterator == NULL )
- return ccErrBadParam;
-
- iterator->next = NULL;
- free(iterator);
- return ccNoError;
-}
-
+/* $Copyright:\r
+ *\r
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.\r
+ * \r
+ * All rights reserved.\r
+ * \r
+ * Export of this software from the United States of America may require a\r
+ * specific license from the United States Government. It is the\r
+ * responsibility of any person or organization contemplating export to\r
+ * obtain such a license before exporting.\r
+ * \r
+ * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute\r
+ * this software and its documentation for any purpose and without fee is\r
+ * hereby granted, provided that the above copyright notice appear in all\r
+ * copies and that both that copyright notice and this permission notice\r
+ * appear in supporting documentation, and that the name of M.I.T. not be\r
+ * used in advertising or publicity pertaining to distribution of the\r
+ * software without specific, written prior permission. Furthermore if you\r
+ * modify this software you must label your software as modified software\r
+ * and not distribute it in such a fashion that it might be confused with\r
+ * the original MIT software. M.I.T. makes no representations about the\r
+ * suitability of this software for any purpose. It is provided "as is"\r
+ * without express or implied warranty.\r
+ * \r
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED\r
+ * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF\r
+ * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.\r
+ * \r
+ * Individual source code files are copyright MIT, Cygnus Support,\r
+ * OpenVision, Oracle, Sun Soft, FundsXpress, and others.\r
+ * \r
+ * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,\r
+ * and Zephyr are trademarks of the Massachusetts Institute of Technology\r
+ * (MIT). No commercial use of these trademarks may be made without prior\r
+ * written permission of MIT.\r
+ * \r
+ * "Commercial use" means use of a name in a product or other for-profit\r
+ * manner. It does NOT prevent a commercial firm from referring to the MIT\r
+ * trademarks in order to convey information (although in doing so,\r
+ * recognition of their trademark status should be given).\r
+ * $\r
+ */\r
+\r
+\r
+/*\r
+ * Lists implementation.\r
+ * \r
+ */\r
+\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include <memory.h>\r
+\r
+#include "CredentialsCache.h"\r
+#include "datastore.h"\r
+\r
+/**\r
+ * ccs_context_iterate_has_next()\r
+ *\r
+ * Purpose: Determine if a context iterator has a next element\r
+ *\r
+ * Return: 1 if another element exists\r
+ * 0 if no additional elements exist\r
+ */\r
+cc_int32 \r
+ccs_context_iterate_has_next(cc_context_iterate_t *iterate) \r
+{\r
+ if ( iterate == NULL )\r
+ return 0;\r
+ \r
+ return cci_generic_iterate_has_next((cc_generic_iterate_t*)iterate);\r
+}\r
+\r
+/**\r
+ * ccs_context_iterate_next()\r
+ *\r
+ * Purpose: Retrieve the next element from a context iterator and advance\r
+ * the iterator\r
+ *\r
+ * Return: non-NULL, the next element in the iterator\r
+ * NULL, the iterator list is empty or iterator is invalid\r
+ *\r
+ * Errors: ccErrBadParam\r
+ *\r
+ */\r
+cc_int32\r
+ccs_context_iterate_next(cc_context_iterate_t *iterate, cc_context_list_node_t ** nodepp)\r
+{\r
+ if ( iterate == NULL || nodepp == NULL)\r
+ return ccErrBadParam;\r
+ \r
+ return cci_generic_iterate_next((cc_generic_iterate_t*)iterate,(cc_context_list_node_t**)nodepp);\r
+}\r
+\r
+/**\r
+ * ccs_ccache_iterate_has_next()\r
+ *\r
+ * Purpose: Determine if a cache iterator has a next element\r
+ *\r
+ * Return: 1 if another element exists\r
+ * 0 if no additional elements exist\r
+ * -1 if error\r
+ *\r
+ * Errors: ccErrBadParam\r
+ *\r
+ */\r
+cc_int32 \r
+ccs_ccache_iterate_has_next(cc_ccache_iterate_t *iterate) \r
+{\r
+ if ( iterate == NULL )\r
+ return 0;\r
+ return cci_generic_iterate_has_next((cc_generic_iterate_t*)iterate);\r
+}\r
+\r
+/**\r
+ * ccs_ccache_iterate_next()\r
+ * \r
+ * Purpose: Retrieve the next element from a ccache iterator and advance\r
+ * the iterator\r
+ *\r
+ * Return: non-NULL, the next element in the iterator\r
+ * NULL, the iterator list is empty or iterator is invalid\r
+ *\r
+ * Errors: ccErrBadParam\r
+ *\r
+ */\r
+cc_int32\r
+ccs_ccache_iterate_next(cc_ccache_iterate_t *iterate, cc_ccache_list_node_t ** nodepp)\r
+{\r
+ if ( iterate == NULL || nodepp == NULL)\r
+ return ccErrBadParam;\r
+ \r
+ return cci_generic_iterate_next((cc_generic_iterate_t*)iterate, (cc_ccache_list_node_t**)nodepp);\r
+}\r
+\r
+/**\r
+ * ccs_credentials_iterate_has_next()\r
+ *\r
+ * Purpose: Determine if a credentials iterator has a next element\r
+ *\r
+ * Return: 1 if another element exists\r
+ * 0 if no additional elements exist\r
+ * -1 if error\r
+ *\r
+ * Errors: ccErrBadParam\r
+ *\r
+ */\r
+cc_int32 \r
+ccs_credentials_iterate_has_next(cc_credentials_iterate_t *iterate) \r
+{\r
+ if ( iterate == NULL )\r
+ return 0;\r
+ \r
+ return cci_generic_iterate_has_next((cc_generic_iterate_t*)iterate);\r
+}\r
+\r
+/**\r
+ * ccs_credentials_iterate_next()\r
+ * \r
+ * Purpose: Retrieve the next element from a credentials iterator and advance\r
+ * the iterator\r
+ *\r
+ * Return: non-NULL, the next element in the iterator\r
+ * NULL, the iterator list is empty or iterator is invalid\r
+ *\r
+ * Errors: ccErrBadParam\r
+ *\r
+ */\r
+cc_int32\r
+ccs_credentials_iterate_next(cc_credentials_iterate_t *iterate, cc_credentials_list_node_t** nodepp) \r
+{\r
+ if ( iterate == NULL || nodepp == NULL )\r
+ return ccErrBadParam;\r
+ return cci_generic_iterate_next((cc_generic_iterate_t*)iterate, (cc_credentials_list_node_t**)nodepp);\r
+}\r
+\r
+/**\r
+ * ccs_context_list_destroy()\r
+ *\r
+ * Purpose: Deallocate a list and all of its contents\r
+ *\r
+ * Return: 0, success\r
+ * -1, failure\r
+ *\r
+ * Errors: ccErrBadParam\r
+ */\r
+cc_int32\r
+ccs_context_list_destroy(cc_context_list_head_t* head) \r
+{\r
+ return cci_generic_list_destroy((cc_generic_list_head_t*)head);\r
+}\r
+\r
+/**\r
+ * ccs_ccache_list_destroy()\r
+ *\r
+ * Purpose: Deallocate a list and all of its contents\r
+ *\r
+ * Return: 0, success\r
+ * -1, failure\r
+ *\r
+ * Errors: ccErrBadParam\r
+ */\r
+cc_int32\r
+ccs_ccache_list_destroy(cc_ccache_list_head_t* head) \r
+{\r
+ return cci_generic_list_destroy((cc_generic_list_head_t*)head);\r
+}\r
+\r
+/**\r
+ * ccs_credentials_list_destroy()\r
+ *\r
+ * Purpose: Deallocate a list and all of its contents\r
+ *\r
+ * Return: 0, success\r
+ * -1, failure\r
+ *\r
+ * Errors: ccErrBadParam\r
+ */\r
+cc_int32\r
+ccs_credentials_list_destroy(cc_credentials_list_head_t* head) \r
+{\r
+ return cci_generic_list_destroy((cc_generic_list_head_t*)head);\r
+}\r
+\r
+/**\r
+ * ccs_context_list_copy()\r
+ *\r
+ * Purpose: Copy a list\r
+ *\r
+ * Return: non-NULL, a new list\r
+ * NULL, failure\r
+ *\r
+ * Errors: ccErrBadParam, ccErrNoMem\r
+ *\r
+ */\r
+cc_int32\r
+ccs_context_list_copy(cc_context_list_head_t* head, cc_context_list_head_t** headpp ) \r
+{\r
+ return cci_generic_list_copy((cc_generic_list_head_t*)head, (cc_context_list_head_t **)headpp);\r
+}\r
+\r
+/**\r
+ * ccs_ccache_list_copy()\r
+ *\r
+ * Purpose: Copy a list\r
+ *\r
+ * Return: non-NULL, a new list\r
+ * NULL, failure\r
+ *\r
+ * Errors: ccErrBadParam, ccErrNoMem\r
+ */\r
+cc_int32\r
+ccs_ccache_list_copy(cc_ccache_list_head_t* head, cc_ccache_list_head_t** headpp)\r
+{\r
+ return cci_generic_list_copy((cc_generic_list_head_t*)head, (cc_ccache_list_head_t **)headpp);\r
+}\r
+\r
+/**\r
+ * ccs_credentials_list_copy()\r
+ *\r
+ * Purpose: Copy a list\r
+ *\r
+ * Return: non-NULL, a new list\r
+ * NULL, failure\r
+ *\r
+ * Errors: ccErrBadParam, ccErrNoMem\r
+ *\r
+ */\r
+cc_int32\r
+ccs_credentials_list_copy(cc_credentials_list_head_t* head, cc_credentials_list_head_t** headpp) \r
+{\r
+ return cci_generic_list_copy((cc_generic_list_head_t*)head, (cc_credentials_list_head_t **)headpp);\r
+}\r
+\r
+\r
+/**\r
+ * ccs_context_list_new()\r
+ *\r
+ * Purpose: Allocate a new context list\r
+ *\r
+ * Return: non-NULL, a new list\r
+ * NULL, failure\r
+ *\r
+ * Errors: ccErrNoMem\r
+ *\r
+ */\r
+cc_int32\r
+ccs_context_list_new(cc_context_list_head_t ** headpp) \r
+{\r
+ cc_context_list_head_t *ret;\r
+ \r
+ if ( headpp == NULL )\r
+ return ccErrBadParam;\r
+\r
+ ret = (cc_context_list_head_t *)malloc(sizeof(cc_context_list_head_t));\r
+ if (ret == NULL)\r
+ return ccErrNoMem;\r
+ ret->head = ret->tail = NULL;\r
+ ret->type = context;\r
+ *headpp = ret;\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * ccs_context_list_append()\r
+ *\r
+ * Purpose: Appends a new node containing a copy of 'len' bytes of 'data' \r
+ *\r
+ * Return: non-NULL, a pointer to the newly allocated node\r
+ * NULL, failure\r
+ *\r
+ * Errors: ccErrNoMem,ccErrBadParam\r
+ *\r
+ */\r
+cc_int32\r
+ccs_context_list_append(cc_context_list_head_t *head, cc_server_context_t *data, cc_context_list_node_t** nodepp) \r
+{\r
+ return cci_generic_list_append((cc_generic_list_head_t *)head, (void *)data, sizeof(cc_server_context_t), (cc_context_list_node_t**)nodepp);\r
+}\r
+\r
+/**\r
+ * ccs_context_list_prepend()\r
+ *\r
+ * Purpose: Prepends a new node containing a copy of 'len' bytes of 'data' \r
+ *\r
+ * Return: non-NULL, a pointer to the newly allocated node\r
+ * NULL, failure\r
+ *\r
+ * Errors: ccErrNoMem,ccErrBadParam\r
+ *\r
+ */\r
+cc_int32\r
+ccs_context_list_prepend(cc_context_list_head_t *head, cc_server_context_t *data, cc_context_list_node_t** nodepp ) \r
+{\r
+ return cci_generic_list_prepend((cc_generic_list_head_t *)head, (void *)data, sizeof(cc_server_context_t), (cc_context_list_node_t**)nodepp);\r
+}\r
+\r
+/**\r
+ * ccs_context_list_remove_element\r
+ *\r
+ * Purpose: Remove a node from the list\r
+ *\r
+ * Return: 0, success\r
+ * -1, failure\r
+ *\r
+ * Errors: ccErrBadParam\r
+ */\r
+cc_int32\r
+ccs_context_list_remove_element(cc_context_list_head_t* head, cc_context_list_node_t* rem) \r
+{\r
+ return cci_generic_list_remove_element((cc_generic_list_head_t*)head, (cc_generic_list_node_t*)rem);\r
+}\r
+\r
+/**\r
+ * ccs_context_list_iterator()\r
+ *\r
+ * Purpose: Allocate an iterator for the specified list\r
+ *\r
+ * Return: non-NULL, an iterator\r
+ * NULL, failure\r
+ *\r
+ * Errors: ccErrNoMem\r
+ *\r
+ */\r
+cc_int32\r
+ccs_context_list_iterator(cc_context_list_head_t *head, cc_context_iterate_t** iterpp) \r
+{\r
+ cc_context_iterate_t* iterator;\r
+ \r
+ if ( head == NULL || iterpp == NULL )\r
+ return ccErrBadParam;\r
+\r
+ iterator = (cc_context_iterate_t*)malloc(sizeof(cc_context_iterate_t));\r
+ if (iterator == NULL)\r
+ return ccErrNoMem;\r
+\r
+ iterator->next = head->head;\r
+ *iterpp = iterator;\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * ccs_context_free_iterator()\r
+ *\r
+ * Purpose: Deallocate memory associated with an iterator\r
+ *\r
+ * Return: 0, success\r
+ * -1, failure\r
+ *\r
+ * Errors: ccErrBadParam\r
+ *\r
+ */\r
+cc_int32\r
+ccs_context_free_iterator(cc_context_iterate_t* iterator)\r
+{\r
+ if ( iterator == NULL )\r
+ return ccErrBadParam;\r
+\r
+ iterator->next = NULL;\r
+ free(iterator);\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * ccs_ccache_list_new()\r
+ *\r
+ * Purpose: Allocate a new ccache list\r
+ *\r
+ * Return: non-NULL, a new list\r
+ * NULL, failure\r
+ *\r
+ * Errors: ccErrNoMem\r
+ */\r
+cc_int32\r
+ccs_ccache_list_new(cc_ccache_list_head_t ** listpp)\r
+{\r
+ cc_ccache_list_head_t *ret;\r
+ \r
+ if ( listpp == NULL )\r
+ return ccErrBadParam;\r
+\r
+ ret = (cc_ccache_list_head_t *)malloc(sizeof(cc_ccache_list_head_t));\r
+ if (ret == NULL)\r
+ return ccErrNoMem;\r
+\r
+ ret->head = ret->tail = NULL;\r
+ *listpp = ret;\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * ccs_ccache_list_append()\r
+ *\r
+ * Purpose: Appends a new node containing a copy of 'len' bytes of 'data' \r
+ *\r
+ * Return: non-NULL, a pointer to the newly allocated node\r
+ * NULL, failure\r
+ *\r
+ * Errors: ccErrNoMem,ccErrBadParam\r
+ *\r
+ */\r
+cc_int32\r
+ccs_ccache_list_append(cc_ccache_list_head_t *head, cc_server_ccache_t *data, cc_ccache_list_node_t** nodepp) \r
+{\r
+ return cci_generic_list_append((cc_generic_list_head_t *)head, (void *)data, sizeof(cc_server_ccache_t), (cc_ccache_list_node_t**)nodepp);\r
+}\r
+\r
+/**\r
+ * ccs_ccache_list_prepend()\r
+ *\r
+ * Purpose: Prepends a new node containing a copy of 'len' bytes of 'data' \r
+ *\r
+ * Return: non-NULL, a pointer to the newly allocated node\r
+ * NULL, failure\r
+ *\r
+ * Errors: ccErrNoMem,ccErrBadParam\r
+ *\r
+ */\r
+cc_int32\r
+ccs_ccache_list_prepend(cc_ccache_list_head_t *head, cc_server_ccache_t *data, cc_ccache_list_node_t** nodepp) \r
+{\r
+ return cci_generic_list_prepend((cc_generic_list_head_t *)head, (void *)data, sizeof(cc_server_ccache_t), (cc_ccache_list_node_t**)nodepp);\r
+}\r
+\r
+/**\r
+ * ccs_ccache_list_remove_element()\r
+ *\r
+ * Purpose: Remove a node from the list\r
+ *\r
+ * Return: 0, success\r
+ * -1, failure\r
+ *\r
+ * Errors: ccErrBadParam\r
+ *\r
+ */\r
+cc_int32\r
+ccs_ccache_list_remove_element(cc_ccache_list_head_t* head, cc_ccache_list_node_t* rem) \r
+{\r
+ return cci_generic_list_remove_element((cc_generic_list_head_t*)head, (cc_generic_list_node_t*)rem);\r
+}\r
+\r
+/**\r
+ * ccs_ccache_list_iterator()\r
+ *\r
+ * Purpose: Allocate an iterator for the specified list\r
+ *\r
+ * Return: non-NULL, an iterator\r
+ * NULL, failure\r
+ *\r
+ * Errors: ccErrNoMem\r
+ *\r
+ */\r
+cc_int32\r
+ccs_ccache_list_iterator(cc_ccache_list_head_t *head, cc_ccache_iterate_t** iterpp) \r
+{\r
+ cc_ccache_iterate_t* iterator;\r
+ \r
+ if ( head == NULL || iterpp == NULL )\r
+ return ccErrBadParam;\r
+\r
+ iterator = (cc_ccache_iterate_t*)malloc(sizeof(cc_ccache_iterate_t));\r
+ if (iterator == NULL)\r
+ return ccErrNoMem;\r
+\r
+ iterator->next = head->head;\r
+ *iterpp = iterator;\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * ccs_ccache_free_iterator()\r
+ *\r
+ * Purpose: Deallocate memory associated with an iterator\r
+ *\r
+ * Return: 0, success\r
+ * -1, failure\r
+ *\r
+ * Errors: ccErrBadParam\r
+ *\r
+ */\r
+cc_int32\r
+ccs_ccache_free_iterator(cc_ccache_iterate_t* iterator)\r
+{\r
+ if ( iterator == NULL )\r
+ return ccErrBadParam;\r
+\r
+ iterator->next = NULL;\r
+ free(iterator);\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * ccs_credentials_list_new()\r
+ *\r
+ * Purpose: Allocate a new ccache list\r
+ *\r
+ * Return: non-NULL, a new list\r
+ * NULL, failure\r
+ *\r
+ * Errors: ccErrNoMem\r
+ *\r
+ */\r
+cc_int32\r
+ccs_credentials_list_new(cc_credentials_list_head_t ** list) \r
+{\r
+ if ( list == NULL )\r
+ return ccErrBadParam;\r
+\r
+ *list = (cc_credentials_list_head_t *)malloc(sizeof(cc_credentials_list_head_t));\r
+ if (*list == NULL)\r
+ return ccErrNoMem;\r
+\r
+ (*list)->head = (*list)->tail = NULL;\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * ccs_credentials_list_append()\r
+ *\r
+ * Purpose: Appends a new node containing a copy of 'len' bytes of 'data' \r
+ *\r
+ * Return: non-NULL, a pointer to the newly allocated node\r
+ * NULL, failure\r
+ *\r
+ * Errors: ccErrNoMem,ccErrBadParam\r
+ *\r
+ */\r
+cc_int32\r
+ccs_credentials_list_append(cc_credentials_list_head_t *head, cc_server_credentials_t *data, cc_credentials_list_node_t** nodepp ) \r
+{\r
+ return cci_generic_list_append((cc_generic_list_head_t *)head, (void *)data, sizeof(cc_server_credentials_t), (cc_credentials_list_node_t**)nodepp);\r
+}\r
+\r
+/**\r
+ * ccs_credentials_list_prepend()\r
+ *\r
+ * Purpose: Prepends a new node containing a copy of 'len' bytes of 'data' \r
+ *\r
+ * Return: non-NULL, a pointer to the newly allocated node\r
+ * NULL, failure\r
+ *\r
+ * Errors: ccErrNoMem,ccErrBadParam\r
+ *\r
+ */\r
+cc_int32\r
+ccs_credentials_list_prepend(cc_credentials_list_head_t *head, cc_server_credentials_t *data, cc_credentials_list_node_t** nodepp) \r
+{\r
+ return cci_generic_list_prepend((cc_generic_list_head_t *)head, (void *)data, sizeof(cc_server_credentials_t), (cc_credentials_list_node_t**)nodepp);\r
+}\r
+\r
+/**\r
+ * ccs_credentials_list_remove_element()\r
+ *\r
+ * Purpose: Remove a node from the list\r
+ *\r
+ * Return: 0, success\r
+ * -1, failure\r
+ *\r
+ * Errors: ccErrBadParam\r
+ *\r
+ */\r
+cc_int32 \r
+ccs_credentials_list_remove_element(cc_credentials_list_head_t* head, cc_credentials_list_node_t* rem) \r
+{\r
+ return cci_generic_list_remove_element((cc_generic_list_head_t*)head, (cc_generic_list_node_t*)rem);\r
+}\r
+\r
+/**\r
+ * ccs_credentials_list_iterator()\r
+ *\r
+ * Purpose: Allocate an iterator for the specified list\r
+ *\r
+ * Return: non-NULL, an iterator\r
+ * NULL, failure\r
+ *\r
+ * Errors: ccErrNoMem\r
+ *\r
+ */\r
+cc_int32\r
+ccs_credentials_list_iterator(cc_credentials_list_head_t *head, cc_credentials_iterate_t** iterpp) \r
+{\r
+ cc_credentials_iterate_t* iterator;\r
+ \r
+ if ( head == NULL || iterpp == NULL )\r
+ return ccErrBadParam;\r
+\r
+ iterator = (cc_credentials_iterate_t*)malloc(sizeof(cc_credentials_iterate_t));\r
+ if (iterator == NULL)\r
+ return ccErrNoMem;\r
+\r
+ iterator->next = head->head;\r
+ *iterpp = iterator;\r
+ return ccNoError;\r
+}\r
+\r
+/**\r
+ * ccs_credentials_free_iterator()\r
+ *\r
+ * Purpose: Deallocate memory associated with an iterator\r
+ *\r
+ * Return: 0, success\r
+ * -1, failure\r
+ *\r
+ * Errors: ccErrBadParam\r
+ *\r
+ */\r
+cc_int32\r
+ccs_credentials_free_iterator(cc_credentials_iterate_t* iterator)\r
+{\r
+ if ( iterator == NULL )\r
+ return ccErrBadParam;\r
+\r
+ iterator->next = NULL;\r
+ free(iterator);\r
+ return ccNoError;\r
+}\r
+\r
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>ServiceName</key>
+ <string>edu.mit.Kerberos.CCacheServer.ipcService</string>
+ <key>Command</key>
+ <string>/System/Library/CoreServices/CCacheServer.app/Contents/MacOS/CCacheServer</string>
+ <key>OnDemand</key>
+ <true/>
+</dict>
+</plist>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>English</string>
+ <key>CFBundleExecutable</key>
+ <string>CCacheServer</string>
+ <key>CFBundleGetInfoString</key>
+ <string>4.1</string>
+ <key>CFBundleIconFile</key>
+ <string></string>
+ <key>CFBundleIdentifier</key>
+ <string>edu.mit.Kerberos.CCacheServer</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>Kerberos Credentials Cache Server</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleSignature</key>
+ <string>CCSa</string>
+ <key>CFBundleVersion</key>
+ <string>0.0.1d1</string>
+ <key>CFBundleShortVersionString</key>
+ <string>5.5</string>
+ <key>CFBundleGetInfoString</key>
+ <string>5.5 Copyright MIT</string>
+ <key>KfMDisplayVersion</key>
+ <string>5.5 Copyright MIT</string>
+ <key>KfMDisplayCopyright</key>
+ <string>Copyright MIT</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>5.5 Copyright MIT</string>
+ <key>LSBackgroundOnly</key>
+ <string>1</string>
+</dict>
+</plist>
--- /dev/null
+#include <stdarg.h>
+#include <stdio.h>
+#include <syslog.h>
+#include "CredentialsCache.h"
+#include "msg.h"
+#include "migServer.h"
+
+#include <Kerberos/kipc_server.h>
+
+int main (int argc, const char *argv[])
+{
+ cc_int32 code = 0;
+ int running = 1;
+
+ openlog (argv[0], LOG_CONS | LOG_PID, LOG_AUTH);
+ syslog (LOG_INFO, "Starting up.");
+
+ if (!code) {
+ code = ccs_serv_initialize();
+ }
+
+ if (!code) {
+ code = kipc_server_run_server (ccapi_server);
+ }
+
+ /* cleanup ccs resources */
+ ccs_serv_cleanup();
+
+ syslog (LOG_NOTICE, "Exiting: %s (%d)", kipc_error_string (code), code);
+
+ /* exit */
+ return code ? 1 : 0;
+}
#include "rpc_auth.h"
cc_int32
-cci_rpc_is_authorized( cc_auth_info_t* msg_auth, cc_session_info_t* msg_session, cc_auth_info_t* stored_auth,
+ccs_rpc_is_authorized( cc_auth_info_t* msg_auth, cc_session_info_t* msg_session, cc_auth_info_t* stored_auth,
cc_session_info_t* stored_session, cc_uint32 * authorizedp)
{
- if (msg_auth == stored_auth && msg_session == stored_session)
+ if (msg_auth->len == stored_auth->len &&
+ !memcmp(msg_auth->info, stored_auth->info, msg_auth->len) &&
+ msg_session->len == stored_session->len &&
+ !memcmp(msg_session->info, stored_session->info, msg_session->len))
*authorizedp = 1;
else
*authorizedp = 0;
/* $Copyright:
*
- * Copyright 2004 by the Massachusetts Institute of Technology.
+ * Copyright 2004-2006 by the Massachusetts Institute of Technology.
*
* All rights reserved.
*
#include "datastore.h"
#include "rpc_auth.h"
#include "msg_headers.h"
+#include "marshall.h"
#include <stdlib.h>
#include <string.h>
extern char cc_vendor[];
cc_int32
-cci_serv_initialize(void)
+ccs_serv_initialize(void)
{
cc_int32 code;
- code = cci_context_list_new(&AllContexts);
+ code = ccs_context_list_new(&AllContexts);
if ( code != ccNoError )
return code;
TypeToOpMapping = (type_to_op_mapping_t*)malloc(sizeof(type_to_op_mapping_t));
if (TypeToOpMapping == NULL) {
- cci_context_list_destroy(AllContexts);
+ ccs_context_list_destroy(AllContexts);
return ccErrNoMem;
}
+#if 0
+ /* These message types are only generated by the server in response
+ * to a request. They are never received.
+ */
+ TypeToOpMapping->operations[ccmsg_ACK] = ccop_ACK;
+ TypeToOpMapping->operations[ccmsg_NACK] = ccop_NACK;
+#endif
TypeToOpMapping->operations[ccmsg_INIT] = ccop_INIT;
TypeToOpMapping->operations[ccmsg_CTX_RELEASE] = ccop_CTX_RELEASE;
TypeToOpMapping->operations[ccmsg_CTX_GET_CHANGE_TIME] = ccop_CTX_GET_CHANGE_TIME;
TypeToOpMapping->operations[ccmsg_CTX_GET_DEFAULT_CCACHE_NAME] = ccop_CTX_GET_DEFAULT_CCACHE_NAME;
- TypeToOpMapping->operations[ccmsg_CTX_COMPARE] = ccop_CTX_COMPARE;
+ TypeToOpMapping->operations[ccmsg_CTX_CCACHE_OPEN] = ccop_CTX_CCACHE_OPEN;
+ TypeToOpMapping->operations[ccmsg_CTX_CCACHE_OPEN_DEFAULT] = ccop_CTX_CCACHE_OPEN_DEFAULT;
+ TypeToOpMapping->operations[ccmsg_CTX_CCACHE_CREATE] = ccop_CTX_CCACHE_CREATE;
+ TypeToOpMapping->operations[ccmsg_CTX_CCACHE_CREATE_DEFAULT] = ccop_CTX_CCACHE_CREATE_DEFAULT;
+ TypeToOpMapping->operations[ccmsg_CTX_CCACHE_CREATE_UNIQUE] = ccop_CTX_CCACHE_CREATE_UNIQUE;
TypeToOpMapping->operations[ccmsg_CTX_NEW_CCACHE_ITERATOR] = ccop_CTX_NEW_CCACHE_ITERATOR;
TypeToOpMapping->operations[ccmsg_CTX_LOCK] = ccop_CTX_LOCK;
TypeToOpMapping->operations[ccmsg_CTX_UNLOCK] = ccop_CTX_UNLOCK;
- TypeToOpMapping->operations[ccmsg_CTX_CLONE] = ccop_CTX_CLONE;
- TypeToOpMapping->operations[ccmsg_CCACHE_OPEN] = ccop_CCACHE_OPEN;
- TypeToOpMapping->operations[ccmsg_CCACHE_OPEN_DEFAULT] = ccop_CCACHE_OPEN_DEFAULT;
- TypeToOpMapping->operations[ccmsg_CCACHE_CREATE] = ccop_CCACHE_CREATE;
- TypeToOpMapping->operations[ccmsg_CCACHE_CREATE_DEFAULT] = ccop_CCACHE_CREATE_DEFAULT;
- TypeToOpMapping->operations[ccmsg_CCACHE_CREATE_UNIQUE] = ccop_CCACHE_CREATE_UNIQUE;
+ TypeToOpMapping->operations[ccmsg_CTX_COMPARE] = ccop_CTX_COMPARE;
TypeToOpMapping->operations[ccmsg_CCACHE_RELEASE] = ccop_CCACHE_RELEASE;
TypeToOpMapping->operations[ccmsg_CCACHE_DESTROY] = ccop_CCACHE_DESTROY;
TypeToOpMapping->operations[ccmsg_CCACHE_SET_DEFAULT] = ccop_CCACHE_SET_DEFAULT;
TypeToOpMapping->operations[ccmsg_CCACHE_GET_NAME] = ccop_CCACHE_GET_NAME;
TypeToOpMapping->operations[ccmsg_CCACHE_GET_PRINCIPAL] = ccop_CCACHE_GET_PRINCIPAL;
TypeToOpMapping->operations[ccmsg_CCACHE_SET_PRINCIPAL] = ccop_CCACHE_SET_PRINCIPAL;
- TypeToOpMapping->operations[ccmsg_CCACHE_CREDS_ITERATOR] = ccop_CCACHE_CREDS_ITERATOR;
+ TypeToOpMapping->operations[ccmsg_CCACHE_NEW_CREDS_ITERATOR] = ccop_CCACHE_NEW_CREDS_ITERATOR;
TypeToOpMapping->operations[ccmsg_CCACHE_STORE_CREDS] = ccop_CCACHE_STORE_CREDS;
TypeToOpMapping->operations[ccmsg_CCACHE_REM_CREDS] = ccop_CCACHE_REM_CREDS;
+ TypeToOpMapping->operations[ccmsg_CCACHE_MOVE] = ccop_CCACHE_MOVE;
+ TypeToOpMapping->operations[ccmsg_CCACHE_LOCK] = ccop_CCACHE_LOCK;
+ TypeToOpMapping->operations[ccmsg_CCACHE_UNLOCK] = ccop_CCACHE_UNLOCK;
TypeToOpMapping->operations[ccmsg_CCACHE_GET_LAST_DEFAULT_TIME] = ccop_CCACHE_GET_LAST_DEFAULT_TIME;
TypeToOpMapping->operations[ccmsg_CCACHE_GET_CHANGE_TIME] = ccop_CCACHE_GET_CHANGE_TIME;
TypeToOpMapping->operations[ccmsg_CCACHE_COMPARE] = ccop_CCACHE_COMPARE;
TypeToOpMapping->operations[ccmsg_CCACHE_CLEAR_KDC_TIME_OFFSET] = ccop_CCACHE_CLEAR_KDC_TIME_OFFSET;
TypeToOpMapping->operations[ccmsg_CCACHE_ITERATOR_RELEASE] = ccop_CCACHE_ITERATOR_RELEASE;
TypeToOpMapping->operations[ccmsg_CCACHE_ITERATOR_NEXT] = ccop_CCACHE_ITERATOR_NEXT;
+ TypeToOpMapping->operations[ccmsg_CCACHE_ITERATOR_CLONE] = ccop_CCACHE_ITERATOR_CLONE;
TypeToOpMapping->operations[ccmsg_CREDS_ITERATOR_RELEASE] = ccop_CREDS_ITERATOR_RELEASE;
TypeToOpMapping->operations[ccmsg_CREDS_ITERATOR_NEXT] = ccop_CREDS_ITERATOR_NEXT;
- TypeToOpMapping->operations[ccmsg_CREDS_RELEASE] = ccop_CREDS_RELEASE;
+ TypeToOpMapping->operations[ccmsg_CREDS_ITERATOR_CLONE] = ccop_CREDS_ITERATOR_CLONE;
return ccNoError;
};
cc_int32
-cci_serv_process_msg(cc_msg_t * msg, cc_auth_info_t* auth_info, cc_session_info_t* session_info, cc_msg_t** resp_msg)
+ccs_serv_cleanup(void)
+{
+ return ccNoError;
+}
+
+cc_int32
+ccs_serv_process_msg(cc_msg_t * msg, cc_auth_info_t* auth_info, cc_session_info_t* session_info, cc_msg_t** resp_msg)
{
cc_server_context_t* ctx;
ccmsg_ctx_only_t* header = (ccmsg_ctx_only_t *)msg->header;
+ cc_uint32 type;
+ cc_uint32 header_len;
+ cc_handle handle;
cc_int32 code;
if (msg == NULL || msg->header == NULL || auth_info == NULL || session_info == NULL)
return ccErrBadParam;
if (AllContexts == NULL) {
- code = cci_serv_initialize();
+ code = ccs_serv_initialize();
if ( code != ccNoError )
return code;
}
- if (msg->type == ccmsg_INIT) {
- return TypeToOpMapping->operations[msg->type] (NULL, auth_info, session_info, msg, resp_msg);
+ type = msg->type;
+ if (type == ccmsg_INIT) {
+ return TypeToOpMapping->operations[type] (NULL, auth_info, session_info, msg, resp_msg);
} else {
- if (msg->header_len < sizeof(ccmsg_ctx_only_t)) {
+ header_len = msg->header_len;
+ if (header_len < sizeof(ccmsg_ctx_only_t)) {
return ccErrBadParam;
}
- code = cci_serv_find_ctx_by_handle(header->ctx, auth_info, session_info, &ctx);
+ handle = ntohll(header->ctx);
+ code = ccs_serv_find_ctx_by_handle(handle, auth_info, session_info, &ctx);
if (code != ccNoError) {
- cci_serv_make_nack(ccErrContextNotFound, auth_info, session_info, resp_msg);
+ ccs_serv_make_nack(ccErrContextNotFound, auth_info, session_info, resp_msg);
return code;
}
- return TypeToOpMapping->operations[msg->type] (ctx, auth_info, session_info, msg, resp_msg);
+ return TypeToOpMapping->operations[type] (ctx, auth_info, session_info, msg, resp_msg);
}
}
/*deprecated*/
cc_int32
-cci_serv_find_ctx(cc_auth_info_t* auth_info, cc_session_info_t* session_info,
+ccs_serv_find_ctx(cc_auth_info_t* auth_info, cc_session_info_t* session_info,
cc_server_context_t** ctxpp)
{
cc_context_iterate_t* ctx_iterator;
cc_int32 code;
cc_uint32 authorized;
- code = cci_context_list_iterator(AllContexts, &ctx_iterator);
+ code = ccs_context_list_iterator(AllContexts, &ctx_iterator);
if (code != ccNoError)
return code;
- while (cci_context_iterate_has_next(ctx_iterator)) {
- code = cci_context_iterate_next(ctx_iterator, &ctx_node);
+ while (ccs_context_iterate_has_next(ctx_iterator)) {
+ code = ccs_context_iterate_next(ctx_iterator, &ctx_node);
if (code != ccNoError) {
- cci_context_free_iterator(ctx_iterator);
+ ccs_context_free_iterator(ctx_iterator);
return code;
}
ctx = (cc_server_context_t *)ctx_node->data;
- code = cci_rpc_is_authorized(auth_info, session_info, ctx->auth_info, ctx->session_info, &authorized);
+ code = ccs_rpc_is_authorized(auth_info, session_info, ctx->auth_info, ctx->session_info, &authorized);
if (code != ccNoError) {
- cci_context_free_iterator(ctx_iterator);
+ ccs_context_free_iterator(ctx_iterator);
return code;
}
if (authorized) {
- cci_context_free_iterator(ctx_iterator);
+ ccs_context_free_iterator(ctx_iterator);
*ctxpp = ctx;
return ccNoError;
}
}
- cci_context_free_iterator(ctx_iterator);
+ ccs_context_free_iterator(ctx_iterator);
return ccIteratorEnd;
}
cc_int32
-cci_serv_find_ctx_by_handle(cc_handle ctx_num, cc_auth_info_t* auth, cc_session_info_t* session, cc_server_context_t** ctxpp)
+ccs_serv_find_ctx_by_handle(cc_handle ctx_num, cc_auth_info_t* auth, cc_session_info_t* session, cc_server_context_t** ctxpp)
{
cc_server_context_t* input_ctx = (cc_server_context_t*)ctx_num;
cc_context_iterate_t* ctx_iterator;
cc_uint32 authorized;
cc_int32 code;
- code = cci_context_list_iterator(AllContexts, &ctx_iterator);
+ code = ccs_context_list_iterator(AllContexts, &ctx_iterator);
if (code != ccNoError)
return code;
- while (cci_context_iterate_has_next(ctx_iterator)) {
- code = cci_context_iterate_next(ctx_iterator, &ctx_node);
+ while (ccs_context_iterate_has_next(ctx_iterator)) {
+ code = ccs_context_iterate_next(ctx_iterator, &ctx_node);
ctx = (cc_server_context_t *)ctx_node->data;
if (code != ccNoError) {
- cci_context_free_iterator(ctx_iterator);
+ ccs_context_free_iterator(ctx_iterator);
return code;
}
- code = cci_rpc_is_authorized(auth, session, ctx->auth_info, ctx->session_info, &authorized);
+ code = ccs_rpc_is_authorized(auth, session, ctx->auth_info, ctx->session_info, &authorized);
if (code != ccNoError) {
- cci_context_free_iterator(ctx_iterator);
+ ccs_context_free_iterator(ctx_iterator);
return code;
}
if (ctx == input_ctx && authorized) {
- cci_context_free_iterator(ctx_iterator);
+ ccs_context_free_iterator(ctx_iterator);
*ctxpp = ctx;
return ccNoError;
}
}
- cci_context_free_iterator(ctx_iterator);
+ ccs_context_free_iterator(ctx_iterator);
return ccIteratorEnd;
}
cc_int32
-cci_serv_find_ccache_by_handle(cc_server_context_t* ctx, cc_handle ccache, cc_server_ccache_t** ccachepp )
+ccs_serv_find_ccache_by_handle(cc_server_context_t* ctx, cc_handle ccache, cc_server_ccache_t** ccachepp )
{
cc_ccache_iterate_t* ccache_iterator;
cc_ccache_list_node_t* ccache_node;
cc_server_ccache_t* target_ccache = (cc_server_ccache_t*)ccache;
cc_int32 code;
- code = cci_ccache_list_iterator(ctx->ccaches, &ccache_iterator);
+ code = ccs_ccache_list_iterator(ctx->ccaches, &ccache_iterator);
if (code != ccNoError)
return code;
- while (cci_ccache_iterate_has_next(ccache_iterator)) {
- code = cci_ccache_iterate_next(ccache_iterator, &ccache_node);
+ while (ccs_ccache_iterate_has_next(ccache_iterator)) {
+ code = ccs_ccache_iterate_next(ccache_iterator, &ccache_node);
if (code != ccNoError) {
- cci_ccache_free_iterator(ccache_iterator);
+ ccs_ccache_free_iterator(ccache_iterator);
return code;
}
stored_ccache = (cc_server_ccache_t *)ccache_node->data;
if (stored_ccache == target_ccache) {
- cci_ccache_free_iterator(ccache_iterator);
+ ccs_ccache_free_iterator(ccache_iterator);
*ccachepp = stored_ccache;
return ccNoError;
}
}
- cci_ccache_free_iterator(ccache_iterator);
+ ccs_ccache_free_iterator(ccache_iterator);
return ccIteratorEnd;
}
cc_int32
-cci_serv_find_ccache_iterator_by_handle(cc_server_context_t* ctx, cc_handle iterator, cc_generic_list_node_t** nodepp )
+ccs_serv_find_ccache_iterator_by_handle(cc_server_context_t* ctx, cc_handle iterator, cc_generic_list_node_t** nodepp )
{
cc_generic_iterate_t* gen_iterator;
cc_generic_list_node_t* gen_node;
}
cc_int32
-cci_serv_find_creds_iterator_by_handle(cc_server_ccache_t* ccache, cc_handle iterator, cc_generic_list_node_t** nodepp)
+ccs_serv_find_creds_iterator_by_handle(cc_server_ccache_t* ccache, cc_handle iterator, cc_generic_list_node_t** nodepp)
{
cc_generic_iterate_t* gen_iterator;
cc_generic_list_node_t* gen_node;
}
cc_int32
-cci_serv_make_nack(cc_int32 err_code, cc_auth_info_t* auth_info, cc_session_info_t* session_info, cc_msg_t** resp_msg)
+ccs_serv_make_nack(cc_int32 err_code, cc_auth_info_t* auth_info, cc_session_info_t* session_info, cc_msg_t** resp_msg)
{
ccmsg_nack_t* nack_header;
cc_int32 code;
return ccErrNoMem;
}
- nack_header->err_code = err_code;;
+ nack_header->err_code = htonl(err_code);
code = cci_msg_add_header(*resp_msg, nack_header, sizeof(ccmsg_nack_t));
if (code != ccNoError) {
cci_msg_destroy(*resp_msg);
}
cc_int32
-cci_serv_make_ack(void * header, cc_int32 header_len, cc_auth_info_t* auth_info, cc_session_info_t* session_info, cc_msg_t** resp_msg)
+ccs_serv_make_ack(void * header, cc_int32 header_len, cc_auth_info_t* auth_info, cc_session_info_t* session_info, cc_msg_t** resp_msg)
{
cc_int32 code;
ccmsg_init_resp_t *resp_header;
ccmsg_init_t *header = (ccmsg_init_t *)msg->header;
cc_context_list_node_t* ctx_node;
+ cc_uint32 header_len, in_version;
+
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_init_t)) {
+ header_len = msg->header_len;
+ if (ctx != NULL || header_len != sizeof(ccmsg_init_t)) {
return ccErrBadParam;
}
- code = cci_context_new(header->in_version, auth_info, session_info, &new_ctx);
+ in_version = ntohl(header->in_version);
+ code = ccs_context_new(in_version, auth_info, session_info, &new_ctx);
if (code != ccNoError) {
return code;
}
- code = cci_context_list_append(AllContexts, ctx, &ctx_node);
+ code = ccs_context_list_append(AllContexts, new_ctx, &ctx_node);
if (code != ccNoError) {
- cci_context_destroy(new_ctx);
+ ccs_context_destroy(new_ctx);
return code;
}
resp_header = (ccmsg_init_resp_t*)malloc(sizeof(ccmsg_init_resp_t));
if (resp_header == NULL) {
- cci_context_destroy(new_ctx);
+ ccs_context_destroy(new_ctx);
return ccErrNoMem;
}
code = cci_msg_new(ccmsg_ACK, resp_msg);
if (code != ccNoError) {
free(resp_header);
- cci_context_destroy(new_ctx);
+ ccs_context_destroy(new_ctx);
return code;
}
code = cci_msg_add_data_blob(*resp_msg, cc_vendor, strlen(cc_vendor) + 1, &blob_pos);
if (code != ccNoError) {
free(resp_header);
- cci_context_destroy(new_ctx);
+ ccs_context_destroy(new_ctx);
cci_msg_destroy(*resp_msg);
*resp_msg = 0;
return code;
}
- resp_header->out_ctx = new_ctx;
- resp_header->out_version = cc_myversion;
- resp_header->vendor_offset = blob_pos;
- resp_header->vendor_length = strlen(cc_vendor) + 1;
+ resp_header->out_ctx = htonll((cc_handle) new_ctx);
+ resp_header->out_version = htonl(cc_myversion);
+ resp_header->vendor_offset = htonl(blob_pos);
+ resp_header->vendor_length = htonl(strlen(cc_vendor) + 1);
code = cci_msg_add_header(*resp_msg, resp_header, sizeof(ccmsg_init_resp_t));
if (code != ccNoError) {
free(resp_header);
- cci_context_destroy(new_ctx);
+ ccs_context_destroy(new_ctx);
cci_msg_destroy(*resp_msg);
*resp_msg = 0;
return code;
cc_msg_t *msg, cc_msg_t **resp_msg)
{
ccmsg_ctx_release_t* header = (ccmsg_ctx_release_t *)msg->header;
+ cc_uint32 header_len = msg->header_len;
+ cc_handle handle = ntohll(header->ctx);
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ctx_release_t)) {
+ if (header_len != sizeof(ccmsg_ctx_release_t)) {
return ccErrBadParam;
}
- code = cci_context_destroy(header->ctx);
- return cci_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
+ code = ccs_context_destroy((cc_server_context_t *)handle);
+ return ccs_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
}
cc_int32
{
ccmsg_ctx_get_change_time_resp_t* resp_header;
ccmsg_ctx_get_change_time_t *header = (ccmsg_ctx_get_change_time_t *)msg->header;
+ cc_uint32 header_len = msg->header_len;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ctx_get_change_time_t)) {
+ if (header_len != sizeof(ccmsg_ctx_get_change_time_t)) {
return ccErrBadParam;
}
return ccErrNoMem;
}
- resp_header->time = ctx->changed;
- return cci_serv_make_ack(resp_header, sizeof(ccmsg_ctx_get_change_time_resp_t), auth_info, session_info, resp_msg);
+ resp_header->time = htonll(ctx->changed);
+ return ccs_serv_make_ack(resp_header, sizeof(ccmsg_ctx_get_change_time_resp_t), auth_info, session_info, resp_msg);
}
cc_int32
char * name;
ccmsg_ctx_get_default_ccache_name_resp_t* resp_header;
ccmsg_ctx_get_default_ccache_name_t* header = (ccmsg_ctx_get_default_ccache_name_t *)msg->header;
+ cc_uint32 header_len = htonl(msg->header_len);
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ctx_get_default_ccache_name_t)) {
+ if (header_len != sizeof(ccmsg_ctx_get_default_ccache_name_t)) {
return ccErrBadParam;
}
- code = cci_context_get_default_ccache_name(ctx, &name);
+ code = ccs_context_get_default_ccache_name(ctx, &name);
if (code != ccNoError)
return code;
}
code = cci_msg_add_data_blob(*resp_msg, name, strlen(name) + 1, &resp_header->name_offset);
- resp_header->name_len = strlen(name) + 1;
+ resp_header->name_len = htonl(strlen(name) + 1);
return ccNoError;
}
cc_server_context_t *ctx2;
ccmsg_ctx_compare_resp_t* resp_header;
ccmsg_ctx_compare_t* header = (ccmsg_ctx_compare_t *)msg->header;
+ cc_uint32 header_len = msg->header_len;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ctx_compare_t))
+ if (header_len != sizeof(ccmsg_ctx_compare_t))
return ccErrBadParam;
- code = cci_serv_find_ctx_by_handle(header->ctx2, auth_info, session_info, &ctx2);
+ code = ccs_serv_find_ctx_by_handle(header->ctx2, auth_info, session_info, &ctx2);
resp_header = (ccmsg_ctx_compare_resp_t*)malloc(sizeof(ccmsg_ctx_compare_resp_t));
if (resp_header == NULL)
return ccErrNoMem;
- resp_header->is_equal = cci_context_compare(ctx, ctx2);
- return cci_serv_make_ack(resp_header, sizeof(ccmsg_ctx_compare_resp_t), auth_info, session_info, resp_msg);
+ resp_header->is_equal = htonl(ccs_context_compare(ctx, ctx2));
+ return ccs_serv_make_ack(resp_header, sizeof(ccmsg_ctx_compare_resp_t), auth_info, session_info, resp_msg);
}
cc_int32
cc_ccache_iterate_t* ccache_iterator;
ccmsg_ctx_new_ccache_iterator_resp_t* resp_header;
ccmsg_ctx_new_ccache_iterator_t* header = (ccmsg_ctx_new_ccache_iterator_t*)msg->header;
+ cc_uint32 header_len = msg->header_len;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ctx_new_ccache_iterator_t))
+ if (header_len != sizeof(ccmsg_ctx_new_ccache_iterator_t))
return ccErrBadParam;
- code = cci_context_ccache_iterator(ctx,&ccache_iterator);
+ code = ccs_context_ccache_iterator(ctx, &ccache_iterator);
resp_header = (ccmsg_ctx_new_ccache_iterator_resp_t*)malloc(sizeof(ccmsg_ctx_new_ccache_iterator_resp_t));
if (resp_header == NULL)
return ccErrNoMem;
- resp_header->iterator = ccache_iterator;
+ resp_header->iterator = htonll((cc_handle) ccache_iterator);
- return cci_serv_make_ack(resp_header, sizeof(ccmsg_ctx_new_ccache_iterator_resp_t), auth_info, session_info, resp_msg);
+ return ccs_serv_make_ack(resp_header, sizeof(ccmsg_ctx_new_ccache_iterator_resp_t), auth_info, session_info, resp_msg);
}
cc_int32
cc_msg_t *msg, cc_msg_t **resp_msg)
{
// TODO
- return cci_serv_make_nack(ccErrNotImplemented, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrNotImplemented, auth_info, session_info, resp_msg);
}
cc_int32
cc_msg_t *msg, cc_msg_t **resp_msg)
{
// TODO
- return cci_serv_make_nack(ccErrNotImplemented, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrNotImplemented, auth_info, session_info, resp_msg);
}
cc_int32
cc_msg_t *msg, cc_msg_t **resp_msg)
{
// TODO
- return cci_serv_make_nack(ccErrNotImplemented, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrNotImplemented, auth_info, session_info, resp_msg);
}
cc_int32
-ccop_CCACHE_OPEN(cc_server_context_t* ctx,
+ccop_CTX_CCACHE_OPEN(cc_server_context_t* ctx,
cc_auth_info_t* auth_info,
cc_session_info_t* session_info,
cc_msg_t *msg, cc_msg_t **resp_msg)
cc_server_ccache_t* ccache;
ccmsg_ccache_open_resp_t* resp_header;
ccmsg_ccache_open_t* header = (ccmsg_ccache_open_t*)msg->header;
+ cc_uint32 header_len = msg->header_len;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_open_t))
+ if (header_len != sizeof(ccmsg_ccache_open_t))
return ccErrBadParam;
- code = cci_msg_retrieve_blob(msg, header->name_offset, header->name_len, &name);
- code = cci_context_find_ccache(ctx, name, &ccache);
+ code = cci_msg_retrieve_blob(msg, ntohl(header->name_offset), ntohl(header->name_len), &name);
+ code = ccs_context_find_ccache(ctx, name, &ccache);
free(name);
if (ccache == NULL)
- return cci_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
resp_header = (ccmsg_ccache_open_resp_t*)malloc(sizeof(ccmsg_ccache_open_resp_t));
if (resp_header == NULL)
return ccErrNoMem;
- resp_header->ccache = ccache;
- cci_serv_make_ack(resp_header, sizeof(ccmsg_ccache_open_resp_t), auth_info, session_info, resp_msg);
+ resp_header->ccache = htonll((cc_handle) ccache);
+ ccs_serv_make_ack(resp_header, sizeof(ccmsg_ccache_open_resp_t), auth_info, session_info, resp_msg);
return ccNoError;
}
cc_int32
-ccop_CCACHE_OPEN_DEFAULT(cc_server_context_t* ctx,
+ccop_CTX_CCACHE_OPEN_DEFAULT(cc_server_context_t* ctx,
cc_auth_info_t* auth_info,
cc_session_info_t* session_info,
cc_msg_t *msg, cc_msg_t **resp_msg)
ccmsg_ccache_open_default_t* header = (ccmsg_ccache_open_default_t*)msg->header;
ccmsg_ccache_open_resp_t* resp_header;
cc_server_ccache_t* ccache;
+ cc_uint32 header_len = msg->header_len;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_open_default_t))
+ if (header_len != sizeof(ccmsg_ccache_open_default_t))
return ccErrBadParam;
if (ctx->ccaches->head->data == NULL)
- return cci_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
ccache = (cc_server_ccache_t*) ctx->ccaches->head->data;
if (resp_header == NULL)
return ccErrNoMem;
- resp_header->ccache = ccache;
- return cci_serv_make_ack(resp_header, sizeof(ccmsg_ccache_open_resp_t), auth_info, session_info, resp_msg);
+ resp_header->ccache = htonll((cc_handle) ccache);
+ return ccs_serv_make_ack(resp_header, sizeof(ccmsg_ccache_open_resp_t), auth_info, session_info, resp_msg);
}
cc_int32
-ccop_CCACHE_CREATE(cc_server_context_t* ctx,
+ccop_CTX_CCACHE_CREATE(cc_server_context_t* ctx,
cc_auth_info_t* auth_info,
cc_session_info_t* session_info,
cc_msg_t *msg, cc_msg_t **resp_msg)
cc_server_ccache_t* ccache;
char* principal;
char* name;
+ cc_uint32 header_len = msg->header_len;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_create_t))
+ if (header_len != sizeof(ccmsg_ccache_create_t))
return ccErrBadParam;
- code = cci_msg_retrieve_blob(msg, header->principal_offset, header->principal_len, &principal);
+ code = cci_msg_retrieve_blob(msg, ntohl(header->principal_offset), ntohl(header->principal_len), &principal);
if (code != ccNoError)
return code;
- principal[header->principal_len] = '\0'; /*Ensure null termination*/
+ principal[ntohl(header->principal_len)] = '\0'; /*Ensure null termination*/
- code = cci_msg_retrieve_blob(msg, header->name_offset, header->name_len, &name);
+ code = cci_msg_retrieve_blob(msg, ntohl(header->name_offset), ntohl(header->name_len), &name);
if (code != ccNoError)
return code;
- name[header->name_len] = '\0'; /*Ensure null termination*/
+ name[ntohl(header->name_len)] = '\0'; /*Ensure null termination*/
- code = cci_context_create_ccache(ctx, name, header->version, principal, &ccache);
+ code = ccs_context_create_ccache(ctx, name, ntohl(header->version), principal, &ccache);
if (code != ccNoError)
return code;
if (resp_header == NULL)
return ccErrNoMem;
- resp_header->ccache = ccache;
- return cci_serv_make_ack(resp_header, sizeof(ccmsg_ccache_create_resp_t), auth_info, session_info, resp_msg);
+ resp_header->ccache = htonll((cc_handle) ccache);
+ return ccs_serv_make_ack(resp_header, sizeof(ccmsg_ccache_create_resp_t), auth_info, session_info, resp_msg);
}
cc_int32
-ccop_CCACHE_CREATE_DEFAULT( cc_server_context_t* ctx,
+ccop_CTX_CCACHE_CREATE_DEFAULT( cc_server_context_t* ctx,
cc_auth_info_t* auth_info,
cc_session_info_t* session_info,
cc_msg_t *msg, cc_msg_t **resp_msg)
cc_server_ccache_t* ccache;
char* principal;
char* name;
+ cc_uint32 header_len = msg->header_len;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_create_t))
+ if (header_len != sizeof(ccmsg_ccache_create_t))
return ccErrBadParam;
- code = cci_msg_retrieve_blob(msg, header->principal_offset, header->principal_len, &principal);
+ code = cci_msg_retrieve_blob(msg, ntohl(header->principal_offset), ntohl(header->principal_len), &principal);
if (code != ccNoError)
return code;
- principal[header->principal_len] = '\0'; /*Ensure null termination*/
+ principal[ntohl(header->principal_len)] = '\0'; /*Ensure null termination*/
- code = cci_context_get_default_ccache_name(ctx, &name);
+ code = ccs_context_get_default_ccache_name(ctx, &name);
if (code != ccNoError)
return code;
- code = cci_context_create_ccache(ctx, name, header->version, principal, &ccache);
+ code = ccs_context_create_ccache(ctx, name, ntohl(header->version), principal, &ccache);
if (code != ccNoError)
return code;
if (resp_header == NULL)
return ccErrNoMem;
- resp_header->ccache = ccache;
- return cci_serv_make_ack(resp_header, sizeof(ccmsg_ccache_create_resp_t), auth_info, session_info, resp_msg);
+ resp_header->ccache = htonll((cc_handle) ccache);
+ return ccs_serv_make_ack(resp_header, sizeof(ccmsg_ccache_create_resp_t), auth_info, session_info, resp_msg);
}
cc_int32
-ccop_CCACHE_CREATE_UNIQUE( cc_server_context_t* ctx,
+ccop_CTX_CCACHE_CREATE_UNIQUE( cc_server_context_t* ctx,
cc_auth_info_t* auth_info,
cc_session_info_t* session_info,
cc_msg_t *msg, cc_msg_t **resp_msg)
cc_server_ccache_t* ccache;
char* principal;
char* name;
+ cc_uint32 header_len = msg->header_len;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_create_t))
+ if (header_len != sizeof(ccmsg_ccache_create_t))
return ccErrBadParam;
- code = cci_msg_retrieve_blob(msg, header->principal_offset, header->principal_len, &principal);
+ code = cci_msg_retrieve_blob(msg, ntohl(header->principal_offset), htonl(header->principal_len), &principal);
if (code != ccNoError)
return code;
- principal[header->principal_len] = '\0'; /*Ensure null termination*/
+ principal[ntohl(header->principal_len)] = '\0'; /*Ensure null termination*/
- // TODO: Generate a unique ccache name
+ // TODO: Generate a unique ccache name
+ name = "unique";
- code = cci_context_create_ccache(ctx, name, header->version, principal, &ccache);
+ code = ccs_context_create_ccache(ctx, name, ntohl(header->version), principal, &ccache);
if (code != ccNoError)
return code;
if (resp_header == NULL)
return ccErrNoMem;
- resp_header->ccache = ccache;
- return cci_serv_make_ack(resp_header, sizeof(ccmsg_ccache_create_resp_t), auth_info, session_info, resp_msg);
+ resp_header->ccache = htonll((cc_handle) ccache);
+ return ccs_serv_make_ack(resp_header, sizeof(ccmsg_ccache_create_resp_t), auth_info, session_info, resp_msg);
}
cc_int32
{
ccmsg_ccache_release_t* header = (ccmsg_ccache_release_t*)msg->header;
cc_server_ccache_t* ccache;
+ cc_uint32 header_len = msg->header_len;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_release_t))
+ if (header_len != sizeof(ccmsg_ccache_release_t))
return ccErrBadParam;
- code = cci_serv_find_ccache_by_handle(ctx, header->ccache, &ccache);
+ code = ccs_serv_find_ccache_by_handle(ctx, ntohll(header->ccache), &ccache);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
- cci_ccache_destroy(ccache);
+ ccs_ccache_destroy(ccache);
- return cci_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
+ return ccs_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
}
cc_int32
ccmsg_ccache_set_default_t* header = (ccmsg_ccache_set_default_t*)msg->header;
cc_ccache_iterate_t* ccache_iterator;
cc_ccache_list_node_t* ccache_node;
+ cc_uint32 header_len = msg->header_len;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_set_default_t))
+ if (header_len != sizeof(ccmsg_ccache_set_default_t))
return ccErrBadParam;
- code = cci_serv_find_ccache_by_handle(ctx, header->ccache, &ccache);
+ code = ccs_serv_find_ccache_by_handle(ctx, ntohll(header->ccache), &ccache);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
if (ccache == (cc_server_ccache_t*)ctx->ccaches->head->data) /*already default*/
- return cci_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
+ return ccs_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
old_default = (cc_server_ccache_t*)ctx->ccaches->head->data;
old_default->last_default = time(NULL);
- code = cci_ccache_list_iterator(ctx->ccaches, &ccache_iterator);
+ code = ccs_ccache_list_iterator(ctx->ccaches, &ccache_iterator);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
- while (cci_ccache_iterate_has_next(ccache_iterator)) {
- code = cci_ccache_iterate_next(ccache_iterator,&ccache_node);
+ while (ccs_ccache_iterate_has_next(ccache_iterator)) {
+ code = ccs_ccache_iterate_next(ccache_iterator,&ccache_node);
stored_ccache = (cc_server_ccache_t*)ccache_node->data;
if (stored_ccache == ccache) {
ccache_node->data = NULL; /*don't want list removal code free()ing ccache*/
- cci_ccache_list_remove_element(ctx->ccaches, ccache_node);
- cci_ccache_list_prepend(ctx->ccaches, ccache, NULL);
+ ccs_ccache_list_remove_element(ctx->ccaches, ccache_node);
+ ccs_ccache_list_prepend(ctx->ccaches, ccache, NULL);
break;
}
}
- return cci_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
+ return ccs_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
}
cc_int32
ccmsg_ccache_get_creds_version_t* header = (ccmsg_ccache_get_creds_version_t*)msg->header;
ccmsg_ccache_get_creds_version_resp_t* resp_header;
cc_server_ccache_t* ccache;
+ cc_uint32 header_len = msg->header_len;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_get_creds_version_t))
+ if (header_len != sizeof(ccmsg_ccache_get_creds_version_t))
return ccErrBadParam;
- code = cci_serv_find_ccache_by_handle(ctx, header->ccache, &ccache);
+ code = ccs_serv_find_ccache_by_handle(ctx, ntohll(header->ccache), &ccache);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
resp_header = (ccmsg_ccache_get_creds_version_resp_t*)malloc(sizeof(ccmsg_ccache_get_creds_version_resp_t));
if (resp_header == NULL)
return ccErrNoMem;
- resp_header->version = ccache->versions;
- return cci_serv_make_ack(resp_header, sizeof(ccmsg_ccache_get_creds_version_resp_t), auth_info, session_info, resp_msg);
+ resp_header->version = htonl(ccache->versions);
+ return ccs_serv_make_ack(resp_header, sizeof(ccmsg_ccache_get_creds_version_resp_t), auth_info, session_info, resp_msg);
}
cc_int32
ccmsg_ccache_get_name_t* header = (ccmsg_ccache_get_name_t*)msg->header;
ccmsg_ccache_get_name_resp_t* resp_header;
cc_server_ccache_t* ccache;
+ cc_uint32 header_len = msg->header_len;
+ cc_uint32 name_offset;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_get_name_resp_t))
+ if (header_len != sizeof(ccmsg_ccache_get_name_resp_t))
return ccErrBadParam;
- code = cci_serv_find_ccache_by_handle(ctx, header->ccache, &ccache);
+ code = ccs_serv_find_ccache_by_handle(ctx, ntohll(header->ccache), &ccache);
if (ccache == NULL)
- return cci_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
resp_header = (ccmsg_ccache_get_name_resp_t*)malloc(sizeof(ccmsg_ccache_get_name_resp_t));
if (resp_header == NULL)
if (code != ccNoError)
return code;
- code = cci_msg_add_data_blob(*resp_msg, ccache->name, strlen(ccache->name) + 1, &resp_header->name_offset);
- resp_header->name_len = strlen(ccache->name) + 1;
+ code = cci_msg_add_data_blob(*resp_msg, ccache->name, strlen(ccache->name) + 1, &name_offset);
+ if (code == 0) {
+ resp_header->name_len = htonl(strlen(ccache->name) + 1);
+ resp_header->name_offset = htonl(name_offset);
+ }
cci_msg_add_header(*resp_msg, resp_header, sizeof(ccmsg_ccache_get_name_resp_t));
return ccNoError;
ccmsg_ccache_get_principal_resp_t* resp_header;
cc_server_ccache_t* ccache;
char * principal;
+ cc_uint32 header_len = msg->header_len;
+ cc_uint32 principal_offset;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_get_principal_t))
+ if (header_len != sizeof(ccmsg_ccache_get_principal_t))
return ccErrBadParam;
- code = cci_serv_find_ccache_by_handle(ctx, header->ccache, &ccache);
+ code = ccs_serv_find_ccache_by_handle(ctx, ntohll(header->ccache), &ccache);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
- code = cci_ccache_get_principal(ccache, header->version, &principal);
+ code = ccs_ccache_get_principal(ccache, ntohl(header->version), &principal);
if (code != ccNoError)
- return cci_serv_make_nack(code, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(code, auth_info, session_info, resp_msg);
code = cci_msg_new(ccmsg_ACK, resp_msg);
if (code != ccNoError)
if (resp_header == NULL)
return ccErrNoMem;
- code = cci_msg_add_data_blob(*resp_msg, principal, strlen(principal) + 1, &resp_header->principal_offset);
+ code = cci_msg_add_data_blob(*resp_msg, principal, strlen(principal) + 1, &principal_offset);
+ if (code == 0) {
+ resp_header->principal_len = htonl(strlen(principal) + 1);
+ resp_header->principal_offset = htonl(principal_offset);
+ }
cci_msg_add_header(*resp_msg, resp_header, sizeof(ccmsg_ccache_get_principal_resp_t));
return ccNoError;
ccmsg_ccache_set_principal_t* header = (ccmsg_ccache_set_principal_t*)msg->header;
cc_server_ccache_t* ccache;
char *principal;
+ cc_uint32 header_len = msg->header_len;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_set_principal_t))
+ if (header_len != sizeof(ccmsg_ccache_set_principal_t))
return ccErrBadParam;
- code = cci_serv_find_ccache_by_handle(ctx, header->ccache, &ccache);
+ code = ccs_serv_find_ccache_by_handle(ctx, ntohll(header->ccache), &ccache);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
- code = cci_msg_retrieve_blob(msg, header->principal_offset, header->principal_len, &principal);
+ code = cci_msg_retrieve_blob(msg, ntohl(header->principal_offset), ntohl(header->principal_len), &principal);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrBadParam, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrBadParam, auth_info, session_info, resp_msg);
- code = cci_ccache_set_principal(ccache, header->version, principal);
+ code = ccs_ccache_set_principal(ccache, ntohl(header->version), principal);
if (code != ccNoError)
- return cci_serv_make_nack(code, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(code, auth_info, session_info, resp_msg);
- return cci_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
+ return ccs_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
}
cc_int32
-ccop_CCACHE_CREDS_ITERATOR(cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg, cc_msg_t **resp_msg)
+ccop_CCACHE_NEW_CREDS_ITERATOR( cc_server_context_t* ctx,
+ cc_auth_info_t* auth_info,
+ cc_session_info_t* session_info,
+ cc_msg_t *msg, cc_msg_t **resp_msg)
{
cc_server_ccache_t* ccache;
cc_credentials_iterate_t* creds_iterator;
ccmsg_ccache_creds_iterator_t* header = (ccmsg_ccache_creds_iterator_t*)msg->header;
ccmsg_ccache_creds_iterator_resp_t* resp_header;
+ cc_uint32 header_len = msg->header_len;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_creds_iterator_t))
+ if (header_len != sizeof(ccmsg_ccache_creds_iterator_t))
return ccErrBadParam;
- code = cci_serv_find_ccache_by_handle(ctx, header->ccache, &ccache);
+ code = ccs_serv_find_ccache_by_handle(ctx, ntohll(header->ccache), &ccache);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
- code = cci_ccache_new_iterator(ccache, &creds_iterator);
+ code = ccs_ccache_new_iterator(ccache, &creds_iterator);
if (code != ccNoError)
return code;
if (resp_header == NULL)
return ccErrNoMem;
- resp_header->iterator = creds_iterator;
- return cci_serv_make_ack(resp_header, sizeof(ccmsg_ccache_creds_iterator_resp_t), auth_info, session_info, resp_msg);
+ resp_header->iterator = htonll((cc_handle) creds_iterator);
+ return ccs_serv_make_ack(resp_header, sizeof(ccmsg_ccache_creds_iterator_resp_t), auth_info, session_info, resp_msg);
}
static cc_int32
-cci_credentials_union_release( cc_credentials_union * creds )
+ccs_credentials_union_release( cc_credentials_union * creds )
{
int i;
cc_server_ccache_t* ccache;
char *flat_creds;
cc_credentials_union *creds;
+ cc_uint32 header_len = msg->header_len;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_store_creds_t))
+ if (header_len != sizeof(ccmsg_ccache_store_creds_t))
return ccErrBadParam;
- code = cci_serv_find_ccache_by_handle(ctx, header->ccache, &ccache);
+ code = ccs_serv_find_ccache_by_handle(ctx, ntohll(header->ccache), &ccache);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
- // TODO: This code is too simplistic. cc_credential_unions are not flat
- // structures and must be flattened. That means that although we can
- // store a flat blob in the message we will need to decode the blob
- // into the actual object.
- code = cci_msg_retrieve_blob(msg, header->creds_offset, header->creds_len, &flat_creds);
+ code = cci_msg_retrieve_blob(msg, ntohl(header->creds_offset), ntohl(header->creds_len), &flat_creds);
if (code != ccNoError)
- return cci_serv_make_nack(code, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(code, auth_info, session_info, resp_msg);
creds = (cc_credentials_union *)malloc(sizeof(cc_credentials_union));
if ( creds == NULL )
switch ( creds->version ) {
case cc_credentials_v4:
- code = cci_creds_v4_unmarshall(flat_creds, header->creds_len, creds);
+ code = cci_creds_v4_unmarshall(flat_creds, ntohl(header->creds_len), creds);
break;
case cc_credentials_v5:
- code = cci_creds_v5_unmarshall(flat_creds, header->creds_len, creds);
+ code = cci_creds_v5_unmarshall(flat_creds, ntohl(header->creds_len), creds);
break;
default:
- return cci_serv_make_nack(ccErrBadCredentialsVersion, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrBadCredentialsVersion, auth_info, session_info, resp_msg);
}
if (code != ccNoError)
- return cci_serv_make_nack(code, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(code, auth_info, session_info, resp_msg);
- code = cci_ccache_store_creds(ccache, creds);
- cci_credentials_union_release(creds);
+ code = ccs_ccache_store_creds(ccache, creds);
+ ccs_credentials_union_release(creds);
if (code != ccNoError) {
- return cci_serv_make_nack(code, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(code, auth_info, session_info, resp_msg);
}
- return cci_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
+ return ccs_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
}
cc_int32
ccmsg_ccache_rem_creds_t* header = (ccmsg_ccache_rem_creds_t*)msg->header;
cc_server_ccache_t* ccache;
cc_credentials_union *creds;
+ cc_uint32 header_len = msg->header_len;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_rem_creds_t))
+ if (header_len != sizeof(ccmsg_ccache_rem_creds_t))
return ccErrBadParam;
- code = cci_serv_find_ccache_by_handle(ctx, header->ccache, &ccache);
+ code = ccs_serv_find_ccache_by_handle(ctx, ntohll(header->ccache), &ccache);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
- code = cci_ccache_rem_creds(ccache, header->creds);
+ code = ccs_ccache_rem_creds(ccache, (const cc_credentials_union *)(ntohll(header->creds)));
if (code != ccNoError)
- return cci_serv_make_nack(code, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(code, auth_info, session_info, resp_msg);
- return cci_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
+ return ccs_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
}
cc_int32
cc_msg_t *msg, cc_msg_t **resp_msg)
{
// TODO
- return cci_serv_make_nack(ccErrNotImplemented, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrNotImplemented, auth_info, session_info, resp_msg);
}
cc_int32
cc_msg_t *msg, cc_msg_t **resp_msg)
{
// TODO
- return cci_serv_make_nack(ccErrNotImplemented, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrNotImplemented, auth_info, session_info, resp_msg);
}
cc_int32
cc_msg_t *msg, cc_msg_t **resp_msg)
{
// TODO
- return cci_serv_make_nack(ccErrNotImplemented, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrNotImplemented, auth_info, session_info, resp_msg);
}
ccmsg_ccache_get_last_default_time_t* header = (ccmsg_ccache_get_last_default_time_t*)msg->header;
ccmsg_ccache_get_last_default_time_resp_t* resp_header;
cc_server_ccache_t* ccache;
+ cc_uint32 header_len = msg->header_len;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_get_last_default_time_t))
+ if (header_len != sizeof(ccmsg_ccache_get_last_default_time_t))
return ccErrBadParam;
- code = cci_serv_find_ccache_by_handle(ctx, header->ccache, &ccache);
+ code = ccs_serv_find_ccache_by_handle(ctx, ntohll(header->ccache), &ccache);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
resp_header = (ccmsg_ccache_get_last_default_time_resp_t*)malloc(sizeof(ccmsg_ccache_get_last_default_time_resp_t));
if (resp_header == NULL)
return ccErrNoMem;
- resp_header->last_default_time = ccache->last_default;
- return cci_serv_make_ack(resp_header, sizeof(ccmsg_ccache_get_last_default_time_resp_t), auth_info, session_info, resp_msg);
+ resp_header->last_default_time = htonll(ccache->last_default);
+ return ccs_serv_make_ack(resp_header, sizeof(ccmsg_ccache_get_last_default_time_resp_t), auth_info, session_info, resp_msg);
}
cc_int32
ccmsg_ccache_get_change_time_resp_t* resp_header;
ccmsg_ccache_get_change_time_t *header = (ccmsg_ccache_get_change_time_t *)msg->header;
cc_server_ccache_t* ccache = (cc_server_ccache_t *)header->ccache;
+ cc_uint32 header_len = msg->header_len;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_get_change_time_t)) {
+ if (header_len != sizeof(ccmsg_ccache_get_change_time_t)) {
return ccErrBadParam;
}
return ccErrNoMem;
}
- resp_header->time = ccache->changed;
- return cci_serv_make_ack(resp_header, sizeof(ccmsg_ccache_get_change_time_resp_t), auth_info, session_info, resp_msg);
+ resp_header->time = htonll(ccache->changed);
+ return ccs_serv_make_ack(resp_header, sizeof(ccmsg_ccache_get_change_time_resp_t), auth_info, session_info, resp_msg);
}
cc_int32
ccmsg_ccache_compare_t* header = (ccmsg_ccache_compare_t*)msg->header;
ccmsg_ccache_compare_resp_t* resp_header;
cc_server_ccache_t* ccache1, *ccache2;
+ cc_uint32 header_len = msg->header_len;
+ cc_uint32 is_equal;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_compare_t))
+ if (header_len != sizeof(ccmsg_ccache_compare_t))
return ccErrBadParam;
- code = cci_serv_find_ccache_by_handle(ctx, header->ccache1, &ccache1);
+ code = ccs_serv_find_ccache_by_handle(ctx, ntohll(header->ccache1), &ccache1);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
- code = cci_serv_find_ccache_by_handle(ctx, header->ccache2, &ccache2);
+ code = ccs_serv_find_ccache_by_handle(ctx, ntohll(header->ccache2), &ccache2);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
resp_header = (ccmsg_ccache_compare_resp_t*)malloc(sizeof(ccmsg_ccache_compare_resp_t));
if (resp_header == NULL)
return ccErrNoMem;
- cci_ccache_compare(ccache1, ccache2, &resp_header->is_equal);
- return cci_serv_make_ack(resp_header, sizeof(ccmsg_ccache_compare_resp_t), auth_info, session_info, resp_msg);
+ ccs_ccache_compare(ccache1, ccache2, &is_equal);
+ resp_header->is_equal = htonl(is_equal);
+ return ccs_serv_make_ack(resp_header, sizeof(ccmsg_ccache_compare_resp_t), auth_info, session_info, resp_msg);
}
cc_int32
ccmsg_ccache_get_kdc_time_offset_t* header = (ccmsg_ccache_get_kdc_time_offset_t*)msg->header;
ccmsg_ccache_get_kdc_time_offset_resp_t* resp_header;
cc_server_ccache_t* ccache;
- cc_time_t offset;
+ cc_time64 offset;
+ cc_uint32 header_len = msg->header_len;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_get_kdc_time_offset_t))
+ if (header_len != sizeof(ccmsg_ccache_get_kdc_time_offset_t))
return ccErrBadParam;
- code = cci_serv_find_ccache_by_handle(ctx, header->ccache, &ccache);
+ code = ccs_serv_find_ccache_by_handle(ctx, ntohll(header->ccache), &ccache);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
// TODO How is the header->creds_version supposed to be used?
- code = cci_ccache_get_kdc_time_offset(ccache, &offset);
+ code = ccs_ccache_get_kdc_time_offset(ccache, &offset);
if (code != ccNoError)
- return cci_serv_make_nack(code, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(code, auth_info, session_info, resp_msg);
resp_header = (ccmsg_ccache_get_kdc_time_offset_resp_t*)malloc(sizeof(ccmsg_ccache_get_kdc_time_offset_resp_t));
if (resp_header == NULL)
return ccErrNoMem;
- resp_header->offset = offset;
- return cci_serv_make_ack(resp_header, sizeof(ccmsg_ccache_get_kdc_time_offset_resp_t), auth_info, session_info, resp_msg);
+ resp_header->offset = htonll(offset);
+ return ccs_serv_make_ack(resp_header, sizeof(ccmsg_ccache_get_kdc_time_offset_resp_t), auth_info, session_info, resp_msg);
}
cc_int32
{
ccmsg_ccache_set_kdc_time_offset_t* header = (ccmsg_ccache_set_kdc_time_offset_t*)msg->header;
cc_server_ccache_t* ccache;
+ cc_uint32 header_len = msg->header_len;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_set_kdc_time_offset_t))
+ if (header_len != sizeof(ccmsg_ccache_set_kdc_time_offset_t))
return ccErrBadParam;
- code = cci_serv_find_ccache_by_handle(ctx, header->ccache, &ccache);
+ code = ccs_serv_find_ccache_by_handle(ctx, ntohll(header->ccache), &ccache);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
// TODO How is the header->creds_version supposed to be used?
- cci_ccache_set_kdc_time_offset(ccache, header->offset);
- return cci_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
+ ccs_ccache_set_kdc_time_offset(ccache, htonll(header->offset));
+ return ccs_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
}
cc_int32
{
ccmsg_ccache_clear_kdc_time_offset_t* header = (ccmsg_ccache_clear_kdc_time_offset_t*)msg->header;
cc_server_ccache_t* ccache;
+ cc_uint32 header_len = msg->header_len;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_clear_kdc_time_offset_t))
+ if (header_len != sizeof(ccmsg_ccache_clear_kdc_time_offset_t))
return ccErrBadParam;
- code = cci_serv_find_ccache_by_handle(ctx, header->ccache, &ccache);
+ code = ccs_serv_find_ccache_by_handle(ctx, ntohll(header->ccache), &ccache);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
// TODO How is the header->creds_version supposed to be used?
- cci_ccache_clear_kdc_time_offset(ccache);
- return cci_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
+ ccs_ccache_clear_kdc_time_offset(ccache);
+ return ccs_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
}
cc_int32
{
cc_generic_list_node_t* gen_node;
ccmsg_ccache_iterator_release_t* header = (ccmsg_ccache_iterator_release_t*)msg->header;
+ cc_uint32 header_len = msg->header_len;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_iterator_release_t))
+ if (header_len != sizeof(ccmsg_ccache_iterator_release_t))
return ccErrBadParam;
- code = cci_serv_find_ccache_iterator_by_handle(ctx, header->iterator, &gen_node);
+ code = ccs_serv_find_ccache_iterator_by_handle(ctx, ntohll(header->iterator), &gen_node);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrBadParam, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrBadParam, auth_info, session_info, resp_msg);
code = cci_generic_list_remove_element(ctx->active_iterators, gen_node);
if (code != ccNoError)
- return cci_serv_make_nack(code, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(code, auth_info, session_info, resp_msg);
- return cci_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
+ return ccs_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
}
+cc_int32
+ccop_CCACHE_ITERATOR_CLONE( cc_server_context_t* ctx,
+ cc_auth_info_t* auth_info,
+ cc_session_info_t* session_info,
+ cc_msg_t *msg, cc_msg_t **resp_msg)
+{
+ // TODO
+ return ccs_serv_make_nack(ccErrNotImplemented, auth_info, session_info, resp_msg);
+}
+
cc_int32
ccop_CCACHE_ITERATOR_NEXT(cc_server_context_t* ctx,
cc_auth_info_t* auth_info,
ccmsg_ccache_iterator_next_resp_t* resp_header;
cc_generic_list_node_t* gen_node;
cc_ccache_iterate_t* ccache_iterator;
- cc_ccache_list_node_t *ccache_node;
+ cc_ccache_list_node_t *ccache_node;
+ cc_uint32 header_len = msg->header_len;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_ccache_iterator_next_t))
+ if (header_len != sizeof(ccmsg_ccache_iterator_next_t))
return ccErrBadParam;
- code = cci_serv_find_ccache_iterator_by_handle(ctx, header->iterator, &gen_node);
+ code = ccs_serv_find_ccache_iterator_by_handle(ctx, ntohll(header->iterator), &gen_node);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrBadParam, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrBadParam, auth_info, session_info, resp_msg);
ccache_iterator = (cc_ccache_iterate_t*)gen_node->data;
- if (cci_ccache_iterate_has_next(ccache_iterator)) {
+ if (ccs_ccache_iterate_has_next(ccache_iterator)) {
resp_header = (ccmsg_ccache_iterator_next_resp_t*)malloc(sizeof(ccmsg_ccache_iterator_next_resp_t));
if (resp_header == NULL)
return ccErrNoMem;
- code = cci_ccache_iterate_next(ccache_iterator, &ccache_node);
+ code = ccs_ccache_iterate_next(ccache_iterator, &ccache_node);
if (code != ccNoError)
- return cci_serv_make_nack(code, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(code, auth_info, session_info, resp_msg);
- resp_header->ccache = ccache_node;
- return cci_serv_make_ack(resp_header, sizeof(ccmsg_ccache_iterator_next_resp_t), auth_info, session_info, resp_msg);
+ resp_header->ccache = htonll((cc_handle) ccache_node);
+ return ccs_serv_make_ack(resp_header, sizeof(ccmsg_ccache_iterator_next_resp_t), auth_info, session_info, resp_msg);
} else {
- return cci_serv_make_nack(ccIteratorEnd, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccIteratorEnd, auth_info, session_info, resp_msg);
}
}
cc_generic_list_node_t* gen_node;
cc_server_ccache_t* ccache;
ccmsg_creds_iterator_release_t* header = (ccmsg_creds_iterator_release_t*)msg->header;
+ cc_uint32 header_len = msg->header_len;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_creds_iterator_release_t))
+ if (header_len != sizeof(ccmsg_creds_iterator_release_t))
return ccErrBadParam;
- code = cci_serv_find_ccache_by_handle(ctx, header->ccache, &ccache);
+ code = ccs_serv_find_ccache_by_handle(ctx, ntohll(header->ccache), &ccache);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
- code = cci_serv_find_creds_iterator_by_handle(ccache, header->iterator, &gen_node);
+ code = ccs_serv_find_creds_iterator_by_handle(ccache, ntohll(header->iterator), &gen_node);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrBadParam, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrBadParam, auth_info, session_info, resp_msg);
code = cci_generic_list_remove_element(ccache->active_iterators, gen_node);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrBadParam, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrBadParam, auth_info, session_info, resp_msg);
- return cci_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
+ return ccs_serv_make_ack(NULL, 0, auth_info, session_info, resp_msg);
}
+cc_int32
+ccop_CREDS_ITERATOR_CLONE( cc_server_context_t* ctx,
+ cc_auth_info_t* auth_info,
+ cc_session_info_t* session_info,
+ cc_msg_t *msg, cc_msg_t **resp_msg)
+{
+ // TODO
+ return ccs_serv_make_nack(ccErrNotImplemented, auth_info, session_info, resp_msg);
+}
+
+
cc_int32
ccop_CREDS_ITERATOR_NEXT(cc_server_context_t* ctx,
cc_auth_info_t* auth_info,
cc_server_ccache_t* ccache;
cc_server_credentials_t* stored_creds;
cc_credentials_union *creds_union;
+ cc_uint32 header_len = msg->header_len;
cc_int32 code;
*resp_msg = 0;
- if (msg->header_len != sizeof(ccmsg_creds_iterator_next_t))
+ if (header_len != sizeof(ccmsg_creds_iterator_next_t))
return ccErrBadParam;
- code = cci_serv_find_ccache_by_handle(ctx, header->ccache, &ccache);
+ code = ccs_serv_find_ccache_by_handle(ctx, ntohll(header->ccache), &ccache);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrCCacheNotFound, auth_info, session_info, resp_msg);
- code = cci_serv_find_creds_iterator_by_handle(ccache, header->iterator, &gen_node);
+ code = ccs_serv_find_creds_iterator_by_handle(ccache, ntohll(header->iterator), &gen_node);
if (code != ccNoError)
- return cci_serv_make_nack(ccErrBadParam, auth_info, session_info, resp_msg);
+ return ccs_serv_make_nack(ccErrBadParam, auth_info, session_info, resp_msg);
creds_iterator = (cc_credentials_iterate_t*)gen_node->data;
- if (cci_credentials_iterate_has_next(creds_iterator)) {
+ if (ccs_credentials_iterate_has_next(creds_iterator)) {
code = cci_msg_new(ccmsg_ACK, resp_msg);
if (code != ccNoError)
return code;
if (resp_header == NULL)
return ccErrNoMem;
- code = cci_credentials_iterate_next(creds_iterator, &creds_node);
+ code = ccs_credentials_iterate_next(creds_iterator, &creds_node);
stored_creds = (cc_server_credentials_t*)creds_node->data;
creds_union = &stored_creds->creds;
code = cci_msg_add_data_blob(*resp_msg, creds_union, sizeof(cc_credentials_union), &resp_header->creds_offset);
code = cci_msg_add_header(*resp_msg, resp_header, sizeof(ccmsg_creds_iterator_next_resp_t));
} else {
- cci_serv_make_nack(ccIteratorEnd, auth_info, session_info, resp_msg);
+ ccs_serv_make_nack(ccIteratorEnd, auth_info, session_info, resp_msg);
}
return ccNoError;
}
cc_msg_t *msg, cc_msg_t **resp_msg)
{
- cci_serv_make_nack(ccErrNotImplemented, auth_info, session_info, resp_msg);
+ ccs_serv_make_nack(ccErrNotImplemented, auth_info, session_info, resp_msg);
return ccNoError;
}
+++ /dev/null
-/* $Copyright:
- *
- * Copyright 2004 by the Massachusetts Institute of Technology.
- *
- * All rights reserved.
- *
- * Export of this software from the United States of America may require a
- * specific license from the United States Government. It is the
- * responsibility of any person or organization contemplating export to
- * obtain such a license before exporting.
- *
- * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and distribute
- * this software and its documentation for any purpose and without fee is
- * hereby granted, provided that the above copyright notice appear in all
- * copies and that both that copyright notice and this permission notice
- * appear in supporting documentation, and that the name of M.I.T. not be
- * used in advertising or publicity pertaining to distribution of the
- * software without specific, written prior permission. Furthermore if you
- * modify this software you must label your software as modified software
- * and not distribute it in such a fashion that it might be confused with
- * the original MIT software. M.I.T. makes no representations about the
- * suitability of this software for any purpose. It is provided "as is"
- * without express or implied warranty.
- *
- * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
- * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- *
- * Individual source code files are copyright MIT, Cygnus Support,
- * OpenVision, Oracle, Sun Soft, FundsXpress, and others.
- *
- * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira,
- * and Zephyr are trademarks of the Massachusetts Institute of Technology
- * (MIT). No commercial use of these trademarks may be made without prior
- * written permission of MIT.
- *
- * "Commercial use" means use of a name in a product or other for-profit
- * manner. It does NOT prevent a commercial firm from referring to the MIT
- * trademarks in order to convey information (although in doing so,
- * recognition of their trademark status should be given).
- * $
- */
-
-/*
- * Prototypes for serv_ops.c
- */
-
-#ifndef __SERV_OPS_H__
-#define __SERV_OPS_H__
-
-#include "CredentialsCache.h"
-#include "rpc_auth.h"
-#include "msg.h"
-#include "datastore.h"
-
-struct type_to_op_mapping_t {
- cc_int32 (*operations[CC_MSG_MAX_TYPE]) (
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-};
-typedef struct type_to_op_mapping_t type_to_op_mapping_t;
-
-cc_int32 cci_serv_initialize(void);
-cc_int32 cci_serv_process_msg(cc_msg_t * msg, cc_auth_info_t* auth_info, cc_session_info_t* session_info, cc_msg_t** resp_msg);
-cc_int32 cci_serv_find_ctx(cc_auth_info_t* auth_info, cc_session_info_t* session_info, cc_server_context_t** contextp);
-cc_int32 cci_serv_find_ctx_by_handle(cc_handle ctx_handle, cc_auth_info_t *auth, cc_session_info_t* session, cc_server_context_t** contextp);
-cc_int32 cci_serv_find_ccache_by_handle(cc_server_context_t* ctx, cc_handle ccache_handle, cc_server_ccache_t** ccachep) ;
-cc_int32 cci_serv_find_ccache_iterator_by_handle(cc_server_context_t* ctx, cc_handle iterator, cc_generic_list_node_t** nodep);
-cc_int32 cci_serv_find_creds_iterator_by_handle(cc_server_ccache_t* ccache, cc_handle iterator, cc_generic_list_node_t** nodep);
-cc_int32 cci_serv_make_nack(cc_int32 err_code, cc_auth_info_t* auth_info, cc_session_info_t* session_info, cc_msg_t** msgp);
-cc_int32 cci_serv_make_ack(void * header, cc_int32 header_len, cc_auth_info_t* auth_info, cc_session_info_t* session_info, cc_msg_t** msgp);
-
-cc_int32 ccop_INIT(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CTX_RELEASE(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CTX_GET_CHANGE_TIME(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CTX_GET_DEFAULT_CCACHE_NAME(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CTX_COMPARE(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CTX_NEW_CCACHE_ITERATOR(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32
-ccop_CTX_LOCK( cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32
-ccop_CTX_UNLOCK( cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32
-ccop_CTX_CLONE( cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CCACHE_OPEN(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CCACHE_OPEN_DEFAULT(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CCACHE_CREATE(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32
-ccop_CCACHE_CREATE_DEFAULT( cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32
-ccop_CCACHE_CREATE_UNIQUE( cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CCACHE_RELEASE(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CCACHE_DESTROY(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CCACHE_SET_DEFAULT(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CCACHE_GET_CREDS_VERSION(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CCACHE_GET_NAME(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CCACHE_GET_PRINCIPAL(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CCACHE_SET_PRINCIPAL(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CCACHE_CREDS_ITERATOR(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CCACHE_STORE_CREDS(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CCACHE_REM_CREDS(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CCACHE_GET_LAST_DEFAULT_TIME(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32
-ccop_CCACHE_GET_CHANGE_TIME(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg) ;
-
-cc_int32 ccop_CCACHE_COMPARE(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CCACHE_GET_KDC_TIME_OFFSET(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CCACHE_SET_KDC_TIME_OFFSET(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CCACHE_CLEAR_KDC_TIME_OFFSET(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CCACHE_ITERATOR_RELEASE(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CCACHE_ITERATOR_NEXT(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CREDS_ITERATOR_RELEASE(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CREDS_ITERATOR_NEXT(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-
-cc_int32 ccop_CREDS_RELEASE(
- cc_server_context_t* ctx,
- cc_auth_info_t* auth_info,
- cc_session_info_t* session_info,
- cc_msg_t *msg,
- cc_msg_t **resp_msg);
-#endif /*__SERV_OPS_H__*/
--- /dev/null
+!include <win32.mak>\r
+\r
+CFLAGS = -I../include $(cdebug) $(cflags) $(cvarsmt)\r
+\r
+WINLIBS = ws2_32.lib rpcrt4.lib $(guilibsdll)\r
+\r
+T_CCACHE = t_ccache.exe\r
+\r
+T_CONTEXT = t_context.exe\r
+\r
+T_LISTS = t_lists.exe\r
+\r
+T_MSG = t_msg.exe\r
+\r
+T_SERVER = t_server.exe\r
+\r
+T_CCAPI = t_ccapi.exe\r
+\r
+all: $(T_CCAPI) $(T_CCACHE) $(T_CONTEXT) $(T_LISTS) $(T_MSG) $(T_SERVER)\r
+\r
+ntccrpc_c.c ntccrpc_s.c ntccrpc.h: ntccrpc.idl ntccrpc.acf\r
+ midl ntccrpc.idl /acf ntccrpc.acf\r
+\r
+CC_CLIENT_LIB = ..\client\cc_client.lib\r
+\r
+CC_COMMON_LIB = ..\common\cc_common.lib\r
+\r
+CC_SERVER_LIB = ..\server\cc_server.lib\r
+\r
+CC_API_LIB = ..\windows\krbcc32.lib\r
+\r
+$(T_CCACHE): t_ccache.obj $(CC_SERVER_LIB) $(CC_COMMON_LIB)\r
+ $(link) /NOLOGO $(conlibsmt) $(ldebug) $(conlflags) /OUT:$@ $** $(WINLIBS)\r
+\r
+$(T_CONTEXT): t_context.obj $(CC_SERVER_LIB) $(CC_COMMON_LIB)\r
+ $(link) /NOLOGO $(conlibsmt) $(ldebug) $(conlflags) /OUT:$@ $** $(WINLIBS)\r
+\r
+$(T_LISTS): t_lists.obj $(CC_SERVER_LIB) $(CC_COMMON_LIB)\r
+ $(link) /NOLOGO $(conlibsmt) $(ldebug) $(conlflags) /OUT:$@ $** $(WINLIBS)\r
+\r
+$(T_MSG): t_msg.obj $(CC_SERVER_LIB) $(CC_COMMON_LIB)\r
+ $(link) /NOLOGO $(conlibsmt) $(ldebug) $(conlflags) /OUT:$@ $** $(WINLIBS)\r
+\r
+$(T_SERVER): t_server.obj $(CC_SERVER_LIB) $(CC_COMMON_LIB)\r
+ $(link) /NOLOGO $(conlibsmt) $(ldebug) $(conlflags) /OUT:$@ $** $(WINLIBS)\r
+\r
+$(T_CCAPI): t_ccapi.obj $(CC_API_LIB)\r
+ $(link) /NOLOGO $(conlibsmt) $(ldebug) $(conlflags) /OUT:$@ $** $(WINLIBS)\r
+\r
+clean:\r
+ del *.exe *.dll *.lib *.exp *.obj ntccrpc_c.c ntccrpc_s.c ntccrpc.h\r
+\r
+\r
int i;
cc_int32 code;
- code = cci_ccache_new("The first", p1, cc_credentials_v4_v5, &c1);
- code = cci_ccache_new("The 2nd", p2, cc_credentials_v4_v5, &c2);
+ code = ccs_ccache_new("The first", p1, cc_credentials_v4_v5, &c1);
+ code = ccs_ccache_new("The 2nd", p2, cc_credentials_v4_v5, &c2);
cred1 = (cc_server_credentials_t*)malloc(sizeof(cc_server_credentials_t));
memset(cred1,0,sizeof(cc_server_credentials_t));
strncpy(cred2->creds.credentials.credentials_v4->principal, p1, strlen(p1));
cred3->creds.credentials.credentials_v5->client = p1;
- code = cci_ccache_store_creds(c1, &cred1->creds);
+ code = ccs_ccache_store_creds(c1, &cred1->creds);
printf("(c1, cred1) -> %d\n",code);
- code = cci_ccache_store_creds(c1, &cred2->creds);
+ code = ccs_ccache_store_creds(c1, &cred2->creds);
printf("(c1, cred2) -> %d\n",code);
- code = cci_ccache_store_creds(c2, &cred3->creds);
+ code = ccs_ccache_store_creds(c2, &cred3->creds);
printf("(c2, cred3) -> %d\n",code);
- code = cci_ccache_store_creds(c1, &cred3->creds);
+ code = ccs_ccache_store_creds(c1, &cred3->creds);
printf("(c1, cred3) -> %d\n",code);
i = 0;
- code = cci_ccache_move(c1, c2);
- code = cci_ccache_destroy(c1);
- code = cci_ccache_new_iterator(c2, &iterator);
- while (cci_credentials_iterate_has_next(iterator)) {
+ code = ccs_ccache_move(c1, c2);
+ code = ccs_ccache_destroy(c1);
+ code = ccs_ccache_new_iterator(c2, &iterator);
+ while (ccs_credentials_iterate_has_next(iterator)) {
i++;
- code = cci_credentials_iterate_next(iterator, &node);
+ code = ccs_credentials_iterate_next(iterator, &node);
stored_cred = (cc_server_credentials_t *)node->data;
printf("%d %d %s\n", stored_cred->is_default, stored_cred->creds.version, stored_cred->creds.credentials.credentials_v4->principal);
if (i == 1) {
- code = cci_ccache_rem_creds(c2,&cred2->creds);
+ code = ccs_ccache_rem_creds(c2,&cred2->creds);
printf("(c2 rem cred2) -> %d\n",code);
}
}
int i;
cc_int32 code;
- code = cci_context_new(5, auth_info, session_info, &ctx);
- code = cci_context_create_default_ccache(ctx, cc_credentials_v4, "Spike", &ccache);
- code = cci_context_get_default_ccache_name(ctx, &name);
- code = cci_context_open_ccache(ctx, name, &ccache);
+ code = ccs_context_new(5, auth_info, session_info, &ctx);
+ code = ccs_context_create_default_ccache(ctx, cc_credentials_v4, "Spike", &ccache);
+ code = ccs_context_get_default_ccache_name(ctx, &name);
+ code = ccs_context_open_ccache(ctx, name, &ccache);
for (i = 0; i < 5; i++) {
creds = (cc_credentials_union*)malloc(sizeof(cc_credentials_union));
creds->credentials.credentials_v4 = (cc_credentials_v4_t*)malloc(sizeof(cc_credentials_v4_t));
strcpy(creds->credentials.credentials_v4->principal, "Spike");
- code = cci_ccache_store_creds(ccache, creds);
+ code = ccs_ccache_store_creds(ccache, creds);
}
- code = cci_context_create_ccache(ctx, "ccache 2", cc_credentials_v4, "Jeff", &ccache);
- code = cci_context_open_ccache(ctx, "ccache 2", &ccache);
+ code = ccs_context_create_ccache(ctx, "ccache 2", cc_credentials_v4_v5, "Jeff", &ccache);
+ code = ccs_context_open_ccache(ctx, "ccache 2", &ccache);
for (i = 0; i < 5; i++) {
creds = (cc_credentials_union*)malloc(sizeof(cc_credentials_union));
- creds->version = cc_credentials_v4;
- creds->credentials.credentials_v4 = (cc_credentials_v4_t*)malloc(sizeof(cc_credentials_v4_t));
- strcpy(creds->credentials.credentials_v4->principal, "Jeff");
+ creds->version = cc_credentials_v5;
+ creds->credentials.credentials_v5 = (cc_credentials_v5_t*)malloc(sizeof(cc_credentials_v5_t));
+ strcpy(creds->credentials.credentials_v5->principal, "Jeff");
- cci_ccache_store_creds(ccache, creds);
+ ccs_ccache_store_creds(ccache, creds);
}
- code = cci_context_ccache_iterator(ctx, &ccache_iterator);
- while (cci_ccache_iterate_has_next(ccache_iterator)) {
- code = cci_ccache_iterate_next(ccache_iterator, &ccache_node);
+ code = ccs_context_ccache_iterator(ctx, &ccache_iterator);
+ while (ccs_ccache_iterate_has_next(ccache_iterator)) {
+ code = ccs_ccache_iterate_next(ccache_iterator, &ccache_node);
ccache = (cc_server_ccache_t *)ccache_node->data;
printf("%x for %s %s default = %d v %d\n",
ccache, ccache->principal_v4, ccache->principal_v5,
ccache->is_default, ccache->versions);
- code = cci_ccache_new_iterator(ccache, &creds_iterator);
- while (cci_credentials_iterate_has_next(creds_iterator)) {
- code = cci_credentials_iterate_next(creds_iterator, &creds_node);
+ code = ccs_ccache_new_iterator(ccache, &creds_iterator);
+ while (ccs_credentials_iterate_has_next(creds_iterator)) {
+ code = ccs_credentials_iterate_next(creds_iterator, &creds_node);
server_creds = (cc_server_credentials_t *)creds_node->data;
printf("\t%s %d\n",
server_creds->creds.credentials.credentials_v4->principal,
cc_session_info_t * session_info;
cc_int32 code;
- if ( cci_serv_initialize() != ccNoError )
+ if ( ccs_serv_initialize() != ccNoError )
return 1;
while ( 1 ) {
code = obtain_session_info(&session_info);
/* process message */
- code = cci_serv_process_msg(msg, auth_info, session_info, &resp);
+ code = ccs_serv_process_msg(msg, auth_info, session_info, &resp);
/* flatten response */
code = cci_msg_flatten(resp, NULL);
--- /dev/null
+!include <win32.mak>\r
+\r
+CFLAGS = -I../include $(cdebug) $(cflags) $(cvarsmt)\r
+\r
+CCAPI_SERVER = ccapi_server.exe\r
+\r
+CCAPI_DLLFILE = krbcc32.dll\r
+\r
+WINLIBS = ws2_32.lib rpcrt4.lib $(guilibsdll)\r
+\r
+all: $(CCAPI_DLLFILE) $(CCAPI_SERVER)\r
+\r
+ntccrpc_c.c ntccrpc_s.c ntccrpc.h: ntccrpc.idl ntccrpc.acf\r
+ midl ntccrpc.idl /acf ntccrpc.acf\r
+\r
+CLIENT_OBJS = ntccrpc_c.obj client.obj dllmain.obj\r
+\r
+SERVER_OBJS = ntccrpc_s.obj server.obj\r
+\r
+CC_CLIENT_LIB = ..\client\cc_client.lib\r
+\r
+CC_COMMON_LIB = ..\common\cc_common.lib\r
+\r
+CC_SERVER_LIB = ..\server\cc_server.lib\r
+\r
+$(CCAPI_DLLFILE): $(CLIENT_OBJS) $(CC_CLIENT_LIB) $(CC_COMMON_LIB)\r
+ $(link) /NOLOGO /OUT:$@ $(ldebug) $(dlllflags) $(guilibsmt) -def:cacheapi.def $** $(WINLIBS)\r
+\r
+$(CCAPI_SERVER): $(SERVER_OBJS) $(CC_SERVER_LIB) $(CC_COMMON_LIB)\r
+ $(link) /NOLOGO $(conlibsmt) $(ldebug) $(conlflags) /OUT:$@ $** $(WINLIBS)\r
+\r
+clean:\r
+ del *.exe *.dll *.lib *.exp *.obj ntccrpc_c.c ntccrpc_s.c ntccrpc.h\r
+\r
+\r
--- /dev/null
+EXPORTS\r
+ ; ccapi v3 only exports one function\r
+ cc_initialize @14\r
+\r
+ ; ccapi v2 compatibility functions\r
+ cc_close @2\r
+ cc_create @3\r
+ cc_destroy @4\r
+ cc_free_NC_info @5\r
+ cc_free_creds @6\r
+ cc_free_name @7\r
+ cc_free_principal @8\r
+ cc_get_NC_info @9\r
+ cc_get_change_time @10\r
+ cc_get_cred_version @11\r
+ cc_get_name @12\r
+ cc_get_principal @13\r
+ cc_lock_request @15\r
+ cc_open @16\r
+ cc_remove_cred @17\r
+ cc_seq_fetch_NCs_begin @18\r
+ cc_seq_fetch_NCs_end @19\r
+ cc_seq_fetch_NCs_next @20\r
+ cc_seq_fetch_creds_begin @21\r
+ cc_seq_fetch_creds_end @22\r
+ cc_seq_fetch_creds_next @23\r
+ cc_set_principal @24\r
+ cc_shutdown @25\r
+ cc_store @26\r
--- /dev/null
+#include <windows.h>\r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include <tchar.h>\r
+#include "ntccrpc.h"\r
+#include <strsafe.h>\r
+#include "CredentialsCache.h"\r
+#include "msg.h"\r
+\r
+static RPC_BINDING_HANDLE hRpcBinding;\r
+\r
+void * __RPC_USER MIDL_user_allocate(size_t s) {\r
+ return malloc(s);\r
+}\r
+\r
+void __RPC_USER MIDL_user_free(void * p) {\r
+ free(p);\r
+}\r
+\r
+int cc_rpc_init(void) {\r
+ RPC_STATUS status;\r
+ TCHAR * bindstring = NULL;\r
+ RPC_SECURITY_QOS sqos;\r
+\r
+ status = RpcStringBindingCompose(NULL,\r
+ _T("ncalrpc"),\r
+ NULL,\r
+ NULL,\r
+ NULL,\r
+ &bindstring);\r
+\r
+ if (status != RPC_S_OK) {\r
+ fprintf(stderr, "RpcStringBindingCompose failed: %d\n",\r
+ status);\r
+ return 1;\r
+ }\r
+\r
+ status = RpcBindingFromStringBinding(bindstring,\r
+ &hRpcBinding);\r
+\r
+ if (status != RPC_S_OK) {\r
+ fprintf(stderr, "RpcBindingFromStringBinding failed: %d\n",\r
+ status);\r
+ return 1;\r
+ }\r
+\r
+ status = RpcStringFree(&bindstring);\r
+\r
+ ZeroMemory(&sqos, sizeof(sqos));\r
+\r
+ sqos.Version = 1;\r
+ sqos.Capabilities = RPC_C_QOS_CAPABILITIES_DEFAULT;\r
+ sqos.IdentityTracking = RPC_C_QOS_IDENTITY_STATIC;\r
+ sqos.ImpersonationType = RPC_C_IMP_LEVEL_IMPERSONATE;\r
+\r
+ status = RpcBindingSetAuthInfoEx(hRpcBinding,\r
+ NULL,\r
+ RPC_C_AUTHN_LEVEL_CALL,\r
+ RPC_C_AUTHN_WINNT,\r
+ NULL,\r
+ 0,\r
+ &sqos);\r
+ if (status != RPC_S_OK) {\r
+ fprintf(stderr, "RpcBindingSetAuthInfoEx failed: %d\n",\r
+ status);\r
+ return 1;\r
+ }\r
+\r
+ return 0;\r
+}\r
+\r
+int cc_rpc_cleanup(void) {\r
+ RPC_STATUS status;\r
+\r
+ status = RpcBindingFree(&hRpcBinding);\r
+\r
+ return 0;\r
+}\r
+\r
+cc_int32 cci_set_thread_session_id(unsigned char * client_name, LUID luid) {\r
+ return 0;\r
+}\r
+\r
+void cci_get_thread_session_id(unsigned char * client_name, int len, LUID *pluid) {\r
+ client_name[0] = '\0';\r
+ pluid->HighPart = 0;\r
+ pluid->LowPart = 0;\r
+}\r
+\r
+\r
+/* __int32 ccapi_Message(\r
+ * [in] handle_t h,\r
+ * [string][in] unsigned char *client_name,\r
+ * [in] struct _LUID luid,\r
+ * [in] __int32 cb_buffer,\r
+ * [out] __int32 *cb_len,\r
+ * [size_is][string][out] unsigned char buffer[ ]);\r
+ */\r
+\r
+cc_int32 cci_perform_rpc(cc_msg_t *request, cc_msg_t **response)\r
+{\r
+ cc_int32 code;\r
+ unsigned char client_name[256];\r
+ LUID luid;\r
+ struct __LUID __luid;\r
+ unsigned char out_buf[MAXMSGLEN];\r
+ __int32 out_len = MAXMSGLEN;\r
+\r
+ if (cc_rpc_init())\r
+ return -1;\r
+\r
+ cci_get_thread_session_id(client_name, sizeof(client_name), &luid);\r
+\r
+ __luid.HighPart = luid.HighPart;\r
+ __luid.LowPart = luid.LowPart;\r
+\r
+ /* flatten response */\r
+ code = cci_msg_flatten(request, NULL);\r
+ if (code)\r
+ goto cleanup;\r
+\r
+ RpcTryExcept {\r
+ code = ccapi_Message(hRpcBinding, client_name, __luid, \r
+ request->flat, request->flat_len, \r
+ out_buf, &out_len);\r
+ } \r
+ RpcExcept(1) {\r
+ code = RpcExceptionCode();\r
+ }\r
+ RpcEndExcept;\r
+ if (code)\r
+ goto cleanup;\r
+\r
+ /* unflatten message */\r
+ code = cci_msg_unflatten(out_buf, out_len, response);\r
+ if (code)\r
+ goto cleanup;\r
+\r
+ cleanup:\r
+ return code;\r
+}\r
--- /dev/null
+#include <windows.h>\r
+\r
+BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, \r
+ LPVOID lpvReserved)\r
+{\r
+ switch (fdwReason) {\r
+ case DLL_PROCESS_ATTACH:\r
+ case DLL_THREAD_ATTACH:\r
+ case DLL_THREAD_DETACH:\r
+ case DLL_PROCESS_DETACH:\r
+ default:\r
+ return TRUE;\r
+ }\r
+}\r
+\r
--- /dev/null
+[\r
+ explicit_handle\r
+]\r
+\r
+interface portable_ccapi\r
+{\r
+\r
+}
\ No newline at end of file
--- /dev/null
+[\r
+ uuid(0012a1de-f7ad-44b0-b597-8ba53159c6fa),\r
+ version(1.0),\r
+ pointer_default(unique)\r
+]\r
+\r
+interface portable_ccapi\r
+{\r
+ const short MAXMSGLEN = 65536;\r
+\r
+ // Locally Unique Identifier\r
+ //\r
+\r
+ struct __LUID {\r
+ __int32 LowPart;\r
+ long HighPart;\r
+ };\r
+\r
+\r
+ // The Generic CCAPI Message RPC\r
+\r
+ __int32 ccapi_Message (\r
+ [in] handle_t h,\r
+ [in, string] unsigned char * client_name,\r
+ [in] struct __LUID luid,\r
+ [in, length_is(in_len), size_is(MAXMSGLEN)] unsigned char in_buf[],\r
+ [in] __int32 in_len,\r
+ [out, length_is(*out_len), size_is(MAXMSGLEN)] unsigned char out_buf[],\r
+ [out] __int32 * out_len);\r
+}\r
--- /dev/null
+\r
+!include <win32.mak>\r
+\r
+{}.c{}.obj:\r
+ $(CC) $(cdebug) $(cflags) /Fo"$@" /c $**\r
+\r
+EXECONLINK=link /NOLOGO $(conlibsmt) $(ldebug) $(conlflags) /OUT:$@ $**\r
+\r
+CLIENTEXE=csclient.exe\r
+\r
+SERVEREXE=csserver.exe\r
+\r
+SDKLIBS=rpcrt4.lib\r
+\r
+cstest_c.c cstest_s.c cstest.h: cstest.idl cstest.acf\r
+ midl cstest.idl /acf cstest.acf\r
+\r
+$(CLIENTEXE): client.obj cstest_c.obj\r
+ $(EXECONLINK) $(SDKLIBS)\r
+\r
+$(SERVEREXE): server.obj cstest_s.obj\r
+ $(EXECONLINK) $(SDKLIBS)\r
+\r
+all: $(SERVEREXE) $(CLIENTEXE)\r
--- /dev/null
+#include<windows.h>\r
+#include<stdio.h>\r
+#include<stdlib.h>\r
+#include<tchar.h>\r
+#include"cstest.h"\r
+#include<strsafe.h>\r
+\r
+void * __RPC_USER MIDL_user_allocate(size_t s) {\r
+ return malloc(s);\r
+}\r
+\r
+void __RPC_USER MIDL_user_free(void * p) {\r
+ free(p);\r
+}\r
+\r
+int main(int argc, char ** argv) {\r
+ RPC_STATUS status;\r
+ RPC_BINDING_HANDLE h;\r
+ TCHAR * bindstring = NULL;\r
+ RPC_SECURITY_QOS sqos;\r
+ char inbuf[256];\r
+ char outbuf[256];\r
+ long cb_out;\r
+\r
+ status = RpcStringBindingCompose(NULL,\r
+ _T("ncalrpc"),\r
+ NULL,\r
+ NULL,\r
+ NULL,\r
+ &bindstring);\r
+\r
+ if (status != RPC_S_OK) {\r
+ fprintf(stderr, "RpcStringBindingCompose failed: %d\n",\r
+ status);\r
+ return 1;\r
+ }\r
+\r
+ status = RpcBindingFromStringBinding(bindstring,\r
+ &h);\r
+\r
+ if (status != RPC_S_OK) {\r
+ fprintf(stderr, "RpcBindingFromStringBinding failed: %d\n",\r
+ status);\r
+ return 1;\r
+ }\r
+\r
+ ZeroMemory(&sqos, sizeof(sqos));\r
+\r
+ sqos.Version = 1;\r
+ sqos.Capabilities = RPC_C_QOS_CAPABILITIES_DEFAULT;\r
+ sqos.IdentityTracking = RPC_C_QOS_IDENTITY_STATIC;\r
+ sqos.ImpersonationType = RPC_C_IMP_LEVEL_IMPERSONATE;\r
+\r
+ status = RpcBindingSetAuthInfoEx(h,\r
+ NULL,\r
+ RPC_C_AUTHN_LEVEL_CALL,\r
+ RPC_C_AUTHN_WINNT,\r
+ NULL,\r
+ 0,\r
+ &sqos);\r
+\r
+ if (status != RPC_S_OK) {\r
+ fprintf(stderr, "RpcBindingSetAuthInfoEx failed: %d\n",\r
+ status);\r
+ return 1;\r
+ }\r
+\r
+ StringCbCopyA(inbuf, sizeof(inbuf), "Echo Test 1");\r
+ StringCbCopyA(outbuf, sizeof(outbuf), "Blank blank blank");\r
+\r
+ printf("Before call: in[%s], out[%s]\n", inbuf, outbuf);\r
+ cb_out = 0;\r
+\r
+ status = EchoString(h, inbuf, sizeof(outbuf), &cb_out, outbuf);\r
+\r
+ if (status) {\r
+ printf("Call failed: status = %d\n", status);\r
+ } else {\r
+ printf("After call: out[%s], outlen[%d]\n", outbuf, cb_out);\r
+ }\r
+\r
+ status = RpcBindingFree(&h);\r
+\r
+ status = RpcStringFree(&bindstring);\r
+\r
+ return 0;\r
+}\r
--- /dev/null
+[\r
+ explicit_handle\r
+]\r
+\r
+interface ccapi_cstest\r
+{\r
+\r
+}
\ No newline at end of file
--- /dev/null
+[\r
+uuid(c8b4a635-e9e4-4650-a073-b25610324950),\r
+ version(1.0),\r
+ pointer_default(unique)\r
+]\r
+\r
+interface ccapi_cstest\r
+{\r
+ long EchoString([in] handle_t h,\r
+ [in, string] unsigned char * in_str,\r
+ [in] long cb_buffer,\r
+ [out] long * cb_len,\r
+ [out, string, size_is(cb_buffer)] unsigned char buffer[*]);\r
+}\r
--- /dev/null
+#include<windows.h>\r
+#include<stdio.h>\r
+#include<process.h>\r
+#include<tchar.h>\r
+#include<rpc.h>\r
+#include"cstest.h"\r
+#include<strsafe.h>\r
+\r
+#define SVCNAME "CCAPICSTest"\r
+\r
+SERVICE_STATUS_HANDLE h_service_status = NULL;\r
+SERVICE_STATUS service_status;\r
+FILE * logfile = NULL;\r
+\r
+void begin_log(void) {\r
+ char temppath[512];\r
+\r
+ temppath[0] = L'\0';\r
+\r
+ GetTempPathA(sizeof(temppath), temppath);\r
+ StringCbCatA(temppath, sizeof(temppath), "csserverconn.log");\r
+ logfile = fopen(temppath, "w");\r
+}\r
+\r
+void end_log(void) {\r
+ if (logfile) {\r
+ fclose(logfile);\r
+ logfile = NULL;\r
+ }\r
+}\r
+\r
+BOOL report_status(DWORD state,\r
+ DWORD exit_code,\r
+ DWORD wait_hint) {\r
+ static DWORD checkpoint = 1;\r
+ BOOL rv = TRUE;\r
+\r
+ if (state == SERVICE_START_PENDING)\r
+ service_status.dwControlsAccepted = 0;\r
+ else\r
+ service_status.dwControlsAccepted = SERVICE_ACCEPT_STOP;\r
+\r
+ service_status.dwCurrentState = state;\r
+ service_status.dwWin32ExitCode = exit_code;\r
+ service_status.dwWaitHint = wait_hint;\r
+\r
+ if (state == SERVICE_RUNNING ||\r
+ state == SERVICE_STOPPED)\r
+ service_status.dwCheckPoint = 0;\r
+ else\r
+ service_status.dwCheckPoint = checkpoint++;\r
+\r
+ rv = SetServiceStatus(h_service_status, &service_status);\r
+\r
+ return rv;\r
+}\r
+\r
+void service_start(DWORD argc, LPTSTR * argv) {\r
+ RPC_STATUS status;\r
+ RPC_BINDING_VECTOR * bv;\r
+\r
+ status = RpcServerUseProtseq("ncalrpc",\r
+ RPC_C_PROTSEQ_MAX_REQS_DEFAULT,\r
+ NULL);\r
+\r
+ if (status != RPC_S_OK) {\r
+ return;\r
+ }\r
+\r
+ report_status(SERVICE_START_PENDING, NO_ERROR, 3000);\r
+\r
+ status = RpcServerRegisterIf(ccapi_cstest_v1_0_s_ifspec,\r
+ 0, 0);\r
+\r
+ if (status != RPC_S_OK)\r
+ return;\r
+\r
+ report_status(SERVICE_START_PENDING, NO_ERROR, 3000);\r
+\r
+ status = RpcServerInqBindings(&bv);\r
+\r
+ if (status != RPC_S_OK)\r
+ return;\r
+\r
+ status = RpcEpRegister(ccapi_cstest_v1_0_s_ifspec,\r
+ bv, 0, 0);\r
+\r
+ if (status != RPC_S_OK)\r
+ return;\r
+\r
+ report_status(SERVICE_START_PENDING, NO_ERROR, 3000);\r
+\r
+ status = RpcServerRegisterAuthInfo(NULL,\r
+ RPC_C_AUTHN_WINNT,\r
+ 0, 0);\r
+\r
+ if (status != RPC_S_OK)\r
+ return;\r
+\r
+ report_status(SERVICE_START_PENDING, NO_ERROR, 3000);\r
+\r
+ status = RpcServerListen(1,\r
+ RPC_C_LISTEN_MAX_CALLS_DEFAULT,\r
+ TRUE);\r
+\r
+ if (status != RPC_S_OK)\r
+ return;\r
+\r
+ report_status(SERVICE_RUNNING, NO_ERROR, 0);\r
+\r
+ begin_log();\r
+\r
+ status = RpcMgmtWaitServerListen();\r
+\r
+ end_log();\r
+\r
+ RpcEpUnregister(ccapi_cstest_v1_0_s_ifspec, bv, 0);\r
+\r
+ RpcBindingVectorFree(&bv);\r
+}\r
+\r
+void service_stop(void) {\r
+ RpcMgmtStopServerListening(0);\r
+}\r
+\r
+void * __RPC_USER MIDL_user_allocate(size_t s) {\r
+ return malloc(s);\r
+}\r
+\r
+void __RPC_USER MIDL_user_free(void * p) {\r
+ free(p);\r
+}\r
+\r
+typedef struct tag_client_info {\r
+ char client_name[512];\r
+ LUID luid; \r
+} client_info_t;\r
+\r
+RPC_STATUS check_auth(handle_t h, client_info_t * client_info) {\r
+ RPC_BINDING_HANDLE bh = (RPC_BINDING_HANDLE) h;\r
+ RPC_STATUS status;\r
+ HANDLE htoken = NULL;\r
+ char name[256];\r
+ char domain[256];\r
+ DWORD name_len;\r
+ DWORD domain_len;\r
+ SID_NAME_USE snu = 0;\r
+\r
+ struct {\r
+ TOKEN_ORIGIN origin;\r
+ char pad[512];\r
+ } torigin;\r
+\r
+ struct {\r
+ TOKEN_OWNER owner;\r
+ char pad[4096];\r
+ } towner;\r
+\r
+ DWORD len;\r
+\r
+ status = RpcImpersonateClient(bh);\r
+\r
+ if (status != RPC_S_OK)\r
+ return status;\r
+\r
+ if (!OpenThreadToken(GetCurrentThread(),\r
+ TOKEN_READ | TOKEN_QUERY_SOURCE,\r
+ FALSE,\r
+ &htoken)) {\r
+ status = GetLastError();\r
+ goto _cleanup;\r
+ }\r
+\r
+ len = 0;\r
+\r
+ if (!GetTokenInformation(htoken,\r
+ TokenOrigin,\r
+ &torigin.origin,\r
+ sizeof(torigin),\r
+ &len)) {\r
+ status = GetLastError();\r
+ goto _cleanup;\r
+ }\r
+\r
+ if (!GetTokenInformation(htoken,\r
+ TokenOwner,\r
+ &towner.owner,\r
+ sizeof(towner),\r
+ &len)) {\r
+ status = GetLastError();\r
+ goto _cleanup;\r
+ }\r
+\r
+\r
+ name_len = sizeof(name)/sizeof(name[0]);\r
+ domain_len = sizeof(domain)/sizeof(domain[0]);\r
+\r
+ if (!LookupAccountSidA(NULL,\r
+ towner.owner.Owner,\r
+ name,\r
+ &name_len,\r
+ domain,\r
+ &domain_len,\r
+ &snu)) {\r
+ status = GetLastError();\r
+ goto _cleanup;\r
+ }\r
+\r
+ client_info->luid = torigin.origin.OriginatingLogonSession;\r
+ StringCbPrintfA(client_info->client_name,\r
+ sizeof(client_info->client_name),\r
+ "%s\\%s", domain, name);\r
+\r
+ status = 0;\r
+\r
+ _cleanup:\r
+\r
+ RpcRevertToSelf();\r
+\r
+ return status;\r
+}\r
+\r
+long EchoString(\r
+ /* [in] */ handle_t h,\r
+ /* [string][in] */ unsigned char *in_str,\r
+ /* [in] */ long cb_buffer,\r
+ /* [out] */ long *cb_len,\r
+ /* [size_is][string][out] */ unsigned char buffer[ ]) {\r
+\r
+ size_t cb;\r
+ long rv = 0;\r
+ client_info_t client_info;\r
+\r
+ rv = check_auth(h, &client_info);\r
+\r
+ if (rv == 0 && logfile) {\r
+ fprintf(logfile,\r
+ "Client name [%s], LUID [%x:%x]\n",\r
+ client_info.client_name,\r
+ (client_info.luid.HighPart),\r
+ (client_info.luid.LowPart));\r
+ fflush(logfile);\r
+ }\r
+\r
+ if (!in_str) {\r
+ rv = 1;\r
+ if (cb_len)\r
+ *cb_len = 0;\r
+ if (buffer)\r
+ buffer[0] = '\0';\r
+ } else {\r
+ if (FAILED(StringCbLengthA(in_str, 256, &cb))) {\r
+ rv = 2;\r
+ goto _exit_f;\r
+ }\r
+\r
+ cb += sizeof(char);\r
+\r
+ if (((long)cb) > cb_buffer) {\r
+ rv = 3;\r
+ goto _exit_f;\r
+ }\r
+\r
+ *cb_len = cb;\r
+\r
+ if (buffer)\r
+ StringCbCopyA(buffer, cb_buffer, in_str);\r
+\r
+ rv = 0;\r
+ }\r
+\r
+ _exit_f:\r
+\r
+ return rv;\r
+}\r
+\r
+void WINAPI service_control(DWORD ctrl_code) {\r
+ switch(ctrl_code) {\r
+ case SERVICE_CONTROL_STOP:\r
+ report_status(SERVICE_STOP_PENDING, NO_ERROR, 0);\r
+ service_stop();\r
+ return;\r
+\r
+ /* everything else falls through */\r
+ }\r
+\r
+ report_status(service_status.dwCurrentState, NO_ERROR, 0);\r
+}\r
+\r
+void WINAPI service_main(DWORD argc, LPTSTR * argv) {\r
+\r
+ h_service_status = RegisterServiceCtrlHandler( _T(SVCNAME), service_control);\r
+\r
+ if (!h_service_status)\r
+ goto cleanup;\r
+\r
+ ZeroMemory(&service_status, sizeof(service_status));\r
+\r
+ service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;\r
+ service_status.dwServiceSpecificExitCode = 0;\r
+\r
+ if (!report_status(SERVICE_START_PENDING,\r
+ NO_ERROR,\r
+ 3000))\r
+ goto cleanup;\r
+\r
+ service_start(argc, argv);\r
+\r
+ cleanup:\r
+\r
+ if (h_service_status) {\r
+ report_status(SERVICE_STOPPED, NO_ERROR, 0);\r
+ }\r
+}\r
+\r
+\r
+BOOL\r
+IsInstalled()\r
+{\r
+ BOOL bResult = FALSE;\r
+ SC_HANDLE hSCM;\r
+ SC_HANDLE hService;\r
+\r
+ // Open the Service Control Manager\r
+ hSCM = OpenSCManager( NULL, // local machine\r
+ NULL, // ServicesActive database\r
+ SC_MANAGER_ALL_ACCESS); // full access\r
+ if (hSCM) {\r
+\r
+ // Try to open the service\r
+ hService = OpenService( hSCM,\r
+ SVCNAME,\r
+ SERVICE_QUERY_CONFIG);\r
+ if (hService) {\r
+ bResult = TRUE;\r
+ CloseServiceHandle(hService);\r
+ }\r
+\r
+ CloseServiceHandle(hSCM);\r
+ }\r
+\r
+ return bResult;\r
+}\r
+\r
+BOOL\r
+Install()\r
+{\r
+ char szFilePath[_MAX_PATH];\r
+ SC_HANDLE hSCM;\r
+ SC_HANDLE hService;\r
+ TCHAR szKey[256];\r
+ HKEY hKey = NULL;\r
+ DWORD dwData;\r
+\r
+ // Open the Service Control Manager\r
+ hSCM = OpenSCManager( NULL, // local machine\r
+ NULL, // ServicesActive database\r
+ SC_MANAGER_ALL_ACCESS); // full access\r
+ if (!hSCM)\r
+ return FALSE;\r
+\r
+ // Get the executable file path\r
+ GetModuleFileName(NULL, szFilePath, sizeof(szFilePath));\r
+\r
+ // Create the service\r
+ hService = CreateService( hSCM,\r
+ SVCNAME,\r
+ SVCNAME,\r
+ SERVICE_ALL_ACCESS,\r
+ SERVICE_WIN32_OWN_PROCESS,\r
+ SERVICE_AUTO_START, // start condition\r
+ SERVICE_ERROR_NORMAL,\r
+ szFilePath,\r
+ NULL,\r
+ NULL,\r
+ NULL,\r
+ NULL,\r
+ NULL);\r
+ if (!hService) {\r
+ CloseServiceHandle(hSCM);\r
+ return FALSE;\r
+ }\r
+\r
+ // make registry entries to support logging messages\r
+ // Add the source name as a subkey under the Application\r
+ // key in the EventLog service portion of the registry.\r
+ StringCbCopyA(szKey, 256, "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\IKSD");\r
+ if (RegCreateKey(HKEY_LOCAL_MACHINE, szKey, &hKey) != ERROR_SUCCESS) {\r
+ CloseServiceHandle(hService);\r
+ CloseServiceHandle(hSCM);\r
+ return FALSE;\r
+ }\r
+\r
+ // Add the Event ID message-file name to the 'EventMessageFile' subkey.\r
+ RegSetValueEx( hKey,\r
+ "EventMessageFile",\r
+ 0,\r
+ REG_EXPAND_SZ,\r
+ (CONST BYTE*)szFilePath,\r
+ strlen(szFilePath) + 1);\r
+\r
+ // Set the supported types flags.\r
+ dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE;\r
+ RegSetValueEx( hKey,\r
+ "TypesSupported",\r
+ 0,\r
+ REG_DWORD,\r
+ (CONST BYTE*)&dwData,\r
+ sizeof(DWORD));\r
+ RegCloseKey(hKey);\r
+\r
+ // LogEvent(EVENTLOG_INFORMATION_TYPE, EVMSG_INSTALLED, SVCNAME);\r
+\r
+ // tidy up\r
+ CloseServiceHandle(hService);\r
+ CloseServiceHandle(hSCM);\r
+ return TRUE;\r
+}\r
+\r
+BOOL\r
+Uninstall()\r
+{\r
+ BOOL bResult = FALSE;\r
+ SC_HANDLE hService;\r
+ SC_HANDLE hSCM;\r
+\r
+ // Open the Service Control Manager\r
+ hSCM = OpenSCManager( NULL, // local machine\r
+ NULL, // ServicesActive database\r
+ SC_MANAGER_ALL_ACCESS); // full access\r
+ if (!hSCM)\r
+ return FALSE;\r
+\r
+ hService = OpenService( hSCM,\r
+ SVCNAME,\r
+ DELETE);\r
+ if (hService) {\r
+ if (DeleteService(hService)) {\r
+ // LogEvent(EVENTLOG_INFORMATION_TYPE, EVMSG_REMOVED, SVCNAME);\r
+ bResult = TRUE;\r
+ } else {\r
+ // LogEvent(EVENTLOG_ERROR_TYPE, EVMSG_NOTREMOVED, SVCNAME);\r
+ }\r
+ CloseServiceHandle(hService);\r
+ }\r
+\r
+ CloseServiceHandle(hSCM);\r
+ return bResult;\r
+}\r
+\r
+\r
+// Returns TRUE if it found an arg it recognised, FALSE if not\r
+// Note: processing some arguments causes output to stdout to be generated.\r
+BOOL\r
+ParseStandardArgs(int argc, char* argv[])\r
+{\r
+ char szFilePath[_MAX_PATH];\r
+\r
+ // See if we have any command line args we recognize\r
+ if (argc <= 1)\r
+ return FALSE;\r
+\r
+ if ( _stricmp(argv[1], "-h") == 0 ||\r
+ _stricmp(argv[1], "-?") == 0 ||\r
+ _stricmp(argv[1], "/h") == 0 ||\r
+ _stricmp(argv[1], "/?") == 0) {\r
+\r
+ //\r
+ GetModuleFileName(NULL, szFilePath, sizeof(szFilePath));\r
+ fprintf(stderr, "usage: %s [-v | -i | -u | -h]\r\n",szFilePath);\r
+ return TRUE;\r
+ } else if (_stricmp(argv[1], "-v") == 0 ||\r
+ _stricmp(argv[1], "/v") == 0 ) {\r
+\r
+ // Spit out version info\r
+ fprintf(stderr, "%s Version 0.1\n",_T(SVCNAME));\r
+ fprintf(stderr, "The service is %s installed\n",\r
+ IsInstalled() ? "currently" : "not");\r
+ return TRUE; // say we processed the argument\r
+\r
+ } else if (_stricmp(argv[1], "-i") == 0 ||\r
+ _stricmp(argv[1], "/i") == 0) {\r
+\r
+ // Request to install.\r
+ if (IsInstalled()) {\r
+ fprintf(stderr, "%s is already installed\n", _T(SVCNAME));\r
+ } else {\r
+ // Try and install the copy that's running\r
+ if (Install()) {\r
+ fprintf(stderr, "%s installed\n", _T(SVCNAME));\r
+ } else {\r
+ fprintf(stderr, "%s failed to install. Error %d\n", _T(SVCNAME), GetLastError());\r
+ }\r
+ }\r
+ return TRUE; // say we processed the argument\r
+\r
+ } else if (_stricmp(argv[1], "-u") == 0 ||\r
+ _stricmp(argv[1], "/u") == 0) {\r
+\r
+ // Request to uninstall.\r
+ if (!IsInstalled()) {\r
+ fprintf(stderr, "%s is not installed\n", _T(SVCNAME));\r
+ } else {\r
+ // Try and remove the copy that's installed\r
+ if (Uninstall()) {\r
+ // Get the executable file path\r
+ GetModuleFileName(NULL, szFilePath, sizeof(szFilePath));\r
+ fprintf(stderr, "%s removed. (You must delete the file (%s) yourself.)\n"\r
+ _T(SVCNAME), szFilePath);\r
+ } else {\r
+ fprintf(stderr, "Could not remove %s. Error %d\n", _T(SVCNAME), GetLastError());\r
+ }\r
+ }\r
+ return TRUE; // say we processed the argument\r
+\r
+ }\r
+\r
+ // Don't recognise the args\r
+ return FALSE;\r
+}\r
+\r
+int main(int argc, char ** argv) {\r
+\r
+ SERVICE_TABLE_ENTRY dispatch_table[] = {\r
+ { _T(SVCNAME), (LPSERVICE_MAIN_FUNCTION) service_main },\r
+ { NULL, NULL }\r
+ };\r
+\r
+ if ( ParseStandardArgs(argc, argv) )\r
+ return 0;\r
+\r
+ if (!StartServiceCtrlDispatcher(dispatch_table)) {\r
+ fprintf(stderr, "Can't start service control dispatcher\n");\r
+ }\r
+\r
+ return 0;\r
+}\r
--- /dev/null
+\r
+#include <windows.h>\r
+#include "msg.h"\r
+#include "marshall.h"\r
+#include "serv_ops.h"\r
+#include "datastore.h"\r
+#include <stdio.h>\r
+#include <process.h>\r
+#include <tchar.h>\r
+#include <rpc.h>\r
+#include <rpcndr.h>\r
+#include "ntccrpc.h"\r
+#include <strsafe.h>\r
+\r
+#define SVCNAME "MIT_CCAPI_NT_Service"\r
+\r
+HANDLE hMainThread = 0;\r
+HANDLE WaitToTerminate = 0;\r
+\r
+SERVICE_STATUS_HANDLE h_service_status = NULL;\r
+SERVICE_STATUS service_status;\r
+FILE * logfile = NULL;\r
+\r
+/* Log File */\r
+void begin_log(void) {\r
+ char temppath[512];\r
+\r
+ temppath[0] = L'\0';\r
+\r
+ GetTempPathA(sizeof(temppath), temppath);\r
+ StringCbCatA(temppath, sizeof(temppath), "mit_nt_ccapi.log");\r
+ logfile = fopen(temppath, "w");\r
+}\r
+\r
+void end_log(void) {\r
+ if (logfile) {\r
+ fclose(logfile);\r
+ logfile = NULL;\r
+ }\r
+}\r
+\r
+BOOL report_status(DWORD state,\r
+ DWORD exit_code,\r
+ DWORD wait_hint) {\r
+ static DWORD checkpoint = 1;\r
+ BOOL rv = TRUE;\r
+\r
+ if (state == SERVICE_START_PENDING)\r
+ service_status.dwControlsAccepted = 0;\r
+ else\r
+ service_status.dwControlsAccepted = SERVICE_ACCEPT_STOP;\r
+\r
+ service_status.dwCurrentState = state;\r
+ service_status.dwWin32ExitCode = exit_code;\r
+ service_status.dwWaitHint = wait_hint;\r
+\r
+ if (state == SERVICE_RUNNING ||\r
+ state == SERVICE_STOPPED)\r
+ service_status.dwCheckPoint = 0;\r
+ else\r
+ service_status.dwCheckPoint = checkpoint++;\r
+\r
+ rv = SetServiceStatus(h_service_status, &service_status);\r
+\r
+ return rv;\r
+}\r
+\r
+void service_start(DWORD argc, LPTSTR * argv) {\r
+ RPC_STATUS status;\r
+ RPC_BINDING_VECTOR * bv;\r
+\r
+ status = RpcServerUseProtseq("ncalrpc",\r
+ RPC_C_PROTSEQ_MAX_REQS_DEFAULT,\r
+ NULL);\r
+\r
+ if (status != RPC_S_OK) {\r
+ if (logfile) fprintf(logfile, "service_start RpcServerUseProtseq = 0x%x\n", status);\r
+ goto cleanup;\r
+ }\r
+\r
+ report_status(SERVICE_START_PENDING, NO_ERROR, 3000);\r
+\r
+ status = RpcServerRegisterIf(portable_ccapi_v1_0_s_ifspec,\r
+ 0, 0);\r
+\r
+ if (status != RPC_S_OK) {\r
+ if (logfile) fprintf(logfile, "service_start RpcServerRegisterIf = 0x%x\n", status);\r
+ goto cleanup;\r
+ }\r
+\r
+ report_status(SERVICE_START_PENDING, NO_ERROR, 3000);\r
+\r
+ status = RpcServerInqBindings(&bv);\r
+\r
+ if (status != RPC_S_OK) {\r
+ if (logfile) fprintf(logfile, "service_start RpcServerInqBindings = 0x%x\n", status);\r
+ goto cleanup;\r
+ }\r
+\r
+ status = RpcEpRegister(portable_ccapi_v1_0_s_ifspec,\r
+ bv, 0, 0);\r
+\r
+ if (status != RPC_S_OK) {\r
+ if (logfile) fprintf(logfile, "service_start RpcEpRegister = 0x%x\n", status);\r
+ goto cleanup;\r
+ }\r
+\r
+ report_status(SERVICE_START_PENDING, NO_ERROR, 3000);\r
+\r
+ status = RpcServerRegisterAuthInfo(NULL,\r
+ RPC_C_AUTHN_WINNT,\r
+ 0, 0);\r
+\r
+ if (status != RPC_S_OK) {\r
+ if (logfile) fprintf(logfile, "service_start RpcServerRegisterAuthInfo = 0x%x\n", status);\r
+ goto cleanup;\r
+ }\r
+\r
+ report_status(SERVICE_START_PENDING, NO_ERROR, 3000);\r
+\r
+ status = RpcServerListen(2,\r
+ RPC_C_LISTEN_MAX_CALLS_DEFAULT,\r
+ TRUE);\r
+\r
+ if (status != RPC_S_OK) {\r
+ if (logfile) fprintf(logfile, "service_start RpcServerListen = 0x%x\n", status);\r
+ goto cleanup;\r
+ }\r
+\r
+ report_status(SERVICE_RUNNING, NO_ERROR, 0);\r
+\r
+\r
+ if (logfile) fprintf(logfile, "service_start calling RpcMgmtWaitServerListen\n");\r
+ status = RpcMgmtWaitServerListen();\r
+ if (logfile) fprintf(logfile, "service_start RpcMgmtWaitServerListen = 0x%x\n", status);\r
+\r
+ cleanup:\r
+ RpcEpUnregister(portable_ccapi_v1_0_s_ifspec, bv, 0);\r
+\r
+ RpcBindingVectorFree(&bv);\r
+}\r
+\r
+void service_stop(void) {\r
+ if (logfile) fprintf(logfile, "service_stop\n");\r
+ RpcMgmtStopServerListening(0);\r
+}\r
+\r
+void * __RPC_USER MIDL_user_allocate(size_t s) {\r
+ return malloc(s);\r
+}\r
+\r
+void __RPC_USER MIDL_user_free(void * p) {\r
+ free(p);\r
+}\r
+\r
+typedef struct tag_client_info {\r
+ char client_name[512];\r
+ LUID luid; \r
+} client_info_t;\r
+\r
+int obtain_auth_info(client_info_t * client_info, cc_auth_info_t ** pauth_info)\r
+{\r
+ *pauth_info = (cc_auth_info_t *)malloc(sizeof(cc_auth_info_t));\r
+ if ( !*pauth_info )\r
+ return ccErrNoMem;\r
+ \r
+ (*pauth_info)->len = strlen(client_info->client_name) + 1;\r
+ (*pauth_info)->info = malloc((*pauth_info)->len);\r
+ if ( !(*pauth_info)->info ) {\r
+ free(*pauth_info);\r
+ return ccErrNoMem;\r
+ }\r
+\r
+ memcpy((*pauth_info)->info, client_info->client_name, (*pauth_info)->len);\r
+ \r
+ return 0;\r
+}\r
+\r
+void destroy_auth_info(cc_auth_info_t *auth_info)\r
+{\r
+ free(auth_info->info);\r
+ free(auth_info);\r
+}\r
+\r
+int obtain_session_info(client_info_t * client_info, cc_session_info_t ** psession_info)\r
+{\r
+ *psession_info = (cc_session_info_t *)malloc(sizeof(cc_session_info_t));\r
+ if ( !*psession_info )\r
+ return ccErrNoMem;\r
+ \r
+ (*psession_info)->len = sizeof(LUID);\r
+ (*psession_info)->info = malloc((*psession_info)->len);\r
+ if ( !(*psession_info)->info ) {\r
+ free(*psession_info);\r
+ return ccErrNoMem;\r
+ }\r
+\r
+ memcpy((*psession_info)->info, &client_info->luid, (*psession_info)->len);\r
+ \r
+ return 0;\r
+}\r
+\r
+void destroy_session_info(cc_session_info_t *session_info)\r
+{\r
+ free(session_info->info);\r
+ free(session_info);\r
+}\r
+\r
+RPC_STATUS check_auth(handle_t h, client_info_t * client_info) {\r
+ RPC_BINDING_HANDLE bh = (RPC_BINDING_HANDLE) h;\r
+ RPC_STATUS status;\r
+ HANDLE htoken = NULL;\r
+ char name[256];\r
+ char domain[256];\r
+ DWORD name_len;\r
+ DWORD domain_len;\r
+ SID_NAME_USE snu = 0;\r
+\r
+ struct {\r
+ TOKEN_ORIGIN origin;\r
+ char pad[512];\r
+ } torigin;\r
+\r
+ struct {\r
+ TOKEN_OWNER owner;\r
+ char pad[4096];\r
+ } towner;\r
+\r
+ DWORD len;\r
+\r
+ status = RpcImpersonateClient(bh);\r
+\r
+ if (status != RPC_S_OK)\r
+ return status;\r
+\r
+ if (!OpenThreadToken(GetCurrentThread(),\r
+ TOKEN_READ | TOKEN_QUERY_SOURCE,\r
+ FALSE,\r
+ &htoken)) {\r
+ status = GetLastError();\r
+ goto _cleanup;\r
+ }\r
+\r
+ len = 0;\r
+\r
+ if (!GetTokenInformation(htoken,\r
+ TokenOrigin,\r
+ &torigin.origin,\r
+ sizeof(torigin),\r
+ &len)) {\r
+ status = GetLastError();\r
+ goto _cleanup;\r
+ }\r
+\r
+ if (!GetTokenInformation(htoken,\r
+ TokenOwner,\r
+ &towner.owner,\r
+ sizeof(towner),\r
+ &len)) {\r
+ status = GetLastError();\r
+ goto _cleanup;\r
+ }\r
+\r
+\r
+ name_len = sizeof(name)/sizeof(name[0]);\r
+ domain_len = sizeof(domain)/sizeof(domain[0]);\r
+\r
+ if (!LookupAccountSidA(NULL,\r
+ towner.owner.Owner,\r
+ name,\r
+ &name_len,\r
+ domain,\r
+ &domain_len,\r
+ &snu)) {\r
+ status = GetLastError();\r
+ goto _cleanup;\r
+ }\r
+\r
+ client_info->luid = torigin.origin.OriginatingLogonSession;\r
+ StringCbPrintfA(client_info->client_name,\r
+ sizeof(client_info->client_name),\r
+ "%s\\%s", domain, name);\r
+\r
+ status = 0;\r
+\r
+ _cleanup:\r
+\r
+ RpcRevertToSelf();\r
+\r
+ return status;\r
+}\r
+\r
+__int32 ccapi_Message( \r
+ /* [in] */ handle_t h,\r
+ /* [string][in] */ unsigned char *client_name,\r
+ /* [in] */ struct __LUID luid,\r
+ /* [size_is][length_is][in] */ unsigned char in_buf[],\r
+ /* [in] */ __int32 in_len,\r
+ /* [size_is][length_is][out] */ unsigned char out_buf[],\r
+ /* [out] */ __int32 *out_len)\r
+{\r
+ client_info_t client_info;\r
+ cc_msg_t * msg = NULL;\r
+ cc_msg_t * resp = NULL;\r
+ cc_auth_info_t * auth_info = NULL;\r
+ cc_session_info_t * session_info = NULL;\r
+ cc_int32 code;\r
+\r
+ if (logfile) fprintf(logfile, "ccapi_Message\n");\r
+\r
+ if ( ccs_serv_initialize() != ccNoError ) {\r
+ code = ccErrServerUnavailable;\r
+ goto done;\r
+ }\r
+\r
+ code = check_auth(h, &client_info);\r
+ if (code == 0) {\r
+ if (!strcmp("SYSTEM",client_info.client_name) &&\r
+ client_info.luid.HighPart == 0 &&\r
+ client_info.luid.LowPart == 0 &&\r
+ client_name != NULL &&\r
+ client_name[0] != '\0') {\r
+ StringCbPrintfA(client_info.client_name,\r
+ sizeof(client_info.client_name),\r
+ "%s", client_name);\r
+ client_info.luid.HighPart = luid.HighPart;\r
+ client_info.luid.LowPart = luid.LowPart;\r
+ }\r
+ } else {\r
+ code = ccErrServerCantBecomeUID;\r
+ goto done;\r
+ }\r
+\r
+ /* allocate message */\r
+ msg = (cc_msg_t *)malloc(sizeof(cc_msg_t));\r
+ if (!msg) {\r
+ code = ccErrNoMem;\r
+ goto done;\r
+ }\r
+\r
+ /* unflatten message */\r
+ code = cci_msg_unflatten(in_buf, in_len, &msg);\r
+ if (code)\r
+ goto cleanup;\r
+\r
+ /* obtain auth info */\r
+ code = obtain_auth_info(&client_info, &auth_info);\r
+ if (code)\r
+ goto cleanup;\r
+\r
+ /* obtain session info */\r
+ code = obtain_session_info(&client_info, &session_info);\r
+ if (code)\r
+ goto cleanup;\r
+\r
+ /* process message */\r
+ code = ccs_serv_process_msg(msg, auth_info, session_info, &resp);\r
+ if (code)\r
+ goto cleanup;\r
+\r
+ /* flatten response */\r
+ code = cci_msg_flatten(resp, NULL);\r
+ if (code)\r
+ goto cleanup;\r
+\r
+ /* send response */\r
+ if (resp->flat_len > MAXMSGLEN) {\r
+ code = ccErrBadInternalMessage;\r
+ goto cleanup;\r
+ }\r
+ memcpy(out_buf, resp->flat, resp->flat_len);\r
+ *out_len = resp->flat_len;\r
+ code = ccNoError;\r
+\r
+ cleanup:\r
+ if (auth_info)\r
+ destroy_auth_info(auth_info);\r
+\r
+ if (session_info)\r
+ destroy_session_info(session_info);\r
+\r
+ /* free message */\r
+ if (msg)\r
+ cci_msg_destroy(msg);\r
+\r
+ /* free response */\r
+ if (resp)\r
+ cci_msg_destroy(resp);\r
+\r
+ done:\r
+ return code ? -1 : 0;\r
+}\r
+\r
+void WINAPI service_control(DWORD ctrl_code) {\r
+ switch(ctrl_code) {\r
+ case SERVICE_CONTROL_STOP:\r
+ report_status(SERVICE_STOP_PENDING, NO_ERROR, 0);\r
+ service_stop();\r
+ return;\r
+\r
+ /* everything else falls through */\r
+ }\r
+\r
+ report_status(service_status.dwCurrentState, NO_ERROR, 0);\r
+}\r
+\r
+void WINAPI service_main(DWORD argc, LPTSTR * argv) {\r
+\r
+ begin_log();\r
+\r
+ h_service_status = RegisterServiceCtrlHandler( _T(SVCNAME), service_control);\r
+\r
+ if (!h_service_status)\r
+ goto cleanup;\r
+\r
+ ZeroMemory(&service_status, sizeof(service_status));\r
+\r
+ service_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;\r
+ service_status.dwServiceSpecificExitCode = 0;\r
+\r
+ if (!report_status(SERVICE_START_PENDING,\r
+ NO_ERROR,\r
+ 3000))\r
+ goto cleanup;\r
+\r
+ service_start(argc, argv);\r
+\r
+ cleanup:\r
+\r
+ if (h_service_status) {\r
+ report_status(SERVICE_STOPPED, NO_ERROR, 0);\r
+ }\r
+\r
+ end_log();\r
+}\r
+\r
+\r
+BOOL\r
+IsInstalled()\r
+{\r
+ BOOL bResult = FALSE;\r
+ SC_HANDLE hSCM;\r
+ SC_HANDLE hService;\r
+\r
+ // Open the Service Control Manager\r
+ hSCM = OpenSCManager( NULL, // local machine\r
+ NULL, // ServicesActive database\r
+ SC_MANAGER_ALL_ACCESS); // full access\r
+ if (hSCM) {\r
+\r
+ // Try to open the service\r
+ hService = OpenService( hSCM,\r
+ SVCNAME,\r
+ SERVICE_QUERY_CONFIG);\r
+ if (hService) {\r
+ bResult = TRUE;\r
+ CloseServiceHandle(hService);\r
+ }\r
+\r
+ CloseServiceHandle(hSCM);\r
+ }\r
+\r
+ return bResult;\r
+}\r
+\r
+BOOL\r
+Install()\r
+{\r
+ char szFilePath[_MAX_PATH];\r
+ SC_HANDLE hSCM;\r
+ SC_HANDLE hService;\r
+ TCHAR szKey[256];\r
+ HKEY hKey = NULL;\r
+ DWORD dwData;\r
+\r
+ // Open the Service Control Manager\r
+ hSCM = OpenSCManager( NULL, // local machine\r
+ NULL, // ServicesActive database\r
+ SC_MANAGER_ALL_ACCESS); // full access\r
+ if (!hSCM)\r
+ return FALSE;\r
+\r
+ // Get the executable file path\r
+ GetModuleFileName(NULL, szFilePath, sizeof(szFilePath));\r
+\r
+ // Create the service\r
+ hService = CreateService( hSCM,\r
+ SVCNAME,\r
+ SVCNAME,\r
+ SERVICE_ALL_ACCESS,\r
+ SERVICE_WIN32_OWN_PROCESS,\r
+ SERVICE_AUTO_START, // start condition\r
+ SERVICE_ERROR_NORMAL,\r
+ szFilePath,\r
+ NULL,\r
+ NULL,\r
+ NULL,\r
+ NULL,\r
+ NULL);\r
+ if (!hService) {\r
+ CloseServiceHandle(hSCM);\r
+ return FALSE;\r
+ }\r
+\r
+ // make registry entries to support logging messages\r
+ // Add the source name as a subkey under the Application\r
+ // key in the EventLog service portion of the registry.\r
+ StringCbCopyA(szKey, 256, "SYSTEM\\CurrentControlSet\\Services\\EventLog\\Application\\IKSD");\r
+ if (RegCreateKey(HKEY_LOCAL_MACHINE, szKey, &hKey) != ERROR_SUCCESS) {\r
+ CloseServiceHandle(hService);\r
+ CloseServiceHandle(hSCM);\r
+ return FALSE;\r
+ }\r
+\r
+ // Add the Event ID message-file name to the 'EventMessageFile' subkey.\r
+ RegSetValueEx( hKey,\r
+ "EventMessageFile",\r
+ 0,\r
+ REG_EXPAND_SZ,\r
+ (CONST BYTE*)szFilePath,\r
+ strlen(szFilePath) + 1);\r
+\r
+ // Set the supported types flags.\r
+ dwData = EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE;\r
+ RegSetValueEx( hKey,\r
+ "TypesSupported",\r
+ 0,\r
+ REG_DWORD,\r
+ (CONST BYTE*)&dwData,\r
+ sizeof(DWORD));\r
+ RegCloseKey(hKey);\r
+\r
+ // LogEvent(EVENTLOG_INFORMATION_TYPE, EVMSG_INSTALLED, SVCNAME);\r
+\r
+ // tidy up\r
+ CloseServiceHandle(hService);\r
+ CloseServiceHandle(hSCM);\r
+ return TRUE;\r
+}\r
+\r
+BOOL\r
+Uninstall()\r
+{\r
+ BOOL bResult = FALSE;\r
+ SC_HANDLE hService;\r
+ SC_HANDLE hSCM;\r
+\r
+ // Open the Service Control Manager\r
+ hSCM = OpenSCManager( NULL, // local machine\r
+ NULL, // ServicesActive database\r
+ SC_MANAGER_ALL_ACCESS); // full access\r
+ if (!hSCM)\r
+ return FALSE;\r
+\r
+ hService = OpenService( hSCM,\r
+ _T(SVCNAME),\r
+ DELETE);\r
+ if (hService) {\r
+ if (DeleteService(hService)) {\r
+ // LogEvent(EVENTLOG_INFORMATION_TYPE, EVMSG_REMOVED, SVCNAME);\r
+ bResult = TRUE;\r
+ } else {\r
+ // LogEvent(EVENTLOG_ERROR_TYPE, EVMSG_NOTREMOVED, SVCNAME);\r
+ }\r
+ CloseServiceHandle(hService);\r
+ }\r
+\r
+ CloseServiceHandle(hSCM);\r
+ return bResult;\r
+}\r
+\r
+\r
+// Returns TRUE if it found an arg it recognised, FALSE if not\r
+// Note: processing some arguments causes output to stdout to be generated.\r
+BOOL\r
+ParseStandardArgs(int argc, char* argv[])\r
+{\r
+ char szFilePath[_MAX_PATH]="not a file name";\r
+\r
+ // See if we have any command line args we recognize\r
+ if (argc <= 1)\r
+ return FALSE;\r
+\r
+ if ( _stricmp(argv[1], "-h") == 0 ||\r
+ _stricmp(argv[1], "-?") == 0 ||\r
+ _stricmp(argv[1], "/h") == 0 ||\r
+ _stricmp(argv[1], "/?") == 0) {\r
+\r
+ //\r
+ GetModuleFileNameA(NULL, szFilePath, sizeof(szFilePath));\r
+ fprintf(stderr, "usage: %s [-v | -i | -u | -h]\r\n",szFilePath);\r
+ return TRUE;\r
+ } else if (_stricmp(argv[1], "-v") == 0 ||\r
+ _stricmp(argv[1], "/v") == 0 ) {\r
+\r
+ // Spit out version info\r
+ fprintf(stderr, "%s Version 0.1\n",_T(SVCNAME));\r
+ fprintf(stderr, "The service is %s installed\n",\r
+ IsInstalled() ? "currently" : "not");\r
+ return TRUE; // say we processed the argument\r
+\r
+ } else if (_stricmp(argv[1], "-i") == 0 ||\r
+ _stricmp(argv[1], "/i") == 0) {\r
+\r
+ // Request to install.\r
+ if (IsInstalled()) {\r
+ fprintf(stderr, "%s is already installed\n", _T(SVCNAME));\r
+ } else {\r
+ // Try and install the copy that's running\r
+ if (Install()) {\r
+ fprintf(stderr, "%s installed\n", _T(SVCNAME));\r
+ } else {\r
+ fprintf(stderr, "%s failed to install. Error %d\n", _T(SVCNAME), GetLastError());\r
+ }\r
+ }\r
+ return TRUE; // say we processed the argument\r
+\r
+ } else if (_stricmp(argv[1], "-u") == 0 ||\r
+ _stricmp(argv[1], "/u") == 0) {\r
+\r
+ // Request to uninstall.\r
+ if (!IsInstalled()) {\r
+ fprintf(stderr, "%s is not installed\n", _T(SVCNAME));\r
+ } else {\r
+ // Try and remove the copy that's installed\r
+ if (Uninstall()) {\r
+ // Get the executable file path\r
+ GetModuleFileNameA(NULL, szFilePath, sizeof(szFilePath));\r
+ fprintf(stderr, "%s removed. (You must delete the file (%s) yourself.)\n",\r
+ _T(SVCNAME), szFilePath);\r
+ } else {\r
+ fprintf(stderr, "Could not remove %s. Error %d\n", _T(SVCNAME), GetLastError());\r
+ }\r
+ }\r
+ return TRUE; // say we processed the argument\r
+\r
+ }\r
+\r
+ // Don't recognise the args\r
+ return FALSE;\r
+}\r
+\r
+DWORD __stdcall Main_thread(void* notUsed)\r
+{\r
+ char * argv[2] = {SVCNAME, NULL};\r
+ begin_log();\r
+ service_start(1, (LPTSTR*)argv);\r
+ end_log();\r
+ return(0);\r
+}\r
+\r
+int main(int argc, char ** argv) {\r
+ SERVICE_TABLE_ENTRY dispatch_table[] = {\r
+ { _T(SVCNAME), (LPSERVICE_MAIN_FUNCTION) service_main },\r
+ { NULL, NULL }\r
+ };\r
+\r
+ if ( ParseStandardArgs(argc, argv) )\r
+ return 0;\r
+\r
+ if (!StartServiceCtrlDispatcher(dispatch_table)) {\r
+ LONG status = GetLastError();\r
+ if (status == ERROR_FAILED_SERVICE_CONTROLLER_CONNECT)\r
+ {\r
+ DWORD tid;\r
+ hMainThread = CreateThread(NULL, 0, Main_thread, 0, 0, &tid);\r
+\r
+ printf("Hit <Enter> to terminate MIT CCAPI Server\n");\r
+ getchar();\r
+ service_stop();\r
+ }\r
+ }\r
+\r
+ if ( hMainThread ) {\r
+ WaitForSingleObject( hMainThread, INFINITE );\r
+ CloseHandle( hMainThread );\r
+ }\r
+ return 0;\r
+}\r
cd ..
-# @lib_frag@
-# @libobj_frag@
+@lib_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
clean::
-$(RM) aes-gen aes-gen.o vt.txt vk.txt kresults.out aes-test aes-test.o
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
clean-unix:: clean-libobjs
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
$(CC_LINK) -o $@ t_crc.o crc32.o $(SUPPORT_LIB)
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
clean-unix:: clean-libobjs
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
clean-unix:: clean-libobjs
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
clean-unix:: clean-libobjs
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
clean-unix:: clean-libobjs
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
clean-unix:: clean-libobjs
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
clean-unix:: clean-libobjs
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
clean-unix:: clean-libobjs
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
clean-unix:: clean-libobjs
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
clean-unix:: clean-libobjs
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
t_shs3: t_shs3.o shs.o $(SUPPORT_DEPLIB)
$(CC_LINK) -o t_shs3 t_shs3.o shs.o $(SUPPORT_LIB)
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
clean-unix:: clean-libobjs
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
install-unix:: install-libs
-# @lib_frag@
-# @libobj_frag@
+@lib_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
DEFS=
##DOSLIBNAME=$(OUTPRE)gssapi.lib
-##DOSOBJFILELIST=@$(OUTPRE)generic.lst @$(OUTPRE)krb5.lst @$(OUTPRE)gssapi.lst
-##DOSOBJFILEDEP=$(OUTPRE)generic.lst $(OUTPRE)krb5.lst $(OUTPRE)gssapi.lst
+##DOSOBJFILELIST=@$(OUTPRE)mechglue.lst @$(OUTPRE)spnego.lst @$(OUTPRE)generic.lst @$(OUTPRE)krb5.lst @$(OUTPRE)gssapi.lst
+##DOSOBJFILEDEP=$(OUTPRE)mechglue.lst $(OUTPRE)spnego.lst $(OUTPRE)generic.lst $(OUTPRE)krb5.lst $(OUTPRE)gssapi.lst
##DOSOBJFILE=$(OUTPRE)gssapi.lst
##DOSLIBOBJS=$(OBJS)
LIBINITFUNC=gssint_lib_init
LIBFINIFUNC=gssint_lib_fini
STOBJLISTS=OBJS.ST generic/OBJS.ST mechglue/OBJS.ST krb5/OBJS.ST spnego/OBJS.ST
-SUBDIROBJLISTS=generic/OBJS.ST mechglue/OBJS.ST krb5/OBJS.ST
+SUBDIROBJLISTS=generic/OBJS.ST mechglue/OBJS.ST krb5/OBJS.ST spnego/OBJS.ST
SHLIB_EXPDEPS=\
$(KRB5_DEPLIB) $(CRYPTO_DEPLIB) $(SUPPORT_DEPLIB) $(COM_ERR_DEPLIB)
SHLIB_EXPLIBS=-lkrb5 -lk5crypto -lcom_err $(SUPPORT_LIB) $(DL_LIB) $(LIBS)
SHLIB_RDIRS=$(KRB5_LIBDIR)
RELDIR=gssapi
-all-unix:: all-liblinks
+all-unix:: all-liblinks @MAINT@ verify-calling-conventions-gssapi
install-unix:: install-libs
-clean-unix:: clean-liblinks clean-libs clean-libobjs
+clean-unix:: clean-liblinks clean-libs clean-libobjs clean-misc-unix
clean-windows::
$(RM) gssapi.lib gssapi.bak
+clean-misc-unix:
+ $(RM) merged-gssapi-header.h
+
+EHDRDIR=$(BUILDTOP)$(S)include$(S)gssapi
+EXPORTED_HEADERS= \
+ $(EHDRDIR)$(S)gssapi_krb5.h \
+ $(EHDRDIR)$(S)gssapi_generic.h \
+ $(EHDRDIR)$(S)gssapi.h
+merged-gssapi-header.h: $(EXPORTED_HEADERS)
+ cat $(EXPORTED_HEADERS) > merged.tmp
+ $(MV) merged.tmp merged-gssapi-header.h
+verify-calling-conventions-gssapi: merged-gssapi-header.h
+ $(PERL) -w $(SRCTOP)/util/def-check.pl merged-gssapi-header.h $(srcdir)/../gssapi32.def
+
all-windows::
cd generic
@echo Making in gssapi\generic
cd ..\krb5
@echo Making in gssapi\krb5
$(MAKE) -$(MFLAGS)
-# cd ..\mechglue
-# @echo Making in gssapi\mechglue
-# $(MAKE) -$(MFLAGS)
+ cd ..\mechglue
+ @echo Making in gssapi\mechglue
+ $(MAKE) -$(MFLAGS)
+ cd ..\spnego
+ @echo Making in gssapi\spnego
+ $(MAKE) -$(MFLAGS)
cd ..
clean-windows::
cd ..\krb5
@echo Making clean in gssapi\krb5
$(MAKE) -$(MFLAGS) clean
-# cd ..\mechglue
-# @echo Making clean in gssapi\mechglue
-# $(MAKE) -$(MFLAGS) clean
+ cd ..\mechglue
+ @echo Making clean in gssapi\mechglue
+ $(MAKE) -$(MFLAGS) clean
+ cd ..\spnego
+ @echo Making clean in gssapi\spnego
+ $(MAKE) -$(MFLAGS) clean
cd ..
@echo Making clean in gssapi
# appears to be properly serializing the subdir processing and local
# compiles... so far.
##DOS##!if 0
-$(BUILDTOP)/include/gssapi/gssapi.h generic/gssapi.h krb5/gssapi_err_krb5.h generic/gssapi_err_generic.h krb5/gssapi_krb5.h: all-recurse
+$(EXPORTED_HEADERS) generic/gssapi.h krb5/gssapi_err_krb5.h generic/gssapi_err_generic.h krb5/gssapi_krb5.h: all-recurse
: $@ updated by recursion rule
##DOS##!endif
-# @lib_frag@
-# @libobj_frag@
+@lib_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
depend:: $(ETSRCS)
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
err = k5_key_register(K5_KEY_GSS_KRB5_CCACHE_NAME, free);
if (err)
return err;
+#ifndef _WIN32
err = k5_mutex_finish_init(&kg_kdc_flag_mutex);
if (err)
return err;
+#endif
return k5_mutex_finish_init(&kg_vdb.mutex);
}
k5_key_delete(K5_KEY_GSS_KRB5_SET_CCACHE_OLD_NAME);
k5_key_delete(K5_KEY_GSS_KRB5_CCACHE_NAME);
k5_mutex_destroy(&kg_vdb.mutex);
+#ifndef _WIN32
k5_mutex_destroy(&kg_kdc_flag_mutex);
+#endif
k5_mutex_destroy(&gssint_krb5_keytab_lock);
gssint_mechglue_fini();
}
install::
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
return(major_status);
}
+#ifndef _WIN32
k5_mutex_t kg_kdc_flag_mutex = K5_MUTEX_PARTIAL_INITIALIZER;
static int kdc_flag = 0;
+#endif
krb5_error_code
krb5_gss_init_context (krb5_context *ctxp)
{
krb5_error_code err;
+#ifndef _WIN32
int is_kdc;
+#endif
err = gssint_initialize_library();
if (err)
return err;
+#ifndef _WIN32
err = k5_mutex_lock(&kg_kdc_flag_mutex);
if (err)
return err;
is_kdc = kdc_flag;
k5_mutex_unlock(&kg_kdc_flag_mutex);
+
if (is_kdc)
return krb5int_init_context_kdc(ctxp);
- else
- return krb5_init_context(ctxp);
+#endif
+
+ return krb5_init_context(ctxp);
}
+#ifndef _WIN32
krb5_error_code
krb5_gss_use_kdc_context()
{
k5_mutex_unlock(&kg_kdc_flag_mutex);
return 0;
}
+#endif
+
k5glue_inquire_context, \
k5glue_internal_release_oid, \
k5glue_wrap_size_limit, \
- NULL, /* pname_to_uid */ \
- NULL, /* userok */ \
k5glue_export_name, \
NULL /* store_cred */
#ifdef MS_BUG_TEST
static gss_mechanism krb5_mech_configs_hack[] = {
&krb5_mechanism, &krb5_mechanism_old, NULL
-}
+};
#endif
#if 1
gss_verify_mic
gss_wrap
gss_wrap_size_limit
-krb5_gss_accept_sec_context
-krb5_gss_acquire_cred
-krb5_gss_add_cred
-krb5_gss_canonicalize_name
-krb5_gss_compare_name
-krb5_gss_context_time
-krb5_gss_convert_static_mech_oid
krb5_gss_dbg_client_expcreds
-krb5_gss_delete_sec_context
-krb5_gss_display_name
-krb5_gss_display_status
-krb5_gss_duplicate_name
-krb5_gss_export_name
-krb5_gss_export_sec_context
-krb5_gss_get_mic
-krb5_gss_import_name
-krb5_gss_import_sec_context
-krb5_gss_indicate_mechs
-krb5_gss_init_sec_context
-krb5_gss_inquire_context
-krb5_gss_inquire_cred
-krb5_gss_inquire_cred_by_mech
-krb5_gss_inquire_names_for_mech
-krb5_gss_oid_array
-krb5_gss_process_context_token
krb5_gss_register_acceptor_identity
-krb5_gss_release_cred
-krb5_gss_release_name
-krb5_gss_release_oid
-krb5_gss_seal
-krb5_gss_ser_init
-krb5_gss_sign
-krb5_gss_unseal
-krb5_gss_unwrap
-krb5_gss_validate_cred
-krb5_gss_verify
-krb5_gss_verify_mic
-krb5_gss_wrap
-krb5_gss_wrap_size_limit
krb5_gss_use_kdc_context
DEFS=
##DOSBUILDTOP = ..\..\..
-##DOSLIBNAME=..\$(OUTPRE)gssapi.$(LIBEXT)
+##DOS##PREFIXDIR=mechglue
+##DOS##OBJFILE=..\$(OUTPRE)mechglue.lst
##DOS##DLL_EXP_TYPE=GSS
$(srcdir)/g_sign.c \
$(srcdir)/g_store_cred.c \
$(srcdir)/g_unseal.c \
- $(srcdir)/g_userok.c \
- $(srcdir)/g_utils.c \
$(srcdir)/g_verify.c \
- $(srcdir)/gssd_pname_to_uid.c \
$(srcdir)/oid_ops.c
+OBJS = \
+ $(OUTPRE)g_accept_sec_context.$(OBJEXT) \
+ $(OUTPRE)g_acquire_cred.$(OBJEXT) \
+ $(OUTPRE)g_canon_name.$(OBJEXT) \
+ $(OUTPRE)g_compare_name.$(OBJEXT) \
+ $(OUTPRE)g_context_time.$(OBJEXT) \
+ $(OUTPRE)g_delete_sec_context.$(OBJEXT) \
+ $(OUTPRE)g_dsp_name.$(OBJEXT) \
+ $(OUTPRE)g_dsp_status.$(OBJEXT) \
+ $(OUTPRE)g_dup_name.$(OBJEXT) \
+ $(OUTPRE)g_exp_sec_context.$(OBJEXT) \
+ $(OUTPRE)g_export_name.$(OBJEXT) \
+ $(OUTPRE)g_glue.$(OBJEXT) \
+ $(OUTPRE)g_imp_name.$(OBJEXT) \
+ $(OUTPRE)g_imp_sec_context.$(OBJEXT) \
+ $(OUTPRE)g_init_sec_context.$(OBJEXT) \
+ $(OUTPRE)g_initialize.$(OBJEXT) \
+ $(OUTPRE)g_inq_context.$(OBJEXT) \
+ $(OUTPRE)g_inq_cred.$(OBJEXT) \
+ $(OUTPRE)g_inq_names.$(OBJEXT) \
+ $(OUTPRE)g_mechname.$(OBJEXT) \
+ $(OUTPRE)g_oid_ops.$(OBJEXT) \
+ $(OUTPRE)g_process_context.$(OBJEXT) \
+ $(OUTPRE)g_rel_buffer.$(OBJEXT) \
+ $(OUTPRE)g_rel_cred.$(OBJEXT) \
+ $(OUTPRE)g_rel_name.$(OBJEXT) \
+ $(OUTPRE)g_rel_oid_set.$(OBJEXT) \
+ $(OUTPRE)g_seal.$(OBJEXT) \
+ $(OUTPRE)g_sign.$(OBJEXT) \
+ $(OUTPRE)g_store_cred.$(OBJEXT) \
+ $(OUTPRE)g_unseal.$(OBJEXT) \
+ $(OUTPRE)g_verify.$(OBJEXT) \
+ $(OUTPRE)oid_ops.$(OBJEXT)
+
STLIBOBJS = \
g_accept_sec_context.o \
g_acquire_cred.o \
g_sign.o \
g_store_cred.o \
g_unseal.o \
- g_userok.o \
- g_utils.o \
g_verify.o \
- gssd_pname_to_uid.o \
oid_ops.o
EHDRDIR= $(BUILDTOP)$(S)include$(S)gssapi
EXPORTED_HEADERS = mechglue.h
+$(OBJS): $(EXPORTED_HEADERS)
+
all-unix:: all-libobjs
+##DOS##LIBOBJS = $(OBJS)
+
clean-unix:: clean-libobjs
# Krb5InstallHeaders($(EXPORTED_HEADERS), $(KRB5_INCDIR)/krb5)
includes::
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
# Makefile dependencies follow. This must be the last section in
$(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/gssapi/gssapi.h \
$(COM_ERR_DEPS) $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
$(srcdir)/../generic/gssapiP_generic.h $(srcdir)/../generic/gssapi_generic.h \
- ../generic/gssapi_err_generic.h g_initialize.c mechglue.h \
- mglueP.h
+ $(srcdir)/../gss_libinit.h ../generic/gssapi.h ../generic/gssapi_err_generic.h \
+ g_initialize.c mechglue.h mglueP.h
g_inq_context.so g_inq_context.po $(OUTPRE)g_inq_context.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/gssapi/gssapi.h \
$(COM_ERR_DEPS) $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
$(srcdir)/../generic/gssapiP_generic.h $(srcdir)/../generic/gssapi_generic.h \
../generic/gssapi_err_generic.h g_unseal.c mechglue.h \
mglueP.h
-g_userok.so g_userok.po $(OUTPRE)g_userok.$(OBJEXT): \
- $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/gssapi/gssapi.h \
- $(COM_ERR_DEPS) $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
- $(srcdir)/../generic/gssapiP_generic.h $(srcdir)/../generic/gssapi_generic.h \
- ../generic/gssapi_err_generic.h g_userok.c mechglue.h \
- mglueP.h
-g_utils.so g_utils.po $(OUTPRE)g_utils.$(OBJEXT): $(BUILDTOP)/include/gssapi/gssapi.h \
- g_utils.c
g_verify.so g_verify.po $(OUTPRE)g_verify.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/gssapi/gssapi.h \
$(COM_ERR_DEPS) $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
$(srcdir)/../generic/gssapiP_generic.h $(srcdir)/../generic/gssapi_generic.h \
../generic/gssapi_err_generic.h g_verify.c mechglue.h \
mglueP.h
-gssd_pname_to_uid.so gssd_pname_to_uid.po $(OUTPRE)gssd_pname_to_uid.$(OBJEXT): \
- $(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/gssapi/gssapi.h \
- $(COM_ERR_DEPS) $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
- $(srcdir)/../generic/gssapiP_generic.h $(srcdir)/../generic/gssapi_generic.h \
- ../generic/gssapi_err_generic.h gssd_pname_to_uid.c \
- mechglue.h mglueP.h
oid_ops.so oid_ops.po $(OUTPRE)oid_ops.$(OBJEXT): $(BUILDTOP)/include/autoconf.h \
$(BUILDTOP)/include/gssapi/gssapi.h $(BUILDTOP)/include/gssapi/gssapi_generic.h \
$(COM_ERR_DEPS) $(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-thread.h \
+++ /dev/null
-/* #ident "@(#)gss_indicate_mechs.c 1.13 95/08/04 SMI" */
-
-/*
- * Copyright 1996 by Sun Microsystems, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appears in all copies and
- * that both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Sun Microsystems not be used
- * in advertising or publicity pertaining to distribution of the software
- * without specific, written prior permission. Sun Microsystems makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
- * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * glue routine for gss_indicate_mechs
- */
-
-#include "mglueP.h"
-#include <stdio.h>
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#include <string.h>
-
-extern gss_mechanism *gssint_mechs_array;
-
-static gss_OID_set_desc supported_mechs_desc;
-static gss_OID_set supported_mechs = NULL;
-
-OM_uint32 KRB5_CALLCONV
-gss_indicate_mechs (minor_status,
- mech_set)
-
-OM_uint32 * minor_status;
-gss_OID_set * mech_set;
-
-{
- int i;
-
- gss_initialize();
-
- if (minor_status)
- *minor_status = 0;
-
- /*
- * If we have already computed the mechanisms supported, return
- * a pointer to it. Otherwise, compute them and return the pointer.
- */
-
- if(supported_mechs == NULL) {
-
- supported_mechs = &supported_mechs_desc;
- supported_mechs->count = 0;
-
- /* Build the mech_set from the OIDs in mechs_array. */
-
- for(i=0; gssint_mechs_array[i]->mech_type.length != 0; i++)
- supported_mechs->count++;
-
- supported_mechs->elements =
- (void *) malloc(supported_mechs->count *
- sizeof(gss_OID_desc));
-
- for(i=0; i < supported_mechs->count; i++) {
- supported_mechs->elements[i].length =
- gssint_mechs_array[i]->mech_type.length;
- supported_mechs->elements[i].elements = (void *)
- malloc(gssint_mechs_array[i]->mech_type.length);
- memcpy(supported_mechs->elements[i].elements,
- gssint_mechs_array[i]->mech_type.elements,
- gssint_mechs_array[i]->mech_type.length);
- }
- }
-
- if(mech_set != NULL)
- *mech_set = supported_mechs;
-
- return(GSS_S_COMPLETE);
-}
*/
#include "mglueP.h"
+#include "gss_libinit.h"
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <ctype.h>
#include <errno.h>
-#include <dlfcn.h>
-
-#define MECH_CONF "/etc/gss/mech"
-
-#define MECH_LIB_PREFIX1 "/usr/lib/"
-
-#define MECH_LIB_PREFIX2 ""
-
-#define MECH_LIB_DIR "gss/"
-
-#define MECH_LIB_PREFIX MECH_LIB_PREFIX1 MECH_LIB_PREFIX2 MECH_LIB_DIR
-
-#define MECH_SYM "gss_mech_initialize"
-
#define M_DEFAULT "default"
-#include <sys/stat.h>
-
#include "k5-thread.h"
/* Local functions */
static gss_mech_info searchMechList(const gss_OID);
-static void loadConfigFile(const char *);
static void updateMechList(void);
static void register_mech(gss_mechanism, const char *, void *);
static gss_mech_info g_mechList = NULL;
static gss_mech_info g_mechListTail = NULL;
static k5_mutex_t g_mechListLock = K5_MUTEX_PARTIAL_INITIALIZER;
-static time_t g_confFileModTime = (time_t)0;
-static time_t g_mechSetTime = (time_t)0;
static gss_OID_set_desc g_mechSet = { 0, NULL };
static k5_mutex_t g_mechSetLock = K5_MUTEX_PARTIAL_INITIALIZER;
OM_uint32 *minorStatus;
gss_OID_set *mechSet;
{
- char *fileName;
- struct stat fileInfo;
int i, j;
gss_OID curItem;
if (mechSet == NULL)
return (GSS_S_CALL_INACCESSIBLE_WRITE);
- fileName = MECH_CONF;
-
-#if 0
- /*
- * If we have already computed the mechanisms supported and if it
- * is still valid; make a copy and return to caller,
- * otherwise build it first.
- */
- if ((stat(fileName, &fileInfo) == 0 &&
- fileInfo.st_mtime > g_mechSetTime)) {
- } /* if g_mechSet is out of date or not initialized */
-#endif
if (build_mechSet())
return GSS_S_FAILURE;
*/
(void) k5_mutex_lock(&g_mechListLock);
-#if 0
- /*
- * this checks for the case when we need to re-construct the
- * g_mechSet structure, but the mechanism list is upto date
- * (because it has been read by someone calling
- * gssint_get_mechanism)
- */
- if (fileInfo.st_mtime > g_confFileModTime)
- {
- g_confFileModTime = fileInfo.st_mtime;
- loadConfigFile(fileName);
- }
-#endif
-
updateMechList();
/*
}
}
-#if 0
- g_mechSetTime = fileInfo.st_mtime;
-#endif
(void) k5_mutex_unlock(&g_mechSetLock);
(void) k5_mutex_unlock(&g_mechListLock);
static void
updateMechList(void)
{
- char *fileName;
- struct stat fileInfo;
init_hardcoded();
- fileName = MECH_CONF;
-
-#if 0
- /* check if mechList needs updating */
- if (stat(fileName, &fileInfo) == 0 &&
- (fileInfo.st_mtime > g_confFileModTime)) {
- loadConfigFile(fileName);
- g_confFileModTime = fileInfo.st_mtime;
- }
-#endif
+
} /* updateMechList */
/*
extern gss_mechanism *spnego_gss_get_mech_configs(void);
gss_mechanism *cflist;
static int inited;
- gss_mech_info cf;
if (inited)
return;
* module if it has not been already loaded.
*/
gss_mechanism
-gssint_get_mechanism(oid)
-const gss_OID oid;
+gssint_get_mechanism(gss_OID oid)
{
gss_mech_info aMech;
- gss_mechanism (*sym)(const gss_OID);
- void *dl;
if (gssint_initialize_library())
return NULL;
if (aMech->mech) {
(void) k5_mutex_unlock(&g_mechListLock);
return (aMech->mech);
+ } else {
+ return NULL;
}
-
- /* we found the mechanism, but it is not loaded */
- if ((dl = dlopen(aMech->uLibName, RTLD_NOW)) == NULL) {
-#if 0
- (void) syslog(LOG_INFO, "libgss dlopen(%s): %s\n",
- aMech->uLibName, dlerror());
-#endif
- (void) k5_mutex_unlock(&g_mechListLock);
- return ((gss_mechanism)NULL);
- }
-
- if ((sym = (gss_mechanism (*)(const gss_OID))dlsym(dl, MECH_SYM))
- == NULL) {
- (void) dlclose(dl);
-#if 0
- (void) syslog(LOG_INFO, "unable to initialize mechanism"
- " library [%s]\n", aMech->uLibName);
-#endif
- (void) k5_mutex_unlock(&g_mechListLock);
- return ((gss_mechanism)NULL);
- }
-
- /* Call the symbol to get the mechanism table */
- aMech->mech = (*sym)(aMech->mech_type);
-
- if (aMech->mech == NULL) {
- (void) dlclose(dl);
-#if 0
- (void) syslog(LOG_INFO, "unable to initialize mechanism"
- " library [%s]\n", aMech->uLibName);
-#endif
- (void) k5_mutex_unlock(&g_mechListLock);
- return ((gss_mechanism)NULL);
- }
-
- aMech->dl_handle = dl;
-
- (void) k5_mutex_unlock(&g_mechListLock);
- return (aMech->mech);
} /* gssint_get_mechanism */
-gss_mechanism_ext
-gssint_get_mechanism_ext(oid)
-const gss_OID oid;
-{
- gss_mech_info aMech;
- gss_mechanism_ext mech_ext;
-
- /* check if the mechanism is already loaded */
- if ((aMech = searchMechList(oid)) != NULL && aMech->mech_ext != NULL)
- return (aMech->mech_ext);
-
- if (gssint_get_mechanism(oid) == NULL)
- return (NULL);
-
- if (aMech->dl_handle == NULL)
- return (NULL);
-
- /* Load the gss_config_ext struct for this mech */
-
- mech_ext = (gss_mechanism_ext)malloc(sizeof (struct gss_config_ext));
-
- if (mech_ext == NULL)
- return (NULL);
-
- /*
- * dlsym() the mech's 'method' functions for the extended APIs
- *
- * NOTE: Until the void *context argument is removed from the
- * SPI method functions' signatures it will be necessary to have
- * different function pointer typedefs and function names for
- * the SPI methods than for the API. When this argument is
- * removed it will be possible to rename gss_*_sfct to gss_*_fct
- * and and gssspi_* to gss_*.
- */
- mech_ext->gss_acquire_cred_with_password =
- (gss_acquire_cred_with_password_sfct)dlsym(aMech->dl_handle,
- "gssspi_acquire_cred_with_password");
-
- /* Set aMech->mech_ext */
- (void) k5_mutex_lock(&g_mechListLock);
-
- if (aMech->mech_ext == NULL)
- aMech->mech_ext = mech_ext;
- else
- free(mech_ext); /* we raced and lost; don't leak */
-
- (void) k5_mutex_unlock(&g_mechListLock);
-
- return (aMech->mech_ext);
-
-} /* gssint_get_mechanism_ext */
-
/*
* this routine is used for searching the list of mechanism data.
/* none found */
return ((gss_mech_info) NULL);
} /* searchMechList */
-
-
-/*
- * loads the configuration file
- * this is called while having a mutex lock on the mechanism list
- * entries for libraries that have been loaded can't be modified
- * mechNameStr and mech_type fields are not updated during updates
- */
-static void loadConfigFile(fileName)
-const char *fileName;
-{
- char buffer[BUFSIZ], *oidStr, *oid, *sharedLib, *kernMod, *endp;
- char *modOptions;
- char sharedPath[sizeof (MECH_LIB_PREFIX) + BUFSIZ];
- char *tmpStr;
- FILE *confFile;
- gss_OID mechOid;
- gss_mech_info aMech, tmp;
- OM_uint32 minor;
- gss_buffer_desc oidBuf;
-
- if ((confFile = fopen(fileName, "r")) == NULL) {
- return;
- }
-
- (void) memset(buffer, 0, sizeof (buffer));
- while (fgets(buffer, BUFSIZ, confFile) != NULL) {
-
- /* ignore lines beginning with # */
- if (*buffer == '#')
- continue;
-
- /*
- * find the first white-space character after
- * the mechanism name
- */
- oidStr = buffer;
- for (oid = buffer; *oid && !isspace(*oid); oid++);
-
- /* Now find the first non-white-space character */
- if (*oid) {
- *oid = '\0';
- oid++;
- while (*oid && isspace(*oid))
- oid++;
- }
-
- /*
- * If that's all, then this is a corrupt entry. Skip it.
- */
- if (! *oid)
- continue;
-
- /* Find the end of the oid and make sure it is NULL-ended */
- for (endp = oid; *endp && !isspace(*endp); endp++)
- ;
-
- if (*endp) {
- *endp = '\0';
- }
-
- /*
- * check if an entry for this oid already exists
- * if it does, and the library is already loaded then
- * we can't modify it, so skip it
- */
- oidBuf.value = (void *)oid;
- oidBuf.length = strlen(oid);
- if (generic_gss_str_to_oid(&minor, &oidBuf, &mechOid)
- != GSS_S_COMPLETE) {
-#if 0
- (void) syslog(LOG_INFO, "invalid mechanism oid"
- " [%s] in configuration file", oid);
-#endif
- continue;
- }
-
- k5_mutex_lock(&g_mechListLock);
- aMech = searchMechList(mechOid);
- if (aMech && aMech->mech) {
- free(mechOid->elements);
- free(mechOid);
- k5_mutex_unlock(&g_mechListLock);
- continue;
- }
- k5_mutex_unlock(&g_mechListLock);
-
- /* Find the start of the shared lib name */
- for (sharedLib = endp+1; *sharedLib && isspace(*sharedLib);
- sharedLib++)
- ;
-
- /*
- * If that's all, then this is a corrupt entry. Skip it.
- */
- if (! *sharedLib) {
- free(mechOid->elements);
- free(mechOid);
- continue;
- }
-
- /*
- * Find the end of the shared lib name and make sure it is
- * NULL-terminated.
- */
- for (endp = sharedLib; *endp && !isspace(*endp); endp++)
- ;
-
- if (*endp) {
- *endp = '\0';
- }
-
- /* Find the start of the optional kernel module lib name */
- for (kernMod = endp+1; *kernMod && isspace(*kernMod);
- kernMod++)
- ;
-
- /*
- * If this item starts with a bracket "[", then
- * it is not a kernel module, but is a list of
- * options for the user module to parse later.
- */
- if (*kernMod && *kernMod != '[') {
- /*
- * Find the end of the shared lib name and make sure
- * it is NULL-terminated.
- */
- for (endp = kernMod; *endp && !isspace(*endp); endp++)
- ;
-
- if (*endp) {
- *endp = '\0';
- }
- } else
- kernMod = NULL;
-
- /* Find the start of the optional module options list */
- for (modOptions = endp+1; *modOptions && isspace(*modOptions);
- modOptions++);
-
- if (*modOptions == '[') {
- /* move past the opening bracket */
- for (modOptions = modOptions+1;
- *modOptions && isspace(*modOptions);
- modOptions++);
-
- /* Find the closing bracket */
- for (endp = modOptions;
- *endp && *endp != ']'; endp++);
-
- if (endp)
- *endp = '\0';
-
- } else {
- modOptions = NULL;
- }
-
- (void) strcpy(sharedPath, MECH_LIB_PREFIX);
- (void) strcat(sharedPath, sharedLib);
-
- /*
- * are we creating a new mechanism entry or
- * just modifying existing (non loaded) mechanism entry
- */
- if (aMech) {
- /*
- * delete any old values and set new
- * mechNameStr and mech_type are not modified
- */
- if (aMech->kmodName) {
- free(aMech->kmodName);
- aMech->kmodName = NULL;
- }
-
- if (aMech->optionStr) {
- free(aMech->optionStr);
- aMech->optionStr = NULL;
- }
-
- if ((tmpStr = strdup(sharedPath)) != NULL) {
- if (aMech->uLibName)
- free(aMech->uLibName);
- aMech->uLibName = tmpStr;
- }
-
- if (kernMod) /* this is an optional parameter */
- aMech->kmodName = strdup(kernMod);
-
- if (modOptions) /* optional module options */
- aMech->optionStr = strdup(modOptions);
-
- /* the oid is already set */
- free(mechOid->elements);
- free(mechOid);
- continue;
- }
-
- /* adding a new entry */
- aMech = malloc(sizeof (struct gss_mech_config));
- if (aMech == NULL) {
- free(mechOid->elements);
- free(mechOid);
- continue;
- }
- (void) memset(aMech, 0, sizeof (struct gss_mech_config));
- aMech->mech_type = mechOid;
- aMech->uLibName = strdup(sharedPath);
- aMech->mechNameStr = strdup(oidStr);
-
- /* check if any memory allocations failed - bad news */
- if (aMech->uLibName == NULL || aMech->mechNameStr == NULL) {
- if (aMech->uLibName)
- free(aMech->uLibName);
- if (aMech->mechNameStr)
- free(aMech->mechNameStr);
- free(mechOid->elements);
- free(mechOid);
- free(aMech);
- continue;
- }
- if (kernMod) /* this is an optional parameter */
- aMech->kmodName = strdup(kernMod);
-
- if (modOptions)
- aMech->optionStr = strdup(modOptions);
- /*
- * add the new entry to the end of the list - make sure
- * that only complete entries are added because other
- * threads might currently be searching the list.
- */
- tmp = g_mechListTail;
- g_mechListTail = aMech;
-
- if (tmp != NULL)
- tmp->next = aMech;
-
- if (g_mechList == NULL)
- g_mechList = aMech;
- } /* while */
- (void) fclose(confFile);
-} /* loadConfigFile */
+++ /dev/null
-/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-/* #pragma ident "@(#)g_userok.c 1.1 04/03/25 SMI" */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <mglueP.h>
-#include <gssapi/gssapi.h>
-
-
-static OM_uint32
-compare_names(OM_uint32 *minor,
- const gss_OID mech_type,
- const gss_name_t name,
- const char *user,
- int *user_ok)
-{
-
- OM_uint32 status, tmpMinor;
- gss_name_t imported_name;
- gss_name_t canon_name;
- gss_buffer_desc gss_user;
- int match = 0;
-
- *user_ok = 0;
-
- gss_user.value = (void *)user;
- if (!gss_user.value || !name || !mech_type)
- return (GSS_S_BAD_NAME);
- gss_user.length = strlen(gss_user.value);
-
- status = gss_import_name(minor,
- &gss_user,
- GSS_C_NT_USER_NAME,
- &imported_name);
- if (status != GSS_S_COMPLETE) {
- goto out;
- }
-
- status = gss_canonicalize_name(minor,
- imported_name,
- mech_type,
- &canon_name);
- if (status != GSS_S_COMPLETE) {
- (void) gss_release_name(&tmpMinor, &imported_name);
- goto out;
- }
-
- status = gss_compare_name(minor,
- canon_name,
- name,
- &match);
- (void) gss_release_name(&tmpMinor, &canon_name);
- (void) gss_release_name(&tmpMinor, &imported_name);
- if (status == GSS_S_COMPLETE) {
- if (match)
- *user_ok = 1; /* remote user is a-ok */
- }
-
-out:
- return (status);
-}
-
-
-OM_uint32
-gssint_userok(OM_uint32 *minor,
- const gss_name_t name,
- const char *user,
- int *user_ok)
-
-{
- gss_mechanism mech;
- gss_union_name_t intName;
- gss_name_t mechName = NULL;
- OM_uint32 major;
-
- if (minor == NULL || user_ok == NULL)
- return (GSS_S_CALL_INACCESSIBLE_WRITE);
-
- if (name == NULL || user == NULL)
- return (GSS_S_CALL_INACCESSIBLE_READ);
-
- *user_ok = 0;
- *minor = GSS_S_COMPLETE;
-
- intName = (gss_union_name_t)name;
-
- mech = gssint_get_mechanism(intName->mech_type);
- if (mech == NULL)
- return (GSS_S_UNAVAILABLE);
-
- /* may need to import the name if this is not MN */
- if (intName->mech_type == NULL) {
- return (GSS_S_FAILURE);
- } else
- mechName = intName->mech_name;
-
- if (mech->gssint_userok)
- major = mech->gssint_userok(mech->context, minor, mechName,
- user, user_ok);
- else
- major = compare_names(minor, intName->mech_type,
- name, user, user_ok);
-
- return (major);
-} /* gss_userok */
+++ /dev/null
-/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
- * Use is subject to license terms.
- */
-
-/* #pragma ident "@(#)g_utils.c 1.8 04/02/23 SMI" */
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
-#include <ctype.h>
-#include <errno.h>
-#include <gssapi/gssapi.h>
-
-#define Q_DEFAULT "default"
-#define BUFLEN 256
-
-#if 0
-static int qop_num_pair_cnt;
-static const char QOP_NUM_FILE[] = "/etc/gss/qop";
-static qop_num qop_num_pairs[MAX_QOP_NUM_PAIRS+1];
-static mutex_t qopfile_lock = DEFAULTMUTEX;
-
-static OM_uint32 gssint_read_qop_file(void);
-
-/*
- * This routine fetches qop and num from "/etc/gss/qop".
- * There is a memory leak associated with rereading this file,
- * because we can't free the qop_num_pairs array when we reread
- * the file (some callers may have been given these pointers).
- * In general, this memory leak should be a small one, because
- * we don't expect the qop file to be changed and reread often.
- */
-static OM_uint32
-gssint_read_qop_file(void)
-{
- char buf[BUFLEN]; /* one line from the file */
- char *name, *next;
- char *qopname, *num_str;
- char *line;
- FILE *fp;
- static int last = 0;
- struct stat stbuf;
- OM_uint32 major = GSS_S_COMPLETE;
-
- (void) mutex_lock(&qopfile_lock);
- if (stat(QOP_NUM_FILE, &stbuf) != 0 || stbuf.st_mtime < last) {
- if (!qop_num_pairs[0].qop) {
- major = GSS_S_FAILURE;
- }
- goto done;
- }
- last = stbuf.st_mtime;
-
- fp = fopen(QOP_NUM_FILE, "r");
- if (fp == (FILE *)0) {
- major = GSS_S_FAILURE;
- goto done;
- }
-
- /*
- * For each line in the file parse it appropriately.
- * File format : qopname num(int)
- * Note that we silently ignore corrupt entries.
- */
- qop_num_pair_cnt = 0;
- while (!feof(fp)) {
- line = fgets(buf, BUFLEN, fp);
- if (line == NULL)
- break;
-
- /* Skip comments and blank lines */
- if ((*line == '#') || (*line == '\n'))
- continue;
-
- /* Skip trailing comments */
- next = strchr(line, '#');
- if (next)
- *next = '\0';
-
- name = &(buf[0]);
- while (isspace(*name))
- name++;
- if (*name == '\0') /* blank line */
- continue;
-
- qopname = name; /* will contain qop name */
- while (!isspace(*qopname))
- qopname++;
- if (*qopname == '\0') {
- continue;
- }
- next = qopname+1;
- *qopname = '\0'; /* null terminate qopname */
- qop_num_pairs[qop_num_pair_cnt].qop = strdup(name);
- if (qop_num_pairs[qop_num_pair_cnt].qop == NULL)
- continue;
-
- name = next;
- while (isspace(*name))
- name++;
- if (*name == '\0') { /* end of line, no num */
- free(qop_num_pairs[qop_num_pair_cnt].qop);
- continue;
- }
- num_str = name; /* will contain num (n) */
- while (!isspace(*num_str))
- num_str++;
- next = num_str+1;
- *num_str++ = '\0'; /* null terminate num_str */
-
- qop_num_pairs[qop_num_pair_cnt].num = (OM_uint32)atoi(name);
- name = next;
- while (isspace(*name))
- name++;
- if (*name == '\0') { /* end of line, no mechanism */
- free(qop_num_pairs[qop_num_pair_cnt].qop);
- continue;
- }
- num_str = name; /* will contain mech */
- while (!isspace(*num_str))
- num_str++;
- *num_str = '\0';
-
- qop_num_pairs[qop_num_pair_cnt].mech = strdup(name);
- if (qop_num_pairs[qop_num_pair_cnt].mech == NULL) {
- free(qop_num_pairs[qop_num_pair_cnt].qop);
- continue;
- }
-
- if (qop_num_pair_cnt++ >= MAX_QOP_NUM_PAIRS)
- break;
- }
- (void) fclose(fp);
-done:
- (void) mutex_unlock(&qopfile_lock);
- return (major);
-}
-
-OM_uint32
-gssint_qop_to_num(
- char *qop,
- char *mech,
- OM_uint32 *num
-)
-{
- int i;
- OM_uint32 major = GSS_S_FAILURE;
-
- if (!num)
- return (GSS_S_CALL_INACCESSIBLE_WRITE);
-
- if (qop == NULL || strlen(qop) == 0 ||
- strcasecmp(qop, Q_DEFAULT) == 0) {
- *num = GSS_C_QOP_DEFAULT;
- return (GSS_S_COMPLETE);
- }
-
- if ((major = gssint_read_qop_file()) != GSS_S_COMPLETE)
- return (major);
-
- for (i = 0; i < qop_num_pair_cnt; i++) {
- if ((strcasecmp(mech, qop_num_pairs[i].mech) == 0) &&
- (strcasecmp(qop, qop_num_pairs[i].qop) == 0)) {
- *num = qop_num_pairs[i].num;
- return (GSS_S_COMPLETE);
- }
- }
-
- return (GSS_S_FAILURE);
-}
-
-OM_uint32
-gssint_num_to_qop(
- char *mech,
- OM_uint32 num,
- char **qop
-)
-{
- int i;
- OM_uint32 major;
-
- if (!qop)
- return (GSS_S_CALL_INACCESSIBLE_WRITE);
- *qop = NULL;
-
- if (num == GSS_C_QOP_DEFAULT) {
- *qop = Q_DEFAULT;
- return (GSS_S_COMPLETE);
- }
-
- if (mech == NULL)
- return (GSS_S_CALL_INACCESSIBLE_READ);
-
- if ((major = gssint_read_qop_file()) != GSS_S_COMPLETE)
- return (major);
-
- for (i = 0; i < qop_num_pair_cnt; i++) {
- if ((strcasecmp(mech, qop_num_pairs[i].mech) == 0) &&
- (num == qop_num_pairs[i].num)) {
- *qop = qop_num_pairs[i].qop;
- return (GSS_S_COMPLETE);
- }
- }
- return (GSS_S_FAILURE);
-}
-
-/*
- * For a given mechanism pass back qop information about it in a buffer
- * of size MAX_QOPS_PER_MECH+1.
- */
-OM_uint32
-gssint_get_mech_info(
- char *mech,
- char **qops
-)
-{
- int i, cnt = 0;
- OM_uint32 major = GSS_S_COMPLETE;
-
- if (!qops)
- return (GSS_S_CALL_INACCESSIBLE_WRITE);
- *qops = NULL;
-
- if (!mech)
- return (GSS_S_CALL_INACCESSIBLE_READ);
-
- if ((major = gssint_read_qop_file()) != GSS_S_COMPLETE)
- return (major);
-
- for (i = 0; i < qop_num_pair_cnt; i++) {
- if (strcmp(mech, qop_num_pairs[i].mech) == 0) {
- if (cnt >= MAX_QOPS_PER_MECH) {
- return (GSS_S_FAILURE);
- }
- qops[cnt++] = qop_num_pairs[i].qop;
- }
- }
- qops[cnt] = NULL;
- return (GSS_S_COMPLETE);
-}
-
-/*
- * Copy the qop values and names for the mechanism back in a qop_num
- * buffer of size MAX_QOPS_PER_MECH provided by the caller.
- */
-OM_uint32
-gssint_mech_qops(
- char *mech,
- qop_num *mechqops,
- int *numqop
-)
-{
- int i;
- OM_uint32 major;
- int cnt = 0;
-
- if (!mechqops || !numqop)
- return (GSS_S_CALL_INACCESSIBLE_WRITE);
- *numqop = 0;
-
- if (!mech)
- return (GSS_S_CALL_INACCESSIBLE_READ);
-
- if ((major = gssint_read_qop_file()) != GSS_S_COMPLETE)
- return (major);
-
- for (i = 0; i < qop_num_pair_cnt; i++) {
- if (strcasecmp(mech, qop_num_pairs[i].mech) == 0) {
- if (cnt >= MAX_QOPS_PER_MECH) {
- return (GSS_S_FAILURE);
- }
- mechqops[cnt++] = qop_num_pairs[i];
- }
- }
- *numqop = cnt;
- return (GSS_S_COMPLETE);
-}
-#endif
+++ /dev/null
-/*
- * Copyright 1993 by OpenVision Technologies, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appears in all copies and
- * that both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of OpenVision not be used
- * in advertising or publicity pertaining to distribution of the software
- * without specific, written prior permission. OpenVision makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- * OPENVISION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL OPENVISION BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
- * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include "mglueP.h"
-
-/*
- * See krb5/gssapi_krb5.c for a description of the algorithm for
- * encoding an object identifier.
- */
-
-/*
- * The OID of user_name is:
- * iso(1) member-body(2) US(840) mit(113554) infosys(1) gssapi(2)
- * generic(1) user_name(1) = 1.2.840.113554.1.2.1.1
- * machine_uid_name:
- * iso(1) member-body(2) US(840) mit(113554) infosys(1) gssapi(2)
- * generic(1) machine_uid_name(2) = 1.2.840.113554.1.2.1.2
- * string_uid_name:
- * iso(1) member-body(2) US(840) mit(113554) infosys(1) gssapi(2)
- * generic(1) string_uid_name(3) = 1.2.840.113554.1.2.1.3
- * service_name:
- * iso(1) member-body(2) US(840) mit(113554) infosys(1) gssapi(2)
- * generic(1) service_name(4) = 1.2.840.113554.1.2.1.4
- */
-
-static const gss_OID_desc oids[] = {
- {10, "\052\206\110\206\367\022\001\002\001\001"},
- {10, "\052\206\110\206\367\022\001\002\001\002"},
- {10, "\052\206\110\206\367\022\001\002\001\003"},
- {10, "\052\206\110\206\367\022\001\002\001\004"},
-};
-
-const gss_OID_desc * const gss_nt_user_name = oids+0;
-const gss_OID_desc * const gss_nt_machine_uid_name = oids+1;
-const gss_OID_desc * const gss_nt_string_uid_name = oids+2;
-const gss_OID_desc * const gss_nt_service_name = oids+3;
+++ /dev/null
-/* #pragma ident "@(#)gssd_pname_to_uid.c 1.18 04/02/23 SMI" */
-
-/*
- * Copyright 1996 by Sun Microsystems, Inc.
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appears in all copies and
- * that both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Sun Microsystems not be used
- * in advertising or publicity pertaining to distribution of the software
- * without specific, written prior permission. Sun Microsystems makes no
- * representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- * SUN MICROSYSTEMS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- * EVENT SHALL SUN MICROSYSTEMS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
- * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
- * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * glue routines that test the mech id either passed in to
- * gss_init_sec_contex() or gss_accept_sec_context() or within the glue
- * routine supported version of the security context and then call
- * the appropriate underlying mechanism library procedure.
- *
- */
-
-#include "mglueP.h"
-
-int gssd_pname_to_uid(pname, name_type, mech_type, uid)
-
-char * pname;
-gss_OID name_type;
-gss_OID mech_type;
-uid_t * uid;
-{
- int status;
- gss_mechanism mech;
-
- /*
- * find the appropriate mechanism specific pname_to_uid procedure and
- * call it.
- */
-
- mech = gssint_get_mechanism (mech_type);
-
- if (mech) {
- if (mech_type == GSS_C_NULL_OID)
- mech_type = &mech->mech_type;
-
- if (mech->pname_to_uid)
- status = mech->pname_to_uid(mech->context,
- pname, name_type, mech_type, uid);
- else
- status = GSS_S_BAD_MECH;
- } else
- status = GSS_S_BAD_MECH;
-
- return(status);
-}
/* GSSAPI Extension functions -- these functions aren't */
/* in the GSSAPI, but they are provided in this library */
-int gssd_pname_to_uid (char *, gss_OID, gss_OID, uid_t *);
-void gss_initialize (void);
-
#endif /* _GSS_MECHGLUE_H */
gss_union_cred_auxinfo auxinfo;
} gss_union_cred_desc, *gss_union_cred_t;
-typedef OM_uint32 (*gss_acquire_cred_with_password_sfct)(
- void *, /* context */
- OM_uint32 *, /* minor_status */
- const gss_name_t, /* desired_name */
- const gss_buffer_t, /* password */
- OM_uint32, /* time_req */
- const gss_OID_set, /* desired_mechs */
- int, /* cred_usage */
- gss_cred_id_t *, /* output_cred_handle */
- gss_OID_set *, /* actual_mechs */
- OM_uint32 * /* time_rec */
- /* */);
-
/********************************************************/
/* The Mechanism Dispatch Table -- a mechanism needs to */
/* define one of these and provide a function to return */
OM_uint32, /* req_output_size */
OM_uint32 * /* max_input_size */
);
- int (*pname_to_uid)
- (
- void *, /* context */
- char *, /* pname */
- gss_OID, /* name type */
- gss_OID, /* mech type */
- uid_t * /* uid */
- );
- OM_uint32 (*gssint_userok)
- (
- void *, /* context */
- OM_uint32 *, /* minor_status */
- const gss_name_t, /* pname */
- const char *, /* local user */
- int * /* user ok? */
- /* */);
OM_uint32 (*gss_export_name)
(
void *, /* context */
/* */);
} *gss_mechanism;
-/* This structure MUST NOT be used by any code outside libgss */
-typedef struct gss_config_ext {
- gss_acquire_cred_with_password_sfct gss_acquire_cred_with_password;
-} *gss_mechanism_ext;
-
/*
* In the user space we use a wrapper structure to encompass the
* mechanism entry points. The wrapper contain the mechanism
void *dl_handle; /* RTLD object handle for the mech */
gss_OID mech_type; /* mechanism oid */
gss_mechanism mech; /* mechanism initialization struct */
- gss_mechanism_ext mech_ext; /* extensions */
struct gss_mech_config *next; /* next element in the list */
} *gss_mech_info;
void gssint_mechglue_fini(void);
gss_mechanism gssint_get_mechanism (gss_OID);
-gss_mechanism_ext gssint_get_mechanism_ext(const gss_OID);
OM_uint32 gssint_get_mech_type (gss_OID, gss_buffer_t);
char *gssint_get_kmodName(const gss_OID);
char *gssint_get_modOptions(const gss_OID);
int arrayLen /* length of passed in array */
);
-OM_uint32
-gssint_userok(
- OM_uint32 *, /* minor */
- const gss_name_t, /* name */
- const char *, /* user */
- int * /* user_ok */
-);
-
OM_uint32
gss_store_cred(
OM_uint32 *, /* minor_status */
all-unix:: all-libobjs
+##DOS##LIBOBJS = $(OBJS)
+
clean-unix:: clean-libobjs
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
# Makefile dependencies follow. This must be the last section in
#
spnego_mech.so spnego_mech.po $(OUTPRE)spnego_mech.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/gssapi/gssapi.h \
- $(BUILDTOP)/include/krb5/krb5.h $(COM_ERR_DEPS) $(SRCTOP)/include/k5-platform.h \
- $(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/krb5.h \
+ $(BUILDTOP)/include/krb5/krb5.h $(BUILDTOP)/include/osconf.h \
+ $(BUILDTOP)/include/profile.h $(COM_ERR_DEPS) $(SRCTOP)/include/k5-err.h \
+ $(SRCTOP)/include/k5-int.h $(SRCTOP)/include/k5-platform.h \
+ $(SRCTOP)/include/k5-plugin.h $(SRCTOP)/include/k5-thread.h \
+ $(SRCTOP)/include/krb5.h $(SRCTOP)/include/krb5/locate_plugin.h \
+ $(SRCTOP)/include/port-sockets.h $(SRCTOP)/include/socket-utils.h \
$(SRCTOP)/include/syslog.h $(srcdir)/../generic/gssapiP_generic.h \
$(srcdir)/../generic/gssapi_generic.h $(srcdir)/../mechglue/mechglue.h \
$(srcdir)/../mechglue/mglueP.h ../generic/gssapi_err_generic.h \
};
const gss_OID_set_desc * const gss_mech_set_spnego = spnego_oidsets+0;
-#define TWRITE_STR(ptr, str, len) \
- memcpy((ptr), (char *)(str), (len)); \
- (ptr) += (len);
-
#ifdef DEBUG
#define dsyslog(a) syslog(LOG_DEBUG, a)
#else
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <k5-int.h>
#include <krb5.h>
-#include "gssapiP_spnego.h"
#include <mglueP.h>
+#include "gssapiP_spnego.h"
#include <gssapi_err_generic.h>
#undef g_token_size
static spnego_token_t make_spnego_token(char *);
static gss_buffer_desc make_err_msg(char *);
static int g_token_size(gss_OID_const, OM_uint32);
-static int g_make_token_header(gss_OID_const, int, unsigned char **, int);
-static int g_verify_token_header(gss_OID_const, int *, unsigned char **,
- int, int);
-static int g_verify_neg_token_init(unsigned char **, int);
+static int g_make_token_header(gss_OID_const, unsigned int,
+ unsigned char **, unsigned int);
+static int g_verify_token_header(gss_OID_const, unsigned int *,
+ unsigned char **,
+ int, unsigned int);
+static int g_verify_neg_token_init(unsigned char **, unsigned int);
static gss_OID get_mech_oid(OM_uint32 *, unsigned char **, size_t);
-static gss_buffer_t get_input_token(unsigned char **, int);
-static gss_OID_set get_mech_set(OM_uint32 *, unsigned char **, int);
+static gss_buffer_t get_input_token(unsigned char **, unsigned int);
+static gss_OID_set get_mech_set(OM_uint32 *, unsigned char **, unsigned int);
static OM_uint32 get_req_flags(unsigned char **, OM_uint32, OM_uint32 *);
static OM_uint32 get_available_mechs(OM_uint32 *, gss_name_t,
gss_cred_usage_t, gss_cred_id_t *, gss_OID_set *);
static void release_spnego_ctx(spnego_gss_ctx_id_t *);
static void check_spnego_options(spnego_gss_ctx_id_t);
static spnego_gss_ctx_id_t create_spnego_ctx(void);
-static int put_req_flags(unsigned char **, OM_uint32, int);
+static int put_req_flags(unsigned char **, OM_uint32, unsigned int);
static int put_mech_set(gss_OID_set mechSet, gss_buffer_t buf);
-static int put_input_token(unsigned char **, gss_buffer_t, int);
-static int put_mech_oid(unsigned char **, gss_OID_const, int);
-static int put_negResult(unsigned char **, OM_uint32, int);
+static int put_input_token(unsigned char **, gss_buffer_t, unsigned int);
+static int put_mech_oid(unsigned char **, gss_OID_const, unsigned int);
+static int put_negResult(unsigned char **, OM_uint32, unsigned int);
static OM_uint32
process_mic(OM_uint32 *, gss_buffer_t, spnego_gss_ctx_id_t,
negotiate_mech_type(OM_uint32 *, gss_OID_set, gss_OID_set,
OM_uint32 *);
static int
-g_get_tag_and_length(unsigned char **, int, int, int *);
+g_get_tag_and_length(unsigned char **, int, unsigned int, unsigned int *);
static int
make_spnego_tokenInit_msg(spnego_gss_ctx_id_t, gss_buffer_t,
spnego_gss_inquire_context, /* gss_inquire_context */
NULL, /* gss_internal_release_oid */
spnego_gss_wrap_size_limit, /* gss_wrap_size_limit */
- NULL, /* gss_pname_to_uid */
- NULL, /* gssint_userok */
NULL, /* gss_export_name */
NULL, /* gss_store_cred */
};
OM_uint32 ret, tmpmin;
gss_OID supportedMech;
spnego_gss_ctx_id_t sc;
- int len;
+ unsigned int len;
unsigned char *ptr, *bufstart;
sc = (spnego_gss_ctx_id_t)*ctx;
*/
static int
-put_mech_oid(unsigned char **buf_out, gss_OID_const mech, int buflen)
+put_mech_oid(unsigned char **buf_out, gss_OID_const mech, unsigned int buflen)
{
if (buflen < mech->length + 2)
return (-1);
* buffer pointer.
*/
static gss_buffer_t
-get_input_token(unsigned char **buff_in, int buff_length)
+get_input_token(unsigned char **buff_in, unsigned int buff_length)
{
gss_buffer_t input_token;
unsigned int bytes;
static int
put_input_token(unsigned char **buf_out, gss_buffer_t input_token,
- int buflen)
+ unsigned int buflen)
{
int ret;
if ((ret = gssint_put_der_length(input_token->length, buf_out,
input_token->length)))
return (ret);
- TWRITE_STR(*buf_out, input_token->value, ((int)input_token->length));
+ TWRITE_STR(*buf_out, input_token->value, input_token->length);
return (0);
}
* return it, advancing the buffer pointer.
*/
static gss_OID_set
-get_mech_set(OM_uint32 *minor_status, unsigned char **buff_in, int buff_length)
+get_mech_set(OM_uint32 *minor_status, unsigned char **buff_in,
+ unsigned int buff_length)
{
gss_OID_set returned_mechSet;
OM_uint32 major_status;
put_mech_set(gss_OID_set mechSet, gss_buffer_t buf)
{
unsigned char *ptr;
- int i, tlen, ilen;
+ int i;
+ unsigned int tlen, ilen;
tlen = ilen = 0;
for (i = 0; i < mechSet->count; i++) {
get_req_flags(unsigned char **buff_in, OM_uint32 bodysize,
OM_uint32 *req_flags)
{
- int len;
- unsigned char *start = *buff_in;
+ unsigned int len;
if (**buff_in != (CONTEXT | 0x01))
return (0);
*/
static int
-put_req_flags(unsigned char **buf_out, OM_uint32 req_flags, int buflen)
+put_req_flags(unsigned char **buf_out, OM_uint32 req_flags,
+ unsigned int buflen)
{
int ret = 0;
if (buflen < 6)
{
OM_uint32 err;
unsigned char *ptr, *bufstart;
- int len;
+ unsigned int len;
gss_buffer_desc tmpbuf;
*minor_status = 0;
ptr = bufstart = buf->value;
if ((buf->length - (ptr - bufstart)) > INT_MAX)
return GSS_S_FAILURE;
-#define REMAIN ((int)(buf->length - (ptr - bufstart)))
+#define REMAIN (buf->length - (ptr - bufstart))
err = g_verify_token_header(gss_mech_spnego,
&len, &ptr, 0, REMAIN);
gss_buffer_t *mechListMIC)
{
unsigned char *ptr, *bufstart;
- int len, bytes;
- unsigned int tag;
+ unsigned int len;
+ int tmplen;
+ unsigned int tag, bytes;
*negState = ACCEPT_DEFECTIVE_TOKEN;
*supportedMech = GSS_C_NO_OID;
if (g_get_tag_and_length(&ptr, (CONTEXT | 0x01), REMAIN, &len) < 0)
return GSS_S_DEFECTIVE_TOKEN;
if (*ptr++ == SEQUENCE) {
- len = gssint_get_der_length(&ptr, REMAIN, &bytes);
- if (len < 0)
+ tmplen = gssint_get_der_length(&ptr, REMAIN, &bytes);
+ if (tmplen < 0)
return GSS_S_DEFECTIVE_TOKEN;
}
if (REMAIN < 1)
tag = *ptr++;
if (tag == CONTEXT) {
- len = gssint_get_der_length(&ptr, REMAIN, &bytes);
- if (len < 0)
+ tmplen = gssint_get_der_length(&ptr, REMAIN, &bytes);
+ if (tmplen < 0)
return GSS_S_DEFECTIVE_TOKEN;
if (g_get_tag_and_length(&ptr, ENUMERATED,
tag = *ptr++;
}
if (tag == (CONTEXT | 0x01)) {
- len = gssint_get_der_length(&ptr, REMAIN, &bytes);
- if (len < 0)
+ tmplen = gssint_get_der_length(&ptr, REMAIN, &bytes);
+ if (tmplen < 0)
return GSS_S_DEFECTIVE_TOKEN;
*supportedMech = get_mech_oid(minor_status, &ptr, REMAIN);
tag = *ptr++;
}
if (tag == (CONTEXT | 0x02)) {
- len = gssint_get_der_length(&ptr, REMAIN, &bytes);
- if (len < 0)
+ tmplen = gssint_get_der_length(&ptr, REMAIN, &bytes);
+ if (tmplen < 0)
return GSS_S_DEFECTIVE_TOKEN;
*responseToken = get_input_token(&ptr, REMAIN);
tag = *ptr++;
}
if (tag == (CONTEXT | 0x03)) {
- len = gssint_get_der_length(&ptr, REMAIN, &bytes);
- if (len < 0)
+ tmplen = gssint_get_der_length(&ptr, REMAIN, &bytes);
+ if (tmplen < 0)
return GSS_S_DEFECTIVE_TOKEN;
*mechListMIC = get_input_token(&ptr, REMAIN);
*/
static int
-put_negResult(unsigned char **buf_out, OM_uint32 negResult, int buflen)
+put_negResult(unsigned char **buf_out, OM_uint32 negResult,
+ unsigned int buflen)
{
if (buflen < 3)
return (-1);
gss_buffer_t data, send_token_flag sendtoken,
gss_buffer_t outbuf)
{
- int tlen, dataLen = 0, ret = 0;
- int negTokenInitSize = 0;
- int negTokenInitSeqSize = 0;
- int negTokenInitContSize = 0;
- int rspTokenSize = 0;
- int mechListTokenSize = 0;
- int micTokenSize = 0;
- int i;
+ int ret = 0;
+ unsigned int tlen, dataLen = 0;
+ unsigned int negTokenInitSize = 0;
+ unsigned int negTokenInitSeqSize = 0;
+ unsigned int negTokenInitContSize = 0;
+ unsigned int rspTokenSize = 0;
+ unsigned int mechListTokenSize = 0;
+ unsigned int micTokenSize = 0;
unsigned char *t;
unsigned char *ptr;
- unsigned char *MechListPtr = NULL;
- gss_buffer_desc MICbuff;
if (outbuf == GSS_C_NO_BUFFER)
return (-1);
send_token_flag sendtoken,
gss_buffer_t outbuf)
{
- int tlen;
- int ret;
- int NegTokenTargSize;
- int negresultTokenSize;
- int NegTokenSize;
- int rspTokenSize;
- int micTokenSize;
- int dataLen = 0;
+ unsigned int tlen = 0;
+ unsigned int ret = 0;
+ unsigned int NegTokenTargSize = 0;
+ unsigned int NegTokenSize = 0;
+ unsigned int rspTokenSize = 0;
+ unsigned int micTokenSize = 0;
+ unsigned int dataLen = 0;
unsigned char *t;
unsigned char *ptr;
*/
static int
g_make_token_header(gss_OID_const mech,
- int body_size,
+ unsigned int body_size,
unsigned char **buf,
- int totallen)
+ unsigned int totallen)
{
- int hdrsize, ret = 0;
+ int ret = 0;
+ unsigned int hdrsize;
unsigned char *p = *buf;
hdrsize = 1 + gssint_der_length_size(mech->length) + mech->length;
if ((ret = gssint_put_der_length(mech->length, buf,
totallen - (int)(p - *buf))))
return (ret);
- TWRITE_STR(*buf, mech->elements, ((int)mech->length));
+ TWRITE_STR(*buf, mech->elements, mech->length);
return (0);
}
* theory.
*/
static int
-g_get_tag_and_length(unsigned char **buf, int tag, int buflen, int *outlen)
+g_get_tag_and_length(unsigned char **buf, int tag,
+ unsigned int buflen, unsigned int *outlen)
{
unsigned char *ptr = *buf;
int ret = -1; /* pessimists, assume failure ! */
unsigned int encoded_len;
+ int tmplen = 0;
+ *outlen = 0;
if (buflen > 1 && *ptr == tag) {
ptr++;
- *outlen = gssint_get_der_length(&ptr, buflen - 1,
+ tmplen = gssint_get_der_length(&ptr, buflen - 1,
&encoded_len);
- if (*outlen < 0) {
+ if (tmplen < 0) {
ret = -1;
- } else if (*outlen > buflen - (ptr - *buf)) {
+ } else if (tmplen > buflen - (ptr - *buf)) {
ret = -1;
} else
ret = 0;
}
-
+ *outlen = tmplen;
*buf = ptr;
return (ret);
}
static int
-g_verify_neg_token_init(unsigned char **buf_in, int cur_size)
+g_verify_neg_token_init(unsigned char **buf_in, unsigned int cur_size)
{
unsigned char *buf = *buf_in;
unsigned char *endptr = buf + cur_size;
- int seqsize;
+ unsigned int seqsize;
int ret = 0;
unsigned int bytes;
/* verify token header. */
static int
g_verify_token_header(gss_OID_const mech,
- int *body_size,
+ unsigned int *body_size,
unsigned char **buf_in,
int tok_type,
- int toksize)
+ unsigned int toksize)
{
unsigned char *buf = *buf_in;
int seqsize;
int ret = 0;
unsigned int bytes;
- if ((toksize -= 1) < 0)
+ if (toksize-- < 1)
return (G_BAD_TOK_HEADER);
if (*buf++ != HEADER_ID)
if ((seqsize + bytes) != toksize)
return (G_BAD_TOK_HEADER);
- if ((toksize -= 1) < 0)
+ if (toksize-- < 1)
return (G_BAD_TOK_HEADER);
if (*buf++ != MECH_OID)
return (G_BAD_TOK_HEADER);
- if ((toksize -= 1) < 0)
+ if (toksize-- < 1)
return (G_BAD_TOK_HEADER);
toid.length = *buf++;
- if ((toksize -= toid.length) < 0)
+ if (toksize < toid.length)
return (G_BAD_TOK_HEADER);
+ else
+ toksize -= toid.length;
toid.elements = buf;
buf += toid.length;
* G_WRONG_MECH is not returned immediately because it's more important
* to return G_BAD_TOK_HEADER if the token header is in fact bad
*/
- if ((toksize -= 2) < 0)
+ if (toksize < 2)
return (G_BAD_TOK_HEADER);
+ else
+ toksize -= 2;
if (!ret) {
*buf_in = buf;
; GSS-API v2 future extensions
;
gss_inquire_names_for_mech
-; gss_inquire_mechs_for_name
+ gss_inquire_mechs_for_name
gss_canonicalize_name
gss_export_name
gss_duplicate_name
gss_krb5_set_allowable_enctypes
gss_krb5_export_lucid_sec_context
gss_krb5_free_lucid_sec_context
+ krb5_gss_register_acceptor_identity
;
; GSS-API variables
;
clean-windows::
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
install:: install-libs
-# @lib_frag@
-# @libobj_frag@
+@lib_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
* If there is a facility present, then parse that.
*/
if (cp2) {
- const struct {
+ static const struct {
const char *name;
int value;
} facilities[] = {
#define USE_KADM5_API_VERSION 1
#include <kadm5/admin.h>
+#include <string.h>
ovsec_kadm_ret_t ovsec_kadm_init_with_password(char *client_name, char *pass,
char *service_name,
install:: install-libs
-# @lib_frag@
-# @libobj_frag@
+@lib_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
for (op=acle_ops; *op; op++) {
char rop;
- rop = (isupper((int) *op)) ? tolower((int) *op) : *op;
+ rop = (isupper((unsigned char) *op)) ? tolower((unsigned char) *op) : *op;
found = 0;
for (t=0; acl_op_table[t].ao_op; t++) {
if (rop == acl_op_table[t].ao_op) {
return KADM5_PASS_Q_TOOSHORT;
s = password;
while ((c = *s++)) {
- if (islower((int) c)) {
+ if (islower((unsigned char) c)) {
nlower = 1;
continue;
}
- else if (isupper((int) c)) {
+ else if (isupper((unsigned char) c)) {
nupper = 1;
continue;
- } else if (isdigit((int) c)) {
+ } else if (isdigit((unsigned char) c)) {
ndigit = 1;
continue;
- } else if (ispunct((int) c)) {
+ } else if (ispunct((unsigned char) c)) {
npunct = 1;
continue;
} else {
#include <stdio.h>
#include <stdlib.h>
#include <krb5.h>
+#include <string.h>
int main()
{
#include <stdio.h>
#include <kadm5/admin.h>
+#include <string.h>
int main(int argc, char **argv)
{
#include <krb5.h>
#include <kadm5/admin.h>
#include <kdb.h>
+#include <string.h>
char *whoami;
install-unix:: install-libs
clean-unix:: clean-liblinks clean-libs clean-libobjs
-# @lib_frag@
-# @libobj_frag@
+@lib_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
install-unix:: install-libs
-# @lib_frag@
-# @libobj_frag@
+@lib_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
{
char *q;
for (q=start; *q; q++)
- if (isupper((int) *q))
- *q=tolower((int) *q);
+ if (isupper((unsigned char) *q))
+ *q=tolower((unsigned char) *q);
return(start);
}
\f
install-unix:: install-libs
-# @lib_frag@
-# @libobj_frag@
+@lib_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
clean-unix:: clean-libobjs
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
##WIN32## $(OUTPRE)cc_mslsa.$(OBJEXT): cc_mslsa.c $(SRCTOP)/include/k5-int.h $(BUILDTOP)/include/krb5/osconf.h $(BUILDTOP)/include/krb5/autoconf.h $(BUILDTOP)/include/krb5.h $(COM_ERR_DEPS)
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
return fIsWinXP;
}
+typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);
+
+static BOOL
+is_broken_wow64(void)
+{
+ static BOOL fChecked = FALSE;
+ static BOOL fIsBrokenWow64 = FALSE;
+
+ if (!fChecked)
+ {
+ BOOL isWow64 = FALSE;
+ OSVERSIONINFO Version;
+ LPFN_ISWOW64PROCESS fnIsWow64Process =
+ (LPFN_ISWOW64PROCESS)GetProcAddress(GetModuleHandle("kernel32"),
+ "IsWow64Process");
+
+ /* If we don't find the fnIsWow64Process function then we
+ * are not running in a broken Wow64
+ */
+ if (fnIsWow64Process) {
+ memset (&Version, 0x00, sizeof(Version));
+ Version.dwOSVersionInfoSize = sizeof(Version);
+
+ if (fnIsWow64Process(GetCurrentProcess(), &isWow64) &&
+ GetVersionEx (&Version)) {
+ if (isWow64 &&
+ Version.dwPlatformId == VER_PLATFORM_WIN32_NT &&
+ Version.dwMajorVersion < 6)
+ fIsBrokenWow64 = TRUE;
+ }
+ }
+ fChecked = TRUE;
+ }
+
+ return fIsBrokenWow64;
+}
+
/* This flag is only supported by versions of Windows which have obtained
* a code change from Microsoft. When the code change is installed,
* setting this flag will cause all retrieved credentials to be stored
usLength = (pSessionData->AuthenticationPackage).Length;
if (usLength < 256)
{
- lstrcpyn (buffer, usBuffer, usLength);
- lstrcat (buffer,L"");
- if ( !lstrcmp(L"Kerberos",buffer) )
+ lstrcpynW (buffer, usBuffer, usLength);
+ lstrcatW (buffer,L"");
+ if ( !lstrcmpW(L"Kerberos",buffer) )
Success = TRUE;
}
}
KERB_EXTERNAL_TICKET *msticket;
krb5_error_code retval = KRB5_OK;
- if (!is_windows_2000())
+ if (!is_windows_2000() || is_broken_wow64())
return KRB5_FCC_NOFILE;
#ifdef COMMENT
* credentical cache API
*
* Written by Frank Dabek July 1998
+ * Updated by Jeffrey Altman June 2006
*
- * Copyright 1998, 1999 by the Massachusetts Institute of Technology.
+ * Copyright 1998, 1999, 2006 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
*
*/
-#define NEED_WINDOWS
#include "k5-int.h"
#include "stdcc.h"
#include "stdcc_util.h"
#include "string.h"
#include <stdio.h>
-apiCB *gCntrlBlock = NULL;
-
#if defined(_WIN32)
#include "winccld.h"
#endif
#define SHOW_DEBUG(buf)
#endif
+#ifdef USE_CCAPI_V3
+cc_context_t gCntrlBlock = NULL;
+#else
+apiCB *gCntrlBlock = NULL;
+#endif
+
/*
* declare our global object wanna-be
* must be installed in ccdefops.c
*/
krb5_cc_ops krb5_cc_stdcc_ops = {
- 0,
- "API",
+ 0,
+ "API",
+#ifdef USE_CCAPI_V3
+ krb5_stdccv3_get_name,
+ krb5_stdccv3_resolve,
+ krb5_stdccv3_generate_new,
+ krb5_stdccv3_initialize,
+ krb5_stdccv3_destroy,
+ krb5_stdccv3_close,
+ krb5_stdccv3_store,
+ krb5_stdccv3_retrieve,
+ krb5_stdccv3_get_principal,
+ krb5_stdccv3_start_seq_get,
+ krb5_stdccv3_next_cred,
+ krb5_stdccv3_end_seq_get,
+ krb5_stdccv3_remove,
+ krb5_stdccv3_set_flags,
+ krb5_stdccv3_get_flags
+#else
krb5_stdcc_get_name,
krb5_stdcc_resolve,
krb5_stdcc_generate_new,
krb5_stdcc_end_seq_get,
krb5_stdcc_remove,
krb5_stdcc_set_flags,
- krb5_stdcc_get_flags,
+ krb5_stdcc_get_flags
+#endif
};
#if defined(_WIN32)
static const struct err_xlate err_xlate_table[] =
{
+#ifdef USE_CCAPI_V3
+ { ccIteratorEnd, KRB5_CC_END },
+ { ccErrBadParam, KRB5_FCC_INTERNAL },
+ { ccErrNoMem, KRB5_CC_NOMEM },
+ { ccErrInvalidContext, KRB5_FCC_INTERNAL },
+ { ccErrInvalidCCache, KRB5_FCC_INTERNAL },
+ { ccErrInvalidString, KRB5_FCC_INTERNAL },
+ { ccErrInvalidCredentials, KRB5_FCC_INTERNAL },
+ { ccErrInvalidCCacheIterator, KRB5_FCC_INTERNAL },
+ { ccErrInvalidCredentialsIterator, KRB5_FCC_INTERNAL },
+ { ccErrInvalidLock, KRB5_FCC_INTERNAL },
+ { ccErrBadName, KRB5_CC_BADNAME },
+ { ccErrBadCredentialsVersion, KRB5_FCC_INTERNAL },
+ { ccErrBadAPIVersion, KRB5_FCC_INTERNAL },
+ { ccErrContextLocked, KRB5_FCC_INTERNAL },
+ { ccErrContextUnlocked, KRB5_FCC_INTERNAL },
+ { ccErrCCacheLocked, KRB5_FCC_INTERNAL },
+ { ccErrCCacheUnlocked, KRB5_FCC_INTERNAL },
+ { ccErrBadLockType, KRB5_FCC_INTERNAL },
+ { ccErrNeverDefault, KRB5_FCC_INTERNAL },
+ { ccErrCredentialsNotFound, KRB5_CC_NOTFOUND },
+ { ccErrCCacheNotFound, KRB5_FCC_NOFILE },
+ { ccErrContextNotFound, KRB5_FCC_INTERNAL },
+ { ccErrServerUnavailable, KRB5_FCC_NOFILE },
+ { ccErrServerInsecure, KRB5_FCC_INTERNAL },
+ { ccErrServerCantBecomeUID, KRB5_FCC_INTERNAL },
+ { ccErrTimeOffsetNotSet, KRB5_FCC_INTERNAL },
+ { ccErrBadInternalMessage, KRB5_FCC_INTERNAL },
+ { ccErrNotImplemented, KRB5_FCC_INTERNAL },
+#else
{ CC_BADNAME, KRB5_CC_BADNAME },
{ CC_NOTFOUND, KRB5_CC_NOTFOUND },
{ CC_END, KRB5_CC_END },
{ CC_ERR_CACHE_RELEASE, KRB5_FCC_INTERNAL /* XXX */ },
{ CC_ERR_CACHE_FULL, KRB5_FCC_INTERNAL /* XXX */ },
{ CC_ERR_CRED_VERSION, KRB5_FCC_INTERNAL /* XXX */ },
+#endif
{ 0, 0 }
};
{
const struct err_xlate *p;
- if (err == CC_NOERROR)
+#ifdef USE_CCAPI_V3
+ if (err == ccNoError)
return 0;
+#else
+ if (err == CC_NOERROR)
+ return 0;
+#endif
for (p = err_xlate_table; p->cc_err; p++) {
if (err == p->cc_err)
return KRB5_FCC_INTERNAL; /* XXX we need a miscellaneous return */
}
+
+#ifdef USE_CCAPI_V3
+static krb5_error_code stdccv3_setup(krb5_context context,
+ stdccCacheDataPtr ccapi_data)
+{
+ cc_int32 err;
+
+ /* make sure the API has been intialized */
+ if (gCntrlBlock == NULL) {
+ err = cc_initialize(&gCntrlBlock, ccapi_version_max, NULL, NULL);
+ if (err != ccNoError)
+ return cc_err_xlate(err);
+ }
+
+ /*
+ * No ccapi_data structure, so we don't need to make sure the
+ * ccache exists.
+ */
+ if (!ccapi_data)
+ return 0;
+
+ /*
+ * The ccache already exists
+ */
+ if (ccapi_data->NamedCache)
+ return 0;
+
+ err = cc_context_open_ccache(gCntrlBlock, ccapi_data->cache_name,
+ &ccapi_data->NamedCache);
+ if (err == ccNoError)
+ return 0;
+
+ ccapi_data->NamedCache = NULL;
+ return cc_err_xlate(err);
+}
+
+/* krb5_stdcc_shutdown is exported; use the old name */
+void krb5_stdcc_shutdown()
+{
+ if (gCntrlBlock)
+ cc_context_release(gCntrlBlock);
+ gCntrlBlock = NULL;
+}
+
+/*
+ * -- generate_new --------------------------------
+ *
+ * create a new cache with a unique name, corresponds to creating a
+ * named cache initialize the API here if we have to.
+ */
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_generate_new
+ (krb5_context context, krb5_ccache *id )
+{
+ krb5_ccache newCache = NULL;
+ krb5_error_code retval;
+ stdccCacheDataPtr ccapi_data = NULL;
+ char *name = NULL;
+ cc_time time;
+ int err;
+
+ if ((retval = stdccv3_setup(context, NULL)))
+ return retval;
+
+ retval = KRB5_CC_NOMEM;
+ if (!(newCache = (krb5_ccache) malloc(sizeof(struct _krb5_ccache))))
+ goto errout;
+ if (!(ccapi_data = (stdccCacheDataPtr)malloc(sizeof(stdccCacheData))))
+ goto errout;
+ if (!(name = malloc(256)))
+ goto errout;
+
+ /* create a unique name */
+ if (retval = cc_context_get_change_time(gCntrlBlock, &time))
+ goto errout;
+ sprintf(name, "gen_new_cache%d", time);
+
+ /* create the new cache */
+ err = cc_context_create_ccache(gCntrlBlock, name, cc_credentials_v5, 0L,
+ &ccapi_data->NamedCache);
+ if (err != ccNoError) {
+ retval = cc_err_xlate(err);
+ goto errout;
+ }
+
+ /* setup some fields */
+ newCache->ops = &krb5_cc_stdcc_ops;
+ newCache->data = ccapi_data;
+ ccapi_data->cache_name = name;
+
+ /* return a pointer to the new cache */
+ *id = newCache;
+
+ return 0;
+
+errout:
+ if (newCache)
+ free(newCache);
+ if (ccapi_data)
+ free(ccapi_data);
+ if (name)
+ free(name);
+ return retval;
+}
+
+/*
+ * resolve
+ *
+ * create a new cache with the name stored in residual
+ */
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_resolve
+ (krb5_context context, krb5_ccache *id , const char *residual )
+{
+ krb5_ccache newCache = NULL;
+ stdccCacheDataPtr ccapi_data = NULL;
+ int err;
+ krb5_error_code retval;
+ char *cName = NULL;
+
+ if ((retval = stdccv3_setup(context, NULL)))
+ return retval;
+
+ retval = KRB5_CC_NOMEM;
+ if (!(newCache = (krb5_ccache) malloc(sizeof(struct _krb5_ccache))))
+ goto errout;
+
+ if (!(ccapi_data = (stdccCacheDataPtr)malloc(sizeof(stdccCacheData))))
+ goto errout;
+
+ if (!(cName = malloc(strlen(residual)+1)))
+ goto errout;
+
+ newCache->ops = &krb5_cc_stdcc_ops;
+ newCache->data = ccapi_data;
+ ccapi_data->cache_name = cName;
+
+ strcpy(cName, residual);
+
+ err = cc_context_open_ccache(gCntrlBlock, cName,
+ &ccapi_data->NamedCache);
+ if (err != ccNoError) {
+ ccapi_data->NamedCache = NULL;
+ goto errout;
+ }
+
+ /* return new cache structure */
+ *id = newCache;
+
+ return 0;
+
+errout:
+ if (newCache)
+ free(newCache);
+ if (ccapi_data)
+ free(ccapi_data);
+ if (cName)
+ free(cName);
+ return retval;
+}
+
+/*
+ * initialize
+ *
+ * initialize the cache, check to see if one already exists for this
+ * principal if not set our principal to this principal. This
+ * searching enables ticket sharing
+ */
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_initialize
+ (krb5_context context, krb5_ccache id, krb5_principal princ)
+{
+ stdccCacheDataPtr ccapi_data = NULL;
+ int err;
+ char *cName = NULL;
+ krb5_error_code retval;
+
+ if ((retval = stdccv3_setup(context, NULL)))
+ return retval;
+
+ /* test id for null */
+ if (id == NULL) return KRB5_CC_NOMEM;
+
+ if ((retval = krb5_unparse_name(context, princ, &cName)))
+ return retval;
+
+ ccapi_data = id->data;
+
+
+ if (ccapi_data->NamedCache) {
+ err = cc_ccache_release(ccapi_data->NamedCache);
+ ccapi_data->NamedCache = NULL;
+ }
+
+ err = cc_context_create_ccache(gCntrlBlock, ccapi_data->cache_name,
+ cc_credentials_v5, cName,
+ &ccapi_data->NamedCache);
+ if (err != ccNoError) {
+ krb5_free_unparsed_name(context, cName);
+ return cc_err_xlate(err);
+ }
+
+ krb5_free_unparsed_name(context, cName);
+ cache_changed();
+
+ return cc_err_xlate(err);
+}
+
+/*
+ * store
+ *
+ * store some credentials in our cache
+ */
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_store
+ (krb5_context context, krb5_ccache id, krb5_creds *creds )
+{
+ krb5_error_code retval;
+ stdccCacheDataPtr ccapi_data = id->data;
+ cc_credentials_t c = NULL;
+ int err;
+
+ if ((retval = stdccv3_setup(context, ccapi_data)))
+ return retval;
+
+ /* copy the fields from the almost identical structures */
+ dupK5toCC3(context, creds, &c);
+
+ /*
+ * finally store the credential
+ * store will copy (that is duplicate) everything
+ */
+ err = cc_ccache_store_credentials(((stdccCacheDataPtr)(id->data))->NamedCache, c->data);
+ if (err != ccNoError)
+ return cc_err_xlate(err);
+
+ err = cc_credentials_release(c);
+
+ cache_changed();
+ return err;
+}
+
+/*
+ * start_seq_get
+ *
+ * begin an iterator call to get all of the credentials in the cache
+ */
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_start_seq_get
+(krb5_context context, krb5_ccache id , krb5_cc_cursor *cursor )
+{
+ stdccCacheDataPtr ccapi_data = id->data;
+ krb5_error_code retval;
+ int err;
+ cc_credentials_iterator_t iterator;
+
+ if ((retval = stdccv3_setup(context, ccapi_data)))
+ return retval;
+
+ err = cc_ccache_new_credentials_iterator(ccapi_data->NamedCache,
+ &iterator);
+ if (err != ccNoError)
+ return cc_err_xlate(err);
+ *cursor = iterator;
+ return 0;
+}
+
+/*
+ * next cred
+ *
+ * - get the next credential in the cache as part of an iterator call
+ * - this maps to call to cc_seq_fetch_creds
+ */
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_next_cred
+ (krb5_context context, krb5_ccache id, krb5_cc_cursor *cursor,
+ krb5_creds *creds)
+{
+ krb5_error_code retval;
+ stdccCacheDataPtr ccapi_data = id->data;
+ int err;
+ cc_credentials_t cu;
+ cc_credentials_iterator_t iterator;
+
+ if ((retval = stdccv3_setup(context, ccapi_data)))
+ return retval;
+
+ iterator = *cursor;
+ if (iterator == 0)
+ return KRB5_CC_END;
+ err = cc_credentials_iterator_next(iterator, &cu);
+
+ if (err == ccIteratorEnd) {
+ cc_credentials_iterator_release(iterator);
+ *cursor = 0;
+ }
+ if (err != ccNoError)
+ return cc_err_xlate(err);
+
+ /* copy data (with translation) */
+ dupCC3toK5(context, cu, creds);
+
+ cc_credentials_release(cu);
+
+ return 0;
+}
+
+
+/*
+ * retrieve
+ *
+ * - try to find a matching credential in the cache
+ */
+krb5_error_code KRB5_CALLCONV
+krb5_stdccv3_retrieve(context, id, whichfields, mcreds, creds)
+ krb5_context context;
+ krb5_ccache id;
+ krb5_flags whichfields;
+ krb5_creds *mcreds;
+ krb5_creds *creds;
+{
+ return krb5_cc_retrieve_cred_default (context, id, whichfields,
+ mcreds, creds);
+}
+
+/*
+ * end seq
+ *
+ * just free up the storage assoicated with the cursor (if we can)
+ */
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_end_seq_get
+ (krb5_context context, krb5_ccache id, krb5_cc_cursor *cursor)
+{
+ krb5_error_code retval;
+ stdccCacheDataPtr ccapi_data = NULL;
+ int err;
+ cc_credentials_iterator_t iterator;
+
+ ccapi_data = id->data;
+
+ if ((retval = stdccv3_setup(context, ccapi_data)))
+ return retval;
+
+ if (*cursor == NULL)
+ return 0;
+
+ iterator = *cursor;
+
+ err = cc_credentials_iterator_release(iterator);
+ if (err != ccNoError)
+ return cc_err_xlate(err);
+ return(0);
+}
+
+/*
+ * close
+ *
+ * - free our pointers to the NC
+ */
+krb5_error_code KRB5_CALLCONV
+krb5_stdccv3_close(krb5_context context, krb5_ccache id)
+{
+ krb5_error_code retval;
+ stdccCacheDataPtr ccapi_data = id->data;
+
+ if ((retval = stdccv3_setup(context, NULL)))
+ return retval;
+
+ /* free it */
+ if (ccapi_data) {
+ if (ccapi_data->cache_name)
+ free(ccapi_data->cache_name);
+ if (ccapi_data->NamedCache)
+ cc_ccache_release(ccapi_data->NamedCache);
+ free(ccapi_data);
+ id->data = NULL;
+ }
+ free(id);
+
+ return 0;
+}
+
+/*
+ * destroy
+ *
+ * - free our storage and the cache
+ */
+krb5_error_code KRB5_CALLCONV
+krb5_stdccv3_destroy (krb5_context context, krb5_ccache id)
+{
+ int err;
+ krb5_error_code retval;
+ stdccCacheDataPtr ccapi_data = id->data;
+
+ if ((retval = stdccv3_setup(context, ccapi_data))) {
+ return retval;
+ }
+
+ /* free memory associated with the krb5_ccache */
+ if (ccapi_data) {
+ if (ccapi_data->cache_name)
+ free(ccapi_data->cache_name);
+ if (ccapi_data->NamedCache) {
+ /* destroy the named cache */
+ err = cc_ccache_destroy(ccapi_data->NamedCache);
+ retval = cc_err_xlate(err);
+ cache_changed();
+ }
+ free(ccapi_data);
+ id->data = NULL;
+ }
+ free(id);
+
+ /* If the cache does not exist when we tried to destroy it,
+ that's fine. That means someone else destroyed it since
+ we resolved it. */
+ if (retval == ccErrCCacheNotFound)
+ return 0;
+ return retval;
+}
+
+/*
+ * getname
+ *
+ * - return the name of the named cache
+ */
+const char * KRB5_CALLCONV krb5_stdccv3_get_name
+ (krb5_context context, krb5_ccache id )
+{
+ stdccCacheDataPtr ccapi_data = id->data;
+
+ if (!ccapi_data)
+ return 0;
+
+ return (ccapi_data->cache_name);
+}
+
+
+/* get_principal
+ *
+ * - return the principal associated with the named cache
+ */
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_get_principal
+ (krb5_context context, krb5_ccache id , krb5_principal *princ)
+{
+ int err;
+ cc_string_t name = NULL;
+ stdccCacheDataPtr ccapi_data = id->data;
+ krb5_error_code retval;
+
+ if ((retval = stdccv3_setup(context, ccapi_data)))
+ return retval;
+
+ /* another wrapper */
+ err = cc_ccache_get_principal(ccapi_data->NamedCache, cc_credentials_v5, &name);
+
+ if (err != ccNoError)
+ return cc_err_xlate(err);
+
+ /* turn it into a krb principal */
+ err = krb5_parse_name(context, name->data, princ);
+
+ cc_string_release(name);
+
+ return err;
+}
+
+/*
+ * set_flags
+ *
+ * - currently a NOP since we don't store any flags in the NC
+ */
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_set_flags
+ (krb5_context context, krb5_ccache id , krb5_flags flags)
+{
+ stdccCacheDataPtr ccapi_data = id->data;
+ krb5_error_code retval;
+
+ if ((retval = stdccv3_setup(context, ccapi_data)))
+ return retval;
+
+ return 0;
+}
+
+/*
+ * get_flags
+ *
+ * - currently a NOP since we don't store any flags in the NC
+ */
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_get_flags
+ (krb5_context context, krb5_ccache id , krb5_flags *flags)
+{
+ stdccCacheDataPtr ccapi_data = id->data;
+ krb5_error_code retval;
+
+ if ((retval = stdccv3_setup(context, ccapi_data)))
+ return retval;
+
+ return 0;
+}
+
+/*
+ * remove
+ *
+ * - remove the specified credentials from the NC
+ */
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_remove
+ (krb5_context context, krb5_ccache id,
+ krb5_flags flags, krb5_creds *creds)
+{
+ cc_credentials_t c = NULL;
+ int err;
+ stdccCacheDataPtr ccapi_data = id->data;
+ krb5_error_code retval;
+
+ if ((retval = stdccv3_setup(context, ccapi_data))) {
+ if (retval == KRB5_FCC_NOFILE)
+ return 0;
+ return retval;
+ }
+
+ /* convert to a cred union */
+ dupK5toCC3(context, creds, &c);
+
+ /* remove it */
+ err = cc_ccache_remove_credentials(ccapi_data->NamedCache, c);
+ if (err != ccNoError)
+ return cc_err_xlate(err);
+
+ err = cc_credentials_release(c);
+ cache_changed();
+ if (err != ccNoError)
+ return cc_err_xlate(err);
+
+ return 0;
+}
+#else /* !USE_CCAPI_V3 */
static krb5_error_code stdcc_setup(krb5_context context,
stdccCacheDataPtr ccapi_data)
{
{
if (gCntrlBlock)
cc_shutdown(&gCntrlBlock);
- gCntrlBlock = 0;
+ gCntrlBlock = NULL;
}
/*
err = cc_open(gCntrlBlock, cName, CC_CRED_V5, 0L,
&ccapi_data->NamedCache);
- if (err != CC_NOERROR)
- ccapi_data->NamedCache = NULL;
-
+ if (err != CC_NOERROR) {
+ ccapi_data->NamedCache = NULL;
+ goto errout;
+ }
/* return new cache structure */
*id = newCache;
/* free the cred union using our local version of cc_free_creds()
since we allocated it locally */
- err = krb5_free_cc_cred_union(&cu);
+ err = krb5int_free_cc_cred_union(&cu);
cache_changed();
return err;
return KRB5_CC_NOTFOUND;
}
#else
-#include "k5-int.h"
krb5_error_code KRB5_CALLCONV
krb5_stdcc_retrieve(context, id, whichfields, mcreds, creds)
/* free the cred union using our local version of cc_free_creds()
since we allocated it locally */
- err = krb5_free_cc_cred_union(&cu);
+ err = krb5int_free_cc_cred_union(&cu);
cache_changed();
if (err != CC_NOERROR)
return cc_err_xlate(err);
return 0;
}
+#endif /* !USE_CCAPI_V3 */
\ No newline at end of file
-#include "krb5.h"
-#include "k5-int.h"
+#include "k5-int.h" /* loads krb5.h */
+#ifdef USE_CCAPI_V3
+#include <CredentialsCache.h>
+#else
#ifdef USE_CCAPI
#include <CredentialsCache2.h>
-#endif
-
+#else
#if defined(_WIN32)
#include "cacheapi.h"
#endif
+#endif
+#endif
+
#define kStringLiteralLen 255
*/
typedef struct _stdccCacheData {
char *cache_name;
+#ifdef USE_CCAPI_V3
+ cc_ccache_t NamedCache;
+#else
ccache_p *NamedCache;
+#endif
} stdccCacheData, *stdccCacheDataPtr;
/* function protoypes */
+#ifdef USE_CCAPI_V3
+void krb5_stdccv3_shutdown(void);
+
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_close
+ (krb5_context, krb5_ccache id );
+
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_destroy
+ (krb5_context, krb5_ccache id );
+
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_end_seq_get
+ (krb5_context, krb5_ccache id , krb5_cc_cursor *cursor );
+
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_generate_new
+ (krb5_context, krb5_ccache *id );
+
+const char * KRB5_CALLCONV krb5_stdccv3_get_name
+ (krb5_context, krb5_ccache id );
+
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_get_principal
+ (krb5_context, krb5_ccache id , krb5_principal *princ );
+
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_initialize
+ (krb5_context, krb5_ccache id , krb5_principal princ );
+
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_next_cred
+ (krb5_context,
+ krb5_ccache id ,
+ krb5_cc_cursor *cursor ,
+ krb5_creds *creds );
+
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_resolve
+ (krb5_context, krb5_ccache *id , const char *residual );
+
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_retrieve
+ (krb5_context,
+ krb5_ccache id ,
+ krb5_flags whichfields ,
+ krb5_creds *mcreds ,
+ krb5_creds *creds );
+
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_start_seq_get
+ (krb5_context, krb5_ccache id , krb5_cc_cursor *cursor );
+
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_store
+ (krb5_context, krb5_ccache id , krb5_creds *creds );
+
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_set_flags
+ (krb5_context, krb5_ccache id , krb5_flags flags );
+
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_get_flags
+ (krb5_context, krb5_ccache id , krb5_flags *flags );
+
+krb5_error_code KRB5_CALLCONV krb5_stdccv3_remove
+ (krb5_context, krb5_ccache id , krb5_flags flags, krb5_creds *creds);
+#else
void krb5_stdcc_shutdown(void);
krb5_error_code KRB5_CALLCONV krb5_stdcc_close
krb5_error_code KRB5_CALLCONV krb5_stdcc_remove
(krb5_context, krb5_ccache id , krb5_flags flags, krb5_creds *creds);
+#endif
\ No newline at end of file
#define fieldSize 255
+#ifdef USE_CCAPI_V3
+/* krb5int_cc_credentials_release(cc_credentials_t creds)
+ * - function used to release internally generated cc_credentials_t objects
+ */
+static cc_int32
+krb5int_cc_credentials_release(cc_credentials_t creds) {
+ free(creds);
+ return ccNoError;
+}
+
+static cc_int32
+krb5int_cc_credentials_compare(cc_credentials_t creds,
+ cc_credentials_t compare_to,
+ cc_uint32* equal) {
+ return ccErrNotImplemented;
+}
+
+/*
+ * CopyCC3DataArrayToK5
+ * - copy and translate the null terminated arrays of data records
+ * used in k5 tickets
+ */
+int
+copyCC3DataArrayToK5(cc_credentials_v5_t *ccCreds, krb5_creds *v5Creds, char whichArray) {
+
+ switch (whichArray) {
+ case kAddressArray:
+ if (ccCreds->addresses == NULL) {
+ v5Creds->addresses = NULL;
+ } else {
+
+ krb5_address **addrPtr, *addr;
+ cc_data **dataPtr, *data;
+ unsigned int numRecords = 0;
+
+ /* Allocate the array of pointers: */
+ for (dataPtr = ccCreds->addresses; *dataPtr != NULL; numRecords++, dataPtr++) {}
+
+ v5Creds->addresses = (krb5_address **) malloc (sizeof(krb5_address *) * (numRecords + 1));
+ if (v5Creds->addresses == NULL)
+ return ENOMEM;
+
+ /* Fill in the array, allocating the address structures: */
+ for (dataPtr = ccCreds->addresses, addrPtr = v5Creds->addresses; *dataPtr != NULL; addrPtr++, dataPtr++) {
+
+ *addrPtr = (krb5_address *) malloc (sizeof(krb5_address));
+ if (*addrPtr == NULL)
+ return ENOMEM;
+ data = *dataPtr;
+ addr = *addrPtr;
+
+ addr->addrtype = data->type;
+ addr->magic = KV5M_ADDRESS;
+ addr->length = data->length;
+ addr->contents = (krb5_octet *) malloc (sizeof(krb5_octet) * addr->length);
+ if (addr->contents == NULL)
+ return ENOMEM;
+ memmove(addr->contents, data->data, addr->length); /* copy contents */
+ }
+
+ /* Write terminator: */
+ *addrPtr = NULL;
+ }
+ break;
+ case kAuthDataArray:
+ if (ccCreds->authdata == NULL) {
+ v5Creds->authdata = NULL;
+ } else {
+ krb5_authdata **authPtr, *auth;
+ cc_data **dataPtr, *data;
+ unsigned int numRecords = 0;
+
+ /* Allocate the array of pointers: */
+ for (dataPtr = ccCreds->authdata; *dataPtr != NULL; numRecords++, dataPtr++) {}
+
+ v5Creds->authdata = (krb5_authdata **) malloc (sizeof(krb5_authdata *) * (numRecords + 1));
+ if (v5Creds->authdata == NULL)
+ return ENOMEM;
+
+ /* Fill in the array, allocating the address structures: */
+ for (dataPtr = ccCreds->authdata, authPtr = v5Creds->authdata; *dataPtr != NULL; authPtr++, dataPtr++) {
+
+ *authPtr = (krb5_authdata *) malloc (sizeof(krb5_authdata));
+ if (*authPtr == NULL)
+ return ENOMEM;
+ data = *dataPtr;
+ auth = *authPtr;
+
+ auth->ad_type = data->type;
+ auth->magic = KV5M_AUTHDATA;
+ auth->length = data->length;
+ auth->contents = (krb5_octet *) malloc (sizeof(krb5_octet) * auth->length);
+ if (auth->contents == NULL)
+ return ENOMEM;
+ memmove(auth->contents, data->data, auth->length); /* copy contents */
+ }
+
+ /* Write terminator: */
+ *authPtr = NULL;
+ }
+ break;
+ }
+
+ return 0;
+}
+
+/*
+ * copyK5DataArrayToCC
+ * - analagous to above, but in the other direction
+ */
+int
+copyK5DataArrayToCC3(krb5_creds *v5Creds, cc_credentials_v5_t * ccCreds, char whichArray)
+{
+ switch (whichArray) {
+ case kAddressArray:
+ if (v5Creds->addresses == NULL) {
+ ccCreds->addresses = NULL;
+ } else {
+
+ krb5_address **addrPtr, *addr;
+ cc_data **dataPtr, *data;
+ unsigned int numRecords = 0;
+
+ /* Allocate the array of pointers: */
+ for (addrPtr = v5Creds->addresses; *addrPtr != NULL; numRecords++, addrPtr++) {}
+
+ ccCreds->addresses = (cc_data **) malloc (sizeof(cc_data *) * (numRecords + 1));
+ if (ccCreds->addresses == NULL)
+ return ENOMEM;
+
+ /* Fill in the array, allocating the address structures: */
+ for (dataPtr = ccCreds->addresses, addrPtr = v5Creds->addresses; *addrPtr != NULL; addrPtr++, dataPtr++) {
+
+ *dataPtr = (cc_data *) malloc (sizeof(cc_data));
+ if (*dataPtr == NULL)
+ return ENOMEM;
+ data = *dataPtr;
+ addr = *addrPtr;
+
+ data->type = addr->addrtype;
+ data->length = addr->length;
+ data->data = malloc (sizeof(char) * data->length);
+ if (data->data == NULL)
+ return ENOMEM;
+ memmove(data->data, addr->contents, data->length); /* copy contents */
+ }
+
+ /* Write terminator: */
+ *dataPtr = NULL;
+ }
+ break;
+ case kAuthDataArray:
+ if (v5Creds->authdata == NULL) {
+ ccCreds->authdata = NULL;
+ } else {
+ krb5_authdata **authPtr, *auth;
+ cc_data **dataPtr, *data;
+ unsigned int numRecords = 0;
+
+ /* Allocate the array of pointers: */
+ for (authPtr = v5Creds->authdata; *authPtr != NULL; numRecords++, authPtr++) {}
+
+ ccCreds->authdata = (cc_data **) malloc (sizeof(cc_data *) * (numRecords + 1));
+ if (ccCreds->authdata == NULL)
+ return ENOMEM;
+
+ /* Fill in the array, allocating the address structures: */
+ for (dataPtr = ccCreds->authdata, authPtr = v5Creds->authdata; *authPtr != NULL; authPtr++, dataPtr++) {
+
+ *dataPtr = (cc_data *) malloc (sizeof(cc_data));
+ if (*dataPtr == NULL)
+ return ENOMEM;
+ data = *dataPtr;
+ auth = *authPtr;
+
+ data->type = auth->ad_type;
+ data->length = auth->length;
+ data->data = malloc (sizeof(char) * data->length);
+ if (data->data == NULL)
+ return ENOMEM;
+ memmove(data->data, auth->contents, data->length); /* copy contents */
+ }
+
+ /* Write terminator: */
+ *dataPtr = NULL;
+ }
+ break;
+ }
+
+ return 0;
+
+}
+
+/*
+ * dupCC3toK5
+ * - allocate an empty k5 style ticket and copy info from the cc_creds ticket
+ */
+
+krb5_error_code
+dupCC3toK5(krb5_context context, cc_credentials_t src, krb5_creds *dest)
+{
+ const cc_credentials_union *cu = src->data;
+ cc_credentials_v5_t *cv5;
+ krb5_int32 offset_seconds = 0, offset_microseconds = 0;
+ krb5_error_code err;
+
+ if (cu->version != cc_credentials_v5)
+ return KRB5_CC_NOT_KTYPE;
+
+ cv5 = cu->credentials.credentials_v5;
+
+ /*
+ * allocate and copy
+ * copy all of those damn fields back
+ */
+ err = krb5_parse_name(context, cv5->client, &(dest->client));
+ err = krb5_parse_name(context, cv5->server, &(dest->server));
+ if (err)
+ return err; /* parsename fails w/o krb5.ini for example */
+
+ /* copy keyblock */
+ dest->keyblock.enctype = cv5->keyblock.type;
+ dest->keyblock.length = cv5->keyblock.length;
+ dest->keyblock.contents = (krb5_octet *)malloc(dest->keyblock.length);
+ memcpy(dest->keyblock.contents, cv5->keyblock.data, dest->keyblock.length);
+
+ /* copy times */
+#if TARGET_OS_MAC
+ err = krb5_get_time_offsets(context, &offset_seconds, &offset_microseconds);
+ if (err)
+ return err;
+#endif
+ dest->times.authtime = cv5->authtime + offset_seconds;
+ dest->times.starttime = cv5->starttime + offset_seconds;
+ dest->times.endtime = cv5->endtime + offset_seconds;
+ dest->times.renew_till = cv5->renew_till + offset_seconds;
+ dest->is_skey = cv5->is_skey;
+ dest->ticket_flags = cv5->ticket_flags;
+
+ /* more branching fields */
+ err = copyCC3DataArrayToK5(cv5, dest, kAddressArray);
+ if (err)
+ return err;
+
+ /* first ticket */
+ dest->ticket.length = cv5->ticket.length;
+ dest->ticket.data = (char *)malloc(cv5->ticket.length);
+ memcpy(dest->ticket.data, cv5->ticket.data, cv5->ticket.length);
+
+ /* second ticket */
+ dest->second_ticket.length = cv5->second_ticket.length;
+ (dest->second_ticket).data = ( char *)malloc(cv5->second_ticket.length);
+ memcpy(dest->second_ticket.data, cv5->second_ticket.data, cv5->second_ticket.length);
+
+ /* zero out magic number */
+ dest->magic = 0;
+
+ /* authdata */
+ err = copyCC3DataArrayToK5(cv5, dest, kAuthDataArray);
+ if (err)
+ return err;
+
+ return 0;
+}
+
+/*
+ * dupK5toCC3
+ * - analagous to above but in the reverse direction
+ */
+krb5_error_code
+dupK5toCC3(krb5_context context, krb5_creds *src, cc_credentials_t *dest)
+{
+ cc_credentials_v5_t *c;
+ cc_credentials_union *cu;
+ cc_credentials_f *f;
+ int err;
+ krb5_int32 offset_seconds = 0, offset_microseconds = 0;
+ cc_credentials_t creds = NULL;
+
+ if (dest == NULL)
+ return KRB5_CC_NOMEM;
+
+ /* allocate the cc_credentials_t */
+ creds = (cc_credentials_t)malloc(sizeof(cc_credentials_d));
+ if (!creds) {
+ err = KRB5_CC_NOMEM;
+ goto cleanup;
+ }
+
+ /* allocate the cred_union */
+ creds->data = NULL;
+ creds->functions = NULL;
+#ifdef TARGET_OS_MAC
+ creds->otherFunctions = NULL;
+#endif
+ f = (cc_credentials_f *)malloc(sizeof(cc_credentials_f));
+ if (!f) {
+ err = KRB5_CC_NOMEM;
+ goto cleanup;
+ }
+ creds->functions = f;
+
+ cu = (cc_credentials_union *)malloc(sizeof(cc_credentials_union));
+ if (!creds->data) {
+ err = KRB5_CC_NOMEM;
+ goto cleanup;
+ }
+ creds->data = cu;
+
+ f->release = krb5int_cc_credentials_release;
+ f->compare = krb5int_cc_credentials_compare;
+
+ cu->version = cc_credentials_v5;
+
+ c = (cc_credentials_v5_t*)malloc(sizeof(cc_credentials_v5_t));
+ if (!c) {
+ err = KRB5_CC_NOMEM;
+ goto cleanup;
+ }
+ cu->credentials.credentials_v5 = c;
+
+ /* convert krb5 principals to flat principals */
+ err = krb5_unparse_name(context, src->client, &(c->client));
+ if (err)
+ goto cleanup;
+
+ err = krb5_unparse_name(context, src->server, &(c->server));
+ if (err)
+ goto cleanup;
+
+ /* copy more fields */
+ c->keyblock.type = src->keyblock.enctype;
+ c->keyblock.length = src->keyblock.length;
+
+ if (src->keyblock.contents != NULL) {
+ c->keyblock.data = (unsigned char *)malloc(src->keyblock.length);
+ memcpy(c->keyblock.data, src->keyblock.contents, src->keyblock.length);
+ } else {
+ c->keyblock.data = NULL;
+ }
+
+#if TARGET_OS_MAC
+ err = krb5_get_time_offsets(context, &offset_seconds, &offset_microseconds);
+ if (err)
+ goto cleanup;
+#endif
+ c->authtime = src->times.authtime - offset_seconds;
+ c->starttime = src->times.starttime - offset_seconds;
+ c->endtime = src->times.endtime - offset_seconds;
+ c->renew_till = src->times.renew_till - offset_seconds;
+ c->is_skey = src->is_skey;
+ c->ticket_flags = src->ticket_flags;
+
+ err = copyK5DataArrayToCC3(src, c, kAddressArray);
+ if (err)
+ goto cleanup;
+
+ c->ticket.length = src->ticket.length;
+ if (src->ticket.data != NULL) {
+ c->ticket.data = (unsigned char *)malloc(src->ticket.length);
+ memcpy(c->ticket.data, src->ticket.data, src->ticket.length);
+ } else {
+ c->ticket.data = NULL;
+ }
+
+ c->second_ticket.length = src->second_ticket.length;
+ if (src->second_ticket.data != NULL) {
+ c->second_ticket.data = (unsigned char *)malloc(src->second_ticket.length);
+ memcpy(c->second_ticket.data, src->second_ticket.data, src->second_ticket.length);
+ } else {
+ c->second_ticket.data = NULL;
+ }
+
+ err = copyK5DataArrayToCC3(src, c, kAuthDataArray);
+ if (err)
+ goto cleanup;
+
+ *dest = creds;
+ return 0;
+
+ cleanup:
+ if (creds) {
+ if (creds->functions)
+ free((void *)creds->functions);
+ if (creds->data) {
+ if (creds->data->credentials.credentials_v5)
+ free(creds->data->credentials.credentials_v5);
+ free((void *)creds->data);
+ }
+ free(creds);
+ }
+
+ return err;
+}
+#else /* !USE_CCAPI_V3 */
/*
* CopyCCDataArrayToK5
* - copy and translate the null terminated arrays of data records
return;
}
+/* ----- free_cc_cred_union, etc -------------- */
+/*
+ Since the Kerberos5 library allocates a credentials cache structure
+ (in dupK5toCC() above) with its own memory allocation routines - which
+ may be different than how the CCache allocates memory - the Kerb5 library
+ must have its own version of cc_free_creds() to deallocate it. These
+ functions do that. The top-level function to substitue for cc_free_creds()
+ is krb5_free_cc_cred_union().
+
+ If the CCache library wants to use a cred_union structure created by
+ the Kerb5 library, it should make a deep copy of it to "translate" to its
+ own memory allocation space.
+*/
+static void deep_free_cc_data (cc_data data)
+{
+ if (data.data != NULL)
+ free (data.data);
+}
+
+static void deep_free_cc_data_array (cc_data** data) {
+
+ unsigned int index;
+
+ if (data == NULL)
+ return;
+
+ for (index = 0; data [index] != NULL; index++) {
+ deep_free_cc_data (*(data [index]));
+ free (data [index]);
+ }
+
+ free (data);
+}
+
+static void deep_free_cc_v5_creds (cc_creds* creds)
+{
+ if (creds == NULL)
+ return;
+
+ if (creds -> client != NULL)
+ free (creds -> client);
+ if (creds -> server != NULL)
+ free (creds -> server);
+
+ deep_free_cc_data (creds -> keyblock);
+ deep_free_cc_data (creds -> ticket);
+ deep_free_cc_data (creds -> second_ticket);
+
+ deep_free_cc_data_array (creds -> addresses);
+ deep_free_cc_data_array (creds -> authdata);
+
+ free(creds);
+}
+
+static void deep_free_cc_creds (cred_union creds)
+{
+ if (creds.cred_type == CC_CRED_V4) {
+ /* we shouldn't get this, of course */
+ free (creds.cred.pV4Cred);
+ } else if (creds.cred_type == CC_CRED_V5) {
+ deep_free_cc_v5_creds (creds.cred.pV5Cred);
+ }
+}
+
+/* top-level exported function */
+cc_int32 krb5int_free_cc_cred_union (cred_union** creds)
+{
+ if (creds == NULL)
+ return CC_BAD_PARM;
+
+ if (*creds != NULL) {
+ deep_free_cc_creds (**creds);
+ free (*creds);
+ *creds = NULL;
+ }
+
+ return CC_NOERROR;
+}
+#endif
+
/*
* Utility functions...
*/
return FALSE;
}
-/* ----- free_cc_cred_union, etc -------------- */
-/*
- Since the Kerberos5 library allocates a credentials cache structure
- (in dupK5toCC() above) with its own memory allocation routines - which
- may be different than how the CCache allocates memory - the Kerb5 library
- must have its own version of cc_free_creds() to deallocate it. These
- functions do that. The top-level function to substitue for cc_free_creds()
- is krb5_free_cc_cred_union().
-
- If the CCache library wants to use a cred_union structure created by
- the Kerb5 library, it should make a deep copy of it to "translate" to its
- own memory allocation space.
-*/
-static void deep_free_cc_data (cc_data data)
-{
- if (data.data != NULL)
- free (data.data);
-}
-
-static void deep_free_cc_data_array (cc_data** data) {
-
- unsigned int index;
-
- if (data == NULL)
- return;
- for (index = 0; data [index] != NULL; index++) {
- deep_free_cc_data (*(data [index]));
- free (data [index]);
- }
-
- free (data);
-}
-
-static void deep_free_cc_v5_creds (cc_creds* creds)
-{
- if (creds == NULL)
- return;
-
- if (creds -> client != NULL)
- free (creds -> client);
- if (creds -> server != NULL)
- free (creds -> server);
-
- deep_free_cc_data (creds -> keyblock);
- deep_free_cc_data (creds -> ticket);
- deep_free_cc_data (creds -> second_ticket);
-
- deep_free_cc_data_array (creds -> addresses);
- deep_free_cc_data_array (creds -> authdata);
-
- free(creds);
-}
-
-static void deep_free_cc_creds (cred_union creds)
-{
- if (creds.cred_type == CC_CRED_V4) {
- /* we shouldn't get this, of course */
- free (creds.cred.pV4Cred);
- } else if (creds.cred_type == CC_CRED_V5) {
- deep_free_cc_v5_creds (creds.cred.pV5Cred);
- }
-}
-
-/* top-level exported function */
-cc_int32 krb5_free_cc_cred_union (cred_union** creds)
-{
- if (creds == NULL)
- return CC_BAD_PARM;
-
- if (*creds != NULL) {
- deep_free_cc_creds (**creds);
- free (*creds);
- *creds = NULL;
- }
-
- return CC_NOERROR;
-}
#include "autoconf.h"
+#if USE_CCAPI_V3
+#include <CredentialsCache.h>
+#else
#if USE_CCAPI
#include <CredentialsCache2.h>
#endif
#if defined(_WIN32)
#include "cacheapi.h"
#endif
+#endif
#include "krb5.h"
/* protoypes for private functions declared in stdcc_util.c */
+#ifdef USE_CCAPI_V3
+krb5_error_code dupCC3toK5(krb5_context context, cc_credentials_t src, krb5_creds *dest);
+krb5_error_code dupK5toCC3(krb5_context context, krb5_creds *src, cc_credentials_t *dest);
+cc_int32 krb5int_cc_credentials_release(cc_credentials_t creds);
+cc_int32 krb5int_cc_credentials_compare(cc_credentials_t creds,
+ cc_credentials_t compare_to,
+ cc_uint32* equal);
+int copyCC3DataArrayToK5(cc_credentials_v5_t *ccCreds, krb5_creds *v5Creds, char whichArray);
+int copyK5DataArrayToCC3(krb5_creds *v5Creds, cc_credentials_v5_t * ccCreds, char whichArray);
+#else
int copyCCDataArrayToK5(cc_creds *cc, krb5_creds *kc, char whichArray);
int copyK5DataArrayToCC(krb5_creds *kc, cc_creds *cc, char whichArray);
void dupCCtoK5(krb5_context context, cc_creds *src, krb5_creds *dest);
void dupK5toCC(krb5_context context, krb5_creds *creds, cred_union **cu);
+cc_int32 krb5int_free_cc_cred_union (cred_union** creds);
+#endif
int stdccCredsMatch(krb5_context context, krb5_creds *base, krb5_creds *match, int whichfields);
int bitTst(int var, int mask);
-cc_int32 krb5_free_cc_cred_union (cred_union** creds);
#define kAddressArray 4
#define kAuthDataArray 5
#ifndef KRB5_WINCCLD_H_
#define KRB5_WINCCLD_H_
+#ifdef USE_CCAPI_V3
+#include <CredentialsCache.h>
+#else
+
#ifndef CC_API_VER2
#define CC_API_VER2
#endif
#include "cacheapi.h"
+#endif
+#ifdef USE_CCAPI_V3
+typedef CCACHE_API cc_int32 (*FP_cc_initialize) (
+ cc_context_t* outContext,
+ cc_int32 inVersion,
+ cc_int32* outSupportedVersion,
+ char const** outVendor);
+#else
typedef cc_int32 (*FP_cc_initialize)(apiCB**, const cc_int32,
cc_int32*, const char**);
typedef cc_int32 (*FP_cc_shutdown)(apiCB**);
typedef cc_int32 (*FP_cc_free_principal)(apiCB*, char**);
typedef cc_int32 (*FP_cc_free_name)(apiCB*, char** name);
typedef cc_int32 (*FP_cc_free_creds)(apiCB*, cred_union** pCred);
+#endif
#ifdef KRB5_WINCCLD_C_
typedef struct _FUNC_INFO {
#endif
DECL_FUNC_PTR(cc_initialize);
+#ifndef USE_CCAPI_V3
DECL_FUNC_PTR(cc_shutdown);
DECL_FUNC_PTR(cc_get_change_time);
DECL_FUNC_PTR(cc_create);
DECL_FUNC_PTR(cc_free_principal);
DECL_FUNC_PTR(cc_free_name);
DECL_FUNC_PTR(cc_free_creds);
+#endif
#ifdef KRB5_WINCCLD_C_
FUNC_INFO krbcc_fi[] = {
MAKE_FUNC_INFO(cc_initialize),
+#ifndef USE_CCAPI_V3
MAKE_FUNC_INFO(cc_shutdown),
MAKE_FUNC_INFO(cc_get_change_time),
MAKE_FUNC_INFO(cc_create),
MAKE_FUNC_INFO(cc_free_principal),
MAKE_FUNC_INFO(cc_free_name),
MAKE_FUNC_INFO(cc_free_creds),
+#endif
END_FUNC_INFO
};
#undef MAKE_FUNC_INFO
#else
#define cc_initialize pcc_initialize
+#ifndef USE_CCAPI_V3
#define cc_shutdown pcc_shutdown
#define cc_get_change_time pcc_get_change_time
#define cc_create pcc_create
#define cc_free_name pcc_free_name
#define cc_free_creds pcc_free_creds
#endif
+#endif
#undef DECL_FUNC_PTR
pfxlen = cp - name;
- if ( pfxlen == 1 && isalpha(name[0]) ) {
+ if ( pfxlen == 1 && isalpha((unsigned char) name[0]) ) {
/* We found a drive letter not a prefix - use FILE: */
pfx = strdup("FILE:");
if (!pfx)
clean-unix:: clean-libobjs
$(RM) $(HDRS) $(ETSRCS)
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
$(RM) $(OBJFILE)
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
pfxlen = cp - name;
- if ( pfxlen == 1 && isalpha(name[0]) ) {
+ if ( pfxlen == 1 && isalpha((unsigned char) name[0]) ) {
/* We found a drive letter not a prefix - use FILE: */
pfx = strdup("FILE:");
if (!pfx)
$(OUTPRE)t_deltat$(EXEEXT) $(OUTPRE)t_deltat.$(OBJEXT) \
$(OUTPRE)t_expand$(EXEEXT) $(OUTPRE)t_expand.$(OBJEXT)
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
return retval;
if (domain) {
for (cp = domain; *cp; cp++)
- if (isupper((int) (*cp)))
- *cp = tolower((int) *cp);
+ if (isupper((unsigned char) (*cp)))
+ *cp = tolower((unsigned char) *cp);
strncat(buf, ".", sizeof(buf) - 1 - strlen(buf));
strncat(buf, domain, sizeof(buf) - 1 - strlen(buf));
krb5_xfree(domain);
return(ret);
}
+
+static krb5_error_code
+copy_ktypes(krb5_context ctx,
+ unsigned int nktypes,
+ krb5_enctype *oldktypes,
+ krb5_enctype **newktypes)
+{
+ unsigned int i;
+
+ *newktypes = NULL;
+ if (!nktypes)
+ return 0;
+
+ *newktypes = malloc(nktypes * sizeof(krb5_enctype));
+ if (*newktypes == NULL)
+ return ENOMEM;
+ for (i = 0; i < nktypes; i++)
+ (*newktypes)[i] = oldktypes[i];
+ return 0;
+}
+
+krb5_error_code KRB5_CALLCONV
+krb5_copy_context(krb5_context ctx, krb5_context *nctx_out)
+{
+ krb5_error_code ret;
+ krb5_context nctx;
+
+ *nctx_out = NULL;
+ if (ctx == NULL)
+ return EINVAL; /* XXX */
+
+ nctx = malloc(sizeof(*nctx));
+ if (nctx == NULL)
+ return ENOMEM;
+
+ *nctx = *ctx;
+
+ nctx->in_tkt_ktypes = NULL;
+ nctx->in_tkt_ktype_count = 0;
+ nctx->tgs_ktypes = NULL;
+ nctx->tgs_ktype_count = 0;
+ nctx->default_realm = NULL;
+ nctx->profile = NULL;
+ nctx->db_context = NULL;
+ nctx->ser_ctx_count = 0;
+ nctx->ser_ctx = NULL;
+ nctx->prompt_types = NULL;
+ nctx->os_context->default_ccname = NULL;
+
+ memset(&nctx->libkrb5_plugins, 0, sizeof(nctx->libkrb5_plugins));
+ nctx->vtbl = NULL;
+ nctx->locate_fptrs = NULL;
+
+ memset(&nctx->err, 0, sizeof(nctx->err));
+
+ ret = copy_ktypes(nctx, ctx->in_tkt_ktype_count,
+ ctx->in_tkt_ktypes, &nctx->in_tkt_ktypes);
+ if (ret)
+ goto errout;
+ nctx->in_tkt_ktype_count = ctx->in_tkt_ktype_count;
+
+ ret = copy_ktypes(nctx, ctx->tgs_ktype_count,
+ ctx->tgs_ktypes, &nctx->in_tkt_ktypes);
+ if (ret)
+ goto errout;
+ nctx->tgs_ktype_count = ctx->tgs_ktype_count;
+
+ if (ctx->os_context->default_ccname != NULL) {
+ nctx->os_context->default_ccname =
+ strdup(ctx->os_context->default_ccname);
+ if (nctx->os_context->default_ccname == NULL) {
+ ret = ENOMEM;
+ goto errout;
+ }
+ }
+ ret = krb5_get_profile(ctx, &nctx->profile);
+ if (ret)
+ goto errout;
+
+errout:
+ if (ret) {
+ krb5_free_context(nctx);
+ } else {
+ *nctx_out = nctx;
+ }
+ return ret;
+}
#include <stdarg.h>
#include "k5-int.h"
-void
+void KRB5_CALLCONV_C
krb5_set_error_message (krb5_context ctx, krb5_error_code code,
const char *fmt, ...)
{
va_end (args);
}
-void
+void KRB5_CALLCONV
krb5_vset_error_message (krb5_context ctx, krb5_error_code code,
const char *fmt, va_list args)
{
krb5int_vset_error (&ctx->err, code, fmt, args);
}
-char *
+char * KRB5_CALLCONV
krb5_get_error_message (krb5_context ctx, krb5_error_code code)
{
if (ctx == NULL)
return krb5int_get_error (&ctx->err, code);
}
-void
+void KRB5_CALLCONV
krb5_free_error_message (krb5_context ctx, char *msg)
{
if (ctx == NULL)
krb5int_free_error (&ctx->err, msg);
}
-void
+void KRB5_CALLCONV
krb5_clear_error_message (krb5_context ctx)
{
if (ctx == NULL)
retval = krb5_rc_recover_or_initialize(context, rcache, context->clockskew);
if (retval) {
krb5_rc_close(context, rcache);
- rcache = 0;
goto cleanup;
}
*rcptr = rcache;
- rcache = 0;
retval = 0;
cleanup:
- if (rcache)
- krb5_xfree(rcache);
if (cachename)
krb5_xfree(cachename);
return retval;
krb5_copy_authdata
krb5_copy_authenticator
krb5_copy_checksum
+krb5_copy_context
krb5_copy_creds
krb5_copy_data
krb5_copy_keyblock
PROG_RPATH=$(KRB5_LIBDIR)
DEFS=
DEFINES=-DLIBDIR=\"$(KRB5_LIBDIR)\"
+LOCALINCLUDES=-I$(SRCTOP)/util/profile
##DOS##BUILDTOP = ..\..\..
##DOS##PREFIXDIR=os
TEST_PROGS= t_std_conf t_an_to_ln t_locate_kdc
-T_STD_CONF_OBJS= t_std_conf.o def_realm.o get_krbhst.o realm_dom.o \
- hst_realm.o init_os_ctx.o locate_kdc.o dnsglue.o
+T_STD_CONF_OBJS= t_std_conf.o
T_AN_TO_LN_OBJS = t_an_to_ln.o an_to_ln.o
clean::
$(RM) $(TEST_PROGS) test.out t_std_conf.o t_an_to_ln.o
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
$(SRCTOP)/include/k5-platform.h $(SRCTOP)/include/k5-plugin.h \
$(SRCTOP)/include/k5-thread.h $(SRCTOP)/include/krb5.h \
$(SRCTOP)/include/krb5/locate_plugin.h $(SRCTOP)/include/port-sockets.h \
- $(SRCTOP)/include/socket-utils.h init_os_ctx.c os-proto.h
+ $(SRCTOP)/include/socket-utils.h $(SRCTOP)/util/profile/prof_int.h \
+ init_os_ctx.c os-proto.h
krbfileio.so krbfileio.po $(OUTPRE)krbfileio.$(OBJEXT): \
$(BUILDTOP)/include/autoconf.h $(BUILDTOP)/include/krb5/krb5.h \
$(BUILDTOP)/include/osconf.h $(BUILDTOP)/include/profile.h \
}
for (cp = local_host; *cp; cp++) {
- if (isupper((int) (*cp)))
- *cp = tolower((int) *cp);
+ if (isupper((unsigned char) (*cp)))
+ *cp = tolower((unsigned char) *cp);
}
l = strlen(local_host);
/* strip off trailing dot */
/* Assume the realm name is upper case */
for (cp = realm; *cp; cp++)
- if (islower((int) (*cp)))
- *cp = toupper((int) *cp);
+ if (islower((unsigned char) (*cp)))
+ *cp = toupper((unsigned char) *cp);
} else {
/* We are defaulting to the local realm */
retval = krb5_get_default_realm(context, &realm);
#include "k5-int.h"
#include "os-proto.h"
+#include "prof_int.h" /* XXX for profile_copy, not public yet */
#ifdef USE_LOGIN_LIBRARY
#include "KerberosLoginPrivate.h"
krb5_error_code KRB5_CALLCONV
krb5_get_profile (krb5_context ctx, profile_t *profile)
{
- krb5_error_code retval = 0;
- profile_filespec_t *files = 0;
-
- retval = os_get_default_config_files(&files, ctx->profile_secure);
-
- if (!retval) {
- retval = profile_init((const_profile_filespec_t *) files,
- profile);
- }
-
- if (files)
- free_filespecs(files);
-
- if (retval == ENOENT)
- return KRB5_CONFIG_CANTOPEN;
-
- if ((retval == PROF_SECTION_NOTOP) ||
- (retval == PROF_SECTION_SYNTAX) ||
- (retval == PROF_RELATION_SYNTAX) ||
- (retval == PROF_EXTRA_CBRACE) ||
- (retval == PROF_MISSING_OBRACE))
- return KRB5_CONFIG_BADFORMAT;
-
- return retval;
+ return profile_copy (ctx->profile, profile);
}
if (type == KRB5_NT_SRV_HST)
for (cp = remote_host; *cp; cp++)
- if (isupper((int) (*cp)))
- *cp = tolower((int) (*cp));
+ if (isupper((unsigned char) (*cp)))
+ *cp = tolower((unsigned char) (*cp));
/*
* Windows NT5's broken resolver gratuitously tacks on a
clean-unix:: clean-libobjs
##WIN32##LIBOBJS = $(OUTPRE)syslog.obj
-# @libobj_frag@
+@libobj_frag@
all-unix:: all-libobjs
clean-unix:: clean-libobjs
-# @libobj_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
krb5_copy_authdata
krb5_copy_authenticator
krb5_copy_checksum
+ krb5_copy_context
krb5_copy_creds
krb5_copy_data
krb5_copy_keyblock
$(HDRS): includes
-# @lib_frag@
-# @libobj_frag@
+@lib_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
/*
* patchlevel.h
*
- * Copyright (C) 2004 by the Massachusetts Institute of Technology.
+ * Copyright (C) 2004-2006 by the Massachusetts Institute of Technology.
* All rights reserved.
*
* Export of this software from the United States of America may
* organization.
*/
#define KRB5_MAJOR_RELEASE 1
-#define KRB5_MINOR_RELEASE 5
+#define KRB5_MINOR_RELEASE 6
#define KRB5_PATCHLEVEL 0
-#define KRB5_RELTAIL "alpha1-postrelease"
+#define KRB5_RELTAIL "prerelease"
/* #undef KRB5_RELDATE */
/* #undef KRB5_RELTAG */
clean::
$(RM) lib$(LIBBASE)$(SO_EXT) db2_exp.o
-# @libnover_frag@
-# @libobj_frag@
+@libnover_frag@
+@libobj_frag@
.depend-verify-db: depend-verify-db-$(DB_VERSION)
depend-verify-db-k5:
clean-includes::
$(RM) $(HDRS) include/*.stmp
-# @lib_frag@
+@lib_frag@
all-unix:: all-libobjs
clean-unix:: clean-libobjs
-# @libobj_frag@
+@libobj_frag@
all-unix:: all-libobjs
clean-unix:: clean-libobjs
-# @libobj_frag@
+@libobj_frag@
all-unix:: all-libobjs
clean-unix:: clean-libobjs
-# @libobj_frag@
+@libobj_frag@
all-unix:: all-libobjs
clean-unix:: clean-libobjs
-# @libobj_frag@
+@libobj_frag@
all-unix:: all-libobjs
clean-unix:: clean-libobjs
-# @libobj_frag@
+@libobj_frag@
all-unix:: all-libobjs
clean-unix:: clean-libobjs
-# @libobj_frag@
+@libobj_frag@
install-unix:: install-libs
clean-unix:: clean-libs clean-libobjs
-# @libnover_frag@
-# @libobj_frag@
+@libnover_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
.I kpropd
to listen on. This is only useful if the program is run in standalone
mode.
+.TP
+.B \-a
+allows the user to specify the path to the
+.KR kpropd.acl
+file; by default the path used is KPROPD_ACL_FILE
+(normally /usr/local/var/krb5kdc/kpropd.acl).
.SH FILES
.TP "\w'kpropd.acl\ \ 'u"
kpropd.acl
Access file for
-.BR kpropd .
+.BR kpropd ;
+the default location is KPROPD_ACL_FILE (normally
+/usr/local/var/krb5kdc/kpropd.acl).
Each entry is a line containing the principal of a host from which the
local machine will allow Kerberos database propagation via kprop.
.SH SEE ALSO
case 'S':
standalone++;
break;
- case 'a':
+ case 'a':
if (*word)
acl_file_name = word;
else
for (lo = 0, dp = d->data, cp = s; *cp; cp++) {
if (*cp < 0)
return ASN1_PARSE_ERROR;
- else if (isspace(*cp))
+ else if (isspace((unsigned char) *cp))
continue;
- else if (isxdigit(*cp)) {
+ else if (isxdigit((unsigned char) *cp)) {
buf[0] = *cp;
v = strtol(buf, NULL, 16);
} else
start_ftp_daemon
# Make an ftp client connection to it.
- spawn $FTP $hostname [expr 8 + $portbase]
+ spawn $FTP -d -v $hostname [expr 8 + $portbase]
expect_after {
"GSSAPI authentication failed" {
global spawn_id
global supported_enctypes
global KRBIV
+ global portbase
+ global mode
# Start up the kerberos and kadmind daemons.
if ![start_kerberos_daemons 1] {
pass "kadmin.local correct high kvno"
}
}
+
+ if { $mode == "tcp" } {
+ set response {}
+ set got_response 0
+ set kdcsock ""
+ catch {
+ send_log "connecting to $hostname [expr 3 + $portbase]\n"
+ set kdcsock [socket $hostname [expr 3 + $portbase]]
+ fconfigure $kdcsock -encoding binary -blocking 0 -buffering none
+ puts -nonewline $kdcsock [binary format H* ffffffff]
+ # XXX
+ sleep 3
+ set response [read $kdcsock]
+ set got_response 1
+ } msg
+ if [string length $kdcsock] { catch "close $kdcsock" }
+ if $got_response {
+# send_log [list sent length -1, got back $response]
+# send_log "\n"
+ if [string length $response]>10 {
+ pass "too-long TCP request"
+ } else {
+ send_log "response too short\n"
+ fail "too-long TCP request"
+ }
+ } else {
+ send_log "too-long connect/exchange failure: $msg\n"
+ fail "too-long TCP request"
+ }
+ }
}
set status [catch doit msg]
use strict;
use IO::File;
-my $h_filename = shift @ARGV || die "usage: $0 header-file [def-file]\n";
+my $verbose = 0;
+my $error = 0;
+if ( $ARGV[0] eq "-v" ) { $verbose = 1; shift @ARGV; }
+my $h_filename = shift @ARGV || die "usage: $0 [-v] header-file [def-file]\n";
my $d_filename = shift @ARGV;
my $h = open_always($h_filename);
}
Top:
# drop KRB5INT_BEGIN_DECLS and KRB5INT_END_DECLS
- if (/^ *KRB5INT_BEGIN_DECLS/) {
- next LINE;
- }
- if (/^ *KRB5INT_END_DECLS/) {
+ if (/^ *(KRB5INT|GSSAPI[A-Z]*)_(BEGIN|END)_DECLS/) {
next LINE;
}
# drop preprocessor directives
if (/^ *#/) {
+ while (/\\$/) { $_ .= $h->getline(); }
next LINE;
}
if (/^ *\?==/) {
}
# multi-line comments?
if (/\/\*$/) {
- $_ .= "\n";
+ $_ .= " ";
$len1 = length;
$_ .= $h->getline();
chop if $len1 < length;
if (/^[ \t]*$/) {
next LINE;
}
- if (/ *extern "C" {/) {
+ if (/^ *extern "C" {/) {
next LINE;
}
# elide struct definitions
}
}
-print join("\n\t", "Using default calling convention:", sort(@convD));
-print join("\n\t", "\nUsing KRB5_CALLCONV:", sort(@convK));
-print join("\n\t", "\nUsing KRB5_CALLCONV_C:", sort(@convC));
-print join("\n\t", "\nUsing KRB5_CALLCONV_WRONG:", sort(@convW));
-print "\n","-"x70,"\n";
+if ( $verbose ) {
+ print join("\n\t", "Using default calling convention:", sort(@convD));
+ print join("\n\t", "\nUsing KRB5_CALLCONV:", sort(@convK));
+ print join("\n\t", "\nUsing KRB5_CALLCONV_C:", sort(@convC));
+ print join("\n\t", "\nUsing KRB5_CALLCONV_WRONG:", sort(@convW));
+ print "\n","-"x70,"\n";
+}
%conv = ();
map { $conv{$_} = "default"; } @convD;
map { $vararg{$_} = 1; } @vararg;
if (!$d) {
- print "No .DEF file specified\n";
- exit;
+ print "No .DEF file specified\n" if $verbose;
+ exit 0;
}
LINE2:
$printit = 0;
next LINE2;
}
- if (/^EXPORTS/) {
+ if (/^EXPORTS/ || /^DESCRIPTION/ || /^HEAPSIZE/) {
$printit = 0;
next LINE2;
}
my($xconv);
if (/PRIVATE/ || /INTERNAL/) {
$xconv = "PRIVATE";
+ } elsif (/DATA/) {
+ $xconv = "DATA";
} elsif (/!CALLCONV/ || /KRB5_CALLCONV_WRONG/) {
$xconv = "KRB5_CALLCONV_WRONG";
} elsif ($vararg{$_}) {
s/;.*$//;
if ($xconv eq "PRIVATE") {
- print "\t private $_\n";
+ print "\t private $_\n" if $verbose;
+ next LINE2;
+ }
+ if ($xconv eq "DATA") {
+ print "\t data $_\n" if $verbose;
next LINE2;
}
if (!defined($conv{$_})) {
print "No calling convention specified for $_!\n";
+ $error = 1;
} elsif (! ($conv{$_} eq $xconv)) {
print "Function $_ should have calling convention '$xconv', but has '$conv{$_}' instead.\n";
+ $error = 1;
} else {
# print "Function $_ is okay.\n";
}
}
#print "Calling conventions defined for: ", keys(%conv);
+exit $error;
depend:: et_lex.lex.c
-# @lib_frag@
-# @libobj_frag@
+@lib_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
svn export $repository/$reltag $reldir
fi
-if test $dosrc = t; then
- if test -d $reldir/src/util/autoconf; then
- echo "Building autoconf..."
- (cd $reldir/src/util/autoconf
- M4=gm4 ./configure
- make)
- fi
- echo "Creating configure scripts..."
- (cd $reldir/src; util/reconf)
-
- if test -d $reldir/src/util/autoconf; then
- echo "Cleaning src/util/autoconf..."
- (cd $reldir/src/util/autoconf; make distclean)
- fi
-fi
-
echo "Editing release-specific files..."
if test $newstyle = t; then
sed -e '/RELDATE/c\
#define KRB5_RELDATE "'"$reldate"'"' patchlevel.h > patchlevel.h.new && \
mv patchlevel.h.new patchlevel.h)
+ if test $checkout = t; then
+ (cd $reldir && svn log -v $repository/$reltag > doc/CHANGES)
+ fi
else
(cd $reldir/src/lib/krb5/krb && \
)
fi
+if test $dosrc = t; then
+ if test -d $reldir/src/util/autoconf; then
+ echo "Building autoconf..."
+ (cd $reldir/src/util/autoconf
+ M4=gm4 ./configure
+ make)
+ fi
+ echo "Creating configure scripts..."
+ (cd $reldir/src; util/reconf)
+
+ if test -d $reldir/src/util/autoconf; then
+ echo "Cleaning src/util/autoconf..."
+ (cd $reldir/src/util/autoconf; make distclean)
+ fi
+fi
+
echo "Nuking unneeded files..."
find $reldir \( -name TODO -o -name todo -o -name .cvsignore \
-o -name BADSYMS -o -name .Sanitize -o -name .rconf \) -print \
$(OUTPRE)test_parse test.ini
-# @lib_frag@
-# @libobj_frag@
+@lib_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
return 0;
}
+#define COUNT_LINKED_LIST(COUNT, PTYPE, START, FIELD) \
+ { \
+ int cll_counter = 0; \
+ PTYPE cll_ptr = (START); \
+ while (cll_ptr != NULL) { \
+ cll_counter++; \
+ cll_ptr = cll_ptr->FIELD; \
+ } \
+ (COUNT) = cll_counter; \
+ }
+
+errcode_t KRB5_CALLCONV
+profile_copy(profile_t old_profile, profile_t *new_profile)
+{
+ size_t size, i;
+ const_profile_filespec_t *files;
+ prf_file_t file;
+ errcode_t err;
+
+ /* The fields we care about are read-only after creation, so
+ no locking is needed. */
+ COUNT_LINKED_LIST (size, prf_file_t, old_profile->first_file, next);
+ files = malloc ((size+1) * sizeof(*files));
+ if (files == NULL)
+ return errno;
+ for (i = 0, file = old_profile->first_file; i < size; i++, file = file->next)
+ files[i] = file->data->filespec;
+ files[size] = NULL;
+ err = profile_init (files, new_profile);
+ free (files);
+ return err;
+}
+
errcode_t KRB5_CALLCONV
profile_init_path(const_profile_filespec_list_t filepath,
profile_t *ret_profile)
/* prof_file.c */
+errcode_t KRB5_CALLCONV profile_copy (profile_t, profile_t *);
+
errcode_t profile_open_file
(const_profile_filespec_t file, prf_file_t *ret_prof);
TAGS test_ss
-# @lib_frag@
-# @libobj_frag@
+@lib_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
PROG_RPATH=$(KRB5_LIBDIR)
LIBBASE=krb5support
-LIBMAJOR=1
-LIBMINOR=0
+LIBMAJOR=@SUPPORTLIB_MAJOR@
+LIBMINOR=1
LIBINITFUNC=krb5int_thread_support_init
LIBFINIFUNC=krb5int_thread_support_fini
t_mktime: gmt_mktime.c
$(CC) $(ALL_CFLAGS) -DTEST_LEAP -o t_mktime $(srcdir)/gmt_mktime.c
-# @lib_frag@
-# @libobj_frag@
+@lib_frag@
+@libobj_frag@
# +++ Dependency line eater +++
#
krb5int_vset_error (struct errinfo *ep, long code,
const char *fmt, va_list args)
{
+ char *p;
+
if (ep->msg && ep->msg != ep->scratch_buf) {
free (ep->msg);
ep->msg = NULL;
}
#endif
vsnprintf(ep->scratch_buf, sizeof(ep->scratch_buf), fmt, args);
- ep->msg = ep->scratch_buf;
+ p = strdup(ep->scratch_buf);
+ ep->msg = p ? p : ep->scratch_buf;
}
char *
krb5int_get_error (struct errinfo *ep, long code)
{
char *r, *r2;
- if (code != ep->code)
- krb5int_clear_error (ep);
- if (ep->msg) {
- r = ep->msg;
- ep->msg = NULL;
+ if (code == ep->code && ep->msg) {
+ r = strdup(ep->msg);
+ if (r == NULL) {
+ strcpy(ep->scratch_buf, _("Out of memory"));
+ r = ep->scratch_buf;
+ }
return r;
}
if (initialize() != 0) {
if (fptr == NULL) {
unlock();
#ifdef HAVE_STRERROR_R
- if (strerror_r (code, ep->scratch_buf, sizeof(ep->scratch_buf)) == 0)
+ if (strerror_r (code, ep->scratch_buf, sizeof(ep->scratch_buf)) == 0) {
+ char *p = strdup(ep->scratch_buf);
+ if (p)
+ return p;
return ep->scratch_buf;
+ }
/* If strerror_r didn't work with the 1K buffer, we can try a
really big one. This seems kind of gratuitous though. */
#define BIG_ERR_BUFSIZ 8192
/*
- * Copyright (C) 2001,2002,2003,2004,2005 by the Massachusetts Institute of Technology,
+ * Copyright (C) 2001,2002,2003,2004,2005,2006 by the Massachusetts Institute of Technology,
* Cambridge, MA, USA. All Rights Reserved.
*
* This software is being provided to you, the LICENSEE, by the
either getaddrinfo or one of these two flavors of
gethostbyname_r? */
#if !defined(HAVE_GETHOSTBYNAME_R) || defined(THREADSAFE_GETHOSTBYNAME)
-#define GET_HOST_BY_NAME(NAME, HP, ERR) \
- { (HP) = gethostbyname (NAME); (ERR) = h_errno; }
-#define GET_HOST_BY_ADDR(ADDR, ADDRLEN, FAMILY, HP, ERR) \
- { (HP) = gethostbyaddr ((ADDR), (ADDRLEN), (FAMILY)); (ERR) = h_errno; }
+typedef struct hostent *GET_HOST_TMP;
+#define GET_HOST_BY_NAME(NAME, HP, ERR, TMP) \
+ { TMP = gethostbyname (NAME); (ERR) = h_errno; (HP) = TMP; }
+#define GET_HOST_BY_ADDR(ADDR, ADDRLEN, FAMILY, HP, ERR, TMP) \
+ { TMP = gethostbyaddr ((ADDR), (ADDRLEN), (FAMILY)); (ERR) = h_errno; (HP) = TMP; }
#else
#ifdef _AIX /* XXX should have a feature test! */
-#define GET_HOST_BY_NAME(NAME, HP, ERR) \
- { \
- struct hostent my_h_ent; \
- struct hostent_data my_h_ent_data; \
- (HP) = (gethostbyname_r((NAME), &my_h_ent, &my_h_ent_data) \
- ? 0 \
- : &my_h_ent); \
- (ERR) = h_errno; \
+typedef struct {
+ struct hostent ent;
+ struct hostent_data data;
+} GET_HOST_TMP;
+#define GET_HOST_BY_NAME(NAME, HP, ERR, TMP) \
+ { \
+ (HP) = (gethostbyname_r((NAME), &TMP.ent, &TMP.data) \
+ ? 0 \
+ : &my_h_ent); \
+ (ERR) = h_errno; \
}
/*
#define GET_HOST_BY_ADDR(ADDR, ADDRLEN, FAMILY, HP, ERR) \
*/
#else
#ifdef GETHOSTBYNAME_R_RETURNS_INT
-#define GET_HOST_BY_NAME(NAME, HP, ERR) \
+typedef struct {
+ struct hostent ent;
+ char buf[8192];
+} GET_HOST_TMP;
+#define GET_HOST_BY_NAME(NAME, HP, ERR, TMP) \
{ \
- struct hostent my_h_ent, *my_hp; \
- int my_h_err; \
- char my_h_buf[8192]; \
- (HP) = (gethostbyname_r((NAME), &my_h_ent, \
- my_h_buf, sizeof (my_h_buf), &my_hp, \
- &my_h_err) \
+ struct hostent *my_hp = NULL; \
+ int my_h_err, my_ret; \
+ my_ret = gethostbyname_r((NAME), &TMP.ent, \
+ TMP.buf, sizeof (TMP.buf), &my_hp, \
+ &my_h_err); \
+ (HP) = (((my_ret != 0) || (my_hp != &TMP.ent)) \
? 0 \
- : &my_h_ent); \
+ : &TMP.ent); \
(ERR) = my_h_err; \
}
-#define GET_HOST_BY_ADDR(ADDR, ADDRLEN, FAMILY, HP, ERR) \
+#define GET_HOST_BY_ADDR(ADDR, ADDRLEN, FAMILY, HP, ERR, TMP) \
{ \
- struct hostent my_h_ent, *my_hp; \
- int my_h_err; \
- char my_h_buf[8192]; \
- (HP) = (gethostbyaddr_r((ADDR), (ADDRLEN), (FAMILY), &my_h_ent, \
- my_h_buf, sizeof (my_h_buf), &my_hp, \
- &my_h_err) \
+ struct hostent *my_hp; \
+ int my_h_err, my_ret; \
+ my_ret = gethostbyaddr_r((ADDR), (ADDRLEN), (FAMILY), &TMP.ent, \
+ TMP.buf, sizeof (TMP.buf), &my_hp, \
+ &my_h_err); \
+ (HP) = (((my_ret != 0) || (my_hp != &TMP.ent)) \
? 0 \
- : &my_h_ent); \
+ : &TMP.ent); \
(ERR) = my_h_err; \
}
#else
-#define GET_HOST_BY_NAME(NAME, HP, ERR) \
+typedef struct {
+ struct hostent ent;
+ char buf[8192];
+} GET_HOST_TMP;
+#define GET_HOST_BY_NAME(NAME, HP, ERR, TMP) \
{ \
- struct hostent my_h_ent; \
int my_h_err; \
- char my_h_buf[8192]; \
- (HP) = gethostbyname_r((NAME), &my_h_ent, \
- my_h_buf, sizeof (my_h_buf), &my_h_err); \
+ (HP) = gethostbyname_r((NAME), &TMP.ent, \
+ TMP.buf, sizeof (TMP.buf), &my_h_err); \
(ERR) = my_h_err; \
}
-#define GET_HOST_BY_ADDR(ADDR, ADDRLEN, FAMILY, HP, ERR) \
+#define GET_HOST_BY_ADDR(ADDR, ADDRLEN, FAMILY, HP, ERR, TMP) \
{ \
- struct hostent my_h_ent; \
int my_h_err; \
- char my_h_buf[8192]; \
- (HP) = gethostbyaddr_r((ADDR), (ADDRLEN), (FAMILY), &my_h_ent, \
- my_h_buf, sizeof (my_h_buf), &my_h_err); \
+ (HP) = gethostbyaddr_r((ADDR), (ADDRLEN), (FAMILY), &TMP.ent, \
+ TMP.buf, sizeof (TMP.buf), &my_h_err); \
(ERR) = my_h_err; \
}
#endif /* returns int? */
/* Now do the same for getservby* functions. */
#ifndef HAVE_GETSERVBYNAME_R
-#define GET_SERV_BY_NAME(NAME, PROTO, SP, ERR) \
- ((SP) = getservbyname (NAME, PROTO), (ERR) = (SP) ? 0 : -1)
-#define GET_SERV_BY_PORT(PORT, PROTO, SP, ERR) \
- ((SP) = getservbyport (PORT, PROTO), (ERR) = (SP) ? 0 : -1)
+typedef struct servent *GET_SERV_TMP;
+#define GET_SERV_BY_NAME(NAME, PROTO, SP, ERR, TMP) \
+ (TMP = getservbyname (NAME, PROTO), (SP) = TMP, (ERR) = (SP) ? 0 : -1)
+#define GET_SERV_BY_PORT(PORT, PROTO, SP, ERR, TMP) \
+ (TMP = getservbyport (PORT, PROTO), (SP) = TMP, (ERR) = (SP) ? 0 : -1)
#else
#ifdef GETSERVBYNAME_R_RETURNS_INT
-#define GET_SERV_BY_NAME(NAME, PROTO, SP, ERR) \
+typedef struct {
+ struct servent ent;
+ char buf[8192];
+} GET_SERV_TMP;
+#define GET_SERV_BY_NAME(NAME, PROTO, SP, ERR, TMP) \
{ \
- struct servent my_s_ent, *my_sp; \
+ struct servent *my_sp; \
int my_s_err; \
- char my_s_buf[8192]; \
- (SP) = (getservbyname_r((NAME), (PROTO), &my_s_ent, \
- my_s_buf, sizeof (my_s_buf), &my_sp, \
+ (SP) = (getservbyname_r((NAME), (PROTO), &TMP.ent, \
+ TMP.buf, sizeof (TMP.buf), &my_sp, \
&my_s_err) \
? 0 \
- : &my_s_ent); \
+ : &TMP.ent); \
(ERR) = my_s_err; \
}
-#define GET_SERV_BY_PORT(PORT, PROTO, SP, ERR) \
+#define GET_SERV_BY_PORT(PORT, PROTO, SP, ERR, TMP) \
{ \
- struct servent my_s_ent, *my_sp; \
+ struct servent *my_sp; \
int my_s_err; \
- char my_s_buf[8192]; \
- (SP) = (getservbyport_r((PORT), (PROTO), &my_s_ent, \
- my_s_buf, sizeof (my_s_buf), &my_sp, \
+ (SP) = (getservbyport_r((PORT), (PROTO), &TMP.ent, \
+ TMP.buf, sizeof (TMP.buf), &my_sp, \
&my_s_err) \
? 0 \
- : &my_s_ent); \
+ : &TMP.ent); \
(ERR) = my_s_err; \
}
#else
/* returns ptr -- IRIX? */
-#define GET_SERV_BY_NAME(NAME, PROTO, SP, ERR) \
+typedef struct {
+ struct servent ent;
+ char buf[8192];
+} GET_SERV_TMP;
+#define GET_SERV_BY_NAME(NAME, PROTO, SP, ERR, TMP) \
{ \
- struct servent my_s_ent; \
- char my_s_buf[8192]; \
- (SP) = getservbyname_r((NAME), (PROTO), &my_s_ent, \
- my_s_buf, sizeof (my_s_buf)); \
+ (SP) = getservbyname_r((NAME), (PROTO), &TMP.ent, \
+ TMP.buf, sizeof (TMP.buf)); \
(ERR) = (SP) == NULL; \
}
-#define GET_SERV_BY_PORT(PORT, PROTO, SP, ERR) \
+#define GET_SERV_BY_PORT(PORT, PROTO, SP, ERR, TMP) \
{ \
- struct servent my_s_ent, *my_sp; \
- char my_s_buf[8192]; \
- my_sp = getservbyport_r((PORT), (PROTO), &my_s_ent, \
- my_s_buf, sizeof (my_s_buf)); \
+ struct servent *my_sp; \
+ my_sp = getservbyport_r((PORT), (PROTO), &TMP.ent, \
+ TMP.buf, sizeof (TMP.buf)); \
(SP) = my_sp; \
(ERR) = my_sp == 0; \
(ERR) = (ERR); /* avoid "unused" warning */ \
struct hostent *hp;
int i, r;
int herr;
+ GET_HOST_TMP htmp;
- GET_HOST_BY_NAME (name, hp, herr);
+ GET_HOST_BY_NAME (name, hp, herr, htmp);
if (hp == 0)
return translate_h_errno (herr);
for (i = 0; hp->h_addr_list[i]; i++) {
} else {
struct servent *sp;
int try_dgram_too = 0, s_err;
+ GET_SERV_TMP stmp;
if (socktype == 0) {
try_dgram_too = 1;
}
try_service_lookup:
GET_SERV_BY_NAME(serv, socktype == SOCK_STREAM ? "tcp" : "udp",
- sp, s_err);
+ sp, s_err, stmp);
if (sp == 0) {
if (try_dgram_too) {
socktype = SOCK_DGRAM;
#endif
} else {
int herr;
+ GET_HOST_TMP htmp;
+
GET_HOST_BY_ADDR((const char *) &sinp->sin_addr,
sizeof (struct in_addr),
- sa->sa_family, hp, herr);
+ sa->sa_family, hp, herr, htmp);
if (hp == 0) {
if (herr == NO_ADDRESS && !(flags & NI_NAMEREQD)) /* ??? */
goto numeric_host;
strncpy (service, numbuf, slen);
} else {
int serr;
+ GET_SERV_TMP stmp;
+
GET_SERV_BY_PORT(sinp->sin_port,
(flags & NI_DGRAM) ? "udp" : "tcp",
- sp, serr);
+ sp, serr, stmp);
if (sp == 0)
goto numeric_service;
strncpy (service, sp->s_name, slen);
struct hostent *hp;
const char *name2 = 0;
int i, herr;
+ GET_HOST_TMP htmp;
/*
* Current versions of GET_HOST_BY_NAME will fail if the
* target hostname has IPv6 addresses only. Make sure it
* fails fairly cleanly.
*/
- GET_HOST_BY_NAME (name, hp, herr);
+ GET_HOST_BY_NAME (name, hp, herr, htmp);
if (hp == 0) {
/*
* This case probably means it's an IPv6-only name. If
#if USE_DLOPEN
if (!err && (statbuf.st_mode & S_IFMT) == S_IFREG) {
void *handle = NULL;
+#ifdef RTLD_GROUP
+#define PLUGIN_DLOPEN_FLAGS (RTLD_NOW | RTLD_LOCAL | RTLD_GROUP)
+#else
+#define PLUGIN_DLOPEN_FLAGS (RTLD_NOW | RTLD_LOCAL)
+#endif
if (!err) {
- handle = dlopen(filepath, RTLD_NOW | RTLD_GLOBAL);
+ handle = dlopen(filepath, PLUGIN_DLOPEN_FLAGS);
if (handle == NULL) {
const char *e = dlerror();
Tprintf ("dlopen(%s): %s\n", filepath, e);
}
if (dir != NULL) { closedir (dir); }
- }
#else
- /* Until a Windows implementation of this code is implemented */
- err = ENOENT;
+ /* Until a Windows implementation of this code is implemented */
+ err = ENOENT;
#endif /* _WIN32 */
+ }
}
if (err == ENOENT) {
# Flag for error events to signal that the error event has been committed.\r
\r
+khui_action_trigger()\r
+# Function for triggerring an action.\r
\r
+khui_action_set_hwnd()\r
+# internal API. Should not be used by anyone. Basically sets the HWND that should receive event notifications from the UI library.\r
\r
+KEPT_PTR\r
+# error library data type for pointers\r
\r
+_cptr\r
+# type cast macro for pointer types\r
\r
!khc_open_space\r
# name parameter is now a const string\r
\r
!KCDB_ATTRNAME_ISSUE\r
-# Fixed typo
\ No newline at end of file
+# Fixed typo\r
+\r
+!kherr_val\r
+# is now an inline function instead of a macro\r
+\r
+!kherr_param\r
+# is now a structure instead of an integer type\r
+\r
++KEPT_NONE\r
+# new constant signifying a NULL parameter\r
+\r
+!_int32, _uint32, _int64, _uint64, _cstr, _tstr, _cptr\r
+# appropriate typecasts added\r
+\r
++vnull\r
+# macro to insert a NULL parameter\r
+\r
+!_report_cs0, _report_cs1, _report_cs2, _report_cs3\r
+!_report_sr0, _report_sr1, _report_sr2, _report_sr3\r
+!_report_mr0, _report_mr1, _report_mr2, _report_mr3\r
+!_report_ts0, _report_ts1, _report_ts2, _report_ts3\r
+# modified to use _vnull() instead of 0 for NULL parameters\r
+\r
ldebug=$(ldebug) /DEBUG\r
cdebug=$(cdebug) -Os -Zi\r
\r
+# Additionally, suppress conflicting default library directives that we\r
+# might pull in from external libraries.\r
+\r
+!ifndef NODEBUG\r
+lndeflibflag=/NODEFAULTLIB:MSVCRT\r
+!else\r
+lndeflibflag=/NODEFAULTLIB:MSVCRTD\r
+!endif\r
+\r
khcflags=$(cdebug) $(cflags) $(incflags) $(khdefines) $(khcwarn)\r
-khlguiflags=$(ldebug) $(guilflags)\r
-khlconflags=$(ldebug) $(conlflags)\r
-khldllguiflags=$(ldebug) $(dlllflags)\r
-khldllconflags=$(ldebug) $(dlllflags)\r
+khlguiflags=$(ldebug) $(guilflags) $(lndeflibflag)\r
+khlconflags=$(ldebug) $(conlflags) $(lndeflibflag)\r
+khldllguiflags=$(ldebug) $(dlllflags) $(lndeflibflag)\r
+khldllconflags=$(ldebug) $(dlllflags) $(lndeflibflag)\r
\r
!if "$(KH_RUNTIME)" == "STATIC"\r
khcflags=$(khcflags) $(cvarsmt)\r
ldebug=$(ldebug) /DEBUG\r
cdebug=$(cdebug) -Os -Zi\r
\r
+# Additionally, suppress conflicting default library directives that we\r
+# might pull in from external libraries.\r
+\r
+!ifndef NODEBUG\r
+lndeflibflag=/NODEFAULTLIB:MSVCRT\r
+!else\r
+lndeflibflag=/NODEFAULTLIB:MSVCRTD\r
+!endif\r
+\r
khcflags=$(cdebug) $(cflags) $(incflags) $(khdefines) $(khcwarn)\r
-khlguiflags=$(ldebug) $(guilflags)\r
-khlconflags=$(ldebug) $(conlflags)\r
-khldllguiflags=$(ldebug) $(dlllflags)\r
-khldllconflags=$(ldebug) $(dlllflags)\r
+khlguiflags=$(ldebug) $(guilflags) $(lndeflibflag)\r
+khlconflags=$(ldebug) $(conlflags) $(lndeflibflag)\r
+khldllguiflags=$(ldebug) $(dlllflags) $(lndeflibflag)\r
+khldllconflags=$(ldebug) $(dlllflags) $(lndeflibflag)\r
\r
!if "$(KH_RUNTIME)" == "STATIC"\r
khcflags=$(khcflags) $(cvarsmt)\r
\r
.SUFFIXES: .h\r
\r
+#\r
+# Manifest handling\r
+#\r
+# Starting with Visual Studio 8, the C compiler and the linker\r
+# generate manifests so that the applications will link with the\r
+# correct side-by-side DLLs at run-time. These are required for\r
+# correct operation under Windows XP. We also have custom manifests\r
+# which need to be merged with the manifests that VS creates.\r
+#\r
+# The syntax for invoking the _VC_MANIFEST_EMBED_foo macro is:\r
+# $(_VC_MANIFEST_EMBED_???) <any additional manifests that need to be merged in>\r
+#\r
+\r
+!ifndef MT\r
+MT=mt.exe -nologo\r
+!endif\r
+\r
+_VC_MANIFEST_EMBED_EXE= \\r
+if exist $@.manifest $(MT) -outputresource:$@;1 -manifest $@.manifest\r
+\r
+_VC_MANIFEST_EMBED_DLL=$(_VC_MANIFEST_EMBED_EXE)\r
+\r
+# End of manifest handling\r
+\r
!endif\r
This message notifies credentials providers that a password change\r
request has been received.\r
\r
+ A plug-in handling this message that wishes to participate in the\r
+ password change operation is expected to add a\r
+ ::khui_new_creds_by_type to the list of participants in the\r
+ ::khui_new_creds structure by calling khui_cw_add_type().\r
+\r
+ The password change operation requires user interaction. Any\r
+ plug-ins that are participating in the operation need to provide a\r
+ user-interface.\r
+\r
Message parameters:\r
- \b vparam : pointer to a ::khui_new_creds structure\r
+\r
+ \see khui_cw_add_type(), ::khui_new_creds, ::khui_new_creds_by_type\r
*/\r
#define KMSG_CRED_PASSWORD 16\r
\r
/*! \brief Initiate the process of obtaining new credentials\r
\r
The UI sends this message to start the process of obtaining new\r
- credentials. See \ref cred_acq for more information about handling this\r
- message.\r
+ credentials. See \ref cred_acq for more information about\r
+ handling this message.\r
+\r
+ A plug-in handling this message that wishes to participate in the\r
+ new credentials acquisition operation is expected to add a\r
+ ::khui_new_creds_by_type to hte list of participants in the\r
+ ::khui_new_creds structure by calling khui_cw_add_type().\r
\r
Message parameters:\r
- \b vparam : pointer to a ::khui_new_creds structure\r
\r
- \see \ref cred_acq\r
+ \see \ref cred_acq, khui_cw_add_type(), ::khui_new_creds,\r
+ ::khui_new_creds_by_type\r
*/\r
#define KMSG_CRED_NEW_CREDS 17\r
\r
This is a notification sent to individual credentials providers\r
that a specified identity's credentials should be renewed.\r
\r
+ A plug-in handling this message that wishes to participate in the\r
+ renew credentials operation is expected to add a\r
+ ::khui_new_creds_by_type to the list of participants in the\r
+ ::khui_new_creds structure by calling khui_cw_add_type().\r
+\r
Message parameters:\r
- \b vparam : Pointer to a khui_new_creds object\r
+\r
+ \see khui_cw_add_type(), ::khui_new_creds,\r
+ ::khui_new_creds_by_type\r
*/\r
#define KMSG_CRED_RENEW_CREDS 18\r
\r
dialog completion.\r
\r
Currently, the dialog messages are:\r
- - ::KMSG_CRED_INITIAL_CREDS\r
- ::KMSG_CRED_NEW_CREDS\r
- ::KMSG_CRED_RENEW_CREDS\r
- ::KMSG_CRED_DIALOG_SETUP\r
HKEY pkey = NULL;\r
HKEY ckey = NULL;\r
wchar_t buf[KCONF_MAXCCH_NAME];\r
+ size_t cb_regpath = 0;\r
\r
if(!parent)\r
p = conf_root;\r
if(n_sname >= KCONF_MAXCCH_NAME || n_sname <= 0)\r
return KHM_ERROR_INVALID_PARAM;\r
\r
- /* SAFE: buf: buffer size == KCONF_MAXCCH_NAME * wchar_t >\r
- n_sname * wchar_t */\r
- wcsncpy(buf, sname, n_sname);\r
- buf[n_sname] = L'\0';\r
+ StringCchCopyN(buf, ARRAYLENGTH(buf), sname, n_sname);\r
\r
/* see if there is already a config space by this name. if so,\r
return it. Note that if the configuration space is specified\r
/*SAFE: p->regpath: is valid since it was set using this same\r
function. */\r
/*SAFE: buf: see above */\r
- c->regpath = PMALLOC((wcslen(p->regpath) + wcslen(buf) + 2) * sizeof(wchar_t));\r
+ cb_regpath = (wcslen(p->regpath) + wcslen(buf) + 2) * sizeof(wchar_t);\r
+ c->regpath = PMALLOC(cb_regpath);\r
\r
assert(c->regpath != NULL);\r
\r
-#pragma warning( push )\r
-#pragma warning( disable: 4995 )\r
/*SAFE: c->regpath: allocated above to be big enough */\r
/*SAFE: p->regpath: see above */\r
- wcscpy(c->regpath, p->regpath);\r
- wcscat(c->regpath, L"\\");\r
+ StringCbCopy(c->regpath, cb_regpath, p->regpath);\r
+ StringCbCat(c->regpath, cb_regpath, L"\\");\r
+\r
/*SAFE: buf: see above */\r
- wcscat(c->regpath, buf);\r
-#pragma warning( pop )\r
+ StringCbCat(c->regpath, cb_regpath, buf);\r
\r
khcint_space_hold(c);\r
\r
\r
kcdb_cred_lock_read();\r
if(!kcdb_cred_is_active_cred(vcred1) ||\r
- !kcdb_cred_is_active_cred(vcred2))\r
+ !kcdb_cred_is_active_cred(vcred2)) {\r
+\r
+ code = FALSE;\r
goto _exit;\r
\r
+ }\r
+\r
if(vcred1 == vcred2) {\r
+\r
code = TRUE;\r
goto _exit;\r
+\r
}\r
\r
cred1 = vcred1;\r
*cbbuf = s;\r
rv = KHM_ERROR_TOO_LONG;\r
} else {\r
-#pragma warning(push)\r
-#pragma warning(disable:4995)\r
- wcscpy(buf, str); /* str is one of the string fields in t->ct which has \r
- been validated when the type was registered. */\r
-#pragma warning(pop)\r
+ StringCbCopy(buf, *cbbuf, str);\r
*cbbuf = s;\r
}\r
} else {\r
*cbbuf = s;\r
rv = KHM_ERROR_TOO_LONG;\r
} else {\r
-#pragma warning(push)\r
-#pragma warning(disable: 4995)\r
- wcscpy(buf, t->ct.name); /* t->ct.name was validated when the type was registered */\r
-#pragma warning(pop)\r
+ StringCbCopy(buf, *cbbuf, t->ct.name);\r
*cbbuf = s;\r
}\r
} else {\r
t = ibuf + wcslen(ibuf);\r
if(h == 1)\r
{\r
- LoadString(hinst_kcreddb, IDS_IVL_1H, t, ARRAYLENGTH(ibuf) - wcslen(ibuf));\r
+ LoadString(hinst_kcreddb, IDS_IVL_1H, t,\r
+ (int) (ARRAYLENGTH(ibuf) - wcslen(ibuf)));\r
} else {\r
- LoadString(hinst_kcreddb, IDS_IVL_H, fbuf, ARRAYLENGTH(fbuf));\r
+ LoadString(hinst_kcreddb, IDS_IVL_H, fbuf,\r
+ (int) ARRAYLENGTH(fbuf));\r
StringCbPrintf(t, sizeof(ibuf) - wcslen(ibuf)*sizeof(wchar_t), fbuf, h);\r
}\r
}\r
t = ibuf + wcslen(ibuf);\r
if(m == 1)\r
{\r
- LoadString(hinst_kcreddb, IDS_IVL_1M, t, ARRAYLENGTH(ibuf) - wcslen(ibuf));\r
+ LoadString(hinst_kcreddb, IDS_IVL_1M, t,\r
+ (int) (ARRAYLENGTH(ibuf) - wcslen(ibuf)));\r
} else {\r
- LoadString(hinst_kcreddb, IDS_IVL_M, fbuf, ARRAYLENGTH(fbuf));\r
+ LoadString(hinst_kcreddb, IDS_IVL_M, fbuf,\r
+ (int) ARRAYLENGTH(fbuf));\r
StringCbPrintf(t, sizeof(ibuf) - wcslen(ibuf)*sizeof(wchar_t), fbuf, m);\r
}\r
}\r
t = ibuf + wcslen(ibuf);\r
if(s == 1)\r
{\r
- LoadString(hinst_kcreddb, IDS_IVL_1S, t, ARRAYLENGTH(ibuf) - wcslen(ibuf));\r
+ LoadString(hinst_kcreddb, IDS_IVL_1S, t,\r
+ (int) (ARRAYLENGTH(ibuf) - wcslen(ibuf)));\r
} else {\r
- LoadString(hinst_kcreddb, IDS_IVL_S, fbuf, ARRAYLENGTH(fbuf));\r
+ LoadString(hinst_kcreddb, IDS_IVL_S, fbuf,\r
+ (int) ARRAYLENGTH(fbuf));\r
StringCbPrintf(t, sizeof(ibuf) - wcslen(ibuf)*sizeof(wchar_t), fbuf, s);\r
}\r
}\r
$(DLLFILE): $(OBJFILES) $(RESFILES)
$(DLLGUILINK) $(LIBFILES) $(SDKLIBFILES) $(SCLIB)
+ $(_VC_MANIFEST_EMBED_DLL)
all: mkdirs $(DLLFILE)
clean::
$(RM) $(DLLFILE)
+ $(RM) $(DLLFILE).manifest
#ifdef DEBUG\r
#include<assert.h>\r
#endif\r
+#include<strsafe.h>\r
\r
/**************************************/\r
/* khm_krb5_error(): */\r
\r
#ifndef NO_KRB5\r
int khm_krb5_error(krb5_error_code rc, LPCSTR FailedFunctionName, \r
- int FreeContextFlag, krb5_context *ctx,\r
- krb5_ccache *cache);\r
+ int FreeContextFlag, krb5_context *ctx,\r
+ krb5_ccache *cache);\r
\r
+int\r
+khm_krb5_get_error_string(krb5_error_code rc,\r
+ wchar_t * buffer,\r
+ khm_size cb_buffer);\r
\r
int khm_krb5_initialize(khm_handle ident, krb5_context *, krb5_ccache *);\r
\r
$(DLLFILE): $(OBJFILES) $(VERRESFILE) $(MSGRESFILE)
$(DLLGUILINK) $(LIBFILES) $(SDKLIBFILES) $(SCLIB)
+ $(_VC_MANIFEST_EMBED_DLL)
all: mkdirs $(MSGRESFILE) $(DLLFILE) lang
#include<krbcred.h>\r
#include<kherror.h>\r
\r
+#include<strsafe.h>\r
+\r
extern void (__cdecl *pinitialize_krb_error_func)();\r
extern void (__cdecl *pinitialize_kadm_error_table)();\r
\r
case kadm_err_base:\r
break;\r
default:\r
- strncpy(buf, com_err_msg, len);\r
- buf[len-1] = '\0';\r
+ StringCbCopyA(buf, len, com_err_msg);\r
return buf;\r
}\r
\r
break;\r
}\r
if(com_err_msg != buf) {\r
- strncpy(buf, com_err_msg, len);\r
- buf[len-1] = '\0';\r
+ StringCbCopyA(buf, len, com_err_msg);\r
}\r
cp = buf + strlen(buf);\r
*cp++ = '\n';\r
{\r
GetWindowsDirectoryA(confname,szConfname);\r
confname[szConfname-1] = '\0';\r
- strncat(confname, "\\",sizeof(confname)-strlen(confname));\r
- confname[szConfname-1] = '\0';\r
- strncat(confname, KRB5_FILE,sizeof(confname)-strlen(confname));\r
- confname[szConfname-1] = '\0';\r
+\r
+ StringCchCatA(confname, szConfname, "\\");\r
+ StringCchCatA(confname, szConfname, KRB5_FILE);\r
+\r
return FALSE;\r
}\r
\r
\r
if (configFile)\r
{\r
- strncpy(confname, *configFile, szConfname);\r
+ StringCchCopyA(confname, szConfname, *configFile);\r
pkrb5_free_config_files(configFile); \r
}\r
\r
{\r
GetWindowsDirectoryA(confname,szConfname);\r
confname[szConfname-1] = '\0';\r
- strncat(confname, "\\",sizeof(confname)-strlen(confname));\r
- confname[szConfname-1] = '\0';\r
- strncat(confname, KRB5_FILE,sizeof(confname)-strlen(confname));\r
- confname[szConfname-1] = '\0';\r
+\r
+ StringCchCatA(confname, szConfname, "\\");\r
+ StringCchCatA(confname, szConfname, KRB5_FILE);\r
}\r
\r
return FALSE;\r
BOOL\r
khm_get_krb4_con_file(LPSTR confname, UINT szConfname)\r
{\r
- if (hKrb5 && !hKrb4)\r
- { // hold krb.con where krb5.ini is located\r
- CHAR krbConFile[MAX_PATH]="";\r
- LPSTR pFind;\r
+ if (hKrb5 && !hKrb4) {\r
+ // hold krb.con where krb5.ini is located\r
+ CHAR krbConFile[MAX_PATH]="";\r
+ LPSTR pFind;\r
\r
- //strcpy(krbConFile, CLeashApp::m_krbv5_profile->first_file->filename);\r
- if (khm_krb5_get_profile_file(krbConFile, sizeof(krbConFile))) \r
- {\r
- GetWindowsDirectoryA(krbConFile,sizeof(krbConFile));\r
- krbConFile[MAX_PATH-1] = '\0';\r
- strncat(krbConFile, "\\",sizeof(krbConFile)-strlen(krbConFile));\r
- krbConFile[MAX_PATH-1] = '\0';\r
- strncat(krbConFile, KRB5_FILE,sizeof(krbConFile)-strlen(krbConFile));\r
- krbConFile[MAX_PATH-1] = '\0';\r
- }\r
+ if (khm_krb5_get_profile_file(krbConFile, sizeof(krbConFile))) {\r
+ GetWindowsDirectoryA(krbConFile,sizeof(krbConFile));\r
+ krbConFile[MAX_PATH-1] = '\0';\r
\r
- pFind = strrchr(krbConFile, '\\');\r
- if (pFind)\r
- {\r
- *pFind = 0;\r
- strncat(krbConFile, "\\",sizeof(krbConFile)-strlen(krbConFile));\r
- krbConFile[MAX_PATH-1] = '\0';\r
- strncat(krbConFile, KRB_FILE,sizeof(krbConFile)-strlen(krbConFile));\r
- krbConFile[MAX_PATH-1] = '\0';\r
- }\r
- else\r
- krbConFile[0] = 0;\r
- \r
- strncpy(confname, krbConFile, szConfname);\r
+ StringCbCatA(krbConFile, sizeof(krbConFile), "\\");\r
+ }\r
+\r
+ pFind = strrchr(krbConFile, '\\');\r
+\r
+ if (pFind) {\r
+ *pFind = '\0';\r
+\r
+ StringCbCatA(krbConFile, sizeof(krbConFile), "\\");\r
+ StringCbCatA(krbConFile, sizeof(krbConFile), KRB_FILE);\r
+ } else {\r
+ krbConFile[0] = '\0';\r
+ }\r
+\r
+ StringCchCopyA(confname, szConfname, krbConFile);\r
+ } else if (hKrb4) { \r
+ unsigned int size = szConfname;\r
+ memset(confname, '\0', szConfname);\r
+ if (!pkrb_get_krbconf2(confname, &size)) {\r
+ GetWindowsDirectoryA(confname,szConfname);\r
confname[szConfname-1] = '\0';\r
- }\r
- else if (hKrb4)\r
- { \r
- unsigned int size = szConfname;\r
- memset(confname, '\0', szConfname);\r
- if (!pkrb_get_krbconf2(confname, &size))\r
- { // Error has happened\r
- GetWindowsDirectoryA(confname,szConfname);\r
- confname[szConfname-1] = '\0';\r
- strncat(confname, "\\",szConfname-strlen(confname));\r
- confname[szConfname-1] = '\0';\r
- strncat(confname,KRB_FILE,szConfname-strlen(confname));\r
- confname[szConfname-1] = '\0';\r
- }\r
- }\r
+ StringCchCatA(confname, szConfname, "\\");\r
+ StringCchCatA(confname, szConfname, KRB_FILE);\r
+ }\r
+ }\r
+\r
return FALSE;\r
}\r
\r
wchar_t * d;\r
\r
if (!khm_get_krb4_con_file(krb_conf,sizeof(krb_conf)) && \r
- (file = fopen(krb_conf, "rt")))\r
+#if _MSC_VER >= 1400\r
+ !fopen_s(&file, krb_conf, "rt")\r
+#else\r
+ (file = fopen(krb_conf, "rt"))\r
+#endif\r
+ )\r
{\r
char lineBuf[256];\r
\r
const char * postfix,\r
char ** rcopy)\r
{\r
- int base_size;\r
- int ret_size;\r
+ size_t base_size;\r
+ size_t ret_size;\r
char * copy = 0;\r
char * ret = 0;\r
+ size_t t;\r
+\r
+ if (FAILED(StringCbLengthA(base, STRSAFE_MAX_CCH * sizeof(char), &t)))\r
+ goto cleanup;\r
+\r
+ base_size = t + 1;\r
+\r
+ if (FAILED(StringCbLengthA(postfix, STRSAFE_MAX_CCH * sizeof(char), &t)))\r
+ goto cleanup;\r
+\r
+ ret_size = base_size + t + 1;\r
\r
- base_size = (int) strlen(base) + 1;\r
- ret_size = base_size + (int) strlen(postfix) + 1;\r
copy = malloc(base_size);\r
ret = malloc(ret_size);\r
\r
if (!copy || !ret)\r
goto cleanup;\r
\r
- strncpy(copy, base, base_size);\r
- copy[base_size - 1] = 0;\r
-\r
- strncpy(ret, base, base_size);\r
- strncpy(ret + (base_size - 1), postfix, ret_size - (base_size - 1));\r
- ret[ret_size - 1] = 0;\r
+ StringCbCopyNA(copy, base_size, base, base_size);\r
+ StringCbCopyNA(ret, ret_size, base, base_size);\r
+ StringCbCopyNA(ret + (base_size - 1), ret_size - (base_size - 1),\r
+ postfix, ret_size - (base_size - 1));\r
\r
cleanup:\r
if (!copy || !ret) {\r
\r
khm_boolean k4_should_identity_get_k4(khm_handle ident) {\r
khm_int32 idflags = 0;\r
+ khm_int32 t = TRUE;\r
khm_handle csp_ident = NULL;\r
khm_handle csp_k4 = NULL;\r
khm_boolean get_k4 = TRUE;\r
\r
+ if (KHM_SUCCEEDED(khc_read_int32(csp_params, L"Krb4NewCreds", &t)) &&\r
+ !t)\r
+ return FALSE;\r
+\r
if (KHM_FAILED(kcdb_identity_get_flags(ident, &idflags)))\r
return FALSE;\r
\r
\r
l = (khui_htwnd_link *) lParam;\r
\r
- wcsncpy(wid, l->id, l->id_len);\r
- wid[l->id_len] = 0;\r
+ StringCchCopyN(wid, ARRAYLENGTH(wid), l->id, l->id_len);\r
wids = wcschr(wid, L':');\r
\r
if (!wids)\r
$(DLLFILE): $(OBJFILES) $(VERRESFILE)
$(DLLGUILINK) $(MSGRESFILE) $(LIBFILES) $(SDKLIBFILES) $(SCLIB)
+ $(_VC_MANIFEST_EMBED_DLL)
$(MSGRESFILE): $(OBJ)\krb5_msgs.rc
}\r
}\r
\r
+khm_int32 KHMAPI\r
+kvno_toString(const void * data, khm_size cbdata,\r
+ wchar_t *destbuf, khm_size *pcbdestbuf,\r
+ khm_int32 flags)\r
+{\r
+ int resid = 0;\r
+ int kvno;\r
+ wchar_t buf[256];\r
+ size_t cblength;\r
+\r
+ if (cbdata != sizeof(khm_int32))\r
+ return KHM_ERROR_INVALID_PARAM;\r
+\r
+ kvno = *((khm_int32 *) data);\r
+\r
+ StringCbPrintf(buf, sizeof(buf), L"#%d", kvno);\r
+\r
+ StringCbLength(buf, ARRAYLENGTH(buf), &cblength);\r
+ cblength += sizeof(wchar_t);\r
+\r
+ if (!destbuf || *pcbdestbuf < cblength) {\r
+ *pcbdestbuf = cblength;\r
+ return KHM_ERROR_TOO_LONG;\r
+ } else {\r
+ StringCbCopy(destbuf, *pcbdestbuf, buf);\r
+ *pcbdestbuf = cblength;\r
+ return KHM_ERROR_SUCCESS;\r
+ }\r
+}\r
+\r
khm_int32\r
serialize_krb5_addresses(krb5_address ** a, void * buf, size_t * pcbbuf)\r
{\r
krb5flags_toString(const void *, khm_size, wchar_t *,\r
khm_size *, khm_int32);\r
\r
+khm_int32 KHMAPI\r
+kvno_toString(const void * data, khm_size cbdata,\r
+ wchar_t *destbuf, khm_size *pcbdestbuf,\r
+ khm_int32 flags);\r
+\r
khm_int32 KHMAPI\r
renew_for_cb(khm_handle cred, khm_int32 id, void * buffer,\r
khm_size * pcbsize);\r
#define _WIN32_WINNT 0x501\r
#endif\r
\r
+#define STRSAFE_NO_DEPRECATE\r
+\r
#include<krbcred.h>\r
#include<krb5.h>\r
#include<assert.h>\r
#include<lm.h>\r
#include<commctrl.h>\r
-\r
-#pragma warning(push)\r
-#pragma warning(disable: 4995)\r
#include<shlwapi.h>\r
-#pragma warning(pop)\r
+\r
+#include<strsafe.h>\r
\r
typedef struct tag_k5_file_cc {\r
wchar_t path[MAX_PATH];\r
\r
/* see if it's there first */\r
for (i=0; i < d->n_file_ccs; i++) {\r
- if(!wcsicmp(d->file_ccs[i].path, path))\r
+ if(!_wcsicmp(d->file_ccs[i].path, path))\r
return;\r
}\r
\r
\r
for (i=0; i < d->work.n_file_ccs; i++) {\r
for (j=0; j < d->save.n_file_ccs; j++) {\r
- if (!wcsicmp(d->work.file_ccs[i].path,\r
+ if (!_wcsicmp(d->work.file_ccs[i].path,\r
d->save.file_ccs[j].path))\r
break;\r
}\r
return TRUE; /* nothing to add */\r
\r
for (i=0; i < d->work.n_file_ccs; i++) {\r
- if (!wcsicmp(path, d->work.file_ccs[i].path)) {\r
+ if (!_wcsicmp(path, d->work.file_ccs[i].path)) {\r
\r
/* allow the user to correct case, as appropriate */\r
StringCbCopy(d->work.file_ccs[i].path,\r
LVNI_SELECTED)) != -1) {\r
ListView_GetItemText(lv, lv_idx, 0, buf, ARRAYLENGTH(buf));\r
for (i=0; i < d->work.n_file_ccs; i++) {\r
- if (!wcsicmp(buf, d->work.file_ccs[i].path)) {\r
+ if (!_wcsicmp(buf, d->work.file_ccs[i].path)) {\r
k5_del_file_cc(&d->work, i);\r
break;\r
}\r
/* $Id$ */
+#define STRSAFE_NO_DEPRECATE
+
#include<krbcred.h>
#include<krb5.h>
#include<assert.h>
#include<lm.h>
#include<commctrl.h>
-
-#pragma warning(push)
-#pragma warning(disable: 4995)
#include<shlwapi.h>
-#pragma warning(pop)
+#include<strsafe.h>
typedef struct tag_k5_realm_kdc {
wchar_t name[K5_MAXCCH_HOST];
const char *const *p;
for(p=conf_yes; *p; p++) {
- if (!stricmp(*p,s))
+ if (!_stricmp(*p,s))
return 1;
}
for(p=conf_no; *p; p++) {
- if (!stricmp(*p,s))
+ if (!_stricmp(*p,s))
return 0;
}
sizeof(kdc_name), values[i]);
for (j=0; j < d->realms[s].n_kdcs; j++)
- if (!wcsicmp(kdc_name, d->realms[s].kdcs[j].name))
+ if (!_wcsicmp(kdc_name, d->realms[s].kdcs[j].name))
break;
if (j < d->realms[s].n_kdcs) {
AnsiStrToUnicode(kdc_name, sizeof(kdc_name), values[i]);
for (j=0; j < d->realms[s].n_kdcs; j++)
- if (!wcsicmp(kdc_name, d->realms[s].kdcs[j].name))
+ if (!_wcsicmp(kdc_name, d->realms[s].kdcs[j].name))
break;
if (j < d->realms[s].n_kdcs) {
AnsiStrToUnicode(wdr_to, sizeof(wdr_to), dr_to);
for (j=0; j < d->n_realms; j++) {
- if (!wcsicmp(wdr_to, d->realms[j].realm))
+ if (!_wcsicmp(wdr_to, d->realms[j].realm))
break;
}
UnicodeStrToAnsi(astr, sizeof(astr), d->config_file);
- if (stricmp(config_file, astr)) {
+ if (_stricmp(config_file, astr)) {
assert(FALSE);
}
(d->realms[i].flags & K5_RDFLAG_DELETED))
continue;
- if (!wcsicmp(d->realms[i].realm, pdisp->item.pszText))
+ if (!_wcsicmp(d->realms[i].realm, pdisp->item.pszText))
break;
}
(d->realms[r].kdcs[k].flags & K5_RKFLAG_DELETED))
continue;
- if (!wcsicmp(d->realms[r].kdcs[k].name,
+ if (!_wcsicmp(d->realms[r].kdcs[k].name,
pdisp->item.pszText))
break;
}
(d->realms[r].domain_maps[m].flags & K5_DMFLAG_DELETED))
continue;
- if (!wcsicmp(d->realms[r].domain_maps[m].name,
- pdisp->item.pszText))
+ if (!_wcsicmp(d->realms[r].domain_maps[m].name,
+ pdisp->item.pszText))
break;
}
\r
/* $Id$ */\r
\r
+#define STRSAFE_NO_DEPRECATE\r
+\r
#include<krbcred.h>\r
#include<krb5.h>\r
#include<assert.h>\r
#include<lm.h>\r
#include<commctrl.h>\r
-\r
-#pragma warning(push)\r
-#pragma warning(disable: 4995)\r
#include<shlwapi.h>\r
-#pragma warning(pop)\r
+\r
+#include<strsafe.h>\r
\r
typedef struct tag_k5_id_dlg_data {\r
khui_config_init_data cfg;\r
SendDlgItemMessage(hw, IDC_CFG_PUBLICIP, IPM_GETADDRESS,\r
0, (LPARAM) &dwaddress);\r
\r
- if (wcsicmp(ccache, d->ccache) ||\r
+ if (_wcsicmp(ccache, d->ccache) ||\r
\r
d->tc_renew.current != d->renew_life ||\r
\r
GetDlgItemText(hw, IDC_CFG_CCACHE, ccache, ARRAYLENGTH(ccache));\r
\r
if (SUCCEEDED(StringCbLength(ccache, sizeof(ccache), &cb)) &&\r
- wcsicmp(ccache, d->ccache)) {\r
+ _wcsicmp(ccache, d->ccache)) {\r
khc_write_string(csp_ident, L"DefaultCCName", ccache);\r
StringCbCopy(d->ccache, sizeof(d->ccache), ccache);\r
} else {\r
\r
/* $Id$ */\r
\r
+#define STRSAFE_NO_DEPRECATE\r
+\r
#include<krbcred.h>\r
#include<krb5.h>\r
#include<assert.h>\r
if ( !pkrb5_decode_ticket(&KRBv5Credentials.ticket, &tkt)) {\r
ti = tkt->enc_part.enctype;\r
kcdb_cred_set_attr(cred, attr_id_tkt_enctype, &ti, sizeof(ti));\r
+ ti = tkt->enc_part.kvno;\r
+ kcdb_cred_set_attr(cred, attr_id_kvno, &ti, sizeof(ti));\r
pkrb5_free_ticket(ctx, tkt);\r
tkt = NULL;\r
}\r
\r
ti = KRBv5Credentials.keyblock.enctype;\r
kcdb_cred_set_attr(cred, attr_id_key_enctype, &ti, sizeof(ti));\r
+\r
kcdb_cred_set_attr(cred, KCDB_ATTR_LOCATION, wcc_name, \r
KCDB_CBSIZE_AUTO);\r
\r
{\r
GetWindowsDirectoryA(confname,szConfname);\r
confname[szConfname-1] = '\0';\r
- strncat(confname, "\\",sizeof(confname)-strlen(confname));\r
- confname[szConfname-1] = '\0';\r
- strncat(confname, KRB5_FILE,sizeof(confname)-strlen(confname));\r
- confname[szConfname-1] = '\0';\r
+\r
+ StringCchCatA(confname, szConfname, "\\");\r
+ StringCchCatA(confname, szConfname, KRB5_FILE);\r
+\r
return FALSE;\r
}\r
\r
\r
if (configFile)\r
{\r
- strncpy(confname, *configFile, szConfname);\r
+ StringCchCopyA(confname, szConfname, *configFile);\r
pkrb5_free_config_files(configFile); \r
}\r
\r
{\r
GetWindowsDirectoryA(confname,szConfname);\r
confname[szConfname-1] = '\0';\r
- strncat(confname, "\\",sizeof(confname)-strlen(confname));\r
- confname[szConfname-1] = '\0';\r
- strncat(confname, KRB5_FILE,sizeof(confname)-strlen(confname));\r
- confname[szConfname-1] = '\0';\r
+ StringCchCatA(confname, szConfname, "\\");\r
+ StringCchCatA(confname, szConfname, KRB5_FILE);\r
}\r
\r
return FALSE;\r
if (khm_krb5_get_profile_file(krbConFile, sizeof(krbConFile))) {\r
GetWindowsDirectoryA(krbConFile,sizeof(krbConFile));\r
krbConFile[MAX_PATH-1] = '\0';\r
- strncat(krbConFile, "\\",sizeof(krbConFile)-strlen(krbConFile));\r
- krbConFile[MAX_PATH-1] = '\0';\r
- strncat(krbConFile, KRB5_FILE,sizeof(krbConFile)-strlen(krbConFile));\r
- krbConFile[MAX_PATH-1] = '\0';\r
+ StringCchCatA(confname, szConfname, "\\");\r
}\r
\r
pFind = strrchr(krbConFile, '\\');\r
if (pFind) {\r
- *pFind = 0;\r
- strncat(krbConFile, "\\",sizeof(krbConFile)-strlen(krbConFile));\r
- krbConFile[MAX_PATH-1] = '\0';\r
- strncat(krbConFile, KRB_FILE,sizeof(krbConFile)-strlen(krbConFile));\r
- krbConFile[MAX_PATH-1] = '\0';\r
+ *pFind = '\0';\r
+ StringCchCatA(krbConFile, ARRAYLENGTH(krbConFile), "\\");\r
+ StringCchCatA(krbConFile, ARRAYLENGTH(krbConFile), KRB_FILE);\r
}\r
else\r
- krbConFile[0] = 0;\r
- \r
- strncpy(confname, krbConFile, szConfname);\r
- confname[szConfname-1] = '\0';\r
+ krbConFile[0] = '\0';\r
+\r
+ StringCchCopyA(confname, szConfname, krbConFile);\r
}\r
else if (hKrb4) { \r
unsigned int size = szConfname;\r
{ // Error has happened\r
GetWindowsDirectoryA(confname,szConfname);\r
confname[szConfname-1] = '\0';\r
- strncat(confname, "\\",szConfname-strlen(confname));\r
- confname[szConfname-1] = '\0';\r
- strncat(confname,KRB_FILE,szConfname-strlen(confname));\r
- confname[szConfname-1] = '\0';\r
+ StringCchCatA(confname, szConfname, "\\");\r
+ StringCchCatA(confname, szConfname, KRB_FILE);\r
}\r
}\r
return FALSE;\r
wchar_t * d;\r
\r
if (!khm_get_krb4_con_file(krb_conf,sizeof(krb_conf)) && \r
- (file = fopen(krb_conf, "rt")))\r
+#if _MSC_VER >= 1400\r
+ !fopen_s(&file, krb_conf, "rt")\r
+#else\r
+ (file = fopen(krb_conf, "rt"))\r
+#endif\r
+ )\r
{\r
char lineBuf[256];\r
\r
khm_krb5_creds_is_equal(khm_handle vcred1, khm_handle vcred2, void * dummy) {\r
if (kcdb_creds_comp_attr(vcred1, vcred2, KCDB_ATTR_LOCATION) ||\r
kcdb_creds_comp_attr(vcred1, vcred2, attr_id_key_enctype) ||\r
- kcdb_creds_comp_attr(vcred1, vcred2, attr_id_tkt_enctype))\r
+ kcdb_creds_comp_attr(vcred1, vcred2, attr_id_tkt_enctype) ||\r
+ kcdb_creds_comp_attr(vcred1, vcred2, attr_id_kvno))\r
return 1;\r
else\r
return 0;\r
(WPARAM) idx,\r
(LPARAM) srealm);\r
\r
- if (!wcsicmp(srealm, un_realm) && wcscmp(srealm, un_realm)) {\r
+ if (!_wcsicmp(srealm, un_realm) && wcscmp(srealm, un_realm)) {\r
/* differ only by case */\r
\r
StringCchCopy(un_realm, ARRAYLENGTH(un) - (un_realm - un),\r
(WPARAM) idx,\r
(LPARAM) srealm);\r
\r
- if (!wcsicmp(srealm, realm) && wcscmp(srealm, realm)) {\r
+ if (!_wcsicmp(srealm, realm) && wcscmp(srealm, realm)) {\r
StringCbCopy(realm, sizeof(realm), srealm);\r
\r
SetWindowText(d->hw_realm, srealm);\r
khm_krb5_canon_cc_name(w_ccname, sizeof(w_ccname));\r
khm_krb5_canon_cc_name(wid_ccname, sizeof(wid_ccname));\r
\r
- if (!wcsicmp(w_ccname, wid_ccname))\r
+ if (!_wcsicmp(w_ccname, wid_ccname))\r
kcdb_identity_set_default_int(ident);\r
\r
_iu_cleanup:\r
new_ccname[0] = L'\0';\r
}\r
\r
- if (wcsicmp(new_ccname, reg_ccname)) {\r
+ if (_wcsicmp(new_ccname, reg_ccname)) {\r
k5_refresh_default_identity(ctx);\r
StringCbCopy(reg_ccname, sizeof(reg_ccname), new_ccname);\r
}\r
khm_int32 type_id_addr_list = -1;\r
khm_int32 type_id_krb5_flags = -1;\r
khm_int32 type_id_krb5_princ = -1;\r
+khm_int32 type_id_kvno = -1;\r
\r
BOOL type_regd_enctype = FALSE;\r
BOOL type_regd_addr_list = FALSE;\r
BOOL type_regd_krb5_flags = FALSE;\r
BOOL type_regd_krb5_princ = FALSE;\r
+BOOL type_regd_kvno = FALSE;\r
\r
khm_int32 attr_id_key_enctype = -1;\r
khm_int32 attr_id_tkt_enctype = -1;\r
khm_int32 attr_id_addr_list = -1;\r
khm_int32 attr_id_krb5_flags = -1;\r
khm_int32 attr_id_krb5_ccname = -1;\r
+khm_int32 attr_id_kvno = -1;\r
\r
BOOL attr_regd_key_enctype = FALSE;\r
BOOL attr_regd_tkt_enctype = FALSE;\r
BOOL attr_regd_addr_list = FALSE;\r
BOOL attr_regd_krb5_flags = FALSE;\r
BOOL attr_regd_krb5_ccname = FALSE;\r
+BOOL attr_regd_kvno = FALSE;\r
\r
khm_handle csp_plugins = NULL;\r
khm_handle csp_krbcred = NULL;\r
type_regd_krb5_flags = TRUE;\r
}\r
\r
+ if (KHM_FAILED(kcdb_type_get_id(TYPENAME_KVNO, &type_id_kvno))) {\r
+ kcdb_type type;\r
+ kcdb_type *t32;\r
+\r
+ kcdb_type_get_info(KCDB_TYPE_INT32, &t32);\r
+\r
+ type.id = KCDB_TYPE_INVALID;\r
+ type.name = TYPENAME_KVNO;\r
+ type.flags = KCDB_TYPE_FLAG_CB_FIXED;\r
+ type.cb_max = t32->cb_max;\r
+ type.cb_min = t32->cb_min;\r
+ type.isValid = t32->isValid;\r
+ type.comp = t32->comp;\r
+ type.dup = t32->dup;\r
+ type.toString = kvno_toString;\r
+\r
+ rv = kcdb_type_register(&type, &type_id_kvno);\r
+ kcdb_type_release_info(t32);\r
+\r
+ if (KHM_FAILED(rv))\r
+ goto _exit;\r
+\r
+ type_regd_kvno = TRUE;\r
+ }\r
+\r
/* Register common attributes */\r
if(KHM_FAILED(kcdb_attrib_get_id(ATTRNAME_KEY_ENCTYPE, &attr_id_key_enctype))) {\r
kcdb_attrib attrib;\r
attr_regd_krb5_ccname = TRUE;\r
}\r
\r
+ if (KHM_FAILED(kcdb_attrib_get_id(ATTRNAME_KVNO, &attr_id_kvno))) {\r
+ kcdb_attrib attrib;\r
+ wchar_t sbuf[KCDB_MAXCCH_SHORT_DESC];\r
+ wchar_t lbuf[KCDB_MAXCCH_LONG_DESC];\r
+ /* although we are loading a long description, it still fits\r
+ in the short description buffer */\r
+\r
+ ZeroMemory(&attrib, sizeof(attrib));\r
+\r
+ attrib.name = ATTRNAME_KVNO;\r
+ attrib.id = KCDB_ATTR_INVALID;\r
+ attrib.type = type_id_kvno;\r
+ attrib.flags = KCDB_ATTR_FLAG_TRANSIENT;\r
+ LoadString(hResModule, IDS_KVNO_SHORT_DESC, sbuf, ARRAYLENGTH(sbuf));\r
+ LoadString(hResModule, IDS_KVNO_LONG_DESC, lbuf, ARRAYLENGTH(lbuf));\r
+ attrib.short_desc = sbuf;\r
+ attrib.long_desc = lbuf;\r
+\r
+ rv = kcdb_attrib_register(&attrib, &attr_id_kvno);\r
+\r
+ if (KHM_FAILED(rv))\r
+ goto _exit;\r
+\r
+ attr_regd_kvno = TRUE;\r
+ }\r
+\r
rv = kmm_get_plugins_config(0, &csp_plugins);\r
if(KHM_FAILED(rv)) goto _exit;\r
\r
kcdb_attrib_unregister(attr_id_krb5_flags);\r
if(attr_regd_krb5_ccname)\r
kcdb_attrib_unregister(attr_id_krb5_ccname);\r
+ if(attr_regd_kvno)\r
+ kcdb_attrib_unregister(attr_id_kvno);\r
\r
if(type_regd_enctype)\r
kcdb_type_unregister(type_id_enctype);\r
kcdb_type_unregister(type_id_addr_list);\r
if(type_regd_krb5_flags)\r
kcdb_type_unregister(type_id_krb5_flags);\r
+ if(type_regd_kvno)\r
+ kcdb_type_unregister(type_id_kvno);\r
\r
if(csp_params) {\r
khc_close_space(csp_params);\r
#define TYPENAME_ADDR_LIST L"AddrList"\r
#define TYPENAME_KRB5_FLAGS L"Krb5Flags"\r
#define TYPENAME_KRB5_PRINC L"Krb5Principal"\r
+#define TYPENAME_KVNO L"Kvno"\r
\r
#define ATTRNAME_KEY_ENCTYPE L"KeyEncType"\r
#define ATTRNAME_TKT_ENCTYPE L"TktEncType"\r
#define ATTRNAME_ADDR_LIST L"AddrList"\r
#define ATTRNAME_KRB5_FLAGS L"Krb5Flags"\r
#define ATTRNAME_KRB5_CCNAME L"Krb5CCName"\r
+#define ATTRNAME_KVNO L"Kvno"\r
\r
void init_krb();\r
void exit_krb();\r
extern khm_int32 type_id_addr_list;\r
extern khm_int32 type_id_krb5_flags;\r
extern khm_int32 type_id_krb5_princ;\r
+extern khm_int32 type_id_kvno;\r
\r
extern BOOL type_regd_krb5_princ;\r
\r
extern khm_int32 attr_id_addr_list;\r
extern khm_int32 attr_id_krb5_flags;\r
extern khm_int32 attr_id_krb5_ccname;\r
+extern khm_int32 attr_id_kvno;\r
\r
extern khm_ui_4 k5_commctl_version;\r
\r
IDS_CFG_RE_MMK "Toggle &master KDC"\r
IDS_CFG_RE_MND "&Add new domain mapping"\r
IDS_CFG_RE_MDD "&Remove domain mapping"\r
+ IDS_KVNO_LONG_DESC "Key version number"\r
+ IDS_KVNO_SHORT_DESC "Kvno"\r
END\r
\r
#endif // English (U.S.) resources\r
#define IDS_CFG_RE_MMK 214\r
#define IDS_CFG_RE_MND 215\r
#define IDS_CFG_RE_MDD 216\r
+#define IDS_KVNO_SHORT_DESC 217\r
+#define IDS_KVNO_LONG_DESC 218\r
#define IDC_NCK5_RENEWABLE 1002\r
#define IDC_NCK5_FORWARDABLE 1004\r
#define IDC_NCK5_REALM 1005\r
// \r
#ifdef APSTUDIO_INVOKED\r
#ifndef APSTUDIO_READONLY_SYMBOLS\r
-#define _APS_NEXT_RESOURCE_VALUE 118\r
+#define _APS_NEXT_RESOURCE_VALUE 219\r
#define _APS_NEXT_COMMAND_VALUE 40002\r
#define _APS_NEXT_CONTROL_VALUE 1079\r
#define _APS_NEXT_SYMED_VALUE 101\r
EXEFILE=$(BINDIR)\netidmgr.exe
-MANIFESTFILE=$(BINDIR)\netidmgr.exe.manifest
+MANIFESTFILE=$(BINDIR)\netidmgr.exe.static.manifest
OBJFILES= \
$(OBJ)\main.obj \
!endif
$(CP) $** $@
-
!if ("$(CPU)" == "IA64" ) || ("$(CPU)" == "AMD64" ) || ("$(CPU)" == "ALPHA64" )
SCLIB=bufferoverflowu.lib
!else
$(EXEFILE): $(OBJFILES) $(RESFILES) $(LIBFILES)
$(EXEGUILINK) $(SDKLIBFILES) $(SCLIB)
+ $(_VC_MANIFEST_EMBED_EXE) $(MANIFESTFILE)
-all: mkdirs $(EXEFILE) $(MANIFESTFILE)
-
+all: mkdirs $(MANIFESTFILE) $(EXEFILE)
/* a hyperlink was activated */\r
khui_htwnd_link * l;\r
l = (khui_htwnd_link *) lParam;\r
- wcsncpy(wid, l->id, l->id_len);\r
+ StringCchCopyN(wid, ARRAYLENGTH(wid), l->id, l->id_len);\r
wid[l->id_len] = 0;\r
\r
if(!wcscmp(wid, L"NewCreds")) {\r
\r
khm_get_file_log_path(sizeof(temppath), temppath);\r
\r
+ logfile = NULL;\r
+#if _MSC_VER >= 1400\r
+ _wfopen_s(&logfile, temppath, L"w");\r
+#else\r
logfile = _wfopen(temppath, L"w");\r
-\r
+#endif\r
kherr_add_ctx_handler(debug_event_handler,\r
KHERR_CTX_BEGIN |\r
KHERR_CTX_END |\r
wchar_t * text;\r
int scroll_left;\r
int scroll_top;\r
+ int ext_width;\r
+ int ext_height;\r
COLORREF bk_color;\r
HCURSOR hc_hand;\r
int l_pixel_y;\r
int align;\r
int y;\r
wchar_t * par_start;\r
+ int ext_width = 0;\r
+ int ext_height = 0;\r
\r
d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
\r
\r
GetClientRect(hwnd, &r);\r
\r
+#ifdef DRAW_HTWND_CLIENT_EDGE\r
+ /* for the moment, we are skipping on the client edge. */\r
if(d->flags & KHUI_HTWND_CLIENTEDGE)\r
DrawEdge(hdc, &r, EDGE_SUNKEN, BF_ADJUST | BF_RECT | BF_FLAT);\r
+#endif\r
\r
hbk = CreateSolidBrush(RGB(255,255,255));\r
FillRect(hdc, &r, hbk);\r
p = par_start;\r
format_unwind(&s_stack, s_start); /* unwind format stack */\r
\r
- //MoveToEx(hdc, x, y + l_height, NULL);\r
-\r
p_width = 0;\r
\r
while(*p) {\r
SetTextColor(hdc, format_color(&s_stack));\r
\r
GetTextExtentPoint32(hdc, p, (int)(c - p), &s);\r
- rd.left = x + p_width;\r
- rd.top = y;\r
- rd.right = x + p_width + s.cx;\r
- rd.bottom = y + l_height;\r
+ rd.left = x + p_width - d->scroll_left;\r
+ rd.top = y - d->scroll_top;\r
+ rd.right = x + p_width + s.cx - d->scroll_left;\r
+ rd.bottom = y + l_height - d->scroll_top;\r
\r
if(IntersectRect(&rt, &rd, &r)) {\r
- DrawText(hdc, p, (int)(c - p), &rt, DT_BOTTOM | DT_LEFT | DT_SINGLELINE | DT_NOPREFIX);\r
+ DrawText(hdc, p, (int)(c - p), &rd,\r
+ DT_BOTTOM | DT_LEFT | DT_SINGLELINE | DT_NOPREFIX);\r
}\r
\r
p_width += s.cx;\r
}\r
}\r
\r
+ if (p_width > ext_width)\r
+ ext_width = p_width;\r
+\r
y += l_height;\r
par_start = p;\r
}\r
\r
+ if (y > ext_height)\r
+ ext_height = y;\r
+\r
EndPaint(hwnd, &ps);\r
\r
+ if (d->ext_width < ext_width) {\r
+ SCROLLINFO si;\r
+ LONG l;\r
+\r
+ /* the extents need to be adjusted. But first check if we\r
+ have exactly the right scroll bars we need. */\r
+ if ((ext_width > (r.right - r.left) &&\r
+ !(d->flags & KHUI_HTWND_HSCROLL)) ||\r
+ (ext_height > (r.bottom - r.top) &&\r
+ !(d->flags & KHUI_HTWND_VSCROLL)) ||\r
+\r
+ (ext_width <= (r.right - r.left) &&\r
+ (d->flags & KHUI_HTWND_HSCROLL)) ||\r
+ (ext_height <= (r.bottom - r.top) &&\r
+ (d->flags & KHUI_HTWND_VSCROLL))) {\r
+\r
+ /* need to add scroll bars */\r
+ if (ext_width > (r.right - r.left))\r
+ d->flags |= KHUI_HTWND_HSCROLL;\r
+ else\r
+ d->flags &= ~KHUI_HTWND_HSCROLL;\r
+\r
+ if (ext_height > (r.bottom - r.top))\r
+ d->flags |= KHUI_HTWND_VSCROLL;\r
+ else\r
+ d->flags &= ~KHUI_HTWND_VSCROLL;\r
+\r
+ l = GetWindowLongPtr(hwnd, GWL_STYLE);\r
+ l &= ~(WS_HSCROLL | WS_VSCROLL);\r
+\r
+ l |= ((d->flags & KHUI_HTWND_HSCROLL) ? WS_HSCROLL : 0) |\r
+ ((d->flags & KHUI_HTWND_VSCROLL) ? WS_VSCROLL : 0);\r
+\r
+ SetWindowLongPtr(hwnd, GWL_STYLE, l);\r
+\r
+ InvalidateRect(hwnd, NULL, FALSE);\r
+ /* since the client area changed, we do another redraw\r
+ before updating the scroll bar positions. */\r
+ } else {\r
+ d->ext_width = ext_width;\r
+ d->ext_height = ext_height;\r
+\r
+ if (d->flags & KHUI_HTWND_HSCROLL) {\r
+ ZeroMemory(&si, sizeof(si));\r
+ si.cbSize = sizeof(si);\r
+ si.fMask = SIF_ALL | SIF_DISABLENOSCROLL;\r
+ si.nMin = 0;\r
+ si.nMax = ext_width;\r
+ si.nPage = r.right - r.left;\r
+ si.nPos = d->scroll_left;\r
+\r
+ SetScrollInfo(hwnd, SB_HORZ, &si, TRUE);\r
+ }\r
+\r
+ if (d->flags & KHUI_HTWND_VSCROLL) {\r
+ ZeroMemory(&si, sizeof(si));\r
+ si.cbSize = sizeof(si);\r
+ si.fMask = SIF_ALL | SIF_DISABLENOSCROLL;\r
+ si.nMin = 0;\r
+ si.nMax = ext_height;\r
+ si.nPage = r.bottom - r.top;\r
+ si.nPos = d->scroll_top;\r
+\r
+ SetScrollInfo(hwnd, SB_VERT, &si, TRUE);\r
+ }\r
+ }\r
+ }\r
+\r
return 0;\r
}\r
\r
)\r
{\r
switch(uMsg) {\r
- case WM_CREATE:\r
- {\r
- CREATESTRUCT * cs;\r
- khui_htwnd_data * d;\r
- size_t cbsize;\r
+ case WM_CREATE:\r
+ {\r
+ CREATESTRUCT * cs;\r
+ khui_htwnd_data * d;\r
+ size_t cbsize;\r
\r
- cs = (CREATESTRUCT *) lParam;\r
+ cs = (CREATESTRUCT *) lParam;\r
\r
- d = PMALLOC(sizeof(*d));\r
- ZeroMemory(d, sizeof(*d));\r
+ d = PMALLOC(sizeof(*d));\r
+ ZeroMemory(d, sizeof(*d));\r
\r
- if(cs->dwExStyle & WS_EX_TRANSPARENT) {\r
- d->flags |= KHUI_HTWND_TRANSPARENT;\r
- }\r
- if(cs->dwExStyle & WS_EX_CLIENTEDGE) {\r
- d->flags |= KHUI_HTWND_CLIENTEDGE;\r
- }\r
- d->id = (int)(INT_PTR) cs->hMenu;\r
+ if(cs->dwExStyle & WS_EX_TRANSPARENT) {\r
+ d->flags |= KHUI_HTWND_TRANSPARENT;\r
+ }\r
+ if(cs->dwExStyle & WS_EX_CLIENTEDGE) {\r
+ d->flags |= KHUI_HTWND_CLIENTEDGE;\r
+ }\r
+ if(cs->style & WS_HSCROLL) {\r
+ d->flags |= KHUI_HTWND_HSCROLL;\r
+ }\r
+ if(cs->style & WS_VSCROLL) {\r
+ d->flags |= KHUI_HTWND_VSCROLL;\r
+ }\r
+ d->id = (int)(INT_PTR) cs->hMenu;\r
\r
- d->active_link = -1;\r
- d->bk_color = RGB(255,255,255);\r
- d->hc_hand = LoadCursor(NULL, IDC_HAND);\r
+ d->active_link = -1;\r
+ d->bk_color = RGB(255,255,255);\r
+ d->hc_hand = LoadCursor(NULL, IDC_HAND);\r
\r
- if(SUCCEEDED(StringCbLength(cs->lpszName, KHUI_HTWND_MAXCB_TEXT, &cbsize))) {\r
- cbsize += sizeof(wchar_t);\r
- d->text = PMALLOC(cbsize);\r
- StringCbCopy(d->text, cbsize, cs->lpszName);\r
- }\r
+ if(SUCCEEDED(StringCbLength(cs->lpszName, KHUI_HTWND_MAXCB_TEXT, &cbsize))) {\r
+ cbsize += sizeof(wchar_t);\r
+ d->text = PMALLOC(cbsize);\r
+ StringCbCopy(d->text, cbsize, cs->lpszName);\r
+ }\r
+\r
+ /* this is just a flag to the WM_PAINT handler that the\r
+ extents haven't been set yet. */\r
+ d->ext_width = -1;\r
\r
#pragma warning(push)\r
#pragma warning(disable: 4244)\r
- SetWindowLongPtr(hwnd, 0, (LONG_PTR) d);\r
+ SetWindowLongPtr(hwnd, 0, (LONG_PTR) d);\r
#pragma warning(pop)\r
\r
- return 0;\r
+ return 0;\r
+ }\r
+ break;\r
+\r
+ case WM_SETTEXT:\r
+ {\r
+ wchar_t * newtext;\r
+ size_t cbsize;\r
+ khui_htwnd_data * d;\r
+ BOOL rv;\r
+\r
+ d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
+ newtext = (wchar_t *) lParam;\r
+\r
+ if(d->text) {\r
+ PFREE(d->text);\r
+ d->text = NULL;\r
}\r
- break;\r
\r
- case WM_SETTEXT:\r
- {\r
- wchar_t * newtext;\r
- size_t cbsize;\r
- khui_htwnd_data * d;\r
- BOOL rv;\r
+ if(SUCCEEDED(StringCbLength(newtext, KHUI_HTWND_MAXCB_TEXT, &cbsize))) {\r
+ cbsize += sizeof(wchar_t);\r
+ d->text = PMALLOC(cbsize);\r
+ StringCbCopy(d->text, cbsize, newtext);\r
+ rv = TRUE;\r
+ } else\r
+ rv = FALSE;\r
+\r
+ clear_styles(d);\r
+\r
+ d->ext_width = -1;\r
+ d->scroll_left = 0;\r
+ d->scroll_top = 0;\r
\r
- d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
- newtext = (wchar_t *) lParam;\r
+ InvalidateRect(hwnd, NULL, TRUE);\r
\r
- if(d->text) {\r
- PFREE(d->text);\r
- d->text = NULL;\r
+ return rv;\r
+ }\r
+ break;\r
+\r
+ case WM_DESTROY:\r
+ {\r
+ khui_htwnd_data * d;\r
+ int i;\r
+\r
+ d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
+ if(d->text)\r
+ PFREE(d->text);\r
+ d->text = 0;\r
+\r
+ if(d->links) {\r
+ for(i=0;i<d->max_links;i++) {\r
+ if(d->links[i])\r
+ PFREE(d->links[i]);\r
}\r
+ PFREE(d->links);\r
+ }\r
\r
- if(SUCCEEDED(StringCbLength(newtext, KHUI_HTWND_MAXCB_TEXT, &cbsize))) {\r
- cbsize += sizeof(wchar_t);\r
- d->text = PMALLOC(cbsize);\r
- StringCbCopy(d->text, cbsize, newtext);\r
- rv = TRUE;\r
- } else\r
- rv = FALSE;\r
+ clear_styles(d);\r
\r
- clear_styles(d);\r
+ PFREE(d);\r
+ }\r
+ break;\r
\r
- InvalidateRect(hwnd, NULL, TRUE);\r
+ case WM_ERASEBKGND:\r
+ {\r
+ khui_htwnd_data * d;\r
+ d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
\r
- return rv;\r
- }\r
- break;\r
+ if(d->flags & KHUI_HTWND_TRANSPARENT)\r
+ return TRUE;\r
\r
- case WM_DESTROY:\r
- {\r
- khui_htwnd_data * d;\r
- int i;\r
-\r
- d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
- if(d->text)\r
- PFREE(d->text);\r
- d->text = 0;\r
-\r
- if(d->links) {\r
- for(i=0;i<d->max_links;i++) {\r
- if(d->links[i])\r
- PFREE(d->links[i]);\r
- }\r
- PFREE(d->links);\r
- }\r
+ return FALSE;\r
+ }\r
+\r
+ case WM_PAINT:\r
+ htw_paint(hwnd, uMsg, wParam, lParam);\r
+ break;\r
+\r
+ case WM_SETCURSOR:\r
+ {\r
+ khui_htwnd_data * d;\r
\r
- clear_styles(d);\r
+ if(hwnd != (HWND)wParam)\r
+ break;\r
+ \r
+ d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
\r
- PFREE(d);\r
+ if(d->active_link >= 0) {\r
+ SetCursor(d->hc_hand);\r
+ return TRUE;\r
}\r
- break;\r
+ }\r
+ break;\r
\r
- case WM_ERASEBKGND:\r
- {\r
- khui_htwnd_data * d;\r
- d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
+ case WM_SETFOCUS:\r
+ {\r
+ khui_htwnd_data * d;\r
\r
- if(d->flags & KHUI_HTWND_TRANSPARENT)\r
- return TRUE;\r
+ d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
\r
- return FALSE;\r
- }\r
+ d->flags |= KHUI_HTWND_FOCUS;\r
\r
- case WM_PAINT:\r
- htw_paint(hwnd, uMsg, wParam, lParam);\r
- break;\r
+ InvalidateRect(hwnd, NULL, TRUE);\r
+ }\r
+ break;\r
\r
- case WM_SETCURSOR:\r
- {\r
- khui_htwnd_data * d;\r
+ case WM_KILLFOCUS:\r
+ {\r
+ khui_htwnd_data * d;\r
\r
- if(hwnd != (HWND)wParam)\r
- break;\r
+ d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
\r
- d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
+ d->flags &= ~KHUI_HTWND_FOCUS;\r
\r
- if(d->active_link >= 0) {\r
- SetCursor(d->hc_hand);\r
- return TRUE;\r
- }\r
- }\r
- break;\r
+ InvalidateRect(hwnd, NULL, TRUE);\r
+ }\r
+ break;\r
+\r
+ case WM_LBUTTONDOWN:\r
+ {\r
+ khui_htwnd_data * d;\r
\r
- case WM_SETFOCUS:\r
- {\r
- khui_htwnd_data * d;\r
+ d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
\r
- d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
+ d->md_link = d->active_link;\r
\r
- d->flags |= KHUI_HTWND_FOCUS;\r
+ SetCapture(hwnd);\r
+ }\r
+ break;\r
+\r
+ case WM_LBUTTONUP:\r
+ {\r
+ khui_htwnd_data * d;\r
\r
- InvalidateRect(hwnd, NULL, TRUE);\r
+ d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
+\r
+ if(d->md_link == d->active_link && d->md_link >= 0) {\r
+ /* clicked */\r
+ SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(d->id, BN_CLICKED), (LPARAM) d->links[d->md_link]);\r
}\r
- break;\r
\r
- case WM_KILLFOCUS:\r
- {\r
- khui_htwnd_data * d;\r
+ ReleaseCapture();\r
+ }\r
+ break;\r
\r
- d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
+ case WM_HSCROLL:\r
+ {\r
+ khui_htwnd_data * d;\r
+ int old_pos;\r
+ int new_pos;\r
+ int ext;\r
+ SCROLLINFO si;\r
+ RECT r;\r
+\r
+ d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
+\r
+ old_pos = new_pos = d->scroll_left;\r
+ ext = d->ext_width;\r
+\r
+ switch(HIWORD(wParam)) {\r
+ case SB_THUMBTRACK:\r
+ case SB_THUMBPOSITION:\r
+ ZeroMemory(&si, sizeof(si));\r
+ si.cbSize = sizeof(si);\r
+ si.fMask = SIF_TRACKPOS;\r
+ GetScrollInfo(hwnd, SB_HORZ, &si);\r
+ new_pos = si.nTrackPos;\r
+ break;\r
\r
- d->flags &= ~KHUI_HTWND_FOCUS;\r
+ case SB_LINELEFT:\r
+ new_pos -= ext / 12; /* arbitrary unit */\r
+ break;\r
\r
- InvalidateRect(hwnd, NULL, TRUE);\r
+ case SB_LINERIGHT:\r
+ new_pos += ext / 12; /* arbitrary unit */\r
+ break;\r
+\r
+ case SB_PAGELEFT:\r
+ GetClientRect(hwnd, &r);\r
+ new_pos -= r.right - r.left;\r
+ break;\r
+\r
+ case SB_PAGERIGHT:\r
+ GetClientRect(hwnd, &r);\r
+ new_pos += r.right - r.left;\r
+ break;\r
}\r
- break;\r
\r
- case WM_LBUTTONDOWN:\r
- {\r
- khui_htwnd_data * d;\r
+ if (new_pos == old_pos)\r
+ break;\r
\r
- d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
+ GetClientRect(hwnd, &r);\r
\r
- d->md_link = d->active_link;\r
+#if 0\r
+ if (new_pos > ext - (r.right - r.left))\r
+ new_pos = ext - (r.right - r.left);\r
+#endif\r
+ if (new_pos > ext)\r
+ new_pos = ext;\r
\r
- SetCapture(hwnd);\r
- }\r
- break;\r
+ if (new_pos < 0)\r
+ new_pos = 0;\r
\r
- case WM_LBUTTONUP:\r
- {\r
- khui_htwnd_data * d;\r
+ if (new_pos == old_pos)\r
+ break;\r
\r
- d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
+ ZeroMemory(&si, sizeof(si));\r
+ si.cbSize = sizeof(si);\r
+ si.fMask = SIF_POS;\r
+ si.nPos = new_pos;\r
+ SetScrollInfo(hwnd, SB_HORZ, &si, TRUE);\r
+ /* note that Windows sometimes adjusts the position after\r
+ setting it with SetScrollInfo. We have to look it up\r
+ again to see what value it ended up at. */\r
+ GetScrollInfo(hwnd, SB_HORZ, &si);\r
+ new_pos = si.nPos;\r
+\r
+ if (new_pos == old_pos)\r
+ break;\r
\r
- if(d->md_link == d->active_link && d->md_link >= 0) {\r
- /* clicked */\r
- SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(d->id, BN_CLICKED), (LPARAM) d->links[d->md_link]);\r
- }\r
+ d->scroll_left = new_pos;\r
\r
- ReleaseCapture();\r
- }\r
- break;\r
+ ScrollWindow(hwnd, old_pos - new_pos, 0, NULL, NULL);\r
\r
- case WM_MOUSEMOVE:\r
- {\r
- khui_htwnd_data * d;\r
- int i;\r
- POINT p;\r
- int nl;\r
+ return 0;\r
+ }\r
+ break;\r
\r
- p.x = GET_X_LPARAM(lParam);\r
- p.y = GET_Y_LPARAM(lParam);\r
- d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
+ case WM_MOUSEMOVE:\r
+ {\r
+ khui_htwnd_data * d;\r
+ int i;\r
+ POINT p;\r
+ int nl;\r
+\r
+ d = (khui_htwnd_data *)(LONG_PTR) GetWindowLongPtr(hwnd, 0);\r
+ p.x = GET_X_LPARAM(lParam) + d->scroll_left;\r
+ p.y = GET_Y_LPARAM(lParam) + d->scroll_top;\r
\r
- for(i=0; i<d->n_links; i++) {\r
- if(d->links && d->links[i] && PtInRect(&(d->links[i]->r), p))\r
- break;\r
- }\r
+ for(i=0; i<d->n_links; i++) {\r
+ if(d->links && d->links[i] && PtInRect(&(d->links[i]->r), p))\r
+ break;\r
+ }\r
\r
- if(i == d->n_links)\r
- nl = -1;\r
- else\r
- nl = i;\r
+ if(i == d->n_links)\r
+ nl = -1;\r
+ else\r
+ nl = i;\r
\r
- if(d->active_link != nl) {\r
- if(d->active_link >= 0) {\r
- if(d->flags & KHUI_HTWND_TRANSPARENT)\r
+ if(d->active_link != nl) {\r
+ if(d->active_link >= 0) {\r
+ if(d->flags & KHUI_HTWND_TRANSPARENT)\r
{\r
HWND parent = GetParent(hwnd);\r
if(parent) {\r
InvalidateRect(parent, NULL, TRUE);\r
}\r
}\r
- /* although we are invalidating the rect before setting active_link,\r
- WM_PAINT will not be issued until wndproc returns */\r
- InvalidateRect(hwnd, &(d->links[d->active_link]->r), TRUE);\r
- }\r
- d->active_link = nl;\r
- if(d->active_link >= 0) {\r
- /* although we are invalidating the rect before setting active_link,\r
- WM_PAINT will not be issued until wndproc returns */\r
- if(d->flags & KHUI_HTWND_TRANSPARENT)\r
+ /* although we are invalidating the rect before setting active_link,\r
+ WM_PAINT will not be issued until wndproc returns */\r
+ InvalidateRect(hwnd, &(d->links[d->active_link]->r), TRUE);\r
+ }\r
+ d->active_link = nl;\r
+ if(d->active_link >= 0) {\r
+ /* although we are invalidating the rect before setting active_link,\r
+ WM_PAINT will not be issued until wndproc returns */\r
+ if(d->flags & KHUI_HTWND_TRANSPARENT)\r
{\r
HWND parent = GetParent(hwnd);\r
if(parent) {\r
InvalidateRect(parent, NULL, TRUE);\r
}\r
}\r
- InvalidateRect(hwnd, &(d->links[d->active_link]->r), TRUE);\r
- }\r
+ InvalidateRect(hwnd, &(d->links[d->active_link]->r), TRUE);\r
}\r
}\r
- break;\r
+ }\r
+ break;\r
}\r
\r
return DefWindowProc(hwnd, uMsg,wParam,lParam);\r
\r
#define KHUI_HTWND_TRANSPARENT 1\r
#define KHUI_HTWND_CLIENTEDGE 2\r
+#define KHUI_HTWND_HSCROLL 4\r
+#define KHUI_HTWND_VSCROLL 8\r
#define KHUI_HTWND_FOCUS 2048\r
\r
#define KHUI_HTWND_CLASS L"KhmHtWnd"\r
l->param_len < ARRAYLENGTH(sparam) &&\r
l->param_len > 0) {\r
\r
- wcsncpy(sparam, l->param, l->param_len);\r
+ StringCchCopyN(sparam, ARRAYLENGTH(sparam),\r
+ l->param, l->param_len);\r
sparam[l->param_len] = L'\0';\r
\r
} else {\r
}\r
\r
/* if it was for us, then we need to process the message */\r
- if(!wcsicmp(sid, CTLINKID_SWITCH_PANEL)) {\r
+ if(!_wcsicmp(sid, CTLINKID_SWITCH_PANEL)) {\r
khm_int32 credtype;\r
khui_new_creds_by_type * t;\r
\r
WMNC_DIALOG_SWITCH_PANEL),\r
0);\r
}\r
- } else if (!wcsicmp(sid, L"NotDef")) {\r
+ } else if (!_wcsicmp(sid, L"NotDef")) {\r
d->nc->set_default = FALSE;\r
nc_update_credtext(d);\r
- } else if (!wcsicmp(sid, L"MakeDef")) {\r
+ } else if (!_wcsicmp(sid, L"MakeDef")) {\r
d->nc->set_default = TRUE;\r
nc_update_credtext(d);\r
}\r
#include<utils.h>\r
#include<assert.h>\r
\r
+#include<strsafe.h>\r
+\r
khui_action_ref khui_main_menu[] = {\r
MENU_SUBMENU(KHUI_MENU_FILE),\r
MENU_SUBMENU(KHUI_MENU_CRED),\r
#include<utils.h>\r
#include<assert.h>\r
\r
+#include<strsafe.h>\r
+\r
/***********************************************************************\r
Alerter\r
***********************************************************************/\r
#include<utils.h>\r
#include<assert.h>\r
\r
+#include<strsafe.h>\r
+\r
khm_int32 cfgui_node_serial;\r
LONG init_once = 0;\r
CRITICAL_SECTION cs_cfgui;\r
#include<utils.h>\r
#include<assert.h>\r
\r
+#include<strsafe.h>\r
+\r
#define CW_ALLOC_INCR 8\r
\r
static void cw_free_prompts(khui_new_creds * c);\r
#define KHUI_MAXCB_PNAME (KHUI_MAXCCH_PNAME * sizeof(wchar_t))\r
\r
/*! \brief A descriptor of a panel in the new credentials acquisition tab\r
+\r
+ When processing certain credentials messages such as\r
+ ::KMSG_CRED_PASSWORD, ::KMSG_CRED_NEW_CREDS,\r
+ ::KMSG_CRED_RENEW_CREDS, a pointer to a ::khui_new_creds structure\r
+ will be passed in to the message handler. If the handler of the\r
+ message needs to add one or more credentials types as participants\r
+ of the operation, the handler will need to call khui_cw_add_type()\r
+ and specify a ::khui_new_creds_by_type structure.\r
+\r
+ Note that the memory address passed in to the call to\r
+ khui_cw_add_type() will not be copied. Therefore, the block of\r
+ memory should remain as-is for the lifetime of the\r
+ ::khui_new_creds structure or until it is removed with a call to\r
+ khui_cw_del_type().\r
+\r
+ Some of the credentials messages that require specifying a\r
+ ::khui_new_creds_by_type structure require providing a\r
+ user-interface. In these cases, the fields marked for providing a\r
+ UI may be required to hold valid values. If the message does not\r
+ require providing a UI, these fields will be ignored.\r
*/\r
typedef struct tag_khui_new_creds_by_type {\r
khui_new_creds * nc; /*!< Internal use. Do not set */\r
khm_int32 flags; /*!< Internal use. Do not set */\r
\r
khm_int32 type; /*!< The identifier of the credentials\r
- type */\r
+ type. This is a credentials type\r
+ identifier allocated with a call to\r
+ kcdb_credtype_register(). */\r
\r
khm_int32 type_deps[KHUI_MAX_TYPE_DEPS];\r
/*!< credentials types that this\r
credential type depends on. Each\r
element defines a credentials type\r
identifier that this type depends\r
- on for this operation. */\r
+ on for this operation. The number\r
+ of valid values in this array\r
+ should be specified in the \a\r
+ n_type_deps field. */\r
\r
khm_size n_type_deps; /*!< Number of dependencies listed\r
above. Should be between 0 and\r
- ::KHUI_MAX_TYPE_DEPS */\r
+ ::KHUI_MAX_TYPE_DEPS. Specify 0 if\r
+ there are no dependencies. */\r
\r
khm_size ordinal; /*!< The requested ordinal. The UI\r
would attempt to place this panel at\r
wchar_t *name; /*!< Name of the panel (localized,\r
optional). If NULL, the localized\r
name of the credentials type is\r
- used. */\r
+ used. Only used if providing a\r
+ user-interface. */\r
\r
- HICON icon; /*!< Icon for the panel (optional) */\r
+ HICON icon; /*!< Icon for the panel (optional).\r
+ Only used if providing a\r
+ user-interface. */\r
\r
wchar_t *tooltip; /*!< Tooltip for the panel (localized,\r
optional). If NULL, no tooltip will\r
- be assigned for the panel */\r
+ be assigned for the panel. Only\r
+ used if providing a\r
+ user-interface. */\r
\r
HMODULE h_module; /*!< Handle to the module containing\r
- the dialog resource */\r
-\r
- LPWSTR dlg_template; /*!< The dialog resource */\r
- DLGPROC dlg_proc; /*!< The dialog procedure */\r
+ the dialog resource. Only used if\r
+ providing a user-interface. */\r
+\r
+ LPWSTR dlg_template; /*!< The dialog resource. Only used\r
+ if providing a user-interface. */\r
+ DLGPROC dlg_proc; /*!< The dialog procedure. Only used\r
+ if providing a user-interface. */\r
+\r
+ HWND hwnd_panel; /*!< The dialog window. Once the\r
+ dialog panel is created, a handle to\r
+ the panel will be assigned here.\r
+ Note that the handle is assigned\r
+ after a successful call to\r
+ CreateDialogParam and hence would\r
+ not be available when handling the\r
+ WM_INITDIALOG message from the\r
+ dialog procedure. Only used of\r
+ providing a user-interface. */\r
\r
- HWND hwnd_panel; /*!< The dialog window */\r
HWND hwnd_tc; /*!< Internal use. Do not set */\r
\r
wchar_t *credtext; /*!< A brief description of the\r
current state of this cred\r
- type. (localized, optional) */\r
+ type. (localized, optional). Only\r
+ used if providing a\r
+ user-interface. */\r
\r
LPARAM aux; /*!< auxilliary field. For use by the\r
- credential provider */\r
+ plug-in. */\r
} khui_new_creds_by_type;\r
\r
/*!\name Flags for khui_new_creds_by_type\r
See the description of ::khui_new_cred_panel for information on\r
how to populate it to describe a credentials type panel.\r
\r
+ Note that the structure pointed to by \a t is added by reference.\r
+ The memory pointed to by \a t is not copied. Hence, the block of\r
+ memory and any other blocks pointed to by the\r
+ ::khui_new_creds_by_type structure located there should remain\r
+ intact for the lifetime of the ::khui_new_creds structure pointed\r
+ to by \a c or until the credentials type panel is removed from the\r
+ ::khui_new_creds structure with a call to khui_cw_del_type().\r
+\r
+ Generally, a plug-in that calls this function should allocate a\r
+ block of memory to contain the ::khui_new_creds_by_type structure,\r
+ fill it in and then pass in the address in a call to\r
+ khui_cw_add_type() while handling a ::KMSG_CRED_PASSWORD,\r
+ ::KMSG_CRED_NEW_CREDS or ::KMSG_CRED_RENEW_CREDS message. Then\r
+ the plug-in should remove the reference with a call to\r
+ khui_cw_del_type() while processing ::KMSG_CRED_END.\r
+\r
\see khui_cw_del_type()\r
\see \ref cred_acq_panel_spec\r
\see ::khui_new_cred_panel\r
perf_once();\r
\r
EnterCriticalSection(&cs_alloc);\r
+#if _MSC_VER >= 1400\r
+ if (fopen_s(&f, file, "w"))\r
+ return;\r
+#else\r
f = fopen(file, "w");\r
if (!f)\r
- return;\r
+ return;\r
+#endif\r
\r
fprintf(f, "Leaked allocations list ....\n");\r
fprintf(f, "File\tLine\tThread\tSize\n");\r