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

255 Commits

Author SHA1 Message Date
Jeremy Allison
c9a14ea19f r20883: W00t! I now understand how "delete on close" really
works - even with the strange "initial delete on close"
semantics. The "initial delete on close" flag isn't
committed to the share mode db until the handle is
closed, and is discarded if any real "delete on close"
was set. This allows me to remove the "initial_delete_on_close"
flag from the share db, and move it into a BOOL in files_struct.
Warning ! You must do a make clean after this. Cope with
the wrinkle in directory delete on close which is done
differently from files. We now pass all Samba4 smbtortute
BASE-DELETE tests except for the one checking that files
can't be created in a directory which has the delete on
close set (possibly expensive to fix).
Jeremy.
(This used to be commit f2df77a149)
2007-10-10 12:17:18 -05:00
Jeremy Allison
fd37f98158 r20873: Some correctness fixes w.r.t. Samba4 torture BASE-DELETE.
Allow us to correctly refuse to set delete on close on a
non-empty directory. There are still some delete-on-close
wrinkles to be fixed, but I understand how to do that better
now. I'll fix this tomorrow.
Jeremy.
(This used to be commit 0296358858)
2007-10-10 12:17:16 -05:00
Volker Lendecke
940192ddcc r20854: Ok, now I think we're at a point where looking at notify starts to make sense
again :-)

Volker
(This used to be commit 5533cdeec1)
2007-10-10 12:17:13 -05:00
Jeremy Allison
60c1a8e5a8 r20845: Somehow I missed this one - should have been part of the
previous commit :-(.
Jeremy.
(This used to be commit 8fe3829e8a)
2007-10-10 12:17:13 -05:00
Volker Lendecke
46fdae1b6b r20634: A *LOT* more work is necessary before touching notify remotely 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 f146a85e74)
2007-10-10 12:17:00 -05:00
Volker Lendecke
92d02f7afe r20451: Survive the first of the filter-tests (mkdir).
Add lots of TODOs :-)

Volker
(This used to be commit 0e953884a1)
2007-10-10 12:16:50 -05:00
Volker Lendecke
165f5f3f40 r20433: Work in progress: Survive more of RAW-NOTIFY.
call_nt_transact_notify_change() is now sync if there are changes around.

A notify_message does a direct reply from within the message, so
process_pending_change_notify_queue is not needed anymore for samba-generated
events. Next step is to restructure the kernel-mechanisms to generate
messages.

Volker
(This used to be commit c813f71d00)
2007-10-10 12:16:49 -05:00
Volker Lendecke
98c082489b r20394: This is a *VERY* early start of my work on notify.
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 bcf5c751cb)
2007-10-10 12:16:46 -05:00
Volker Lendecke
8cd9636458 r20356: Consolidate the calls to parent_dirname() per open to one.
This involved passing the dirname as argument to a few routines instead of
calling parent_dirname() deep down.

Volker
(This used to be commit 7977fd7865)
2007-10-10 12:16:43 -05:00
Volker Lendecke
e8e5c17f2e r20344: Move the calls to inherit_access_acls and change_owner_to_parent together.
Jeremy, I'm 100% sure you watch me closely here, I count on you :-)

Volker
(This used to be commit 02f85265f2)
2007-10-10 12:16:43 -05:00
Volker Lendecke
a67757ef9c r20343: Split change_owner_to_parent fd-based (for file opens) and a name-based (for
directory opens) routines.

Volker
(This used to be commit 4ca921d9aa)
2007-10-10 12:16:43 -05:00
Volker Lendecke
4e5a335c07 r20342: Move the lstat into mkdir_internal, for the FILE_OPEN case in open_directory
we want to follow symlinks.

Volker
(This used to be commit c20bdd219d)
2007-10-10 12:16:43 -05:00
Volker Lendecke
af1750934d r20340: Join vfs_MkDir to its only caller
(This used to be commit cce911780f)
2007-10-10 12:16:42 -05:00
Volker Lendecke
d0c6f9b728 r20339: Make mkdir_internal static to open.c
(This used to be commit 6dd0886b49)
2007-10-10 12:16:42 -05:00
Volker Lendecke
469b42c61f r20338: Restructure open_directory a bit. This gets rid of a race condition 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 472fb11f49)
2007-10-10 12:16:42 -05:00
Volker Lendecke
920e1a3685 r20257: Hey, change_owner_to_parent is now static :-)
(This used to be commit 4090bc4bca)
2007-10-10 12:16:37 -05:00
Volker Lendecke
9933b596d1 r20228: Bring the calling conventions of inherit_access_acl and change_owner_to_parent
a bit closer together: Move the lp_inherit_perms() check into the callers.

Volker
(This used to be commit 0874093e5f)
2007-10-10 12:16:34 -05:00
Jeremy Allison
61ea96ec79 r19993: Fix the problem with Linux clients requesting O_WRONLY
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 6df3cac44f)
2007-10-10 12:16:18 -05:00
Jim McDonough
4fe70bcee2 r19647: Add some GPFS support in a vfs mod. Also adds the kernel flock op to
the vfs layer, since gpfs supports it.  Thanks to Volker, Christian,
Mathias, Chetan, and Peter.
(This used to be commit 0620658890)
2007-10-10 12:15:43 -05:00
Volker Lendecke
f27d5c7838 r19077: Fix an uninitialized variable
(This used to be commit 6bc2cce645)
2007-10-10 12:15:09 -05:00
Jelmer Vernooij
7ba2554d88 r18802: Use the pidl-generated code for the srvsvc interface, both client 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 ef10672399)
2007-10-10 12:00:59 -05:00
Jeremy Allison
23535f7d49 r17676: Fix printing bug found by kukks. Don't copy a return
value into an auto on the stack that gets removed when
we return from the frame :-).
Jeremy.
(This used to be commit 85bf8a1611)
2007-10-10 11:38:46 -05:00
Jeremy Allison
a093a76dc1 r17293: After the results from the cluster tests in Germany,
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 4ace291278)
2007-10-10 11:38:24 -05:00
Volker Lendecke
31802698db r17254: Simple flattening of an if-statement, no logic change.
Jeremy, I'm sure you will look at this nevertheless :-)

Volker
(This used to be commit 3ef34468b5)
2007-10-10 11:38:22 -05:00
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