summaryrefslogtreecommitdiff
path: root/source3/printing/nt_printing.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/printing/nt_printing.c')
-rw-r--r--source3/printing/nt_printing.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 36add6f474..57e7d37c6e 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -2936,7 +2936,7 @@ static bool map_nt_printer_info2_to_dsspooler(NT_PRINTER_INFO_LEVEL_2 *info2)
{
REGVAL_CTR *ctr = NULL;
fstring longname;
- fstring dnssuffix;
+ const char *dnssuffix;
char *allocated_string = NULL;
const char *ascii_str;
int i;
@@ -2948,15 +2948,17 @@ static bool map_nt_printer_info2_to_dsspooler(NT_PRINTER_INFO_LEVEL_2 *info2)
map_sz_into_ctr(ctr, SPOOL_REG_PRINTERNAME, info2->sharename);
map_sz_into_ctr(ctr, SPOOL_REG_SHORTSERVERNAME, global_myname());
- /* we make the assumption that the netbios name is the same
- as the DNS name sinc ethe former will be what we used to
+ /* we make the assumption that the netbios name is the same
+ as the DNS name sinc ethe former will be what we used to
join the domain */
- if ( get_mydnsdomname( dnssuffix ) )
+ dnssuffix = get_mydnsdomname(talloc_tos());
+ if (!dnssuffix) {
fstr_sprintf( longname, "%s.%s", global_myname(), dnssuffix );
- else
+ } else {
fstrcpy( longname, global_myname() );
-
+ }
+
map_sz_into_ctr(ctr, SPOOL_REG_SERVERNAME, longname);
asprintf(&allocated_string, "\\\\%s\\%s", longname, info2->sharename);