summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2008-07-12 21:28:18 -0400
committerSimo Sorce <idra@samba.org>2008-07-12 21:42:23 -0400
commit9669411d1ea30ca6d2c2bc6bfa4bca8231901b58 (patch)
tree63c725daa2aff4e4d1ec0c8a9d050f3cebbc9ab2 /source3/winbindd
parent8812606c43baa796f6164484fb7cac3d9b0dc9c8 (diff)
downloadsamba-9669411d1ea30ca6d2c2bc6bfa4bca8231901b58.tar.gz
samba-9669411d1ea30ca6d2c2bc6bfa4bca8231901b58.tar.bz2
samba-9669411d1ea30ca6d2c2bc6bfa4bca8231901b58.zip
Fix regression introduced with 4086ef15b395f1a536fb669af2103a33ecc14de4
We must not return an error here just because we are offline. We must instead fix the mappings to the best of our knowledge (ie mark as mapped, expired ones, and as unmapped, unknown ones) (This used to be commit 4436272dd4d6cdd223b1dc3d217a97cbe3bc887b)
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/idmap.c30
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]);
}