summaryrefslogtreecommitdiff
path: root/source3/smbd/files.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r21714: Change the VFS interface to use struct timespecJeremy Allison1-3/+3
for utimes - change the call to ntimes. This preserves nsec timestamps we get from stat (if the system supports it) and only maps back down to usec or sec resolution on time set. Looks bigger than it is as I had to move lots of internal code from using time_t and struct utimebuf to struct timespec. Jeremy. (This used to be commit 8f3d530c5a748ea90f42ed8fbe68ae92178d4875)
2007-10-10r21319: Remove functions not needed anymoreVolker Lendecke1-44/+0
(This used to be commit 0c8a364aec68bc7338d034b6f8223ec4085c9e07)
2007-10-10r21279: Get rid of 'aio write behind', this is broken.Volker Lendecke1-1/+0
It should probably better be integrated with our write cache. Volker (This used to be commit 58bfd168b046a97a895aaa3384fd7af8d077a1d5)
2007-10-10r21092: Ok, that's the one that activates the Samba4 notify backend.Volker Lendecke1-1/+4
Now to clean up / fix lots of stuff. Volker (This used to be commit 9e7443fa1417c01be903b15073825dc4def78d99)
2007-10-10r20854: Ok, now I think we're at a point where looking at notify starts to ↵Volker Lendecke1-0/+46
make sense again :-) Volker (This used to be commit 5533cdeec1b0cdee39b1d89e2320587dc9281ee6)
2007-10-10r20634: A *LOT* more work is necessary before touching notify remotely ↵Volker Lendecke1-46/+0
starts to make sense. Until then, remove it from the tree to keep the diff between 3_0_24 and 3_0 small. Volker (This used to be commit f146a85e74c84e78a11e616a1cbeaeef4693a0e0)
2007-10-10r20442: Slight rewrite of the change notify infrastructure. This now ↵Volker Lendecke1-24/+33
survives the first of the raw-notify subtests, the one-level test_notify_dir without any flags around yet. The tricky part was getting the data structures right, I hope the next tests don't let that fall over. fsp->notify is now by default NULL, meaning that nobody has issued a changenotify call. This means nobody is interested in changes for this directory. If that has happened, notify_change_buf collects the changes if no current request is outstanding, and it collects the requests if no change has happened since the last request. Happy New Year, somewhere on this planet it's already 2007 :-) Volker P.S: Jeremy, there's a question for you in smbd/files.c line 367. (This used to be commit ce0ad24988075465addcac0b9afc872e909135af)
2007-10-10r20394: This is a *VERY* early start of my work on notify.Volker Lendecke1-0/+37
Checking in because Jeremy was bugging me. Potentially this becomes quite intrusive, I'm not sure if I should open a temporary branch for this. Jeremy, Jerry, do you think 3_0 is the right place for this? Volker (This used to be commit bcf5c751cbe203c00814642e26440cf88f300bce)
2007-10-10r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison1-26/+44
to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8)
2007-10-10r15817: Remove some unused codeVolker Lendecke1-20/+0
(This used to be commit 72f103708d17aa86e09fa7a02699f969f7ee9190)
2007-10-10r15668: DOS or FCB opens share one share mode entry from differentJeremy Allison1-4/+4
fsp pointers. Ensure we cope with this to pass Samba4 DENY tests (we used to pass these, there must have been a regression with newer code). We now pass them. Jeremy (This used to be commit fd6fa1d4eaf61783df74ee2da50d331477f06998)
2007-10-10r14460: SMBexit closes by pid and vuid. Tested with smbtorture.Jeremy Allison1-3/+3
Jeremy. (This used to be commit 71e81580421225d5b35a25d46a7b6064a826685c)
2007-10-10r13293: Rather a big patch I'm afraid, but this should fix bug #3347Jeremy Allison1-3/+3
by saving the UNIX token used to set a delete on close flag, and using it when doing the delete. libsmbsharemodes.so still needs updating to cope with this change. Samba4 torture tests to follow. Jeremy. (This used to be commit 23f16cbc2e8cde97c486831e26bcafd4ab4a9654)
2007-10-10r10656: BIG merge from trunk. Features not copied overGerald Carter1-21/+12
* \PIPE\unixinfo * winbindd's {group,alias}membership new functions * winbindd's lookupsids() functionality * swat (trunk changes to be reverted as per discussion with Deryck) (This used to be commit 939c3cb5d78e3a2236209b296aa8aba8bdce32d3)
2007-10-10r9985: Move the all the strict sync logic into file_sync().James Peach1-1/+1
(This used to be commit cc680bbe22b8bfc5a1900f11c2cbaeca3a9f9922)
2007-10-10r8292: Tidy up function comments.Jeremy Allison1-2/+10
Jeremy. (This used to be commit 8de6b1592ad205f59c44ed30102a56594f65e555)
2007-10-10r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the tortureJeremy Allison1-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. (This used to be commit c7fe18761e2c753afbffd3a78abff46472a9b8eb)
2007-10-10r6172: Tidy up error processing significantly. Remove unix_ERR_XXX global ↵Jeremy Allison1-4/+2
nastyness. Jeremy. (This used to be commit d3379fe61bb934082b51a37adac232a96bafcf46)
2007-10-10r5731: Get delayed write semantics closer to W2K3. We need to store 2 times.Jeremy Allison1-0/+4
This may fix bug #2382. Jeremy. (This used to be commit a27c351e6beafc6609790a9bb9a3d0a1331e8f35)
2007-10-10r5720: Attempt to fix bug #2382 (Excel shared workbook stops working). AlsoJeremy Allison1-2/+57
incorporates part of the fix created by ke_miyata@itg.hitachi.co.jp for bug #2045 (MS-Office behavior of timestamp). Jeremy. (This used to be commit 4f3b12ac73487f4ccb37c17506af1abf5acc80cd)
2007-10-10r4088: Get medieval on our ass about malloc.... :-). Take control of all our ↵Jeremy Allison1-1/+1
allocation functions so we can funnel through some well known functions. Should help greatly with malloc checking. HEAD patch to follow. Jeremy. (This used to be commit 620f2e608f70ba92f032720c031283d295c5c06a)
2007-10-10r3050: Steal from Samba4 :-). Make us pass most of the new lock tests ↵Jeremy Allison1-22/+24
(except for the cancel lock which I have to add). Jeremy. (This used to be commit cf7f89999e0c6becd4617c812400d1e71b9c0a30)
2003-09-17Fix coredump from Samba4 torture suite.Jeremy Allison1-0/+2
Jeremy. (This used to be commit 9c1bab944526270d2ad79c75894c33f58f8e3845)
2003-08-19Implement SMBexit properly. Found by Samba4 tester. You must do a makeJeremy Allison1-0/+16
clean proto all; after this commit. Jeremy. (This used to be commit 27af1f9feab12542dc538bfceac4593e644ba3b4)
2003-08-16Implemented the level 1010 NT rename level. Many fixes for Samba4 testJeremy Allison1-0/+12
correctness. Jeremy. (This used to be commit f57429befa43d63ed9a6e19b854e22fd4151db40)
2003-05-22Stat opens can have fsp->fd == -1 and will have a share entry. EnsureJeremy Allison1-2/+10
that file_find_dif will find them. Fixes a core dump in smbd/open.c. Jeremy. (This used to be commit 0e2165630d2ce31076fef6d7098e45c8fd327e23)
2003-05-12Add NT quota support. Patch from Stefan (metze) MetzemacherAlexander Bokovoy1-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 (This used to be commit 4bf022ce9e45be85609426762ba2644ac2031326)
2002-10-22Fix for systems that allow more than 65536 open files per process.Jeremy Allison1-1/+8
Jeremy. (This used to be commit 947a56ce00e552e8b8d2ed64435eabde6225f044)
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)
2001-10-20Move from timestamp to gen count file id's for finding oplocked filesJeremy Allison1-20/+57
in a tdb. Jeremy. (This used to be commit 058ae6b58f61ef46013dd076af3a84de5fbaaab1)
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-1/+1
(This used to be commit a95943fde0ad89ae3f2deca2f7ba9cb5ab612b74)
2001-04-14configure:Jeremy Allison1-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. (This used to be commit 32397e5bc6d995ce7ca37c82d6aedc1e5b1b6fbd)
2001-04-13Added fix from "Eric Boehm" <boehm@nortelnetworks.com> to try and set hardJeremy Allison1-3/+3
limit before setting soft limit. Jeremy. (This used to be commit a1eb2752a8bee9cc7d92c664c3de84e02620933d)
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-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-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-24Now that fsp's are created on successful file open, the structure memberJeremy Allison1-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 used to be commit 389b700a26e8a308a0dff6fc038c38068aa0119a)
2000-04-22This is a *big* checkin that may break some things, but implements theJeremy Allison1-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. (This used to be commit ab0ecc39d688f16b9692fe90b991f0b89287070a)
2000-04-10initialise fsp->fd to -1Andrew Tridgell1-0/+1
(This used to be commit 5257ff5d67632922a64266ad2ce5d5a38c701cbc)
2000-04-10the bulk of the changes to get rid of fd_ptr and move print openAndrew Tridgell1-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 (This used to be commit d1827a3648009fd0a0d165055015d9aeda7a1037)
2000-02-03Mega-VFS merge. Yeah baby!Tim Potter1-1/+1
Synopsis: change every disk access function to work through a vfs_ops structure contained in the connection_struct. (This used to be commit 3aad500c0fb61232ed3431ff4b743b5d18ec852f)
2000-01-16use string_set() instead of string_init()Andrew Tridgell1-1/+1
bug pointed out by Richard (This used to be commit 070f49397ff24e4d6ba7c2c1cfaef2dfa0944bd0)
1999-12-13first pass at updating head branch to be to be the same as the SAMBA_2_0 branchAndrew Tridgell1-12/+6
(This used to be commit 453a822a76780063dff23526c35408866d0c0154)
1999-08-13spelling mistake.Luke Leighton1-1/+1
(This used to be commit b8ac96cd9c8efaf0e07651657f878a2dea127290)
1999-04-20Changed arguments to fsync() function to break dependency onTim Potter1-2/+3
connection_struct. (This used to be commit ee6f826ccc0897a4538f6f9a560127c54a4c4038)
1999-04-04Use VFS operations for file I/O.Tim Potter1-3/+2
(This used to be commit cfddbdb62485256a947a30e04c753200451cbe1c)
1998-11-18Fixed crash bug which was assuming that fd_ptr was always non-nullJeremy Allison1-2/+5
(which is not the case with open directories). Jeremy. (This used to be commit c154b1601f5891d664fc538ec8874fa8ef2061e6)
1998-10-23Reasonably large change to give us *exactly* correct NT delete on close ↵Jeremy Allison1-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. (This used to be commit 5e6a7cd99d29d1cf068fc517272559c1cf47ea3a)