1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-02 00:23:50 +03:00
Commit Graph

249 Commits

Author SHA1 Message Date
Volker Lendecke
c813f71d00 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
2007-10-10 12:16:49 -05:00
Volker Lendecke
bcf5c751cb 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
2007-10-10 12:16:46 -05:00
Volker Lendecke
7977fd7865 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
2007-10-10 12:16:43 -05:00
Volker Lendecke
02f85265f2 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
2007-10-10 12:16:43 -05:00
Volker Lendecke
4ca921d9aa r20343: Split change_owner_to_parent fd-based (for file opens) and a name-based (for
directory opens) routines.

Volker
2007-10-10 12:16:43 -05:00
Volker Lendecke
c20bdd219d r20342: Move the lstat into mkdir_internal, for the FILE_OPEN case in open_directory
we want to follow symlinks.

Volker
2007-10-10 12:16:43 -05:00
Volker Lendecke
cce911780f r20340: Join vfs_MkDir to its only caller 2007-10-10 12:16:42 -05:00
Volker Lendecke
6dd0886b49 r20339: Make mkdir_internal static to open.c 2007-10-10 12:16:42 -05:00
Volker Lendecke
472fb11f49 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
2007-10-10 12:16:42 -05:00
Volker Lendecke
4090bc4bca r20257: Hey, change_owner_to_parent is now static :-) 2007-10-10 12:16:37 -05:00
Volker Lendecke
0874093e5f 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
2007-10-10 12:16:34 -05:00
Jeremy Allison
6df3cac44f 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.
2007-10-10 12:16:18 -05:00
Jim McDonough
0620658890 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.
2007-10-10 12:15:43 -05:00
Volker Lendecke
6bc2cce645 r19077: Fix an uninitialized variable 2007-10-10 12:15:09 -05:00
Jelmer Vernooij
ef10672399 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.
2007-10-10 12:00:59 -05:00
Jeremy Allison
85bf8a1611 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.
2007-10-10 11:38:46 -05:00
Jeremy Allison
4ace291278 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.
2007-10-10 11:38:24 -05:00
Volker Lendecke
3ef34468b5 r17254: Simple flattening of an if-statement, no logic change.
Jeremy, I'm sure you will look at this nevertheless :-)

Volker
2007-10-10 11:38:22 -05:00
Jeremy Allison
f326bae3e2 r17249: Ensure we only set the FILE_WRITE_DATA on O_TRUNC
in one place.
Jeremy.
2007-10-10 11:38:22 -05:00
Jeremy Allison
8eed82d5d5 r17248: Ensure we definately add the WRITE_DATA on O_TRUNC.
Jeremy.
2007-10-10 11:38:22 -05:00
Jeremy Allison
d11e71ebcc 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.
2007-10-10 11:38:22 -05:00
Volker Lendecke
2e400fb007 r17229: Indent-style reformatting -- getting used to the code again :-) 2007-10-10 11:38:20 -05:00
Volker Lendecke
640b4297a4 r17228: Modest reformatting 2007-10-10 11:38:20 -05:00
Jeremy Allison
11bab9d579 r17152: Don't handle the delete pending here, await
reschedule.
Jeremy.
2007-10-10 11:38:16 -05:00
Jeremy Allison
12490fafc7 r17142: Ensure we record the correct can_read/can_write
from the client requested access mask.
Jeremy.
2007-10-10 11:38:15 -05:00
Jeremy Allison
3bcd52a475 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.
2007-10-10 11:38:15 -05:00
Jeremy Allison
788aa15ea2 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.
2007-10-10 11:38:14 -05:00
Jeremy Allison
b3b5aec0ee r17130: Remove unneeded unlock call.
Jeremy.
2007-10-10 11:38:14 -05:00
Jeremy Allison
b7374835e6 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.
2007-10-10 11:38:14 -05:00
Jeremy Allison
8171c4c404 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.
2007-10-10 11:38:13 -05:00
Jeremy Allison
9dafb7f48c 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.
2007-10-10 11:19:14 -05:00
Jeremy Allison
d929323d6f 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.
2007-10-10 11:18:54 -05:00
Gerald Carter
6c1f1c091f r16219: BUG 3836, 3837, 3004: compile warning fixes from Jason Mader. 2007-10-10 11:17:26 -05:00
Volker Lendecke
3a7d01afbe r16198: Fix Klocwork 1023 2007-10-10 11:17:24 -05:00
Jeremy Allison
146a264815 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.
2007-10-10 11:17:15 -05:00
Jeremy Allison
1117a327bd r15959: Ooops. Use the right file_free call...
Jeremy.
2007-10-10 11:17:15 -05:00
Jeremy Allison
c7c9adcce7 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.
2007-10-10 11:17:14 -05:00
Jeremy Allison
ad9895c654 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.
2007-10-10 11:17:14 -05:00
James Peach
784126edff r15943: Update misleading DEBUG statements and comments that refer to
open_file_shared.
2007-10-10 11:17:14 -05:00
Jeremy Allison
e468e1e5c2 r15404: Check for WRITE_THOUGH before calling lp_ fn. I hate
extra fn calls.
Jeremy.
2007-10-10 11:16:41 -05:00
Jeremy Allison
dbc03125f2 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.
2007-10-10 11:16:32 -05:00
Jeremy Allison
3c260bcce2 r15138: Teach Samba the difference between exclusive and batch oplocks.
Pass Samba4 oplock test (with kernel oplocks off).
Jeremy.
2007-10-10 11:16:26 -05:00
James Peach
56bc02d644 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.
2007-10-10 11:15:53 -05:00
Stefan Metzmacher
b98dd258a7 r14883: add 'smbd:sharedelay' option, so that we can speed up BASE-DENY2 in make test
as done in samba4

metze
2007-10-10 11:15:52 -05:00
Jeremy Allison
306061c93d 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.
2007-10-10 11:15:39 -05:00
Jeremy Allison
c2488db727 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.
2007-10-10 11:15:38 -05:00
Volker Lendecke
788e52eb5d r13694: Committing patch from Aleksey Fedoseev <aleksey at fedoseev dot net> to NULL
out a pointer after talloc_destroy().

Volker
2007-10-10 11:10:24 -05:00
Gerald Carter
b65be8874a r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()
macro which sets the freed pointer to NULL.
2007-10-10 11:10:14 -05:00
Jeremy Allison
c8185e7f94 r13559: Fix bug #3522 reported by Sandeep Tamhankar <sandman@electric-cloud.com>.
mkdir foo returns the wrong error message when file foo exists.
Jeremy.
2007-10-10 11:10:14 -05:00
Gerald Carter
17e63ac4ed r13316: Let the carnage begin....
Sync with trunk as off r13315
2007-10-10 11:06:23 -05:00