summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/rpc_server/srv_spoolss_nt.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c
index 6b447ad407..bb3b05d1b1 100644
--- a/source3/rpc_server/srv_spoolss_nt.c
+++ b/source3/rpc_server/srv_spoolss_nt.c
@@ -1493,7 +1493,6 @@ void do_drv_upgrade_printer(struct messaging_context *msg,
const char *drivername;
int snum;
int n_services = lp_numservices();
- size_t len;
tmp_ctx = talloc_new(NULL);
if (!tmp_ctx) return;
@@ -1505,8 +1504,7 @@ void do_drv_upgrade_printer(struct messaging_context *msg,
goto done;
}
- len = MIN(data->length,sizeof(drivername)-1);
- drivername = talloc_strndup(tmp_ctx, (const char *)data->data, len);
+ drivername = talloc_strndup(tmp_ctx, (const char *)data->data, data->length);
if (!drivername) {
DEBUG(0, ("do_drv_upgrade_printer: Out of memoery ?!\n"));
goto done;
@@ -1522,6 +1520,11 @@ void do_drv_upgrade_printer(struct messaging_context *msg,
continue;
}
+ /* ignore [printers] share */
+ if (strequal(lp_const_servicename(snum), "printers")) {
+ continue;
+ }
+
result = winreg_get_printer(tmp_ctx, server_info, msg,
lp_const_servicename(snum),
&pinfo2);