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

47341 Commits

Author SHA1 Message Date
Jeremy Allison
40df6f23f3 s3: smbd: Now struct smb_request has a bool posix_pathnames, remove the lp_posix_pathnames() call inside srvstr_get_path_req_wcard().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2015-12-23 18:23:17 +01:00
Jeremy Allison
4587d83f07 s3: smbd: VFS change. Add new field bool posix_pathnames into struct smb_request.
Initialize from lp_posix_pathnames() global.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2015-12-23 18:23:17 +01:00
Jeremy Allison
cc729ae47d s3: smbd: srvstr_get_path() is now only called when lp_posix_pathnames() is false.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2015-12-23 18:23:17 +01:00
Jeremy Allison
88bb4801c0 s3: smbd: Split all calls to srvstr_get_path() to calls to srvstr_get_path_posix() or srvstr_get_path() depending on lp_posix_pathnames().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2015-12-23 18:23:16 +01:00
Jeremy Allison
c78d73986d s3: smbd: Add srvstr_get_path_posix().
Not yet used, will be plumbed into existing callers of srvstr_get_path()
when lp_posix_pathnames() is true.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2015-12-23 18:23:16 +01:00
Jeremy Allison
5740761e78 s3: smbd: We now know that srvstr_get_path_wcard() is only called when lp_posix_pathnames() is false.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2015-12-23 18:23:16 +01:00
Jeremy Allison
41d62dfcb6 s3: smbd: Split all calls to srvstr_get_path_wcard() into srvstr_get_path_wcard_posix() or srvstr_get_path_wcard() depending on lp_posix_pathnames().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2015-12-23 18:23:16 +01:00
Jeremy Allison
eb7198f999 s3: smbd: Add srvstr_get_path_wcard_posix().
Allows us to call this directly and eventually remove the lp_posix_pathnames() call
from inside of srvstr_get_path_wcard().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2015-12-23 18:23:16 +01:00
Jeremy Allison
db36ee422b s3: smbd: Move lp_posix_pathnames() out into srvstr_get_path_req_wcard().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2015-12-23 18:23:16 +01:00
Jeremy Allison
5a34069875 s3: smbd: Move lp_posix_pathnames() out into srvstr_get_path().
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2015-12-23 18:23:16 +01:00
Jeremy Allison
4a6d7e1e15 s3: smbd: Move lp_posix_pathnames() out of srvstr_get_path_wcard_internal().
Pass as parameter. Part of moving this switch out to the external request
parsing code.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2015-12-23 18:23:16 +01:00
Volker Lendecke
f33224dbcf net: Fix Coverity ID 241039 Unchecked return value
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>

Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Wed Dec 23 17:17:53 CET 2015 on sn-devel-144
2015-12-23 17:17:53 +01:00
Jeremy Allison
431cf20160 s3: smbd: open_file: use FSP_POSIX_FLAGS_PATHNAMES
Start using FSP_POSIX_FLAGS_PATHNAMES instead of the kitchen sink
FSP_POSIX_FLAGS_OPEN.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Dec 23 10:37:07 CET 2015 on sn-devel-144
2015-12-23 10:37:07 +01:00
Ralph Boehme
58bebcb4bc smbd: file_struct: factor out POSIX pathname processing out of POSIX open
Factor out another POSIX cabability from file_struct.posix_flags
FSP_POSIX_FLAGS_OPEN.

Places that still use FSP_POSIX_FLAGS_OPEN when dealing with pathnames
can be converted later, because for the time being we always set
FSP_POSIX_FLAGS_ALL in file_struct.posix_flags.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-23 07:36:19 +01:00
Jeremy Allison
035bd5feb8 s3: smbd: Remove lp_posix_pathnames() from filename.c
Now correctly passed in everywhere as the UCF_POSIX_PATHNAMES flag.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Dec 23 06:31:28 CET 2015 on sn-devel-144
2015-12-23 06:31:28 +01:00
Jeremy Allison
993122aa2c s3: smbd: In trans2.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>
2015-12-23 03:31:11 +01:00
Jeremy Allison
274e8b5409 s3: smbd: In smb2_query_directory.c.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>
2015-12-23 03:31:10 +01:00
Jeremy Allison
31212e9587 s3: smbd: In smb2_create.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>
2015-12-23 03:31:10 +01:00
Jeremy Allison
dae4b37514 s3: smbd: In reply.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>
2015-12-23 03:31:10 +01:00
Jeremy Allison
6694c82c9a s3: smbd: In open.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>
2015-12-23 03:31:10 +01:00
Jeremy Allison
4ce5de5fd9 s3: smbd: In srv_srvsvc_nt.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>
2015-12-23 03:31:10 +01:00
Jeremy Allison
7641c69563 s3: smbd: In nttrans2.c, add in UCF_POSIX_PATHNAMES to the ucf_flags if lp_posix_pathnames() requested.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>
2015-12-23 03:31:10 +01:00
Jeremy Allison
acf6600132 s3: smbd: In smb2_query_directory.c Use ucf_flags variable instead of passing as parameter.
This will allow us to move lp_posix_pathnames() out of unix_convert()
later.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>
2015-12-23 03:31:10 +01:00
Jeremy Allison
c783db3ac9 s3: smbd: In smb2_create.c Use ucf_flags variable instead of passing as parameter.
This will allow us to move lp_posix_pathnames() out of unix_convert()
later.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>
2015-12-23 03:31:10 +01:00
Jeremy Allison
5d03e7550b s3: smbd: In srv_srvsvc_nt.c Use ucf_flags variable instead of passing as parameter.
This will allow us to move lp_posix_pathnames() out of unix_convert()
later.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>
2015-12-23 03:31:10 +01:00
Jeremy Allison
f3f3426f68 s3: smbd: In trans2.c Use ucf_flags variable instead of passing as parameter.
This will allow us to move lp_posix_pathnames() out of unix_convert()
later.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>
2015-12-23 03:31:10 +01:00
Jeremy Allison
b2c813f176 s3: smbd: In reply.c Use ucf_flags variable instead of passing as parameter.
This will allow us to move lp_posix_pathnames() out of unix_convert()
later.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>
2015-12-23 03:31:10 +01:00
Jeremy Allison
e5db6763d2 s3: smbd: In open.c Use ucf_flags variable instead of passing as parameter.
This will allow us to move lp_posix_pathnames() out of unix_convert()
later.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>
2015-12-23 03:31:10 +01:00
Jeremy Allison
5c183b22d1 s3: smbd: Use ucf_flags variable instead of passing as parameter.
This will allow us to move lp_posix_pathnames() out of unix_convert()
later.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <rb@sernet.de>
2015-12-23 03:31:09 +01:00
Marc Muehlfeld
5f407e3fb8 Fix typo in winbindd_cm.c
Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2015-12-23 03:31:09 +01:00
Ralph Boehme
00e952e3c6 s3: fix encryption help messages
Encryption is a SMB3 feature and not tied to UNIX extensions, so fix the
help messages of various utilities.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Dec 22 02:22:50 CET 2015 on sn-devel-144
2015-12-22 02:22:50 +01:00
Ralph Boehme
ee431fc525 vfs_fruit: ignore delete on the AFP_Resource stream
OS X ignores deletes on the AFP_Resource stream. This was discovered by
torture tests against OS X SMB server.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-21 23:21:18 +01:00
Ralph Boehme
f569fd5e44 vfs_fruit: fix offset and len handling for AFP_AfpInfo stream
When reading from the AFP_AfpInfo stream, OS X ignores the offset from
the request and always reads from offset=0.

The offset bounds check has a off-by-1 bug in OS X, so a request
offset=60 (AFP_AfpInfo stream has a ficed size of 60 bytes), len=1
returns 1 byte from offset 0 insteaf of returning 0.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-21 23:21:18 +01:00
Ralph Boehme
e94b17715e vfs_fruit: writing all 0 to AFP_AfpInfo stream
When writing all 0 to AFP_AfpInfo stream we can remove the underlying
storage object. This beaviour of OS X SMB server was found with a
torture test.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-21 23:21:18 +01:00
Ralph Boehme
4024153894 vfs_fruit: handling of ftruncate() on AFP_AfpInfo stream
With help of some torture tests I verified the following behaviour of OS
X SMB server:

* ftruncate AFP_AfpInfo stream > 60 bytes results in an error
  NT_STATUS_ALLOTTED_SPACE_EXCEEDED

* ftruncate AFP_AfpInfo stream <=60 returns success but has no effect

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-21 23:21:17 +01:00
Ralph Boehme
0af7bf4249 vfs_fruit: stat AFP_AfpInfo must fail when it doesn't exist
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-21 23:21:17 +01:00
Ralph Boehme
748adea77f vfs_fruit: fix some debug messages
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-21 23:21:17 +01:00
Ralph Boehme
1650e793ed s3:lib/errmap_unix: map EOVERFLOW to NT_STATUS_ALLOTTED_SPACE_EXCEEDED
vfs_fruit returns the correct error NT_STATUS_ALLOTTED_SPACE_EXCEEDED
when an attempt is made to extend the AFP_AfpInfo stream beyond 60
bytes.

This will be used in a subsequent commit in vfs_fruit.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-21 23:21:17 +01:00
Ralph Boehme
9d28f82484 s4:torture:vfs_fruit: remove unused tree2
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11347

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-21 23:21:16 +01:00
Volker Lendecke
bffcc17567 libads: Remove "foreign" from ads_struct
AFAICS this was never actually used

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-18 05:24:25 +01:00
Jeremy Allison
d7feb1879e s3: libsmb: Correctly initialize the list head when keeping a list of primary followed by DFS connections.
Greatly helped by <shargagan@novell.com> to
track down this issue.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11624

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Dec 18 01:02:55 CET 2015 on sn-devel-144
2015-12-18 01:02:55 +01:00
Jose A. Rivera
f27ba17fcf vfs_glusterfs: Fix a memory leak in AIO
Signed-off-by: Jose A. Rivera <jarrpa@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>

Autobuild-User(master): Ira Cooper <ira@samba.org>
Autobuild-Date(master): Thu Dec 17 20:55:22 CET 2015 on sn-devel-144
2015-12-17 20:55:22 +01:00
Stefan Metzmacher
55d8bfca9b s3:libsmb: remove unused spnego related includes
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Dec 17 17:49:14 CET 2015 on sn-devel-144
2015-12-17 17:49:14 +01:00
Stefan Metzmacher
fbcc30931c s3:smbd: remove unused spnego related includes
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Günther Deschner <gd@samba.org>
2015-12-17 14:45:13 +01:00
Stefan Metzmacher
aef4113823 CVE-2015-5296: s3:libsmb: force signing when requiring encryption in SMBC_server_internal()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11536

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-16 12:56:48 +01:00
Stefan Metzmacher
f8b0f7fd94 CVE-2015-5296: s3:libsmb: force signing when requiring encryption in do_connect()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11536

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-16 12:56:48 +01:00
Jeremy Allison
acbb4ddb68 CVE-2015-5299: s3-shadow-copy2: fix missing access check on snapdir
Fix originally from <partha@exablox.com>

https://bugzilla.samba.org/show_bug.cgi?id=11529

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2015-12-16 12:56:48 +01:00
Jeremy Allison
cc137fa386 CVE-2015-5252: s3: smbd: Fix symlink verification (file access outside the share).
New tests for fix.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11395

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-12-16 12:56:48 +01:00
Jeremy Allison
7606c0db25 CVE-2015-5252: s3: smbd: Fix symlink verification (file access outside the share).
Ensure matching component ends in '/' or '\0'.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11395

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2015-12-16 12:56:48 +01:00
Ralph Boehme
2058ce246e smbd: make "hide dot files" option work with "store dos attributes = yes"
When using "store dos attributes = yes", the function that reads the
attributes from the xattr get_ea_dos_attribute() will overwrite the
attribute previously set for "hide dot files".

According to smb.conf, "store dos attributes = yes" should only
overwrite the "map XXX" options, but not "hide dot files".

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11645

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Dec 16 07:21:10 CET 2015 on sn-devel-104
2015-12-16 07:21:10 +01:00