summaryrefslogtreecommitdiff
path: root/source3/smbd/close.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r20542: Make close_remove_share_mode retun NTSTATUS. Not that anybody cares ↵Volker Lendecke1-4/+16
yet... (This used to be commit c8995771531caa4ec9bcaef2c29b11ee7d8e49e6)
2007-10-10r20525: Closing a dir with del-on-close set requires the same as files: ↵Volker Lendecke1-0/+12
Don't actually unlink/rmdir if another process still has it open. Jeremy, this is a potential merger to 3.0.24. Volker (This used to be commit 8e1e896b02da99b5a48883c5f37fe146ad0fb5ce)
2007-10-10r20524: Simplify logic of close_remove_share_mode().Volker Lendecke1-51/+67
Volker (This used to be commit ade90dbf0c2cbd2cc49a6357f3dd220ea82fd215)
2007-10-10r20442: Slight rewrite of the change notify infrastructure. This now ↵Volker Lendecke1-1/+2
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-10r17293: After the results from the cluster tests in Germany,Jeremy Allison1-2/+0
fix the messaging code to call the efficient calls : save_re_uid() set_effective_uid(0); messaging_op restore_re_uid(); instead of using heavyweight become_root()/unbecome_root() pairs around all messaging code. Fixup the messaging code to ensure sec_init() is called (only once) so that non-root processes still work when sending messages. This is a lighter weight solution to become_root()/unbecome_root() (which swaps all the supplemental groups) and should be more efficient. I will migrate all server code over to using this (a similar technique should be used in the passdb backend where needed). Jeremy. (This used to be commit 4ace291278d9a44f5c577bdd3b282c1231e543df)
2007-10-10r17098: Samba3 now cleanly passes Samba4 RAW-LOCK tortureJeremy Allison1-2/+0
test. Phew - that was painful :-). But what it means is that we now implement lock cancels and I can add lock cancels into POSIX lock handling which will fix the fast/slow system call issue with cifsfs ! Jeremy. (This used to be commit f1a9cf075b87c76c032d19da0168424c90f6cb3c)
2007-10-10r15668: DOS or FCB opens share one share mode entry from differentJeremy Allison1-65/+73
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-10r15660: Without this when using smbcquotas I getVolker Lendecke1-0/+2
close fd=-1 fnum=4321 (numopen=1) close_file: Could not get share mode lock for file $Extend/$Quota:$Q:$INDEX_ALLOCATION unix_error_packet: error string = Das Argument ist ungültig error packet at smbd/reply.c(3325) cmd=4 (SMBclose) NT_STATUS_INVALID_HANDLE so a fake file needs special close handling I think. Jeremy, can you check this? Thanks, Volker (This used to be commit f66b9701b5c6bb6302fa11889adab6902cbaf2e3)
2007-10-10r13748: Don't reference memory after we just freed it (Doh!).Jeremy Allison1-2/+3
Thanks to tridge's changes to the directory delete on close tests for catching this. Jeremy. (This used to be commit 01ef957d4846191071f95393e6e76e48d4c6aa24)
2007-10-10r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()Gerald Carter1-2/+2
macro which sets the freed pointer to NULL. (This used to be commit b65be8874a2efe5a4b167448960a4fcf6bd995e2)
2007-10-10r13293: Rather a big patch I'm afraid, but this should fix bug #3347Jeremy Allison1-15/+51
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-10r13274: Fix for bug #3467. Not a show stopper.Jeremy Allison1-2/+2
jason qian <jason@infrant.com> was a *fantastic* help in tracking this down. Jeremy. (This used to be commit 9f4a9c70fa232047868e5d8a3f132a2dd6bfee82)
2007-10-10r12877: Stop passing structs around in smb messages, insteadJeremy Allison1-1/+5
always linearize into little-endian. Should fix all Solaris issues with this, plus provide a cleaner base moving forward for cluster-aware Samba where smbd's can communicate across different compilers/architectures (eventually these message will have to go cross-machine). Jeremy. (This used to be commit d01824b78576a034428e1cef73868d1169057991)
2007-10-10r12460: Fixes for bug 3349Volker Lendecke1-0/+2
(This used to be commit 040eda6bf0517204d5650702eea7e1d1c5eeb3d5)
2007-10-10r12213: Final fix for #3303 - send rename messages to smbd'sJeremy Allison1-11/+34
that have open file handles to allow them to correctly implement delete on close. There is a further correctness fix I'm intending to add to this to cope with different share paths, but not right now... Jeremy. (This used to be commit 932e337db8788e75344e1c7cf1ef009d090cb039)
2007-10-10r12203: Add the share path into the sharemode db. This involvesJeremy Allison1-2/+2
revving the minor version number for libsmbsharemodes (we now have a new _ex interface that takes the share path as well as the filename). Needed for #3303. Some code written by SATOH Fumiyasu <fumiya@samba.gr.jp> included in the changes to locking/locking.c. The smbstatus output is a bit of a mess and needs overhauling... Jeremy. (This used to be commit 9d93af713f8520ca506730dd32aa2b994937eaba)
2007-10-10r12160: The filename parameter to get_share_mode_lock is goingJeremy Allison1-2/+2
to become very important as we fix #3303, so make sure we don't accidently set it here. Jeremy. (This used to be commit d1a9d0587cd9a391f0193ca76cb319803c6e019f)
2007-10-10r11344: I don't think share mode conflicts occur on deletingJeremy Allison1-17/+6
a directory when you've got permissions. Need to write a smbtorture test for this. Jeremy. (This used to be commit e959a5be393eb59b8987eb6967a2ee5d11978f41)
2007-10-10r11341: Put directory opens into the share mode db so weJeremy Allison1-4/+34
can treat them similarly to file opens (delete on close, share mode violations etc.). This fixes bug #3216 I will up the default hash size on the locking db in a later commit as this means more entries. Jeremy. (This used to be commit 1134abbbb3fd8e8b88e1a5817aae106476a4c126)
2007-10-10r10656: BIG merge from trunk. Features not copied overGerald Carter1-39/+48
* \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-10r8531: Fix a memleakVolker Lendecke1-0/+1
(This used to be commit ebf0cda797da2c63aa0033f034573f6d5485b57a)
2007-10-10r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the tortureJeremy Allison1-30/+16
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-10r7963: Add aio support to 3.0.Jeremy Allison1-0/+14
Jeremy. (This used to be commit 1de27da47051af08790317f5b48b02719d6b9934)
2007-10-10r5731: Get delayed write semantics closer to W2K3. We need to store 2 times.Jeremy Allison1-1/+3
This may fix bug #2382. Jeremy. (This used to be commit a27c351e6beafc6609790a9bb9a3d0a1331e8f35)
2007-10-10r3121: Bug #1956. Ensure errno is saved and restored consistently on a ↵Jeremy Allison1-8/+18
normal_close. Jeremy. (This used to be commit f08f437c736e44913b3eeb16d6e32da8975442a7)
2007-10-10r1263: Make "defer sharing violations" a global parameter.Jeremy Allison1-0/+4
Jeremy. (This used to be commit 42cdeccc36dc5f4bd133b84d4eaeb76f42f8043b)
2007-10-10r1085: Now it's had some proper user testing, merge in the deferred open ↵Jeremy Allison1-0/+30
fix. I'm still doing more testing, but it fixes a behaviour that we've been wrong on ever since the start of Samba. Jeremy. (This used to be commit 894cc6d16296b934c112786eec896846156aee5d)
2007-10-10r370: The 'it does never happen -- error on close()' does happen when you exceedVolker Lendecke1-1/+1
your quota on an AFS file system. The specific errno was thrown away by close_normal_file(). Thus we returned NT_STATUS_UNSUCCESSFUL and not NT_STATUS_DISK_FULL as we should. Fix that. (Not that this gives more sane Windows app behaviour.... :-( ) Jerry, jra, could you please look over this one, it's been quite a while since I touch file server code. Volker (This used to be commit 588351d1b37a900eb90eddd80882170c201e9162)
2003-07-25More printf portability fixes. Got caught out by some gcc'isms lastTim Potter1-2/+2
time. )-: (This used to be commit 59dae1da66a5eb7e128263bd578f167d8746e9f0)
2003-07-24More printf fixes - size_t is long on some architectures.Tim Potter1-1/+1
(This used to be commit ba4d334b822248d8ab929c9568533431603d967e)
2003-05-14Prefix VFS API macros with SMB_ for consistency and to avoid problems with ↵Alexander Bokovoy1-1/+1
VFS_ macros at system side. We currently have one clash with AIX and its VFS_LOCK. Compiled and tested -- no new functionality or code, just plain rename of macros for yet-unreleased VFS API version. Needs to be done before a24 is out (This used to be commit c2689ed118b490e49497a76ed6a2251262018769)
2003-05-11Fix VFS layer:Alexander Bokovoy1-1/+1
1. Finally work with cascaded modules with private data storage per module 2. Convert VFS API to macro calls to simplify cascading 3. Add quota support to VFS layer (prepare to NT quota support) Patch by Stefan (metze) Metzemacher, with review of Jelmer and me Tested in past few weeks. Documentation to new VFS API for third-party developers to follow (This used to be commit 91984ef5caa2d13c5d52e1f535bd3bbbae1ec978)
2003-04-22Tidyups of some dubious logic discovered whilst trying to track down aJeremy Allison1-1/+1
strange oplock related issue on the PSA. Jeremy. (This used to be commit 1dd274bf61aaaad3c475de93f53aac176678bc7c)
2003-04-04Re-fix regression noticed by Tom Schaefer <tom@umsl.edu> due toJeremy Allison1-0/+2
correct delete on close semantics change. Jeremy. (This used to be commit 7a45b45490e6001c17fc89aabfa802f76fa3fe5e)
2003-02-11Fix delete on close semantics to match W2K. I (think:-) I understand it now :-).Jeremy Allison1-0/+16
Thanks to Nir Livni <nirl@cyber-ark.com> for giving me the test case to track it down. Jeremy. (This used to be commit 41894489e82a474f4f8f66aa2c7a117ed05b33e1)
2003-01-03Fix problem with "hide unreadable". stat file opens are baaack :-).Jeremy Allison1-53/+72
Jeremy. (This used to be commit 62038a0abf193d4dc4f37c31ac77216a10f6f326)
2002-03-20Remove the "stat open" code - make it inline. This should fix theJeremy Allison1-23/+7
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-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-12-17removed unused variableAndrew Tridgell1-1/+0
(This used to be commit bed269e6d4dc4c9622ec37f9a7e9e2b4dbbaee24)
2001-12-16Ensured filetimes set (by name) after close. Ignore errors. This is theJeremy Allison1-2/+11
correct way to ensure times set in 'pending modtime' and 'time close' are always set correctly. Inspired by patch from Juergen Hasch. Jeremy. (This used to be commit 24053858543fa6c22c0c3222570109fbfdabab9e)
2001-11-13Formatting fixes only.Jeremy Allison1-14/+14
Jeremy. (This used to be commit 27081355a97550b26c870907a471352a11921ffc)
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-09-04Merge of transfer file code from 2.2, fix for readbraw.Jeremy Allison1-1/+1
Jeremy. (This used to be commit c05e79453655abb67fd47a2d3dba88b4c5377e35)
2001-08-27converted smbd to use NTSTATUS by defaultAndrew Tridgell1-4/+0
major changes include: - added NSTATUS type - added automatic mapping between dos and nt error codes - changed all ERROR() calls to ERROR_DOS() and many to ERROR_NT() these calls auto-translate to the client error code system - got rid of the cached error code and the writebmpx code We eventually will need to also: - get rid of BOOL, so we don't lose error info - replace all ERROR_DOS() calls with ERROR_NT() calls but that is too much for one night (This used to be commit 83d9896c1ea8be796192b51a4678c2a3b87f7518)
2001-08-22Fixed the (incorrect) paranioa fix I put in for the fcntl lock spin.Jeremy Allison1-0/+3
Don't delete a share mode that failed to remove the oplock (doh!), just set the oplock entry to zero.... Jeremy. (This used to be commit fe4aa720181a43f7a636ca029680fab0c836b968)
2001-07-04strchr and strrchr are macros when compiling with optimisation in gcc, so we ↵Andrew Tridgell1-1/+1
can't redefine them. damn. (This used to be commit c41fc06376d1a2b83690612304e85010b5e5f3cf)
2001-07-04The big character set handling changeover!Andrew Tridgell1-1/+1
This commit gets rid of all our old codepage handling and replaces it with iconv. All internal strings in Samba are now in "unix" charset, which may be multi-byte. See internals.doc and my posting to samba-technical for a more complete explanation. (This used to be commit debb471267960e56005a741817ebd227ecfc512a)
2001-04-14configure:Jeremy Allison1-1/+1
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-13Merge of Andrew's changes in 2.2.Jeremy Allison1-1/+1
Jeremy. (This used to be commit fc76681812b1469208ad6c8847afdfc68bc6db49)