diff options
author | Gerald Carter <jerry@samba.org> | 2003-03-03 16:32:03 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2003-03-03 16:32:03 +0000 |
commit | d95f1e4260e66b0ab37b69105e7cc252e23bee16 (patch) | |
tree | 12e129e9d92adaf32e2898e7ddcd451941e12dbe /source3/rpc_server | |
parent | ba3ccc2928f0178034b48e27383e57a8cf1a4f21 (diff) | |
download | samba-d95f1e4260e66b0ab37b69105e7cc252e23bee16.tar.gz samba-d95f1e4260e66b0ab37b69105e7cc252e23bee16.tar.bz2 samba-d95f1e4260e66b0ab37b69105e7cc252e23bee16.zip |
* CR1868: only send a change notify message if we have something
that changed that the client is monitoring.
* couple of comments abnout how we need to validate driver names
on SetPrinter() and AddPrinter()
* up the debug level on some overly verbose dev mode parsing messages
(This used to be commit e8939165b77c9e2ea8b3cef2e85885b9812c7184)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_spoolss_nt.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index b321832930..a966326d3a 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -900,7 +900,7 @@ static void send_notify2_changes( SPOOLSS_NOTIFY_MSG_CTR *ctr, uint32 idx ) TALLOC_CTX *mem_ctx = notify_ctr_getctx( ctr ); SPOOLSS_NOTIFY_MSG_GROUP *msg_group = notify_ctr_getgroup( ctr, idx ); SPOOLSS_NOTIFY_MSG *messages; - + int sending_msg_count; if ( !msg_group ) { DEBUG(5,("send_notify2_changes() called with no msg group!\n")); @@ -949,6 +949,8 @@ static void send_notify2_changes( SPOOLSS_NOTIFY_MSG_CTR *ctr, uint32 idx ) /* build the array of change notifications */ + sending_msg_count = 0; + for ( i=0; i<msg_group->num_msgs; i++ ) { SPOOLSS_NOTIFY_MSG *msg = &messages[i]; @@ -957,6 +959,8 @@ static void send_notify2_changes( SPOOLSS_NOTIFY_MSG_CTR *ctr, uint32 idx ) if (!is_monitoring_event(p, msg->type, msg->field)) continue; + sending_msg_count++; + DEBUG(10,("process_notify2_message: Sending message type [%x] field [%x] for printer [%s]\n", msg->type, msg->field, p->dev.handlename)); @@ -1012,8 +1016,10 @@ static void send_notify2_changes( SPOOLSS_NOTIFY_MSG_CTR *ctr, uint32 idx ) data_len++; } - cli_spoolss_rrpcn( ¬ify_cli, mem_ctx, &p->notify.client_hnd, - data_len, data, p->notify.change, 0 ); + if ( sending_msg_count ) { + cli_spoolss_rrpcn( ¬ify_cli, mem_ctx, &p->notify.client_hnd, + data_len, data, p->notify.change, 0 ); + } } done: @@ -5886,6 +5892,9 @@ static WERROR update_printer(pipes_struct *p, POLICY_HND *handle, uint32 level, goto done; } + /* FIXME!!! If the driver has changed we really should verify that + it is installed before doing much else --jerry */ + /* Check calling user has permission to update printer description */ if (Printer->access_granted != PRINTER_ACCESS_ADMINISTER) { @@ -7177,6 +7186,9 @@ static WERROR spoolss_addprinterex_level_2( pipes_struct *p, const UNISTR2 *uni_ free_a_printer(&printer, 2); return WERR_PRINTER_ALREADY_EXISTS; } + + /* FIXME!!! smbd should check to see if the driver is installed before + trying to add a printer like this --jerry */ if (*lp_addprinter_cmd() ) { if ( !add_printer_hook(printer) ) { |