summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-04-14 23:19:25 +0200
committerGünther Deschner <gd@samba.org>2009-04-14 23:21:47 +0200
commit4721be488ceb8229d564e4b63ca9937603394e51 (patch)
treeebbc99b9a11da25ddd847cd289772f72a69b9b36
parentca3de0103b545c86c8507dfc7d042f1838d5dfb2 (diff)
downloadsamba-4721be488ceb8229d564e4b63ca9937603394e51.tar.gz
samba-4721be488ceb8229d564e4b63ca9937603394e51.tar.bz2
samba-4721be488ceb8229d564e4b63ca9937603394e51.zip
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
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c16
1 files changed, 6 insertions, 10 deletions
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);