summaryrefslogtreecommitdiff
path: root/source/smbd/server.c
Commit message (Collapse)AuthorAgeFilesLines
* Copyright notices written to debug logs are now through 1998.Christopher R. Hertel1998-09-091-1/+1
| | | | Chris -)-----
* tridge the destroyer returns!Andrew Tridgell1998-09-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | prompted by the interpret_security() dead code that Jean-Francois pointed out I added a make target "finddead" that finds potentially dead (ie. unused) code. It spat out 304 function names ... I went through these are deleted many of them, making others static (finddead also reports functions that are used only in the local file). in doing this I have almost certainly deleted some useful code. I may have even prevented compilation with some compile options. I apologise. I decided it was better to get rid of this code now and add back the one or two functions that are needed than to keep all this baggage. So, if I have done a bit too much "destroying" then let me know. Keep the swearing to a minimum :) One bit I didn't do is the ubibt code. Chris, can you look at that? Heaps of unused functions there. Can they be made static?
* we are never interested in SIGPIPE so just ignore (block) itAndrew Tridgell1998-09-021-23/+3
| | | | always. Don't even install a handler.
* This checking fixes the statcache bug that stopped NetBench from runningJeremy Allison1998-08-281-1/+1
| | | | | | | | | | | | | | correctly. Added new parameter "stat cache size" - set to 50 by default. I now declare the statcache code officially "open" for business :-). It gets a hit rate of 97% with a NetBench run and seems to make using a case insensitive run as efficient as a case sensitive run. Also tidied up our sys_select usage - added a maxfd parameter and also added an implementation of select in terms of poll(), for systems where poll() is much faster. This is disabled by default. Jeremy.
* This is the stat cache code - seems to work fine (needs heavyJeremy Allison1998-08-271-1/+1
| | | | | | NetBench testing though.... :-). Attempts to efficiently reduce the number of stat() calls Samba does. Jeremy.
* nmbd and smbd had different behavior with respect to log files. nmbd wouldChristopher R. Hertel1998-08-211-7/+11
| | | | | | | | | | | | | | | default to overwrite and smbd would default to append. Also, the -a option (actually a toggle, such that "-a -a" would set the default) was documented as append mode for nmbd, and *overwrite mode* for smbd. nmbd now defaults to append mode, to match smbd. The -a option now always means append, and I've added the -o option to both, meaning overwrite. Note that the change to nmbd's default behavior may confuse some people. I've not seen anything about 2.0.0 changes in the WHATSNEW.txt file. Where would I document a change like this? Chris -)-----
* removed some of the rough edges from the splitupAndrew Tridgell1998-08-171-435/+451
|
* move soem variables from server.c that don't belong there.Andrew Tridgell1998-08-171-45/+0
|
* this completes the splitup of server.c.Andrew Tridgell1998-08-171-3322/+2
| | | | | | | | the splitup was done with an axe, not a scalpel, so there are some rough edges. I mostly wanted to get the general form right with fine tuning of what goes where to come later. Still, this is better than what we had before where server.c was a general repository for anything that didn't fit elsewhere.
* more splitting of server.cAndrew Tridgell1998-08-171-557/+16
| | | | created dosmode.c and filename.c
* now that we have no global arrays we can start to split up the monsterAndrew Tridgell1998-08-171-485/+0
| | | | | | | server.c without breaking things. this splits off netprot.c and fileio.c for negprot and read/write/seek handling respectively.
* moved connection_struct handling code into smbd/conn.c and changed itAndrew Tridgell1998-08-171-119/+18
| | | | to a linked list with bitmap format.
* much cleaner chain pointer handling for both files and pipes.Andrew Tridgell1998-08-171-4/+1
| | | | | | 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.
* some cleanups from the conversion of Pipes[] to a linked list. I alsoAndrew Tridgell1998-08-171-1/+1
| | | | | | | | removed most cases where a pnum is used and substituted a pipes_struct*. in files.c I added a offset of 0x1000 to all file handles on the wire. This makes it much less likely that bad parsing will give us the wrong field.
* got rid of the Files[] array completely (previously I'd just made itAndrew Tridgell1998-08-161-2/+2
| | | | | | | | | | | | | | | | | private to files.c) It now is a doubly linked list with a bitmap for allocated file numbers. Similarly for the fd_ptr code. I also changed the default maximum number of open files to 4096. The static cost is 1 bit per file. It all seems to work, and it passes the "does Sue scream" test, but if you see weird behaviour then please investigate. With the volume of new code that has gone in there are bound to be one or two bugs lurking. note that you must do a "make clean" before building this as many data structures have changed in size.
* server.c: fixed a bug in close_file() with the new files.c handling codeAndrew Tridgell1998-08-161-15/+14
| | | | | bitmap.c: added bitmap hanlding code in preparation for increasing the default max open files to several thousand
* this checkin gets rid of the global Files[] array and makes it localAndrew Tridgell1998-08-151-297/+81
| | | | | | | in files.c it should now be faily easy to expand the default MAX_OPEN_FILES to many thousands.
* configure: Changes for extra headers.Jeremy Allison1998-08-151-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-141-775/+726
| | | | | | | | 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.
* include/smb.h: Removed dir_ptr. Not needed.Jeremy Allison1998-08-111-27/+26
| | | | | | | | | | | | | | | 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.
* moved access.c into lib/ from smbd/ as it is needed by testparm. IAndrew Tridgell1998-08-101-3/+9
| | | | | modified it not to need any smbd specific structures and instead pass things from smbd.
* split the system password checking routines out of smbd/password.c andAndrew Tridgell1998-08-101-1/+2
| | | | | into passdb/pass_check.c. This means SWAT no longer needs to link to smbd/password.c
* loadparm.c: Added "debug timestamp" synonym for Chris.Jeremy Allison1998-08-041-16/+24
| | | | | | | nttrans.c: Moved common code into function in server.c Removed left over debug level 0. server.c: Moved common code into function in server.c Jeremy.
* First implementation of ChangeNotify - this version only checksJeremy Allison1998-08-031-1/+12
| | | | | | | | | | | | | | | | | | | 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.
* As per a Andrew's message, I went through and removed the timestring()Christopher R. Hertel1998-07-311-100/+139
| | | | | | | | | timestamps from several DEBUG messages. The timestamps are redundant now that DEBUG() provides them automatically. There are still a few more files to do, but I've got to get home for dinner. Chris -)-----
* Makefile.in: Moved UBIQX stuff into UTILOBJ.Jeremy Allison1998-07-301-61/+108
| | | | | | | | | | | | | | | | 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.
* get rid of the runtime test for broken getgroups() and add a compileAndrew Tridgell1998-07-291-8/+4
| | | | | time test instead. This also allows us to get rid of the igroups element of a couple of structures.
* merge from the autoconf2 branch to the main branchAndrew Tridgell1998-07-291-349/+54
|
* loadparm.c: Added strict sync parameter.Jeremy Allison1998-07-281-8/+6
| | | | | | | 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.
* chgpasswd.c: Fixed up debug calls to stop crashes if ptsname failed.Jeremy Allison1998-07-271-9/+2
| | | | | | | | | | | | local.h: Kept FSTYPE_STRING as Samba for now. nmbd_browsesync.c: Added bugfix from Matt Chapman mattyc@cyberdude.com - lmb_browserlist is now a struct ubi_dlList not a struct browse_cache_record *. server.c: smb.h: uid.c: password.c: Removed attrs code - it is not used anywhere. Jeremy
* locking.c: Added lock type to is_locked() and do_lock()Jeremy Allison1998-07-231-1/+15
| | | | | | | | | | | | 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.
* Fixed bug found by Richard Sharpe. After increasing files_struct size byJeremy Allison1998-07-221-9/+9
| | | | | | | | | MAX_OPEN_DIRECTORIES for nttrans I forgot to update the code that enumerates the array. Created new MAX_FNUMS in local.h, changed all code that iterates through the files_struct array to use this. (sorry Richard). Jeremy.
* Forgot to increase size of files_struct by MAX_OPEN_DIRECTORIES inJeremy Allison1998-07-171-1/+1
| | | | | previous checkin. Jeremy.
* Code added to fix the renaming of a directory under NT SMB calls.Jeremy Allison1998-07-171-23/+102
| | | | | | | | | | | | | | | | local.h: Changed MAXDIR to MAX_OPEN_DIRECTORIES - shmem size also tuned by this. dir.c: Use MAX_OPEN_DIRECTORIES. nttrans.c: Allow opening of a directory to succeed. Doesn't actually open a file descriptor but takes a files_struct slot marked as an fd. reply.c: Changed to close any outstanding is_directory files. reply_close changed to understand directory files. server.c: Added open_directory(), close_directory() calls. smb.h: Added is_directory to files_struct. Changed OPEN_FNUM to check that target is !is_directory (this prevents the normal file calls from processing a directory files_struct. Jeremy.
* Makefile: Added nttrans.oJeremy Allison1998-07-161-3/+3
| | | | | | | | | includes.h: Added termios.h for AIX. nttrans.c: Working NT SMB calls ! pipes.c: Use strequal instead of strcmp. server.c: Use #defines rather than numbers. smb.h: Updated NT SMB #defines. Jeremy.
* loadparm.c:Jeremy Allison1998-07-141-88/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | With apologies to Charlton Heston and Pierre Boule. "You damn fools, you finally did it". Changed default security mode to be security=user. Yes this is a big (although small in code) change. It's something we've been discussing for a while, to finally wean people off the legacy security=share mode which is *never* what you want. Jeremy. nmbd_incomingrequests.c: Bug fix for nmbd core dumps caused by overrun. Found by <samuel@public.szonline.net>. nttrans.c: More NT smb stuff. reply.c: Unlink will overwrite an existing file. Well you learn something new about POSIX every day. :-). server.c: Tidyup unreadable code. smbpasswd.c: Code to allow -U remote_username to allow ordinary users to change remote passwords if their NT username is different from their UNIX username. Patch from <torbjorn.lindh@allgon.se>. Jeremy.
* nttrans.c: More NT SMB stuff.Jeremy Allison1998-07-111-3/+16
| | | | | | | | reply.c: Broke out the internals of reply_mv so that they may be called externally from the NT transact rename. server.c: Changed stat calls to sys_stat - found in code review of bugfix. Jeremy.
* Fix for bug PR#8294 reported by <detlef.lammermann@er.materna.de>Jeremy Allison1998-07-101-1/+8
| | | | | | | - the Files array was storing the 'dos_to_unix' translated name, rather than the untranslated name. This could case problems when the name was run through dos_to_unix again. Jeremy.
* Needed fix to SIGHUP handling donated by branko.cibej@hermes.siJeremy Allison1998-07-091-8/+29
| | | | | (I can't believe we've had that bug so long :-). Jeremy.
* Added SSL support from Christian Starkjohann <cs@obdev.at>Jeremy Allison1998-06-161-0/+25
| | | | | | | This patch may not yet compile with -DUSE_SSL enabled, further Makefile changes may be needed. But it was important to get this code in place before I go off to USENIX. Jeremy.
* ipc.c: map_username is now a BOOL function.Jeremy Allison1998-06-121-28/+42
| | | | | | | | | | | reply.c: map_username is now a BOOL function. server.c: Added capability to do map_username on service names when looking for a home directory. That's what the original code would do. lib/rpc/server/srv_util.c: Changed domain_ to builtin_ for BUILTIN aliases. username.c: Work in progress on groupname map parameter. Jeremy
* Minor changes as I've now discovered gcc -pedantic-errors. ThisJeremy Allison1998-06-101-2/+1
| | | | | does the signed/unsigned warnings I've been missing. Jeremy
* ipc.c: Fix bug where we don't return the correct error code when clientJeremy Allison1998-06-031-82/+258
| | | | | | | | | | gives a too-small buffer for share info. Fix from Gil Kloepfer <gil@arlut.utexas.edu> smb.h: server.c: Fix for a nastly little security problem with multi-user Windows NT servers and Samba where the contents of the open-file cache can end up being served out to users who shouldn't have access. This is some *seriously* ugly code. Jeremy.
* loadparm.c: Added machine password timeout parameter - set to 7 days be default.Jeremy Allison1998-05-271-0/+47
| | | | | | | | | password.c: Added code to tell server.c when machine password needs changing. server.c: Change machine password in idle cycles if it needs it. smbpassfile.c: Fixed up length calculations for machine password file. smbpasswd.c: Moved domain joining code/machine password changing code. lib/rpc/client/cli_netlogon.c: And this is where it now lives. Jeremy.
* Abstracted all the crappy password interfaces through an indirectJeremy Allison1998-05-181-0/+3
| | | | | | | | function table, selectable at compile time. This should make the code that implements all the password functions much cleaner, as it's now very clear exactly what a particular password database needs to provide to Samba. Jeremy.
* resolving compilation errorsLuke Leighton1998-05-181-1/+1
|
* passdb.cJeremy Allison1998-05-141-181/+2
| | | | | | | | | | server.c: Moved generate_machine_sid() into passdb.c for Jean-Francois (who might want an LDAP version). Changed locking to free exclusive lock as soon as possible to prevent contention. lib/rpc/parse/parse_samr.c lib/rpc/server/srv_samr.c: Changed last SID-as-string manipulation function to use DOM_SID structure. Jeremy.
* namequery.c: Fixed SGI IRIX 5.x compiler problem.Jeremy Allison1998-05-141-2/+191
| | | | | | server.c: Added MACHINE.SID file generation - use lp_domain_sid() be default. smbpass.c: Exposed do_file_lock() as I now use it in server.c Jeremy.
* This is a security audit change of the main source.Jeremy Allison1998-05-121-28/+28
| | | | | | | | | | | | | | | | | | 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-4/+4
| | | | | | | 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.