[SCM] Samba Shared Repository - branch master updated
Günther Deschner
gd at samba.org
Thu Jun 30 02:55:01 MDT 2011
The branch, master has been updated
via c9e3f6a s3-printing: skip migration of non-existent printers
via a36ce07 s3-printing: fill devicemode size in migrate_printer()
from 44a434a s3-winbind: Fix bug 7888 -- deal with buggy 3.0 based PDCs
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit c9e3f6ab02bdc354a9b656f62744ee66fe9e9e67
Author: David Disseldorp <ddiss at suse.de>
Date: Wed Jun 15 14:59:49 2011 +0200
s3-printing: skip migration of non-existent printers
Skip tdb migration of printer and security descriptor entries which
refer to non-existent printers.
Signed-off-by: Günther Deschner <gd at samba.org>
Autobuild-User: Günther Deschner <gd at samba.org>
Autobuild-Date: Thu Jun 30 10:54:23 CEST 2011 on sn-devel-104
commit a36ce0735ff6cad8124bd63a056a71d9495b238c
Author: David Disseldorp <ddiss at suse.de>
Date: Wed Jun 15 12:46:55 2011 +0200
s3-printing: fill devicemode size in migrate_printer()
Signed-off-by: Günther Deschner <gd at samba.org>
-----------------------------------------------------------------------
Summary of changes:
source3/printing/nt_printing_migrate.c | 27 +++++++++++++++++++--------
source3/utils/net_printing.c | 1 +
2 files changed, 20 insertions(+), 8 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/printing/nt_printing_migrate.c b/source3/printing/nt_printing_migrate.c
index ec66dfe..7914585 100644
--- a/source3/printing/nt_printing_migrate.c
+++ b/source3/printing/nt_printing_migrate.c
@@ -318,6 +318,7 @@ static NTSTATUS migrate_printer(TALLOC_CTX *mem_ctx,
dm.pelsheight = r.devmode->pelsheight;
dm.pelswidth = r.devmode->pelswidth;
dm.printquality = r.devmode->printquality;
+ dm.size = r.devmode->size;
dm.scale = r.devmode->scale;
dm.specversion = r.devmode->specversion;
dm.ttoption = r.devmode->ttoption;
@@ -458,10 +459,6 @@ static NTSTATUS migrate_secdesc(TALLOC_CTX *mem_ctx,
key_name, nt_errstr(status)));
return status;
}
- if (W_ERROR_EQUAL(WERR_INVALID_PRINTER_NAME, result)) {
- DEBUG(3, ("Ignoring missing printer %s\n", key_name));
- return NT_STATUS_OK;
- }
if (!W_ERROR_IS_OK(result)) {
DEBUG(2, ("OpenPrinter(%s) failed: %s\n",
key_name, win_errstr(result)));
@@ -587,13 +584,20 @@ static NTSTATUS migrate_internal(TALLOC_CTX *mem_ctx,
}
if (strncmp((const char *) kbuf.dptr, PRINTERS_PREFIX, strlen(PRINTERS_PREFIX)) == 0) {
+ const char *printer_name = (const char *)(kbuf.dptr
+ + strlen(PRINTERS_PREFIX));
status = migrate_printer(mem_ctx,
pipe_hnd,
- (const char *) kbuf.dptr + strlen(PRINTERS_PREFIX),
+ printer_name,
dbuf.dptr,
dbuf.dsize);
SAFE_FREE(dbuf.dptr);
- if (!NT_STATUS_IS_OK(status)) {
+ /* currently no WERR_INVALID_PRINTER_NAME equivalent */
+ if (NT_STATUS_EQUAL(status,
+ werror_to_ntstatus(WERR_INVALID_PRINTER_NAME))) {
+ DEBUG(2, ("Skipping migration for non-existent "
+ "printer: %s\n", printer_name));
+ } else if (!NT_STATUS_IS_OK(status)) {
tdb_close(tdb);
return status;
}
@@ -601,13 +605,20 @@ static NTSTATUS migrate_internal(TALLOC_CTX *mem_ctx,
}
if (strncmp((const char *) kbuf.dptr, SECDESC_PREFIX, strlen(SECDESC_PREFIX)) == 0) {
+ const char *secdesc_name = (const char *)(kbuf.dptr
+ + strlen(SECDESC_PREFIX));
status = migrate_secdesc(mem_ctx,
pipe_hnd,
- (const char *) kbuf.dptr + strlen(SECDESC_PREFIX),
+ secdesc_name,
dbuf.dptr,
dbuf.dsize);
SAFE_FREE(dbuf.dptr);
- if (!NT_STATUS_IS_OK(status)) {
+ /* currently no WERR_INVALID_PRINTER_NAME equivalent */
+ if (NT_STATUS_EQUAL(status,
+ werror_to_ntstatus(WERR_INVALID_PRINTER_NAME))) {
+ DEBUG(2, ("Skipping migration for non-existent "
+ "secdesc: %s\n", secdesc_name));
+ } else if (!NT_STATUS_IS_OK(status)) {
tdb_close(tdb);
return status;
}
diff --git a/source3/utils/net_printing.c b/source3/utils/net_printing.c
index 2f8caad..6e82c55 100644
--- a/source3/utils/net_printing.c
+++ b/source3/utils/net_printing.c
@@ -466,6 +466,7 @@ static NTSTATUS migrate_printer(TALLOC_CTX *mem_ctx,
dm.pelsheight = r.devmode->pelsheight;
dm.pelswidth = r.devmode->pelswidth;
dm.printquality = r.devmode->printquality;
+ dm.size = r.devmode->size;
dm.scale = r.devmode->scale;
dm.specversion = r.devmode->specversion;
dm.ttoption = r.devmode->ttoption;
--
Samba Shared Repository
More information about the samba-cvs
mailing list