summaryrefslogtreecommitdiff
path: root/source3/printing/nt_printing.c
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2007-03-16 21:46:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:39 -0500
commitb2bc94eeeec3a2181c0578e52156d87a82aefb13 (patch)
tree01ef4a27555ceb2437682b89d2e0b90111835937 /source3/printing/nt_printing.c
parent815fdf23c782e8ace0d71d1fed6f7fe3be200731 (diff)
downloadsamba-b2bc94eeeec3a2181c0578e52156d87a82aefb13.tar.gz
samba-b2bc94eeeec3a2181c0578e52156d87a82aefb13.tar.bz2
samba-b2bc94eeeec3a2181c0578e52156d87a82aefb13.zip
r21861: Pull the comment and location from CUPS if we don't have one
when fetching a printer from ntprinters.tdb. Slightly modified from original version submitted on samba-technical ml by Andy Polyakov <appro@fy.chalmers.se> (This used to be commit e859e1fdcd13c55746a53b5de4a02a3278f41815)
Diffstat (limited to 'source3/printing/nt_printing.c')
-rw-r--r--source3/printing/nt_printing.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index b3c04913f1..6289be3e5f 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -3864,6 +3864,15 @@ static WERROR get_a_printer_2(NT_PRINTER_INFO_LEVEL_2 *info, const char *servern
fstrcpy(info->printername, printername);
+#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
+
len += unpack_devicemode(&info->devmode,dbuf.dptr+len, dbuf.dsize-len);
/*