1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-15 23:24:37 +03:00

963 Commits

Author SHA1 Message Date
Stefan Metzmacher
e6a2ce970b s3:smbd: give the correct error when trying to replace a stream
metze
2008-12-01 14:23:30 -08:00
Stefan Metzmacher
edde763d3f s3:smbd: correctly verify stream names to pass RAW-STREAMS
metze
2008-12-01 13:22:55 -08:00
Stefan Metzmacher
49a8bd5e14 s3:smbd: '|' isn't allowed in windows filenames
metze
2008-12-01 13:01:09 -08:00
Jeremy Allison
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
Jeremy Allison
0baca66589 Fix bug 5889. "delete veto files = no" seems to break.
Jeremy.
2008-11-11 14:21:09 -08:00
Volker Lendecke
8637dd1232 change CHECK_READ to use smb_request instead of inbuf 2008-11-08 10:42:28 +01:00
Volker Lendecke
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
Volker Lendecke
7808a2594c Remove some inbuf references by adding "cmd" to smb_request 2008-11-02 23:17:01 +01:00
Volker Lendecke
792324bf5a Remove the inbuf reference from map_checkpath_error() 2008-11-02 22:38:03 +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
Volker Lendecke
e48364af2f Rename "inbuf" to "base_ptr" in srvstr_get_path_* 2008-11-02 09:22:40 +01:00
Volker Lendecke
af7cf4f992 Remove some direct inbuf references by adding smbreq_bufrem 2008-11-02 09:22:40 +01:00
Volker Lendecke
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
Volker Lendecke
2bd5ac86ff Add srvstr_get_path_req[_wcard] 2008-11-02 09:22:40 +01:00
Volker Lendecke
7bdb571ec4 Remove a bunch of direct inbuf references by adding "buf" to smb_request 2008-11-01 19:41:08 +01:00
Volker Lendecke
ac97d7d4b0 In reply_copy, don't write to inbuf when splitting directory and mask 2008-11-01 19:41:07 +01:00
Volker Lendecke
cc546c0191 In reply_search(), don't write to inbuf when splitting directory and mask 2008-11-01 19:41:07 +01:00
Volker Lendecke
ab0561f3c3 Apply some const to get_lock_*() 2008-11-01 19:41:07 +01:00
Volker Lendecke
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
Volker Lendecke
2883c88ae4 Fix nonempty blank lines 2008-10-19 21:51:17 +02:00
Volker Lendecke
ded09b28de Inline the once-used macro "init_dfsroot" 2008-10-19 11:36:32 +02: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
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
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
Volker Lendecke
be63f86ce7 Remove unused CHECK_FSP macro 2008-10-08 13:01:22 +02:00
Jeremy Allison
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
Jeremy Allison
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
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 6f20585419046c4aca1f7d6c863cf79eb6ae53b0)
2008-09-05 19:00:48 -07:00
Volker Lendecke
edd16eaa90 Slightly simplify logic: remove an else branch
(This used to be commit 56ecec50130aa948a431427285aed4b28a5647e8)
2008-09-01 23:32:33 +02:00
Jeremy Allison
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 4c3a9558906f213948c3bdc081be73f8fed148cb)
2008-08-27 15:06:14 -07:00
Andrew Tridgell
39697d5745 EINVAL is also a valid error return, meaning "this filesystem
cannot do sendfile for this file"
(This used to be commit 737f664604b28f230be63bfc2f3d516fd9eb1c63)
2008-08-26 14:39:43 +02:00
Jeremy Allison
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 ecf2b906f476e4a764d0e53eed84b9b75a2062c0)
2008-08-14 11:22:47 +02:00
Andrew Tridgell
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 834684a524a24bb4eb46b4af583d39947dc87d95)
2008-08-12 21:37:16 +02:00
Volker Lendecke
a235676dd1 Fix a debug message
(This used to be commit 1970eed1b79a5d9dc45eb96098d653ad62a20871)
2008-07-27 18:41:19 +02:00
Volker Lendecke
b117e10394 Remove a pointless CONST_DISCARD
(This used to be commit c63cb78b4c8a283c0eebe37ff2f60ddbfbfaac4a)
2008-07-27 18:37:00 +02:00
Jeremy Allison
ee49e0391f Fix bug creating files using DOS clients with mixed
case files. Reported by Daniel Johnson <Progman2000@usa.net>.
The smb_set_file_time() call to set the filetimes is failing
because it's using the unmodified name passed in by the
client, not the modified name (matching case on the
disk) that comes out from create_file().
Jeremy.
(This used to be commit 1706a33e78347d14a8b09fd21b87d57bad543bcd)
2008-07-25 13:16:18 -07:00
Volker Lendecke
c885ae01eb Remove current_user reference from printfsp.c
(This used to be commit 510f45d01a19ce1c226755ac42a328241098b2e0)
2008-06-26 13:13:23 +02: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 5595cdf837edb82db69a3e57bcf3108be7feeeb8)
2008-06-19 18:51:38 +02:00
Volker Lendecke
f1cd0bdbcc Remove reference to current_user from reply.c
(This used to be commit e895e44cc7d675d128430fb53c138e5e8736e59f)
2008-06-19 18:51:38 +02:00
Volker Lendecke
e40b6e296a Remove the "current_user" arg from fsp_belongs_conn
fsp_belongs_conn only used the vuid struct member anyway, and this is available
in the smb_request structure as well.
(This used to be commit 64e9372ab997739d46669c0cc4a4c6edb11d5e64)
2008-06-19 18:51:37 +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 8d364c4c3311b406847158fc37e9208d298cf8ba)
2008-06-19 18:51:37 +02:00
Günther Deschner
ee8dffbca6 Fix the build of reply_setattrE().
How ever could this compile ?

Guenther
(This used to be commit 02f5f35e5ed3b061cfd020d0b13014c72fced5f4)
2008-04-08 21:41:16 +02:00
Stefan Metzmacher
19f49de92e smbd: make it possible to disable get_file_infos() on searches
metze
(This used to be commit 404a865a34c3a7c67131b3f99e92c11b2abe3e39)
2008-04-07 12:29:30 +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 2eab212ea2e1bfd8fa716c2c89b2c042f7ba12ea)
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 6aaa2ce0eeb46f6735ec984a2e7aadde7a7f456d)
2008-04-07 12:29:25 +02:00
Jeremy Allison
43fdd1748c Fix missing '&&'.
Jeremy.
(This used to be commit 251df53811e4272b629575a4b50c29a99715ccf9)
2008-03-28 17:32:52 -07:00
Jeremy Allison
e00bfc5092 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.
(This used to be commit eef53e9603d4f3d892ffe00b061def5d717ca481)
2008-03-28 17:31:06 -07:00
Volker Lendecke
afa682943c printclose has only 1 vwv
(This used to be commit 99d980125054cbfef8ec85a31e83aa18a6e0bce3)
2008-03-28 13:44:30 +01:00