summaryrefslogtreecommitdiffstats
path: root/source3/rpc_server/srv_spoolss_util.c
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2010-09-29 04:51:56 +0200
committerGünther Deschner <gd@samba.org>2010-09-30 02:59:35 +0200
commit3797d48b76fadb988c40d056751be8671c9e6906 (patch)
tree06555231fd8974ba189c57c2f4f1c657e140ef47 /source3/rpc_server/srv_spoolss_util.c
parent156ab4ec104adf20257b2ef1e361382eac457ee3 (diff)
downloadsamba-3797d48b76fadb988c40d056751be8671c9e6906.tar.gz
samba-3797d48b76fadb988c40d056751be8671c9e6906.tar.xz
samba-3797d48b76fadb988c40d056751be8671c9e6906.zip
s3-spoolss: Fix servername/printername handling which turns out to be very important to get right.
Guenther
Diffstat (limited to 'source3/rpc_server/srv_spoolss_util.c')
-rw-r--r--source3/rpc_server/srv_spoolss_util.c50
1 files changed, 1 insertions, 49 deletions
diff --git a/source3/rpc_server/srv_spoolss_util.c b/source3/rpc_server/srv_spoolss_util.c
index cd5ffe245ff..b901d964072 100644
--- a/source3/rpc_server/srv_spoolss_util.c
+++ b/source3/rpc_server/srv_spoolss_util.c
@@ -1340,7 +1340,6 @@ static WERROR winreg_printer_ver_to_dword(const char *str, uint64_t *data)
WERROR winreg_create_printer(TALLOC_CTX *mem_ctx,
const struct auth_serversupplied_info *server_info,
struct messaging_context *msg_ctx,
- const char *servername,
const char *sharename)
{
uint32_t access_mask = SEC_FLAG_MAXIMUM_ALLOWED;
@@ -1572,12 +1571,7 @@ WERROR winreg_create_printer(TALLOC_CTX *mem_ctx,
goto done;
}
- if (servername != NULL) {
- info2->printername = talloc_asprintf(tmp_ctx, "\\\\%s\\%s",
- servername, sharename);
- } else {
- info2->printername = sharename;
- }
+ info2->printername = sharename;
if (info2->printername == NULL) {
result = WERR_NOMEM;
goto done;
@@ -1987,7 +1981,6 @@ done:
WERROR winreg_get_printer(TALLOC_CTX *mem_ctx,
const struct auth_serversupplied_info *server_info,
struct messaging_context *msg_ctx,
- const char *servername,
const char *printer,
struct spoolss_PrinterInfo2 **pinfo2)
{
@@ -2062,14 +2055,6 @@ WERROR winreg_get_printer(TALLOC_CTX *mem_ctx,
FILL_STRING(info2, EMPTY_STRING, info2->datatype);
FILL_STRING(info2, EMPTY_STRING, info2->parameters);
- if (servername != NULL && servername[0] != '\0') {
- info2->servername = talloc_asprintf(info2, "\\\\%s", servername);
- if (info2->servername == NULL) {
- result = WERR_NOMEM;
- goto done;
- }
- }
-
for (i = 0; i < num_values; i++) {
v = &enum_values[i];
@@ -2184,29 +2169,6 @@ WERROR winreg_get_printer(TALLOC_CTX *mem_ctx,
goto done;
}
- /* Create the printername */
- if (info2->servername != NULL && info2->servername[0] != '\0') {
- if (lp_force_printername(snum)) {
- const char *p = talloc_asprintf(info2, "%s\\%s",
- info2->servername,
- info2->sharename);
- if (p == NULL) {
- result = WERR_NOMEM;
- goto done;
- }
- info2->printername = p;
- } else {
- char *p = talloc_asprintf(info2, "%s\\%s",
- info2->servername,
- info2->printername);
- if (p == NULL) {
- result = WERR_NOMEM;
- goto done;
- }
- info2->printername = p;
- }
- }
-
/* Construct the Device Mode */
result = winreg_printer_query_binary(tmp_ctx,
winreg_handle,
@@ -2239,16 +2201,6 @@ WERROR winreg_get_printer(TALLOC_CTX *mem_ctx,
}
}
- if (info2->devmode != NULL) {
- info2->devmode->devicename = talloc_strdup(info2->devmode,
- info2->printername);
- if (info2->devmode->devicename == NULL) {
- DEBUG(0, ("winreg_get_printer: Failed to set devicename\n"));
- result = WERR_NOMEM;
- goto done;
- }
- }
-
result = winreg_get_printer_secdesc(info2,
server_info,
msg_ctx,