summaryrefslogtreecommitdiff
path: root/source3/printing
diff options
context:
space:
mode:
Diffstat (limited to 'source3/printing')
-rw-r--r--source3/printing/nt_printing_migrate.c14
-rw-r--r--source3/printing/nt_printing_migrate.h6
-rw-r--r--source3/printing/nt_printing_migrate_internal.c6
3 files changed, 20 insertions, 6 deletions
diff --git a/source3/printing/nt_printing_migrate.c b/source3/printing/nt_printing_migrate.c
index 94dc3daa56..eacafa2a5f 100644
--- a/source3/printing/nt_printing_migrate.c
+++ b/source3/printing/nt_printing_migrate.c
@@ -88,7 +88,8 @@ NTSTATUS printing_tdb_migrate_driver(TALLOC_CTX *mem_ctx,
struct rpc_pipe_client *winreg_pipe,
const char *key_name,
unsigned char *data,
- size_t length)
+ size_t length,
+ bool do_string_conversion)
{
struct dcerpc_binding_handle *b = winreg_pipe->binding_handle;
enum ndr_err_code ndr_err;
@@ -105,6 +106,10 @@ NTSTATUS printing_tdb_migrate_driver(TALLOC_CTX *mem_ctx,
ZERO_STRUCT(r);
+ if (do_string_conversion) {
+ r.string_flags = LIBNDR_FLAG_STR_ASCII;
+ }
+
ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, &r,
(ndr_pull_flags_fn_t)ndr_pull_ntprinting_driver);
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
@@ -150,7 +155,8 @@ NTSTATUS printing_tdb_migrate_printer(TALLOC_CTX *mem_ctx,
struct rpc_pipe_client *winreg_pipe,
const char *key_name,
unsigned char *data,
- size_t length)
+ size_t length,
+ bool do_string_conversion)
{
struct dcerpc_binding_handle *b = winreg_pipe->binding_handle;
enum ndr_err_code ndr_err;
@@ -173,6 +179,10 @@ NTSTATUS printing_tdb_migrate_printer(TALLOC_CTX *mem_ctx,
ZERO_STRUCT(r);
+ if (do_string_conversion) {
+ r.info.string_flags = LIBNDR_FLAG_STR_ASCII;
+ }
+
ndr_err = ndr_pull_struct_blob(&blob, mem_ctx, &r,
(ndr_pull_flags_fn_t) ndr_pull_ntprinting_printer);
if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
diff --git a/source3/printing/nt_printing_migrate.h b/source3/printing/nt_printing_migrate.h
index 3da8db4626..0c9800ddcd 100644
--- a/source3/printing/nt_printing_migrate.h
+++ b/source3/printing/nt_printing_migrate.h
@@ -30,12 +30,14 @@ NTSTATUS printing_tdb_migrate_driver(TALLOC_CTX *mem_ctx,
struct rpc_pipe_client *winreg_pipe,
const char *key_name,
unsigned char *data,
- size_t length);
+ size_t length,
+ bool do_string_conversion);
NTSTATUS printing_tdb_migrate_printer(TALLOC_CTX *mem_ctx,
struct rpc_pipe_client *winreg_pipe,
const char *key_name,
unsigned char *data,
- size_t length);
+ size_t length,
+ bool do_string_conversion);
NTSTATUS printing_tdb_migrate_secdesc(TALLOC_CTX *mem_ctx,
struct rpc_pipe_client *winreg_pipe,
const char *key_name,
diff --git a/source3/printing/nt_printing_migrate_internal.c b/source3/printing/nt_printing_migrate_internal.c
index 7142a5cb24..200db07fe2 100644
--- a/source3/printing/nt_printing_migrate_internal.c
+++ b/source3/printing/nt_printing_migrate_internal.c
@@ -114,7 +114,8 @@ static NTSTATUS migrate_internal(TALLOC_CTX *mem_ctx,
winreg_pipe,
(const char *) kbuf.dptr + strlen(DRIVERS_PREFIX),
dbuf.dptr,
- dbuf.dsize);
+ dbuf.dsize,
+ false);
SAFE_FREE(dbuf.dptr);
if (!NT_STATUS_IS_OK(status)) {
tdb_close(tdb);
@@ -130,7 +131,8 @@ static NTSTATUS migrate_internal(TALLOC_CTX *mem_ctx,
winreg_pipe,
printer_name,
dbuf.dptr,
- dbuf.dsize);
+ dbuf.dsize,
+ false);
SAFE_FREE(dbuf.dptr);
if (!NT_STATUS_IS_OK(status)) {
tdb_close(tdb);