summaryrefslogtreecommitdiff
path: root/source3/lib
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
commiteee29958f5cacc753f3fa324327e0d8b14ac3006 (patch)
tree938597b59dfed27cd34514b3f44b095a31a01043 /source3/lib
parentb9c5be4d79364db0fd3f9af186f165638cae1c54 (diff)
downloadsamba-eee29958f5cacc753f3fa324327e0d8b14ac3006.tar.gz
samba-eee29958f5cacc753f3fa324327e0d8b14ac3006.tar.bz2
samba-eee29958f5cacc753f3fa324327e0d8b14ac3006.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". (This used to be commit 02f154e729b0e8465d3e1e2ac794e6ab3844ce57)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/messages.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index 661a1ab0ef..f0e75d430a 100644
--- a/source3/lib/messages.c
+++ b/source3/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;
}