summaryrefslogtreecommitdiffstats
path: root/source/printing/nt_printing.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-11-08 17:25:45 -0800
committerJeremy Allison <jra@samba.org>2007-11-08 17:25:45 -0800
commit2a0173743d2cf615d52278f3dd87cc804abe2d16 (patch)
treec872a57aebebf87658b18703b8abb1ce54c082ec /source/printing/nt_printing.c
parentd9335456d23271a4b15b97d24f1b263700a3b9df (diff)
downloadsamba-2a0173743d2cf615d52278f3dd87cc804abe2d16.tar.gz
samba-2a0173743d2cf615d52278f3dd87cc804abe2d16.tar.xz
samba-2a0173743d2cf615d52278f3dd87cc804abe2d16.zip
Remove more fstring/pstring bad useage. Go talloc !
Jeremy.
Diffstat (limited to 'source/printing/nt_printing.c')
-rw-r--r--source/printing/nt_printing.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/source/printing/nt_printing.c b/source/printing/nt_printing.c
index 36add6f474e..57e7d37c6e9 100644
--- a/source/printing/nt_printing.c
+++ b/source/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);