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 {
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 {
#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 */
time_t t = time(NULL);
unsigned cache_time = lp_winbind_cache_time();
- if ( IS_DOMAIN_OFFLINE(domain) ) {
+ if (is_domain_offline(domain)) {
return;
}
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,
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 */
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;
+}