summaryrefslogtreecommitdiff
path: root/source3/smbd/fileio.c
AgeCommit message (Collapse)AuthorFilesLines
2004-01-06Patch based on work from James Peach <jpeach@sgi.com> to convert over toJeremy Allison1-11/+12
using pread/pwrite. Modified a little to ensure fsp->pos is correct. Fix for #889. Jeremy. (This used to be commit 3a24dc868d95c9bcc2ac3a0dbd50e6e226ac0841)
2003-11-05Merge of 64-bit printf warning fixes.Tim Potter1-3/+3
(This used to be commit a6cc763333943bc6e360bb7e78cf9bfb1bc936e8)
2003-09-09sync 3.0 into HEAD for the last timeGerald Carter1-2/+20
(This used to be commit c17a7dc9a190156a069da3e861c18fd3f81224ad)
2003-07-16trying to get HEAD building again. If you want the codeGerald Carter1-7/+7
prior to this merge, checkout HEAD_PRE_3_0_0_BETA_3_MERGE (This used to be commit adb98e7b7cd0f025b52c570e4034eebf4047b1ad)
2002-12-05The element in fsp->print_job should be a RAP jobid, not a uint32 RPCJeremy Allison1-2/+13
jobid. This was causing Win9x client "set name" calls to fail. Still need one cleanup fix to finish. Jeremy. (This used to be commit 15f0bad1fc72ff44cd195d34fd530c25a739f42d)
2002-12-04Fix for 64 bit issues with oplocks and allocation size.Jeremy Allison1-20/+36
Jeremy. (This used to be commit 4a9c995e50b24e6ee6ec58c46da32100a8197724)
2002-10-21merge from samba_3_0Gerald Carter1-7/+3
removed the following parameters * postscript * printer driver * printer driver location * printer driver file also removed the get_a_printer_driver_9x_compatible() function (This used to be commit e7dd8cf903144393b1362719d75430a2ee7e5f27)
2002-10-03Added ASCII art to make this clearer.Jeremy Allison1-1/+73
Jeremy. (This used to be commit 96e9ff905426f4754685a140674934cf2f6cb11c)
2002-10-03Write cache bugfix from Rasmus Borup Hansen, system adm. Email: ↵Jeremy Allison1-0/+13
rbh@math.ku.dk Jeremy. (This used to be commit 971b82beb7b99a3ae692ca147cce9ce4b5bce39c)
2002-07-17Gone back to explicit queue number passing as snum - removed encoding ofJeremy Allison1-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. (This used to be commit 4ff64f69706cc94d5dba7762754d00790c476963)
2002-07-01used findstatic.pl to make some variables static and remove some deadAndrew Tridgell1-2/+2
code (This used to be commit 91ad9041e9507d36eb3f40c23c5d4df61f139ef0)
2002-04-24smbd/fileio.c: debug changes so read/write/seek calls can be logged for ↵Jeremy Allison1-382/+393
name, pos, size easily. Might help with access problem. Jeremy. (This used to be commit e08d72b3271ae1b155a59ae82acf9d619c22c81f)
2002-03-20Remove the "stat open" code - make it inline. This should fix theJeremy Allison1-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. (This used to be commit 504e5ef0494c54efbd0357e334cb2aa5a9eb9c14)
2002-03-02Fix lseek-on-pipe problem in VFS (where it belongs IMHO).Jeremy Allison1-13/+1
Jeremy. (This used to be commit ebef2e7bc87fcbae794426c39044a7d23f43722d)
2002-01-30Removed version number from file header.Tim Potter1-2/+1
Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa)
2002-01-22Ensure fsp->size is correct so readraw's return correct data.Jeremy Allison1-9/+14
Jeremy. (This used to be commit 443d2530a7fe32392bdb8c7d38a10b7071392b13)
2002-01-21Found and fixed the logic bug in write cache code. Amazingly helpfulJeremy Allison1-4/+10
work from Juergen.Hasch@de.bosch.com in tracking this down. Jermy. (This used to be commit 40060fe3459cf103a143c324f99c2233a8e53825)
2002-01-20Ensure identical between 2.2.3 and 3.0 - no need for difference here..Jeremy Allison1-1/+0
Jeremy. (This used to be commit 7c5c035e417b45acebc3580c4fdc80a7ef3306ce)
2002-01-20Fix file size calculations for write cache code.Jeremy Allison1-5/+41
Jeremy. (This used to be commit 71d647b6c0db8470d6144683c41ab26a7e1ef35e)
2002-01-20Attempt to fix bugs in write cache code (yes I know it's going away :-).Jeremy Allison1-3/+19
Jeremy. (This used to be commit ccda82b457b11ec683f404c9059b02c1214a0fd1)
2001-11-25#ifdefed DMF fix so not compiled by default. We need to look at this...Jeremy Allison1-22/+39
Jeremy. (This used to be commit 97dca242a91c68048e510f42be53421b533183be)
2001-10-02Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter1-2/+0
(This used to be commit 2d0922b0eabfdc0aaf1d0797482fef47ed7fde8e)
2001-09-17move to SAFE_FREE()Simo Sorce1-5/+3
(This used to be commit a95943fde0ad89ae3f2deca2f7ba9cb5ab612b74)
2001-03-11Merge of new 2.2 code into HEAD (Gerald I hate you :-) :-). Allows new SAMRJeremy Allison1-2/+0
RPC code to merge with new passdb code. Currently rpcclient doesn't compile. I'm working on it... Jeremy. (This used to be commit 0be41d5158ea4e645e93e8cd30617c038416e549)
2000-11-16Ok - fixed a bug in our levelII oplock code. We need to break a level II onJeremy Allison1-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. (This used to be commit 213cd0b5192307cd4b0026cae94b2f52fb1b0c02)
2000-10-06Herb's warning fixes. Also the POSIX locking fix.Jeremy Allison1-39/+16
We now use our own vfs layer to do get/set acl calls (hurrah!). Jeremy. (This used to be commit dfe77c7046cbd65ee52aea7439f21503c1eac41d)
2000-10-06Restructuring of vfs layer to include a "this" pointer - can be an fsp orJeremy Allison1-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)
2000-10-05Herb's fixes for profiling & compiler warnings.Jeremy Allison1-47/+69
Jeremy. (This used to be commit 7914e9351abb5271ebb4990c3b1fe495d15a4eda)
2000-10-02Memleak fix for cache code.Jeremy Allison1-1/+7
Jeremy. (This used to be commit 1ebe54666b0fc6f224f17036063dfe0ef7ec9147)
2000-08-25vfs write data fix. Fix for name matching in addtosmbpassJeremy Allison1-2/+2
Jeremy. (This used to be commit 85738b7ee1ea6d88999d6aedc51a2daf545cb8b8)
2000-05-10more merging voodooAndrew Tridgell1-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)
2000-05-10Fix for misunderstanding of fsync added when vfs layerHerb Lewis1-1/+1
was done. Samba was doing fsync's (bleagh). Jeremy. (This used to be commit f9a52cadbf11f7afcef754a59d783964a2edb5bc)
2000-05-05Fix for read_file() returning -1.Jeremy Allison1-0/+2
Jeremy. (This used to be commit b899943658bee90994b416aa6caff0ee7cab5f28)
2000-05-02Added sys_fork() and sys_getpid() functions to stop the overheadJeremy Allison1-1/+1
of doing a system call every time we want to just get our pid. Jeremy. (This used to be commit 148628b616b5c29ba6340d65fc3ddbcabba6e67a)
2000-04-22This is a *big* checkin that may break some things, but implements theJeremy Allison1-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)
2000-04-16the changes to the main smb codeAndrew Tridgell1-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)
2000-04-10the bulk of the changes to get rid of fd_ptr and move print openAndrew Tridgell1-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)
2000-04-04Change to vfs API. POSIX states fsync should return an int, not a void.Jeremy Allison1-2/+0
Jeremy. (This used to be commit 6c442d68afae4140e28b770343a900b5ce510b4a)
2000-02-03Mega-VFS merge. Yeah baby!Tim Potter1-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)
1999-12-21converted all our existing shared memory code to use a tdb databaseAndrew Tridgell1-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)
1999-12-13first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1-22/+545
(This used to be commit 453a822a76780063dff23526c35408866d0c0154)
1999-04-20Changed arguments to fsync() function to break dependency onTim Potter1-3/+2
connection_struct. (This used to be commit ee6f826ccc0897a4538f6f9a560127c54a4c4038)
1999-04-04Use VFS operations for file I/O.Tim Potter1-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)
1998-10-18Fixed sys_lseek and seek_file calls so all returnsJeremy Allison1-2/+11
are *checked* :-). Jeremy. (This used to be commit b8b781191dd7d28944d87eec5fa0fbef798e289b)
1998-10-15config: Fix crypt prototype on RedHat Linux.Jeremy Allison1-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)
1998-09-18gto ri of a bunch more #ifdef LARGE_SMB_OFF_T checks by introducing aAndrew Tridgell1-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)
1998-09-11Ok so with this bugfix 64 bit file access actually seems to work :-).Jeremy Allison1-2/+6
Problems were just dumb bugs like (defining sys_lseek to return 'int' DOH !). Jeremy. (This used to be commit 54dd51176fbab18af0b21bdee71b53f8f86573a8)
1998-09-11Added ssize_t to configure code.Jeremy Allison1-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)
1998-09-03Ok - this is the 64 bit widening check in. It changes the configureJeremy Allison1-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)
1998-09-01More abstraction of file system data types, to move to a 64Jeremy Allison1-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)