From 7d671504192ddcd7006ba9636d9334bcc744bdbc Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Fri, 8 Jun 2001 15:53:45 +0000 Subject: [PATCH] * tcl_kadm5.c: Cleanup assignments in conditionals * test.c: Add prototype for Tcl_ovsec_kadm_init() and Tcl_kadm5_init(). git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13308 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kadmin/testing/util/ChangeLog | 6 ++++++ src/kadmin/testing/util/tcl_kadm5.c | 23 +++++++++++------------ src/kadmin/testing/util/test.c | 4 ++++ 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/src/kadmin/testing/util/ChangeLog b/src/kadmin/testing/util/ChangeLog index 4f9acd1f1..6fcb79c8e 100644 --- a/src/kadmin/testing/util/ChangeLog +++ b/src/kadmin/testing/util/ChangeLog @@ -1,3 +1,9 @@ +2001-06-08 Ezra Peisach + + * tcl_kadm5.c: Cleanup assignments in conditionals. + + * test.c: Add prototype for Tcl_ovsec_kadm_init() and Tcl_kadm5_init(). + 2001-04-25 Ezra Peisach * tcl_kadm5.c, tcl_ovsec_kadm.c: Cleanup of assignments in diff --git a/src/kadmin/testing/util/tcl_kadm5.c b/src/kadmin/testing/util/tcl_kadm5.c index a103e9abe..73ddd31d4 100644 --- a/src/kadmin/testing/util/tcl_kadm5.c +++ b/src/kadmin/testing/util/tcl_kadm5.c @@ -839,7 +839,7 @@ static int parse_key_data(Tcl_Interp *interp, char *list, char **argv; int argc, retcode; - *key_data == NULL; + *key_data = NULL; if (list == NULL) { if (n_key_data != 0) { sprintf(interp->result, "0 key_datas specified, " @@ -879,7 +879,7 @@ static int parse_tl_data(Tcl_Interp *interp, char *list, char **argv, **argv1 = NULL; int i, tmp, argc, argc1, retcode; - *tlp == NULL; + *tlp = NULL; if (list == NULL) { if (n_tl_data != 0) { sprintf(interp->result, "0 tl_datas specified, " @@ -1831,13 +1831,13 @@ int tcl_kadm5_rename_principal(ClientData clientData, Tcl_Interp *interp, GET_HANDLE(2, 0); - if (krb5_ret = krb5_parse_name(context, argv[0], &source)) { + if ((krb5_ret = krb5_parse_name(context, argv[0], &source)) != 0) { stash_error(interp, krb5_ret); Tcl_AppendElement(interp, "while parsing source"); return TCL_ERROR; } - if (krb5_ret = krb5_parse_name(context, argv[1], &target)) { + if ((krb5_ret = krb5_parse_name(context, argv[1], &target)) != 0) { stash_error(interp, krb5_ret); Tcl_AppendElement(interp, "while parsing target"); krb5_free_principal(context, source); @@ -1876,7 +1876,7 @@ int tcl_kadm5_chpass_principal(ClientData clientData, Tcl_Interp *interp, GET_HANDLE(2, 0); - if (krb5_ret = krb5_parse_name(context, argv[0], &princ)) { + if ((krb5_ret = krb5_parse_name(context, argv[0], &princ)) != 0) { stash_error(interp, krb5_ret); Tcl_AppendElement(interp, "while parsing principal name"); return TCL_ERROR; @@ -1936,7 +1936,7 @@ int tcl_kadm5_chpass_principal_util(ClientData clientData, GET_HANDLE(4, 0); - if (krb5_ret = krb5_parse_name(context, argv[0], &princ)) { + if ((krb5_ret = krb5_parse_name(context, argv[0], &princ)) != 0) { stash_error(interp, krb5_ret); Tcl_AppendElement(interp, "while parsing principal name"); return TCL_ERROR; @@ -2020,7 +2020,7 @@ int tcl_kadm5_randkey_principal(ClientData clientData, Tcl_Interp *interp, GET_HANDLE(3, 0); - if (krb5_ret = krb5_parse_name(context, argv[0], &princ)) { + if ((krb5_ret = krb5_parse_name(context, argv[0], &princ)) != 0) { stash_error(interp, krb5_ret); Tcl_AppendElement(interp, "while parsing principal name"); return TCL_ERROR; @@ -2098,7 +2098,7 @@ int tcl_kadm5_get_principal(ClientData clientData, Tcl_Interp *interp, if((tcl_ret = parse_str(interp, argv[0], &name)) != TCL_OK) return tcl_ret; if(name != NULL) { - if (krb5_ret = krb5_parse_name(context, name, &princ)) { + if ((krb5_ret = krb5_parse_name(context, name, &princ)) != 0) { stash_error(interp, ret); Tcl_AppendElement(interp, "while parsing principal name"); return TCL_ERROR; @@ -2204,8 +2204,6 @@ finished: int tcl_kadm5_delete_policy(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[]) { - krb5_principal princ; - krb5_error_code krb5_ret; kadm5_ret_t ret; char *policy; int tcl_ret; @@ -2381,7 +2379,8 @@ int tcl_kadm5_free_principal_ent(ClientData clientData, ent = (kadm5_principal_ent_t) Tcl_GetHashValue(entry); - if (ret = kadm5_free_principal_ent(server_handle, ent)) { + ret = kadm5_free_principal_ent(server_handle, ent); + if (ret != KADM5_OK) { stash_error(interp, ret); return TCL_ERROR; } @@ -2437,7 +2436,7 @@ int tcl_kadm5_free_policy_ent(ClientData clientData, ent = (kadm5_policy_ent_t) Tcl_GetHashValue(entry); - if (ret = kadm5_free_policy_ent(server_handle, ent)) { + if ((ret = kadm5_free_policy_ent(server_handle, ent)) != KADM5_OK) { stash_error(interp, ret); return TCL_ERROR; } diff --git a/src/kadmin/testing/util/test.c b/src/kadmin/testing/util/test.c index 702f683cd..1627b113c 100644 --- a/src/kadmin/testing/util/test.c +++ b/src/kadmin/testing/util/test.c @@ -27,6 +27,10 @@ extern int main(); int *tclDummyMainPtr = (int *) main; #endif +/* No header files... sigh... */ +extern void Tcl_ovsec_kadm_init(Tcl_Interp *interp); +extern void Tcl_kadm5_init(Tcl_Interp *interp); + int Tcl_AppInit(Tcl_Interp *interp) { Tcl_ovsec_kadm_init(interp); -- 2.26.2