summaryrefslogtreecommitdiff
path: root/source3/smbd/reply.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r20635: Add placeholder to ensure we don't go into theJeremy Allison1-0/+11
wcard unlink if bad_path was set. The error returned here is almost certainly incorrect and will need testing properly with smbtorture, but I don't want to forget about this path (yes Volker I know this is currently incorrect :-). Jeremy. (This used to be commit 06e20c287898d21e437ab117eb5eeeaf2420ba78)
2007-10-10r20634: A *LOT* more work is necessary before touching notify remotely ↵Volker Lendecke1-17/+0
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 f146a85e74c84e78a11e616a1cbeaeef4693a0e0)
2007-10-10r20632: The extended RAW-SAMBA3BADPATH test led me to some wrong assumptions, inVolker Lendecke1-53/+59
particular the NT_STATUS_INVALID_PARAMETER thing was badly wrong. Remove the changes based on it. Using gentest is much more effective in this respect, but it will take a while to figure out the wildcard error handling of W2k3. Volker (This used to be commit 58b8a242a7f08c1292d24fc73df170dbcd68c10d)
2007-10-10r20628: Looks bigger than it is. This is just re-indenting the if (dirname) ↵Volker Lendecke1-40/+38
that we've taken care of above. Volker (This used to be commit 5e1da363bb3f2675beb9fd9240301bb432e5239b)
2007-10-10r20627: orig_name is not needed anymore, and slightly simplify logic by ↵Volker Lendecke1-9/+8
doing early returns. Volker (This used to be commit 614651c6a72742173de5fa8723403880acc37c09)
2007-10-10r20619: bad_path is handled somewhere else, so can_delete does not need it ↵Volker Lendecke1-11/+3
anymore (This used to be commit 1798987128be579a1a4574294a7c3094040ebaf2)
2007-10-10r20618: Fix a bug in bad_path handling that also exists in 3.0.23: For ↵Volker Lendecke1-0/+5
reply_unlink under Linux we returned NT_STATUS_NOT_A_DIRECTORY. This is because in the bad_path==True condition lstat(2) returns ENOTDIR and not ENOENT. Not sure if we want to necessarily replicate the INVALID_PARAMETER here, but this is what W2k3 does. Jeremy, I tried to call you, but you were not around. So I'll leave it up to you to merge this. Volker (This used to be commit b1edc3d053104204b966eed67d070ad5da40f17b)
2007-10-10r20617: Do not notify if the delete failedVolker Lendecke1-5/+7
(This used to be commit c86fbdf8cc8f6f17b23e647bd1f4714c6095b860)
2007-10-10r20612: A checkin I've wanted to do for ages: For bad_path==False ↵Volker Lendecke1-9/+8
set_bad_path_error is equivalent to UNIX_ERROR. Expand the last reference. Lets see if I can kill that as well :-) Volker (This used to be commit 794d5d38f19601bb5b30b965b41b844aacf1caeb)
2007-10-10r20611: All but one callers to set_bad_path_error have had the ↵Volker Lendecke1-2/+4
bad_path==True argument being handled further up. Volker (This used to be commit 358673c36697a16aa87f9cebbace34abf16ed28e)
2007-10-10r20607: Next micro-step for reply_setatrVolker Lendecke1-8/+6
(This used to be commit cea9a01434490fb8a17c3f12db7a092efda21186)
2007-10-10r20606: bad_path == True has been covered further up in reply_setatr.Volker Lendecke1-1/+2
I'm checking in micro-steps to make them independently checkable. This code just very severely needs cleanup, but I don't want to break anything. So, be patient with me, please :-) Volker (This used to be commit c16775486baa89901f0d5126cb926c9e5a807743)
2007-10-10r20605: Simplify logic in reply_setatr slightlyVolker Lendecke1-4/+2
(This used to be commit f19db8f33ed3749f6b72ae3a4cee83574c606e88)
2007-10-10r20597: Survive some of the notify mask tests.Volker Lendecke1-9/+1
(This used to be commit e4a2e63272dc5b20413597179d06b0185c4a6817)
2007-10-10r20589: Re-add lost bad_path handling, sorry.Volker Lendecke1-0/+4
(This used to be commit 244f96388c843fd629478d0069f68550a2006d06)
2007-10-10r20558: Refactor rmdir_internals to use early termination ratherJeremy Allison1-55/+56
than lots of indented code. Change recursive_rmdir() to return the smbd standards of True on success, False on fail (it was doing the reverse, which was very confusing). Jeremy. (This used to be commit 27dc5bebda7ffbdcb2371638f6132063a953fba2)
2007-10-10r20544: Change copy_file() to return NTSTATUS. This is in preparation of turningVolker Lendecke1-18/+31
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 (This used to be commit 5ebdf02ba166df69e210e6f70c01a44e6205ecc1)
2007-10-10r20532: From Volker...Jeremy Allison1-1/+1
"smbcli_setattr("") always returns ACCESS_DENIED, test extension to follow. Merge to 3.0.24?" Yep (with slight optimization). Jeremy. (This used to be commit dcc7bca1adbc69f348d46291ec2cbfaf5d8486bc)
2007-10-10r20507: smbcli_setattr("") always returns ACCESS_DENIED, test extension to ↵Volker Lendecke1-0/+9
follow. Merge to 3.0.24? Volker (This used to be commit f2563ac98f8ec7af8083d2b62186753acba7a9dd)
2007-10-10r20496: Some changes to make Samba3 the RAW-OPEN test. Checking in to both ↵Volker Lendecke1-5/+8
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 (This used to be commit 84e6889632c7f98a7cb37036b0acdf538d50d16c)
2007-10-10r20482: Make us survive and activate RAW-CLOSEVolker Lendecke1-1/+1
(This used to be commit 471c6e6a2142afbca36163bcdbb5b6fb4e7ac774)
2007-10-10r20479: Both remaining calls of can_delete called it with ↵Volker Lendecke1-26/+19
check_is_at_open==False, remove that parameter. Volker (This used to be commit e51b7648703f3a85b840501dd4199600a5a7e44f)
2007-10-10r20478: Make us survive & activate RAW-UNLINKVolker Lendecke1-1/+1
(This used to be commit 4f0f917b344743e16e8bacf4e72529a2890590fe)
2007-10-10r20470: Jeremy, another one to check:Volker Lendecke1-1/+3
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 (This used to be commit d289037fdbc8bd3e0723784888946d5b39ffadef)
2007-10-10r20454: Get rid of a bogus variable that was only assigned but never read.Volker Lendecke1-4/+0
Jeremy, please check this. Thanks, Volker (This used to be commit 2becbb9e5f7d1b04962178e6f0c97c3ccf2b0f88)
2007-10-10r20451: Survive the first of the filter-tests (mkdir).Volker Lendecke1-3/+4
Add lots of TODOs :-) Volker (This used to be commit 0e953884a15873b0962ab1ab064d6b3a436726c0)
2007-10-10r20442: Slight rewrite of the change notify infrastructure. This now ↵Volker Lendecke1-12/+12
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. (This used to be commit ce0ad24988075465addcac0b9afc872e909135af)
2007-10-10r20433: Work in progress: Survive more of RAW-NOTIFY.Volker Lendecke1-1/+20
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 c813f71d0036ec52c99a97e60fe33ee47d0635fa)
2007-10-10r20394: This is a *VERY* early start of my work on notify.Volker Lendecke1-4/+19
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 bcf5c751cbe203c00814642e26440cf88f300bce)
2007-10-10r20393: Debug level 1 is a bit excessive hereVolker Lendecke1-1/+1
(This used to be commit 48798b5e57fcb2ee7debfe9d5178adef37907f92)
2007-10-10r20371: In renames (via SMBmv) both src and dest can containJeremy Allison1-4/+5
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 (This used to be commit 4183c1b49fd5a6107aa87249b7be236af092ed8b)
2007-10-10r20370: Now we've gone to the trouble of getting an NT statusJeremy Allison1-1/+1
from open_file_ntcreate make sure we return it on rename error. Jeremy. (This used to be commit 633f02fb860223585f388e64c1a2d770db52d4f0)
2007-10-10r20339: Make mkdir_internal static to open.cVolker Lendecke1-48/+2
(This used to be commit 6dd0886b49969d0edfe16861f19d35275217b2af)
2007-10-10r20338: Restructure open_directory a bit. This gets rid of a race condition ↵Volker Lendecke1-2/+3
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 472fb11f4968d30cedc9851215c63acd3132f3db)
2007-10-10r20264: Two lines above this we just checked if (fsp->is_directory) ...Volker Lendecke1-1/+1
(This used to be commit 88ab54b3b7ec6c0ac1958fca435880e29eeefd69)
2007-10-10r20253: Reduce some code duplication, make reply_mkdir go through the same ↵Volker Lendecke1-25/+10
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 (This used to be commit ddae494fbe36e4a74776f71c212b00cce61fbf81)
2007-10-10r20237: Replace exit_server with exit_server_cleanly where appropriate. AllJames Peach1-16/+16
send_smb failures should be clean exits. All times when we exit as a matter of policy should also be clean exits. (This used to be commit d6382092e72120a3c89ffe81975e8898d454bf06)
2007-10-10r20229: Avoid a silly function call in mkdir_internal. None of the callers ↵Volker Lendecke1-2/+1
look at errno, all go straight to ERROR_NT(status). Volker (This used to be commit 9d8b48c0ef0af5792b879565915832ee141c853c)
2007-10-10r18787: Fix the strlen_m and strlen_m_term code by mergingJeremy Allison1-3/+24
in (and using elsewhere) next_codepoint from Samba4. Jerry please test. Jeremy. (This used to be commit ece00b70a4621633f1ac9e576c4bbe332031de09)
2007-10-10r17220: If we're going to fail a write with an errno, makeJeremy Allison1-0/+4
sure we return -1. Jeremy. (This used to be commit 89b83237b03066785ca4bf3b9d120519bddeffad)
2007-10-10r17108: Make the default timeout parameter for lock waitingJeremy Allison1-3/+3
be lp_lock_spin(). lock spin count is no longer used. I'll update the man pages. Jeremy. (This used to be commit 0451a170c9be88399202abd225af35ddc45023f0)
2007-10-10r17107: Make the 200 ms timeout value tunable in local.h...Jeremy Allison1-3/+3
Might need to be a parameter ? Jeremy. (This used to be commit 98d8d9399bb287319578daaf2a2fb42f3c48f858)
2007-10-10r17106: Match Windows timing values on locks.Jeremy Allison1-0/+5
Jeremy. (This used to be commit b5aaff665937313370e0e87225e146f9af7b7e67)
2007-10-10r17105: Fix the race Volker found - we had a non-lockedJeremy Allison1-81/+53
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. (This used to be commit b81d6d1ae95a3d3e449dde629884b565eac289d9)
2007-10-10r17098: Samba3 now cleanly passes Samba4 RAW-LOCK tortureJeremy Allison1-47/+76
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. (This used to be commit f1a9cf075b87c76c032d19da0168424c90f6cb3c)
2007-10-10r16945: Sync trunk -> 3.0 for 3.0.24 code. Still needJeremy Allison1-80/+92
to do the upper layer directories but this is what everyone is waiting for.... Jeremy. (This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8)
2007-10-10r16397: Fix Klocwork #11767 and drasticly simplify theJeremy Allison1-0/+7
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. (This used to be commit d357f8b33594472ffa78d0a112accccc2a8b1fe7)
2007-10-10r15951: oplock_request must be an int, not a BOOL. WeJeremy Allison1-3/+3
were getting away with mixing types. Not cool. Jeremy. (This used to be commit ad3bc112a21afd3a04449ec3f604e017d753c224)
2007-10-10r15450: Change profiling data macros to use stack variables rather thanJames Peach1-7/+8
globals. This catches mismatched start/end calls and removes the need for special nested profiling calls. (This used to be commit ee750498812190edd3ec52ca3c750258f3b8a97a)
2007-10-10r15112: Move strict locking default to auto. Fix up the errorJeremy Allison1-1/+1
return for one of the Samba4 torture tests. Jeremy. (This used to be commit 9db6617756ff155eb7549c3c622a9920189e577d)