r8511: This 'can't happen', but GCC gives warnings because it thinks it can.
authorAndrew Bartlett <abartlet@samba.org>
Sat, 16 Jul 2005 01:02:17 +0000 (01:02 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:29:33 +0000 (13:29 -0500)
Andrew Bartlett
(This used to be commit 40088b9566e8f63897958fc99d99dedb38e0cb69)

source4/kdc/hdb-ldb.c

index 1e99511792eede7aead012fa53421034ab406aa8..af93ea8f72f199fbf79461d573c30104adfeba5b 100644 (file)
@@ -725,7 +725,7 @@ static krb5_error_code LDB_fetch(krb5_context context, HDB *db, unsigned flags,
 
        const char *realm;
        const char *realm_dn;
-       TALLOC_CTX *mem_ctx = talloc_named(NULL, 0, "LDB_fetch context\n");
+       TALLOC_CTX *mem_ctx = talloc_named(NULL, 0, "LDB_fetch context");
 
        if (!mem_ctx) {
                krb5_set_error_string(context, "LDB_fetch: talloc_named() failed!");
@@ -737,7 +737,7 @@ static krb5_error_code LDB_fetch(krb5_context context, HDB *db, unsigned flags,
        ret = LDB_lookup_realm(context, (struct ldb_context *)db->hdb_db, 
                               mem_ctx, realm, &realm_msg);
        if (ret != 0) {
-               krb5_warnx(context, "LDB_fetch: could not find realm\n");
+               krb5_warnx(context, "LDB_fetch: could not find realm");
                talloc_free(mem_ctx);
                return HDB_ERR_NOENTRY;
        }
@@ -781,6 +781,10 @@ static krb5_error_code LDB_fetch(krb5_context context, HDB *db, unsigned flags,
        case HDB_ENT_TYPE_ANY:
                ldb_ent_type = HDB_LDB_ENT_TYPE_ANY;
                break;
+       default:
+               krb5_warnx(context, "LDB_fetch: invalid ent_type specified!");
+               talloc_free(mem_ctx);
+               return HDB_ERR_NOENTRY;
        }
 
        ret = LDB_lookup_principal(context, (struct ldb_context *)db->hdb_db,