diff options
Diffstat (limited to 'source3/winbindd/idmap.c')
-rw-r--r-- | source3/winbindd/idmap.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/source3/winbindd/idmap.c b/source3/winbindd/idmap.c index 7a9462b7fd..95ff923d0f 100644 --- a/source3/winbindd/idmap.c +++ b/source3/winbindd/idmap.c @@ -1361,16 +1361,16 @@ NTSTATUS idmap_unixids_to_sids(struct id_map **ids) /* let's see if there is any id mapping to be retrieved * from the backends */ - if (bi) { + if (bids) { + bool online; + /* Only do query if we are online */ - if ( IS_DOMAIN_OFFLINE(our_domain) ) { - ret = NT_STATUS_FILE_IS_OFFLINE; - goto done; + online = !IS_DOMAIN_OFFLINE(our_domain); + if (online) { + ret = idmap_backends_unixids_to_sids(bids); + IDMAP_CHECK_RET(ret); } - ret = idmap_backends_unixids_to_sids(bids); - IDMAP_CHECK_RET(ret); - /* update the cache */ for (i = 0; i < bi; i++) { if (bids[i]->status == ID_MAPPED) { @@ -1388,7 +1388,7 @@ NTSTATUS idmap_unixids_to_sids(struct id_map **ids) * unmapped and hope next time things will * settle down. */ bids[i]->status = ID_UNMAPPED; - } else { /* unmapped */ + } else if (online) { /* unmapped */ ret = idmap_cache_set_negative_id(idmap_cache, bids[i]); } @@ -1478,15 +1478,15 @@ NTSTATUS idmap_sids_to_unixids(struct id_map **ids) /* let's see if there is any id mapping to be retrieved * from the backends */ if (bids) { + bool online; + /* Only do query if we are online */ - if ( IS_DOMAIN_OFFLINE(our_domain) ) { - ret = NT_STATUS_FILE_IS_OFFLINE; - goto done; + online = !IS_DOMAIN_OFFLINE(our_domain); + if (online) { + ret = idmap_backends_sids_to_unixids(bids); + IDMAP_CHECK_RET(ret); } - ret = idmap_backends_sids_to_unixids(bids); - IDMAP_CHECK_RET(ret); - /* update the cache */ for (i = 0; bids[i]; i++) { if (bids[i]->status == ID_MAPPED) { @@ -1504,7 +1504,7 @@ NTSTATUS idmap_sids_to_unixids(struct id_map **ids) * unmapped and hope next time things will * settle down. */ bids[i]->status = ID_UNMAPPED; - } else { /* unmapped */ + } else if (online) { /* unmapped */ ret = idmap_cache_set_negative_sid(idmap_cache, bids[i]); } |