ret.code = KADM5_FAILURE;
return &ret;
}
- krb5_unparse_name(handle->context, arg->rec.principal, &prime_arg);
+ if (krb5_unparse_name(handle->context, arg->rec.principal, &prime_arg)) {
+ ret.code = KADM5_BAD_PRINCIPAL;
+ return &ret;
+ }
if (CHANGEPW_SERVICE(rqstp)
|| !acl_check(handle->context, rqstp->rq_clntcred, ACL_ADD,
ret.code = KADM5_FAILURE;
return &ret;
}
- krb5_unparse_name(handle->context, arg->rec.principal, &prime_arg);
+ if (krb5_unparse_name(handle->context, arg->rec.principal, &prime_arg)) {
+ ret.code = KADM5_BAD_PRINCIPAL;
+ return &ret;
+ }
if (CHANGEPW_SERVICE(rqstp)
|| !acl_check(handle->context, rqstp->rq_clntcred, ACL_ADD,
ret.code = KADM5_FAILURE;
return &ret;
}
- krb5_unparse_name(handle->context, arg->princ, &prime_arg);
+ if (krb5_unparse_name(handle->context, arg->princ, &prime_arg)) {
+ ret.code = KADM5_BAD_PRINCIPAL;
+ return &ret;
+ }
if (CHANGEPW_SERVICE(rqstp)
|| !acl_check(handle->context, rqstp->rq_clntcred, ACL_DELETE,
ret.code = KADM5_FAILURE;
return &ret;
}
- krb5_unparse_name(handle->context, arg->rec.principal, &prime_arg);
+ if (krb5_unparse_name(handle->context, arg->rec.principal, &prime_arg)) {
+ ret.code = KADM5_BAD_PRINCIPAL;
+ return &ret;
+ }
if (CHANGEPW_SERVICE(rqstp)
|| !acl_check(handle->context, rqstp->rq_clntcred, ACL_MODIFY,
ret.code = KADM5_FAILURE;
return &ret;
}
- krb5_unparse_name(handle->context, arg->src, &prime_arg1);
- krb5_unparse_name(handle->context, arg->dest, &prime_arg2);
+ if (krb5_unparse_name(handle->context, arg->src, &prime_arg1) ||
+ krb5_unparse_name(handle->context, arg->dest, &prime_arg2)) {
+ ret.code = KADM5_BAD_PRINCIPAL;
+ return &ret;
+ }
sprintf(prime_arg, "%s to %s", prime_arg1, prime_arg2);
ret.code = KADM5_OK;
ret.code = KADM5_FAILURE;
return &ret;
}
- krb5_unparse_name(handle->context, arg->princ, &prime_arg);
+ if (krb5_unparse_name(handle->context, arg->princ, &prime_arg)) {
+ ret.code = KADM5_BAD_PRINCIPAL;
+ return &ret;
+ }
if (! cmp_gss_krb5_name(handle, rqstp->rq_clntcred, arg->princ) &&
(CHANGEPW_SERVICE(rqstp) || !acl_check(handle->context,
ret.code = KADM5_FAILURE;
return &ret;
}
- krb5_unparse_name(handle->context, arg->princ, &prime_arg);
+ if (krb5_unparse_name(handle->context, arg->princ, &prime_arg)) {
+ ret.code = KADM5_BAD_PRINCIPAL;
+ return &ret;
+ }
if (cmp_gss_krb5_name(handle, rqstp->rq_clntcred, arg->princ)) {
ret.code = chpass_principal_wrapper((void *)handle, arg->princ,
ret.code = KADM5_FAILURE;
return &ret;
}
- krb5_unparse_name(handle->context, arg->princ, &prime_arg);
+ if (krb5_unparse_name(handle->context, arg->princ, &prime_arg)) {
+ ret.code = KADM5_BAD_PRINCIPAL;
+ return &ret;
+ }
if (cmp_gss_krb5_name(handle, rqstp->rq_clntcred, arg->princ)) {
ret.code = chpass_principal_wrapper((void *)handle, arg->princ,
ret.code = KADM5_FAILURE;
return &ret;
}
- krb5_unparse_name(handle->context, arg->princ, &prime_arg);
+ if (krb5_unparse_name(handle->context, arg->princ, &prime_arg)) {
+ ret.code = KADM5_BAD_PRINCIPAL;
+ return &ret;
+ }
if (!(CHANGEPW_SERVICE(rqstp)) &&
acl_check(handle->context, rqstp->rq_clntcred,
ret.code = KADM5_FAILURE;
return &ret;
}
- krb5_unparse_name(handle->context, arg->princ, &prime_arg);
+ if (krb5_unparse_name(handle->context, arg->princ, &prime_arg)) {
+ ret.code = KADM5_BAD_PRINCIPAL;
+ return &ret;
+ }
if (!(CHANGEPW_SERVICE(rqstp)) &&
acl_check(handle->context, rqstp->rq_clntcred,
ret.code = KADM5_FAILURE;
return &ret;
}
- krb5_unparse_name(handle->context, arg->princ, &prime_arg);
+ if (krb5_unparse_name(handle->context, arg->princ, &prime_arg)) {
+ ret.code = KADM5_BAD_PRINCIPAL;
+ return &ret;
+ }
if (!(CHANGEPW_SERVICE(rqstp)) &&
acl_check(handle->context, rqstp->rq_clntcred,
free_server_handle(handle);
return &ret;
}
- krb5_unparse_name(handle->context, arg->princ, &prime_arg);
+ if (krb5_unparse_name(handle->context, arg->princ, &prime_arg)) {
+ ret.code = KADM5_BAD_PRINCIPAL;
+ return &ret;
+ }
if (cmp_gss_krb5_name(handle, rqstp->rq_clntcred, arg->princ)) {
ret.code = randkey_principal_wrapper((void *)handle,
free_server_handle(handle);
return &ret;
}
- krb5_unparse_name(handle->context, arg->princ, &prime_arg);
+ if (krb5_unparse_name(handle->context, arg->princ, &prime_arg)) {
+ ret.code = KADM5_BAD_PRINCIPAL;
+ return &ret;
+ }
if (cmp_gss_krb5_name(handle, rqstp->rq_clntcred, arg->princ)) {
ret.code = randkey_principal_wrapper((void *)handle,