1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-28 07:21:54 +03:00
Commit Graph

767 Commits

Author SHA1 Message Date
Volker Lendecke
a790dcbc4e Remove inbuf references from the trans2ioctl code 2008-11-28 10:06:24 +01:00
Volker Lendecke
2719216d60 Consolidate the buffer checks for the reply_trans style functions
This is the one where I found the problem that led to 3.2.5. So if there is one
checkin in the last year that I would like others to review and *understand*,
it is this one :-)

Volker
2008-11-28 09:22:34 +01:00
Volker Lendecke
4a322398c5 Remove an unused variable 2008-11-28 08:23:20 +01:00
Volker Lendecke
114f519233 Fix the offset checks in the trans routines
This fixes a potential crash bug, a client can make us read memory we
should not read. Luckily I got the disp checks right...

Volker
(cherry picked from commit 64a1d80851)
(cherry picked from commit f04c5650a3)
2008-11-27 17:19:01 +01:00
Volker Lendecke
8315677ca3 Do not write into inbuf for the transs request
Instead, fix up the outbuf in send_xx_reply. In those routines, we know
what we are returning.
2008-11-08 10:42:29 +01:00
Volker Lendecke
95d1825a51 Fix a const warning 2008-11-04 21:53:14 +01:00
Volker Lendecke
7808a2594c Remove some inbuf references by adding "cmd" to smb_request 2008-11-02 23:17:01 +01:00
Volker Lendecke
77f52d903f Use "vwv" in trans parsing 2008-11-02 17:46:08 +01:00
Volker Lendecke
2bab73a18d Remove a bunch of direct inbuf references by adding "vwv" to smb_request 2008-11-02 16:58:19 +01:00
Jeremy Allison
54eaf2de74 Get closer to passing S4 RAW-ACLs.
Jeremy.
2008-10-31 18:04:53 -07:00
Jeremy Allison
c783d8a32e Cope with bad trans2mkdir requests from System i QNTC IBM SMB client.
If total_data == 4 Windows doesn't care what values
are placed in that field, it just ignores them.
The System i QNTC IBM SMB client puts bad values here,
so ignore them.
Jeremy.
2008-10-16 21:03:59 -07:00
Jelmer Vernooij
4746f79d50 Use {u,}int64_t instead of SMB_BIG_{U,}INT. 2008-10-14 01:59:36 +02:00
Volker Lendecke
ac126ea818 Use "struct files_struct" for pipes instead of smb_np_struct 2008-10-13 20:59:32 +02:00
Volker Lendecke
c530009401 Pass struct smb_request to file_free
on the way to get rid of chain_fsp
2008-10-13 19:32:38 +02:00
Volker Lendecke
3bbe5e88e5 Pass struct smb_request to file_fsp
The goal is to get rid of the chain_fsp global variable
2008-10-13 19:32:37 +02:00
Jeremy Allison
d275cc762d Fix bug #5783 FindFirst fails where search pattern == mangled filename.
That was an old and subtle bug.
Jeremy.
2008-09-23 15:05:45 -07:00
Jeremy Allison
cb40b1ae83 When requesting UNIX info levels on findfirst/findnext, don't play games with write time,
just return what the underlying filesystem says. Trying not to confuse UNIX apps any more than necessary.
Jeremy.
(This used to be commit b81a4dd003)
2008-09-10 14:54:25 -07:00
Volker Lendecke
d39e9e05ed Fix calculation of useable_space for trans2 and nttrans replies
When alignment was in place, we pretended to send more data/params according to
the param_offset/param_length and data_offset/data_length parameters than would
actually fit into the SMB according to the NBSS length field.
(This used to be commit ef3c132b84)
2008-09-08 23:32:22 +02:00
Jeremy Allison
405b072431 Write times code update.
Ok, here's the fix for the write times breakage
with the new tests in S4 smbtorture.

The key is keeping in the share mode struct
the "old_file_time" as the real write time,
set by all the write and allocation calls,
and the "changed_write_time" as the "sticky"
write time - set by the SET_FILE_TIME calls.

We can set them independently (although I
kept the optimization of not setting the
"old_file_time" is a "changed_write_time"
was already set, as we'll never see it.

This allows us to update the write time
immediately on the SMBwrite truncate case,
SET_END_OF_FILE and SET_ALLOCATION_SIZE calls,
whilst still have the 2 second delay on the
"normal" SMBwrite, SMBwriteX calls.

I think in a subsequent patch I'd like to
change the name of these from "old_file_time"
to "write_time" and "changed_write_time" to
"sticky_write_time" to make this clearer.

I think I also fixed a bug in Metze's original
code in that once a write timestamp had been
set from a "normal" SMBwriteX call the fsp->update_write_time_triggered
variable was set and then never reset - thus
meaning the write timestamp would never get
updated again on subsequent SMBwriteX's.

The new code checks the update_write_time_event
event instead, and doesn't update is there's
an event already scheduled.

Metze especially, please check this over for
your understanding.

Jeremy.
(This used to be commit 6f20585419)
2008-09-05 19:00:48 -07:00
Volker Lendecke
52664f62ba Remove current_user references from trans2.c
This involved replacing the CHECK_NTQUOTA_HANDLE_OK macro by a function.
(This used to be commit 5595cdf837)
2008-06-19 18:51:38 +02:00
Volker Lendecke
e901466061 Remove some current_user references from trans2.c
(This used to be commit 4c31cc0b62)
2008-06-19 18:51:38 +02:00
Volker Lendecke
49ca8efa91 Remove the "current_user" arg from check_fsp
check_fsp only used the vuid struct member anyway, and this is available in the
smb_request structure as well.
(This used to be commit 8d364c4c33)
2008-06-19 18:51:37 +02:00
Tim Prouty
fb37f15600 Cleanup size_t return values in callers of convert_string_allocate
This patch is the second iteration of an inside-out conversion to cleanup
functions in charcnv.c returning size_t == -1 to indicate failure.
(This used to be commit 6b189dabc5)
2008-05-20 22:40:13 +02:00
Volker Lendecke
5bda9a8af0 Remove "user" from connection_struct
(This used to be commit 368454a27c)
2008-05-10 11:17:01 +02:00
Volker Lendecke
d62563342e Remove connection_struct->mem_ctx, connection_struct is its own parent
(This used to be commit 559180f7d3)
2008-05-05 11:23:13 +02:00
Jeremy Allison
85dc0ad7be Rename inherit_access_acl() -> inherit_access_posix_acl() to make use clear.
Jeremy.
(This used to be commit b739c7f1cd)
2008-05-02 12:54:53 -07:00
Jeremy Allison
0173eeb3b5 Fix bug found by Igor Mammedov <niallain@gmail.com> where we are
not returning a directory value for a QPATHINFO on a msdfs link
with a non-dfs path. Windows does this.
Jeremy.
(This used to be commit fbd99071f9)
2008-04-28 15:06:08 -07:00
Jeremy Allison
86e59c50f1 Rewrite the wrap checks to deal with gcc 4.x optimisations.
Karolin, please pull once Volker has reviewed. Thanks.
Jeremy.
(This used to be commit 09852899ca)
2008-04-07 21:11:16 -07:00
Stefan Metzmacher
19f49de92e smbd: make it possible to disable get_file_infos() on searches
metze
(This used to be commit 404a865a34)
2008-04-07 12:29:30 +02:00
Stefan Metzmacher
851cadba51 locking: combine get_delete_on_close_flag() and get_write_time() into get_file_infos()
This means we need to fetch the record only once.

metze
(This used to be commit 4130b87329)
2008-04-07 12:29:29 +02:00
Stefan Metzmacher
d03453864a smbd: implement the strange write time update logic
We now never call file_ntimes() directly, every update
is done via smb_set_file_time().

This let samba3 pass the BASE-DELAYWRITE test.

The write time is only updated 2 seconds after the
first write() on any open handle to the current time
(not the time of the first write).

Each handle which had write requests updates the write
time to the current time on close().

If the write time is set explicit via setfileinfo or setpathinfo
the write time is visible directly and a following close
on the same handle doesn't update the write time.

metze
(This used to be commit 2eab212ea2)
2008-04-07 12:29:26 +02:00
Stefan Metzmacher
2ccf50256e locking: store the write time in the locking.tdb
This is needed to implement the strange write time update
logic later. We need to store 2 time timestamps to
distinguish between the time the file system had before
the first client opened the file and a forced timestamp update.

metze
(This used to be commit 6aaa2ce0ee)
2008-04-07 12:29:25 +02:00
Jeremy Allison
792c972538 Metze pointed out this we don't need FILE_ATTRIBUTE_READ here.
Jeremy.
(This used to be commit 923aa9f330)
2008-03-11 13:59:04 -07:00
Jeremy Allison
bac7b5b19e Try and fix bug #5315, as well as S4 torture tests RAW-OPLOCK BATCH19,
BATCH20 and RAW-RENAME.
Jeremy.
(This used to be commit 9065792d4b)
2008-03-11 13:27:33 -07:00
Jeremy Allison
380fcfa600 Fix S3 to pass the test_raw_oplock_exclusive3 test.
Jeremy.
(This used to be commit 028302fac5)
2008-03-11 12:37:01 -07:00
Volker Lendecke
6a2dbea794 Fix some typos
(This used to be commit cfa1b83814)
2008-03-08 12:31:21 +01:00
Volker Lendecke
14aa57a9e3 Don't use fname after create_file has been called
create_file calls unix_convert internally, so modifies fname. So we can't use
"fname" after create_file has returned. Use fsp->fsp_name instead.

Found during a lengthy debugging session with Karolin testing the xattr_tdb
module...
(This used to be commit 183fe57046)
2008-02-22 17:15:09 +01:00
Volker Lendecke
5398dd641c Fix uninitialized variables
Thanks to Corinna Vinschen
(This used to be commit aba8c17599)
2008-01-26 21:29:18 +01:00
Corinna Vinschen
9051199e40 Get Samba version or capability information from Windows
On Jan 22 13:31, Volker Lendecke wrote:
> On Tue, Jan 22, 2008 at 11:33:17AM +0100, Corinna Vinschen wrote:
> > Right.  I changed samba_gitcommitdate from time_t to NTTIME and shortened
> > samba_version_string to 28 bytes.  New patch below.
>
> Ok, pushed with some modifications. You might want to review
> that.

Reviewed and tested.  Looks good, thank you!

Below you'll find a tiny patch to add the git commit date.  It seems
I simply missed its existence in version.h :(  Tested on Windows XP.

Thanks,
Corinna

	* source/smbd/trans2.c (samba_extended_info_version): Fill out
	samba_gitcommitdate member with GIT commit timestamp.
(This used to be commit a33d079758)
2008-01-22 16:45:25 +01:00
Volker Lendecke
d4d962f691 Move samba_extended_info_version to smbd/trans2.c
This is right now only used there, and in version.c it gave linker errors
because some binaries (e.g. smbmnt) don't link in time.o
(This used to be commit 1f0eaaa591)
2008-01-22 13:00:22 +01:00
Corinna Vinschen
559603ad69 Get Samba version or capability information from Windows
On Jan 21 16:18, Danilo Almeida wrote:
> Corina wrote:
>
> > +	time_t samba_gitcommitdate;
>
> And:
>
> > +   SIVAL(pdata,28,extended_info.samba_gitcommitdate);
> > +   memcpy(pdata+32,extended_info.samba_version_string,32);
>
> Note that you are dropping bits on a system w/64-bit time_t, and that this has the 2038 problem.

Right.  I changed samba_gitcommitdate from time_t to NTTIME and shortened
samba_version_string to 28 bytes.  New patch below.

Thanks,
Corinna
(This used to be commit 28aa1c199d)
2008-01-22 12:39:47 +01:00
Volker Lendecke
a4c2b04a2b Hide streams from the EA API
(This used to be commit e9bb3d5067)
2008-01-22 12:29:02 +01:00
Volker Lendecke
6a69bc3ef9 Fix get_ea_names_from_file for many EAs
Found by the IBM checker
(This used to be commit 8741a9b374)
2008-01-22 09:23:27 +01:00
Volker Lendecke
043a7e1774 Activate SMB_QUERY_FILE_STREAM_INFO
gcolley was right, my nt4 does not blue screen with it
(This used to be commit 9f2b5dc186)
2008-01-20 15:59:31 +01:00
Volker Lendecke
1b976d5192 Add the STREAMINFO vfs call
Based on jpeach's work, modified the streaminfo prototype

Make use of it in trans2.c together with marshall_stream_info()
(This used to be commit c34d729c7c)
2008-01-19 22:58:17 +01:00
Volker Lendecke
84518f1fc7 Add get_ea_names_from_file to sanely list posix xattrs
Refactor get_ea_list_from_file to use that.
(This used to be commit aec357a456)
2008-01-19 16:07:56 +01:00
Volker Lendecke
6d7eb2e6ec Make get_ea_value public
(This used to be commit 0aa406bbba)
2008-01-19 15:50:05 +01:00
Jeremy Allison
ca6cf1fe94 Actually test vl's new code and make it work to fix the build farm :-).
Jeremy.
(This used to be commit 63defd3e9d)
2008-01-18 18:39:27 -08:00
Volker Lendecke
145ab107b2 Always return nlink=1 for directories
I did not test it, but it should not affect cifsfs, there are special posix
calls that also return the stat information unfiltered.
(This used to be commit e96cf1309e)
2008-01-18 17:37:04 -08:00
Alexander Bokovoy
03387a0f58 Remove is_remotestorage() call from VFS. We already have statvfs() there to handle FS capabilities.
As discussed with Volker, it is better to calculate FS capabilities at
connection time. We already do this with help of VFS statvfs() call
which allows to fill-in system-specific attributes including FS
capabilities. So just re-use it if you want to represent additional
capabilities in your modules. The only caution is that you need to
call underlying statvfs() call to actually get system-specific
capabilities (and other fields) added. Then add module-specific ones.
(This used to be commit e342ca0d93)
2008-01-17 16:59:29 +03:00
Alexander Bokovoy
d86fc3ec8c Add support for offline files support, remote storage, and Async I/O force operations to VFS
Offline files support and remote storage are for allowing communication with
backup and archiving tools that mark files moved to a tape library as offline.
We translate this info into corresponding CIFS offline file attribute and
mark an exported volume as remote storage.

Async I/O force is to allow selective redirection of I/O operations to asynchronous
processing in case it is viable at VFS module discretion. It is needed for
proper handling of offline files as performing regular I/O on offline file will
block smbd.


Signed-off-by: Alexander Bokovoy <ab@samba.org>(This used to be commit 875208724e)
2008-01-16 12:17:03 +03:00
Volker Lendecke
3cc3b9e187 use talloc_tos in a few more places
(This used to be commit 65dd869bea)
2008-01-10 13:19:58 +01:00
Jeremy Allison
253fbf1a6e Make use of talloc_pool in the main codepaths. Remove the sub-contexts.
Jeremy.
(This used to be commit bc932b8ad4)
2008-01-09 17:11:04 -08:00
Michael Adam
aab6704ce8 Remove redundant parameter fd from SMB_VFS_FSETXATTR().
Michael
(This used to be commit 0bd2643463)
2008-01-08 11:47:33 +01:00
Michael Adam
1590dd32cf Remove redundant parameter fd from SMB_VFS_FREMOVEXATTR().
Michael
(This used to be commit bfc3b5a27f)
2008-01-08 11:29:09 +01:00
Michael Adam
9f691df852 Remove redundant parameter fd from SMB_VFS_FLISTXATTR().
Michael
(This used to be commit 167649b3b8)
2008-01-08 10:51:40 +01:00
Michael Adam
50ee744fa4 Remove redundant parameter fd from SMB_VFS_FGETXATTR().
Michael
(This used to be commit 2cb739a82d)
2008-01-08 10:00:47 +01:00
Michael Adam
62e9d503d8 Remove redundant parameter fd from SMB_VFS_SYS_ACL_GET_FD().
Michael
(This used to be commit 42663e8736)
2008-01-07 23:54:07 +01:00
Michael Adam
87a684f7fc Remove redundant parameter fd from SMB_VFS_FSTAT().
Michael
(This used to be commit 0b86c420be)
2008-01-07 15:59:01 +01:00
Jeremy Allison
29562987c3 Now conn is part of smb_request, we don't need it as
an extra parameter. This cleans up quite a few places
we were passing it around without needing it.
Jeremy.
(This used to be commit 8f36def18e)
2008-01-04 15:37:24 -08:00
Jeremy Allison
9394916e49 We dont' modify the smb header for crypto anymore.
Jeremy.
(This used to be commit f5b6b6dac6)
2008-01-04 14:43:43 -08:00
Jeremy Allison
9254bb4ef1 Refactor the crypto code after a very helpful conversation
with Volker. Mostly making sure we have data on the incoming
packet type, not stored in the smb header.
Jeremy.
(This used to be commit c4e5a50504)
2008-01-04 12:56:23 -08:00
Volker Lendecke
523dbf801b Convert call_trans2open to create_file()
(This used to be commit 22138572bd)
2008-01-02 13:32:29 +01:00
Jeremy Allison
bd3521457c Allow encryption context setup on IPC$.
Jeremy.
(This used to be commit 5d424cb306)
2007-12-29 22:36:49 -08:00
Volker Lendecke
a59280792c Remove tiny code duplication
sid_size did the same as ndr_size_dom_sid
(This used to be commit 8aec5d09ba)
2007-12-29 23:12:51 +01:00
Jeremy Allison
38369ba741 Ensure we turn off POSIX large read/write if encryption
is mandatory or signing is on.
Jeremy.
(This used to be commit 5088b70479)
2007-12-28 00:02:13 -08:00
Jeremy Allison
afce2b245a Add the capability to set "smb encrypt = required"
on a share (or global) and have the server reply with
ACCESS_DENIED for all non-encrypted traffic (except
that used to query encryption requirements and set
encryption state).
Jeremy.
(This used to be commit d241bfa577)
2007-12-27 23:51:03 -08:00
Jeremy Allison
675f41dc14 Add "smb encrypt" parameter. Can be set to "no, yes, required".
Currently if set required this is not enforced. I'll be adding
that soon.
Jeremy.
(This used to be commit df7e447623)
2007-12-27 16:54:07 -08:00
Jeremy Allison
5413ad4aca Add CIFS_UNIX_TRANSPORT_ENCRYPTION_CAP capability to
our reported caps.
Jeremy.
(This used to be commit e86d027823)
2007-12-27 10:18:22 -08:00
Jeremy Allison
afc93255d1 Add SMB encryption. Still fixing client decrypt but
negotiation works.
Jeremy.
(This used to be commit d78045601a)
2007-12-26 17:12:36 -08:00
Volker Lendecke
d4bfafa29c Fix bug 5055
(This used to be commit 8bcd2df841)
2007-11-26 15:28:13 +01:00
Jeremy Allison
61b37c73ee Paranoia check that space_remaining never goes -ve.
Jeremy.
(This used to be commit 76f9c0b2dc)
2007-11-20 15:31:18 -08:00
Jeremy Allison
b059e2cbf1 Ensure we use PATH_MAX for symlinks.
Jeremy.
(This used to be commit a90ef69350)
2007-11-16 17:06:57 -08:00
Volker Lendecke
082da3d287 Fix a debug message
(This used to be commit a86849e4f9)
2007-11-05 03:40:18 +01:00
Jeremy Allison
73d4079680 Remove the smb_read_error global variable and replace
it with accessor functions. "One global or pstring a day...." :-).
Jeremy.
(This used to be commit d50d14c300)
2007-11-03 15:12:42 -07:00
Jeremy Allison
8bad80efb0 Add brackets so as not to break the POSIX caps return.
Jeremy.
(This used to be commit 47dbddcb53)
2007-11-01 18:30:02 -07:00
Jeremy Allison
0bb1a6ec2d Note when we're setting change time, not write time, and send
message accordingly. Apart from not supporting create time we
now pass the S4 RAW-NOTIFY torture.
Jeremy.
(This used to be commit 8a77f520fa)
2007-10-31 16:32:48 -07:00
Jeremy Allison
8f1f2f04c7 Fix some cases where file_set_dosmode was being passed
False instead of NULL. Fix more of the notifications to
be correct for Samba4 RAW-NOTIFY torture (we had missed
one when calling set_ea_dos_attribute().
Jeremy.
(This used to be commit 39d265375c)
2007-10-31 15:45:45 -07:00
Jeremy Allison
133fad90b5 Make explicit draining the socket on RECVFILE. Add
capability for large UNIX write if not signing and
recvfile set. Cope with large UNIX write length on
incoming processing. Stevef - we can now test 1-16Mb
writes from CIFFS.
Jeremy.
(This used to be commit 8cf78776b0)
2007-10-31 14:01:35 -07:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
(This used to be commit f35a266b3c)
2007-10-18 17:40:25 -07:00
Jeremy Allison
39d30c5499 Fix valgrind-found memory overwrite.
(This used to be commit 183df4754b)
2007-10-10 17:24:44 -07:00
Gerald (Jerry) Carter
e5a951325a [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.
(This used to be commit 5c6c8e1fe9)
2007-10-10 15:34:30 -05:00
Volker Lendecke
ad97bcf813 r25184: Fix some C++ warnings and an uninitialized variable
(This used to be commit b64df8a3c5)
2007-10-10 12:30:49 -05:00
Jeremy Allison
539635cd94 r25163: Fix wrong ctx passed to talloc_asprintf_append().
Found by Metze's code review (thanks Metze !).
Jeremy.
(This used to be commit a7370eea6b)
2007-10-10 12:30:47 -05:00
Jeremy Allison
eacd314057 r25138: More pstring elimination. Add a TALLOC_CTX parameter
to unix_convert().
Jeremy.
(This used to be commit 39c211a702)
2007-10-10 12:30:44 -05:00
Jeremy Allison
12f61e09d9 r25117: The mega-patch Jerry was waiting for. Remove all pstrings from
the main server code paths. We should now be able to cope with
paths up to PATH_MAX length now.
Final job will be to add the TALLOC_CTX * parameter to
unix_convert to make it explicit (for Volker).
Jeremy.
(This used to be commit 7f0db75fb0)
2007-10-10 12:30:41 -05:00
Jeremy Allison
3a9d382164 r25111: Move to talloced pathnames on most code paths.
There are now ony 17 pstrings left in reply.c,
and these will be easy to remove (and I'll be
doing that shortly). Had to fix an interesting
bug in pull_ucs2_base_talloc() when a source
string is not null terminated :-).
Jeremy.
(This used to be commit 0c9a8c4dff)
2007-10-10 12:30:41 -05:00
Jeremy Allison
351eb37a25 r25102: Rewrite msdfs code to use talloced filenames. Passes make test
and make valgrindtest. Final step will be to change srvstr_get_path()
to return talloced memory in the major codepaths.
Jeremy.
(This used to be commit cf6b6f9c3a)
2007-10-10 12:30:40 -05:00
Jeremy Allison
132ee3990a r25009: Large patch discussed with Volker. Move unix_convert to a talloc-based
interface. More development will come on top of this. Remove the
"mangled map" parameter.
Jeremy.
(This used to be commit dee8beba7a)
2007-10-10 12:30:32 -05:00
Volker Lendecke
929e1d9920 r24809: Consolidate the use of temporary talloc contexts.
This adds the two functions talloc_stackframe() and talloc_tos().

 * When a new talloc stackframe is allocated with talloc_stackframe(), then
 * the TALLOC_CTX returned with talloc_tos() is reset to that new
 * frame. Whenever that stack frame is TALLOC_FREE()'ed, then the reverse
 * happens: The previous talloc_tos() is restored.
 *
 * This API is designed to be robust in the sense that if someone forgets to
 * TALLOC_FREE() a stackframe, then the next outer one correctly cleans up and
 * resets the talloc_tos().

The original motivation for this patch was to get rid of the
sid_string_static & friends buffers. Explicitly passing talloc context
everywhere clutters code too much for my taste, so an implicit
talloc_tos() is introduced here. Many of these static buffers are
replaced by a single static pointer.

The intended use would thus be that low-level functions can rather
freely push stuff to talloc_tos, the upper layers clean up by freeing
the stackframe. The more of these stackframes are used and correctly
freed the more exact the memory cleanup happens.

This patch removes the main_loop_talloc_ctx, tmp_talloc_ctx and
lp_talloc_ctx (did I forget any?)

So, never do a

tmp_ctx = talloc_init("foo");

anymore, instead, use

tmp_ctx = talloc_stackframe()

:-)

Volker
(This used to be commit 6585ea2cb7)
2007-10-10 12:30:24 -05:00
Volker Lendecke
3aed02989f r24699: Actually write 24 zeros instead of zero 24's...
Jeremy, please check ;-)
(This used to be commit 85b64bde7d)
2007-10-10 12:30:14 -05:00
Volker Lendecke
2efabbbf4b r24548: Fix the case-changing renames
This was broken when I changed reply_mv to wrap in a open_file_ntcreate
call, unix_convert on the destination was called twice
(This used to be commit fddc9db911)
2007-10-10 12:29:56 -05:00
Jeremy Allison
077d5d2e36 r24498: More extra code into a function, reply_openerror.
Jeremy.
(This used to be commit 43ddfb8c91)
2007-10-10 12:29:52 -05:00
Jeremy Allison
622abf53f9 r24476: Fix the mappings in reply_opeXXX calls. Now to test renames.
Jeremy.
(This used to be commit 74d10b09a6)
2007-10-10 12:29:51 -05:00
Jeremy Allison
522418ce16 r24475: Fix the error mapping for SMB_POSIX_PATH_OPEN.
Jeremy.
(This used to be commit 6dac315ba1)
2007-10-10 12:29:51 -05:00
Jeremy Allison
fd9c413786 r24470: Start fixing up the mapping of OBJECT_NAME_COLLISION
to DOS error ERRDOS, ERRfilexists on open calls.
Jeremy.
(This used to be commit 4674486450)
2007-10-10 12:29:50 -05:00
Volker Lendecke
527905a09a r24444: Convert reply_find[n]close to the new API
(This used to be commit 6af8595346)
2007-10-10 12:29:48 -05:00
Volker Lendecke
2a375f12be r24362: Initialize padding also when no params are sent back
(This used to be commit 03c5e960a2)
2007-10-10 12:29:36 -05:00
Volker Lendecke
23998e1da8 r24320: Fix the wct checks in reply_trans2 and the reply_trans calls
No idea what I've been smoking here.

Thanks to Stefan for closely looking
(This used to be commit 708f5af2e8)
2007-10-10 12:29:28 -05:00
Volker Lendecke
c7a425f30f r24163: Remove the send_trans2_replies_new wrapper
This changes send_trans2_replies to not depend on large buffers anymore
and finishes the trans2 conversion.
(This used to be commit b1d133e4ff)
2007-10-10 12:29:16 -05:00
Volker Lendecke
c2fb81bbf0 r24162: send_trans2_replies is now static in trans2.c
(This used to be commit 47261fb6fe)
2007-10-10 12:29:16 -05:00
Volker Lendecke
72ce8ef168 r24161: handle_trans2 takes care of errors itself, no need to do it in reply_transs2
(This used to be commit ca26b43e02)
2007-10-10 12:29:16 -05:00
Volker Lendecke
9f3062d8a7 r24160: process_trans2 in smbd/blocking.c used send_trans2_replies.
Fake a struct smb_request here.

Volker
(This used to be commit f712d1c92b)
2007-10-10 12:29:16 -05:00
Volker Lendecke
1d8851f4c7 r24159: Convert reply_transs2 to the new API
(This used to be commit a55a4d71ff)
2007-10-10 12:29:15 -05:00
Volker Lendecke
e2f0b5dd2a r24156: Convert reply_trans2 to the new API
(This used to be commit a9c2d75b42)
2007-10-10 12:29:15 -05:00
Volker Lendecke
675a484670 r24155: Check wct in reply_trans2
(This used to be commit e0a708c79b)
2007-10-10 12:29:15 -05:00
Volker Lendecke
c28bd38aa6 r24154: handle_trans2 does not reference inbuf/outbuf anymore
(This used to be commit 8eb016a91e)
2007-10-10 12:29:14 -05:00
Volker Lendecke
2516942a4b r24153: Convert call_trans2setfsinfo to the new API.
This *might* break the transport encryption stuff. I need to check that.
(This used to be commit 82b34d7bdb)
2007-10-10 12:29:14 -05:00
Volker Lendecke
4514ea2034 r24152: Convert call_trans2ioctl to the new API
(This used to be commit db4e6781c4)
2007-10-10 12:29:14 -05:00
Volker Lendecke
70496e030f r24151: Convert call_trans2getdfsreferral to the new API
(This used to be commit 642c58648b)
2007-10-10 12:29:14 -05:00
Volker Lendecke
ccd0b815e8 r24150: Convert call_trans2qfsinfo to the new API
(This used to be commit cdd86497b9)
2007-10-10 12:29:14 -05:00
Volker Lendecke
24e97edc78 r24149: Convert call_trans2setfilepathinfo to the new API
(This used to be commit 50aa149cef)
2007-10-10 12:29:13 -05:00
Volker Lendecke
67fde05d68 r24148: Remove some inbuf refs from subcommands of call_trans2setfilepathinfo
(This used to be commit 09ed6537b3)
2007-10-10 12:29:13 -05:00
Volker Lendecke
f2e2c22b6f r24147: Remove some inbuf refs from call_trans2setfilepathinfo
(This used to be commit a13c42be75)
2007-10-10 12:29:13 -05:00
Volker Lendecke
bd627a1597 r24144: Fix the build
In a function returning void the "return;" needs to stand alone on some
compilers
(This used to be commit 28affcca8e)
2007-10-10 12:29:12 -05:00
Volker Lendecke
44c5ee4ca6 r24143: Convert call_trans2qfilepathinfo to the new API
(This used to be commit 0b84e29120)
2007-10-10 12:29:12 -05:00
Volker Lendecke
fa2b8a447a r24142: Remove some direct inbuf references from call_trans2qfilepathinfo
(This used to be commit c9c0133d55)
2007-10-10 12:29:12 -05:00
Volker Lendecke
e3a53acafe r24140: Convert call_trans2findnotifyfirst/next to the new API
(This used to be commit 46d9c51631)
2007-10-10 12:29:11 -05:00
Volker Lendecke
133a8bbe07 r24139: Convert call_trans2mkdir to the new API
(This used to be commit d0b7f409e1)
2007-10-10 12:29:11 -05:00
Volker Lendecke
a1d70fcad7 r24138: Convert call_trans2findnext to the new API
(This used to be commit af1855e4ce)
2007-10-10 12:29:11 -05:00
Volker Lendecke
e5ad62702b r24137: Convert call_trans2findfirst to the new API
(This used to be commit 238edebab7)
2007-10-10 12:29:11 -05:00
Volker Lendecke
4d34c5eef7 r24136: get_lanman2_dir_entry() does not need access to inbuf/outbuf
It did not use inbuf anyway. Outbuf was used for alignment and to the
flags2. The alignment works ok if we align relative to base_data because this
and outbuf are both malloc'ed, and we put send_trans2_replies aligns out_data
properly relative to the start of the outbuf.

I don't know if the explicit align_string() calls in get_lanman2_dir_entry are
really necessary. I think that srvstr_push also does the same.

Please also note that this changes dst_len in srvstr_push from -1 to the real
length remaining.

Volker
(This used to be commit 9b1614f8cb)
2007-10-10 12:29:10 -05:00
Volker Lendecke
b91704d47b r24135: Convert call_trans2open to the new API
This itself won't help much, because send_trans2_replies_new still allocates
the big buffers, but stay tuned :-)

Also add/update my copyright on stuff I recently touched.

Volker
(This used to be commit 248f15ff14)
2007-10-10 12:29:10 -05:00
Volker Lendecke
d526657d5f r24134: talloc smb_request for handle_trans2
When starting to convert the individual trans2 subcalls, I need the new
API conventions to be present there. This means that those calls fill in
req->outbuf when there's something to ship
(This used to be commit d9eef977dc)
2007-10-10 12:29:10 -05:00
Volker Lendecke
6c6fed5e65 r24130: Explicitly pass flags2 to srvstr_push
This is in preparation of the trans2 conversion: srvstr_push should not
look at inbuf directly.
(This used to be commit 5fd7e6a382)
2007-10-10 12:29:09 -05:00
Stefan Metzmacher
4b15f31f10 r24120: add a file_id_create() hook into the VFS layer
it's needed for some cluster filesystems to
overload this function.

metze
(This used to be commit cdaa24e804)
2007-10-10 12:29:08 -05:00
Volker Lendecke
bfbd756535 r24106: Pass fnum instead of buf/offset into get_rpc_pipe_p
(This used to be commit eb353412c6)
2007-10-10 12:29:07 -05:00
Volker Lendecke
a2d6aa829f r24102: Pass the fid instead of inbuf and an offset to file_fsp.
This removes the buf==NULL condition in file_fsp(), but wherever it is called
we do have a buffer anyway.

Volker
(This used to be commit d70a1f82fe)
2007-10-10 12:29:07 -05:00
Volker Lendecke
3d769de244 r24101: Move prohibited_ea_names[] into samba_private_attr_name()
Minor cleanup
(This used to be commit 0487971722)
2007-10-10 12:29:06 -05:00
Jeremy Allison
e6c6c0438d r23942: Fix issue found by Shlomi Yaakobovich <Shlomi@exanet.com> where
invalid names sent as a resume name were incorrectly mapped into
. and .. Ensure they really *are . and ..
Jeremy.
(This used to be commit 78d0c5194f)
2007-10-10 12:28:47 -05:00
Jeremy Allison
14826b0a79 r23935: We were lying to the client in the case of POSIX_UNLINK
if a Windows client had the file open. We were setting
delete on close and returning "ok". The POSIX client then
believed the file was gone (and it wasn't). Fix this to
return SHARING_VIOLATION if there is an existing NTcreateX
open on the file and someone calls POSIX_UNLINK. Still one
more Cthon test to fix but getting closer now. Should
be in 3.0.25c also.
Jeremy.
(This used to be commit 24e625a615)
2007-10-10 12:28:46 -05:00
Volker Lendecke
3912eebdc9 r23877: Fix two segfaults in (very unlikely) error paths, found by the IBM
checker.
(This used to be commit 33068885e6)
2007-10-10 12:28:37 -05:00
Jeremy Allison
967b22827f r23855: Setting the allocation size updates the modified time
as a write does. Fix bug #4779.
Jeremy.
(This used to be commit ed0e2174a8)
2007-10-10 12:28:35 -05:00
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Volker Lendecke
ead70dc92e r23761: Rename reduce_name to check_reduced_name
The function name reduce_name is misleading, making the user believe it
changes an argument.
(This used to be commit 68234f0bc6)
2007-10-10 12:23:53 -05:00
Volker Lendecke
8724dfe551 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 :-)
(This used to be commit 18078b9faa)
2007-10-10 12:23:49 -05:00
Volker Lendecke
fcda5b5896 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.
(This used to be commit 836782b07b)
2007-10-10 12:23:49 -05:00
Volker Lendecke
0bc56a2e5f 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
(This used to be commit ca988f4e79)
2007-10-10 12:23:48 -05:00
Volker Lendecke
9c4d185ef0 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
(This used to be commit b599e5b1e1)
2007-10-10 12:23:22 -05:00
Volker Lendecke
e8156439f2 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
(This used to be commit 9b10dbbd5d)
2007-10-10 12:22:52 -05:00
Jeremy Allison
f5038178a9 r23106: Use lchown for symlinks.
Jeremy.
(This used to be commit b98175440b)
2007-10-10 12:22:46 -05:00
Jeremy Allison
dbfd6bf8c8 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.
(This used to be commit a301467d5f)
2007-10-10 12:22:46 -05:00
Jeremy Allison
828cb24004 r23087: Fix POSIX setfilepathinfo to use lstat, not stat.
Still missing lchown (will add this for 3.0.26).
Don't merge for 3.0.25a - possibly 3.0.25b (if it
exists).
Jeremy.
(This used to be commit f546750176)
2007-10-10 12:22:44 -05:00
Jeremy Allison
01a7017d7b 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.
(This used to be commit fa18fc25a5)
2007-10-10 12:22:15 -05:00
Jeremy Allison
32106b2395 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.
(This used to be commit a53268fb20)
2007-10-10 12:22:08 -05:00
Volker Lendecke
b92064fcfd 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.
(This used to be commit bbb5084146)
2007-10-10 12:22:02 -05:00
Jeremy Allison
12ba88574b r22542: Move over to using the _strict varients of the talloc
calls. No functional changes. Looks bigger than it is :-).
Jeremy.
(This used to be commit f6fa3080fe)
2007-10-10 12:19:44 -05:00
Jeremy Allison
0845fa4085 r22493: Fix horrible memory corruption bug with CIFS POSIX open/mkidr.
Found by SteveF + valgrind :-). Jerry - essential for rc3.
Jeremy.
(This used to be commit b01c1c4618)
2007-10-10 12:19:39 -05:00
Jeremy Allison
7d859f04f2 r22491: Fix the build (3.0.25 and 3.0 are different here).
Jeremy.
(This used to be commit c34c291194)
2007-10-10 12:19:38 -05:00