summaryrefslogtreecommitdiff
path: root/source3/lib
AgeCommit message (Collapse)AuthorFilesLines
2000-04-30we don't need fnmatch.c any moreAndrew Tridgell2-201/+1
(This used to be commit e23f43e7d3d2a068f527baa63a31f7fe4e60e79d)
2000-04-30- removed all our old wildcard matching code and replaced it with aAndrew Tridgell2-627/+69
call to ms_fnmatch(). This also removes all the Win9X semantics stuff and a bunch of other associated cruft. - moved the stat cache code into statcache.c - fixed the uint16 alignment requirements of ascii_to_unistr() and unistr_to_ascii() - trans2 SMB_FIND_FILE_BOTH_DIRECTORY_INFO returns the short name as unicode always (at least thats what NT4 does) - fixed some errors in the in-memory tdb code. Still ugly, but doesn't crash as much (This used to be commit 03e9cea004bbba72161a5323cf3b4556c94aed8e)
2000-04-30YIPEE!!!!!Andrew Tridgell2-1/+147
We finally have a perfect emulation of Microsoft wildcard matching. The routine ms_fnmatch() does wildcard matching with all MS wildcards (including the unicode wildcards), and masktest against a NT4 workstation with hundreds of thousands of random exmaples has not found a single error. amazingly it is only about 60 lines of code, but it has taken us years to get it right. I didn't sleep much last night :) (This used to be commit cc9e007cdfdd300189f89e2a55e4234e47fa842d)
2000-04-25moved trans2.h and nterr.h into includes.h with all our other includesAndrew Tridgell1-1/+0
(This used to be commit d7cd7c88fdabb01d9e40ae8a657737907a21ac37)
2000-04-24Now that fsp's are created on successful file open, the structure memberJeremy Allison1-1/+0
fsp->open is no longer needed (if an fsp pointer is valid, then it's open :-). NB for Luke, this patch also did not apply to TNG. TNG is not yet identical w.r.t file serving with HEAD. This makes it impossible for me to help maintain TNG. Please fix asap. lib/substitute.c: Removed unused variable (pidstr). Jeremy. (This used to be commit 389b700a26e8a308a0dff6fc038c38068aa0119a)
2000-04-24moved the INSURE hook into util.cAndrew Tridgell1-0/+26
(This used to be commit 8c726b9764bac0bc95cf9877e172c9e1262e576d)
2000-04-23don't close high fd's in smbrun when using insure (prevents closingAndrew Tridgell1-1/+3
error fd) (This used to be commit defbedd198f02f7bb9af70436f5a25ab754b5fb6)
2000-04-23split out standard_sub_basic() again to fix a bug where %p was beingAndrew Tridgell1-14/+29
substituted in the loadparm code and thus leaving lpq with no printer (This used to be commit b7c7a4d564d36885aa7c3efb2a87caec470df7fe)
2000-04-23if using insure then don't close fd 2Andrew Tridgell1-1/+4
(This used to be commit 1c6322473afcf9065fa25777d1b0627f133af3f6)
2000-04-22return NULL for a zero size memdupAndrew Tridgell1-0/+1
(This used to be commit 9416b58b9c2ff898cdae2cb81ab1e150ef9f0e89)
2000-04-22This is a *big* checkin that may break some things, but implements theJeremy Allison1-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. (This used to be commit ab0ecc39d688f16b9692fe90b991f0b89287070a)
2000-04-19split fsusage() into a separate module (to fix linking problems withAndrew Tridgell1-0/+149
spoolssd in tng) (This used to be commit e2eacdd74c369fbbcd118148149321e36f3d0010)
2000-04-19- got rid of the "passive" optionAndrew Tridgell2-77/+54
- cleaned up the standard_sub_*() calls a lot (This used to be commit 2c2d95d77d3667eaa9252506a82b9054b0d0e01c)
2000-04-18fixed some crash bugs in the nt forms parsingAndrew Tridgell1-0/+2
(This used to be commit e505a6ddf3df37ca485cae117c53fa96d736f897)
2000-04-17got rid of some more old configure tests and includesAndrew Tridgell1-17/+0
(This used to be commit f137648504362479143d50477fa38ebf7147968b)
2000-04-17moved standard_sub() and friends into a separate moduleAndrew Tridgell2-269/+296
(This used to be commit 030ec8e71f9ef533b5d6aece01e67d357e23b7d2)
2000-04-16converted a couple more functions to use a fd instead of a FILE*Andrew Tridgell1-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 (This used to be commit 384ecd9d66ccd31ee85000c0ca55d413d8f2cc53)
2000-04-16converted a bunch more functions to use a fd instead of a FILE*Andrew Tridgell2-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 (This used to be commit a09470817c5b21dba42f9ef4ce5e8b768a254c0b)
2000-04-16added fdprintf()Andrew Tridgell2-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. (This used to be commit bd5cd502bf52164b95d7bfc026189e04988171db)
2000-04-16the new file_lines_load() and file_lines_free() routines. Very useful!Andrew Tridgell1-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. (This used to be commit be1e98b3f7a6007d2c9ac8e079724cb264e0dd3a)
2000-04-15added standard_sub_snum() function for modules that don't haveAndrew Tridgell1-1/+8
a connection structure (This used to be commit f35fe3b4a175161128341fe30a61437c560180d1)
2000-04-15use macros for table boundariesAndrew Tridgell1-6/+9
(This used to be commit a82a5acff2ad2120f5480f0cb08550e95d80c59e)
2000-04-15a quick hack to reduce the size of the unicode map table headers fromAndrew Tridgell1-9/+39
3MB to 250k. I split the table into 3 sections, after noticing that 5/6 of the table was empty. (This used to be commit c1496736bbdb7f6bf1eb43a54f883e5f41a4d39e)
2000-04-15use open() not fopen() on codepage files.Andrew Tridgell1-7/+7
in general we need to get rid of all uses of fopen(). The hard one will be the debug code and dbf. (This used to be commit 3992a5169c0b3805c38729c3856c41b1b2527765)
2000-04-15Log file check patch from Mattias Gronlund <Mattias.Gronlund@sa.erisoft.se>.Jeremy Allison1-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. (This used to be commit c3794fd29fdc4e5a0dbd725cdc24fe210934caf2)
2000-04-14use interpret_addr2() instead of inet_aton()Andrew Tridgell1-1/+1
(This used to be commit f65c6ec6db8e05685c719e23d7b06b3452fbbb4e)
2000-04-12Removed "ole locking compat" parameter (no longer used).Jeremy Allison1-34/+1
We now get/set/check POSIX locks, but I still need to code up the close fd braindamage... Jeremy. (This used to be commit 3de058bd43976853b0ed2b6b5529e2a3a08909eb)
2000-04-12Roll back to using static MACHINE.SID after consultation with Andrew. ThisJeremy Allison1-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. (This used to be commit fbfe94a799cda7f728bc920d4f0655d4f537e3b6)
2000-04-11include/byteorder.h: ALIGN4/ALIGN2 macros.Jeremy Allison1-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. (This used to be commit 491eea8a20bf80d426625479326211dc975857a6)
2000-04-11add an align4() functionAndrew Tridgell1-1/+14
(This used to be commit 7969f4dccbc5a506ef58b9270a08f8f70d9006f7)
2000-04-11finally got sick of the "extern int Client" code and the stupidAndrew Tridgell3-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. (This used to be commit 5937ab14d222696e40a3fc6f0e6a536f2d7305d3)
2000-04-11added a cheap and nasty skip_unibuf() fn to allow easier merging fromAndrew Tridgell1-0/+10
TNG out unicode string handling functions need a lot of work (This used to be commit 707401fc1e697362cdaadcfaac4edc964b80b1a0)
2000-03-27changed the definition of dos_PutUniCodeAndrew Tridgell1-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. (This used to be commit 426c90433396a95033eefcc4af97603abc934221)
2000-03-27moved nmblib-specific code from util.c to nmblib.c.Luke Leighton1-191/+0
(This used to be commit 1b9077a1d5295bc8522b83ebed2d41d5dbd28a27)
2000-03-22Correctly convert from little-endian UNICODE to dos_codepage when doingJeremy Allison1-0/+2
secure file create. Jeremy. (This used to be commit 90134dd13721f60d4fb05ce9434b65e95ff09629)
2000-03-22acconfig.h configure configure.in: Added check for UT_SYSLEN for utmp code.Jeremy Allison2-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. (This used to be commit f02999dbf7971b4ea05050d7206205d7737a78b2)
2000-03-16Fixes to add "paranoid" option to popen. Checks some basic things.Jeremy Allison1-1/+56
Jeremy (This used to be commit 3b8cbb10de322fd7a1063fb5b681790b10d24ab0)
2000-03-15Fix from NAKAJI Hiroyuki for a trailing '\n\ in asctime.Jeremy Allison1-0/+2
Jeremy. (This used to be commit 87df97c9365a185e4ea6bac7b832b8cf38144624)
2000-03-10Fixups for compiles with gcc flags -Wall -Wshadow -Wstrict-prototypes ↵Jeremy Allison1-5/+5
-Wpointer-arith -Wcast-qual Partially implemented rpc daemon redirect (needs more work). Jeremy. (This used to be commit a462191698fa589ceac4afd14c652adf699eccad)
2000-03-06changed prs_unistr to parse empty and non-empty strings the same way.Jean-François Micouleau1-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. (This used to be commit 025cdb345f6de287a41d4449b2662dbc5e762bf2)
2000-02-23lib/system.c: Fixed gcc warnings.Jeremy Allison1-1/+0
nmbd/nmbd_processlogon.c: Use "True" and "False" instead of 1 and 0. Others - preparing for multiple pdu write code. Jeremy. (This used to be commit 9f879ec396230deba34fbe5e82d8a65f92137c54)
2000-02-21Fix for crash bug from Paul Tyler <pct@ansto.gov.au>.Jeremy Allison1-10/+11
Jeremy. (This used to be commit 89aa4d8ca9cc9e8e6dd4566076c0cace8b82d838)
2000-02-18Fixes for Eastern Europe code page.Jeremy Allison1-0/+1
Jeremy. (This used to be commit 0ec82d661a27a02322e5c8da20a18f33bfb24a3e)
2000-02-16Added support for SO_REUSEPORT for systems that have it.Jeremy Allison1-1/+11
Jeremy. (This used to be commit 377515cf9624720362c0b76969b9381d9972a13f)
2000-02-15Added replacement functions sys_popen and sys_pclose. These are basedJeremy Allison3-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. (This used to be commit b52e92b09d4ca3b66e534f520468dee27065d048)
2000-02-09Fixed wildcard match bug with '****' with smbclient. Found by Andrew (damn ↵Jeremy Allison1-2/+3
him! :-). Jeremy. (This used to be commit c8ca70f99ee2eae5e29ddf0dd4bc231fbcd188f2)
2000-02-08Moved over lib/util_sec (with added fixes) as the HEAD sourceJeremy Allison1-4/+50
seems to have drifted a little. Jeremy. (This used to be commit ebcdb4afee04cc3b94e60b1de86c2b534d4e233e)
2000-02-07Hum, I should remove my gloves when I'm in front of an xterm :)Jean-François Micouleau1-2/+2
fixed a stupid bug in unistr2_to_ascii that I introduced fixed getprinterdata() (This used to be commit 2f544a807714024c0fe2ddc26e11c9ddcb47e81f)
2000-02-07Jeremy can you check lib/util_unistr.c for codepages support ?Jean-François Micouleau2-0/+109
I added 2 UNICODE <-> ASCII functions which _don't_ honor codepage support. J.F. (This used to be commit b81dc7b7f832cae2e66076398a134fbb6c1f78ca)
2000-02-03Comments to use vfs_* functions instead of dos_* unless reallyTim Potter2-4/+16
accessing files on local disk. (This used to be commit b55f63da7e6a3c306ce668c77ed63a41d33240db)