From d40e47db4b5da41c8604a2058f3a0b0a82164f08 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 8 Nov 2007 17:25:45 -0800 Subject: Remove more fstring/pstring bad useage. Go talloc ! Jeremy. (This used to be commit 2a0173743d2cf615d52278f3dd87cc804abe2d16) --- source3/printing/nt_printing.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source3/printing/nt_printing.c') 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); -- cgit