summaryrefslogtreecommitdiffstats
path: root/source/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* This is a *big* checkin that may break some things, but implements theJeremy Allison2000-04-221-19/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | new open mechanism Andrew & I discussed. config.sub: configure: Included the QNX patch. include/vfs.h: smbd/vfs-wrap.c: smbd/vfs.c: Added ftruncate vfs call (needed). Note that we will also need locking calls in the vfs (to be added). lib/util_unistr.c: nmbd/nmbd_processlogon.c: Fix for NT domain logons causing nmbd to core dump. Also fix for sidsize DOS bug. locking/locking.c: Check value of ret before using it for memdup. printing/printing.c: Convert print_fsp_open to return an allocated fsp. rpc_server/srv_lsa.c: Fix for NT domain logons. I have removed all use of lp_share_modes() from the code (although I left the parameter in the table for backwards compatibility). It no longer makes sense for this to exist. smbd/close.c: Removed lp_share_modes(). smbd/fileio.c: Fixed parameters to unlock_share_entry call in panic code. smbd/files.c: Correctly set the unix_ERR_code to ERRnofids on fsp allocation fail. smbd/nttrans.c: smbd/reply.c: smbd/trans2.c: Changed all occurrences of open_file_shared/open_directory/ open_file_stat to return an fsp from the call. smbd/open.c: Changed all occurrences of open_file_shared/open_directory/ open_file_stat to return an fsp from the call. In addition I have fixed a long standing race condition in the deny mode processing w.r.t. two smbd's creating a file. Andrew, please note that your original idea of using open with O_EXCL in this case would not work (I went over the races very carefully) and so we must re-check deny modes *after* the open() call returns. This is because there is a race between the open with O_EXCL and the lock of the share mode entry. Imagine the case where the first smbd does the open with O_EXCL and a deny mode of DENY_ALL, but is pre-empted before it locks the share modes and creates the deny mode entry for DENY_ALL. A second smbd could then come in with O_RDONLY and a deny mode of DENY_NONE and the two opens would be allowed. The *only* way to fix this race is to lock the share modes after the open and then do the deny mode checks *after* this lock in the case where the file did not originally exist. This code will need extensive testing but seems to initially work. Jeremy.
* split fsusage() into a separate module (to fix linking problems withAndrew Tridgell2000-04-191-0/+149
| | | | spoolssd in tng)
* - got rid of the "passive" optionAndrew Tridgell2000-04-192-77/+54
| | | | - cleaned up the standard_sub_*() calls a lot
* fixed some crash bugs in the nt forms parsingAndrew Tridgell2000-04-181-0/+2
|
* got rid of some more old configure tests and includesAndrew Tridgell2000-04-171-17/+0
|
* moved standard_sub() and friends into a separate moduleAndrew Tridgell2000-04-172-269/+296
|
* converted a couple more functions to use a fd instead of a FILE*Andrew Tridgell2000-04-161-0/+23
| | | | | added a new utility fn file_lines_slashcont() which is used to handle files that treat a \ followed by a newline as a blank
* converted a bunch more functions to use a fd instead of a FILE*Andrew Tridgell2000-04-162-99/+105
| | | | | | | to support some of this I added the following functions in util_file.c file_lines_pload : load lines from a pipe file_pload : load a pipe into memory
* added fdprintf()Andrew Tridgell2000-04-162-2/+34
| | | | | | | this is like fprintf() but operates on a file descriptor combined with file_load_lines() this makes it really easy to get rid of the use of fopen() in Samba.
* the new file_lines_load() and file_lines_free() routines. Very useful!Andrew Tridgell2000-04-161-0/+64
| | | | | | | | | | | | | | | | | | | | | ------------ The following series of commits are for the new tdb based printing backend. This completely replaces our old printing backend. Major changes include: - all print ops are now done in printing/*.c rather than scattered all over the place - system job ids are decoupled from SMB job ids - the lpq parsers don't need to be nearly so smart, they only need to parse the filename, the status and system job id - we can store lots more info about a job, including the full job name - the queue cache control is much better I also added a new utility routine file_lines_load() that loads a text file and parses it into lines. This is used in out lpq parsing and I also want to use it to replace all of our fgets() based code in other places.
* added standard_sub_snum() function for modules that don't haveAndrew Tridgell2000-04-151-1/+8
| | | | a connection structure
* use macros for table boundariesAndrew Tridgell2000-04-151-6/+9
|
* a quick hack to reduce the size of the unicode map table headers fromAndrew Tridgell2000-04-151-9/+39
| | | | | | | 3MB to 250k. I split the table into 3 sections, after noticing that 5/6 of the table was empty.
* use open() not fopen() on codepage files.Andrew Tridgell2000-04-151-7/+7
| | | | | in general we need to get rid of all uses of fopen(). The hard one will be the debug code and dbf.
* Log file check patch from Mattias Gronlund <Mattias.Gronlund@sa.erisoft.se>.Jeremy Allison2000-04-151-6/+32
| | | | | | | Modified to do checks in timeout processing not in main loop. This (IMHO) is the correct place as (a) we are already root, and (b) it is guarenteed to be called every 200 smb requests. Jeremy.
* use interpret_addr2() instead of inet_aton()Andrew Tridgell2000-04-141-1/+1
|
* Removed "ole locking compat" parameter (no longer used).Jeremy Allison2000-04-121-34/+1
| | | | | | We now get/set/check POSIX locks, but I still need to code up the close fd braindamage... Jeremy.
* Roll back to using static MACHINE.SID after consultation with Andrew. ThisJeremy Allison2000-04-121-288/+0
| | | | | | code will be removed soon and a SID auto-generated from (probably) primary hostname and never stored in a file will replace it. Jeremy.
* include/byteorder.h: ALIGN4/ALIGN2 macros.Jeremy Allison2000-04-111-25/+0
| | | | | | | | | | | | include/includes.h: Added SMB_BIG_UINT_BITS. lib/util.c: Removed align2/align4 - use macros. libsmb/namequery.c: Use ALIGN2. locking/locking.c: Replace do_lock, do_unlock, args with SMB_BIG_UINT, not SMB_OFF_T. Needed to move to hiding POSIX locks at a lower layer. nmbd/nmbd_processlogon.c: Use ALIGN2/ALIGN4 macros. smbd/blocking.c: Replace do_lock, do_unlock, args with SMB_BIG_UINT, not SMB_OFF_T. smbd/reply.c: Replace do_lock, do_unlock, args with SMB_BIG_UINT, not SMB_OFF_T. Jeremy.
* add an align4() functionAndrew Tridgell2000-04-111-1/+14
|
* finally got sick of the "extern int Client" code and the stupidAndrew Tridgell2000-04-113-119/+94
| | | | | | | | | | | | | | | | assumption that we have one socket everywhere while doing so I discovered a few bugs! 1) the clientgen session retarget code if used from smbd or nmbd would cause a crash as it called close_sockets() which closed our main socket! fixed by removing close_sockets() completely - it is unnecessary 2) the caching in client_addr() and client_name() was bogus - it could easily get fooled and give the wrong result. fixed. 3) the retarget could could recurse, allowing an easy denial of service attack on nmbd. fixed.
* added a cheap and nasty skip_unibuf() fn to allow easier merging fromAndrew Tridgell2000-04-111-0/+10
| | | | | | TNG out unicode string handling functions need a lot of work
* changed the definition of dos_PutUniCodeAndrew Tridgell2000-03-271-4/+9
| | | | | | | | | the previous definition could result is us overflowing a buffer. The null termination was always added yet the size returned did not include the null termination. the new function takes a BOOL null_terminate, and always returns the total number of bytes consumed by the string.
* moved nmblib-specific code from util.c to nmblib.c.Luke Leighton2000-03-271-191/+0
|
* Correctly convert from little-endian UNICODE to dos_codepage when doingJeremy Allison2000-03-221-0/+2
| | | | | secure file create. Jeremy.
* acconfig.h configure configure.in: Added check for UT_SYSLEN for utmp code.Jeremy Allison2000-03-222-52/+15
| | | | | | | | | | | | | | include/byteorder.h: Added alignment macros. include/nameserv.h: Added defines for msg_type field options - from rfc1002. lib/time.c: Typo fix. lib/util_unistr.c: Updates from UNICODE branch. printing/nt_printing.c: bzero -> memset. smbd/connection.c: Added check for UT_SYSLEN for utmp code. Other fixes : Rollback of unapproved commit from Luke. Please *ask* next time before doing large changes to HEAD. Jeremy.
* Fixes to add "paranoid" option to popen. Checks some basic things.Jeremy Allison2000-03-161-1/+56
| | | | Jeremy
* Fix from NAKAJI Hiroyuki for a trailing '\n\ in asctime.Jeremy Allison2000-03-151-0/+2
| | | | Jeremy.
* Fixups for compiles with gcc flags -Wall -Wshadow -Wstrict-prototypes ↵Jeremy Allison2000-03-101-5/+5
| | | | | | | -Wpointer-arith -Wcast-qual Partially implemented rpc daemon redirect (needs more work). Jeremy.
* changed prs_unistr to parse empty and non-empty strings the same way.Jean-François Micouleau2000-03-061-14/+20
| | | | | | | | | | | | fixed typo in SPOOLSS_SYNT some cleanup of unused functions wrote make_spoolss_enumprinter and make_spoolss_openprinterex for rpcclient as I'm trying to keep in sync the parsing code between HEAD and TNG. Will commit changes to TNG after lunch. J.F.
* lib/system.c: Fixed gcc warnings.Jeremy Allison2000-02-231-1/+0
| | | | | | nmbd/nmbd_processlogon.c: Use "True" and "False" instead of 1 and 0. Others - preparing for multiple pdu write code. Jeremy.
* Fix for crash bug from Paul Tyler <pct@ansto.gov.au>.Jeremy Allison2000-02-211-10/+11
| | | | Jeremy.
* Fixes for Eastern Europe code page.Jeremy Allison2000-02-181-0/+1
| | | | Jeremy.
* Added support for SO_REUSEPORT for systems that have it.Jeremy Allison2000-02-161-1/+11
| | | | Jeremy.
* Added replacement functions sys_popen and sys_pclose. These are basedJeremy Allison2000-02-153-15/+244
| | | | | | | | | on the glibc source code and are safer than the traditional popen as they don't use a shell to exec the requested command. Now we have these functions they can be tightened up (environment etc.) as required to make a safe popen. It should now be safe to add the environement variable loading code to loadparm.c Jeremy.
* Fixed wildcard match bug with '****' with smbclient. Found by Andrew (damn ↵Jeremy Allison2000-02-091-2/+3
| | | | | | him! :-). Jeremy.
* Moved over lib/util_sec (with added fixes) as the HEAD sourceJeremy Allison2000-02-081-4/+50
| | | | | seems to have drifted a little. Jeremy.
* Hum, I should remove my gloves when I'm in front of an xterm :)Jean-François Micouleau2000-02-071-2/+2
| | | | | | fixed a stupid bug in unistr2_to_ascii that I introduced fixed getprinterdata()
* Jeremy can you check lib/util_unistr.c for codepages support ?Jean-François Micouleau2000-02-072-0/+109
| | | | | | | I added 2 UNICODE <-> ASCII functions which _don't_ honor codepage support. J.F.
* Comments to use vfs_* functions instead of dos_* unless reallyTim Potter2000-02-032-4/+16
| | | | accessing files on local disk.
* Added hash-based stat cache code from Ying Chen.Jeremy Allison2000-01-261-0/+320
| | | | Jeremy.
* Second set of inline optimisation fixes from Ying Chen <ying@almaden.ibm.com>.Jeremy Allison2000-01-263-42/+61
| | | | | | Stop makeing function calls for every use of skip_multibyte_char. This function is called several *million* times during a NetBench run :-). Jeremy.
* First set of speed improvements from Ying Chen <ying@almaden.ibm.com>.Jeremy Allison2000-01-251-137/+1
| | | | | Inline several commonly used functions as macros. Jeremy.
* made cvs main up-to-date with samba_tng, with addition of process id toLuke Leighton2000-01-212-7/+12
| | | | msrpc loop-back interface.
* make string_init() staticAndrew Tridgell2000-01-162-2/+2
| | | | use string_set() instead, to avoid the bug Richard discovered
* Added "inherit permissions" patch.Jeremy Allison2000-01-142-0/+31
| | | | | Fixed locking bug found by Andrew. Jeremy.
* Fix problems with broken libc fvct returns.Jeremy Allison2000-01-121-1/+8
| | | | Jeremy.
* Fixed pointer arithmetic found by IRIX compiler.Jeremy Allison2000-01-111-1/+1
| | | | Jeremy.
* Fixed bug in unix_mask_match() that caused veto files not to work.Jeremy Allison2000-01-111-31/+9
| | | | Jeremy.
* this looks like a big commit, but it isn't really :)Andrew Tridgell2000-01-072-6/+4
| | | | | | | | This fixes our netbios scope handling. We now have a 'netbios scope' option in smb.conf and the scope option is removed from make_nmb_name() this was prompted by a bug in our PDC finding code where it didn't append the scope to the query of the '*' name.