diff options
author | Jeremy Allison <jra@samba.org> | 2002-01-08 00:46:56 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-01-08 00:46:56 +0000 |
commit | 4702494dce15d4158fd17720d843ff5211ce1715 (patch) | |
tree | 46516cb4cabadff3f3a8234a193bc94252903f6a /source3/printing/nt_printing.c | |
parent | 43b27771f50d5feba995c6ede961fdb4e73354f9 (diff) | |
download | samba-4702494dce15d4158fd17720d843ff5211ce1715.tar.gz samba-4702494dce15d4158fd17720d843ff5211ce1715.tar.bz2 samba-4702494dce15d4158fd17720d843ff5211ce1715.zip |
Added get_called_name() function, which replaces global_myname in printing
code (one less global, hurrah !) - to allow NetBIOS aliasing to be used
with point and print.
Jeremy.
(This used to be commit 10d72f0b01e5950c667f3f73dff1b4da5b675ea3)
Diffstat (limited to 'source3/printing/nt_printing.c')
-rw-r--r-- | source3/printing/nt_printing.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 701944824d..3436d2c1c4 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -2379,19 +2379,16 @@ get a default printer info 2 struct ****************************************************************************/ static WERROR get_a_printer_2_default(NT_PRINTER_INFO_LEVEL_2 **info_ptr, fstring sharename) { - extern pstring global_myname; - extern fstring local_machine; int snum; NT_PRINTER_INFO_LEVEL_2 info; - char *sub_name = *local_machine ? local_machine : global_myname; ZERO_STRUCT(info); snum = lp_servicenumber(sharename); - slprintf(info.servername, sizeof(info.servername)-1, "\\\\%s", sub_name); + slprintf(info.servername, sizeof(info.servername)-1, "\\\\%s", get_called_name()); slprintf(info.printername, sizeof(info.printername)-1, "\\\\%s\\%s", - sub_name, sharename); + get_called_name(), sharename); fstrcpy(info.sharename, sharename); fstrcpy(info.portname, SAMBA_PRINTER_PORT_NAME); fstrcpy(info.drivername, lp_printerdriver(snum)); @@ -2467,10 +2464,7 @@ static WERROR get_a_printer_2_default(NT_PRINTER_INFO_LEVEL_2 **info_ptr, fstrin ****************************************************************************/ static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 **info_ptr, fstring sharename) { - extern pstring global_myname; - extern fstring local_machine; pstring key; - char *sub_name = *local_machine ? local_machine : global_myname; NT_PRINTER_INFO_LEVEL_2 info; int len = 0; TDB_DATA kbuf, dbuf; @@ -2515,8 +2509,8 @@ static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 **info_ptr, fstring sharen info.attributes |= (PRINTER_ATTRIBUTE_SHARED|PRINTER_ATTRIBUTE_RAW_ONLY); /* Restore the stripped strings. */ - slprintf(info.servername, sizeof(info.servername)-1, "\\\\%s", sub_name); - slprintf(printername, sizeof(printername)-1, "\\\\%s\\%s", sub_name, + slprintf(info.servername, sizeof(info.servername)-1, "\\\\%s", get_called_name()); + slprintf(printername, sizeof(printername)-1, "\\\\%s\\%s", get_called_name(), info.printername); fstrcpy(info.printername, printername); |