diff options
author | Jeremy Allison <jra@samba.org> | 2007-11-08 17:58:55 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-11-08 17:58:55 -0800 |
commit | 214bb0f11937843a268a897ab0337184ab36c2bc (patch) | |
tree | b8967374d5e1f8d5653c964ecd4ff1064d8748fd | |
parent | d40e47db4b5da41c8604a2058f3a0b0a82164f08 (diff) | |
download | samba-214bb0f11937843a268a897ab0337184ab36c2bc.tar.gz samba-214bb0f11937843a268a897ab0337184ab36c2bc.tar.bz2 samba-214bb0f11937843a268a897ab0337184ab36c2bc.zip |
Fix case where we have no dns domain name. Return a talloc of "".
Jeremy.
(This used to be commit ab8934844a8ae08657769ce1787c32f14a7eb745)
-rw-r--r-- | source3/lib/util.c | 2 | ||||
-rw-r--r-- | source3/printing/nt_printing.c | 2 | ||||
-rw-r--r-- | source3/rpc_server/srv_lsa_nt.c | 2 |
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); |