summaryrefslogtreecommitdiffstats
path: root/source/smbd/fileio.c
Commit message (Collapse)AuthorAgeFilesLines
* Gone back to explicit queue number passing as snum - removed encoding ofJeremy Allison2002-07-171-1/+1
| | | | | | queueid in job number. This means we must have an internal tdb to store mapping from 16 bit RAP jobid's to 32 bit RPC jobids. Jeremy.
* used findstatic.pl to make some variables static and remove some deadAndrew Tridgell2002-07-011-2/+2
| | | | code
* smbd/fileio.c: debug changes so read/write/seek calls can be logged for ↵Jeremy Allison2002-04-241-382/+393
| | | | | | | name, pos, size easily. Might help with access problem. Jeremy.
* Remove the "stat open" code - make it inline. This should fix theJeremy Allison2002-03-201-0/+12
| | | | | | | | bugs with opening and renaming mp3 files, also the word rename problems that people have had for a while. Needs a make clean :-) make. Also added JohnR's printing fix. Jeremy.
* Fix lseek-on-pipe problem in VFS (where it belongs IMHO).Jeremy Allison2002-03-021-13/+1
| | | | Jeremy.
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* Ensure fsp->size is correct so readraw's return correct data.Jeremy Allison2002-01-221-9/+14
| | | | Jeremy.
* Found and fixed the logic bug in write cache code. Amazingly helpfulJeremy Allison2002-01-211-4/+10
| | | | | work from Juergen.Hasch@de.bosch.com in tracking this down. Jermy.
* Ensure identical between 2.2.3 and 3.0 - no need for difference here..Jeremy Allison2002-01-201-1/+0
| | | | Jeremy.
* Fix file size calculations for write cache code.Jeremy Allison2002-01-201-5/+41
| | | | Jeremy.
* Attempt to fix bugs in write cache code (yes I know it's going away :-).Jeremy Allison2002-01-201-3/+19
| | | | Jeremy.
* #ifdefed DMF fix so not compiled by default. We need to look at this...Jeremy Allison2001-11-251-22/+39
| | | | 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-5/+3
|
* 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.
* 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.
* Herb's warning fixes. Also the POSIX locking fix.Jeremy Allison2000-10-061-39/+16
| | | | | We now use our own vfs layer to do get/set acl calls (hurrah!). Jeremy.
* 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.
* Herb's fixes for profiling & compiler warnings.Jeremy Allison2000-10-051-47/+69
| | | | Jeremy.
* 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.