The Samba-Bugzilla – Attachment 11373 Details for
Bug 10770
Renaming a printer fails in Printer Management Console
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Adds some allocation checks
0001-spoolss-handle-SetPrinter-for-info-level-4.patch (text/plain), 2.97 KB, created by
Garming Sam
on 2015-08-28 01:53:13 UTC
(
hide
)
Description:
Adds some allocation checks
Filename:
MIME Type:
Creator:
Garming Sam
Created:
2015-08-28 01:53:13 UTC
Size:
2.97 KB
patch
obsolete
>From e1650abf8a5aa4ea5d8eed56b5d42da4550837dd Mon Sep 17 00:00:00 2001 >From: Garming Sam <garming@catalyst.net.nz> >Date: Tue, 18 Nov 2014 12:41:30 +1300 >Subject: [PATCH] spoolss: handle SetPrinter for info level 4 > >BUG: https://bugzilla.samba.org/show_bug.cgi?id=10770 > >Signed-off-by: Garming Sam <garming@catalyst.net.nz> >--- > source3/rpc_server/spoolss/srv_spoolss_nt.c | 79 +++++++++++++++++++++++++++++ > 1 file changed, 79 insertions(+) > >diff --git a/source3/rpc_server/spoolss/srv_spoolss_nt.c b/source3/rpc_server/spoolss/srv_spoolss_nt.c >index 0639b87..1577dc6 100644 >--- a/source3/rpc_server/spoolss/srv_spoolss_nt.c >+++ b/source3/rpc_server/spoolss/srv_spoolss_nt.c >@@ -7015,6 +7015,85 @@ WERROR _spoolss_SetPrinter(struct pipes_struct *p, > case 3: > return update_printer_sec(r->in.handle, p, > r->in.secdesc_ctr); >+ case 4: { >+ struct spoolss_PrinterInfo2 *old_printer; >+ struct spoolss_SetPrinterInfo2 *set_old_printer; >+ struct spoolss_SetPrinterInfoCtr *info_ctr; >+ struct dcerpc_binding_handle *b; >+ int snum; >+ TALLOC_CTX *tmp_ctx; >+ >+ tmp_ctx = talloc_new(p->mem_ctx); >+ if (tmp_ctx == NULL) { >+ return WERR_NOMEM; >+ } >+ >+ if (!get_printer_snum(p, r->in.handle, &snum, NULL)) { >+ TALLOC_FREE(tmp_ctx); >+ return WERR_BADFID; >+ } >+ >+ result = winreg_printer_binding_handle(tmp_ctx, >+ get_session_info_system(), >+ p->msg_ctx, >+ &b); >+ if (!W_ERROR_IS_OK(result)) { >+ TALLOC_FREE(tmp_ctx); >+ return result; >+ } >+ >+ result = winreg_get_printer(tmp_ctx, b, >+ lp_const_servicename(snum), >+ &old_printer); >+ if (!W_ERROR_IS_OK(result)) { >+ TALLOC_FREE(tmp_ctx); >+ return WERR_BADFID; >+ } >+ >+ old_printer->servername = talloc_strdup(tmp_ctx, r->in.info_ctr->info.info4->servername); >+ if (old_printer->servername == NULL) { >+ return WERR_NOMEM; >+ } >+ >+ old_printer->printername = talloc_strdup(tmp_ctx, r->in.info_ctr->info.info4->printername); >+ if (old_printer->printername == NULL) { >+ return WERR_NOMEM; >+ } >+ >+ old_printer->attributes = r->in.info_ctr->info.info4->attributes; >+ >+ set_old_printer = talloc_zero(tmp_ctx, struct spoolss_SetPrinterInfo2); >+ if (set_old_printer == NULL) { >+ return WERR_NOMEM; >+ } >+ >+ spoolss_printerinfo2_to_setprinterinfo2(old_printer, set_old_printer); >+ >+ info_ctr = talloc_zero(tmp_ctx, struct spoolss_SetPrinterInfoCtr); >+ if (info_ctr == NULL) { >+ return WERR_NOMEM; >+ } >+ >+ info_ctr->level = 2; >+ info_ctr->info.info2 = set_old_printer; >+ >+ result = update_printer(p, r->in.handle, >+ info_ctr, >+ r->in.devmode_ctr->devmode); >+ >+ if (!W_ERROR_IS_OK(result)) { >+ TALLOC_FREE(tmp_ctx); >+ return result; >+ } >+ >+ if (r->in.secdesc_ctr->sd) { >+ result = update_printer_sec(r->in.handle, p, >+ r->in.secdesc_ctr); >+ } >+ >+ TALLOC_FREE(tmp_ctx); >+ return result; >+ } > case 7: > return publish_or_unpublish_printer(p, r->in.handle, > r->in.info_ctr->info.info7); >-- >1.9.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 10770
:
10200
|
10201
|
10557
| 11373