1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00
Commit Graph

231 Commits

Author SHA1 Message Date
Jeremy Allison
999b1e01e1 r17249: Ensure we only set the FILE_WRITE_DATA on O_TRUNC
in one place.
Jeremy.
(This used to be commit f326bae3e2)
2007-10-10 11:38:22 -05:00
Jeremy Allison
f6aeba37ff r17248: Ensure we definately add the WRITE_DATA on O_TRUNC.
Jeremy.
(This used to be commit 8eed82d5d5)
2007-10-10 11:38:22 -05:00
Jeremy Allison
f43522856b r17247: When we map generic to specific we need to remember
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 d11e71ebcc)
2007-10-10 11:38:22 -05:00
Volker Lendecke
9bbe29ad13 r17229: Indent-style reformatting -- getting used to the code again :-)
(This used to be commit 2e400fb007)
2007-10-10 11:38:20 -05:00
Volker Lendecke
0e6e3c90c9 r17228: Modest reformatting
(This used to be commit 640b4297a4)
2007-10-10 11:38:20 -05:00
Jeremy Allison
dc5f6687e4 r17152: Don't handle the delete pending here, await
reschedule.
Jeremy.
(This used to be commit 11bab9d579)
2007-10-10 11:38:16 -05:00
Jeremy Allison
201bd24ac3 r17142: Ensure we record the correct can_read/can_write
from the client requested access mask.
Jeremy.
(This used to be commit 12490fafc7)
2007-10-10 11:38:15 -05:00
Jeremy Allison
dada5b4853 r17140: Get rid of the lock release/reacquire code ! Turns out
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 3bcd52a475)
2007-10-10 11:38:15 -05:00
Jeremy Allison
48e1e45183 r17131: Optimisation - when doing a stat open don't open the
file unless we really have to (ie. O_CREAT and file
doesn't exist).
Jeremy.
(This used to be commit 788aa15ea2)
2007-10-10 11:38:14 -05:00
Jeremy Allison
addc07be7d r17130: Remove unneeded unlock call.
Jeremy.
(This used to be commit b3b5aec0ee)
2007-10-10 11:38:14 -05:00
Jeremy Allison
4815e2c344 r17128: Missed a logic error in my last patch. Ensure we deal with any
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 b7374835e6)
2007-10-10 11:38:14 -05:00
Jeremy Allison
0e292222c3 r17125: Drastic problems require drastic solutions. There's
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 8171c4c404)
2007-10-10 11:38:13 -05:00
Jeremy Allison
fbdcf2663b r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....

Jeremy.
(This used to be commit 9dafb7f48c)
2007-10-10 11:19:14 -05:00
Jeremy Allison
54ea3c23e3 r16435: Add in the uid info that Jerry needs into the
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 d929323d6f)
2007-10-10 11:18:54 -05:00
Gerald Carter
b32d2ecf9c r16219: BUG 3836, 3837, 3004: compile warning fixes from Jason Mader.
(This used to be commit 6c1f1c091f)
2007-10-10 11:17:26 -05:00
Volker Lendecke
4d1688bf6b r16198: Fix Klocwork 1023
(This used to be commit 3a7d01afbe)
2007-10-10 11:17:24 -05:00
Jeremy Allison
73cc5f1e25 r15960: Don't double-free (ensure we always free file_fsp in
the same place on error - I missed the extra free in
delay_for_oplocks).
Jeremy.
(This used to be commit 146a264815)
2007-10-10 11:17:15 -05:00
Jeremy Allison
b990e78866 r15959: Ooops. Use the right file_free call...
Jeremy.
(This used to be commit 1117a327bd)
2007-10-10 11:17:15 -05:00
Jeremy Allison
7361c7a883 r15958: Make us pass RAW-OPLOCK with kernel oplocks off.
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 c7c9adcce7)
2007-10-10 11:17:14 -05:00
Jeremy Allison
41f139c0bb r15949: Patch for bug #3308 to stop us returning duplicate
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 ad9895c654)
2007-10-10 11:17:14 -05:00
James Peach
0a1ca7fa3d r15943: Update misleading DEBUG statements and comments that refer to
open_file_shared.
(This used to be commit 784126edff)
2007-10-10 11:17:14 -05:00
Jeremy Allison
aca0a3ad3a r15404: Check for WRITE_THOUGH before calling lp_ fn. I hate
extra fn calls.
Jeremy.
(This used to be commit e468e1e5c2)
2007-10-10 11:16:41 -05:00
Jeremy Allison
ec8b810a16 r15293: Don't ever set O_SYNC on open unless "strict sync = yes".
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 dbc03125f2)
2007-10-10 11:16:32 -05:00
Jeremy Allison
f60111e074 r15138: Teach Samba the difference between exclusive and batch oplocks.
Pass Samba4 oplock test (with kernel oplocks off).
Jeremy.
(This used to be commit 3c260bcce2)
2007-10-10 11:16:26 -05:00
James Peach
4fa5559800 r14898: This change is an attempt to improve the quality of the information that
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 56bc02d644)
2007-10-10 11:15:53 -05:00
Stefan Metzmacher
18e93247aa r14883: add 'smbd:sharedelay' option, so that we can speed up BASE-DENY2 in make test
as done in samba4

metze
(This used to be commit b98dd258a7)
2007-10-10 11:15:52 -05:00
Jeremy Allison
5067cca077 r14602: Fix another logic bug in new oplock handling. Just
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 306061c93d)
2007-10-10 11:15:39 -05:00
Jeremy Allison
292afdba59 r14596: Fix a logic bug with multiple oplock contention.
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 c2488db727)
2007-10-10 11:15:38 -05:00
Volker Lendecke
f8fccdfd37 r13694: Committing patch from Aleksey Fedoseev <aleksey at fedoseev dot net> to NULL
out a pointer after talloc_destroy().

Volker
(This used to be commit 788e52eb5d)
2007-10-10 11:10:24 -05:00
Gerald Carter
fb5362c069 r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()
macro which sets the freed pointer to NULL.
(This used to be commit b65be8874a)
2007-10-10 11:10:14 -05:00
Jeremy Allison
51e8dc417b r13559: Fix bug #3522 reported by Sandeep Tamhankar <sandman@electric-cloud.com>.
mkdir foo returns the wrong error message when file foo exists.
Jeremy.
(This used to be commit c8185e7f94)
2007-10-10 11:10:14 -05:00
Gerald Carter
0af1500fc0 r13316: Let the carnage begin....
Sync with trunk as off r13315
(This used to be commit 17e63ac4ed)
2007-10-10 11:06:23 -05:00
Jeremy Allison
21a30a1346 r13314: This code has been causing problems since 1.9.x I think.
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 50c894a6e9)
2007-10-10 11:06:23 -05:00
Jeremy Allison
66d5a32d9c r13299: From testing W2K3 and W2K the delete on close bit seems to be always
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 e2fc8a196a)
2007-10-10 11:06:22 -05:00
Jeremy Allison
d14af63e6a r13293: Rather a big patch I'm afraid, but this should fix bug #3347
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 23f16cbc2e)
2007-10-10 11:06:21 -05:00
Jeremy Allison
86c9bac4c3 r13274: Fix for bug #3467. Not a show stopper.
jason qian <jason@infrant.com> was a *fantastic*
help in tracking this down.
Jeremy.
(This used to be commit 9f4a9c70fa)
2007-10-10 11:06:20 -05:00
Jeremy Allison
3317484799 r12877: Stop passing structs around in smb messages, instead
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 d01824b785)
2007-10-10 11:06:05 -05:00
Volker Lendecke
4d1d826be4 r12735: After talking to Tridge and Jeremy... This needs to be made more generic
before it goes in.

Volker
(This used to be commit 2c3d5c029a)
2007-10-10 11:06:02 -05:00
Volker Lendecke
a189257c15 r12721: GPFS 2.4 on Linux will contain some windows semantics, ie share modes and
oplocks across the cluster. Adapt Samba to it.

The gpfs API is called via libgpfs.so. This code is written with dlopen(), so
that you can compile on a system with gpfs installed and later on run on
systems without gpfs available.

So to actually make Samba call gpfs share mode calls you need to compile with
gpfs.h and libgpfs.so around and set 'gpfs share = yes' on the shares you
export from GPFS.

Volker
(This used to be commit 2253b17a1a)
2007-10-10 11:06:01 -05:00
Volker Lendecke
67706697c5 r12460: Fixes for bug 3349
(This used to be commit 040eda6bf0)
2007-10-10 11:05:56 -05:00
Jeremy Allison
ab7a4f7e8e r12213: Final fix for #3303 - send rename messages to smbd's
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 932e337db8)
2007-10-10 11:05:49 -05:00
Jeremy Allison
7d2771e758 r12203: Add the share path into the sharemode db. This involves
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 9d93af713f)
2007-10-10 11:05:49 -05:00
Jeremy Allison
533da83852 r11341: Put directory opens into the share mode db so we
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 1134abbbb3)
2007-10-10 11:05:13 -05:00
Jeremy Allison
c5260e733c r10943: Unused variable. Bug #3160 from jason@ncac.gwu.edu
Jeremy.
(This used to be commit 5647a5d4b0)
2007-10-10 11:04:57 -05:00
Jeremy Allison
bd87876a8b r10930: Fix erroneous debug spotted by Herb.
Jeremy.
(This used to be commit b2e22e7d12)
2007-10-10 11:04:56 -05:00
Jeremy Allison
94fe079be7 r10744: Fix for the second incarnation of bug #3088, pushed by Alex Masterov
<alex@infobit.ru>. A fcbopen specific part of the code was erroneously
being called as part of the mainline open. Note, that this patch
superceeds and replaces the fix that Volker added for this bug
(which he added a Samba4 torture test for ) :

"Fix a race condition in Samba 3. If two files are opened simultaneously with
NTCREATEX_DISP_CREATE (create if not exists, else fail) they might end up with
two or more times NT_STATUS_OK as EEXIST is not correctly handled."

Jeremy.
(This used to be commit 5d7ab9a17e)
2007-10-10 11:04:51 -05:00
Gerald Carter
54abd2aa66 r10656: BIG merge from trunk. Features not copied over
* \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 939c3cb5d7)
2007-10-10 11:04:48 -05:00
Jeremy Allison
11c79fa98f r10133: Fix bug #3044. open-exec is read-only.
Jeremy.
(This used to be commit ed644d4014)
2007-10-10 11:03:33 -05:00
Volker Lendecke
fa2ec3651e r9584: Fix a race condition in Samba 3. If two files are opened simultaneously with
NTCREATEX_DISP_CREATE (create if not exists, else fail) they might end up with
two or more times NT_STATUS_OK as EEXIST is not correctly handled.

Jeremy, please look closely at this. You can easily verify this by adding a
smb_msleep(100) to the top of open_file_ntcreate and run the new samba4
torture test. It does also happen without the msleep, but not as reliably.

Thanks,

Volker
(This used to be commit 58b9e48df0)
2007-10-10 11:01:14 -05:00
Volker Lendecke
4fffd271d0 r8492: open_mode_check does not use the parameter p_flags, so remove it.
Volker
(This used to be commit ed9cb0061d)
2007-10-10 11:00:06 -05:00