summaryrefslogtreecommitdiffstats
path: root/source/lib/messages.c
diff options
context:
space:
mode:
authorDavid O'Neill <dmo@samba.org>2001-01-23 20:25:25 +0000
committerDavid O'Neill <dmo@samba.org>2001-01-23 20:25:25 +0000
commit02f154e729b0e8465d3e1e2ac794e6ab3844ce57 (patch)
tree70f80532ede0a489cc7f7609347913e18724d04a /source/lib/messages.c
parent0ccc552203d6432cde844c5946b203b27f257b1a (diff)
downloadsamba-02f154e729b0e8465d3e1e2ac794e6ab3844ce57.tar.gz
samba-02f154e729b0e8465d3e1e2ac794e6ab3844ce57.tar.xz
samba-02f154e729b0e8465d3e1e2ac794e6ab3844ce57.zip
Changes from APPLIANCE_HEAD:
source/rpc_server/srv_spoolss_nt.c - add an access check to _spoolss_deleteprinter() to stop random users and passers by from deleting printers. source/lib/messages.c - converted global msg_all struct to a local in message_send_all() function. source/include/smb.h - added a success error code to the spoolss return codes. source/include/proto.h source/param/loadparm.c source/printing/printing.c - Added new parameter "total print jobs" to limit the total number of print jobs across all queues. Currently individual queues are limited by "max print jobs".
Diffstat (limited to 'source/lib/messages.c')
-rw-r--r--source/lib/messages.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/lib/messages.c b/source/lib/messages.c
index 661a1ab0ef6..f0e75d430a5 100644
--- a/source/lib/messages.c
+++ b/source/lib/messages.c
@@ -348,12 +348,12 @@ void message_deregister(int msg_type)
}
}
-static struct {
+struct msg_all {
int msg_type;
void *buf;
size_t len;
BOOL duplicates;
-} msg_all;
+};
/****************************************************************************
send one of the messages for the broadcast
@@ -361,11 +361,12 @@ send one of the messages for the broadcast
static int traverse_fn(TDB_CONTEXT *the_tdb, TDB_DATA kbuf, TDB_DATA dbuf, void *state)
{
struct connections_data crec;
+ struct msg_all *msg_all = (struct msg_all *)state;
memcpy(&crec, dbuf.dptr, sizeof(crec));
if (crec.cnum != -1) return 0;
- message_send_pid(crec.pid, msg_all.msg_type, msg_all.buf, msg_all.len, msg_all.duplicates);
+ message_send_pid(crec.pid, msg_all->msg_type, msg_all->buf, msg_all->len, msg_all->duplicates);
return 0;
}
@@ -376,11 +377,13 @@ use it. When we need efficient broadcast we can add it.
****************************************************************************/
BOOL message_send_all(TDB_CONTEXT *conn_tdb, int msg_type, void *buf, size_t len, BOOL duplicates_allowed)
{
+ struct msg_all msg_all;
+
msg_all.msg_type = msg_type;
msg_all.buf = buf;
msg_all.len = len;
msg_all.duplicates = duplicates_allowed;
- tdb_traverse(conn_tdb, traverse_fn, NULL);
+ tdb_traverse(conn_tdb, traverse_fn, &msg_all);
return True;
}