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

820 Commits

Author SHA1 Message Date
Volker Lendecke
e068e38ef3 r23482: Slightly simplify the rename code: Remove two local variables that are
not really needed.
2007-10-10 12:23:20 -05:00
Volker Lendecke
47cc9359aa r23469: Fix a comment 2007-10-10 12:23:18 -05:00
Volker Lendecke
f3d582cb90 r23467: Next little simplification: In rename_internals it's a bit pointless to
first ask for existence of a file when we do the open_file_ntcreate in
can_rename later on anyway. That also gets us the right error message in
case the file is not there automatically.
2007-10-10 12:23:18 -05:00
Volker Lendecke
0b29e3ad0f r23466: Fix RAW-NOTIFY: by using delete on close the notify is triggered deep
inside close_file() already.
2007-10-10 12:23:18 -05:00
Volker Lendecke
0342ce7057 r23457: After Jeremy's ack:
The attached patch removes a little race condition for
people with real kernel oplock support, and reduces some
code paths. It changes reply_unlink to open_file_ntcreate,
set_delete_on_close and close_file.

The race condition happens if we break the oplock in
can_delete via open_file_ntcreate, we close the file,
someone else gets a batch oplock and we try to unlink.

It reduces code paths by calling SMB_VFS_UNLINK in 2 fewer
places.
2007-10-10 12:23:17 -05:00
Jeremy Allison
7a9629365e r23445: Fix suggested by Volker. Don't call rename_open_files
if the name wasn't changed.
Jeremy.
2007-10-10 12:23:16 -05:00
James Peach
87b92e7ebd r23299: Fix the build for !WITH_SENDFILE. 2007-10-10 12:23:04 -05:00
Volker Lendecke
9b10dbbd5d r23183: Check in a change made by Tridge:
This replaces the internal explicit dev/ino file id representation by a
"struct file_id". This is necessary as cluster file systems and NFS
don't necessarily assign the same device number to the shared file
system. With this structure in place we can now easily add different
schemes to map a file to a unique 64-bit device node.

Jeremy, you might note that I did not change the external interface of
smb_share_modes.c.

Volker
2007-10-10 12:22:52 -05:00
Jeremy Allison
a56bce3d44 r23107: Fix renames on file descriptors that are supposed to overwrite the
target. Needs merging for 3.0.25a (sorry).
Jeremy.
2007-10-10 12:22:46 -05:00
Jeremy Allison
a301467d5f r23100: Implement the delete on close semantics I've just tested for
in Samba4 smbtorture. Fix rename on an open file handle.
Needed for 3.0.25a.
Jeremy.
2007-10-10 12:22:46 -05:00
Jeremy Allison
02e4f6b0f1 r23088: Fix rename for cifsfs client. This may be needed for
3.0.25a.
Jeremy.
2007-10-10 12:22:44 -05:00
Jeremy Allison
c2c970fd50 r23016: Remove extra & - thanks to Volker for spotting this.
Jeremy.
2007-10-10 12:22:15 -05:00
Jeremy Allison
fa18fc25a5 r23014: For all branches, ensure that if we're blocked on a POSIX
lock we know nothing about that we retry the lock every
10 seconds instead of waiting for the standard select
timeout. This is how we used to (and are supposed to)
work.
Jeremy.
2007-10-10 12:22:15 -05:00
Jeremy Allison
5d465dd2d5 r23007: Ensure we don't allow large read over the possible
packet size.
Jeremy.
2007-10-10 12:22:14 -05:00
Jeremy Allison
e1052c0e3d r22925: Sync read_and_X with 3.0.26 code (use setup_readX_header()).
Jeremy.
2007-10-10 12:22:09 -05:00
Jeremy Allison
3c1ccc68f0 r22922: Move "normal_read:" label out of ifdef guard. Fix the build.
Jeremy.
2007-10-10 12:22:08 -05:00
Jeremy Allison
a53268fb20 r22920: Add in the UNIX capability for 24-bit readX, as discussed
with the Apple guys and Linux kernel guys. Still looking
at how to do writeX as there's no recvfile().
Jeremy.
2007-10-10 12:22:08 -05:00
Volker Lendecke
bbb5084146 r22846: Chunk one to replace message_send_pid with messaging_send: Deep inside
locking/locking.c we have to send retry messages to timed lock holders.
The majority of this patch passes a "struct messaging_context" down
there. No functional change, survives make test.
2007-10-10 12:22:02 -05:00
Jeremy Allison
b523e782b0 r22765: Fix from Alison Winters <alisonw@sgi.com> for missing return
in sendfilereadbraw.
Jeremy.
2007-10-10 12:21:55 -05:00
Jeremy Allison
dcc6517d9d r22502: Fix bug #4536 - delete symlinks to a directory correctly.
Jeremy.
2007-10-10 12:19:40 -05:00
Jeremy Allison
2d80a96120 r22391: Looks bigger than it is. Make "inbuf" available
to all callers of smb_setlen (via set_message()
calls). This will allow the server to reflect back
the correct encryption context.
Jeremy.
2007-10-10 12:19:30 -05:00
Jeremy Allison
b49e90335d r22389: Start preparing for multiple encryption contexts in the
server. Allow server to reflect back to calling client
the encryption context that was sent.
Jeremy.
2007-10-10 12:19:30 -05:00
Jeremy Allison
bc6ac4feac r22291: Fix off-by-one in tconX parsing.
Jeremy.
2007-10-10 12:19:24 -05:00
Jeremy Allison
38404c990d r22145: Fix bug #4494 - reported by Kevin Jamieson <bugzilla@kevinjamieson.com>.
If returning a mapped UNIX error from sendfile, don't call chain_reply.
Jeremy.
2007-10-10 12:19:16 -05:00
Jeremy Allison
137953226a r22122: Start to fix csc issue with Vista. Make smbd support
the extended 7 word response for tconX rather than the
3 word one we supported previously.
Jeremy.
2007-10-10 12:19:14 -05:00
Volker Lendecke
8700cd71bb r21801: Fix Coverity ID # 342 2007-10-10 12:18:35 -05:00
Jeremy Allison
7a7862c01d r21800: Check-in the DFS rewrite. I am still testing this but it
works from smbclient and Windows, and I am promising to
support and fix both client and server code moving forward.
Still need to test the RPC admin support but I haven't
changed that code.
Jeremy.
2007-10-10 12:18:34 -05:00
Jeremy Allison
c74bcf7677 r21770: For old DOS style searches we must remember if
the initial search had a wildcard in order to
correctly return no error on end of search.
Found by Samba4 torture tester.
Jeremy.
2007-10-10 12:18:31 -05:00
Jeremy Allison
33a67fd39e r21769: Attempt to fix bug #4384 in old search code.
We were accessing a pathname that hadn't gone
through unix_convert ! That's a big no-no...
Jeremy.
2007-10-10 12:18:31 -05:00
Jeremy Allison
cdf0fdb104 r21754: Volker is completely correct. There's no need for
the RESOLVE_DFSPATH macros and their varients
any more. Fix reporting profile bug with all
error returns.
Jeremy.
2007-10-10 12:18:28 -05:00
Jeremy Allison
8f3d530c5a r21714: Change the VFS interface to use struct timespec
for utimes - change the call to ntimes. This preserves
nsec timestamps we get from stat (if the system supports
it) and only maps back down to usec or sec resolution
on time set. Looks bigger than it is as I had to move
lots of internal code from using time_t and struct utimebuf
to struct timespec.
Jeremy.
2007-10-10 12:18:24 -05:00
Jeremy Allison
b8327b21dd r21672: The cannonical file access pattern should look like this :
srvstr_get_path(inbuf, name, smb_buf(inbuf) + 1, sizeof(name), 0, STR_TERMINATE, &status);
	if (!NT_STATUS_IS_OK(status)) {
		return ERROR_NT(status);
	}

	RESOLVE_DFSPATH(name, conn, inbuf, outbuf);

	status = unix_convert(conn, name, False, NULL, &sbuf);
	if (!NT_STATUS_IS_OK(status)) {
		return ERROR_NT(status);
	}

	status = check_name(conn, name);
	if (!NT_STATUS_IS_OK(status)) {
		return ERROR_NT(status);
	}

Make sure that every access pattern (including the
wildcard generated paths from unlink, rename, and copy)
do the same. Tidy things up a bit....

Jeremy.
2007-10-10 12:18:23 -05:00
Jeremy Allison
83dbbdff34 r21191: Add in the POSIX open/mkdir/unlink calls.
Move more error code returns to NTSTATUS.
Client test code to follow... See if this
passes the build-farm before I add it into
3.0.25.
Jeremy.
2007-10-10 12:17:47 -05:00
Volker Lendecke
01c9fb1728 r21093: Remove the hash and dnotify backends. Disabling FAM for this checkin, I'm
working on that right now.

Volker
2007-10-10 12:17:36 -05:00
Volker Lendecke
2aadb95a7e r21089: Do notifies on rename 2007-10-10 12:17:35 -05:00
Volker Lendecke
defa28f9c3 r21087: Make the param list of notify_fname match notify_trigger 2007-10-10 12:17:34 -05:00
Volker Lendecke
705f866a78 r21080: Reformatting 2007-10-10 12:17:34 -05:00
Volker Lendecke
a3c1069b0c r21079: Minimizing diff: Adopt the Samba4 style ChangeNotify flags.
Volker
2007-10-10 12:17:33 -05:00
Jeremy Allison
fe2d7cb2dc r21057: More refactoring into functions.
Jeremy.
2007-10-10 12:17:31 -05:00
Volker Lendecke
9cd6a8a827 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
2007-10-10 12:17:21 -05:00
Volker Lendecke
2f1bfc5373 r20877: Random notify fixes 2007-10-10 12:17:17 -05:00
Jeremy Allison
0296358858 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.
2007-10-10 12:17:16 -05:00
Volker Lendecke
5533cdeec1 r20854: Ok, now I think we're at a point where looking at notify starts to make sense
again :-)

Volker
2007-10-10 12:17:13 -05:00
Jeremy Allison
6133a694aa 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.
2007-10-10 12:17:12 -05:00
Jeremy Allison
a36d446fb6 r20843: Get rid of last BOOL ok.
Jeremy.
2007-10-10 12:17:12 -05:00
Jeremy Allison
de0bf477da r20842: Only one more BOOL ok to go...
Jeremy.
2007-10-10 12:17:12 -05:00
Jeremy Allison
c6b6519660 r20841: Remove more BOOL ok.
Jeremy.
2007-10-10 12:17:12 -05:00
Jeremy Allison
224ff05991 r20840: Keep removing the old BOOL ok logic.
Jeremy.
2007-10-10 12:17:12 -05:00
Volker Lendecke
21b8f15dd5 r20796: Fix the same problem Jeremy has fixed (improper handling of deferred opens)
for delete_driver_files. Proper fix pending... :-)

Jeremy, please check.

Volker
2007-10-10 12:17:09 -05:00
Volker Lendecke
14c88b560e r20759: Dummy checkin to let the build farm pick up the new smbtorture4 2007-10-10 12:17:08 -05:00