]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r5029: after talking to Rob, ensure that we set the NETIOSNAME.domainname
authorGerald Carter <jerry@samba.org>
Thu, 27 Jan 2005 02:56:18 +0000 (02:56 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:55:12 +0000 (10:55 -0500)
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.

source/printing/nt_printing.c

index d5cf58f54d81edc88e3988ca285cc140994828dd..2a525ef560b01694892985b83b92eef6a0b9be2b 100644 (file)
@@ -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);