Age | Commit message (Collapse) | Author | Files | Lines |
|
(This used to be commit 9d23cf0cc4a8974bf0cf74b219a1138383083360)
|
|
event-driven
based approach. The only remaining hook into the backend is now
void *(*notify_add)(TALLOC_CTX *mem_ctx,
struct event_context *event_ctx,
files_struct *fsp, uint32 *filter);
(Should we put this through the VFS, so that others can more easily plug in?)
The trick here is that the backend can pick filter bits that the main smbd
should not handle anymore. Thanks to tridge for this idea.
The backend can notify the main smbd process via
void notify_fsp(files_struct *fsp, uint32 action, char *name);
The core patch is not big, what makes this more than 1800 lines are the
individual backends that are considerably changed but can be reviewed
one by one.
Based on this I'll continue with inotify now.
Volker
(This used to be commit 9cd6a8a82792b7b6967141565d043b6337836a5d)
|
|
(This used to be commit eb14d0ea83273c60aee900557aa5dceb77bb8127)
|
|
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 029635885825a5562e7974a6f5675cce3bf1b5dc)
|
|
make sense
again :-)
Volker
(This used to be commit 5533cdeec1b0cdee39b1d89e2320587dc9281ee6)
|
|
watch carefully - so I'm doing it in one transaction so I can
roll back).
Change check_name(), reduce_name() and dptr_create() to
return NTSTATUS. This helps a lot in error path processing
and especially in reduce_name() allows us to ditch the flaky
and error-prone saving of errno and return errors directly.
Jeremy.
(This used to be commit 6133a694aa429d638320e39ffe1c49d172583ccf)
|
|
correctly handling deferred opens.
Jeremy.
(This used to be commit e47b79d1cef279a1de1128d114d423c1fd2b1e8d)
|
|
create disposition of FILE_CREATE then there's no need
to check can_delete_file_in_directory().
Jeremy.
(This used to be commit eb32b60efc4c332295ff6fc7e5d575f4b40e8ff6)
|
|
The only difference between the two trees now w.r.t file
serving are the changes to smbd/open.c in this branch I need
to review.
Jeremy.
(This used to be commit f4474edf6a0c71001dbd01429ef70bafad6abd74)
|
|
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)
|
|
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)
|
|
bad_path==True argument
being handled further up.
Volker
(This used to be commit 358673c36697a16aa87f9cebbace34abf16ed28e)
|
|
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)
|
|
(This used to be commit ff173995cfeac216ab26faef6553be8f7f439347)
|
|
Add lots of TODOs :-)
Volker
(This used to be commit 0e953884a15873b0962ab1ab064d6b3a436726c0)
|
|
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)
|
|
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)
|
|
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)
|
|
Jeremy.
(This used to be commit b8d5faac69f3a0c2620a34f9026b4018ebd48bb8)
|
|
by ensuring we pass in a valid src_len (or zero when appropriate).
Volker is correct in that this is a *horrible* interface and he is
now free to generally clean it up everywhere :-). Go for it Volker !
Jeremy.
(This used to be commit cd991fb839994dd29dc790b655f5597fa1e12843)
|
|
This involved passing the dirname as argument to a few routines instead of
calling parent_dirname() deep down.
Volker
(This used to be commit 7977fd78652897bb7d4db1c21c5749043428f911)
|
|
(This used to be commit df6362baa0928616c6934950fb9c1264cb27106e)
|
|
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)
|
|
Fixes parts of
raw-open.
Volker
(This used to be commit e4e766c092e19f78a593c08f22ea1d7521be18e7)
|
|
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)
|
|
(This used to be commit ab45c50da36be316773f9332925dee7dc3eec025)
|
|
off conn->mem_ctx, not the null context so we can
safefy free everything on conn close. Should fix
possible memleak.
Jeremy.
(This used to be commit b33bde7b39953e171f05cdb53b6345ee3a9ec6e7)
|
|
(This used to be commit ac3eb7813e33b9a2e78c9158433f7ed62c3b62bb)
|
|
(This used to be commit 048127f9dd6363dfb3c78369fa2227551b741831)
|
|
Many things work (OpenHKLM, etc...) but some still don't.
This shouldn't block anyone so I'm checking it in.
Will probably move to a bzr tree after this for
longer dev cycles between checkins.
(This used to be commit cf1404a0d7538288b9370ba80df328f81b713ce0)
|
|
descriptor
buffers.
Make security access masks simply a uint32 rather than a structure
with a uint32 in it.
(This used to be commit b41c52b9db5fc4a553b20a7a5a051a4afced9366)
|
|
and DLIST_DEMOTE() now take the type of the tmp pointer
not the tmp pointer itself anymore.
metze
(This used to be commit 2f58645b7094e81dff3734f11aa183ea2ab53d2d)
|
|
on the wire. This allows us to go to nsec resolution
for systems that support it. It should also now be
easy to add a correct "create time" (birth time)
for systems that support it (*BSD). I'll be watching
the build farm closely after this one for breakage :-).
Jeremy.
(This used to be commit 425280a1d23f97ef0b0be77462386d619f47b21d)
|
|
(This used to be commit 1e4ee728df7eeafc1b4d533240acb032f73b4f5c)
|
|
to do the upper layer directories but this is what
everyone is waiting for....
Jeremy.
(This used to be commit 9dafb7f48ca3e7af956b0a7d1720c2546fc4cfb8)
|
|
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)
|
|
Jeremy.
(This used to be commit c430730f5a0dc00626b9b924e88adfb84cd48869)
|
|
strict-aliasing rules" warning.
Jeremy.
(This used to be commit 7ac5aee88cae3400fb6400b3628544da2e474560)
|
|
unsigned int
in a format string.
Jeremy.
(This used to be commit 3a15fff21988b426a514ad28060eaf0ddc17ef6b)
|
|
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 ad9895c654f400e242adcd4099f7cd004521ee92)
|
|
open_file_shared.
(This used to be commit 784126edff942d1c2f79f7c9feb59980426f331e)
|
|
globals. This catches mismatched start/end calls and removes
the need for special nested profiling calls.
(This used to be commit ee750498812190edd3ec52ca3c750258f3b8a97a)
|
|
Thanks to Jason Mader for reporting this.
Volker
(This used to be commit 3e616c3272ba76a2d135f7c51ceb44461ad165ad)
|
|
memset's as possible.
Jeremy.
(This used to be commit 1217ed392b75aa8bfefa9c3f1ec5fa3bba841ee0)
|
|
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.
(This used to be commit 08e52ead03304ff04229e1bfe544ff40e2564fc7)
|
|
realloc can return NULL in one of two cases - (1) the realloc failed,
(2) realloc succeeded but the new size requested was zero, in which
case this is identical to a free() call.
The error paths dealing with these two cases should be different,
but mostly weren't. Secondly the standard idiom for dealing with
realloc when you know the new size is non-zero is the following :
tmp = realloc(p, size);
if (!tmp) {
SAFE_FREE(p);
return error;
} else {
p = tmp;
}
However, there were *many* *many* places in Samba where we were
using the old (broken) idiom of :
p = realloc(p, size)
if (!p) {
return error;
}
which will leak the memory pointed to by p on realloc fail.
This commit (hopefully) fixes all these cases by moving to
a standard idiom of :
p = SMB_REALLOC(p, size)
if (!p) {
return error;
}
Where if the realloc returns null due to the realloc failing
or size == 0 we *guarentee* that the storage pointed to by p
has been freed. This allows me to remove a lot of code that
was dealing with the standard (more verbose) method that required
a tmp pointer. This is almost always what you want. When a
realloc fails you never usually want the old memory, you
want to free it and get into your error processing asap.
For the 11 remaining cases where we really do need to keep the
old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR,
which can be used as follows :
tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size);
if (!tmp) {
SAFE_FREE(p);
return error;
} else {
p = tmp;
}
SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the
pointer p, even on size == 0 or realloc fail. All this is
done by a hidden extra argument to Realloc(), BOOL free_old_on_error
which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR
macros (and their array counterparts).
It remains to be seen what this will do to our Coverity bug count :-).
Jeremy.
(This used to be commit 1d710d06a214f3f1740e80e0bffd6aab44aac2b0)
|
|
Sync with trunk as off r13315
(This used to be commit 17e63ac4ed8325c0d44fe62b2442449f3298559f)
|
|
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 23f16cbc2e8cde97c486831e26bcafd4ab4a9654)
|
|
Jeremy.
(This used to be commit 2187502732e41690bf266f229312bb9c7177cf22)
|
|
only tell at parse time from the wire if an incoming name
has wildcards or not. If it's a mangled name and we demangle
the demangled name may contain wildcard characters. Ensure
these are ignored.
Jeremy.
(This used to be commit 4cd8e2a96b98ff711905e8c6f416b22440c16062)
|