diff options
author | Gerald Carter <jerry@samba.org> | 2007-03-16 21:52:21 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:18:39 -0500 |
commit | 2d30923864e389bc5275ab66ccd6dec8b0432517 (patch) | |
tree | c4007fb1c76ecb9ab72d87f0f36d01be1b950cd8 /source3/printing | |
parent | b2bc94eeeec3a2181c0578e52156d87a82aefb13 (diff) | |
download | samba-2d30923864e389bc5275ab66ccd6dec8b0432517.tar.gz samba-2d30923864e389bc5275ab66ccd6dec8b0432517.tar.xz samba-2d30923864e389bc5275ab66ccd6dec8b0432517.zip |
r21862: add the cups comment and location lookup to get_a_printer_2_default() as well
(This used to be commit 5b47c4e5c25550ad72f9e558bb50f237ba28f81e)
Diffstat (limited to 'source3/printing')
-rw-r--r-- | source3/printing/nt_printing.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 6289be3e5fb..c03f38840d0 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -3743,9 +3743,7 @@ static void map_to_os2_driver(fstring drivername) ****************************************************************************/ static WERROR get_a_printer_2_default(NT_PRINTER_INFO_LEVEL_2 *info, const char *servername, const char* sharename) { - int snum; - - snum = lp_servicenumber(sharename); + int snum = lp_servicenumber(sharename); slprintf(info->servername, sizeof(info->servername)-1, "\\\\%s", servername); slprintf(info->printername, sizeof(info->printername)-1, "\\\\%s\\%s", @@ -3769,6 +3767,15 @@ static WERROR get_a_printer_2_default(NT_PRINTER_INFO_LEVEL_2 *info, const char fstrcpy(info->printprocessor, "winprint"); fstrcpy(info->datatype, "RAW"); +#ifdef HAVE_CUPS + if ( (enum printing_types)lp_printing(snum) == PRINT_CUPS ) { + /* Pull the location and comment strings from cups if we don't + already have one */ + if ( !strlen(info->location) || !strlen(info->comment) ) + cups_pull_comment_location( info ); + } +#endif + info->attributes = PRINTER_ATTRIBUTE_SAMBA; info->starttime = 0; /* Minutes since 12:00am GMT */ |