[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Sun Aug 8 10:10:07 MDT 2010
The branch, master has been updated
via f089675... s3: Lift the server_messaging_context from spoolss_setjob_1
via 18ff84b... s3: Lift the server_messaging_context from construct_printer_info6
via 35c39b0... s3: Lift the server_messaging_context from construct_printer_info2
via 73a5c2d... s3: Lift the server_messaging_context from construct_notify_jobs_info
via 788498d... s3: Lift the server_messaging_context from construct_notify_printer_info
via 02c0086... s3: Pass messaging_context through s_notify_info_data_table
via 1b60ead... s3: Lift the server_messaging_context from update_monitored_printq_cache
via ef208c5... s3: Lift the server_messaging_context from print_job_endpage
via d1f3a2e... s3: Lift the server_messaging_context from print_job_write
via ae1600b... s3: Lift the server_messaging_context from print_job_delete1
via de10824... s3: Lift the server_messaging_context from print_job_set_name
via 3b5b74c... s3: Lift the server_messaging_context from print_queue_update_with_lock
via c289450... s3: Lift the server_messaging_context from print_queue_update_internal
via 2b13864... s3: Lift the server_messaging_context from traverse_fn_delete
via 8b6d888... s3: Lift the server_messaging_context from print_unix_job
via 0b42349... s3: Lift the server_messaging_context from pjob_delete
via 6806ae7... s3: Lift the server_messaging_context from pjob_store
via 9ff35d0... s3: Lift the server_messaging_context from pjob_store_notify
via 128976e... s3: Lift the server_messaging_context from notify_printer_byname
via d62c73b... s3: Lift the server_messaging_context from notify_printer_location
via 83c4c04... s3: Lift the server_messaging_context from notify_printer_port
via f3313c5... s3: Lift the server_messaging_context from notify_printer_printername
via c427423... s3: Lift the server_messaging_context from notify_printer_sharename
via 7285e0d... s3: Lift the server_messaging_context from notify_printer_comment
via 4e4bf13... s3: Lift the server_messaging_context from notify_printer_driver
via b71debc... s3: Lift the server_messaging_context from notify_job_submitted
via aa5fd41... s3: Lift the server_messaging_context from notify_job_name
via 06cf2ae... s3: Lift the server_messaging_context from notify_job_username
via 7a9f94d... s3: Lift the server_messaging_context from notify_job_total_pages
via bd6626c... s3: Lift the server_messaging_context from notify_job_total_bytes
via edbed43... s3: Lift the server_messaging_context from notify_job_status
via 9b3a53a... s3: Lift the server_messaging_context from notify_job_status_byname
via 21811fe... s3: Lift the server_messaging_context from notify_printer_status
via 49d1847... s3: Lift the server_messaging_context from notify_printer_status_byname
via 30de2f7... s3: Lift the server_messaging_context from send_notify_field_buffer
via dddb5a8... s3: Lift the server_messaging_context from send_notify_field_values
via 6720c6e... s3: Lift the server_messaging_context from send_spoolss_notify2_msg
via fc6e7bd... s3: Lift the server_messaging_context from print_notify_event_send_messages
via c6e6aee... s3: Lift the server_messaging_context from print_queue_status
via a36103c... s3: Lift the server_messaging_context from get_stored_queue_info
via c50c973... s3: Lift the server_messaging_context from print_job_end
via a4c2778... s3: Lift the server_messaging_context from print_queue_length
via 31d23c8... s3: Lift the server_messaging_context from print_queue_update
via bc760e7... s3: Lift the smbd_messaging_context from start_background_queue
via 75b4dfd... s3: Lift the smbd_messaging_context from smbd_setup_sig_hup_handler
via 5281e62... s3: Lift the smbd_messaging_context from smbd_sig_hup_handler
via 39da717... s3: Lift the smbd_messaging_context from reload_services
via 7c7ffb7... s3: Lift the smbd_messaging_context from reload_printers
via 89b4c90... s3: Remove smbd_messaging_context from dummysmbd
from 9a4ac5b... s3: Fix the build without ADS
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit f0896759cef9de8ae4a4b5eb2d26586fb10bbf39
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 17:32:21 2010 +0200
s3: Lift the server_messaging_context from spoolss_setjob_1
commit 18ff84b089cbbdf5c29fc678417090caa0ecd8d1
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 17:31:38 2010 +0200
s3: Lift the server_messaging_context from construct_printer_info6
commit 35c39b07cc4d284b8e6af5212c4d602909ac6f30
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 17:30:57 2010 +0200
s3: Lift the server_messaging_context from construct_printer_info2
commit 73a5c2d02d5f768a952a219b5c62231b0f9af75b
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 17:29:12 2010 +0200
s3: Lift the server_messaging_context from construct_notify_jobs_info
commit 788498d2ff1b07cc94250395dd1da6bb63be2454
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 17:28:16 2010 +0200
s3: Lift the server_messaging_context from construct_notify_printer_info
commit 02c008613f6cd6fc12ac014cb311ca0285a30068
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 17:25:42 2010 +0200
s3: Pass messaging_context through s_notify_info_data_table
commit 1b60ead64add4920bf92b73a0e57e0a7e320e99f
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 17:19:12 2010 +0200
s3: Lift the server_messaging_context from update_monitored_printq_cache
commit ef208c5571bb20a0701f1da845c07f38f84c26e1
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 17:17:05 2010 +0200
s3: Lift the server_messaging_context from print_job_endpage
commit d1f3a2efb7eef8372b7431cc5de3f8ab5d6ac981
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 17:15:23 2010 +0200
s3: Lift the server_messaging_context from print_job_write
commit ae1600b99557e482fbb7aa04478b54b86976f6ae
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 17:12:52 2010 +0200
s3: Lift the server_messaging_context from print_job_delete1
commit de108248729cbed4464f0fb68b6f4b2d2bbdcc1e
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 17:11:23 2010 +0200
s3: Lift the server_messaging_context from print_job_set_name
commit 3b5b74c7dd931815e7b3763ad1cbf47c3710f60d
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 17:09:00 2010 +0200
s3: Lift the server_messaging_context from print_queue_update_with_lock
commit c2894503d1c66504e74f378141a9cfb221091c63
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 17:07:28 2010 +0200
s3: Lift the server_messaging_context from print_queue_update_internal
commit 2b13864569115a3f459a4ffffba36b1d33513c83
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 17:05:15 2010 +0200
s3: Lift the server_messaging_context from traverse_fn_delete
commit 8b6d88854c55553fce59aa8956d025b16f513a25
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 17:02:24 2010 +0200
s3: Lift the server_messaging_context from print_unix_job
commit 0b423493c30ca291ed09c9c2fc288d59635e79df
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 17:00:55 2010 +0200
s3: Lift the server_messaging_context from pjob_delete
commit 6806ae729065ed0914d89b84eb486b0fe8bec89a
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 16:54:09 2010 +0200
s3: Lift the server_messaging_context from pjob_store
commit 9ff35d0690f0938e489523d0528c9e5700cf82a3
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 16:50:17 2010 +0200
s3: Lift the server_messaging_context from pjob_store_notify
commit 128976e01121c877cb815e60504fb6a5391255a2
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 16:42:59 2010 +0200
s3: Lift the server_messaging_context from notify_printer_byname
commit d62c73b799baf908269835f2d69b1a2094ef23c6
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 16:41:31 2010 +0200
s3: Lift the server_messaging_context from notify_printer_location
commit 83c4c04121addc39ae7b13001545ed303b8adf1c
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 16:40:08 2010 +0200
s3: Lift the server_messaging_context from notify_printer_port
commit f3313c53078d60a437cfa4bea71995beb223b819
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 16:38:54 2010 +0200
s3: Lift the server_messaging_context from notify_printer_printername
commit c427423aeecfc8c123a75079d4398b093ab9bc76
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 16:37:21 2010 +0200
s3: Lift the server_messaging_context from notify_printer_sharename
commit 7285e0d5dd3f6186a919bbf04a66469d5c1090ea
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 16:35:56 2010 +0200
s3: Lift the server_messaging_context from notify_printer_comment
commit 4e4bf13e704f8e2af77cbc5099953380dc0758dc
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 16:34:44 2010 +0200
s3: Lift the server_messaging_context from notify_printer_driver
commit b71debcca0bc7adc99787ceee028e3ef3a0cb267
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 16:33:05 2010 +0200
s3: Lift the server_messaging_context from notify_job_submitted
commit aa5fd419b27b7c52eccc6c129b17d606e4635b3e
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 16:31:41 2010 +0200
s3: Lift the server_messaging_context from notify_job_name
commit 06cf2ae6ea3c8ef5e092dc3b465461746f3d466b
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 16:29:31 2010 +0200
s3: Lift the server_messaging_context from notify_job_username
commit 7a9f94dae87061b15245314cbe6d079f62f1db98
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 16:28:03 2010 +0200
s3: Lift the server_messaging_context from notify_job_total_pages
commit bd6626c40ce9806a6f5bc8aee4fe969028bda928
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 16:26:40 2010 +0200
s3: Lift the server_messaging_context from notify_job_total_bytes
commit edbed43119212c3642951516a1e6c065bd9db756
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 16:24:51 2010 +0200
s3: Lift the server_messaging_context from notify_job_status
commit 9b3a53a7a7f6b055bfa074fe6d3fcaa6d6ccc9ce
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 16:21:42 2010 +0200
s3: Lift the server_messaging_context from notify_job_status_byname
commit 21811fe72df202413ca7f65bf271d4c9fe1345c5
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 16:19:03 2010 +0200
s3: Lift the server_messaging_context from notify_printer_status
commit 49d18478fd952b360221852a0bc0e2f4f6427aea
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 16:16:37 2010 +0200
s3: Lift the server_messaging_context from notify_printer_status_byname
commit 30de2f735b160c0a3d311748066c73421f7a484d
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 16:09:20 2010 +0200
s3: Lift the server_messaging_context from send_notify_field_buffer
commit dddb5a8795643e79d1869d226ad018336d1d44c4
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 16:07:56 2010 +0200
s3: Lift the server_messaging_context from send_notify_field_values
commit 6720c6e071058a4b1dd0406d40fe6f30632044dc
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 16:01:51 2010 +0200
s3: Lift the server_messaging_context from send_spoolss_notify2_msg
commit fc6e7bdc9e752b7b5ee4b978a605dde5b7c075e4
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 15:59:00 2010 +0200
s3: Lift the server_messaging_context from print_notify_event_send_messages
commit c6e6aee0a0524cf68bb206b339040c4ccf208bb2
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 15:55:19 2010 +0200
s3: Lift the server_messaging_context from print_queue_status
commit a36103ca05109e402c4db57f892d61023d0e6104
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 15:53:06 2010 +0200
s3: Lift the server_messaging_context from get_stored_queue_info
commit c50c973036cda52c0ce04a5220168fbfa7195dc0
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 15:51:30 2010 +0200
s3: Lift the server_messaging_context from print_job_end
commit a4c27786ffe3b9513a0e64ce25f37dfe0ff0dc1b
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 15:47:51 2010 +0200
s3: Lift the server_messaging_context from print_queue_length
commit 31d23c83fef2b67c3afa4cf1d1f409086f92649d
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 15:39:48 2010 +0200
s3: Lift the server_messaging_context from print_queue_update
commit bc760e79c868c11af9771c0179c18c9d543b9294
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 15:35:31 2010 +0200
s3: Lift the smbd_messaging_context from start_background_queue
commit 75b4dfd14d4dac5268c01351768b2317fcce34fb
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 15:18:12 2010 +0200
s3: Lift the smbd_messaging_context from smbd_setup_sig_hup_handler
commit 5281e6294112a521e2c9603f1617b18107480973
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 15:15:01 2010 +0200
s3: Lift the smbd_messaging_context from smbd_sig_hup_handler
commit 39da717fe1583308239278615ac44f8b910c50e3
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 15:09:47 2010 +0200
s3: Lift the smbd_messaging_context from reload_services
commit 7c7ffb70fb53c8cedd388c016836d13107f28ac1
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 15:02:29 2010 +0200
s3: Lift the smbd_messaging_context from reload_printers
commit 89b4c905776fefc12c1e3cc4b1c47b64863e9f30
Author: Volker Lendecke <vl at samba.org>
Date: Sun Aug 8 14:59:47 2010 +0200
s3: Remove smbd_messaging_context from dummysmbd
-----------------------------------------------------------------------
Summary of changes:
source3/auth/auth_ntlmssp.c | 2 +-
source3/include/printing.h | 21 +++-
source3/include/proto.h | 78 ++++++++++----
source3/lib/dummysmbd.c | 5 -
source3/printing/notify.c | 122 +++++++++++++++------
source3/printing/printing.c | 212 ++++++++++++++++++++++-------------
source3/rpc_server/srv_spoolss_nt.c | 191 ++++++++++++++++++++-----------
source3/smbd/negprot.c | 4 +-
source3/smbd/process.c | 22 ++--
source3/smbd/reply.c | 2 +-
source3/smbd/server.c | 13 ++-
source3/smbd/server_reload.c | 16 ++--
source3/smbd/sesssetup.c | 10 +-
source3/smbd/smb2_sesssetup.c | 2 +-
source3/torture/vfstest.c | 2 +-
source3/utils/smbcontrol.c | 17 ++-
16 files changed, 468 insertions(+), 251 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/auth/auth_ntlmssp.c b/source3/auth/auth_ntlmssp.c
index c212bb3..bc0e9d2 100644
--- a/source3/auth/auth_ntlmssp.c
+++ b/source3/auth/auth_ntlmssp.c
@@ -122,7 +122,7 @@ static NTSTATUS auth_ntlmssp_check_password(struct ntlmssp_state *ntlmssp_state,
/* sub_set_smb_name checks for weird internally */
sub_set_smb_name(auth_ntlmssp_state->ntlmssp_state->user);
- reload_services(True);
+ reload_services(smbd_messaging_context(), True);
nt_status = make_user_info_map(&user_info,
auth_ntlmssp_state->ntlmssp_state->user,
diff --git a/source3/include/printing.h b/source3/include/printing.h
index 95b0ec6..334b7a1 100644
--- a/source3/include/printing.h
+++ b/source3/include/printing.h
@@ -116,13 +116,14 @@ void print_spool_terminate(struct connection_struct *conn,
int unpack_pjob( uint8 *buf, int buflen, struct printjob *pjob );
uint32 sysjob_to_jobid(int unix_jobid);
-void pjob_delete(const char* sharename, uint32 jobid);
bool print_notify_register_pid(int snum);
bool print_notify_deregister_pid(int snum);
bool print_job_exists(const char* sharename, uint32 jobid);
char *print_job_fname(const char* sharename, uint32 jobid);
struct spoolss_DeviceMode *print_job_devmode(const char* sharename, uint32 jobid);
-bool print_job_set_name(const char *sharename, uint32 jobid, const char *name);
+bool print_job_set_name(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 jobid, const char *name);
bool print_job_get_name(TALLOC_CTX *mem_ctx, const char *sharename, uint32_t jobid, char **name);
WERROR print_job_delete(struct auth_serversupplied_info *server_info,
struct messaging_context *msg_ctx,
@@ -133,15 +134,21 @@ bool print_job_pause(struct auth_serversupplied_info *server_info,
bool print_job_resume(struct auth_serversupplied_info *server_info,
struct messaging_context *msg_ctx,
int snum, uint32 jobid, WERROR *errcode);
-ssize_t print_job_write(int snum, uint32 jobid, const char *buf, SMB_OFF_T pos, size_t size);
-int print_queue_length(int snum, print_status_struct *pstatus);
+ssize_t print_job_write(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ int snum, uint32 jobid, const char *buf, SMB_OFF_T pos,
+ size_t size);
+int print_queue_length(struct messaging_context *msg_ctx, int snum,
+ print_status_struct *pstatus);
WERROR print_job_start(struct auth_serversupplied_info *server_info,
struct messaging_context *msg_ctx,
int snum, const char *docname, const char *filename,
struct spoolss_DeviceMode *devmode, uint32_t *_jobid);
-void print_job_endpage(int snum, uint32 jobid);
-NTSTATUS print_job_end(int snum, uint32 jobid, enum file_close_type close_type);
-int print_queue_status(int snum,
+void print_job_endpage(struct messaging_context *msg_ctx,
+ int snum, uint32 jobid);
+NTSTATUS print_job_end(struct messaging_context *msg_ctx, int snum,
+ uint32 jobid, enum file_close_type close_type);
+int print_queue_status(struct messaging_context *msg_ctx, int snum,
print_queue_struct **ppqueue,
print_status_struct *status);
WERROR print_queue_pause(struct auth_serversupplied_info *server_info,
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 4937c62..63a1095 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -4410,26 +4410,60 @@ uint32_t print_parse_jobid(const char *fname);
int print_queue_snum(const char *qname);
void print_notify_send_messages(struct messaging_context *msg_ctx,
unsigned int timeout);
-void notify_printer_status_byname(const char *sharename, uint32 status);
-void notify_printer_status(int snum, uint32 status);
-void notify_job_status_byname(const char *sharename, uint32 jobid, uint32 status,
+void notify_printer_status_byname(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 status);
+void notify_printer_status(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ int snum, uint32 status);
+void notify_job_status_byname(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 jobid,
+ uint32 status,
uint32 flags);
-void notify_job_status(const char *sharename, uint32 jobid, uint32 status);
-void notify_job_total_bytes(const char *sharename, uint32 jobid,
+void notify_job_status(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 jobid, uint32 status);
+void notify_job_total_bytes(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 jobid,
uint32 size);
-void notify_job_total_pages(const char *sharename, uint32 jobid,
+void notify_job_total_pages(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 jobid,
uint32 pages);
-void notify_job_username(const char *sharename, uint32 jobid, char *name);
-void notify_job_name(const char *sharename, uint32 jobid, char *name);
-void notify_job_submitted(const char *sharename, uint32 jobid,
+void notify_job_username(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 jobid, char *name);
+void notify_job_name(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 jobid, char *name);
+void notify_job_submitted(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 jobid,
time_t submitted);
-void notify_printer_driver(int snum, const char *driver_name);
-void notify_printer_comment(int snum, const char *comment);
-void notify_printer_sharename(int snum, const char *share_name);
-void notify_printer_printername(int snum, const char *printername);
-void notify_printer_port(int snum, const char *port_name);
-void notify_printer_location(int snum, const char *location);
-void notify_printer_byname( const char *printername, uint32 change, const char *value );
+void notify_printer_driver(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ int snum, const char *driver_name);
+void notify_printer_comment(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ int snum, const char *comment);
+void notify_printer_sharename(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ int snum, const char *share_name);
+void notify_printer_printername(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ int snum, const char *printername);
+void notify_printer_port(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ int snum, const char *port_name);
+void notify_printer_location(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ int snum, const char *location);
+void notify_printer_byname(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *printername, uint32 change,
+ const char *value);
/* The following definitions come from printing/pcap.c */
@@ -4442,7 +4476,8 @@ uint16 pjobid_to_rap(const char* sharename, uint32 jobid);
bool rap_to_pjobid(uint16 rap_jobid, fstring sharename, uint32 *pjobid);
void rap_jobid_delete(const char* sharename, uint32 jobid);
bool print_backend_init(struct messaging_context *msg_ctx);
-void start_background_queue(void);
+void start_background_queue(struct tevent_context *ev,
+ struct messaging_context *msg);
void printing_end(void);
/* The following definitions come from printing/printing_db.c */
@@ -4742,7 +4777,7 @@ void do_drv_upgrade_printer(struct messaging_context *msg,
uint32_t msg_type,
struct server_id server_id,
DATA_BLOB *data);
-void update_monitored_printq_cache( void );
+void update_monitored_printq_cache(struct messaging_context *msg_ctx);
void reset_all_printerdata(struct messaging_context *msg,
void *private_data,
uint32_t msg_type,
@@ -5545,7 +5580,8 @@ struct security_descriptor *get_nt_acl_no_snum( TALLOC_CTX *ctx, const char *fna
/* The following definitions come from smbd/process.c */
void smbd_setup_sig_term_handler(void);
-void smbd_setup_sig_hup_handler(void);
+void smbd_setup_sig_hup_handler(struct tevent_context *ev,
+ struct messaging_context *msg_ctx);
bool srv_send_smb(int fd, char *buffer,
bool no_signing, uint32_t seqnum,
bool do_encrypt,
@@ -5755,8 +5791,8 @@ int get_client_fd(void);
struct event_context *smbd_event_context(void);
struct messaging_context *smbd_messaging_context(void);
struct memcache *smbd_memcache(void);
-void reload_printers(void);
-bool reload_services(bool test);
+void reload_printers(struct messaging_context *msg_ctx);
+bool reload_services(struct messaging_context *msg_ctx, bool test);
void exit_server(const char *const explanation);
void exit_server_cleanly(const char *const explanation);
void exit_server_fault(void);
diff --git a/source3/lib/dummysmbd.c b/source3/lib/dummysmbd.c
index c79e080..ee88a78 100644
--- a/source3/lib/dummysmbd.c
+++ b/source3/lib/dummysmbd.c
@@ -65,11 +65,6 @@ struct event_context *smbd_event_context(void)
return NULL;
}
-struct messaging_context *smbd_messaging_context(void)
-{
- return NULL;
-}
-
/**
* The following two functions need to be called from inside the low-level BRL
* code for oplocks correctness in smbd. Since other utility binaries also
diff --git a/source3/printing/notify.c b/source3/printing/notify.c
index df9a150..9f07f6c 100644
--- a/source3/printing/notify.c
+++ b/source3/printing/notify.c
@@ -230,11 +230,13 @@ static void print_notify_event_send_messages(struct tevent_context *event_ctx,
struct timeval now,
void *private_data)
{
+ struct messaging_context *msg_ctx = talloc_get_type_abort(
+ private_data, struct messaging_context);
/* Remove this timed event handler. */
TALLOC_FREE(notify_event);
change_to_root_user();
- print_notify_send_messages(server_messaging_context(), 0);
+ print_notify_send_messages(msg_ctx, 0);
}
/**********************************************************************
@@ -265,7 +267,9 @@ static bool copy_notify2_msg( SPOOLSS_NOTIFY_MSG *to, SPOOLSS_NOTIFY_MSG *from )
Batch up print notify messages.
*******************************************************************/
-static void send_spoolss_notify2_msg(SPOOLSS_NOTIFY_MSG *msg)
+static void send_spoolss_notify2_msg(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ SPOOLSS_NOTIFY_MSG *msg)
{
struct notify_queue *pnqueue, *tmp_ptr;
@@ -328,16 +332,18 @@ to notify_queue_head\n", msg->type, msg->field, msg->printer));
DLIST_ADD_END(notify_queue_head, pnqueue, struct notify_queue *);
num_messages++;
- if ((notify_event == NULL) && (server_event_context() != NULL)) {
+ if ((notify_event == NULL) && (ev != NULL)) {
/* Add an event for 1 second's time to send this queue. */
- notify_event = tevent_add_timer(server_event_context(), NULL,
- timeval_current_ofs(1,0),
- print_notify_event_send_messages, NULL);
+ notify_event = tevent_add_timer(
+ ev, NULL, timeval_current_ofs(1,0),
+ print_notify_event_send_messages, msg_ctx);
}
}
-static void send_notify_field_values(const char *sharename, uint32 type,
+static void send_notify_field_values(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 type,
uint32 field, uint32 id, uint32 value1,
uint32 value2, uint32 flags)
{
@@ -363,10 +369,12 @@ static void send_notify_field_values(const char *sharename, uint32 type,
msg->notify.value[1] = value2;
msg->flags = flags;
- send_spoolss_notify2_msg(msg);
+ send_spoolss_notify2_msg(ev, msg_ctx, msg);
}
-static void send_notify_field_buffer(const char *sharename, uint32 type,
+static void send_notify_field_buffer(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 type,
uint32 field, uint32 id, uint32 len,
const char *buffer)
{
@@ -391,142 +399,188 @@ static void send_notify_field_buffer(const char *sharename, uint32 type,
msg->len = len;
msg->notify.data = CONST_DISCARD(char *,buffer);
- send_spoolss_notify2_msg(msg);
+ send_spoolss_notify2_msg(ev, msg_ctx, msg);
}
/* Send a message that the printer status has changed */
-void notify_printer_status_byname(const char *sharename, uint32 status)
+void notify_printer_status_byname(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 status)
{
/* Printer status stored in value1 */
int snum = print_queue_snum(sharename);
- send_notify_field_values(sharename, PRINTER_NOTIFY_TYPE,
+ send_notify_field_values(ev, msg_ctx, sharename, PRINTER_NOTIFY_TYPE,
PRINTER_NOTIFY_FIELD_STATUS, snum,
status, 0, 0);
}
-void notify_printer_status(int snum, uint32 status)
+void notify_printer_status(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ int snum, uint32 status)
{
const char *sharename = lp_servicename(snum);
if (sharename)
- notify_printer_status_byname(sharename, status);
+ notify_printer_status_byname(ev, msg_ctx, sharename, status);
}
-void notify_job_status_byname(const char *sharename, uint32 jobid, uint32 status,
+void notify_job_status_byname(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 jobid,
+ uint32 status,
uint32 flags)
{
/* Job id stored in id field, status in value1 */
- send_notify_field_values(sharename, JOB_NOTIFY_TYPE,
+ send_notify_field_values(ev, msg_ctx,
+ sharename, JOB_NOTIFY_TYPE,
JOB_NOTIFY_FIELD_STATUS, jobid,
status, 0, flags);
}
-void notify_job_status(const char *sharename, uint32 jobid, uint32 status)
+void notify_job_status(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 jobid, uint32 status)
{
- notify_job_status_byname(sharename, jobid, status, 0);
+ notify_job_status_byname(ev, msg_ctx, sharename, jobid, status, 0);
}
-void notify_job_total_bytes(const char *sharename, uint32 jobid,
+void notify_job_total_bytes(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 jobid,
uint32 size)
{
/* Job id stored in id field, status in value1 */
- send_notify_field_values(sharename, JOB_NOTIFY_TYPE,
+ send_notify_field_values(ev, msg_ctx,
+ sharename, JOB_NOTIFY_TYPE,
JOB_NOTIFY_FIELD_TOTAL_BYTES, jobid,
size, 0, 0);
}
-void notify_job_total_pages(const char *sharename, uint32 jobid,
+void notify_job_total_pages(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 jobid,
uint32 pages)
{
/* Job id stored in id field, status in value1 */
- send_notify_field_values(sharename, JOB_NOTIFY_TYPE,
+ send_notify_field_values(ev, msg_ctx,
+ sharename, JOB_NOTIFY_TYPE,
JOB_NOTIFY_FIELD_TOTAL_PAGES, jobid,
pages, 0, 0);
}
-void notify_job_username(const char *sharename, uint32 jobid, char *name)
+void notify_job_username(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 jobid, char *name)
{
send_notify_field_buffer(
+ ev, msg_ctx,
sharename, JOB_NOTIFY_TYPE, JOB_NOTIFY_FIELD_USER_NAME,
jobid, strlen(name) + 1, name);
}
-void notify_job_name(const char *sharename, uint32 jobid, char *name)
+void notify_job_name(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 jobid, char *name)
{
send_notify_field_buffer(
+ ev, msg_ctx,
sharename, JOB_NOTIFY_TYPE, JOB_NOTIFY_FIELD_DOCUMENT,
jobid, strlen(name) + 1, name);
}
-void notify_job_submitted(const char *sharename, uint32 jobid,
+void notify_job_submitted(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *sharename, uint32 jobid,
time_t submitted)
{
send_notify_field_buffer(
+ ev, msg_ctx,
sharename, JOB_NOTIFY_TYPE, JOB_NOTIFY_FIELD_SUBMITTED,
jobid, sizeof(submitted), (char *)&submitted);
}
-void notify_printer_driver(int snum, const char *driver_name)
+void notify_printer_driver(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ int snum, const char *driver_name)
{
const char *sharename = lp_servicename(snum);
send_notify_field_buffer(
+ ev, msg_ctx,
sharename, PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_FIELD_DRIVER_NAME,
snum, strlen(driver_name) + 1, driver_name);
}
-void notify_printer_comment(int snum, const char *comment)
+void notify_printer_comment(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ int snum, const char *comment)
{
const char *sharename = lp_servicename(snum);
send_notify_field_buffer(
+ ev, msg_ctx,
sharename, PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_FIELD_COMMENT,
snum, strlen(comment) + 1, comment);
}
-void notify_printer_sharename(int snum, const char *share_name)
+void notify_printer_sharename(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ int snum, const char *share_name)
{
const char *sharename = lp_servicename(snum);
send_notify_field_buffer(
+ ev, msg_ctx,
sharename, PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_FIELD_SHARE_NAME,
snum, strlen(share_name) + 1, share_name);
}
-void notify_printer_printername(int snum, const char *printername)
+void notify_printer_printername(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ int snum, const char *printername)
{
const char *sharename = lp_servicename(snum);
send_notify_field_buffer(
+ ev, msg_ctx,
sharename, PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_FIELD_PRINTER_NAME,
snum, strlen(printername) + 1, printername);
}
-void notify_printer_port(int snum, const char *port_name)
+void notify_printer_port(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ int snum, const char *port_name)
{
const char *sharename = lp_servicename(snum);
send_notify_field_buffer(
+ ev, msg_ctx,
sharename, PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_FIELD_PORT_NAME,
snum, strlen(port_name) + 1, port_name);
}
-void notify_printer_location(int snum, const char *location)
+void notify_printer_location(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ int snum, const char *location)
{
const char *sharename = lp_servicename(snum);
send_notify_field_buffer(
+ ev, msg_ctx,
sharename, PRINTER_NOTIFY_TYPE, PRINTER_NOTIFY_FIELD_LOCATION,
snum, strlen(location) + 1, location);
}
-void notify_printer_byname( const char *printername, uint32 change, const char *value )
+void notify_printer_byname(struct tevent_context *ev,
+ struct messaging_context *msg_ctx,
+ const char *printername, uint32 change,
+ const char *value)
{
int snum = print_queue_snum(printername);
int type = PRINTER_NOTIFY_TYPE;
@@ -534,7 +588,9 @@ void notify_printer_byname( const char *printername, uint32 change, const char *
if ( snum == -1 )
return;
- send_notify_field_buffer( printername, type, change, snum, strlen(value)+1, value );
+ send_notify_field_buffer(
+ ev, msg_ctx,
+ printername, type, change, snum, strlen(value)+1, value );
}
diff --git a/source3/printing/printing.c b/source3/printing/printing.c
index 9d98d5d..69191ef 100644
--- a/source3/printing/printing.c
+++ b/source3/printing/printing.c
@@ -557,7 +557,10 @@ static uint32 map_to_spoolss_status(uint32 lpq_status)
return 0;
}
-static void pjob_store_notify(const char* sharename, uint32 jobid, struct printjob *old_data,
+static void pjob_store_notify(struct tevent_context *ev,
--
Samba Shared Repository
More information about the samba-cvs
mailing list