diff options
Diffstat (limited to 'source3/winbindd')
-rw-r--r-- | source3/winbindd/idmap_ad.c | 3 | ||||
-rw-r--r-- | source3/winbindd/idmap_ldap.c | 3 | ||||
-rw-r--r-- | source3/winbindd/wb_getgrsid.c | 3 | ||||
-rw-r--r-- | source3/winbindd/winbindd_cache.c | 36 | ||||
-rw-r--r-- | source3/winbindd/winbindd_proto.h | 1 | ||||
-rw-r--r-- | source3/winbindd/winbindd_rpc.c | 5 | ||||
-rw-r--r-- | source3/winbindd/winbindd_util.c | 7 |
7 files changed, 17 insertions, 41 deletions
diff --git a/source3/winbindd/idmap_ad.c b/source3/winbindd/idmap_ad.c index 3d47baadc9..f2e47a7042 100644 --- a/source3/winbindd/idmap_ad.c +++ b/source3/winbindd/idmap_ad.c @@ -33,6 +33,7 @@ #include "nss_info.h" #include "secrets.h" #include "idmap.h" +#include "../libcli/security/dom_sid.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_IDMAP @@ -266,7 +267,7 @@ static struct id_map *find_map_by_sid(struct id_map **maps, struct dom_sid *sid) int i; for (i = 0; maps[i] && i<IDMAP_AD_MAX_IDS; i++) { - if (sid_equal(maps[i]->sid, sid)) { + if (dom_sid_equal(maps[i]->sid, sid)) { return maps[i]; } } diff --git a/source3/winbindd/idmap_ldap.c b/source3/winbindd/idmap_ldap.c index 39df489be7..dcdc14f277 100644 --- a/source3/winbindd/idmap_ldap.c +++ b/source3/winbindd/idmap_ldap.c @@ -28,6 +28,7 @@ #include "secrets.h" #include "idmap.h" #include "idmap_rw.h" +#include "../libcli/security/dom_sid.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_IDMAP @@ -1030,7 +1031,7 @@ static struct id_map *find_map_by_sid(struct id_map **maps, struct dom_sid *sid) if (maps[i] == NULL) { /* end of the run */ return NULL; } - if (sid_equal(maps[i]->sid, sid)) { + if (dom_sid_equal(maps[i]->sid, sid)) { return maps[i]; } } diff --git a/source3/winbindd/wb_getgrsid.c b/source3/winbindd/wb_getgrsid.c index bb93be2174..8accc639af 100644 --- a/source3/winbindd/wb_getgrsid.c +++ b/source3/winbindd/wb_getgrsid.c @@ -20,6 +20,7 @@ #include "includes.h" #include "winbindd.h" #include "librpc/gen_ndr/cli_wbint.h" +#include "../libcli/security/dom_sid.h" struct wb_getgrsid_state { struct tevent_context *ev; @@ -55,7 +56,7 @@ struct tevent_req *wb_getgrsid_send(TALLOC_CTX *mem_ctx, if (lp_winbind_trusted_domains_only()) { struct winbindd_domain *our_domain = find_our_domain(); - if (sid_compare_domain(group_sid, &our_domain->sid) == 0) { + if (dom_sid_compare_domain(group_sid, &our_domain->sid) == 0) { DEBUG(7, ("winbindd_getgrsid: My domain -- rejecting " "getgrsid() for %s\n", sid_string_tos(group_sid))); tevent_req_nterror(req, NT_STATUS_NO_SUCH_GROUP); diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c index 9c48c71aa2..c2ce0a2713 100644 --- a/source3/winbindd/winbindd_cache.c +++ b/source3/winbindd/winbindd_cache.c @@ -30,6 +30,7 @@ #include "../librpc/gen_ndr/ndr_wbint.h" #include "ads.h" #include "nss_info.h" +#include "../libcli/security/dom_sid.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_WINBIND @@ -105,35 +106,6 @@ void (*smb_panic_fn)(const char *const why) = smb_panic; static struct winbind_cache *wcache; -void winbindd_check_cache_size(time_t t) -{ - static time_t last_check_time; - struct stat st; - - if (last_check_time == (time_t)0) - last_check_time = t; - - if (t - last_check_time < 60 && t - last_check_time > 0) - return; - - if (wcache == NULL || wcache->tdb == NULL) { - DEBUG(0, ("Unable to check size of tdb cache - cache not open !\n")); - return; - } - - if (fstat(tdb_fd(wcache->tdb), &st) == -1) { - DEBUG(0, ("Unable to check size of tdb cache %s!\n", strerror(errno) )); - return; - } - - if (st.st_size > WINBINDD_MAX_CACHE_SIZE) { - DEBUG(10,("flushing cache due to size (%lu) > (%lu)\n", - (unsigned long)st.st_size, - (unsigned long)WINBINDD_MAX_CACHE_SIZE)); - wcache_flush_cache(); - } -} - /* get the winbind_cache structure */ static struct winbind_cache *get_cache(struct winbindd_domain *domain) { @@ -147,7 +119,7 @@ static struct winbind_cache *get_cache(struct winbindd_domain *domain) } if (strequal(domain->name, get_global_sam_name()) && - sid_equal(&domain->sid, get_global_sam_sid())) { + dom_sid_equal(&domain->sid, get_global_sam_sid())) { domain->backend = &sam_passdb_methods; domain->initialized = True; } @@ -673,7 +645,7 @@ static struct cache_entry *wcache_fetch_raw(char *kstr) static bool is_my_own_sam_domain(struct winbindd_domain *domain) { if (strequal(domain->name, get_global_sam_name()) && - sid_equal(&domain->sid, get_global_sam_sid())) { + dom_sid_equal(&domain->sid, get_global_sam_sid())) { return true; } @@ -683,7 +655,7 @@ static bool is_my_own_sam_domain(struct winbindd_domain *domain) static bool is_builtin_domain(struct winbindd_domain *domain) { if (strequal(domain->name, "BUILTIN") && - sid_equal(&domain->sid, &global_sid_Builtin)) { + dom_sid_equal(&domain->sid, &global_sid_Builtin)) { return true; } diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h index ae6401379a..f43c08f417 100644 --- a/source3/winbindd/winbindd_proto.h +++ b/source3/winbindd/winbindd_proto.h @@ -81,7 +81,6 @@ bool parse_sidlist(TALLOC_CTX *mem_ctx, const char *sidstr, /* The following definitions come from winbindd/winbindd_cache.c */ -void winbindd_check_cache_size(time_t t); struct cache_entry *centry_start(struct winbindd_domain *domain, NTSTATUS status); NTSTATUS wcache_cached_creds_exist(struct winbindd_domain *domain, const struct dom_sid *sid); NTSTATUS wcache_get_creds(struct winbindd_domain *domain, diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c index 80f7bb69bf..3ceaa67b7e 100644 --- a/source3/winbindd/winbindd_rpc.c +++ b/source3/winbindd/winbindd_rpc.c @@ -33,6 +33,7 @@ #include "librpc/gen_ndr/srv_lsa.h" #include "rpc_client/cli_samr.h" #include "rpc_client/cli_lsarpc.h" +#include "../libcli/security/dom_sid.h" /* Query display info for a domain */ NTSTATUS rpc_query_user_list(TALLOC_CTX *mem_ctx, @@ -612,7 +613,7 @@ NTSTATUS rpc_lookup_useraliases(TALLOC_CTX *mem_ctx, } for (i = 0; i < num_query_sids; i++) { - sid_array.sids[i].sid = sid_dup_talloc(mem_ctx, &sids[total_sids++]); + sid_array.sids[i].sid = dom_sid_dup(mem_ctx, &sids[total_sids++]); if (sid_array.sids[i].sid == NULL) { return NT_STATUS_NO_MEMORY; } @@ -739,7 +740,7 @@ NTSTATUS rpc_lookup_groupmem(TALLOC_CTX *mem_ctx, struct lsa_SidPtr sid_ptr; struct samr_Ids rids_query; - sid_ptr.sid = sid_dup_talloc(mem_ctx, group_sid); + sid_ptr.sid = dom_sid_dup(mem_ctx, group_sid); if (sid_ptr.sid == NULL) { return NT_STATUS_NO_MEMORY; } diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c index 671c868273..14be0e26fa 100644 --- a/source3/winbindd/winbindd_util.c +++ b/source3/winbindd/winbindd_util.c @@ -23,6 +23,7 @@ #include "includes.h" #include "winbindd.h" #include "secrets.h" +#include "../libcli/security/dom_sid.h" #undef DBGC_CLASS #define DBGC_CLASS DBGC_WINBIND @@ -135,7 +136,7 @@ static struct winbindd_domain *add_trusted_domain(const char *domain_name, const continue; } - if (sid_equal(sid, &domain->sid)) { + if (dom_sid_equal(sid, &domain->sid)) { break; } } @@ -146,7 +147,7 @@ static struct winbindd_domain *add_trusted_domain(const char *domain_name, const * We found a match. Possibly update the SID */ if ((sid != NULL) - && sid_equal(&domain->sid, &global_sid_NULL)) { + && dom_sid_equal(&domain->sid, &global_sid_NULL)) { sid_copy( &domain->sid, sid ); } return domain; @@ -740,7 +741,7 @@ struct winbindd_domain *find_domain_from_sid_noinit(const struct dom_sid *sid) /* Search through list */ for (domain = domain_list(); domain != NULL; domain = domain->next) { - if (sid_compare_domain(sid, &domain->sid) == 0) + if (dom_sid_compare_domain(sid, &domain->sid) == 0) return domain; } |