From: Ezra Peisach Date: Thu, 7 Nov 1996 16:46:23 +0000 (+0000) Subject: * client_principal.c (kadm5_get_principal, X-Git-Tag: krb5-1.0-freeze1~113 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4098d75a44e49e696dd7e07379c73862e242604e;p=krb5.git * client_principal.c (kadm5_get_principal, kadm5_modify_principal): For a V1 request, copy only the memory that is allocated for the incomming principal. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9312 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/kadm5/clnt/ChangeLog b/src/lib/kadm5/clnt/ChangeLog index 7ce511a41..1d1704968 100644 --- a/src/lib/kadm5/clnt/ChangeLog +++ b/src/lib/kadm5/clnt/ChangeLog @@ -1,3 +1,9 @@ +Thu Nov 7 11:41:08 1996 Ezra Peisach + + * client_principal.c (kadm5_get_principal, + kadm5_modify_principal): For a V1 request, copy only the + memory that is allocated for the incomming principal. + Fri Oct 4 08:38:16 1996 Ezra Peisach * client_principal.c (kadm5_randkey_principal): Do not assume that diff --git a/src/lib/kadm5/clnt/client_principal.c b/src/lib/kadm5/clnt/client_principal.c index 54ce1f30b..14cd55d80 100644 --- a/src/lib/kadm5/clnt/client_principal.c +++ b/src/lib/kadm5/clnt/client_principal.c @@ -25,13 +25,19 @@ kadm5_create_principal(void *server_handle, CHECK_HANDLE(server_handle); + memset(&arg, 0, sizeof(arg)); arg.mask = mask; arg.passwd = pw; arg.api_version = handle->api_version; if(princ == NULL) return EINVAL; - memcpy(&arg.rec, princ, sizeof(kadm5_principal_ent_rec)); + + if (handle->api_version == KADM5_API_VERSION_1) { + memcpy(&arg.rec, princ, sizeof(kadm5_principal_ent_rec_v1)); + } else { + memcpy(&arg.rec, princ, sizeof(kadm5_principal_ent_rec)); + } if (handle->api_version == KADM5_API_VERSION_1) { /* * hack hack cough cough. @@ -94,6 +100,7 @@ kadm5_modify_principal(void *server_handle, CHECK_HANDLE(server_handle); + memset(&arg, 0, sizeof(arg)); arg.mask = mask; arg.api_version = handle->api_version; /* @@ -102,7 +109,11 @@ kadm5_modify_principal(void *server_handle, */ if(princ == NULL) return EINVAL; - memcpy(&arg.rec, princ, sizeof(kadm5_principal_ent_rec)); + if (handle->api_version == KADM5_API_VERSION_1) { + memcpy(&arg.rec, princ, sizeof(kadm5_principal_ent_rec_v1)); + } else { + memcpy(&arg.rec, princ, sizeof(kadm5_principal_ent_rec)); + } if(!(mask & KADM5_POLICY)) arg.rec.policy = NULL; if (! (mask & KADM5_KEY_DATA)) {