1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-11 00:59:11 +03:00
Commit Graph

1278 Commits

Author SHA1 Message Date
da2dd1406f Only call sendfile_short_read() if we need it.
Jeremy.
2009-01-13 15:36:09 -08:00
0f450623c5 Fix bug noticed by Volker - if sendfile returns zero then
we might have to handle a short send by filling with zeros.
Jeremy.
2009-01-13 13:02:44 -08:00
83c3b28096 Fix bug #6019 File corruption in Clustered SMB/NFS environment managed via CTDB
Jeremy.
2009-01-13 11:19:11 -08:00
3dde0cbb76 s3:smbd: move all globals and static variables in globals.[ch]
The goal is to move all this variables into a big context structure.

metze
2009-01-08 12:22:21 +01:00
3e0e756104 s3: Allow renames of streams via NTRENAME and fix stream error codes on rename
The test_streams_rename2 test in RAW-STREAMS verifies these changes
2009-01-04 19:31:30 -08:00
972295f80a Rename parent_dirname_talloc() to parent_dirname() 2008-12-31 19:33:25 +01:00
641772b605 recvfile can't be used for printing so far 2008-12-31 18:43:11 +01:00
ce2ff557bd Fix an ancient uninitialized variable read
The callers of open_file_ntcreate expect *psbuf to be filled correctly
2008-12-31 10:51:44 +01:00
6eda98dd13 Fix bug #5986 - Editing a stream is broken (rename problems).
Jeremy.
2008-12-19 13:59:12 -08:00
7b9f6dda13 s3: [3/3]: Fix a delete on close divergence from windows and the associated torture test
This third patch cleans up by removing all of the code that is made
obsolete by the first patch.  It should cause no functional changes.
2008-12-09 18:06:49 -08:00
5844012285 s3: Change SMB_VFS_CREATE_FILE to take a create_file_flags argument
This replaces the is_dos_path bool with a more future-proof argument.
The next step is to plumb INTERNAL_OPEN_ONLY through this flag instead
of overridding the oplock_request.
2008-12-03 17:51:44 -08:00
08ce060475 s3: Modify direct callers of open_file_ntcreate and open_directory to call SMB_VFS_CREATE_FILE 2008-12-03 17:51:16 -08:00
2caa4fe08e s3: Modify direct callers of create_file_unix_path to call SMB_VFS_CREATE_FILE 2008-12-03 17:51:07 -08:00
f995a7af2a s3: Add new "is_dos_path" argument to SMB_VFS_CREATE_FILE
Now unix paths can be differentiated from windows paths so the
underlying create_file implementations can convert paths correctly.
2008-12-03 17:50:37 -08:00
f38d7f20a8 s3: Add SMB_VFS_CREATE_FILE to the vfs layer
Modify all callers of create_file to go through SMB_VFS_CREATE_FILE
2008-12-03 17:50:17 -08:00
e6a2ce970b s3:smbd: give the correct error when trying to replace a stream
metze
2008-12-01 14:23:30 -08:00
edde763d3f s3:smbd: correctly verify stream names to pass RAW-STREAMS
metze
2008-12-01 13:22:55 -08:00
49a8bd5e14 s3:smbd: '|' isn't allowed in windows filenames
metze
2008-12-01 13:01:09 -08:00
97fb05c2c0 First part of fix for bug #5903 - vfs_streams_xattr breaks contents of the file.
Restructures parts of open code so that fsp must be allocated before calling
open_file_ntcreate(_internal). Also fix up file ref-counting inside files.c.
Jeremy.
2008-11-21 12:14:53 -08:00
0baca66589 Fix bug 5889. "delete veto files = no" seems to break.
Jeremy.
2008-11-11 14:21:09 -08:00
8637dd1232 change CHECK_READ to use smb_request instead of inbuf 2008-11-08 10:42:28 +01:00
e4897a5376 Add construct_reply_common_req wrapper
The goal is to remove the remaining direct calls to construct_reply_common.
2008-11-04 20:52:06 +01:00
7808a2594c Remove some inbuf references by adding "cmd" to smb_request 2008-11-02 23:17:01 +01:00
792324bf5a Remove the inbuf reference from map_checkpath_error() 2008-11-02 22:38:03 +01:00
2bab73a18d Remove a bunch of direct inbuf references by adding "vwv" to smb_request 2008-11-02 16:58:19 +01:00
e48364af2f Rename "inbuf" to "base_ptr" in srvstr_get_path_* 2008-11-02 09:22:40 +01:00
af7cf4f992 Remove some direct inbuf references by adding smbreq_bufrem 2008-11-02 09:22:40 +01:00
a31fab8156 Simplify params of srvstr_pull_buf_talloc()
Now that "req" is available everywhere, use it. Rename srvstr_pull_buf_talloc()
to srvstr_pull_req()
2008-11-02 09:22:40 +01:00
2bd5ac86ff Add srvstr_get_path_req[_wcard] 2008-11-02 09:22:40 +01:00
7bdb571ec4 Remove a bunch of direct inbuf references by adding "buf" to smb_request 2008-11-01 19:41:08 +01:00
ac97d7d4b0 In reply_copy, don't write to inbuf when splitting directory and mask 2008-11-01 19:41:07 +01:00
cc546c0191 In reply_search(), don't write to inbuf when splitting directory and mask 2008-11-01 19:41:07 +01:00
ab0561f3c3 Apply some const to get_lock_*() 2008-11-01 19:41:07 +01:00
7f9d6f80ef Add a "buflen" struct member to smb_request
This removes some explicit inbuf references and also removes a pointless check
in reply_echo. The buflen can never be more than 64k, this is just a 16 bit
value.
2008-11-01 19:41:07 +01:00
2883c88ae4 Fix nonempty blank lines 2008-10-19 21:51:17 +02:00
ded09b28de Inline the once-used macro "init_dfsroot" 2008-10-19 11:36:32 +02:00
4746f79d50 Use {u,}int64_t instead of SMB_BIG_{U,}INT. 2008-10-14 01:59:36 +02:00
ac126ea818 Use "struct files_struct" for pipes instead of smb_np_struct 2008-10-13 20:59:32 +02:00
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
c3fedcddd5 Pass struct smb_request to file_new
Goal is to remove the chain_fsp global variable
2008-10-13 19:32:38 +02:00
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
be63f86ce7 Remove unused CHECK_FSP macro 2008-10-08 13:01:22 +02:00
f6c883b4b0 Simply our main loop processing. A lot :-). Correctly use events for all the previous "special" cases.
A step on the way to adding signals to the events and being able to merge the S3 event system with
the S4 one.
Jeremy.
2008-10-03 14:18:35 -07:00
97d57d0364 Fix the make test problem Karolin reported. Now rename_open_files actually works correctly we must emit the change notify before we change the name, not before.
Jeremy.
2008-09-30 13:26:41 -07:00
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
edd16eaa90 Slightly simplify logic: remove an else branch
(This used to be commit 56ecec5013)
2008-09-01 23:32:33 +02:00
1cae2ac905 Add st_birthtime and friends for accurate create times on systems that support it (*BSD and MacOSX).
Should have done this ages ago, sorry.
Jeremy.
(This used to be commit 4c3a955890)
2008-08-27 15:06:14 -07:00
39697d5745 EINVAL is also a valid error return, meaning "this filesystem
cannot do sendfile for this file"
(This used to be commit 737f664604)
2008-08-26 14:39:43 +02:00
a5cf8b9fb5 Fix for bug #5617, reported and patched by Bartosz Antosik antosik@gmail.com.
xp/2003 explorer freezes browsing shares on samba ipv6 hosts. Caused by missing
reply packet to SMB printclose packet.
Jeremy
(This used to be commit ecf2b906f4)
2008-08-14 11:22:47 +02:00
8b25ce06ce I found lots of places where we assume error will be set when calling
one of our virtualised functions, such as db_open(), but error is only
set when a system call fails, and it is not uncommon for us to fail a
function internally without ever making a system call. That led to us
passing back success when a function had in fact failed.

I found two places where we relied on map_nt_error_from_unix()
returning success when errno==0, but lots and lots of places where we
relied on the reverse, so I fixed those two places.

map_nt_error_from_unix() will now always return an error, returning
NT_STATUS_UNSUCCESSFUL if errno is 0
(cherry picked from commit 69d40ca4c1af925d4b0e59ddc69ef8c26e6501d1)
(This used to be commit 834684a524)
2008-08-12 21:37:16 +02:00