summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2005-01-27 02:56:18 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:55:12 -0500
commit3bb69bc8efa02a2ffdba4b4ee6371312de9eba0d (patch)
tree7eab30e0631d63d8fc5e84464716d14423c81fd3 /source3/printing
parent091f4bcda5cee113ade6ae64fa892278eb17dd5b (diff)
downloadsamba-3bb69bc8efa02a2ffdba4b4ee6371312de9eba0d.tar.gz
samba-3bb69bc8efa02a2ffdba4b4ee6371312de9eba0d.tar.bz2
samba-3bb69bc8efa02a2ffdba4b4ee6371312de9eba0d.zip
r5029: after talking to Rob, ensure that we set the NETIOSNAME.domainname
as the longname in the published printer information since this is what we will have used when we joined the domain. More testing on this tomorrow. (This used to be commit d64fd1116d5fe29807be29c73809317f88fdb033)
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index d5cf58f54d..2a525ef560 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -2595,6 +2595,7 @@ static BOOL map_nt_printer_info2_to_dsspooler(NT_PRINTER_INFO_LEVEL_2 *info2)
{
REGVAL_CTR *ctr = NULL;
fstring longname;
+ fstring dnssuffix;
char *allocated_string = NULL;
const char *ascii_str;
int i;
@@ -2606,7 +2607,15 @@ 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());
- get_mydnsfullname(longname);
+ /* 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 ) )
+ fstr_sprintf( longname, "%s.%s", global_myname(), dnssuffix );
+ else
+ fstrcpy( longname, global_myname() );
+
map_sz_into_ctr(ctr, SPOOL_REG_SERVERNAME, longname);
asprintf(&allocated_string, "\\\\%s\\%s", longname, info2->sharename);