summaryrefslogtreecommitdiffstats
path: root/source/locking
Commit message (Collapse)AuthorAgeFilesLines
...
* configure: Changes for extra headers.Jeremy Allison1998-08-152-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 is the bug change to using connection_struct* instead of cnum.Andrew Tridgell1998-08-144-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.
* Makefile.in: Changed so that make proto will work with ldap & nisplus.Jeremy Allison1998-08-141-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.
* More blocking lock code - still #ifdef'ed out - under development.Jeremy Allison1998-08-131-10/+170
| | | | Jeremy.
* fixed the nested comment - Jeremy, do you want that unbecome_user() orAndrew Tridgell1998-08-121-2/+1
| | | | not?
* include/smb.h: Removed dir_ptr. Not needed.Jeremy Allison1998-08-112-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.
* First implementation of ChangeNotify - this version only checksJeremy Allison1998-08-031-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.
* Makefile.in: Moved UBIQX stuff into UTILOBJ.Jeremy Allison1998-07-302-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.
* merge from the autoconf2 branch to the main branchAndrew Tridgell1998-07-295-62/+21
|
* locking.c: Print messages when we downgrade a lock.Jeremy Allison1998-07-291-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.
* locking.c: Don't need to do map_lock_type on *testing* a lock, just on setting.Jeremy Allison1998-07-281-2/+7
| | | | Jeremy.
* loadparm.c: Added strict sync parameter.Jeremy Allison1998-07-281-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.
* locking.c: Added lock type to is_locked() and do_lock()Jeremy Allison1998-07-231-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.
* nttrans.c: More NT SMB stuff.Jeremy Allison1998-07-021-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.
* loadparm.c: Did it ! Changed defaults for 'case preserve' and 'short case ↵Jeremy Allison1998-06-051-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.
* includes.h: SunOS doesn't have strcasecmp, solaris versions prior to 2.6 don'tJeremy Allison1998-05-121-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 is a security audit change of the main source.Jeremy Allison1998-05-123-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.
* changed to use slprintf() instead of sprintf() just aboutAndrew Tridgell1998-05-111-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.
* includes.h: Moved HPUX undefine of SEMMSL to where it actually does something.Jeremy Allison1998-04-101-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.
* - added a check for broken RH5 include files. With the standard RH5Andrew Tridgell1998-03-222-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 is *not* a big change (although it looks like one).Jeremy Allison1998-01-225-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.
* a dummy change to shmem_sysv.c to try and break CVS out of a problemAndrew Tridgell1997-12-291-0/+1
| | | | with the ntdom branch
* - handle ENOSPC in shmem init.Andrew Tridgell1997-12-161-4/+6
| | | | - be a little bit more friendly about grabbing semaphores
* don't use free and alloc as structure elementsAndrew Tridgell1997-12-041-13/+13
|
* don't display locks for dead processes in smbstatusAndrew Tridgell1997-11-292-5/+9
|
* don't use SEM_UNDO because of ridiculously small undo limits on someAndrew Tridgell1997-11-011-1/+25
| | | | OSes. Instead add explicit checks for dead locks at startup.
* some locking code cleanupsAndrew Tridgell1997-11-013-238/+222
|
* change from * to ^ in hashing of device/inode. Using * meant that ifAndrew Tridgell1997-10-311-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.
* - cleanup some warningsAndrew Tridgell1997-10-311-2/+0
| | | | - redo the prototypes
* damn. We need root privilages to do semaphore operations even if weAndrew Tridgell1997-10-291-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.
* - don't allow locking to initialise twiceAndrew Tridgell1997-10-291-1/+5
| | | | - check that it is initialised before de-initialising it!
* clean up the hash entry code a bit. Got rid of lp_shmem_hash_size()Andrew Tridgell1997-10-293-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.
* fix for broken sunos4 includes (doesn't have SHM_R)Andrew Tridgell1997-10-281-0/+4
|
* lower the default hash size if SEMMSL isn't definedAndrew Tridgell1997-10-281-0/+5
|
* SYSV IPC implementation of fast share modes.Andrew Tridgell1997-10-283-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.
* change the default file permissions on the SHARE_MEM_FILE* toAndrew Tridgell1997-10-274-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)
* shared memory code cleanups (partly preparing for a possible sysVAndrew Tridgell1997-10-222-43/+33
| | | | shared memory implementation)
* loadparm.c: Changed 'interfaces only' parameter to 'bind interfaces only'. AddedJeremy Allison1997-10-201-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)
* a major share modes reorganisation.Andrew Tridgell1997-10-203-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.
* .cvsignore: Added make_smbcodepageJeremy Allison1997-10-171-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)
* ipc.c: Adding Andrews become_root code to the main branch.Jeremy Allison1997-10-151-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)
* Broke my own rule about checking in uncompiled source :-(.Jeremy Allison1997-10-141-1/+1
| | | | Jeremy.
* Added fixes for become_user braindamage.Jeremy Allison1997-10-141-4/+20
| | | | Jeremy (jallison@whistle.com)
* locking.c: Added fix for race condition in slow share mode code.Jeremy Allison1997-10-071-15/+56
| | | | | | | | | lsaparse.c: #ifdef'ed out code so this will compile - LUKE PLEASE CHECK THIS. pipes.c: #ifdef'ed out code so this will compile - LUKE PLEASE CHECK THIS. server.c: Fixed last known oplock race condition. smb.h: Re-removed USE_OPLOCK defines - someone checked in an old version. smbparse.c: #ifdef'ed out code so this will compile - LUKE PLEASE CHECK THIS. Jeremy (jallison@whistle.com)
* Finally ! Found & fixed crash bug with logging message when deletingJeremy Allison1997-10-061-1/+2
| | | | | | invalid share mode entries. Thanks to berg@wienrg.aut.alcatel.at (Dietmar Berg) for the stack backtrace. Jeremy (jallison@whistle.com)
* client.c: Changed shadowed variable.Jeremy Allison1997-10-061-18/+0
| | | | | | | | | | | | | locking.c: Removed USE_OPLOCKS - now the default. params.c: Removed unused variable. proto.h: Updated. reply.c: Removed USE_OPLOCKS - now the default. server.c: Removed USE_OPLOCKS - now the default. smb.h: Removed USE_OPLOCKS - now the default. smbparse.c: Changed shadowed variable. status.c: Removed USE_OPLOCKS - now the default. util.c: Removed USE_OPLOCKS - now the default. Jeremy (jallison@whistle.com)
* Making it harder for share_mode_entries to be left withJeremy Allison1997-10-031-5/+2
| | | | | non-zero op_type fields. Paranoia code really. Jeremy (jallison@whistle.com)
* locking.c: Fixed incorrect parameter count in debug statements. May explainJeremy Allison1997-10-031-6/+5
| | | | | | | | | | | | | | | | | | solaris crashes. reply.c: Added NT specific error code. Put oplock break code in correct place in reply_lockingX. server.c: Removed unneeded error mapping stuff. Fixed race condition in oplock code. trans2.c: Added NT specific error code. util.c: Added paranoia check in interpret_addr. Some core dumps reported here. Upped fcntl debug levels. Andrew. Please check the NT specific error code handling (search for the string "/* Ugly - NT specific hack - but needed (JRA) */", this makes NT and 95 clients behave correctly here - please check your Visual Basic apps with this code. Jeremy (jallison@whistle.com).
* OPLOCK CHECK-IN - oplocks are now *OPERATIONAL* !!!!Jeremy Allison1997-10-011-2/+242
| | | | | | | | | | | | | | | Yipeee. At least as far as I can check in a short time :-). local.h: Changed OPLOCK_BREAK_TIMEOUT to 30 seconds. locking.c: Big changes to delete oplocks on a share mode entry. proto.h: updated. reply.c: Added oplock break code in lockingX reply & readbraw reply. server.c: Add batch oplock code. Force server shutdown if client fails to respond to oplock break. smb.h: Fix silly slow share mode oplock define bug. status.c: Add oplock status info. Jeremy (jallison@whistle.com)
* Syncing up current oplock work in progress. #ifdef'ed outJeremy Allison1997-09-261-2/+7
| | | | | so should have no effect on other work. Jeremy (jallison@whistle.com)