summaryrefslogtreecommitdiff
path: root/source3/locking
AgeCommit message (Collapse)AuthorFilesLines
1998-08-20Turning on blocking locking code. NB. Blocking lock requests that are notJeremy Allison1-0/+6
the head of an SMB request (ie. are part of a chain) will not be queued - this will be fixed when we move to the new chain code. In practice, this doesn't seem to cause much of a problem (in my admittedly limited testing) bug a debug level zero message will be placed in the log when this happens to help determine how real the problem is. smbd/locking.c: New debug messages. smbd/blocking.c: New blocking code - handles SMBlock, SMBlockread and SMBlockingX smbd/chgpasswd.c: Fix for master fd leak. smbd/files.c: Tidyup comment. smbd/nttrans.c: Added fnum to debug message. smbd/process.c: Made chain_reply() use construct_reply_common(). Added blocking lock queue processing into idle loop. smbd/reply.c: Added queue pushes for SMBlock, SMBlockread and SMBlockingX. Jeremy. (This used to be commit e1dd03ecda0bc6d7eaa31070c83774bb5679fd1b)
1998-08-19Makefile.in: Moved blocking lock code into smbd/blocking.c for link purposes.Jeremy Allison1-290/+0
include/includes.h: Added nterr.h. locking/locking.c: Moved blocking lock code into smbd/blocking.c for link purposes. smbd/close.c: Added blocking lock removal to file close. smbd/filename.c: Tidied up unix_convert() so I could read it (:-) in preparation for the stat_cache code. smbd/nttrans.c: Added WRITE_ATTRIBUTES check. smbd/reply.c: Fixed multibyte char problem in wildcard mask. Jeremy. (This used to be commit 148eaba3dadb1d0bd3ac3ef53da3d9811636e89a)
1998-08-17smbd/nttrans.c: Fixed bug in split off pipe code.Jeremy Allison1-4/+12
locking/locking.c: More blocking lock changes. Jeremy. (This used to be commit 2ca4fc95a4227645f1009a057d46b58508846a92)
1998-08-17much cleaner chain pointer handling for both files and pipes.Andrew Tridgell1-7/+6
the chain pointer is now stored as a static and is set whenever a handle is created or extracted. This also makes the code less error prone. (This used to be commit 068a862982bea726e8d7b1b4065d510b9840a272)
1998-08-16fixed some bugs in the locking_slow code caused by the recent changes.Andrew Tridgell1-8/+9
also fixed a couple of %s/%d bugs in locking slow that have been there for a while but are now revealed by the gcc printf argument testing. (This used to be commit 16228c185a7844a243db538aa1e5729e62a8bc4a)
1998-08-16server.c: fixed a bug in close_file() with the new files.c handling codeAndrew Tridgell1-2/+0
bitmap.c: added bitmap hanlding code in preparation for increasing the default max open files to several thousand (This used to be commit f573a65b67e7a57586fec57845598e49b157ee0a)
1998-08-15this checkin gets rid of the global Files[] array and makes it localAndrew Tridgell3-87/+75
in files.c it should now be faily easy to expand the default MAX_OPEN_FILES to many thousands. (This used to be commit b088c804f98908eb02f05ab2f2e8a61691a0a582)
1998-08-15configure: Changes for extra headers.Jeremy Allison2-8/+19
configure.in: Source for header changes. client/clitar.c: Fixed isXXX macros & debugs for gcc pedantic compile. include/config.h.in: Added MEMSET, BZERO, MEMORY, RPCSVC_YPCLNT, STRINGS headers. include/includes.h: Headers for the above. include/smb.h: Made SIGNAL_CAST POSIX by default void (*)(int). lib/access.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/charset.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/debug.c: Fixed signal functs. lib/kanji.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/smbrun.c: Fixed isXXX macros & debugs for gcc pedantic compile. lib/util.c: Fixed isXXX macros & debugs for gcc pedantic compile. libsmb/namequery.c: Fixed isXXX macros & debugs for gcc pedantic compile. locking/shmem.c: Fixed isXXX macros & debugs for gcc pedantic compile. locking/shmem_sysv.c: Fixed error messages in sysV stuff. nmbd/asyncdns.c: Fixed signal functs. nmbd/nmbd.c: Fixed isXXX macros & debugs for gcc pedantic compile. passdb/passdb.c: Fixed isXXX macros & debugs for gcc pedantic compile. passdb/smbpassfile.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/chgpasswd.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/ipc.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/nttrans.c: Fixed fsp code path. smbd/password.c: fixed HAVE_YP_GET_DEFAULT_DOMAIN problem. smbd/printing.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/reply.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/server.c: Fixed isXXX macros & debugs for gcc pedantic compile. smbd/trans2.c: Fixed core dump bug. smbd/uid.c: Fixed isXXX macros & debugs for gcc pedantic compile. Jeremy. (This used to be commit 1b9cbcd02e575dc0a95fa589f720df30a4acc46b)
1998-08-14this is the bug change to using connection_struct* instead of cnum.Andrew Tridgell4-96/+91
Connections[] is now a local array in server.c I might have broken something with this change. In particular the oplock code is suspect and some .dll files aren't being oplocked when I expected them to be. I'll look at it after I've got some sleep. (This used to be commit c7ee025ead4a85b6fa44a832047b878451845fb6)
1998-08-14Makefile.in: Changed so that make proto will work with ldap & nisplus.Jeremy Allison1-3/+3
locking/locking.c: Made #ifdef'ed out functions static for Make proto. lib/util.c: Re-instated old mask_match code for UNIX filesystem checks only. Client calls use the new mask_match code. Changed the name of the old function to unix_mask_match. Jeremy. (This used to be commit b68e756ff57622c6c74f28031d4be964d7b1c9bc)
1998-08-13More blocking lock code - still #ifdef'ed out - under development.Jeremy Allison1-10/+170
Jeremy. (This used to be commit c9695bdf2e22c3081841f116af37340308d447aa)
1998-08-12fixed the nested comment - Jeremy, do you want that unbecome_user() orAndrew Tridgell1-2/+1
not? (This used to be commit 638ee7d265982ca95ae7f49e2a84431bdf147c21)
1998-08-11include/smb.h: Removed dir_ptr. Not needed.Jeremy Allison2-11/+145
locking/locking.c: First cut a blocking lock code. #ifdef'ed out for now. locking/locking_shm.c: Removed dir_ptr. Not needed. smbd/nttrans.c: More work on ChangeNotify - return is not an error and needs to be handled as a nttrans with zero params. Removed dir_ptr. Not needed. smbd/reply.c: smbd/server.c: smbd/trans2.c: Removed dir_ptr. Not needed. Hmmm. At the moment smbclient is broken - doesn't issue prompt correctly. This needs looking at. Jeremy. (This used to be commit ddfbcc05815621d3c463f92faed047f126412342)
1998-08-03First implementation of ChangeNotify - this version only checksJeremy Allison1-9/+13
for changes in the directory modify timestamps. A better version will look at the requested client flags, and create a hash that represents the current state of the directory, and check against this instead. debug.c: Added lp_timestamp_logs() function. loadparm.c: Added "change notify timeout" in seconds (default 60) - this is the scan rate for a directory. Added ""timestamp logs" boolean - default True. Turns off log timestamps (so I can read them :-). nttrans.c: ChangeNotify implementation. server.c: ChangeNotify implementation. shmem_sysv.c: Added exits on shmem errors (without them smbd can core dump if some calls fail). smb.h: Added ChangeNotify flags for future use. util.c: Tidied up typedef. Jeremy. (This used to be commit a0748c3f53974483680ebe2ea4f556ece8d7fa43)
1998-07-30Makefile.in: Moved UBIQX stuff into UTILOBJ.Jeremy Allison2-11/+11
loadparm.c: Added "ole locking compatibility" option (default "true"). locking.c: Changes to implement union in files_struct. locking_shm.c: Changes to implement union in files_struct. nttrans.c: Made opening a directory explicit (we have to). Added create directory code for nttrans. reply.c: Changes to implement union in files_struct. server.c: Changes to implement union in files_struct. Added create directory code. trans2.c: Changes to implement union in files_struct. smb.h: Changes to implement union in files_struct. util.c: Changed linked list code to UNIQX linked list. This will make the other lists I need to implement for ChangeNotify and blocking locks easier. Jeremy. (This used to be commit 3a5eea850bb256b39cff8ace1e4fb4e0c1f5472b)
1998-07-29merge from the autoconf2 branch to the main branchAndrew Tridgell5-62/+21
(This used to be commit 3bda7ac417107a7b01d91805ca71c4330657ed21)
1998-07-29locking.c: Print messages when we downgrade a lock.Jeremy Allison1-0/+2
reply.c: Do the same mask expansion we do in trans2.c - needed for Win98. trans2.c: Make the mask expansion into a function call now we have to do it twice. Jeremy. (This used to be commit 7b3a9d6285cc0d1967155a68845e28c6296ecc67)
1998-07-28locking.c: Don't need to do map_lock_type on *testing* a lock, just on setting.Jeremy Allison1-2/+7
Jeremy. (This used to be commit 17f68cc86cafbb04dbd9cc6ecc0aac7b911c9b70)
1998-07-28loadparm.c: Added strict sync parameter.Jeremy Allison1-10/+34
locking.c: Added code to deal with real open mode of file. reply.c: Added strict sync parameter. server.c: Added strict sync parameter. Fixed open modes. Jeremy. (This used to be commit ed57b603b5c9333d588e62d774ad2be67e43ffd9)
1998-07-23locking.c: Added lock type to is_locked() and do_lock()Jeremy Allison1-27/+47
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)
1998-07-02nttrans.c: More NT SMB stuff.Jeremy Allison1-2/+9
shmem_sysv.c: Fix for shared memory problems on several systems, Second and subsequent use of shmget should use zero as the size. Fix from Veselin Terzic <vterzic@systems.DHL.COM> Jeremy. (This used to be commit 1cd94b24592ca31ffae671acfd83b0d42b212cab)
1998-06-05loadparm.c: Did it ! Changed defaults for 'case preserve' and 'short case ↵Jeremy Allison1-3/+3
preserve'. Also removed 'domain allow/deny' parameters. shmem_sysv.c: Added strerror code so I can see why sysV calls are failing. lib/rpc/server/srv_netlog.c: Removed code that used 'domain allow/deny' parameters - replaced with a comment so I will remember to fix this later. Jeremy. (This used to be commit 5f46c7c4b11a75f1ffbd806cde915b4bf28232db)
1998-05-12includes.h: SunOS doesn't have strcasecmp, solaris versions prior to 2.6 don'tJeremy Allison1-1/+1
have vsnprintf. locking_slow.c: slight tidy. make_smbcodepage.c: Use safe_strcpy instead of pstrcpy. nmbd_winsserver.c: Use pstrcpy instead of fstrcpy. smbmount.c: Fixed reported bug. util.c: Removed old fstrcpy/fstrcat functions. Jeremy. (This used to be commit f257d2e4bafd3944cca737699913a8d868279ca6)
1998-05-12This is a security audit change of the main source.Jeremy Allison3-11/+13
It removed all ocurrences of the following functions : sprintf strcpy strcat The replacements are slprintf, safe_strcpy and safe_strcat. It should not be possible to use code in Samba that uses sprintf, strcpy or strcat, only the safe_equivalents. Once Andrew has fixed the slprintf implementation then this code will be moved back to the 1.9.18 code stream. Jeremy. (This used to be commit 2d774454005f0b54e5684cf618da7060594dfcbb)
1998-05-11changed to use slprintf() instead of sprintf() just aboutAndrew Tridgell1-1/+1
everywhere. I've implemented slprintf() as a bounds checked sprintf() using mprotect() and a non-writeable page. This should prevent any sprintf based security holes. (This used to be commit ee09e9dadb69aaba5a751dd20ccc6d587d841bd6)
1998-04-10includes.h: Moved HPUX undefine of SEMMSL to where it actually does something.Jeremy Allison1-0/+41
ipc.c: Added Luke's debug statement. locking_slow.c: Added FTRUNCATE_NEEDS_ROOT code for broken systems that need it (not sure what these are yet). membuffer.c ntdomain.h proto.h lib/rpc/include/rpc_dce.h lib/rpc/include/rpc_srvsvc.h lib/rpc/parse/parse_prs.c lib/rpc/parse/parse_rpc.c lib/rpc/server/srv_pipe_hnd.c lib/rpc/server/srv_util.c: Re-merge of Luke's NTDOM changes 'cos he's a lazy git with carpel tunnel syndrome :-). Jeremy. (This used to be commit 52e3966fbcf7b5fbdbc7cbe9ac0b453ab5bf3217)
1998-03-22- added a check for broken RH5 include files. With the standard RH5Andrew Tridgell2-0/+15
includes (ie. unpatched RH5) Samba gets file corruption because of the incorrect definition of the shmid_ds structure. Updating your RH5 installation of glibc-devel fixes this. - don't try to fcntl_lock() a read-only fd in shmem.c - allow level 0 debug messages to get through in smbstatus (This used to be commit 45553771f90087a12db0153524146d42155d1d3f)
1998-01-22This is *not* a big change (although it looks like one).Jeremy Allison5-5/+5
This is merely updating the Copyright statements from 1997 to 1998. It's a once a year thing :-). NO OTHER CHANGES WERE MADE. Jeremy. (This used to be commit b9c16977231efb274e08856f7f3f4408dad6d96c)
1997-12-29a dummy change to shmem_sysv.c to try and break CVS out of a problemAndrew Tridgell1-0/+1
with the ntdom branch (This used to be commit 213c3a4ed27cdc689e941b9a6d70e02e8b7dedd4)
1997-12-16- handle ENOSPC in shmem init.Andrew Tridgell1-4/+6
- be a little bit more friendly about grabbing semaphores (This used to be commit 87f88708939a3b72b26716a0d6648c4ea2d14047)
1997-12-04don't use free and alloc as structure elementsAndrew Tridgell1-13/+13
(This used to be commit f7066355b00a169423b4f64f58567e19b52abc1b)
1997-11-29don't display locks for dead processes in smbstatusAndrew Tridgell2-5/+9
(This used to be commit c7df484ef6d746fb1f5b53007ee04fa54e5f2223)
1997-11-01don't use SEM_UNDO because of ridiculously small undo limits on someAndrew Tridgell1-1/+25
OSes. Instead add explicit checks for dead locks at startup. (This used to be commit 79858d610c37675b9dc56a949723053ac9b67620)
1997-11-01some locking code cleanupsAndrew Tridgell3-238/+222
(This used to be commit 6d77311d6cecabafb86c02e26b30724425ef6208)
1997-10-31change from * to ^ in hashing of device/inode. Using * meant that ifAndrew Tridgell1-1/+1
the device number happened to divide the number of hash buckets we would only use a small fraction of the hash buckets, which would slow things down. (This used to be commit 623ffd701f2f966875d396d8b2df74f0cf874cda)
1997-10-31- cleanup some warningsAndrew Tridgell1-2/+0
- redo the prototypes (This used to be commit 31dcb51e05914d49d81a3faef354aaf0ab9fa63f)
1997-10-29damn. We need root privilages to do semaphore operations even if weAndrew Tridgell1-28/+43
have done the semget() as root. The problem is that become_root() and unbecome_root() are so slow! I've provided two options. The default is to set the semaphores (but _not_ the shared memory) world writeable so that a become_root() isn't needed. Otherwise you can define SECURE_SEMAPHORES and pay the performance penalty. (This used to be commit 2bbd8d2cbc5cf1901859a181bc9ec29822995e51)
1997-10-29- don't allow locking to initialise twiceAndrew Tridgell1-1/+5
- check that it is initialised before de-initialising it! (This used to be commit 68ad7b91999216e5721207b5a79c3a66be7cf420)
1997-10-29clean up the hash entry code a bit. Got rid of lp_shmem_hash_size()Andrew Tridgell3-81/+88
and made it private to the 2 shmem implementations. Added new shmops->hash_size() function. Added code to handle the IPC system limits by looping decreasing the size of the resources (semaphores and shared memory) that we request until we get under the system limits, which can be quite low on some systems! Added checks that the creator of the IPC objects is root. Otherwise we would be open to a security hole where someone pre-creates the shared memory segment and attaches. (This used to be commit 6b6f624b63137d4750200e8cb4961b1402513632)
1997-10-28fix for broken sunos4 includes (doesn't have SHM_R)Andrew Tridgell1-0/+4
(This used to be commit 6ca96782ace2258707f49d204726a00baef9d941)
1997-10-28lower the default hash size if SEMMSL isn't definedAndrew Tridgell1-0/+5
(This used to be commit 9f0be847fdbcf0f8bbd69de6cdf277ae0440bcda)
1997-10-28SYSV IPC implementation of fast share modes.Andrew Tridgell3-306/+952
It will try sysv IPC first, then if that fails it will try mmap(), then after that it will try share files. I have defined USE_SYSV_IPC for Linux, Solaris and HPUX at the moment. Probably a lot more could have it defined. In fact, the vast majority of systems support it. Need autoconf again :-) It should actually be faster than the mmap() version, and doesn't need any lock files. This means the problem of the share mem file being on a NFS drive will be gone. (This used to be commit cc8fe0f0629eea9acc39e30d8d76d5890a5b6978)
1997-10-27change the default file permissions on the SHARE_MEM_FILE* toAndrew Tridgell4-41/+70
0644. smbstatus now gets only read permission on the share files and does no locking. also get rid of some unnecessary umask(0) calls. smbd always runs with umask(0) (This used to be commit c6ac10170dbba57dfebc54c50d79cb29d13bb442)
1997-10-22shared memory code cleanups (partly preparing for a possible sysVAndrew Tridgell2-43/+33
shared memory implementation) (This used to be commit 8d1993c71a5d5d32636f62ba9b9a9009ec74d730)
1997-10-20loadparm.c: Changed 'interfaces only' parameter to 'bind interfaces only'. AddedJeremy Allison1-1/+1
'dos filetimes' parameter for UTIME fix. locking_shm.c: Fixed typo (sorry Andrew :-). namepacket.c: Changed lp_interfaces_only() to lp_bind_interfaces_only(). proto.h: The usual. reply.c: Made filetime calls use new file_utime call (wrapper for sys_utime). server.c: Made filetime calls use new file_utime call (wrapper for sys_utime). system.c: Added Andrew's sanity checks to times in sys_utime(). time.c: Moved set_filetime() to server.c. Made null_mtime() global. trans2.c: Made filetime calls use new file_utime call (wrapper for sys_utime). Jeremy (jallison@whistle.com) (This used to be commit 41a1d81c112a82ad2ae1b3c4ee81051f133ce1ed)
1997-10-20a major share modes reorganisation.Andrew Tridgell3-1407/+1829
The shares modes code is now split into separate files. The shared memory implementation is in locking_shm.c. The slow implementation is in locking_slow.c It is all controlled by a struct share_ops structure that has function pointers to the implementation of all the functions needed by a share modes implementation. An initialisation function sets up this structure. This will make adding new implementations easy and clean. This also allowed me to get rid of the ugly code in smbstatus. Now status.c links to the locking code and calls methods in share_ops. I also renamed some things and generally organised things in a much cleaner fashion. Defines and structures specific to each implementation have been moved to the appropriate file and out of smb.h. (This used to be commit 65ab9adaa0d356b8041ed8a507ea52117f2a284e)
1997-10-17.cvsignore: Added make_smbcodepageJeremy Allison1-25/+50
interface.c: Added is_local_net(). locking.c: Added Fix for zero length share files from Gerald Werner <wernerg@mfldclin.edu> plus a race condition fix for the fix. nameannounce.c: Made function static. namedbresp.c: extern int ClientDGRAM removed - not used. namedbserver.c: extern int ClientDGRAM removed - not used. namedbsubnet.c: Added code to make sockets per subnet. namepacket.c: Added code to read from all sockets & filter. nameresp.c: extern int ClientDGRAM removed - not used. nameserv.c: Indentation tidyup :-). nameserv.h: Added sockets to struct subnet. nameservresp.c: Improved debug message. nmbd.c: Changed to terminte on listen_for_packets exiting. nmbsync.c: extern int ClientDGRAM & ClientNMB removed - not used. proto.h: The usual. util.c: Fixed debug message. Jeremy (jallison@whistle.com) (This used to be commit 6904c2de080b2a9702800e9e4126386ced20569d)
1997-10-15ipc.c: Adding Andrews become_root code to the main branch.Jeremy Allison1-29/+16
locking.c: Adding Andrews become_root code to the main branch. pipes.c: Fixing the close_file issue. proto.h: The usual. reply.c: Move smb_pass into NTDOMAIN defined code. Fixing the close_file issue. server.c: Fixing the close_file issue. trans2.c: Fixing the close_file issue. uid.c: Adding Andrews become_root code to the main branch. Jeremy (jallison@whistle.com) (This used to be commit 16fd4337f79ce33f91050c96c4a566221c5d9126)
1997-10-14Broke my own rule about checking in uncompiled source :-(.Jeremy Allison1-1/+1
Jeremy. (This used to be commit 9fd056c91196746e09f220a15171f3c97791dcce)
1997-10-14Added fixes for become_user braindamage.Jeremy Allison1-4/+20
Jeremy (jallison@whistle.com) (This used to be commit 08afa51f5c80f3da983781774378bc1646c431d7)