s3-spoolss: Fix format of description string in spoolss_PrinterInfo1.
authorGünther Deschner <gd@samba.org>
Tue, 14 Apr 2009 21:19:25 +0000 (23:19 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 14 Apr 2009 21:21:47 +0000 (23:21 +0200)
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

index effbb92266688530d02f02bfef928851d3f57062..d114152f64acd78706b2a590bbbb926cece0b935 100644 (file)
@@ -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);