summaryrefslogtreecommitdiff
path: root/source3/smbd/open.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r20356: Consolidate the calls to parent_dirname() per open to one.Volker Lendecke1-35/+51
This involved passing the dirname as argument to a few routines instead of calling parent_dirname() deep down. Volker (This used to be commit 7977fd78652897bb7d4db1c21c5749043428f911)
2007-10-10r20344: Move the calls to inherit_access_acls and change_owner_to_parent ↵Volker Lendecke1-14/+16
together. Jeremy, I'm 100% sure you watch me closely here, I count on you :-) Volker (This used to be commit 02f85265f21607c950639da33bc8fe5d5ffd3cf9)
2007-10-10r20343: Split change_owner_to_parent fd-based (for file opens) and a ↵Volker Lendecke1-73/+83
name-based (for directory opens) routines. Volker (This used to be commit 4ca921d9aa90bc68d21d40ccf4b1ca0b1d2cbcb1)
2007-10-10r20342: Move the lstat into mkdir_internal, for the FILE_OPEN case in ↵Volker Lendecke1-18/+30
open_directory we want to follow symlinks. Volker (This used to be commit c20bdd219d16abcc60d67f4a21b4fcd661473835)
2007-10-10r20340: Join vfs_MkDir to its only callerVolker Lendecke1-7/+25
(This used to be commit cce911780fc52ea56dccde1879b0891cdf9ea320)
2007-10-10r20339: Make mkdir_internal static to open.cVolker Lendecke1-3/+47
(This used to be commit 6dd0886b49969d0edfe16861f19d35275217b2af)
2007-10-10r20338: Restructure open_directory a bit. This gets rid of a race condition ↵Volker Lendecke1-52/+36
regarding error messages: We relied upon a stat that a directory did not exist to later on then do the mkdir or not. This does the mkdir directly and copes with a potential error. The second one is more important: It's possible with Samba 3 to do a ntcreate&x with NTCREATEX_OPTIONS_DIRECTORY and we happily do a NT_STATUS_OK. Also move up the use_nt_status() logic a bit. I think this does not belong into the core routines, the smb server as such should take care of it. Jeremy, do you think this should go to 3.0.24? I'll update samba4torture when the build farm has picked up this checkin. Volker (This used to be commit 472fb11f4968d30cedc9851215c63acd3132f3db)
2007-10-10r20257: Hey, change_owner_to_parent is now static :-)Volker Lendecke1-4/+4
(This used to be commit 4090bc4bca77edafcafa52ecb7dc75ead2779cb5)
2007-10-10r20228: Bring the calling conventions of inherit_access_acl and ↵Volker Lendecke1-1/+3
change_owner_to_parent a bit closer together: Move the lp_inherit_perms() check into the callers. Volker (This used to be commit 0874093e5fff480d8ec442072318525079add633)
2007-10-10r19993: Fix the problem with Linux clients requesting O_WRONLYJeremy Allison1-3/+12
on write-only files. Jim please check. Should not affect Windows clients - I ensured all the relevent Samba4 torture tests still pass. Jeremy. (This used to be commit 6df3cac44fb1eafa84f9fc0ce4485242b4cce111)
2007-10-10r19647: Add some GPFS support in a vfs mod. Also adds the kernel flock op toJim McDonough1-24/+13
the vfs layer, since gpfs supports it. Thanks to Volker, Christian, Mathias, Chetan, and Peter. (This used to be commit 0620658890fa9c68a9848538728023192319c81a)
2007-10-10r19077: Fix an uninitialized variableVolker Lendecke1-2/+2
(This used to be commit 6bc2cce645af94274a5959312c52799c221b0899)
2007-10-10r18802: Use the pidl-generated code for the srvsvc interface, both client ↵Jelmer Vernooij1-1/+1
and server code. This has had some basic testing. I'll do more during the next couple of days and hopefully also make RPC-SRVSVC from Samba4 pass against it. (This used to be commit ef10672399c4b82700dc431b4d93431ffdd42d98)
2007-10-10r17676: Fix printing bug found by kukks. Don't copy a returnJeremy Allison1-1/+1
value into an auto on the stack that gets removed when we return from the frame :-). Jeremy. (This used to be commit 85bf8a16116e5eb9d4400e809531737d45890abb)
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-10r17254: Simple flattening of an if-statement, no logic change.Volker Lendecke1-21/+27
Jeremy, I'm sure you will look at this nevertheless :-) Volker (This used to be commit 3ef34468b55771b6f6b54454fa6c9decc183c565)
2007-10-10r17249: Ensure we only set the FILE_WRITE_DATA on O_TRUNCJeremy Allison1-3/+0
in one place. Jeremy. (This used to be commit f326bae3e269046b6f087626240cddbb5dafb0e4)
2007-10-10r17248: Ensure we definately add the WRITE_DATA on O_TRUNC.Jeremy Allison1-3/+4
Jeremy. (This used to be commit 8eed82d5d5ba34cc0a6b99b9d0df45eec5f788fa)
2007-10-10r17247: When we map generic to specific we need to rememberJeremy Allison1-2/+5
to copy over the copy of the access_mask, open_access_mask. Jerry - this is a definate fix for a 3.0.23b and should also be on the patches page. CIFSFS breaks without this. Jeremy. (This used to be commit d11e71ebcccf6907f2404a04aa6bf61b12ab2709)
2007-10-10r17229: Indent-style reformatting -- getting used to the code again :-)Volker Lendecke1-51/+53
(This used to be commit 2e400fb0077ccef38fff28ef037f982624b7815b)
2007-10-10r17228: Modest reformattingVolker Lendecke1-17/+24
(This used to be commit 640b4297a400fe23418e9c1c01d4c14ce3bde5b4)
2007-10-10r17152: Don't handle the delete pending here, awaitJeremy Allison1-7/+0
reschedule. Jeremy. (This used to be commit 11bab9d57958659c71f053fe8dc0f9156c9f3c1f)
2007-10-10r17142: Ensure we record the correct can_read/can_writeJeremy Allison1-4/+6
from the client requested access mask. Jeremy. (This used to be commit 12490fafc7f98952bf709c4c504f8f2b5646f197)
2007-10-10r17140: Get rid of the lock release/reacquire code ! Turns outJeremy Allison1-85/+73
that create dispositions that cause O_TRUNC break oplocks. This simplifies the code - although we have to keep separate the client requested access mask and the access mask we actually use to open the file. Jeremy. (This used to be commit 3bcd52a4752ec6c2a8f678afa3b7b3646103ad60)
2007-10-10r17131: Optimisation - when doing a stat open don't open theJeremy Allison1-1/+1
file unless we really have to (ie. O_CREAT and file doesn't exist). Jeremy. (This used to be commit 788aa15ea24e6dfb61820465b5b881829a64297a)
2007-10-10r17130: Remove unneeded unlock call.Jeremy Allison1-3/+0
Jeremy. (This used to be commit b3b5aec0eef3bdcae75ce79ffd3ecf21fb1279e7)
2007-10-10r17128: Missed a logic error in my last patch. Ensure we deal with anyJeremy Allison1-5/+42
oplocks that were granted when we had released the lock. Fix strange case where stat open grants a batch oplock on file create, but grants no oplock on file open. Jeremy. (This used to be commit b7374835e6ec0c98fc4020623f0a37c0c173b8aa)
2007-10-10r17125: Drastic problems require drastic solutions. There'sJeremy Allison1-76/+73
no way to get all the cases where kernel oplocks are on and we can't open the file and get the correct semantics (think about the open with truncate with an attribute only open - we'd need a vfs change to add the truncate(fname, len) call). So always drop the share mode lock before doing any real fd opens and then re-acquire it afterwards. We're already dealing with the race in the create case, and we deal with any other races in the same way. Volker, please examine *carefully* :-). This should fix the problems people reported with kernel oplocks being on. Jeremy. (This used to be commit 8171c4c404e9f382880c65daa0232f89e560f399)
2007-10-10r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison1-112/+117
to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8)
2007-10-10r16435: Add in the uid info that Jerry needs into theJeremy Allison1-2/+2
share_mode struct. Allows us to know the unix uid of the opener of the file/directory. Needed for info level queries on open files. Jeremy. (This used to be commit d929323d6f513902381369d77bcd7b714346d713)
2007-10-10r16219: BUG 3836, 3837, 3004: compile warning fixes from Jason Mader.Gerald Carter1-2/+0
(This used to be commit 6c1f1c091f5e87bf9464fe8ad7eb2cb683819a62)
2007-10-10r16198: Fix Klocwork 1023Volker Lendecke1-1/+0
(This used to be commit 3a7d01afbebe5c4c36935b6128998e1327c8f856)
2007-10-10r15960: Don't double-free (ensure we always free file_fsp inJeremy Allison1-1/+0
the same place on error - I missed the extra free in delay_for_oplocks). Jeremy. (This used to be commit 146a2648156563b41642d42c46aff401e435a42b)
2007-10-10r15959: Ooops. Use the right file_free call...Jeremy Allison1-3/+3
Jeremy. (This used to be commit 1117a327bd4fb425d25ea63df782095701fb83bb)
2007-10-10r15958: Make us pass RAW-OPLOCK with kernel oplocks off.Jeremy Allison1-13/+20
This allows a requestor to set FORCE_OPLOCK_BREAK_TO_NONE to ensure we don't break to level 2. Fixed a couple of resource leaks in error paths in open_file_ntcreatex. Jeremy. (This used to be commit c7c9adcce7f13d01445f31b07fb28a76f0a1d6df)
2007-10-10r15949: Patch for bug #3308 to stop us returning duplicateJeremy Allison1-5/+8
mid replies on path based set-eof trans2 calls. Needs modification for HEAD (as in head open_file_ntcreateX properly returns NTSTATUS - I'll fix this tomorrow my time). Secondly it still fails the Samba4 RAW-OPLOCK smbtorture because of an interesting case. Our oplock code always returns "break to level 2" if it can. In this case (path-based set-eof or set-allocation size on an exclusive oplocked file) W2K3 always sends a break-to-none. We send the break to none (from level2) after we've done the write for eof or allocation size. I need to work out some way of telling our break code to always break to none (might need to extend the message field). Jeremy. (This used to be commit ad9895c654f400e242adcd4099f7cd004521ee92)
2007-10-10r15943: Update misleading DEBUG statements and comments that refer toJames Peach1-3/+3
open_file_shared. (This used to be commit 784126edff942d1c2f79f7c9feb59980426f331e)
2007-10-10r15404: Check for WRITE_THOUGH before calling lp_ fn. I hateJeremy Allison1-1/+1
extra fn calls. Jeremy. (This used to be commit e468e1e5c2dbee29066f0efe4141d8705def5d6f)
2007-10-10r15293: Don't ever set O_SYNC on open unless "strict sync = yes".Jeremy Allison1-1/+1
This could be the cause of the perf. problem reported between 3.0.14a and 3.0.2x. Lufthansa has *wireless* on their flights to the USA now... (I'm in heaven ! :-). Jeremy. (This used to be commit dbc03125f2643f8ecff8e901cb23fa6408cce011)
2007-10-10r15138: Teach Samba the difference between exclusive and batch oplocks.Jeremy Allison1-40/+60
Pass Samba4 oplock test (with kernel oplocks off). Jeremy. (This used to be commit 3c260bcce2de76d724279e07dca61eadddfb8782)
2007-10-10r14898: This change is an attempt to improve the quality of the information thatJames Peach1-2/+2
is produced when a process exits abnormally. First, we coalesce the core dumping code so that we greatly improve our odds of being able to produce a core file, even in the case of a memory fault. I've removed duplicates of dump_core() and split it in two to reduce the amount of work needed to actually do the dump. Second, we refactor the exit_server code path to always log an explanation and a stack trace. My goal is to always produce enough log information for us to be able to explain any server exit, though there is a risk that this could produce too much log information on a flaky network. Finally, smbcontrol has gained a smbd fault injection operation to test the changes above. This is only enabled for developer builds. (This used to be commit 56bc02d64498eb3faf89f0c5452b9299daea8e95)
2007-10-10r14883: add 'smbd:sharedelay' option, so that we can speed up BASE-DENY2 in ↵Stefan Metzmacher1-1/+8
make test as done in samba4 metze (This used to be commit b98dd258a74a1e1b4e967e6176a5a92986d03123)
2007-10-10r14602: Fix another logic bug in new oplock handling. JustJeremy Allison1-12/+17
because lck->num_share_modes != 0 doesn't mean that there *are* other valid share modes. They may be all marked "UNUSED" or be deferred open entries. In that case don't downgrade the granted oplock to level2 needlessly - a client can have an exclusive oplock in this case. The original code handled this correctly in the lck->num_share_modes == 0 case but not in the case where there were no valid share modes but lck->num_share_modes != 0. I'll clean up my Samba4 torture tester for this and commit it tomorrow. Jeremy. (This used to be commit 306061c93d9181262298516fefd83444f5a65ce5)
2007-10-10r14596: Fix a logic bug with multiple oplock contention.Jeremy Allison1-18/+33
The sad thing is the core of this bug fix is just removing a paranoia "exit_server" call, as the rest of the logic was already correct :-). Lots of comments to explain the logic added. I will look at adding tests to exercise this, might be possible. Jeremy. (This used to be commit c2488db727e1a00f112be7b169de9e6208e311f3)
2007-10-10r13694: Committing patch from Aleksey Fedoseev <aleksey at fedoseev dot net> ↵Volker Lendecke1-1/+1
to NULL out a pointer after talloc_destroy(). Volker (This used to be commit 788e52eb5d17a8f5b41b6ad5244ccf448fc81a36)
2007-10-10r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()Gerald Carter1-12/+12
macro which sets the freed pointer to NULL. (This used to be commit b65be8874a2efe5a4b167448960a4fcf6bd995e2)
2007-10-10r13559: Fix bug #3522 reported by Sandeep Tamhankar ↵Jeremy Allison1-6/+0
<sandman@electric-cloud.com>. mkdir foo returns the wrong error message when file foo exists. Jeremy. (This used to be commit c8185e7f94cbcf2125bf0e84db02fb8d19111f60)
2007-10-10r13316: Let the carnage begin....Gerald Carter1-9/+1
Sync with trunk as off r13315 (This used to be commit 17e63ac4ed8325c0d44fe62b2442449f3298559f)
2007-10-10r13314: This code has been causing problems since 1.9.x I think.Jeremy Allison1-19/+0
Remove check_for_pipe() - Volker was completely correct. If it gets re-added it will be in a old open call path, not in the generic code path. Jeremy. (This used to be commit 50c894a6e949d4d3579926650674f381a821a671)
2007-10-10r13299: From testing W2K3 and W2K the delete on close bit seems to be alwaysJeremy Allison1-3/+3
honored (ie. the file gets deleted) for derectories when set at open time - even though it doesn't show in the qfileinfo call. This is not true of files.... (if anyone from the EU is listening, it's stuff like this that makes CIFS non-documentable :-). Jeremy. (This used to be commit e2fc8a196a06f76aa47fabc30872c701a2f7ccec)