Author: jra
Date: 2007-04-13 01:00:44 +0000 (Fri, 13 Apr 2007)
New Revision: 22206

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22206

Log:
Added boilerplate to be filled in for other validation functions.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c 2007-04-13 00:39:06 UTC 
(rev 22205)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_cache.c 2007-04-13 01:00:44 UTC 
(rev 22206)
@@ -2730,61 +2730,224 @@
 
 static int validate_loc_pol(TALLOC_CTX *mem_ctx, const char *keystr, TDB_DATA 
dbuf)
 {
+       struct cache_entry *centry = create_centry_validate(keystr, dbuf);
+
+       if (!centry) {
+               return 1;
+       }
+
+       (void)centry_nttime(centry);
+       (void)centry_nttime(centry);
+       (void)centry_uint16(centry);
+
+       centry_free(centry);
+
+       if (bad_cache_entry) {
+               return 1;
+       }
+       DEBUG(10,("validate_loc_pol: %s ok\n", keystr));
        return 0;
 }
 
 static int validate_pwd_pol(TALLOC_CTX *mem_ctx, const char *keystr, TDB_DATA 
dbuf)
 {
+       struct cache_entry *centry = create_centry_validate(keystr, dbuf);
+
+       if (!centry) {
+               return 1;
+       }
+
+       /* FIXME - fill in details here... */
+
+       centry_free(centry);
+
+       if (bad_cache_entry) {
+               return 1;
+       }
+       DEBUG(10,("validate_pwd_pol: %s ok\n", keystr));
        return 0;
 }
 
 static int validate_cred(TALLOC_CTX *mem_ctx, const char *keystr, TDB_DATA 
dbuf)
 {
+       struct cache_entry *centry = create_centry_validate(keystr, dbuf);
+
+       if (!centry) {
+               return 1;
+       }
+
+       /* FIXME - fill in details here... */
+
+       centry_free(centry);
+
+       if (bad_cache_entry) {
+               return 1;
+       }
+       DEBUG(10,("validate_cred: %s ok\n", keystr));
        return 0;
 }
 
 static int validate_ul(TALLOC_CTX *mem_ctx, const char *keystr, TDB_DATA dbuf)
 {
+       struct cache_entry *centry = create_centry_validate(keystr, dbuf);
+
+       if (!centry) {
+               return 1;
+       }
+
+       /* FIXME - fill in details here... */
+
+       centry_free(centry);
+
+       if (bad_cache_entry) {
+               return 1;
+       }
+       DEBUG(10,("validate_ul: %s ok\n", keystr));
        return 0;
 }
 
 static int validate_gl(TALLOC_CTX *mem_ctx, const char *keystr, TDB_DATA dbuf)
 {
+       struct cache_entry *centry = create_centry_validate(keystr, dbuf);
+
+       if (!centry) {
+               return 1;
+       }
+
+       /* FIXME - fill in details here... */
+
+       centry_free(centry);
+
+       if (bad_cache_entry) {
+               return 1;
+       }
+       DEBUG(10,("validate_gl: %s ok\n", keystr));
        return 0;
 }
 
 static int validate_ug(TALLOC_CTX *mem_ctx, const char *keystr, TDB_DATA dbuf)
 {
+       struct cache_entry *centry = create_centry_validate(keystr, dbuf);
+
+       if (!centry) {
+               return 1;
+       }
+
+       /* FIXME - fill in details here... */
+
+       centry_free(centry);
+
+       if (bad_cache_entry) {
+               return 1;
+       }
+       DEBUG(10,("validate_ug: %s ok\n", keystr));
        return 0;
 }
 
 static int validate_ua(TALLOC_CTX *mem_ctx, const char *keystr, TDB_DATA dbuf)
 {
+       struct cache_entry *centry = create_centry_validate(keystr, dbuf);
+
+       if (!centry) {
+               return 1;
+       }
+
+       /* FIXME - fill in details here... */
+
+       centry_free(centry);
+
+       if (bad_cache_entry) {
+               return 1;
+       }
+       DEBUG(10,("validate_ua: %s ok\n", keystr));
        return 0;
 }
 
 static int validate_gm(TALLOC_CTX *mem_ctx, const char *keystr, TDB_DATA dbuf)
 {
+       struct cache_entry *centry = create_centry_validate(keystr, dbuf);
+
+       if (!centry) {
+               return 1;
+       }
+
+       /* FIXME - fill in details here... */
+
+       centry_free(centry);
+
+       if (bad_cache_entry) {
+               return 1;
+       }
+       DEBUG(10,("validate_gm: %s ok\n", keystr));
        return 0;
 }
 
 static int validate_dr(TALLOC_CTX *mem_ctx, const char *keystr, TDB_DATA dbuf)
 {
+       struct cache_entry *centry = create_centry_validate(keystr, dbuf);
+
+       if (!centry) {
+               return 1;
+       }
+
+       /* FIXME - fill in details here... */
+
+       centry_free(centry);
+
+       if (bad_cache_entry) {
+               return 1;
+       }
+       DEBUG(10,("validate_dr: %s ok\n", keystr));
        return 0;
 }
 
 static int validate_de(TALLOC_CTX *mem_ctx, const char *keystr, TDB_DATA dbuf)
 {
+       struct cache_entry *centry = create_centry_validate(keystr, dbuf);
+
+       if (!centry) {
+               return 1;
+       }
+
+       /* FIXME - fill in details here... */
+
+       centry_free(centry);
+
+       if (bad_cache_entry) {
+               return 1;
+       }
+       DEBUG(10,("validate_de: %s ok\n", keystr));
        return 0;
 }
 
 static int validate_trustdoms(TALLOC_CTX *mem_ctx, const char *keystr, 
TDB_DATA dbuf)
 {
+       struct cache_entry *centry = create_centry_validate(keystr, dbuf);
+
+       if (!centry) {
+               return 1;
+       }
+
+       /* FIXME - fill in details here... */
+
+       centry_free(centry);
+
+       if (bad_cache_entry) {
+               return 1;
+       }
+       DEBUG(10,("validate_trustdoms: %s ok\n", keystr));
        return 0;
 }
 
 static int validate_offline(TALLOC_CTX *mem_ctx, const char *keystr, TDB_DATA 
dbuf)
 {
+       if (dbuf.dsize != 4) {
+               DEBUG(0,("validate_offline: Corrupt cache for key %s (len %u != 
4) ?\n",
+                               keystr, (unsigned int)dbuf.dsize ));
+               bad_cache_entry = True;
+               return 1;
+       }
+       DEBUG(10,("validate_offline: %s ok\n", keystr));
        return 0;
 }
 

Reply via email to