summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-05-15 16:41:18 +0200
committerGünther Deschner <gd@samba.org>2008-05-15 16:41:18 +0200
commit2e8b43c58d6d276ef5856816f0259df51ccd9837 (patch)
treec57b850cc15c2d679274f14e0e4793b097bd05ae
parenteeb126a379d8d473e5e9a519b97bee543fb2b251 (diff)
downloadsamba-2e8b43c58d6d276ef5856816f0259df51ccd9837.tar.gz
samba-2e8b43c58d6d276ef5856816f0259df51ccd9837.tar.bz2
samba-2e8b43c58d6d276ef5856816f0259df51ccd9837.zip
dsgetdcname: check for invalid sitename/flag combinations.
Guenther (This used to be commit 255e509474cae92802e90613ccaddb6627ee77cd)
-rw-r--r--source3/libsmb/dsgetdcname.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/libsmb/dsgetdcname.c b/source3/libsmb/dsgetdcname.c
index 1538502e9a..3326c10f5e 100644
--- a/source3/libsmb/dsgetdcname.c
+++ b/source3/libsmb/dsgetdcname.c
@@ -582,7 +582,8 @@ static NTSTATUS dsgetdcname_cached(TALLOC_CTX *mem_ctx,
/****************************************************************
****************************************************************/
-static bool check_allowed_required_flags(uint32_t flags)
+static bool check_allowed_required_flags(uint32_t flags,
+ const char *site_name)
{
uint32_t return_type = flags & (DS_RETURN_FLAT_NAME|DS_RETURN_DNS_NAME);
uint32_t offered_type = flags & (DS_IS_FLAT_NAME|DS_IS_DNS_NAME);
@@ -593,6 +594,10 @@ static bool check_allowed_required_flags(uint32_t flags)
debug_dsdcinfo_flags(10, flags);
+ if ((flags & DS_TRY_NEXTCLOSEST_SITE) && site_name) {
+ return false;
+ }
+
if (return_type == (DS_RETURN_FLAT_NAME|DS_RETURN_DNS_NAME)) {
return false;
}
@@ -1394,7 +1399,7 @@ NTSTATUS dsgetdcname(TALLOC_CTX *mem_ctx,
*info = NULL;
- if (!check_allowed_required_flags(flags)) {
+ if (!check_allowed_required_flags(flags, site_name)) {
DEBUG(0,("invalid flags specified\n"));
return NT_STATUS_INVALID_PARAMETER;
}