diff options
author | Volker Lendecke <vl@samba.org> | 2009-05-10 19:17:37 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2009-06-14 11:25:47 +0200 |
commit | 0834574fdd6b469797b3b6a4edd45f321b9b9971 (patch) | |
tree | 78b9c5231192f868a076838a42fd2b820ae5e77d /source3/winbindd/winbindd_cache.c | |
parent | 9b06c27cdb5f896cfd92eb103132cee258b87ca1 (diff) | |
download | samba-0834574fdd6b469797b3b6a4edd45f321b9b9971.tar.gz samba-0834574fdd6b469797b3b6a4edd45f321b9b9971.tar.bz2 samba-0834574fdd6b469797b3b6a4edd45f321b9b9971.zip |
Remove some unused code
Diffstat (limited to 'source3/winbindd/winbindd_cache.c')
-rw-r--r-- | source3/winbindd/winbindd_cache.c | 109 |
1 files changed, 0 insertions, 109 deletions
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c index e5a72cbfd9..3913d965ca 100644 --- a/source3/winbindd/winbindd_cache.c +++ b/source3/winbindd/winbindd_cache.c @@ -2617,115 +2617,6 @@ void close_winbindd_cache(void) } } -void cache_store_response(pid_t pid, struct winbindd_response *response) -{ - fstring key_str; - - if (!init_wcache()) - return; - - DEBUG(10, ("Storing response for pid %d, len %d\n", - (int)pid, response->length)); - - fstr_sprintf(key_str, "DR/%d", (int)pid); - if (tdb_store(wcache->tdb, string_tdb_data(key_str), - make_tdb_data((uint8 *)response, sizeof(*response)), - TDB_REPLACE) == -1) - return; - - if (response->length == sizeof(*response)) - return; - - /* There's extra data */ - - DEBUG(10, ("Storing extra data: len=%d\n", - (int)(response->length - sizeof(*response)))); - - fstr_sprintf(key_str, "DE/%d", (int)pid); - if (tdb_store(wcache->tdb, string_tdb_data(key_str), - make_tdb_data((uint8 *)response->extra_data.data, - response->length - sizeof(*response)), - TDB_REPLACE) == 0) - return; - - /* We could not store the extra data, make sure the tdb does not - * contain a main record with wrong dangling extra data */ - - fstr_sprintf(key_str, "DR/%d", (int)pid); - tdb_delete(wcache->tdb, string_tdb_data(key_str)); - - return; -} - -bool cache_retrieve_response(pid_t pid, struct winbindd_response * response) -{ - TDB_DATA data; - fstring key_str; - - if (!init_wcache()) - return false; - - DEBUG(10, ("Retrieving response for pid %d\n", (int)pid)); - - fstr_sprintf(key_str, "DR/%d", (int)pid); - data = tdb_fetch(wcache->tdb, string_tdb_data(key_str)); - - if (data.dptr == NULL) - return false; - - if (data.dsize != sizeof(*response)) - return false; - - memcpy(response, data.dptr, data.dsize); - SAFE_FREE(data.dptr); - - if (response->length == sizeof(*response)) { - response->extra_data.data = NULL; - return true; - } - - /* There's extra data */ - - DEBUG(10, ("Retrieving extra data length=%d\n", - (int)(response->length - sizeof(*response)))); - - fstr_sprintf(key_str, "DE/%d", (int)pid); - data = tdb_fetch(wcache->tdb, string_tdb_data(key_str)); - - if (data.dptr == NULL) { - DEBUG(0, ("Did not find extra data\n")); - return false; - } - - if (data.dsize != (response->length - sizeof(*response))) { - DEBUG(0, ("Invalid extra data length: %d\n", (int)data.dsize)); - SAFE_FREE(data.dptr); - return false; - } - - dump_data(11, (uint8 *)data.dptr, data.dsize); - - response->extra_data.data = data.dptr; - return true; -} - -void cache_cleanup_response(pid_t pid) -{ - fstring key_str; - - if (!init_wcache()) - return; - - fstr_sprintf(key_str, "DR/%d", (int)pid); - tdb_delete(wcache->tdb, string_tdb_data(key_str)); - - fstr_sprintf(key_str, "DE/%d", (int)pid); - tdb_delete(wcache->tdb, string_tdb_data(key_str)); - - return; -} - - bool lookup_cached_sid(TALLOC_CTX *mem_ctx, const DOM_SID *sid, char **domain_name, char **name, enum lsa_SidType *type) |