masking an assert error in Tim's wins server checking code; needs a proper fix after...
authorGerald Carter <jerry@samba.org>
Fri, 24 Jan 2003 21:20:31 +0000 (21:20 +0000)
committerGerald Carter <jerry@samba.org>
Fri, 24 Jan 2003 21:20:31 +0000 (21:20 +0000)
(This used to be commit 607bc0b4fca38640c6b5c730aa4119e2aa9006fc)

source3/lib/gencache.c

index d0748456f9c1db9151998721abed1e83c7fd7061..3ff67b9918c85b17d18af262ef0c65298877177d 100644 (file)
@@ -233,7 +233,9 @@ BOOL gencache_get(const char *keystr, char **valstr, time_t *timeout)
        TDB_DATA keybuf, databuf;
 
        /* fail completely if get null pointers passed */
+#if 0  /* JERRY */
        SMB_ASSERT(keystr && valstr && timeout);
+#endif
 
        if (!gencache_init())
                return False;
@@ -242,6 +244,15 @@ BOOL gencache_get(const char *keystr, char **valstr, time_t *timeout)
        keybuf.dsize = strlen(keystr);
        databuf = tdb_fetch(cache, keybuf);
        
+       /* special case for tpot */
+       if ( !valstr && !timeout ) {
+               BOOL result = False;
+               
+               result = (databuf.dptr == NULL);
+               SAFE_FREE(databuf.dptr);
+               return result;
+       }
+       
        if (databuf.dptr && databuf.dsize > TIMEOUT_LEN) {
                char* entry_buf = strndup(databuf.dptr, databuf.dsize);
                *valstr = (char*)malloc(sizeof(char) * (databuf.dsize - TIMEOUT_LEN));