diff options
author | Jeremy Allison <jra@samba.org> | 2007-11-08 17:25:45 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2007-11-08 17:25:45 -0800 |
commit | d40e47db4b5da41c8604a2058f3a0b0a82164f08 (patch) | |
tree | 1974bfa70d7b527714b8c68c40e33f2b88efb9e1 /source3/printing | |
parent | 976b0ec487720982e456f8c3634be3df64882dae (diff) | |
download | samba-d40e47db4b5da41c8604a2058f3a0b0a82164f08.tar.gz samba-d40e47db4b5da41c8604a2058f3a0b0a82164f08.tar.bz2 samba-d40e47db4b5da41c8604a2058f3a0b0a82164f08.zip |
Remove more fstring/pstring bad useage. Go talloc !
Jeremy.
(This used to be commit 2a0173743d2cf615d52278f3dd87cc804abe2d16)
Diffstat (limited to 'source3/printing')
-rw-r--r-- | source3/printing/nt_printing.c | 14 |
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); |