summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/winbindd/wb_sid2gid.c2
-rw-r--r--source3/winbindd/wb_sid2uid.c2
-rw-r--r--source3/winbindd/winbindd.h5
-rw-r--r--source3/winbindd/winbindd_cache.c4
-rw-r--r--source3/winbindd/winbindd_proto.h1
-rw-r--r--source3/winbindd/winbindd_util.c11
6 files changed, 16 insertions, 9 deletions
diff --git a/source3/winbindd/wb_sid2gid.c b/source3/winbindd/wb_sid2gid.c
index a578746ea2..e15d563cd7 100644
--- a/source3/winbindd/wb_sid2gid.c
+++ b/source3/winbindd/wb_sid2gid.c
@@ -54,7 +54,7 @@ struct tevent_req *wb_sid2gid_send(TALLOC_CTX *mem_ctx,
DEBUG(10, ("idmap_cache_find_sid2gid found %d%s\n",
(int)state->gid, expired ? " (expired)": ""));
- if (!expired || IS_DOMAIN_OFFLINE(find_our_domain())) {
+ if (!expired || is_domain_offline(find_our_domain())) {
if (state->gid == -1) {
tevent_req_nterror(req, NT_STATUS_NONE_MAPPED);
} else {
diff --git a/source3/winbindd/wb_sid2uid.c b/source3/winbindd/wb_sid2uid.c
index abfe257bfa..9c22b8d10b 100644
--- a/source3/winbindd/wb_sid2uid.c
+++ b/source3/winbindd/wb_sid2uid.c
@@ -53,7 +53,7 @@ struct tevent_req *wb_sid2uid_send(TALLOC_CTX *mem_ctx,
DEBUG(10, ("idmap_cache_find_sid2uid found %d%s\n",
(int)state->uid, expired ? " (expired)": ""));
- if (!expired || IS_DOMAIN_OFFLINE(find_our_domain())) {
+ if (!expired || is_domain_offline(find_our_domain())) {
if (state->uid == -1) {
tevent_req_nterror(req, NT_STATUS_NONE_MAPPED);
} else {
diff --git a/source3/winbindd/winbindd.h b/source3/winbindd/winbindd.h
index 99fa10250a..a589ecc0cc 100644
--- a/source3/winbindd/winbindd.h
+++ b/source3/winbindd/winbindd.h
@@ -387,9 +387,4 @@ struct WINBINDD_CCACHE_ENTRY {
#define WINBINDD_PAM_AUTH_KRB5_RENEW_TIME 2592000 /* one month */
#define DOM_SEQUENCE_NONE ((uint32)-1)
-#define IS_DOMAIN_OFFLINE(x) ( lp_winbind_offline_logon() && \
- ( get_global_winbindd_state_offline() \
- || !(x)->online ) )
-#define IS_DOMAIN_ONLINE(x) (!IS_DOMAIN_OFFLINE(x))
-
#endif /* _WINBINDD_H */
diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c
index 6e70a18c35..ac855886ce 100644
--- a/source3/winbindd/winbindd_cache.c
+++ b/source3/winbindd/winbindd_cache.c
@@ -514,7 +514,7 @@ static void refresh_sequence_number(struct winbindd_domain *domain, bool force)
time_t t = time(NULL);
unsigned cache_time = lp_winbind_cache_time();
- if ( IS_DOMAIN_OFFLINE(domain) ) {
+ if (is_domain_offline(domain)) {
return;
}
@@ -4394,7 +4394,7 @@ bool wcache_fetch_ndr(TALLOC_CTX *mem_ctx, struct winbindd_domain *domain,
goto fail;
}
- if (IS_DOMAIN_ONLINE(domain)) {
+ if (is_domain_offline(domain)) {
uint32_t entry_seqnum, dom_seqnum, last_check;
if (!wcache_fetch_seqnum(domain->name, &dom_seqnum,
diff --git a/source3/winbindd/winbindd_proto.h b/source3/winbindd/winbindd_proto.h
index 012e3b6332..263e326917 100644
--- a/source3/winbindd/winbindd_proto.h
+++ b/source3/winbindd/winbindd_proto.h
@@ -474,6 +474,7 @@ void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
void winbindd_set_locator_kdc_envs(const struct winbindd_domain *domain);
void winbindd_unset_locator_kdc_env(const struct winbindd_domain *domain);
void set_auth_errors(struct winbindd_response *resp, NTSTATUS result);
+bool is_domain_offline(const struct winbindd_domain *domain);
/* The following definitions come from winbindd/winbindd_wins.c */
diff --git a/source3/winbindd/winbindd_util.c b/source3/winbindd/winbindd_util.c
index 8c21ed6610..17603820d4 100644
--- a/source3/winbindd/winbindd_util.c
+++ b/source3/winbindd/winbindd_util.c
@@ -1461,3 +1461,14 @@ void set_auth_errors(struct winbindd_response *resp, NTSTATUS result)
get_friendly_nt_error_msg(result));
resp->data.auth.pam_error = nt_status_to_pam(result);
}
+
+bool is_domain_offline(const struct winbindd_domain *domain)
+{
+ if (!lp_winbind_offline_logon()) {
+ return false;
+ }
+ if (get_global_winbindd_state_offline()) {
+ return true;
+ }
+ return !domain->online;
+}