From fcd42c0d23f8b89d7c62e41810e5c45e15fa4dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCnther=20Deschner?= Date: Mon, 3 Aug 2009 23:41:08 +0200 Subject: [PATCH] s3-spoolss: fix crash bug in spoolss_addprinterex_level_2. Guenther --- source/rpc_server/srv_spoolss_nt.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/source/rpc_server/srv_spoolss_nt.c b/source/rpc_server/srv_spoolss_nt.c index d24a44b..8c034e9 100644 --- a/source/rpc_server/srv_spoolss_nt.c +++ b/source/rpc_server/srv_spoolss_nt.c @@ -7780,7 +7780,7 @@ static WERROR spoolss_addprinterex_level_2( pipes_struct *p, const UNISTR2 *uni_ } /* you must be a printer admin to add a new printer */ - if (!print_access_check(NULL, snum, PRINTER_ACCESS_ADMINISTER)) { + if (!print_access_check(p->server_info, snum, PRINTER_ACCESS_ADMINISTER)) { free_a_printer(&printer,2); return WERR_ACCESS_DENIED; } -- 1.6.6.1 commit 6a9e0039100b57f9626e87defec6720c476b9789 Author: Jeremy Allison AuthorDate: Fri Jul 17 17:36:26 2009 -0700 Commit: Jeremy Allison CommitDate: Fri Jul 17 17:36:26 2009 -0700 Fix bug #6564 - SetPrinter fails (panics) as non root. Missing become_root()/unbecome_root() around reload_services. Jeremy. --- source/rpc_server/srv_spoolss_nt.c | 4 ++++ source/smbd/server.c | 1 + 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/source/rpc_server/srv_spoolss_nt.c b/source/rpc_server/srv_spoolss_nt.c index 48ac103..9dc1a26 100644 --- a/source/rpc_server/srv_spoolss_nt.c +++ b/source/rpc_server/srv_spoolss_nt.c @@ -309,7 +309,9 @@ static WERROR delete_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, const c return WERR_BADFID; /* What to return here? */ /* go ahead and re-read the services immediately */ + become_root(); reload_services(false); + unbecome_root(); if ( lp_servicenumber( sharename ) < 0 ) return WERR_ACCESS_DENIED; @@ -6034,7 +6036,9 @@ bool add_printer_hook(TALLOC_CTX *ctx, NT_USER_TOKEN *token, NT_PRINTER_INFO_LEV } /* reload our services immediately */ + become_root(); reload_services(false); + unbecome_root(); numlines = 0; /* Get lines and convert them back to dos-codepage */ diff --git a/source/smbd/server.c b/source/smbd/server.c index a1dec03..4b1c803 100644 --- a/source/smbd/server.c +++ b/source/smbd/server.c @@ -94,6 +94,7 @@ static void smb_conf_updated(struct messaging_context *msg, { DEBUG(10,("smb_conf_updated: Got message saying smb.conf was " "updated. Reloading.\n")); + change_to_root_user(); reload_services(False); }