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

1017 Commits

Author SHA1 Message Date
Ralph Boehme
2236883cde s3:smbd: add SMB_VFS_READDIR_ATTR() to marshall direntry
SMB_VFS_READDIR_ATTR is a last minute hook to fetch additional metadata
for a directory entry when we're already marshalling the SMB reply buffer.

This would we used, when there's a need to repurpose some fields in the
the reply, like it's done with Apple's SMB2 extension "AAPL".

We then fetch AAPL metadata with the shiny new SMB_VFS_READDIR_ATTR()
VFS call and marshall appropiately.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-04 22:11:08 +01:00
Ralph Boehme
142db4048f s3:vfs: add create tags to SMB_VFS_CREATEFILE
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-12-04 22:11:07 +01:00
Stefan Metzmacher
d8cffad8e0 s3:smbd: pass smbXsrv_connection to open_was_deferred()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:12 +02:00
Stefan Metzmacher
4b9f17eca7 s3:smbd: pass smbXsrv_connection to srv_send_smb()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-19 09:15:11 +02:00
Jeremy Allison
6d03aed15e s3: smbd: Fix a couple of tricky slow-path cases - don't return a mangled name for a name that cannot be converted.
For a name that contains an illegal Windows character, the
directory listing code returns the mangled 8.3 name as the
primary name for the file.

If the original (non-mangled) filename cannot be converted
to UCS2 on the wire via iconv due to conversion error, we
should skip that name when returning a directory listing,
as we can't map back from a returned 8.3 name to a usable
non-mangled filename if the client sends it back to us.

As this is only done in a very slow path (name must be mangled)
or in the old DOS protocol listing code I don't feel too bad
about using a talloc/free pair here.

Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-09-16 01:56:55 +02:00
Jeremy Allison
2fc8d0e0e8 s3: smbd: Change get_lanman2_dir_entry() to return the full NTSTATUS.
Handle the errors correctly at the level above inside the SMB1 server.

Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-09-16 01:56:55 +02:00
Jeremy Allison
c9877eaf1b s3: smbd: Remove unneeded 'out_of_space' parameter from smbd_dirptr_lanman2_entry().
This can now be handled by checking for the STATUS_MORE_ENTRIES error return.

Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-09-16 01:56:55 +02:00
Jeremy Allison
5293dd2f63 s3: smbd: SMB2 - change smbd_dirptr_lanman2_entry() to return an NTSTATUS.
Handle the errors correctly at the top level inside the SMB2 server.

Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-09-16 01:56:55 +02:00
Jeremy Allison
d17fc79ee6 s3: smbd: smbd_marshall_dir_entry() no longer needs explicit 'out_of_space' parameter.
Handle this in the caller when it returns STATUS_MORE_ENTRIES.

Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-09-16 01:56:54 +02:00
Jeremy Allison
2bddcee5cb s3: smbd: Change smbd_marshall_dir_entry() to return an NTSTATUS. Returns STATUS_MORE_ENTRIES on out of space.
Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-09-16 01:56:54 +02:00
Jeremy Allison
0519088c53 s3: smbd: Change the function signature of srvstr_push() from returning a length to returning an NTSTATUS with a length param.
srvstr_push_fn() now returns an NTSTATUS reporting any
string conversion failure.

We need to get serious about returning character set conversion errors
inside smbd.

Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-09-16 01:56:54 +02:00
Jeremy Allison
c7b89bb9e5 s3: smbd: Ensure types for all variables called 'len' used in srvstr_push() are correct.
Bug 10775 - smbd crashes when accessing garbage filenames

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-09-16 01:56:54 +02:00
Volker Lendecke
446de4f680 vfs3: Pass "lease" through SMB_VFS_CREATE_FILE
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-11 21:11:16 +02:00
Stefan Metzmacher
967ff180f7 s3:smbd: use req->xconn to send_trans2_replies()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 09:51:13 +02:00
Stefan Metzmacher
3437da2154 s3:smbd: remove unused 'sconn' in call_trans2setfsinfo()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 09:51:13 +02:00
Stefan Metzmacher
5159038905 s3:smbd: pass smbXsrv_connection to smbd_do_qfsinfo()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 09:51:13 +02:00
Stefan Metzmacher
c6c7532718 s3:smbd: move sconn->smb1.unix_info.* to xconn->smb1.unix_info.*
This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 09:51:11 +02:00
Stefan Metzmacher
b0fe6c5c9d s3:smbd: move sconn->smb1.echo_handler.* to xconn->smb1.echo_handler.*
This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 09:51:11 +02:00
Stefan Metzmacher
314ef691ba s3:smbd: move sconn->smb1.signing_state to xconn->smb1.signing_state
This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 09:51:11 +02:00
Stefan Metzmacher
7cf7fd77f7 s3:smbd: move sconn->smb1.sessions.* to xconn->smb1.sessions.*
This prepares the structures for multi-channel support.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-08-06 09:51:11 +02:00
Volker Lendecke
b3d1d56b5e smbd/nmbd: Remove HAVE_LONGLONG
We always have 64-bit variables available by now

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-22 15:32:39 +02:00
Volker Lendecke
618b6fdef8 smbd: Use BVAL
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-07 16:08:12 +02:00
Volker Lendecke
f038cf739d smbd: do_lock does not need "blr" anymore
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-04 06:31:16 +02:00
Ralph Boehme
f03e8b12c6 Convert samba_private_attr_name() to a public function
Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-13 13:22:18 +02:00
Garming Sam
0c8e9cc757 param: add const to a local variable to prevent a warning about lp_fstype
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Change-Id: Idc9217eb812b018fed933f84c2c4f1818f8f9372
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
2014-02-20 10:11:28 +13:00
Garming Sam
f38b1dbbe5 param: change fstype to use a constant string
Substitution isn't really necessary for this parameter.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-02-12 13:17:14 +13:00
Garming Sam
51f8a24d26 param: rename lp function and variable from "inherit_perms" to "inherit_permissions"
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-07 16:19:15 -08:00
Garming Sam
5f4159b25b param: rename lp function and variable from "symlinks" to "follow_symlinks"
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-07 16:19:13 -08:00
Garming Sam
617d9acf70 param: rename lp function and variable from 'manglednames' to 'mangled_names'
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-07 16:19:09 -08:00
Garming Sam
60d46fff75 param: rename lp function and variable from 'dontdescend' to 'dont_descend'
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-07 16:19:09 -08:00
Garming Sam
904a235832 param: rename lp function and variable from 'force_dir_mode' to 'force_directory_mode'
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-02-07 16:19:09 -08:00
Michael Adam
43d59d5cc4 loadparm: rename lp[cfg]_dir_mask to lp[cfg]_directory_mask for consistency with docs
Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2014-02-03 13:27:25 +13:00
Volker Lendecke
a9753c180f smbd: Fix a false DEBUG fn name
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-12-14 10:04:37 +01:00
Volker Lendecke
451cde7f2a smbd: Fix a const warning
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-06 13:39:41 +02:00
Volker Lendecke
196da5925b smbd: Remove FORCE_OPLOCK_BREAK_TO_NONE
This flag existed to break an exclusive or batch oplock in just one
instead of two steps down to "no oplock" when we did an allocation or file
size change.  Running raw.oplock against W2k12 differs in this respect
from W2k3: W2k12 takes two steps (via level2) to break to none. This
removes the special flag that we only had for compatibility with systems
older than W2k12...

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

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Sep  6 00:47:07 CEST 2013 on sn-devel-104
2013-09-06 00:47:07 +02:00
Volker Lendecke
1b1935b876 smbd: Correctly return INFO_LENGTH_MISMATCH for smb1
This is required if the client offered less buffer than the fixed portion
of the info level data requires

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-28 23:37:08 +02:00
Volker Lendecke
5634f240fd smbd: Fix error return for STREAM_INFO
The stream_info marshalling follows its own rules. This needs unifying
eventually...

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-28 23:37:08 +02:00
Volker Lendecke
ac41df91a5 smbd: qfsinfo has fixed/variable buffers
The error message will have to change depending whether the buffer is
too small for the fixed or variable buffers

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-28 23:37:08 +02:00
Volker Lendecke
5312399603 smbd: qfilepathinfo has fixed/variable buffers
The error message will have to change depending whether the buffer is
too small for the fixed or variable buffers

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10106
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-28 23:37:08 +02:00
Jeremy Allison
d1593a20f3 Fix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN.
UNIX extensions calls must never deref links.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Aug 26 20:19:46 CEST 2013 on sn-devel-104
2013-08-26 20:19:46 +02:00
Jeremy Allison
f1ff97fc02 Allow UNIX extensions client to act on open fsp instead of pathname if available.
Eliminates possible race condition on pathname op.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
2013-08-26 09:01:22 -07:00
Jeremy Allison
bd0156988b Fix the erroneous masking of chmod requests via the UNIX extensions.
Changed from switch statement to if, as "create mask", "force create mode"
are only applied to new files, not existing ones. "directory mask",
"force directory mode" are only applied to new directories, not existing
ones.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
2013-08-26 09:01:16 -07:00
Jeremy Allison
84b8bddd7d Revert "Fix the erroneous masking of chmod requests via the UNIX extensions."
Pushed from the wrong branch - this is the version
without Simo's review changes. Apologies to all
and I'll re-submit in less of a haste after the
weekend.

This reverts commit f124d6fbcd.

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Aug 25 05:44:11 CEST 2013 on sn-devel-104
2013-08-25 05:44:10 +02:00
Jeremy Allison
8e299634d9 Revert "Allow UNIX extensions client to act on open fsp instead of pathname if available."
Pushed from the wrong branch - this is the version
without Simo's review changes. Apologies to all
and I'll re-submit in less of a haste after the
weekend.

This reverts commit ce776551ab.
2013-08-24 18:44:20 -07:00
Jeremy Allison
9cbd4fcd1e Pushed from the wrong branch - this is the version
without Simo's review changes. Apologies to all
and I'll re-submit in less of a haste after the
weekend.

Revert "Fix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN."

This reverts commit cf86adc441.
2013-08-24 18:43:29 -07:00
Jeremy Allison
cf86adc441 Fix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN.
UNIX calls never deref links.

Signed-off-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun Aug 25 01:02:40 CEST 2013 on sn-devel-104
2013-08-25 01:02:40 +02:00
Jeremy Allison
ce776551ab Allow UNIX extensions client to act on open fsp instead of pathname if available.
Eliminates possible race condition on pathname op.

Signed-off-by: Jeremy Allison <jra@samba.org>
2013-08-24 14:04:47 -07:00
Jeremy Allison
f124d6fbcd Fix the erroneous masking of chmod requests via the UNIX extensions.
Signed-off-by: Jeremy Allison <jra@samba.org>
2013-08-24 14:04:47 -07:00
Volker Lendecke
83d1495e58 smbd: Fix a debug message
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-23 09:48:21 -07:00
Richard Sharpe
74829fecd7 Fix bug #10097 - MacOSX 10.9 will not follow path-based DFS referrals handed out by Samba.
Windows overloads the EA Length field in the DIRECTORY INFO leves of FIND FIRST/FIND NEXT.

This field indicates either the REPARSE_TAG if the file/folder has a reparse proint or
the EA Length if it has EAs, and is the fundamental reason you cannot have both on a
file or folder.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Aug 19 22:21:34 CEST 2013 on sn-devel-104
2013-08-19 22:21:34 +02:00