1
0
mirror of https://github.com/samba-team/samba.git synced 2025-06-21 03:17:08 +03:00

648 Commits

Author SHA1 Message Date
Volker Lendecke
5ebdf02ba1 r20544: Change copy_file() to return NTSTATUS. This is in preparation of turning
close_file() to NTSTATUS as well.

I'm not sure I got all the error codes right, but as I've never come across a
smb_copy() call in all my Samba work, I'm leaving it at that. If I'm
absolutely bored, I will write a thorough torture test.

As far as I can see, Samba4 even does not have a libcli implementation for
it...  :-)

Volker
2007-10-10 12:16:56 -05:00
Jeremy Allison
dcc7bca1ad r20532: From Volker...
"smbcli_setattr("") always returns ACCESS_DENIED, test extension to follow.

Merge to 3.0.24?"

Yep (with slight optimization).

Jeremy.
2007-10-10 12:16:55 -05:00
Volker Lendecke
f2563ac98f r20507: smbcli_setattr("") always returns ACCESS_DENIED, test extension to follow.
Merge to 3.0.24?

Volker
2007-10-10 12:16:54 -05:00
Volker Lendecke
84e6889632 r20496: Some changes to make Samba3 the RAW-OPEN test. Checking in to both 3_0 and
3_0_24 because I was explicitly asked to, although this needs close
review. Jeremy, I'm sure you will check this thoroughly :-)

In reply_open_and_X the separate "size" variable kills the calculation of the
SPARSE flag returned to the client in the attrib field. In getpathinfo we do
it correctly, and RAW-OPEN (correctly) complains about the difference.

Add the "set the write time" to mknew and create.

For trans2open we were missing the "ofun == 0" ->
NT_STATUS_OBJECT_NAME_COLLISION case, and we dropped the status returned in
favor of ACCESS_DENIED once too many.

Last change is a fix to trans2open: We were returning the attributes given by
the client, not the attributes of the new file.

Volker
2007-10-10 12:16:53 -05:00
Volker Lendecke
471c6e6a21 r20482: Make us survive and activate RAW-CLOSE 2007-10-10 12:16:52 -05:00
Volker Lendecke
e51b764870 r20479: Both remaining calls of can_delete called it with check_is_at_open==False,
remove that parameter.

Volker
2007-10-10 12:16:51 -05:00
Volker Lendecke
4f0f917b34 r20478: Make us survive & activate RAW-UNLINK 2007-10-10 12:16:51 -05:00
Volker Lendecke
d289037fdb r20470: Jeremy, another one to check:
The only error path of can_delete() that we're interested in ntcreate&x is the
one of can_delete_file_in_directory(), so call that directly.

The only other one where we might get a NT_STATUS_ACCESS_DENIED is from the
lstat in can_delete, but this is covered later in the open_directory and
open_file_ntcreate calls. open_directory does a stat() in the open case which
also covers the (potential) symlink, and open_file_ntcreate does the open(2)
itself, so this should also work.

This makes can_delete() static to reply.c.

Volker
2007-10-10 12:16:51 -05:00
Volker Lendecke
2becbb9e5f r20454: Get rid of a bogus variable that was only assigned but never read.
Jeremy, please check this.

Thanks,

Volker
2007-10-10 12:16:51 -05:00
Volker Lendecke
0e953884a1 r20451: Survive the first of the filter-tests (mkdir).
Add lots of TODOs :-)

Volker
2007-10-10 12:16:50 -05:00
Volker Lendecke
ce0ad24988 r20442: Slight rewrite of the change notify infrastructure. This now survives the
first of the raw-notify subtests, the one-level test_notify_dir without any
flags around yet.

The tricky part was getting the data structures right, I hope the next tests
don't let that fall over.

fsp->notify is now by default NULL, meaning that nobody has issued a
changenotify call. This means nobody is interested in changes for this
directory.

If that has happened, notify_change_buf collects the changes if no current
request is outstanding, and it collects the requests if no change has happened
since the last request.

Happy New Year, somewhere on this planet it's already 2007 :-)

Volker

P.S: Jeremy, there's a question for you in smbd/files.c line 367.
2007-10-10 12:16:50 -05:00
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
48798b5e57 r20393: Debug level 1 is a bit excessive here 2007-10-10 12:16:46 -05:00
Jeremy Allison
4183c1b49f r20371: In renames (via SMBmv) both src and dest can contain
wcards. I had forgotten this and had refused to allow
dest to contain wcards. We now pass all the normal
Samba4 smbtorture RAW-RENAME tests.
Jeremy
2007-10-10 12:16:45 -05:00
Jeremy Allison
633f02fb86 r20370: Now we've gone to the trouble of getting an NT status
from open_file_ntcreate make sure we return it on rename
error.
Jeremy.
2007-10-10 12:16:44 -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
88ab54b3b7 r20264: Two lines above this we just checked if (fsp->is_directory) ... 2007-10-10 12:16:37 -05:00
Volker Lendecke
ddae494fbe r20253: Reduce some code duplication, make reply_mkdir go through the same code paths
ncreate does. This is a bit slower (about 10-20%), because it goes touches the
share mode db, but I think not having to call change_owner_to_parent and
friends in fewer places outweighs this. And, mkdir is not the way current
Windows boxes create directories, they do it via the ncreate call.

Volker
2007-10-10 12:16:37 -05:00
James Peach
d6382092e7 r20237: Replace exit_server with exit_server_cleanly where appropriate. All
send_smb failures should be clean exits. All times when we exit as
a matter of policy should also be clean exits.
2007-10-10 12:16:34 -05:00
Volker Lendecke
9d8b48c0ef r20229: Avoid a silly function call in mkdir_internal. None of the callers look at
errno, all go straight to ERROR_NT(status).

Volker
2007-10-10 12:16:34 -05:00
Jeremy Allison
ece00b70a4 r18787: Fix the strlen_m and strlen_m_term code by merging
in (and using elsewhere) next_codepoint from Samba4.
Jerry please test.
Jeremy.
2007-10-10 12:00:57 -05:00
Jeremy Allison
89b83237b0 r17220: If we're going to fail a write with an errno, make
sure we return -1.
Jeremy.
2007-10-10 11:38:19 -05:00
Jeremy Allison
0451a170c9 r17108: Make the default timeout parameter for lock waiting
be lp_lock_spin(). lock spin count is no longer
used. I'll update the man pages.
Jeremy.
2007-10-10 11:38:12 -05:00
Jeremy Allison
98d8d9399b r17107: Make the 200 ms timeout value tunable in local.h...
Might need to be a parameter ?
Jeremy.
2007-10-10 11:38:12 -05:00
Jeremy Allison
b5aaff6659 r17106: Match Windows timing values on locks.
Jeremy.
2007-10-10 11:38:12 -05:00
Jeremy Allison
b81d6d1ae9 r17105: Fix the race Volker found - we had a non-locked
region between detecting a pending lock was needed
and when we added the blocking lock record. Make
sure that we hold the lock over all this period.
Removed the old code for doing blocking locks on
SMB requests that never block (the old SMBlock
and friends).
Discovered something interesting about the strange
NT_STATUS_FILE_LOCK_CONFLICT return. If we asked
for a lock with zero timeout, and we got an error
of NT_STATUS_FILE_LOCK_CONFLICT, treat it as though
it was a blocking lock with a timeout of 150 - 300ms.
This only happens when timeout is sent as zero and
can be seen quite clearly in ethereal. This is the
real replacement for old do_lock_spin() code.
Re-worked the blocking lock select timeout to correctly
use milliseconds instead of the old second level
resolution (far too coarse for this work).
Jeremy.
2007-10-10 11:38:12 -05:00
Jeremy Allison
f1a9cf075b r17098: Samba3 now cleanly passes Samba4 RAW-LOCK torture
test. Phew - that was painful :-). But what it means
is that we now implement lock cancels and I can add
lock cancels into POSIX lock handling which will fix
the fast/slow system call issue with cifsfs !
Jeremy.
2007-10-10 11:38:11 -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
d357f8b335 r16397: Fix Klocwork #11767 and drasticly simplify the
logic in smbd/process.c. All interested (Volker,
Jerry, James etc). PLEASE REVIEW THIS CHANGE.
The logic should be identical but *much* easier
to follow and change (and shouldn't confuse Klockwork :-).
Jeremy.
2007-10-10 11:18:52 -05:00
Jeremy Allison
ad3bc112a2 r15951: oplock_request must be an int, not a BOOL. We
were getting away with mixing types. Not cool.
Jeremy.
2007-10-10 11:17:14 -05:00
James Peach
ee75049881 r15450: Change profiling data macros to use stack variables rather than
globals. This catches mismatched start/end calls and removes
the need for special nested profiling calls.
2007-10-10 11:16:47 -05:00
Jeremy Allison
9db6617756 r15112: Move strict locking default to auto. Fix up the error
return for one of the Samba4 torture tests.
Jeremy.
2007-10-10 11:16:24 -05:00
Jeremy Allison
1217ed392b r15030: On a performace hunt... Remove as many extraneous
memset's as possible.
Jeremy.
2007-10-10 11:15:58 -05:00
Jeremy Allison
dc6a13da33 r15020: Fix issue with samba4 netbench torture tester,
it sends break replies to "break to none from level2"
requests and it shouldn't. Just don't log a debug
level zero message.
Jeremy.
2007-10-10 11:15:57 -05:00
Jeremy Allison
08e52ead03 r15018: Merge Volker's ipc/trans2/nttrans changes over
into 3.0. Also merge the new POSIX lock code - this
is not enabled unless -DDEVELOPER is defined.
This doesn't yet map onto underlying system POSIX
locks. Updates vfs to allow lock queries.
Jeremy.
2007-10-10 11:15:57 -05:00
James Peach
0809e2cb1d r14574: Allow use of sendfile as long as the write cache has not been enabled
on the particular file we are performing I/O on, irrespective of whether
the write cache is globally enabled
2007-10-10 11:15:37 -05:00
Jeremy Allison
71e8158042 r14460: SMBexit closes by pid and vuid. Tested with smbtorture.
Jeremy.
2007-10-10 11:15:31 -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
23f16cbc2e 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.
2007-10-10 11:06:21 -05:00
Jeremy Allison
dd185c7aa8 r12956: Fix for bug #3035 from SATOH Fumiyasu <fumiyas@miraclelinux.com>
On a Windows share, a file with read-only dosmode can be opened with
DELETE_ACCESS. But on a Samba share (delete readonly = no), it
fails with NT_STATUS_CANNOT_DELETE error.

This semantic causes a problem that a user can not
rename a file with read-only dosmode on a Samba share
from a Windows command prompt (i.e. cmd.exe, but can rename
from Windows Explorer).

Jeremy.
2007-10-10 11:06:09 -05:00
Jeremy Allison
2187502732 r12491: End profile fixes from SATOH Fumiyasu <fumiya@samba.gr.jp>.
Jeremy.
2007-10-10 11:05:58 -05:00
Jeremy Allison
855f5f8c32 r12234: Reduce the race condition for renames by holding the lock
longer. Instigated by complaints on the fix for #3303 from
SATOH Fumiyasu <fumiyas@miraclelinux.com>.
Jeremy.
2007-10-10 11:05:50 -05:00
Jeremy Allison
932e337db8 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.
2007-10-10 11:05:49 -05:00
Jeremy Allison
22e3300911 r12194: Ensure that when we set a connection path we've canonicalized
the name (must be abolute - start with /, must not end in /,
must have ./ and ../ removed). Of course for realpath resolved
paths this won't be the case but for others we need this name
to be canonicalized. This name is going into the sharemode db
for #3303 so needs to be in a normalized format.
Jeremy.
2007-10-10 11:05:48 -05:00
Jeremy Allison
414303bc02 r11511: A classic "friday night check-in" :-). This moves much
of the Samba4 timezone handling code back into Samba3.
Gets rid of "kludge-gmt" and removes the effectiveness
of the parameter "time offset" (I can add this back
in very easily if needed) - it's no longer being
looked at. I'm hoping this will fix the problems people
have been having with DST transitions. I'll start comprehensive
testing tomorrow, but for now all modifications are done.
Splits time get/set functions into srv_XXX and cli_XXX
as they need to look at different timezone offsets.
Get rid of much of the "efficiency" cruft that was
added to Samba back in the day when the C library
timezone handling functions were slow.
Jeremy.
2007-10-10 11:05:19 -05:00
Jeremy Allison
cab76c3c33 r11451: Fix -O1 "might be using uninitialized" errors.
Jeremy.
2007-10-10 11:05:16 -05:00
Jeremy Allison
f22822790c r11448: Move decl before code.
Jeremy.
2007-10-10 11:05:16 -05:00
Jeremy Allison
7edb26e765 r11428: Fix bug #3192 by actually hooking up the dfree caching
function. Oops.
Jeremy.
2007-10-10 11:05:15 -05:00