svn rev #22788: trunk/src/kadmin/cli/
ghudson@MIT.EDU
ghudson at MIT.EDU
Fri Sep 25 12:31:40 EDT 2009
http://src.mit.edu/fisheye/changelog/krb5/?cs=22788
Commit By: ghudson
Log Message:
Fix a few bugs in kadmin's keytab.c from r22785.
Changed Files:
U trunk/src/kadmin/cli/keytab.c
Modified: trunk/src/kadmin/cli/keytab.c
===================================================================
--- trunk/src/kadmin/cli/keytab.c 2009-09-25 15:20:19 UTC (rev 22787)
+++ trunk/src/kadmin/cli/keytab.c 2009-09-25 16:31:40 UTC (rev 22788)
@@ -100,7 +100,7 @@
} else {
if (strchr(name, ':') != NULL)
name = strdup(name);
- else if (asprintf(keytab_str, "WRFILE:%s", name) < 0)
+ else if (asprintf(&name, "WRFILE:%s", name) < 0)
name = NULL;
if (name == NULL) {
com_err(whoami, ENOMEM, "while creating keytab name");
@@ -342,7 +342,7 @@
krb5_free_principal(context, princ);
}
-void
+static void
remove_principal(char *keytab_str, krb5_keytab keytab,
char *princ_str, char *kvno_str)
{
@@ -356,7 +356,7 @@
code = krb5_parse_name(context, princ_str, &princ);
if (code != 0) {
com_err(whoami, code, "while parsing principal name %s", princ_str);
- return code;
+ return;
}
mode = UNDEF;
@@ -392,7 +392,7 @@
}
} else
com_err(whoami, code, "while retrieving highest kvno from keytab");
- return code;
+ return;
}
/* set kvno to spec'ed value for SPEC, highest kvno otherwise */
@@ -402,7 +402,7 @@
code = krb5_kt_start_seq_get(context, keytab, &cursor);
if (code != 0) {
com_err(whoami, code, "while starting keytab scan");
- return code;
+ return;
}
did_something = 0;
@@ -422,17 +422,17 @@
code = krb5_kt_end_seq_get(context, keytab, &cursor);
if (code != 0) {
com_err(whoami, code, "while temporarily ending keytab scan");
- return code;
+ return;
}
code = krb5_kt_remove_entry(context, keytab, &entry);
if (code != 0) {
com_err(whoami, code, "while deleting entry from keytab");
- return code;
+ return;
}
code = krb5_kt_start_seq_get(context, keytab, &cursor);
if (code != 0) {
com_err(whoami, code, "while restarting keytab scan");
- return code;
+ return;
}
did_something++;
@@ -445,12 +445,12 @@
}
if (code && code != KRB5_KT_END) {
com_err(whoami, code, "while scanning keytab");
- return code;
+ return;
}
code = krb5_kt_end_seq_get(context, keytab, &cursor);
if (code) {
com_err(whoami, code, "while ending keytab scan");
- return code;
+ return;
}
/*
@@ -461,10 +461,7 @@
if (!did_something && mode == OLD) {
fprintf(stderr, "%s: There is only one entry for principal "
"%s in keytab %s\n", whoami, princ_str, keytab_str);
- return 1;
}
-
- return 0;
}
/*
More information about the cvs-krb5
mailing list