summaryrefslogtreecommitdiff
path: root/source3/smbd/server.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-07-23 00:10:26 +0000
committerJeremy Allison <jra@samba.org>1998-07-23 00:10:26 +0000
commit06c0349c445958aebb8a4611bdb7082711585754 (patch)
tree68c22e9d853aa0f77717b519abb4832a52331f55 /source3/smbd/server.c
parentf5866fd4ba8da9acde87c7f9da8f1a242540e287 (diff)
downloadsamba-06c0349c445958aebb8a4611bdb7082711585754.tar.gz
samba-06c0349c445958aebb8a4611bdb7082711585754.tar.bz2
samba-06c0349c445958aebb8a4611bdb7082711585754.zip
locking.c: Added lock type to is_locked() and do_lock()
as the code in reply_lockingX wasn't taking account of the difference between read and write locks ! How did this ever work :-) ! reply.c: server.c: Add lock type to is_locked() and do_lock(). util.c: Also added code from klausr@ITAP.Physik.Uni-Stuttgart.De to fix problem with log files growing too large if an smbd writes less than 100 debug messages. Jeremy. (This used to be commit 80080abf772a470d5f0f4dcd4a75fb2a09a9fb2a)
Diffstat (limited to 'source3/smbd/server.c')
-rw-r--r--source3/smbd/server.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 9df2ed37bb..62ee75db0a 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -1948,7 +1948,7 @@ static void truncate_unless_locked(int fnum, int cnum, int token,
BOOL *share_locked)
{
if (Files[fnum].can_write){
- if (is_locked(fnum,cnum,0x3FFFFFFF,0)){
+ if (is_locked(fnum,cnum,0x3FFFFFFF,0,F_WRLCK)){
/* If share modes are in force for this connection we
have the share entry locked. Unlock it before closing. */
if (*share_locked && lp_share_modes(SNUM(cnum)))
@@ -2861,6 +2861,20 @@ max can be %d\n", num_interfaces, FD_SETSIZE));
return True;
}
close(Client); /* The parent doesn't need this socket */
+
+ /*
+ * Force parent to check log size after spawning child.
+ * Fix from klausr@ITAP.Physik.Uni-Stuttgart.De.
+ * The parent smbd will log to logserver.smb.
+ * It writes only two messages for each child
+ * started/finished. But each child writes, say, 50 messages also in
+ * logserver.smb, begining with the debug_count of the parent, before the
+ * child opens its own log file logserver.client. In a worst case
+ * scenario the size of logserver.smb would be checked after about
+ * 50*50=2500 messages (ca. 100kb).
+ */
+ force_check_log_size();
+
#endif /* NO_FORK_DEBUG */
} /* end for num */
} /* end while 1 */