From ec6823295ad2d0f480d93ee2c3a4c2306b039d9f Mon Sep 17 00:00:00 2001 From: Douglas Engert Date: Wed, 11 Jul 2007 05:32:27 +0000 Subject: [PATCH] STABLE14-aklog-deal-without-524-20070711 patch in a way of dealing with no krb524 (cherry picked from commit e13f8859a01509a45d686972959c73be1d46e500) --- src/aklog/aklog.h | 4 ++++ src/aklog/aklog_main.c | 14 ++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/aklog/aklog.h b/src/aklog/aklog.h index 47acfc768..c3d0ce657 100644 --- a/src/aklog/aklog.h +++ b/src/aklog/aklog.h @@ -51,6 +51,10 @@ void aklog ARGS((int, char *[])); #define INST_SZ 40 #endif /* INST_SZ */ +#ifndef u_int32_t +#define u_int32_t uint32_t +#endif + struct ktext { unsigned int length; unsigned char dat[MAX_KTXT_LEN]; diff --git a/src/aklog/aklog_main.c b/src/aklog/aklog_main.c index 0c29b656b..66672c35b 100644 --- a/src/aklog/aklog_main.c +++ b/src/aklog/aklog_main.c @@ -203,7 +203,7 @@ static int get_user_realm(krb5_context, char *); #if !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) -#error "You must have one of krb5_524_convert_creds or krb524_convert_creds_kdc available" +#define HAVE_NO_KRB5_524 #endif #endif /* WINDOWS */ @@ -669,6 +669,7 @@ static int auth_to_cell(krb5_context context, char *cell, char *realm) get_cred_keylen(v5cred)); atoken.ticketLen = v5cred->ticket.length; memcpy(atoken.ticket, v5cred->ticket.data, atoken.ticketLen); +#ifndef HAVE_NO_KRB5_524 } else { CREDENTIALS cred; @@ -703,6 +704,7 @@ static int auth_to_cell(krb5_context context, char *cell, char *realm) memcpy(&atoken.sessionKey, cred.session, 8); atoken.ticketLen = cred.ticket_st.length; memcpy(atoken.ticket, cred.ticket_st.dat, atoken.ticketLen); +#endif /* HAVE_NO_KRB5_524 */ } if (!force && @@ -1225,7 +1227,11 @@ static void usage(void) "[-d] [[-cell | -c] cell [-k krb_realm]] ", "[[-p | -path] pathname]\n", " [-zsubs] [-hosts] [-noauth] [-noprdb] [-force] [-setpag] \n" - " [-linked] [-524]\n"); + " [-linked]" +#ifndef HAVE_NO_KRB5_524 + " [-524]" +#endif + "\n"); fprintf(stderr, " -d gives debugging information.\n"); fprintf(stderr, " krb_realm is the kerberos realm of a cell.\n"); fprintf(stderr, " pathname is the name of a directory to which "); @@ -1237,7 +1243,9 @@ static void usage(void) fprintf(stderr, " -force means replace identical tickets. \n"); fprintf(stderr, " -linked means if AFS node is linked, try both. \n"); fprintf(stderr, " -setpag set the AFS process authentication group.\n"); +#ifndef HAVE_NO_KRB5_524 fprintf(stderr, " -524 means use the 524 converter instead of V5 directly\n"); +#endif fprintf(stderr, " No commandline arguments means "); fprintf(stderr, "authenticate to the local cell.\n"); fprintf(stderr, "\n"); @@ -1310,8 +1318,10 @@ void aklog(int argc, char *argv[]) linked++; else if (strcmp(argv[i], "-force") == 0) force++; +#ifndef HAVE_NO_KRB5_524 else if (strcmp(argv[i], "-524") == 0) do524++; +#endif else if (strcmp(argv[i], "-setpag") == 0) afssetpag++; else if (((strcmp(argv[i], "-cell") == 0) || -- 2.39.5