diff options
author | Jeremy Allison <jra@samba.org> | 2006-08-30 05:52:31 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:38:59 -0500 |
commit | 7b7ce43b40888af7d2663e77d8a9e83c383c6b2d (patch) | |
tree | b5db98353273e799a1f09490b374da4e8fc6b46b /source3/libads | |
parent | 2abab7ee6d04a62017d99578c274244a1cdd27b2 (diff) | |
download | samba-7b7ce43b40888af7d2663e77d8a9e83c383c6b2d.tar.gz samba-7b7ce43b40888af7d2663e77d8a9e83c383c6b2d.tar.bz2 samba-7b7ce43b40888af7d2663e77d8a9e83c383c6b2d.zip |
r17929: Ok, I think I finally figured out where to put
the code to redo the CLDAP query to restrict DC
DNS lookups to the sitename. Jerry, please check
to stop me going insane :-).
Jeremy.
(This used to be commit 8d22cc111579c57aec65be8884b41564b79b133a)
Diffstat (limited to 'source3/libads')
-rw-r--r-- | source3/libads/dns.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/source3/libads/dns.c b/source3/libads/dns.c index 937cd9213f..430486741d 100644 --- a/source3/libads/dns.c +++ b/source3/libads/dns.c @@ -604,7 +604,7 @@ BOOL sitename_store(const char *sitename) Caller must free. ****************************************************************************/ -static char *sitename_fetch(void) +char *sitename_fetch(void) { char *sitename = NULL; time_t timeout; @@ -624,6 +624,25 @@ static char *sitename_fetch(void) return sitename; } +/**************************************************************************** + Did the sitename change ? +****************************************************************************/ + +BOOL sitename_changed(const char *sitename) +{ + BOOL ret = False; + char *new_sitename = sitename_fetch(); + + if (sitename && new_sitename && !strequal(sitename, new_sitename)) { + ret = True; + } else if ((sitename && !new_sitename) || + (!sitename && new_sitename)) { + ret = True; + } + SAFE_FREE(new_sitename); + return ret; +} + /******************************************************************** Query with optional sitename. ********************************************************************/ |