1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-27 08:23:49 +03:00
Commit Graph

81 Commits

Author SHA1 Message Date
Stefan Metzmacher
3a28443079 r22009: change TDB_DATA from char * to unsigned char *
and fix all compiler warnings in the users

metze
2007-10-10 12:19:00 -05:00
Volker Lendecke
f3421ae4cf r21723: Make use of the per-hashchain "freelists" 2007-10-10 12:18:25 -05:00
Volker Lendecke
3f620d181d r21115: notify_internal.c needs to remove the table entry if a process has crashed. So
it needs the specific error message.

Make messages.c return NTSTATUS and specificially NT_STATUS_INVALID_HANDLE if
sending to a non-existent process.

Volker
2007-10-10 12:17:39 -05:00
Volker Lendecke
4a99fa2666 r21081: Add forgotten function 2007-10-10 12:17:34 -05:00
Volker Lendecke
c01f164dca r21076: Two pieces of infrastructure from Samba4: An API-compatible messaging wrapper
and tdb_wrap_open.

Volker
2007-10-10 12:17:33 -05:00
Volker Lendecke
c8ae60ed65 r21064: The core of this patch is
void message_register(int msg_type,
                      void (*fn)(int msg_type, struct process_id pid,
-                                void *buf, size_t len))
+                                void *buf, size_t len,
+                                void *private_data),
+                     void *private_data)
 {
        struct dispatch_fns *dfn;

So this adds a (so far unused) private pointer that is passed from
message_register to the message handler. A prerequisite to implement a tiny
samba4-API compatible wrapper around our messaging system. That itself is
necessary for the Samba4 notify system.

Yes, I know, I could import the whole Samba4 messaging system, but I want to
do it step by step and I think getting notify in is more important in this
step.

Volker
2007-10-10 12:17:32 -05:00
Jeremy Allison
da3d0b6234 r20174: If we're only going to call one handler per message
then terminate the traversal once we've done that.
Jeremy.
2007-10-10 12:16:29 -05:00
Jeremy Allison
2e9b6faeae r20165: Change messaging subsystem to only allow one message
per type - this is all we use right now and makes
re-entrancy problems with deleting handlers with
a message dispatch loop go away.
Jeremy.
2007-10-10 12:16:28 -05:00
Jeremy Allison
27a4c11214 r20160: Fix long-standing (ie. from initial code I think) bug
in tdb message processing. If we're inside a dispatch
function and we delete our own handler we'd walk onto
the next pointer from a deleted memory block. Fixes
crash bug in winbindd (and goodness knows where else).
Jeremy.
2007-10-10 12:16:28 -05:00
Volker Lendecke
1e4ee728df r17316: More C++ warnings -- 456 left 2007-10-10 11:38:25 -05:00
Jeremy Allison
4143aa83c0 r17294: Make the code a little cleaner. Instead of using the two
calls make it :

become_root_uid_only()
operation
unbecome_root_uid_only()

saving errno across the second call. Most of our internal
change calls can be replaced with these simple calls.

Jeremy
2007-10-10 11:38:24 -05:00
Jeremy Allison
4ace291278 r17293: After the results from the cluster tests in Germany,
fix the messaging code to call the efficient calls :

save_re_uid()
set_effective_uid(0);

messaging_op

restore_re_uid();

instead of using heavyweight become_root()/unbecome_root()
pairs around all messaging code. Fixup the messaging
code to ensure sec_init() is called (only once) so that non-root
processes still work when sending messages.

This is a lighter weight solution to become_root()/unbecome_root()
(which swaps all the supplemental groups) and should be more
efficient. I will migrate all server code over to using this
(a similar technique should be used in the passdb backend
where needed).

Jeremy.
2007-10-10 11:38:24 -05:00
Volker Lendecke
736e55101b r17231: Some patch cosmetics 2007-10-10 11:38:21 -05:00
Jeremy Allison
e99cedfb0c r16390: Klocwork #604 - ensure if NULL pointer we assert
if len != 0.
Jeremy.
2007-10-10 11:18:51 -05:00
Gerald Carter
1e0b79e591 r15003: patch based on code from Arkady Glabek <aglabek@centeris.com> to ensure that global memory is freed when unloading pam_winbind.so (needs more testing on non-linux platforms) 2007-10-10 11:15:55 -05:00
Gerald Carter
17e63ac4ed r13316: Let the carnage begin....
Sync with trunk as off r13315
2007-10-10 11:06:23 -05:00
Gerald Carter
939c3cb5d7 r10656: BIG merge from trunk. Features not copied over
* \PIPE\unixinfo
* winbindd's {group,alias}membership new functions
* winbindd's lookupsids() functionality
* swat (trunk changes to be reverted as per discussion with Deryck)
2007-10-10 11:04:48 -05:00
Volker Lendecke
b5e82bb512 r9619: Fix messages_pending_for_pid actually do what it's meant to do. This might be
a big relief on messages.tdb contention as ignoring processes with >1000
messages in printing/notify.c should work correctly now.

Jeremy, Jerry told me to ask you about printer scalability torture tests, this
might be a reason why you implemented the message_send_pid_with_timeout
using the signal (shudder) in the first place. :-)

While looking at that... Wouldn't it be better to not use the signal but have
an overall timeout for print_notify_send_messages using GetTimeOfDay & friends
and not use the alarm signal deep inside tdb.c?

Volker
2007-10-10 11:03:23 -05:00
Gerald Carter
a112c5570a r7440: * merge registry server changes from trunk (so far) for more
printmig.exe work
* merge the sys_select_signal(char c) change from trunk
  in order to keeo the winbind code in sync
2007-10-10 10:57:09 -05:00
Jeremy Allison
620f2e608f r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
2007-10-10 10:53:32 -05:00
Gerald Carter
540daf71d8 r1885: tighten the cache consistency with the ntprinters.tdb entry an the in memory cache associated with open printer handles; also make sure that register_messages_flags() doesn't overwrite the originally registers flags 2007-10-10 10:52:23 -05:00
Jeremy Allison
2e5e4c10d2 Limit the number of outstanding print notify messages for a process to
1000.
Jeremy.
-
Tim Potter
59f8fc438a Whoops - missed some tdb message registrations from a previous merge. -
Jeremy Allison
bf795b684e lib/messages.c: Check return from chainlock before modifying message queue.
Apply the job returned limit across all requests for job queues.
Jeremy.
-
Andrew Bartlett
04a5cbc896 Mege from HEAD - doxygen. -
Jeremy Allison
07efebb984 Add 3 second timeout when terminating server and sending print notify
messages. Stops build-up of large numbers of smbd's waiting to terminate
on large print throughput.
Jeremy.
-
Tim Potter
abb112ba2a Merge of REQ_DEBUGLEVEL messaging and debug_count fixes from HEAD. -
Jeremy Allison
ee0ceeff99 Added new message_send_pid() code that uses tdb append to reduce locking
contention on the messaging tdb.
Jeremy.
-
Jeremy Allison
b752c0340f First part of efficiency fixes for message sending to pid's (cutting down
the amount of time we hold tdb locks). Gulp down all messages at once rather
than reading/re-writing one at a time. NOTE: All dispatch routines *must*
be able to cope with incoming message on *odd* byte boundaries (all current
handlers do).
Jeremy.
-
Andrew Bartlett
3a7458f947 Merge from HEAD - make Samba compile with -Wwrite-strings without additional
warnings.  (Adds a lot of const).

Andrew Bartlett
-
Jeremy Allison
5d5762d178 Lots of fixes for error paths where tdb_fetch() data need freeing.
Found via a post from Arcady Chernyak <Arcady.Chernyak@efi.com>.
Jeremy.
-
Gerald Carter
65e7b5273b sync'ing up for 3.0alpha20 release -
Andrew Tridgell
03ac082dcb updated the 3.0 branch from the head branch - ready for alpha18 -
Jeremy Allison
e144c174ea Moved debug messages for grabbing/releasing mutex.
Jeremy.
-
Jeremy Allison
1b9f1a368f Don't hold the mutex for more than 20 seconds.
Jeremy.
-
Martin Pool
098905bea2 Add assertions that kill() is never accidentally passed a non-positive
pid.  This follows a bug in rsync where it would accidentally
kill(-1), removing all the user's processes.  I can't see any way this
would directly happen in Samba, but having the assertions seems
beneficial.

http://cvs.samba.org/cgi-bin/cvsweb/rsync/util.c.diff?r1=1.108&r2=1.109&f=h
-
Tim Potter
a3cea5e9ae getpid() -> sys_getpid() -
Tim Potter
b9ab79f30a Doc. -
Andrew Tridgell
eb196070e6 serialise all domain auth requests
this is needed because W2K will send a TCP reset to any open
connections that have not done a negprot when a second connection is
made. This meant that under heavy netlogon load a Samba domain member
would fail authentications.

Jeremy, you may wish to port this to 2.2.x
-
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
-
Martin Pool
53dd8b4539 If we receive a message that is not handled then emit a gentle warning
to the log.
-
Martin Pool
6bd5b7ce8e debug output on receipt of message. -
Martin Pool
22e510ea0d Add an output parameter to message_send_all that says how many
messages were sent, so you know how many replies to expect.

Const and doc religion.
-
Martin Pool
e2b080587c Doc how to reply to messages. -
Jeremy Allison
694372b2c4 Merged in JohnR's ping messaging extension.
Jeremy.
-
Jeremy Allison
dfb58f2276 Fixed enumeration of large numbers of groups from a Samba DC.
Tidied up debug messages in lib/messages.c
Jeremy.
-
Simo Sorce
60e907b7e8 move to SAFE_FREE() -
Andrew Tridgell
c26e0d3f27 got rid of USE_TDB_MMAP_FLAG as its not needed any more -
Simo Sorce
b29a549cdd Some fixes about malloc/Realloc and mem leak
thanks to andreas moroder
-
Jeremy Allison
840802f106 Added "use mmap" for HPUX.
Jeremy.
-