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

686 Commits

Author SHA1 Message Date
Andrew Tridgell
b0132e94fc r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
Jeremy Allison
407e6e695b r23779: Change from v2 or later to v3 or later.
Jeremy.
2007-10-10 12:28:20 -05:00
Jeremy Allison
af715c602a r23752: Fix bug introduced by checkin 22920, allow large
readX. Fix from Dmitry Shatrov <dhsatrov@linux.vnet.ibm.com>.

"In send_file_readX(), if startpos > sbuf.st_size, then smb_maxcnt is set
to an invalid large value due to integer overflow.
As for me, this resulted in MS Word hanging while trying to save
a 1.5Mb document."

This isn't in shipping code.

Jeremy.
2007-10-10 12:23:52 -05:00
Volker Lendecke
b02115f2ca r23731: Forgot one reference to inbuf 2007-10-10 12:23:50 -05:00
Volker Lendecke
18078b9faa r23727: Explicitly pass down FLAGS2 to srvstr_get_path.
Next step is to remove the bug that in the trans2 code we use the inbuf
as the base pointer to decide whether we need ucs2 alignment where we
need to use the beginning of the params buffer

Jeremy, last one for today to reviw :-)
2007-10-10 12:23:49 -05:00
Volker Lendecke
836782b07b r23726: Explicitly pass down the FLAGS2 field to srvstr_pull_buf. The next
checkin will pull this up to srvstr_get_path. At that point we can get more
independent of the inbuf, the base_ptr in pull_string will only be used
to satisfy UCS2 alignment constraints.
2007-10-10 12:23:49 -05:00
Volker Lendecke
ca988f4e79 r23724: Reduce access to the global inbuf a tiny bit. Add a struct smb_request
that contains some of the fields from the SMB header, removing the need
to access inbuf directly. This right now is used only in the open file
code & friends, and creating that header is only done when needed. This
needs more work, but it is a start.

Jeremy, I'm only checking this into 3_0, please review before I merge it
to _26.

Volker
2007-10-10 12:23:48 -05:00
Volker Lendecke
48cdafc10a r23538: Fix for wild-card rename: We can't return directly on error, we need to
CloseDir.
2007-10-10 12:23:26 -05:00
Volker Lendecke
1a45ea28ce r23523: Gaa -- had renamed "name" to "path" and apparently not compiled after
that....

Volker
2007-10-10 12:23:25 -05:00
Volker Lendecke
34a13c82a3 r23522: Save us a kilobyte stack space in a hot code path: I can't see a reason
why check_path_syntax should not be able to run in-line. The destination
pointer either walks side by side with the source pointer or is
decremented. So as far as I can see s>=d is true throughout the whole
routine.

Jeremy, I'm checking this only into 3_0 for now. Please review and ack
or directly merge this to 3_0_26.

Thanks,

Volker
2007-10-10 12:23:25 -05:00
Volker Lendecke
aa16d8a649 r23517: After Jeremy has given is ack on irc:
Change rename_internals to open the file/directory and then call
rename_internals_fsp. Two reasons: Remove code duplication and remove a
race condition. The race condition was due to the fact that in
can_rename the share mode check closed the file and then after that did
the rename.
2007-10-10 12:23:24 -05:00
Jeremy Allison
cd3f7dbee8 r23508: Fix sync_file() to return NTSTATUS and return this
on failure in the write path.
Jeremy.
2007-10-10 12:23:23 -05:00
Volker Lendecke
8d3828871c r23501: Move notify_rename before rename_internals_fsp and call it from there. 2007-10-10 12:23:22 -05:00
Volker Lendecke
b599e5b1e1 r23500: Two changes to survive the now activated test for rename_internals_fsp:
With the target being open we have to return NT_STATUS_ACCESS_DENIED and
root_fid != 0 leads to NT_STATUS_INVALID_PARAMETER
2007-10-10 12:23:22 -05:00
Volker Lendecke
575e594e93 r23486: Ok, this time with a hopefully successful make test in the right place:
Remove two local variables
2007-10-10 12:23:21 -05:00
Volker Lendecke
1ce0c582bc r23483: Revert 23482, I must have run 'make test' in the wrong subdir. 2007-10-10 12:23:20 -05:00
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