diff options
| author | Greg Hudson <ghudson@mit.edu> | 2012-11-17 20:24:11 -0500 |
|---|---|---|
| committer | Greg Hudson <ghudson@mit.edu> | 2012-12-20 11:35:42 -0500 |
| commit | 7ee7399056a201d20315c2ce6650330a7d5c9177 (patch) | |
| tree | 4b079398ddf4e21f088f5797b1196af887b59f30 /src/plugins/kdb/ldap | |
| parent | cde9eaa11a8b7528c2ca736fceb746a847cc8688 (diff) | |
| download | krb5-7ee7399056a201d20315c2ce6650330a7d5c9177.tar.gz krb5-7ee7399056a201d20315c2ce6650330a7d5c9177.tar.xz krb5-7ee7399056a201d20315c2ce6650330a7d5c9177.zip | |
Remove unneeded code in krb5_ldap_put_principal
krb5_ldap_put_principal contained some conditionals for the case where
entry->princ is NULL, but only after entry->princ was dereferenced
unconditionally. It's not necessary to handle this case, so don't.
Diffstat (limited to 'src/plugins/kdb/ldap')
| -rw-r--r-- | src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c b/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c index c386a9ea9..00fbce184 100644 --- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c +++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_principal2.c @@ -531,15 +531,13 @@ krb5_ldap_put_principal(krb5_context context, krb5_db_entry *entry, } /* get the principal information to act on */ - if (entry->princ) { - if (((st=krb5_unparse_name(context, entry->princ, &user)) != 0) || - ((st=krb5_ldap_unparse_principal_name(user)) != 0)) - goto cleanup; - filtuser = ldap_filter_correct(user); - if (filtuser == NULL) { - st = ENOMEM; - goto cleanup; - } + if (((st=krb5_unparse_name(context, entry->princ, &user)) != 0) || + ((st=krb5_ldap_unparse_principal_name(user)) != 0)) + goto cleanup; + filtuser = ldap_filter_correct(user); + if (filtuser == NULL) { + st = ENOMEM; + goto cleanup; } /* Identity the type of operation, it can be @@ -570,14 +568,6 @@ krb5_ldap_put_principal(krb5_context context, krb5_db_entry *entry, * krbprincipalname attribute is unique (only one object entry has * a particular krbprincipalname attribute). */ - if (user == NULL) { - /* must have principal name for search */ - st = EINVAL; - krb5_set_error_message(context, st, - _("operation can not continue, principal " - "name not found")); - goto cleanup; - } if (asprintf(&filter, FILTER"%s))", filtuser) < 0) { filter = NULL; st = ENOMEM; |
