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

820 Commits

Author SHA1 Message Date
Günther Deschner
02f5f35e5e Fix the build of reply_setattrE().
How ever could this compile ?

Guenther
2008-04-08 21:41:16 +02:00
Stefan Metzmacher
404a865a34 smbd: make it possible to disable get_file_infos() on searches
metze
2008-04-07 12:29:30 +02:00
Stefan Metzmacher
2eab212ea2 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
2008-04-07 12:29:26 +02:00
Stefan Metzmacher
6aaa2ce0ee 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
2008-04-07 12:29:25 +02:00
Jeremy Allison
251df53811 Fix missing '&&'.
Jeremy.
2008-03-28 17:32:52 -07:00
Jeremy Allison
eef53e9603 Only allow sendfile on non-stream fsp's. Should fix make test for streams
as sendfile isn't implemented in the streams vfs modules yet.
Jeremy.
2008-03-28 17:31:06 -07:00
Volker Lendecke
99d9801250 printclose has only 1 vwv 2008-03-28 13:44:30 +01:00
Jeremy Allison
632f3fe66f Allow us to pass RAW-RENAME by testing that the connection struct
connection paths are equal, not just the conn structs themselves.
Jeremy.
2008-03-11 13:38:25 -07:00
Jeremy Allison
9065792d4b Try and fix bug #5315, as well as S4 torture tests RAW-OPLOCK BATCH19,
BATCH20 and RAW-RENAME.
Jeremy.
2008-03-11 13:27:33 -07:00
Volker Lendecke
183fe57046 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...
2008-02-22 17:15:09 +01:00
Karolin Seeger
2bec0a1fb7 Fix some typos.
Karolin
2008-02-08 10:05:32 +01:00
Alexander Bokovoy
7da6c67544 Change the file time before we change the file mode.
This doesn't matter for most applications, but for offline files it matters as it allows you to set
files offline from windows clients even with HSM systems that refuse to offline newly created files.
Merge from Tridge's v3-0-ctdb tree.
2008-02-06 09:10:50 +03:00
Volker Lendecke
af40b71023 Convert read_data() to NTSTATUS 2008-02-02 11:03:23 +01:00
Volker Lendecke
9e2947039e Make get_srv_read_error static to process.c 2008-02-02 11:03:23 +01:00
Volker Lendecke
5750c3a51b Convert read_smb_length to return NTSTATUS 2008-02-02 11:03:21 +01:00
Volker Lendecke
46882ad992 Re-enable async I/O for non-TSM systems
The logic was wrong: A "SMB_VFS_AIO_FORCE()==False" disabled async I/O, whereas
a "SMB_VFS_AIO_FORCE()==True" should enforce it regardless of other settings.

Alexander, please check!
2008-01-30 11:12:10 +01:00
Volker Lendecke
4a6dadc517 Fix some "set but never used" warnings 2008-01-20 17:44:40 +01:00
Volker Lendecke
9f7f6b812d Don't test split_ntfs_stream_name
This is a hot code path, and if it has a :, the name will be split later on
anyway.
2008-01-20 14:44:39 +01:00
Volker Lendecke
6022873cc1 Add streams support
This is the core of the streams support. The main change is that in
files_struct there is now a base_fsp pointer that holds the main file open
while a stream is open. This is necessary to get the rather strange delete
semantics right: You can't delete the main file while a stream is open without
FILE_SHARE_DELETE, and while a stream is open a successful unlink of the main
file leads to DELETE_PENDING for all further access on the main file or any
stream.
2008-01-19 23:25:36 +01:00
Alexander Bokovoy
875208724e 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>
2008-01-16 12:17:03 +03:00
Volker Lendecke
8e64107b78 Convert OpenDir to talloc, use talloc_tos()
This cuts some mallocs on NtCreate&X
2008-01-12 21:04:06 +01:00
Michael Adam
a52cfb7d77 Combine fsp and fromfd to fromfsp in SMB_VFS_SENDFILE().
Michael
2008-01-11 01:27:05 +01:00
Volker Lendecke
65dd869bea use talloc_tos in a few more places 2008-01-10 13:19:58 +01:00
Jeremy Allison
acfb233acc Fix resource leak found by coverity (CID 521).
Jeremy.
2008-01-08 18:44:19 -08:00
Michael Adam
0b86c420be Remove redundant parameter fd from SMB_VFS_FSTAT().
Michael
2008-01-07 15:59:01 +01:00
Michael Adam
df929796f2 Remove redundant parameter fd from SMB_VFS_LSEEK().
Michael
2008-01-07 15:59:01 +01:00
Jeremy Allison
8f36def18e 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.
2008-01-04 15:37:24 -08:00
Jeremy Allison
c4e5a50504 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.
2008-01-04 12:56:23 -08:00
Volker Lendecke
1b1cea9ef0 Convert reply_mknew to create_file 2008-01-02 13:32:23 +01:00
Volker Lendecke
fa09b9ab26 Convert reply_open_and_X to create_file 2008-01-02 13:32:12 +01:00
Volker Lendecke
209c696ab8 Convert reply_open to create_file 2008-01-02 13:32:07 +01:00
Jeremy Allison
d78045601a Add SMB encryption. Still fixing client decrypt but
negotiation works.
Jeremy.
2007-12-26 17:12:36 -08:00
Volker Lendecke
5ab82d4f57 Some C++ warnings 2007-12-21 09:58:20 +01:00
Jeremy Allison
6bf053a6a1 Constrain "min receivefile size" to max of BUFFER_SIZE
(128k). Add debug error messages so we can see why
writeX large is denied. Ensure we don't allow recvfile
writes on IPC$.
Jeremy.
2007-11-07 21:47:00 -08:00
Jeremy Allison
255c2adf7b Remove the horror that was the global smb_rw_error.
Each cli struct has it's own local copy of this variable,
so use that in client code. In the smbd server, add one
static to smbd/proccess.c and use that inside smbd. Fix
a bunch of places where smb_rw_error could be set by
calling read_data() in places where we weren't reading
from the SMB client socket (ie. winbindd).
Jeremy.
2007-11-05 11:12:56 -08:00
Jeremy Allison
81ca5853b2 Change the client library to write directly out of
the incoming buffer in the non-signed case. Speeds
up writes by over 10% or so. Complete the server
recvfile implementation.
Jeremy.
2007-11-02 12:21:34 -07:00
Jeremy Allison
c3de44b6b0 Argggh. smblen doesn't include the +4, so my smb_doff calculations
shouldn't either :-).
Jeremy.
2007-11-02 10:35:10 -07:00
Jeremy Allison
84d22f7747 Ensure we can't accidently do a pipe write with
unread bytes in the socket buffer.
Jeremy
2007-11-01 22:42:21 -07:00
Jeremy Allison
2d3ff9c502 Be careful and take care of the correct lengths in large
writeX calls.
Jeremy.
2007-11-01 22:24:39 -07:00
Jeremy Allison
1c71546b61 Ensure we detect a large writeX when using recvfile.
More changes needed to make the UNIX_LARGE_WRITEX_CAP
writes work (I'll add these tomorrow).
Jeremy.
2007-11-01 21:51:45 -07:00
Jeremy Allison
39d265375c 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.
2007-10-31 15:45:45 -07:00
Jeremy Allison
b7088bb9c2 Handle the disk full error case correctly.
Jeremy.
2007-10-30 18:18:40 -07:00
Jeremy Allison
11c03b75dd Add new parameter, "min receivefile size" (by default set
to zero). If non-zero, writeX calls greater than this
value will be left in the socket buffer for later handling
with recvfile (or userspace equivalent). Definition of
recvfile for your system is left as an exercise for
the reader (I'm working on getting splice working :-).
Jeremy.
2007-10-30 16:22:24 -07:00
Jeremy Allison
f35a266b3c 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.
2007-10-18 17:40:25 -07:00
Gerald (Jerry) Carter
5c6c8e1fe9 [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch. 2007-10-10 15:34:30 -05:00
Volker Lendecke
492977016f r25502: Fix bug 5006
Thanks to Joerg.Bernau at web.de
2007-10-10 12:31:10 -05:00
Jeremy Allison
39c211a702 r25138: More pstring elimination. Add a TALLOC_CTX parameter
to unix_convert().
Jeremy.
2007-10-10 12:30:44 -05:00
Jeremy Allison
7f0db75fb0 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.
2007-10-10 12:30:41 -05:00
Jeremy Allison
0c9a8c4dff 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.
2007-10-10 12:30:41 -05:00
Jeremy Allison
cf6b6f9c3a 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.
2007-10-10 12:30:40 -05:00