summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/lib/util.c2
-rw-r--r--source3/printing/nt_printing.c2
-rw-r--r--source3/rpc_server/srv_lsa_nt.c2
3 files changed, 4 insertions, 2 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 6e92a60238..287d2090ff 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1227,6 +1227,8 @@ char *get_mydnsdomname(TALLOC_CTX *ctx)
if (p) {
p++;
my_domname = talloc_strdup(ctx, p);
+ } else {
+ my_domname = talloc_strdup(ctx, "");
}
return my_domname;
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 57e7d37c6e..e729c3b46d 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -2953,7 +2953,7 @@ static bool map_nt_printer_info2_to_dsspooler(NT_PRINTER_INFO_LEVEL_2 *info2)
join the domain */
dnssuffix = get_mydnsdomname(talloc_tos());
- if (!dnssuffix) {
+ if (dnssuffix && *dnssuffix) {
fstr_sprintf( longname, "%s.%s", global_myname(), dnssuffix );
} else {
fstrcpy( longname, global_myname() );
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c
index 5c2e1b6f01..20655082a5 100644
--- a/source3/rpc_server/srv_lsa_nt.c
+++ b/source3/rpc_server/srv_lsa_nt.c
@@ -1928,7 +1928,7 @@ NTSTATUS _lsa_query_info2(pipes_struct *p, LSA_Q_QUERY_INFO2 *q_u, LSA_R_QUERY_I
/* This should be a 'netbios domain -> DNS domain' mapping */
dnsdomname = get_mydnsdomname(p->mem_ctx);
- if (!dnsdomname) {
+ if (!dnsdomname || !*dnsdomname) {
return NT_STATUS_CANT_ACCESS_DOMAIN_INFO;
}
strlower_m(dnsdomname);