summaryrefslogtreecommitdiffstats
path: root/source/smbd/fileio.c
Commit message (Collapse)AuthorAgeFilesLines
* sync with SAMBA_2_2 for 2.2.6rc1Gerald Carter2002-10-091-1/+86
|
* Start of merge to 2_2_RELEASE branch for release.Jeremy Allison2002-04-301-393/+403
| | | | Jeremy.
* Move over to RELEASE branch.Jeremy Allison2002-02-011-43/+118
| | | | Jeremy.
* But Doctor, I had to kill the patient in order to save him....Jeremy Allison2001-02-211-2/+0
| | | | | | | | | | | | | | | | | | | This will probably break 2.2 for a while. Do *NOT* checkout unless you like core dumps. This is the first merge of the TNG SAMR code into 2.2. It will eventually give us a wonderful PDC, but maybe painful in the short term. It had to be done however, and this touches almost every file (mostly just removing the OLD_NT_DOMAIN) stuff. I removed some SAMR functionality from rpcclient that would no longer compile. Also changed fstring to 256 bytes to better match an NT pathname. Jeremy.
* Ok - fixed a bug in our levelII oplock code. We need to break a level II onJeremy Allison2000-11-161-80/+1
| | | | | | | | | a byte range lock (write lock only, but Win2k breaks on read lock also so I do the same) - if you think about why, this is obvious. Also fixed our client code to do level II oplocks, if requested, and fixed the code where we would assume the client wanted level II if it advertised itself as being level II capable - it may not want that. Jeremy.
* includes.h always include profile.hHerb Lewis2000-10-061-39/+16
| | | | | | | | | | | | | | | smb.h move FLUSH_REASONS to profile.h now that it is included by all profile.h add FLUSH_REASONS, add external declarations for profile_starttime, profile_endtime, do_profile_flag which are defined in profile/profile.c Modify PROFILE macros profile.c always include this function. It is still called under an #ifdef WITH_PROFILE but we need the above variables so we might as well include the function as well. fileio.c use new PROFILE macros to make code cleaner looking reply.c fix a typo in one START_PROFILE call statcache.c use new PROFILE macros to make code cleaner looking vfs_wrap.c use new PROFILE macros to make code cleaner looking added time profiling to each call.
* Restructuring of vfs layer to include a "this" pointer - can be an fsp orJeremy Allison2000-10-061-4/+4
| | | | | | | | | | | | | | a conn struct depending on the call. We need this to have a clean NT ACL call interface. This will break any existing VFS libraries (that's why this is pre-release code). In addition - added Herb's WITH_PROFILE changes - Herb - please examine the changes I've made to the smbd/reply.c code you added. The original code was very ugly and I have replaced it with a START_PROFILE(x)/END_PROFILE(x) pair using the preprocessor. Please check this compiles ok with the --with-profile switch. Jeremy.
* misplaced an ifdef WITH_PROFILEHerb Lewis2000-10-051-1/+1
|
* add some profile stats - all under #ifdef WITH_PROFILEHerb Lewis2000-10-051-47/+69
| | | | still more to come but I wanted to commit so it didn't get lost
* Memleak fix for cache code.Jeremy Allison2000-10-021-1/+7
| | | | Jeremy.
* vfs write data fix. Fix for name matching in addtosmbpassJeremy Allison2000-08-251-2/+2
| | | | 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.
* Fix for read_file() returning -1.Jeremy Allison2000-05-051-0/+2
| | | | 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.
* This is a *big* checkin that may break some things, but implements theJeremy Allison2000-04-221-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* the changes to the main smb codeAndrew Tridgell2000-04-161-0/+9
| | | | | | | | | | | | | | | | | | | | | ------------ 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.
* the bulk of the changes to get rid of fd_ptr and move print openAndrew Tridgell2000-04-101-28/+16
| | | | | | | | | 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
* Change to vfs API. POSIX states fsync should return an int, not a void.Jeremy Allison2000-04-041-2/+0
| | | | Jeremy.
* Mega-VFS merge. Yeah baby!Tim Potter2000-02-031-5/+6
| | | | | Synopsis: change every disk access function to work through a vfs_ops structure contained in the connection_struct.
* converted all our existing shared memory code to use a tdb databaseAndrew Tridgell1999-12-211-3/+3
| | | | | | | | | | | | | instead of either sysv or mmap shared memory or lock files. this means we can now completely remove locking_shm.c locking_slow.c shmem.c shmem_sysv.c and lots of other things also got simpler locking.c got a bit larger, but is much better compartmentalised now
* first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1999-12-131-22/+545
|
* Changed arguments to fsync() function to break dependency onTim Potter1999-04-201-3/+2
| | | | connection_struct.
* Use VFS operations for file I/O.Tim Potter1999-04-041-8/+7
| | | | | | Modified args to read_predict to pass in fsp. Renamed sync_file() function to sys_sync_file().
* Fixed sys_lseek and seek_file calls so all returnsJeremy Allison1998-10-181-2/+11
| | | | | are *checked* :-). Jeremy.
* config: Fix crypt prototype on RedHat Linux.Jeremy Allison1998-10-151-1/+1
| | | | | | | | include/includes.h: Fix crypt prototype on RedHat Linux. smbd/fileio.c: Fix mmap bug found by WinCE client. smbd/ipc.c: Fix WinCE wierdness with pipes being opened as \server\pipe\lanman smbd/password.c: Fix encrypted null passwords. Jeremy.
* gto ri of a bunch more #ifdef LARGE_SMB_OFF_T checks by introducing aAndrew Tridgell1998-09-181-13/+9
| | | | | | | SOFF_T() macro for setting an SMB_OFF_T variable also limited mmap based reads to MAX_MMAP_SIZE. We really can't mmap 2^50 bytes due to virtual address space problems.
* Ok so with this bugfix 64 bit file access actually seems to work :-).Jeremy Allison1998-09-111-2/+6
| | | | | | Problems were just dumb bugs like (defining sys_lseek to return 'int' DOH !). Jeremy.
* Added ssize_t to configure code.Jeremy Allison1998-09-111-30/+30
| | | | | | | | | | | Got 'religion' about using size_t and ssize_t for read/write stuff as part of the code to expose 64 bits to the client. This checkin does all the 'easy' stuff - such as all the read/write/lock calls - but now comes the harder parts (open & friends) and all the file enquiry functions..... Jeremy.
* Ok - this is the 64 bit widening check in. It changes the configureJeremy Allison1998-09-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | to check for stat64 and friends, and then changes much of Samba to use the data type SMB_OFF_T for file size information. stat/fstat/lstat/lseek/ftruncate have now become sys_stat etc. to hide the 64 bit calls if needed. Note that this still does not expose 64 bit functionality to the client, as the changes to the reply_xxx smb's are not yet done. This code change should make these changes possible. Still to do before full 64 bit-ness to the client: fcntl lock code. statfs code widening of dev_t and ino_t (now possible due to SMB_DEV_T and SMB_OFF_T types being in place). Let me know if wierd things happen after this check-in and I'll fix them :-). Jeremy.
* More abstraction of file system data types, to move to a 64Jeremy Allison1998-09-011-2/+2
| | | | | | | | | | | | | | | | | | | | | 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.
* more splitting of server.cAndrew Tridgell1998-08-171-0/+12
| | | | created dosmode.c and filename.c
* now that we have no global arrays we can start to split up the monsterAndrew Tridgell1998-08-171-0/+117
server.c without breaking things. this splits off netprot.c and fileio.c for negprot and read/write/seek handling respectively.