summaryrefslogtreecommitdiffstats
path: root/source3/smbd/fileio.c
Commit message (Collapse)AuthorAgeFilesLines
...
* 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). Andrew gets credit for this one :-) :-). 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. (This used to be commit b07611f8159b0b3f42e7e02611be9f4d56de96f5)
* Herb's fixes for profiling & compiler warnings.Jeremy Allison2000-10-051-47/+69
| | | | | Jeremy. (This used to be commit 7914e9351abb5271ebb4990c3b1fe495d15a4eda)
* Memleak fix for cache code.Jeremy Allison2000-10-021-1/+7
| | | | | Jeremy. (This used to be commit 1ebe54666b0fc6f224f17036063dfe0ef7ec9147)
* vfs write data fix. Fix for name matching in addtosmbpassJeremy Allison2000-08-251-2/+2
| | | | | Jeremy. (This used to be commit 85738b7ee1ea6d88999d6aedc51a2daf545cb8b8)
* 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 (This used to be commit 92109d7b3c06f240452d39f669ecb8c9c86ab610)
* Fix for misunderstanding of fsync added when vfs layerHerb Lewis2000-05-101-1/+1
| | | | | | was done. Samba was doing fsync's (bleagh). Jeremy. (This used to be commit f9a52cadbf11f7afcef754a59d783964a2edb5bc)
* Fix for read_file() returning -1.Jeremy Allison2000-05-051-0/+2
| | | | | Jeremy. (This used to be commit b899943658bee90994b416aa6caff0ee7cab5f28)
* 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 used to be commit 148628b616b5c29ba6340d65fc3ddbcabba6e67a)
* 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. (This used to be commit ab0ecc39d688f16b9692fe90b991f0b89287070a)
* 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. (This used to be commit d870542c2884510bd45fd5b54ff2157434d53f4c)
* 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 (This used to be commit d1827a3648009fd0a0d165055015d9aeda7a1037)
* Change to vfs API. POSIX states fsync should return an int, not a void.Jeremy Allison2000-04-041-2/+0
| | | | | Jeremy. (This used to be commit 6c442d68afae4140e28b770343a900b5ce510b4a)
* 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. (This used to be commit 3aad500c0fb61232ed3431ff4b743b5d18ec852f)
* 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 (This used to be commit e48c2d9937eea0667b8cd3332e49c06314ef31e7)
* first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1999-12-131-22/+545
| | | | (This used to be commit 453a822a76780063dff23526c35408866d0c0154)
* Changed arguments to fsync() function to break dependency onTim Potter1999-04-201-3/+2
| | | | | connection_struct. (This used to be commit ee6f826ccc0897a4538f6f9a560127c54a4c4038)
* 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(). (This used to be commit 7ced7fd3958c76303e4b6019b5d54eda666d7b33)
* Fixed sys_lseek and seek_file calls so all returnsJeremy Allison1998-10-181-2/+11
| | | | | | are *checked* :-). Jeremy. (This used to be commit b8b781191dd7d28944d87eec5fa0fbef798e289b)
* 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. (This used to be commit 475992730c0ecbf31c09b3518df2f0354cec61da)
* 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. (This used to be commit 4e784b18899eddd2399a51fa7d8c219560432922)
* 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. (This used to be commit 54dd51176fbab18af0b21bdee71b53f8f86573a8)
* 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. (This used to be commit 36544fe5476f7770bd5748574fc54be7b3ee4d4a)
* 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. (This used to be commit 14500936c321d15995c963766aac67bf1f4e3824)
* 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. (This used to be commit 28aa182dbffaa4ffd86047e608400de4b26e80eb)
* more splitting of server.cAndrew Tridgell1998-08-171-0/+12
| | | | | created dosmode.c and filename.c (This used to be commit 534a90ca44641417c21f6ed6d4b94b1de60f808d)
* 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. (This used to be commit b3d7014643ec9f2eef6e6f598f5b9db1fe2f930d)