1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-28 17:47:29 +03:00

787 Commits

Author SHA1 Message Date
Volker Lendecke
9974656d3b r21093: Remove the hash and dnotify backends. Disabling FAM for this checkin, I'm
working on that right now.

Volker
(This used to be commit 01c9fb17281e99300b339d2cfc0acac7ca94843c)
2007-10-10 12:17:36 -05:00
Volker Lendecke
697ccab3f0 r21089: Do notifies on rename
(This used to be commit 2aadb95a7e58777ee7ff024cc9e14f4334970d50)
2007-10-10 12:17:35 -05:00
Volker Lendecke
547f77778a r21087: Make the param list of notify_fname match notify_trigger
(This used to be commit defa28f9c3eda85a072b972fffd2d5de8bcf01f7)
2007-10-10 12:17:34 -05:00
Volker Lendecke
434bf5fadd r21080: Reformatting
(This used to be commit 705f866a78ec3f1169543bf82fb48ea6580160a9)
2007-10-10 12:17:34 -05:00
Volker Lendecke
b0bf3ddb38 r21079: Minimizing diff: Adopt the Samba4 style ChangeNotify flags.
Volker
(This used to be commit a3c1069b0c3da914e2ac7337fd9e924b1c811d39)
2007-10-10 12:17:33 -05:00
Jeremy Allison
845647f468 r21057: More refactoring into functions.
Jeremy.
(This used to be commit fe2d7cb2dcd7c4d25d71f196aa557ce3e287bb4c)
2007-10-10 12:17:31 -05:00
Volker Lendecke
d5206610cd r20931: This changes the notify infrastructure from a polling-based to an 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)
2007-10-10 12:17:21 -05:00
Volker Lendecke
2958f46733 r20877: Random notify fixes
(This used to be commit 2f1bfc53733ac3debc6a8b51642ab191869cd792)
2007-10-10 12:17:17 -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 029635885825a5562e7974a6f5675cce3bf1b5dc)
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 5533cdeec1b0cdee39b1d89e2320587dc9281ee6)
2007-10-10 12:17:13 -05:00
Jeremy Allison
83eb0d1d6d r20844: Somewhat radical change - this may break the build (I will
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)
2007-10-10 12:17:12 -05:00
Jeremy Allison
52a36db39f r20843: Get rid of last BOOL ok.
Jeremy.
(This used to be commit a36d446fb612f87654c645f6507d413b95efaf21)
2007-10-10 12:17:12 -05:00
Jeremy Allison
f065b42dcc r20842: Only one more BOOL ok to go...
Jeremy.
(This used to be commit de0bf477dab1d57b5f7bc6bf70d8e76f9bfac63f)
2007-10-10 12:17:12 -05:00
Jeremy Allison
16f96517f1 r20841: Remove more BOOL ok.
Jeremy.
(This used to be commit c6b651966039b1c21facd4c4789bf873b5b49426)
2007-10-10 12:17:12 -05:00
Jeremy Allison
6d16226a2d r20840: Keep removing the old BOOL ok logic.
Jeremy.
(This used to be commit 224ff059915b2c92ec86d2c3c4b10c3bc552ffa2)
2007-10-10 12:17:12 -05:00
Volker Lendecke
0cfc6a8e11 r20796: Fix the same problem Jeremy has fixed (improper handling of deferred opens)
for delete_driver_files. Proper fix pending... :-)

Jeremy, please check.

Volker
(This used to be commit 21b8f15dd5ad567efeacf5ba22dc4d8c64b09b76)
2007-10-10 12:17:09 -05:00
Volker Lendecke
fb9a229643 r20759: Dummy checkin to let the build farm pick up the new smbtorture4
(This used to be commit 14c88b560e5c8fd59b84333e92337805620ccd7c)
2007-10-10 12:17:08 -05:00
Jeremy Allison
78fbb597c2 r20743: Remove another BOOL ok from reply_getatr.
Jeremy.
(This used to be commit c154f430710a4646fac42774817dfed7b936b087)
2007-10-10 12:17:08 -05:00
Jeremy Allison
ab46f9cdd2 r20742: Rename chkpth -> checkpath for sanity's sake :-).
Start removing unneeded "BOOL ok" from this reply.c
(this logic is old, old, old..... :-).
Jeremy.
(This used to be commit 3d52268095c605a80dfcd371769198a332baa0a5)
2007-10-10 12:17:07 -05:00
Volker Lendecke
165e08e8b1 r20740: Get rid of some if-statements
(This used to be commit db93c1b98d5445071ad0af229afed1f11ab0a862)
2007-10-10 12:17:07 -05:00
Jeremy Allison
dd5e9e2ae7 r20721: Fix the search unix_convert error returns. Only open
to go...
Jeremy.
(This used to be commit 89f03a8db40365f99c6755ff19a4bfbf8d1bd316)
2007-10-10 12:17:06 -05:00
Jeremy Allison
1a40a6e08a r20720: Fix the chkpath problem, still looking at findfirst.
Jeremy.
(This used to be commit c5be0082ef60cd041121a9c36f4af934cd60562d)
2007-10-10 12:17:05 -05:00
Jeremy Allison
db0ad252a0 r20718: Sync up the filename path parsing changes from SAMBA_3_0_24.
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)
2007-10-10 12:17:04 -05:00
Jeremy Allison
b538c2b86b r20635: Add placeholder to ensure we don't go into the
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-10 12:17:00 -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 f146a85e74c84e78a11e616a1cbeaeef4693a0e0)
2007-10-10 12:17:00 -05:00
Volker Lendecke
87bd4d2723 r20632: The extended RAW-SAMBA3BADPATH test led me to some wrong assumptions, in
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-10 12:17:00 -05:00
Volker Lendecke
45e7b954cd r20628: Looks bigger than it is. This is just re-indenting the if (dirname) that we've
taken care of above.

Volker
(This used to be commit 5e1da363bb3f2675beb9fd9240301bb432e5239b)
2007-10-10 12:16:59 -05:00
Volker Lendecke
b5cad2c2a7 r20627: orig_name is not needed anymore, and slightly simplify logic by doing early
returns.

Volker
(This used to be commit 614651c6a72742173de5fa8723403880acc37c09)
2007-10-10 12:16:59 -05:00
Volker Lendecke
dbac39f74e r20619: bad_path is handled somewhere else, so can_delete does not need it anymore
(This used to be commit 1798987128be579a1a4574294a7c3094040ebaf2)
2007-10-10 12:16:59 -05:00
Volker Lendecke
1b50bcc9c8 r20618: Fix a bug in bad_path handling that also exists in 3.0.23: For 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-10 12:16:59 -05:00
Volker Lendecke
a9e3624bbc r20617: Do not notify if the delete failed
(This used to be commit c86fbdf8cc8f6f17b23e647bd1f4714c6095b860)
2007-10-10 12:16:59 -05:00
Volker Lendecke
d10af02226 r20612: A checkin I've wanted to do for ages: For bad_path==False 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-10 12:16:58 -05:00
Volker Lendecke
283c690e6e r20611: All but one callers to set_bad_path_error have had the bad_path==True argument
being handled further up.

Volker
(This used to be commit 358673c36697a16aa87f9cebbace34abf16ed28e)
2007-10-10 12:16:58 -05:00
Volker Lendecke
72ecfaf32c r20607: Next micro-step for reply_setatr
(This used to be commit cea9a01434490fb8a17c3f12db7a092efda21186)
2007-10-10 12:16:58 -05:00
Volker Lendecke
21cc389545 r20606: bad_path == True has been covered further up in reply_setatr.
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-10 12:16:57 -05:00
Volker Lendecke
ccc54da805 r20605: Simplify logic in reply_setatr slightly
(This used to be commit f19db8f33ed3749f6b72ae3a4cee83574c606e88)
2007-10-10 12:16:57 -05:00
Volker Lendecke
b2efff8fe5 r20597: Survive some of the notify mask tests.
(This used to be commit e4a2e63272dc5b20413597179d06b0185c4a6817)
2007-10-10 12:16:57 -05:00
Volker Lendecke
bb357a1617 r20589: Re-add lost bad_path handling, sorry.
(This used to be commit 244f96388c843fd629478d0069f68550a2006d06)
2007-10-10 12:16:56 -05:00
Jeremy Allison
0a8e3fd236 r20558: Refactor rmdir_internals to use early termination rather
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-10 12:16:56 -05:00
Volker Lendecke
1307337aaf 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
(This used to be commit 5ebdf02ba166df69e210e6f70c01a44e6205ecc1)
2007-10-10 12:16:56 -05:00
Jeremy Allison
2b1760297f r20532: From Volker...
"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-10 12:16:55 -05:00
Volker Lendecke
bc20aac121 r20507: smbcli_setattr("") always returns ACCESS_DENIED, test extension to follow.
Merge to 3.0.24?

Volker
(This used to be commit f2563ac98f8ec7af8083d2b62186753acba7a9dd)
2007-10-10 12:16:54 -05:00
Volker Lendecke
9985f25f00 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
(This used to be commit 84e6889632c7f98a7cb37036b0acdf538d50d16c)
2007-10-10 12:16:53 -05:00
Volker Lendecke
b3ddd92ba2 r20482: Make us survive and activate RAW-CLOSE
(This used to be commit 471c6e6a2142afbca36163bcdbb5b6fb4e7ac774)
2007-10-10 12:16:52 -05:00
Volker Lendecke
6edd999dc1 r20479: Both remaining calls of can_delete called it with check_is_at_open==False,
remove that parameter.

Volker
(This used to be commit e51b7648703f3a85b840501dd4199600a5a7e44f)
2007-10-10 12:16:51 -05:00
Volker Lendecke
58b63b65fc r20478: Make us survive & activate RAW-UNLINK
(This used to be commit 4f0f917b344743e16e8bacf4e72529a2890590fe)
2007-10-10 12:16:51 -05:00
Volker Lendecke
2c1b3a0720 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
(This used to be commit d289037fdbc8bd3e0723784888946d5b39ffadef)
2007-10-10 12:16:51 -05:00
Volker Lendecke
495c361907 r20454: Get rid of a bogus variable that was only assigned but never read.
Jeremy, please check this.

Thanks,

Volker
(This used to be commit 2becbb9e5f7d1b04962178e6f0c97c3ccf2b0f88)
2007-10-10 12:16:51 -05:00
Volker Lendecke
92d02f7afe r20451: Survive the first of the filter-tests (mkdir).
Add lots of TODOs :-)

Volker
(This used to be commit 0e953884a15873b0962ab1ab064d6b3a436726c0)
2007-10-10 12:16:50 -05:00
Volker Lendecke
200bd10b32 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.
(This used to be commit ce0ad24988075465addcac0b9afc872e909135af)
2007-10-10 12:16:50 -05:00