s3-spoolss: Use existing handle in printer_driver_files_in_use().
authorAndreas Schneider <asn@samba.org>
Thu, 28 Jul 2011 09:36:50 +0000 (11:36 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 28 Jul 2011 14:20:11 +0000 (16:20 +0200)
Autobuild-User: Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date: Thu Jul 28 16:20:11 CEST 2011 on sn-devel-104

source3/include/nt_printing.h
source3/printing/nt_printing.c
source3/rpc_server/spoolss/srv_spoolss_nt.c

index 0ac1995f5320b5225cfdd8770e052bfd50f1ff93..1f13a1a8e75101c3c66d5325400a6fbb884809e9 100644 (file)
@@ -150,8 +150,7 @@ bool printer_driver_in_use(TALLOC_CTX *mem_ctx,
                           struct dcerpc_binding_handle *b,
                           const struct spoolss_DriverInfo8 *r);
 bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx,
                           struct dcerpc_binding_handle *b,
                           const struct spoolss_DriverInfo8 *r);
 bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx,
-                                const struct auth_session_info *server_info,
-                                struct messaging_context *msg_ctx,
+                                struct dcerpc_binding_handle *b,
                                 struct spoolss_DriverInfo8 *r);
 bool delete_driver_files(const struct auth_session_info *server_info,
                         const struct spoolss_DriverInfo8 *r);
                                 struct spoolss_DriverInfo8 *r);
 bool delete_driver_files(const struct auth_session_info *server_info,
                         const struct spoolss_DriverInfo8 *r);
index 4eb375dddd320ced43aa673e8ae3894bec73cd62..2ceb540e3539eb1a533e60f46ab4861bc15e4713 100644 (file)
@@ -1401,8 +1401,7 @@ static bool trim_overlap_drv_files(TALLOC_CTX *mem_ctx,
 ****************************************************************************/
 
 bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx,
 ****************************************************************************/
 
 bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx,
-                                const struct auth_session_info *session_info,
-                                struct messaging_context *msg_ctx,
+                                struct dcerpc_binding_handle *b,
                                 struct spoolss_DriverInfo8 *info)
 {
        int                             i;
                                 struct spoolss_DriverInfo8 *info)
 {
        int                             i;
@@ -1412,7 +1411,6 @@ bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx,
        uint32_t num_drivers;
        const char **drivers;
        WERROR result;
        uint32_t num_drivers;
        const char **drivers;
        WERROR result;
-       struct dcerpc_binding_handle *b;
 
        if ( !info )
                return False;
 
        if ( !info )
                return False;
@@ -1425,14 +1423,6 @@ bool printer_driver_files_in_use(TALLOC_CTX *mem_ctx,
 
        /* get the list of drivers */
 
 
        /* get the list of drivers */
 
-       result = winreg_printer_binding_handle(mem_ctx,
-                                              session_info,
-                                              msg_ctx,
-                                              &b);
-       if (!W_ERROR_IS_OK(result)) {
-               return false;
-       }
-
        result = winreg_get_driver_list(mem_ctx, b,
                                        info->architecture, version,
                                        &num_drivers, &drivers);
        result = winreg_get_driver_list(mem_ctx, b,
                                        info->architecture, version,
                                        &num_drivers, &drivers);
index 79e62c4fd3f2aa3410c65fcf1c3c042fdfe4312a..b2200afef63cc83177350c51a7ad567870efc4e5 100644 (file)
@@ -2284,8 +2284,7 @@ WERROR _spoolss_DeletePrinterDriverEx(struct pipes_struct *p,
        if (delete_files &&
            (r->in.delete_flags & DPD_DELETE_ALL_FILES) &&
            printer_driver_files_in_use(tmp_ctx,
        if (delete_files &&
            (r->in.delete_flags & DPD_DELETE_ALL_FILES) &&
            printer_driver_files_in_use(tmp_ctx,
-                                       get_session_info_system(),
-                                       p->msg_ctx,
+                                       b,
                                        info)) {
                /* no idea of the correct error here */
                status = WERR_ACCESS_DENIED;
                                        info)) {
                /* no idea of the correct error here */
                status = WERR_ACCESS_DENIED;
@@ -2304,8 +2303,7 @@ WERROR _spoolss_DeletePrinterDriverEx(struct pipes_struct *p,
                        if (delete_files &&
                            (r->in.delete_flags & DPD_DELETE_ALL_FILES) &&
                            printer_driver_files_in_use(info,
                        if (delete_files &&
                            (r->in.delete_flags & DPD_DELETE_ALL_FILES) &&
                            printer_driver_files_in_use(info,
-                                                       get_session_info_system(),
-                                                       p->msg_ctx,
+                                                       b,
                                                        info_win2k)) {
                                /* no idea of the correct error here */
                                talloc_free(info_win2k);
                                                        info_win2k)) {
                                /* no idea of the correct error here */
                                talloc_free(info_win2k);