Changeset 740 for vendor/current/source3/libsmb/samlogon_cache.c
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified vendor/current/source3/libsmb/samlogon_cache.c ¶
r414 r740 23 23 24 24 #include "includes.h" 25 #include "system/filesys.h" 25 26 #include "librpc/gen_ndr/ndr_krb5pac.h" 27 #include "../libcli/security/security.h" 28 #include "util_tdb.h" 26 29 27 30 #define NETSAMLOGON_TDB "netsamlogon_cache.tdb" … … 46 49 path = cache_path(NETSAMLOGON_TDB); 47 50 again: 48 tdb = tdb_open_log(path, 0, TDB_DEFAULT ,51 tdb = tdb_open_log(path, 0, TDB_DEFAULT|TDB_INCOMPATIBLE_HASH, 49 52 O_RDWR | O_CREAT, 0600); 50 53 if (tdb == NULL) { … … 70 73 71 74 DEBUG(0,("retry after CLEAR_IF_FIRST for '%s'\n", path)); 72 tdb = tdb_open_log(path, 0, TDB_CLEAR_IF_FIRST ,75 tdb = tdb_open_log(path, 0, TDB_CLEAR_IF_FIRST|TDB_INCOMPATIBLE_HASH, 73 76 O_RDWR | O_CREAT, 0600); 74 77 if (tdb) { … … 99 102 ***********************************************************************/ 100 103 101 void netsamlogon_clear_cached_user(struct netr_SamInfo3 *info3) 102 { 103 DOM_SID user_sid; 104 fstring keystr, tmp; 105 106 if (!info3) { 107 return; 108 } 104 void netsamlogon_clear_cached_user(const struct dom_sid *user_sid) 105 { 106 fstring keystr; 109 107 110 108 if (!netsamlogon_cache_init()) { … … 114 112 return; 115 113 } 116 sid_copy(&user_sid, info3->base.domain_sid);117 sid_append_rid(&user_sid, info3->base.rid);118 114 119 115 /* Prepare key as DOMAIN-SID/USER-RID string */ 120 s lprintf(keystr, sizeof(keystr), "%s", sid_to_fstring(tmp, &user_sid));116 sid_to_fstring(keystr, user_sid); 121 117 122 118 DEBUG(10,("netsamlogon_clear_cached_user: SID [%s]\n", keystr)); … … 133 129 { 134 130 TDB_DATA data; 135 fstring keystr , tmp;131 fstring keystr; 136 132 bool result = false; 137 DOM_SIDuser_sid;133 struct dom_sid user_sid; 138 134 time_t t = time(NULL); 139 135 TALLOC_CTX *mem_ctx; … … 152 148 } 153 149 154 sid_copy(&user_sid, info3->base.domain_sid); 155 sid_append_rid(&user_sid, info3->base.rid); 150 sid_compose(&user_sid, info3->base.domain_sid, info3->base.rid); 156 151 157 152 /* Prepare key as DOMAIN-SID/USER-RID string */ 158 s lprintf(keystr, sizeof(keystr), "%s", sid_to_fstring(tmp, &user_sid));153 sid_to_fstring(keystr, &user_sid); 159 154 160 155 DEBUG(10,("netsamlogon_cache_store: SID [%s]\n", keystr)); … … 181 176 } 182 177 183 ndr_err = ndr_push_struct_blob(&blob, mem_ctx, NULL,&r,178 ndr_err = ndr_push_struct_blob(&blob, mem_ctx, &r, 184 179 (ndr_push_flags_fn_t)ndr_push_netsamlogoncache_entry); 185 180 if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { … … 206 201 ***********************************************************************/ 207 202 208 struct netr_SamInfo3 *netsamlogon_cache_get(TALLOC_CTX *mem_ctx, const DOM_SID*user_sid)203 struct netr_SamInfo3 *netsamlogon_cache_get(TALLOC_CTX *mem_ctx, const struct dom_sid *user_sid) 209 204 { 210 205 struct netr_SamInfo3 *info3 = NULL; … … 237 232 blob = data_blob_const(data.dptr, data.dsize); 238 233 239 ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, NULL,&r,234 ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, &r, 240 235 (ndr_pull_flags_fn_t)ndr_pull_netsamlogoncache_entry); 241 236 … … 279 274 } 280 275 281 bool netsamlogon_cache_have(const DOM_SID*user_sid)276 bool netsamlogon_cache_have(const struct dom_sid *user_sid) 282 277 { 283 278 TALLOC_CTX *mem_ctx = talloc_init("netsamlogon_cache_have");
Note:
See TracChangeset
for help on using the changeset viewer.