*/
#include <afsconfig.h>
+#include <afs/param.h>
+#include <afs/stds.h>
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/types.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-#ifdef HAVE_MEMORY_H
-#include <memory.h>
-#endif
-#include <errno.h>
-
-#include <sys/stat.h>
-#include <fcntl.h>
+#include <roken.h>
-#include <sys/param.h>
-#include <sys/errno.h>
-#include <netdb.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <pwd.h>
+#include <ctype.h>
-#include <afs/stds.h>
#include <afs/ktc.h>
#include <afs/token.h>
#include <afs/com_err.h>
#endif
-#include <afs/param.h>
#ifdef AFS_SUN5_ENV
#include <sys/ioccom.h>
#endif
-/* Prevent inclusion of des.h to avoid conflicts with des types */
-#define NO_DES_H_INCLUDE
-
#include <afs/auth.h>
#include <afs/cellconfig.h>
#include <afs/vice.h>
#define AKLOG_BADPATH 6
#define AKLOG_MISC 7
-#ifndef NULL
-#define NULL 0
-#endif
-
#ifndef TRUE
#define TRUE 1
#endif
#error "Must have either keyblock or session member of krb5_creds"
#endif
-#if !defined(HAVE_KRB5_524_CONVERT_CREDS) && defined(HAVE_KRB524_CONVERT_CREDS_KDC)
+#ifdef AFS_DARWIN110_ENV
+#define HAVE_NO_KRB5_524 /* MITKerberosShim logs but returns success */
+#elif !defined(HAVE_KRB5_524_CONVERT_CREDS) && defined(HAVE_KRB524_CONVERT_CREDS_KDC)
#define krb5_524_convert_creds krb524_convert_creds_kdc
#elif !defined(HAVE_KRB5_524_CONVERT_CREDS) && !defined(HAVE_KRB524_CONVERT_CREDS_KDC)
#define HAVE_NO_KRB5_524
if (strncmp(str, "unknown", strlen("unknown")) == 0) {
#ifdef HAVE_KRB5_SVC_GET_MSG
krb5_svc_get_msg(code,&str);
-#else
+#elif defined(HAVE_ERROR_MESSAGE)
str = error_message(code);
+#else
+ ; /* IRIX apparently has neither: use the string we have */
#endif
}
fputs(str, stderr);
fprintf(stderr, "%s: Couldn't get %s AFS tickets:\n",
progname, cell->name);
afs_com_err(progname, status, "while getting AFS tickets");
+#ifdef KRB5_CC_NOT_KTYPE
+ if (status == KRB5_CC_NOT_KTYPE) {
+ fprintf(stderr, "allow_weak_enctypes may be required in the Kerberos configuration\n");
+ }
+#endif
status = AKLOG_KERBEROS;
goto out;
}
} else {
len = strlen(username)+strlen(realmUsed)+2;
*authuser = malloc(len);
- afs_snprintf(*authuser, len, "%s@%s", username, realmUsed);
+ snprintf(*authuser, len, "%s@%s", username, realmUsed);
*foreign = 1;
}
if(buf_len != buf_size) {
afs_com_err(progname, code,
- "%d != %d while encoding ticket (internal ASN.1 encoder error",
- buf_len, buf_size);
+ "%u != %u while encoding ticket (internal ASN.1 encoder error",
+ (unsigned int)buf_len, (unsigned int)buf_size);
goto cleanup;
}
what = "krb5_crypto_init";
*realm = NULL;
- if (!_krb425_ccache)
- krb5_cc_default(context, &_krb425_ccache);
+ if (!_krb425_ccache) {
+ r = krb5_cc_default(context, &_krb425_ccache);
+ if (r)
+ return r;
+ }
if (!client_principal) {
if (client) {
r = krb5_parse_name(context, client, &client_principal);