From 8eed0d0aef3d03f247def819ca1eb23bddf767e1 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 27 Aug 2004 23:01:56 +0000 Subject: [PATCH] Finally applied patch from Nalin Dahyabhai at Red Hat to fix 0/NULL bugs in variadic argument lists to krb5_build_principal{,_ext}. Skipped the stylistic patches that removed casts of NULL. tag: 1850 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16693 dc483132-0cff-0310-8789-dd5450dbe970 --- src/appl/gssftp/ftpd/ChangeLog | 6 ++++++ src/appl/gssftp/ftpd/ftpd.c | 2 +- src/kadmin/dbutil/ChangeLog | 6 ++++++ src/kadmin/dbutil/loadv4.c | 6 +++--- src/lib/krb5/ccache/ChangeLog | 6 ++++++ src/lib/krb5/ccache/t_cc.c | 4 ++-- src/lib/krb5/krb/ChangeLog | 6 ++++++ src/lib/krb5/krb/conv_princ.c | 2 +- 8 files changed, 31 insertions(+), 7 deletions(-) diff --git a/src/appl/gssftp/ftpd/ChangeLog b/src/appl/gssftp/ftpd/ChangeLog index 1112b3fd0..8038333cb 100644 --- a/src/appl/gssftp/ftpd/ChangeLog +++ b/src/appl/gssftp/ftpd/ChangeLog @@ -1,3 +1,9 @@ +2004-08-27 Ken Raeburn + + * ftpd.c (ftpd_gss_convert_creds): Terminate argument list to + krb5_build_principal_ext with 0, not NULL. Patch from Nalin + Dahyabhai. + 2004-08-27 Sam Hartman * ftpd.c (passwd;): Patch from Garry Zacheiss to use diff --git a/src/appl/gssftp/ftpd/ftpd.c b/src/appl/gssftp/ftpd/ftpd.c index eabc74fbb..6048278d7 100644 --- a/src/appl/gssftp/ftpd/ftpd.c +++ b/src/appl/gssftp/ftpd/ftpd.c @@ -2954,7 +2954,7 @@ ftpd_gss_convert_creds(name, creds) 6, "krbtgt", krb5_princ_realm(kcontext, me)->length, krb5_princ_realm(kcontext, me)->data, - NULL)) + 0)) goto cleanup; memset((char *) &increds, 0, sizeof(increds)); diff --git a/src/kadmin/dbutil/ChangeLog b/src/kadmin/dbutil/ChangeLog index 6dee87865..374052d4f 100644 --- a/src/kadmin/dbutil/ChangeLog +++ b/src/kadmin/dbutil/ChangeLog @@ -1,3 +1,9 @@ +2004-08-27 Ken Raeburn + + * loadv4.c (enter_in_v5_db): Terminate argument list of + krb5_build_principal with NULL, not 0. Patch from Nalin + Dahyabhai. + 2004-06-15 Tom Yu * kadm5_create.c (add_admin_princs): Create kadmin/fqdn diff --git a/src/kadmin/dbutil/loadv4.c b/src/kadmin/dbutil/loadv4.c index 07bc27645..672db584b 100644 --- a/src/kadmin/dbutil/loadv4.c +++ b/src/kadmin/dbutil/loadv4.c @@ -540,8 +540,8 @@ Principal *princ; retval = krb5_build_principal(context, &mod_princ, strlen(realm), realm, princ->mod_name, princ->mod_instance[0] ? - princ->mod_instance : 0, - 0); + princ->mod_instance : NULL, + NULL); if (retval) { krb5_free_principal(context, entry.princ); return retval; @@ -607,7 +607,7 @@ Principal *princ; retval = krb5_build_principal(context, &entry.princ, strlen(princ->instance), princ->instance, - "krbtgt", realm, 0); + "krbtgt", realm, NULL); if (retval) return retval; retval = krb5_db_put_principal(context, &entry, &nentries); diff --git a/src/lib/krb5/ccache/ChangeLog b/src/lib/krb5/ccache/ChangeLog index 59a195259..dbf0a8b5b 100644 --- a/src/lib/krb5/ccache/ChangeLog +++ b/src/lib/krb5/ccache/ChangeLog @@ -1,3 +1,9 @@ +2004-08-27 Ken Raeburn + + * t_cc.c (init_test_cred): Terminate argument list to + krb5_build_principal with NULL, not 0. Patch from Nalin + Dahyabhai. + 2004-08-15 Ken Raeburn * cc_file.c (struct _krb5_fcc_data): Add new mutex diff --git a/src/lib/krb5/ccache/t_cc.c b/src/lib/krb5/ccache/t_cc.c index 0e7ae84d6..6559fb2bd 100644 --- a/src/lib/krb5/ccache/t_cc.c +++ b/src/lib/krb5/ccache/t_cc.c @@ -84,10 +84,10 @@ static void init_test_cred(krb5_context context) { #define REALM "REALM" krb5_build_principal(context, &test_creds.client, sizeof(REALM), REALM, - "client-comp1", "client-comp2", 0); + "client-comp1", "client-comp2", NULL); krb5_build_principal(context, &test_creds.server, sizeof(REALM), REALM, - "server-comp1", "server-comp2", 0); + "server-comp1", "server-comp2", NULL); } static void free_test_cred(krb5_context context) diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 1e284cce0..84092f11e 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,9 @@ +2004-08-27 Ken Raeburn + + * conv_princ.c (krb5_425_conv_principal): Terminate argument list + to krb5_build_principal with NULL, not 0. Patch from Nalin + Dahyabhai. + 2004-08-12 Alexandra Ellwood * get_in_tkt.c (get_init_creds): diff --git a/src/lib/krb5/krb/conv_princ.c b/src/lib/krb5/krb/conv_princ.c index 6134baa0a..885dc995a 100644 --- a/src/lib/krb5/krb/conv_princ.c +++ b/src/lib/krb5/krb/conv_princ.c @@ -342,7 +342,7 @@ krb5_425_conv_principal(krb5_context context, const char *name, const char *inst not_service: retval = krb5_build_principal(context, princ, strlen(realm), realm, name, - instance, 0); + instance, NULL); if (iterator) profile_iterator_free (&iterator); if (full_name) profile_free_list(full_name); if (v4realms) profile_free_list(v4realms); -- 2.26.2