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

205 Commits

Author SHA1 Message Date
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
Jeremy Allison
af8a691db1 r8219: Merge the new open code from HEAD to 3.0. Haven't yet run the torture
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 c7fe18761e)
2007-10-10 10:58:18 -05:00
Jeremy Allison
f2f55d703d r7963: Add aio support to 3.0.
Jeremy.
(This used to be commit 1de27da470)
2007-10-10 10:58:05 -05:00
Jeremy Allison
0835575415 r6673: Fix the write cache based on some VERY good detective work
from Ingo Kilian <ikilian@web.de>.
You must do a make clean after updating this.
Jeremy.
(This used to be commit 3b2cd19fcb)
2007-10-10 10:56:50 -05:00
Jeremy Allison
da70ef7c06 r6344: Fix bug #2601 - it seems that DOS_OPEN_EXEC does mean readonly. Needed
for Win9x and OS/2 clients. More Samba4 tests against W2k3 will be needed
to confirm this but in the meantime get it up and running.
Jeremy.
(This used to be commit 77c0ade9fa)
2007-10-10 10:56:37 -05:00
Herb Lewis
978ca84860 r6225: get rid of warnings from my compiler about nested externs
(This used to be commit efea76ac71)
2007-10-10 10:56:30 -05:00
Jeremy Allison
d318fe4025 r6200: Returned access should contain share mode as well as open mode.
Jeremy.
(This used to be commit 3aa784c077)
2007-10-10 10:56:28 -05:00
Jeremy Allison
1045c78624 r6174: Fixup T2 open call - we were returning 2 bytes short.
Jeremy.
(This used to be commit 0c7de7615b)
2007-10-10 10:56:27 -05:00
Jeremy Allison
0557c6cba2 r6172: Tidy up error processing significantly. Remove unix_ERR_XXX global nastyness.
Jeremy.
(This used to be commit d3379fe61b)
2007-10-10 10:56:27 -05:00
Jeremy Allison
67425afa3e r6152: Correctly check OpenX open modes.
Jeremy.
(This used to be commit 326124a7b3)
2007-10-10 10:56:25 -05:00
Jim McDonough
99509cb0b5 r5854: Fix coredump when OS/2 checks for long file name support (with .+,;=[].).
Bugzilla 2338.

Thanks to Guenter Kukkukk <guenter.kukkukk@kukkukk.com>
(This used to be commit c137362871)
2007-10-10 10:56:05 -05:00
Jeremy Allison
56b22250f4 r5848: Fix inherit owner to chown directories in a porable and secure way (from
just secure on Linux). Idea from tridge.
Jeremy.
(This used to be commit c0924a497b)
2007-10-10 10:56:05 -05:00
Jeremy Allison
cc5ba986bf r5792: Added new parameter "inherit owner". If set on a share, the created file/directory
will be owned by the same uid as the containing directory. Doing this for directories
in a race-free mannor has only been tested on Linux (it depends on being able to open
a directory and then do a fchown on that file descriptor). If this functionality is
not available then the code silently downgrades to not changing the ownership of a
new directory. This new parameter (docs to follow) finally makes it possible to create
"drop boxes" on Samba, which requires all files within a directory to be commonly owned.
A HOWTO on how to use this will follow.
Jeremy.
(This used to be commit 2e1f727184)
2007-10-10 10:56:01 -05:00
Jeremy Allison
a4deaac09f r5630: This may be a mistake ... needs more cthon investigation.
Jeremy.
(This used to be commit 0322c58846)
2007-10-10 10:55:51 -05:00
Jeremy Allison
02bce09010 r5623: Horrible band-aid patch to fix Blue-Arc torture tester.
I know this isn't right but will work until I can refactor
the deny mode code with the Samba4 algorithm.
Jeremy.
(This used to be commit f38f464c72)
2007-10-10 10:55:51 -05:00
Jeremy Allison
02c25a2683 r5014: Split out the request to send an async level II oplock break into a
new function to make it clear when it's called. Remove async parameter
that had been overloaded into request_oplock_break.
Inspired by work from Nadav Danieli <nadavd@exanet.com>.
Jeremy.
(This used to be commit 05697fb502)
2007-10-10 10:55:11 -05:00
Jeremy Allison
acf9d61421 r4088: Get medieval on our ass about malloc.... :-). Take control of all our 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 620f2e608f)
2007-10-10 10:53:32 -05:00
Jeremy Allison
46f546571b r4007: Fix bug #2088 - ensure inherit permissions is only applied on a new file,
not an existing one.
Jeremy.
(This used to be commit fbbdb72cf1)
2007-10-10 10:53:27 -05:00
Volker Lendecke
ea9f97886b r3853: Fix an uninitialized variable warning. Jeremy, there are some of these in
charcnv.c.

Volker
(This used to be commit 650d52648d)
2007-10-10 10:53:21 -05:00
Jeremy Allison
2efbc238d4 r3002: Fix for bug #1886 - prevent delete on close being set
for readonly files (and return the correct error code).
We now pass the Samba4 test suite on this.
Jeremy.
(This used to be commit 6ae417f12c)
2007-10-10 10:52:59 -05:00
Jeremy Allison
69e87ef8c3 r2083: Fix memleak on return code path.
Jeremy.
(This used to be commit b0af241fd1)
2007-10-10 10:52:31 -05:00
Jeremy Allison
a96dfe038e r2027: Fix for but #1657, used initialized variable, from
Helmut Heinreichsberger <helmut.heinreichsberger@chello.at>.
Jeremy.
(This used to be commit 07f7aa6afb)
2007-10-10 10:52:29 -05:00
Jeremy Allison
57c07e2785 r1304: Turns out non-io opens that cause oplock breaks are a *different* set
of desired access flags from those that cause sharing violations.
Oplock breaks are caused by : ~(SYNCHRONIZE_ACCESS|FILE_READ_ATTRIBUTES|FILE_WRITE_ATTRIBUTES)
Sharing violations are caused by : ~(SYNCHRONIZE_ACCESS|READ_CONTROL_ACCESS|FILE_READ_ATTRIBUTES|FILE_WRITE_ATTRIBUTES)
We now pass the torture rename test again.
I still need to work out if subsequent opens will cause sharing violations with an existing open
mode of SYNCHRONIZE_ACCESS|READ_CONTROL_ACCESS|FILE_READ_ATTRIBUTES|FILE_WRITE_ATTRIBUTES;
Jeremy.
(This used to be commit 38002bfc1c)
2007-10-10 10:52:05 -05:00
Jeremy Allison
3e0f586298 r1263: Make "defer sharing violations" a global parameter.
Jeremy.
(This used to be commit 42cdeccc36)
2007-10-10 10:52:04 -05:00
Jeremy Allison
7f05a7d0c8 r1260: Added new parameter in the protocol section. "defer sharing violations",
by default set to "yes" (to correctly emulate Windows). I've added this to
ensure if we find a critical problem with this new code when 3.0.5 ships
it can be turned off to test for bugs.
Jeremy.
(This used to be commit bee0619cc4)
2007-10-10 10:52:03 -05:00
Jeremy Allison
459cb00785 r1097: Fix errno being incorrectly set. Noticed by Richard.
Jeremy.
(This used to be commit c8a55e92dd)
2007-10-10 10:51:54 -05:00
Jeremy Allison
effd4a3385 r1089: Removed spurious oplock message in deferred open processing.
Fix smb signing sequence counts.
Jeremy.
(This used to be commit 7e2a5c3661)
2007-10-10 10:51:54 -05:00