#include <afs/venus.h>
#include <afs/ptserver.h>
#include <afs/ptuser.h>
+#include <afs/pterror.h>
#include <afs/dirpath.h>
#include <afs/afsutil.h>
if (code) {
const char *str = afs_error_message(code);
if (strncmp(str, "unknown", strlen("unknown")) == 0) {
+#ifdef HAVE_KRB5_SVC_GET_MSG
+ krb5_svc_get_msg(code,&str);
+#else
str = error_message(code);
+#endif
}
fputs(str, stderr);
fputs(" ", stderr);
+#ifdef HAVE_KRB5_SVC_GET_MSG
+ krb5_free_string(str);
+#endif
}
if (fmt) {
vfprintf(stderr, fmt, ap);
static int
rxkad_build_native_token(krb5_context context, krb5_creds *v5cred,
struct ktc_token **tokenPtr, char **userPtr) {
- char k4name[ANAME_SZ];
- char k4inst[INST_SZ];
- char k4realm[REALM_SZ];
char username[BUFSIZ];
struct ktc_token *token;
- int status;
#ifdef HAVE_NO_KRB5_524
char *p;
int len;
+#else
+ int status;
+ char k4name[ANAME_SZ];
+ char k4inst[INST_SZ];
+ char k4realm[REALM_SZ];
#endif
afs_dprintf("Using Kerberos V5 ticket natively\n");
if ((status = get_cellconfig(cell, &cellconf, &local_cell)))
return(status);
- if (linkedcell != NULL && cellconf.linkedCell != NULL) {
- *linkedcell = strdup(cellconf.linkedCell);
- if (*linkedcell == NULL) {
- status = ENOMEM;
- goto out;
+ if (linkedcell != NULL) {
+ if (cellconf.linkedCell != NULL) {
+ *linkedcell = strdup(cellconf.linkedCell);
+ if (*linkedcell == NULL) {
+ status = ENOMEM;
+ goto out;
+ }
+ } else {
+ *linkedcell = NULL;
}
}
*/
if ((status == 0) && (viceId != ANONYMOUSID)) {
- sprintf(username, "AFS ID %d", (int) viceId);
+ free(username);
+ if (afs_asprintf(&username, "AFS ID %d", (int) viceId) < 0) {
+ status = ENOMEM;
+ username = NULL;
+ goto out;
+ }
}
}
progname = argv[0];
krb5_init_context(&context);
- initialize_ktc_error_table ();
+ initialize_KTC_error_table ();
+ initialize_U_error_table();
+ initialize_RXK_error_table();
+ initialize_ACFG_error_table();
+ initialize_PT_error_table();
afs_set_com_err_hook(redirect_errors);
/*
krb5_ticket ticket_reply[1];
krb5_enc_tkt_part enc_tkt_reply[1];
krb5_address address[30], *faddr[30];
-#endif
krb5_data * temp;
+#endif
int i;
static int any_enctype[] = {0};
*out_creds = 0;
krb5_kt_close(context, kt);
if (creds) krb5_free_creds(context, creds);
krb5_free_keyblock_contents(context, session_key);
-out:
return code;
#else
return -1;