summaryrefslogtreecommitdiffstats
path: root/source/smbd/files.c
Commit message (Collapse)AuthorAgeFilesLines
* r8292: Tidy up function comments.Jeremy Allison2007-10-101-2/+10
| | | | Jeremy.
* r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the tortureJeremy Allison2007-10-101-9/+73
| | | | | | | | | tests on this as it's very late NY time (just wanted to get this work into the tree). I'll test this over the weekend.... Jerry - in looking at the difference between the two trees there seem to be some printing/ntprinting.c and registry changes we might want to examine to try keep in sync. Jeremy.
* r6172: Tidy up error processing significantly. Remove unix_ERR_XXX global ↵Jeremy Allison2007-10-101-4/+2
| | | | | | nastyness. Jeremy.
* r5731: Get delayed write semantics closer to W2K3. We need to store 2 times.Jeremy Allison2007-10-101-0/+4
| | | | | This may fix bug #2382. Jeremy.
* r5720: Attempt to fix bug #2382 (Excel shared workbook stops working). AlsoJeremy Allison2007-10-101-2/+57
| | | | | | incorporates part of the fix created by ke_miyata@itg.hitachi.co.jp for bug #2045 (MS-Office behavior of timestamp). Jeremy.
* r4088: Get medieval on our ass about malloc.... :-). Take control of all our ↵Jeremy Allison2007-10-101-1/+1
| | | | | | | | | allocation functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy.
* r3050: Steal from Samba4 :-). Make us pass most of the new lock tests ↵Jeremy Allison2007-10-101-22/+24
| | | | | | | (except for the cancel lock which I have to add). Jeremy.
* Fix coredump from Samba4 torture suite.Jeremy Allison2003-09-171-0/+2
| | | | Jeremy.
* Implement SMBexit properly. Found by Samba4 tester. You must do a makeJeremy Allison2003-08-191-0/+16
| | | | | clean proto all; after this commit. Jeremy.
* Implemented the level 1010 NT rename level. Many fixes for Samba4 testJeremy Allison2003-08-161-0/+12
| | | | | correctness. Jeremy.
* Stat opens can have fsp->fd == -1 and will have a share entry. EnsureJeremy Allison2003-05-221-2/+10
| | | | | that file_find_dif will find them. Fixes a core dump in smbd/open.c. Jeremy.
* Add NT quota support. Patch from Stefan (metze) MetzemacherAlexander Bokovoy2003-05-121-0/+4
| | | | | | | 1. Allows to change quota settings for shared mount points from Win2K and WinXP from Explorer properties tab 2. Disabled by default and when requested, will be probed and enabled only on Linux where it works 3. Was tested for approx. two weeks now on Linux by two independent QA teams, have not found any bugs so far Documentation to follow
* Fix for systems that allow more than 65536 open files per process.Jeremy Allison2002-10-221-1/+8
| | | | Jeremy.
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* Move from timestamp to gen count file id's for finding oplocked filesJeremy Allison2001-10-201-20/+57
| | | | | in a tdb. Jeremy.
* Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter2001-10-021-2/+0
|
* move to SAFE_FREE()Simo Sorce2001-09-171-1/+1
|
* configure:Jeremy Allison2001-04-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | configure.in: include/config.h.in: include/profile.h: smbd/vfs-wrap.c: smbd/vfs.c: Added fchmod and fchown to VFS (sorry Gerald - but we needed them anyway). smbd/dosmode.c: smbd/files.c: printing/printfsp.c: smbd/close.c: smbd/open.c: Fixed "dos filemode" correctly so there are no race conditions. Forces test of open of file O_WRONLY before allowing fchmod as root. Afterwards, calls standard close function that preserves POSIX locks due to POSIX-me-harder braindamage. :-). Andrew please review this code. Also - in removing the tmpdir param in smbrun an extra NULL parameter was missed in each print_run_command() call (which is a varargs fn.). Now fixed. Jeremy.
* Added fix from "Eric Boehm" <boehm@nortelnetworks.com> to try and set hardJeremy Allison2001-04-131-3/+3
| | | | | limit before setting soft limit. Jeremy.
* Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMRJeremy Allison2001-03-111-2/+0
| | | | | | RPC code to merge with new passdb code. Currently rpcclient doesn't compile. I'm working on it... Jeremy.
* more merging voodooAndrew Tridgell2000-05-101-0/+2
| | | | | | this adds "#define OLD_NTDOMAIN 1" in lots of places. Don't panic - this isn't permanent, it should go after another few merge steps have been done
* Fix for misunderstanding of fsync added when vfs layerHerb Lewis2000-05-101-1/+1
| | | | | was done. Samba was doing fsync's (bleagh). Jeremy.
* Added sys_fork() and sys_getpid() functions to stop the overheadJeremy Allison2000-05-021-1/+1
| | | | | of doing a system call every time we want to just get our pid. Jeremy.
* Now that fsp's are created on successful file open, the structure memberJeremy Allison2000-04-241-10/+23
| | | | | | | | | | | | 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 is a *big* checkin that may break some things, but implements theJeremy Allison2000-04-221-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* initialise fsp->fd to -1Andrew Tridgell2000-04-101-0/+1
|
* the bulk of the changes to get rid of fd_ptr and move print openAndrew Tridgell2000-04-101-106/+12
| | | | | | | | | handling to printing/printing.c most of this was just replacing things like fsp->fd_ptr->fd with fsp->fd the changes in open.c are quite dramatic. Most of it is removing all the functions that handled the fd multiplexing
* Mega-VFS merge. Yeah baby!Tim Potter2000-02-031-1/+1
| | | | | Synopsis: change every disk access function to work through a vfs_ops structure contained in the connection_struct.
* use string_set() instead of string_init()Andrew Tridgell2000-01-161-1/+1
| | | | bug pointed out by Richard
* first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1999-12-131-12/+6
|
* spelling mistake.Luke Leighton1999-08-131-1/+1
|
* Changed arguments to fsync() function to break dependency onTim Potter1999-04-201-2/+3
| | | | connection_struct.
* Use VFS operations for file I/O.Tim Potter1999-04-041-3/+2
|
* Fixed crash bug which was assuming that fd_ptr was always non-nullJeremy Allison1998-11-181-2/+5
| | | | | (which is not the case with open directories). Jeremy.
* Reasonably large change to give us *exactly* correct NT delete on close ↵Jeremy Allison1998-10-231-0/+35
| | | | | | | | | | | | | | semantics. This was trickier than it looks :-). Check out the new DELETE_ON_CLOSE flag in the share modes and the new code that iterates through all open files on the same device and inode in files.c and trans2.c Also changed the code that modifies share mode entries to take generic function pointers rather than doing a specific thing so this sort of change should be easier in the future. Jeremy.
* Re-added code to tell the user how many open files theyJeremy Allison1998-10-161-5/+15
| | | | | have. Needed for server diagnosis purposes... Jeremy.
* - fixed a bunch of warnings and minor errorsAndrew Tridgell1998-10-081-1/+1
| | | | | | - got smbtorture to compile - removed %D from some of lukes code - Luke, what is %D? it ain't portable anyway
* added a function set_maxfiles() to set our file rlimit to the maxAndrew Tridgell1998-10-051-27/+8
| | | | possible and return the max.
* got rid of USE_FILES_ARRAY code (it was unused)Andrew Tridgell1998-10-011-106/+4
|
* (Finally) implemented "max open files" as a global smb.conf parameter.Jeremy Allison1998-09-301-22/+44
| | | | | | Sets up the files array correctly - limited by the smb.conf parameter and by the max fd's per process as found by getrlimit(). Jeremy.
* First cut at kernel oplocks. This should have no effect unless runninJeremy Allison1998-09-231-13/+15
| | | | | | | | | on a machine that supports them in autoconf. Move various functions out of lib/util.c into smbd/process.c and smbd/oplock.c where they belong. Jeremy.
* smb.h: Removed fdnum from file_fd_struct. Not needed.Jeremy Allison1998-09-101-29/+109
| | | | | | | files.c: Removed fd bitmap - not needed. Added code to do use arrays rather than linked list - disabled by default but can be enabled to check performance. Jeremy.
* some cleanups to use ZERO_STRUCT() and friendsAndrew Tridgell1998-09-051-4/+4
|
* tridge the destroyer returns!Andrew Tridgell1998-09-051-2/+3
| | | | | | | | | | | | | | | | | | | | | | 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?
* Bugfix for leak in reference counted file struct.Jeremy Allison1998-09-051-3/+3
| | | | | Added "nt smb support" parameter to allow NT SMB's to be turned off. Jeremy.
* Modified dev_t and ino_t code to be 64 bit clean (including changesJeremy Allison1998-09-041-1/+7
| | | | | | | | | | to oplock break message passing). I think that smbd/nmbd are now inode and offset size independent (at least for 32 bit and 64 bit systems). Now to expose all this new functionality to NT clients..... Jeremy.
* More abstraction of file system data types, to move to a 64Jeremy Allison1998-09-011-1/+1
| | | | | | | | | | | | | | | | | | | | | bit file interface for the NT SMB's. Created a new define, SMB_STRUCT_STAT that currently is defined to be struct stat - this wil change to a user defined type containing 64 bit info when the correct wrappers are written for 64 bit stat(), fstat() and lstat() calls. Also changed all sys_xxxx() calls that were previously just wrappers to the same call prefixed by a dos_to_unix() call into dos_xxxx() calls. This makes it explicit when a pathname translation is being done, and when it is not. Now, all sys_xxx() calls are meant to be wrappers to mask OS differences, and not silently converting filenames on the fly. Jeremy.
* configure.in, configure: include/config.h.in: Added stropts and poll.Jeremy Allison1998-08-311-5/+5
| | | | | | | | | | | include/smb.h: Moved old typedefs of uint8 etc. into include/includes.h where all the other defines live (changed them from typedefs to defines). Other changes : changed from using uint32 to SMB_DEV_T and SMB_INO_T in preparation for moving to size independed (ie. 64 bit clean) device and inode access. Stat call wrapper comes next :-). Jeremy.
* Turning on blocking locking code. NB. Blocking lock requests that are notJeremy Allison1998-08-201-2/+2
| | | | | | | | | | | | | | | | | | 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.
* Fixed bug introduced by the recent changes where the chain_fnumJeremy Allison1998-08-171-1/+19
| | | | | could be overwritten in oplock processing code. Jeremy.