summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Baumbach <bb@sernet.de>2011-11-18 18:54:56 +0100
committerKarolin Seeger <kseeger@samba.org>2016-10-20 10:43:28 +0200
commit69ea4baefdb858b33a72c2f8226d54a2292f6dd1 (patch)
tree4c166a52113e53ab99aed35ea3b79d606b3cd0f3
parent8e2589e07414f63e75833da1418300c10ba9f77a (diff)
downloadsamba-69ea4baefdb858b33a72c2f8226d54a2292f6dd1.tar.gz
s3-printing: fix migrate printer code (bug 8618)
Removed path from driver files. We only need the basenames. (cherry picked from commit d61993043fcb7676a58658476421f5f4ff1a3fea) (cherry picked from commit 9f07ef2249dc21eab37cd5888623e6edc84b2b59) BUG: https://bugzilla.samba.org/show_bug.cgi?id=8618 Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Oct 5 19:19:39 CEST 2016 on sn-devel-144 (cherry picked from commit eb7555397fd4e9f66e041179aadff59f2a39d14f)
-rw-r--r--source3/printing/nt_printing_migrate.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/source3/printing/nt_printing_migrate.c b/source3/printing/nt_printing_migrate.c
index eacafa2a5f2..f56aa702bf1 100644
--- a/source3/printing/nt_printing_migrate.c
+++ b/source3/printing/nt_printing_migrate.c
@@ -3,6 +3,7 @@
* RPC Pipe client / server routines
*
* Copyright (c) Andreas Schneider 2010.
+ * Copyright (C) Bjoern Baumbach <bb@sernet.de> 2011
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -27,6 +28,20 @@
#include "librpc/gen_ndr/ndr_security.h"
#include "rpc_client/cli_winreg_spoolss.h"
+static const char *driver_file_basename(const char *file)
+{
+ const char *basefile;
+
+ basefile = strrchr(file, '\\');
+ if (basefile == NULL) {
+ basefile = file;
+ } else {
+ basefile++;
+ }
+
+ return basefile;
+}
+
NTSTATUS printing_tdb_migrate_form(TALLOC_CTX *mem_ctx,
struct rpc_pipe_client *winreg_pipe,
const char *key_name,
@@ -101,6 +116,7 @@ NTSTATUS printing_tdb_migrate_driver(TALLOC_CTX *mem_ctx,
WERROR result;
const char *driver_name;
uint32_t driver_version;
+ int i;
blob = data_blob_const(data, length);
@@ -123,8 +139,19 @@ NTSTATUS printing_tdb_migrate_driver(TALLOC_CTX *mem_ctx,
ZERO_STRUCT(d3);
ZERO_STRUCT(a);
+ /* remove paths from file names */
+ if (r.dependent_files != NULL) {
+ for (i = 0 ; r.dependent_files[i] != NULL; i++) {
+ r.dependent_files[i] = driver_file_basename(r.dependent_files[i]);
+ }
+ }
a.string = r.dependent_files;
+ r.driverpath = driver_file_basename(r.driverpath);
+ r.configfile = driver_file_basename(r.configfile);
+ r.datafile = driver_file_basename(r.datafile);
+ r.helpfile = driver_file_basename(r.helpfile);
+
d3.architecture = r.environment;
d3.config_file = r.configfile;
d3.data_file = r.datafile;