From 3975203a0242a01fe6d3737f8f04ec80e90cb831 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 1 Oct 2010 06:42:58 +0200 Subject: s3-spoolss: fix do_drv_upgrade_printer() which must have been broken since the days we moved away from fstrings. Guenther --- source3/rpc_server/srv_spoolss_nt.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source3') 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); -- cgit