diff options
author | Gerald Carter <jerry@samba.org> | 2007-03-01 04:35:31 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2007-03-01 04:35:31 +0000 |
commit | 03984b463596cd654bef952d024b96252909c7c7 (patch) | |
tree | 0a278d3c6c5f7cc395772bebc39c8930c134805c /source/nsswitch/idmap_cache.c | |
parent | fec07a7bb897b3c3723d5cb047daa86b45e5e9fd (diff) | |
download | samba-03984b463596cd654bef952d024b96252909c7c7.tar.gz samba-03984b463596cd654bef952d024b96252909c7c7.tar.xz samba-03984b463596cd654bef952d024b96252909c7c7.zip |
r21619: * Pickup latest changes from SAMBA_3_0_25 (this will be it
for 3.0.25pre1 unless something blows up)
* Update release notes some more
Diffstat (limited to 'source/nsswitch/idmap_cache.c')
-rw-r--r-- | source/nsswitch/idmap_cache.c | 61 |
1 files changed, 51 insertions, 10 deletions
diff --git a/source/nsswitch/idmap_cache.c b/source/nsswitch/idmap_cache.c index 897dd9c4f5b..caf5fe72b3a 100644 --- a/source/nsswitch/idmap_cache.c +++ b/source/nsswitch/idmap_cache.c @@ -22,6 +22,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.*/ #include "includes.h" +#include "winbindd.h" #define TIMEOUT_LEN 12 #define IDMAP_CACHE_DATA_FMT "%12u/%s" @@ -418,14 +419,34 @@ NTSTATUS idmap_cache_map_sid(struct idmap_cache_ctx *cache, struct id_map *id) /* here ret == NT_STATUS_OK and id->status = ID_MAPPED */ if (t <= time(NULL)) { - /* We're expired, set an error code for upper layer */ - ret = NT_STATUS_SYNCHRONIZATION_REQUIRED; + /* If we've been told to be offline - stay in + that state... */ + if (lp_winbind_offline_logon() && + get_global_winbindd_state_offline()) + { + DEBUG(10,("idmap_cache_map_sid: winbindd is " + "globally offline.\n")); + } else { + /* We're expired, set an error code + for upper layer */ + ret = NT_STATUS_SYNCHRONIZATION_REQUIRED; + } } } else { if (t <= time(NULL)) { - /* We're expired, delete the entry and return not mapped */ - tdb_delete(cache->tdb, keybuf); - ret = NT_STATUS_NONE_MAPPED; + /* If we've been told to be offline - stay in + that state... */ + if (lp_winbind_offline_logon() && + get_global_winbindd_state_offline()) + { + DEBUG(10,("idmap_cache_map_sid: winbindd is " + "globally offline.\n")); + } else { + /* We're expired, delete the entry and return + not mapped */ + tdb_delete(cache->tdb, keybuf); + ret = NT_STATUS_NONE_MAPPED; + } } else { /* this is not mapped as it was a negative cache hit */ id->status = ID_UNMAPPED; @@ -508,14 +529,34 @@ NTSTATUS idmap_cache_map_id(struct idmap_cache_ctx *cache, struct id_map *id) /* here ret == NT_STATUS_OK and id->mapped = True */ if (t <= time(NULL)) { - /* We're expired, set an error code for upper layer */ - ret = NT_STATUS_SYNCHRONIZATION_REQUIRED; + /* If we've been told to be offline - stay in + that state... */ + if (lp_winbind_offline_logon() && + get_global_winbindd_state_offline()) + { + DEBUG(10,("idmap_cache_map_sid: winbindd is " + "globally offline.\n")); + } else { + /* We're expired, set an error code + for upper layer */ + ret = NT_STATUS_SYNCHRONIZATION_REQUIRED; + } } } else { if (t <= time(NULL)) { - /* We're expired, delete the entry and return not mapped */ - tdb_delete(cache->tdb, keybuf); - ret = NT_STATUS_NONE_MAPPED; + /* If we've been told to be offline - stay in + that state... */ + if (lp_winbind_offline_logon() && + get_global_winbindd_state_offline()) + { + DEBUG(10,("idmap_cache_map_sid: winbindd is " + "globally offline.\n")); + } else { + /* We're expired, delete the entry and + return not mapped */ + tdb_delete(cache->tdb, keybuf); + ret = NT_STATUS_NONE_MAPPED; + } } else { /* this is not mapped is it was a negative cache hit */ id->status = ID_UNMAPPED; |