From 4721be488ceb8229d564e4b63ca9937603394e51 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Tue, 14 Apr 2009 23:19:25 +0200 Subject: s3-spoolss: Fix format of description string in spoolss_PrinterInfo1. This is what windows does and should get us closer to show the appropriate printer location string in explorer. Guenther --- source3/rpc_server/srv_spoolss_nt.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'source3/rpc_server') diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index effbb92266..d114152f64 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -4128,25 +4128,21 @@ static WERROR construct_printer_info1(TALLOC_CTX *mem_ctx, struct spoolss_PrinterInfo1 *r, int snum) { - char *chaine = NULL; r->flags = flags; + r->description = talloc_asprintf(mem_ctx, "%s,%s,%s", + ntprinter->info_2->printername, + ntprinter->info_2->drivername, + ntprinter->info_2->location); + W_ERROR_HAVE_NO_MEMORY(r->description); + if (*ntprinter->info_2->comment == '\0') { r->comment = talloc_strdup(mem_ctx, lp_comment(snum)); - chaine = talloc_asprintf(mem_ctx, - "%s,%s,%s", ntprinter->info_2->printername, - ntprinter->info_2->drivername, lp_comment(snum)); } else { r->comment = talloc_strdup(mem_ctx, ntprinter->info_2->comment); /* saved comment */ - chaine = talloc_asprintf(mem_ctx, - "%s,%s,%s", ntprinter->info_2->printername, - ntprinter->info_2->drivername, ntprinter->info_2->comment); } - W_ERROR_HAVE_NO_MEMORY(chaine); W_ERROR_HAVE_NO_MEMORY(r->comment); - r->description = talloc_strdup(mem_ctx, chaine); - W_ERROR_HAVE_NO_MEMORY(r->description); r->name = talloc_strdup(mem_ctx, ntprinter->info_2->printername); W_ERROR_HAVE_NO_MEMORY(r->name); -- cgit