summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@suse.de>2011-07-05 11:34:47 +0200
committerGünther Deschner <gd@samba.org>2011-07-07 18:06:02 +0200
commit5dd8185d852afc3843253c9471326677f8816a77 (patch)
tree79fc1f5d22a1423c2f7bd3b831ffdbaaccb7b9eb /source3/printing
parent57bbb32c64db1027e2b9ae1aef7f5f3b33ae3882 (diff)
downloadsamba-5dd8185d852afc3843253c9471326677f8816a77.tar.gz
samba-5dd8185d852afc3843253c9471326677f8816a77.tar.bz2
samba-5dd8185d852afc3843253c9471326677f8816a77.zip
s3-printing: fill info2_mask in printer migration
Also fix possibly uninitialised status return from printing_tdb_migrate_printer().
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing_migrate.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source3/printing/nt_printing_migrate.c b/source3/printing/nt_printing_migrate.c
index f3cc6cbe55..44800014e8 100644
--- a/source3/printing/nt_printing_migrate.c
+++ b/source3/printing/nt_printing_migrate.c
@@ -154,11 +154,12 @@ NTSTATUS printing_tdb_migrate_printer(TALLOC_CTX *mem_ctx,
struct spoolss_SetPrinterInfo2 info2;
struct spoolss_DeviceMode dm;
struct spoolss_DevmodeContainer devmode_ctr;
- struct sec_desc_buf secdesc_ctr;
DATA_BLOB blob;
NTSTATUS status;
WERROR result;
int j;
+ uint32_t info2_mask = (SPOOLSS_PRINTER_INFO_ALL)
+ & ~SPOOLSS_PRINTER_INFO_SECDESC;
if (strequal(key_name, "printers")) {
return NT_STATUS_OK;
@@ -182,7 +183,6 @@ NTSTATUS printing_tdb_migrate_printer(TALLOC_CTX *mem_ctx,
/* Create printer info level 2 */
ZERO_STRUCT(info2);
- ZERO_STRUCT(secdesc_ctr);
info2.attributes = r.info.attributes;
info2.averageppm = r.info.averageppm;
@@ -204,7 +204,9 @@ NTSTATUS printing_tdb_migrate_printer(TALLOC_CTX *mem_ctx,
info2.untiltime = r.info.untiltime;
/* Create Device Mode */
- if (r.devmode != NULL) {
+ if (r.devmode == NULL) {
+ info2_mask &= ~SPOOLSS_PRINTER_INFO_DEVMODE;
+ } else {
ZERO_STRUCT(dm);
dm.bitsperpel = r.devmode->bitsperpel;
@@ -252,7 +254,7 @@ NTSTATUS printing_tdb_migrate_printer(TALLOC_CTX *mem_ctx,
result = winreg_update_printer(mem_ctx, b,
key_name,
- 0, /// FIXME !!!!!!!!!!!!!!!!!!!!!!!
+ info2_mask,
&info2,
&dm,
NULL);
@@ -298,6 +300,7 @@ NTSTATUS printing_tdb_migrate_printer(TALLOC_CTX *mem_ctx,
}
}
+ status = NT_STATUS_OK;
done:
return status;