summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-François Micouleau <jfm@samba.org>2000-07-26 10:31:05 +0000
committerJean-François Micouleau <jfm@samba.org>2000-07-26 10:31:05 +0000
commit134a4b86548db77cba292c50fbd6b91ecaa69f14 (patch)
treeb4a848dd575ea6d3d60fd2d175c1d3afcd08b375
parent1e3a5503cd27109e3b79da9d1115ef80317e6849 (diff)
downloadsamba-134a4b86548db77cba292c50fbd6b91ecaa69f14.tar.gz
samba-134a4b86548db77cba292c50fbd6b91ecaa69f14.tar.bz2
samba-134a4b86548db77cba292c50fbd6b91ecaa69f14.zip
if no comment in TDB, use comment from print share.
J.F. (This used to be commit c267b23620677a11f702bfea4885a28e66a05b05)
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 288b9648b7..76dff789c6 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -947,8 +947,12 @@ static void spoolss_notify_driver_name(int snum, SPOOL_NOTIFY_INFO_DATA *data, p
********************************************************************/
static void spoolss_notify_comment(int snum, SPOOL_NOTIFY_INFO_DATA *data, print_queue_struct *queue, NT_PRINTER_INFO_LEVEL *printer)
{
- data->notify_data.data.length=(uint32)((dos_PutUniCode((char *)data->notify_data.data.string,
+ if (*printer->info_2->comment == '\0')
+ data->notify_data.data.length=(uint32)((dos_PutUniCode((char *)data->notify_data.data.string,
lp_comment(snum), sizeof(data->notify_data.data.string)-1, True) - sizeof(uint16))/sizeof(uint16));
+ else
+ data->notify_data.data.length=(uint32)((dos_PutUniCode((char *)data->notify_data.data.string,
+ printer->info_2->comment, sizeof(data->notify_data.data.string)-1, True) - sizeof(uint16))/sizeof(uint16));
}
/*******************************************************************
@@ -1729,14 +1733,21 @@ static BOOL construct_printer_info_1(fstring server, uint32 flags, PRINTER_INFO_
printer->flags=flags;
- snprintf(chaine,sizeof(chaine)-1,"%s%s,%s,%s",server, ntprinter->info_2->printername,
- ntprinter->info_2->drivername, lp_comment(snum));
+ if (*ntprinter->info_2->comment == '\0') {
+ init_unistr(&printer->comment, lp_comment(snum));
+ snprintf(chaine,sizeof(chaine)-1,"%s%s,%s,%s",server, ntprinter->info_2->printername,
+ ntprinter->info_2->drivername, lp_comment(snum));
+ }
+ else {
+ init_unistr(&printer->comment, ntprinter->info_2->comment); /* saved comment. */
+ snprintf(chaine,sizeof(chaine)-1,"%s%s,%s,%s",server, ntprinter->info_2->printername,
+ ntprinter->info_2->drivername, ntprinter->info_2->comment);
+ }
snprintf(chaine2,sizeof(chaine)-1,"%s%s", server, ntprinter->info_2->printername);
init_unistr(&printer->description, chaine);
init_unistr(&printer->name, chaine2);
- init_unistr(&printer->comment, lp_comment(snum));
free_a_printer(&ntprinter,2);