]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
winbindd_cache: add missing validation function for pwinfo cache entry
authorMichael Adam <obnox@samba.org>
Sat, 29 Mar 2008 00:05:17 +0000 (01:05 +0100)
committerMichael Adam <obnox@samba.org>
Sat, 29 Mar 2008 01:10:41 +0000 (02:10 +0100)
Michael

source/winbindd/winbindd_cache.c

index a8a98e5bc8713ac5924227b069c66699d1cba63d..0f8bd49d0684f7a532367f3eab0bd8281b2e0250 100644 (file)
@@ -3209,6 +3209,29 @@ static int validate_de(TALLOC_CTX *mem_ctx, const char *keystr, TDB_DATA dbuf,
        return 0;
 }
 
+static int validate_pwinfo(TALLOC_CTX *mem_ctx, const char *keystr,
+                          TDB_DATA dbuf, struct tdb_validation_status *state)
+{
+       struct cache_entry *centry = create_centry_validate(keystr, dbuf, state);
+
+       if (!centry) {
+               return 1;
+       }
+
+       (void)centry_string(centry, mem_ctx);
+       (void)centry_string(centry, mem_ctx);
+       (void)centry_string(centry, mem_ctx);
+       (void)centry_uint32(centry);
+
+       centry_free(centry);
+
+       if (!(state->success)) {
+               return 1;
+       }
+       DEBUG(10,("validate_pwinfo: %s ok\n", keystr));
+       return 0;
+}
+
 static int validate_trustdoms(TALLOC_CTX *mem_ctx, const char *keystr, TDB_DATA dbuf,
                              struct tdb_validation_status *state)
 {
@@ -3307,6 +3330,7 @@ struct key_val_struct {
        {"GM/", validate_gm},
        {"DR/", validate_dr},
        {"DE/", validate_de},
+       {"NSS/PWINFO/", validate_pwinfo},
        {"TRUSTDOMS/", validate_trustdoms},
        {"TRUSTDOMCACHE/", validate_trustdomcache},
        {"WINBINDD_OFFLINE", validate_offline},