diff options
Diffstat (limited to 'source3/libads/dns.c')
-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. ********************************************************************/ |