summaryrefslogtreecommitdiffstats
path: root/source3/smbd/trans2.c
Commit message (Collapse)AuthorAgeFilesLines
* smbd: ZERO_STRUCT -> struct initVolker Lendecke2015-02-261-6/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Fix a typoVolker Lendecke2015-02-241-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3/vfs: remove unused SMB_VFS_DISK_FREE() small_query parameterDavid Disseldorp2015-02-171-3/+10
| | | | | | | | | | | | | | | The small_query parameter for SMB_VFS_DISK_FREE() was, prior to the previous commit, used to obtain 16-bit wide free-space information for the deprecated dskattr SMB_COM_QUERY_INFORMATION_DISK command. With the dskattr handler now performing the 16-bit collapse directly, the small_query parameter can be removed from the entire code path. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Feb 17 05:37:20 CET 2015 on sn-devel-104
* s3:smbd: add SMB_VFS_READDIR_ATTR() to marshall direntryRalph Boehme2014-12-041-6/+58
| | | | | | | | | | | | | | 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>
* s3:vfs: add create tags to SMB_VFS_CREATEFILERalph Boehme2014-12-041-6/+12
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: pass smbXsrv_connection to open_was_deferred()Stefan Metzmacher2014-09-191-2/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: pass smbXsrv_connection to srv_send_smb()Stefan Metzmacher2014-09-191-3/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3: smbd: Fix a couple of tricky slow-path cases - don't return a mangled ↵Jeremy Allison2014-09-161-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* s3: smbd: Change get_lanman2_dir_entry() to return the full NTSTATUS.Jeremy Allison2014-09-161-20/+32
| | | | | | | | | | | 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>
* s3: smbd: Remove unneeded 'out_of_space' parameter from ↵Jeremy Allison2014-09-161-4/+6
| | | | | | | | | | | | | 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>
* s3: smbd: SMB2 - change smbd_dirptr_lanman2_entry() to return an NTSTATUS.Jeremy Allison2014-09-161-6/+8
| | | | | | | | | | | 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>
* s3: smbd: smbd_marshall_dir_entry() no longer needs explicit 'out_of_space' ↵Jeremy Allison2014-09-161-7/+1
| | | | | | | | | | | | | 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>
* s3: smbd: Change smbd_marshall_dir_entry() to return an NTSTATUS. Returns ↵Jeremy Allison2014-09-161-23/+24
| | | | | | | | | | | 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>
* s3: smbd: Change the function signature of srvstr_push() from returning a ↵Jeremy Allison2014-09-161-49/+125
| | | | | | | | | | | | | | | | | 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>
* s3: smbd: Ensure types for all variables called 'len' used in srvstr_push() ↵Jeremy Allison2014-09-161-12/+10
| | | | | | | | | | | 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>
* vfs3: Pass "lease" through SMB_VFS_CREATE_FILEVolker Lendecke2014-08-111-0/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: use req->xconn to send_trans2_replies()Stefan Metzmacher2014-08-061-2/+2
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: remove unused 'sconn' in call_trans2setfsinfo()Stefan Metzmacher2014-08-061-2/+1
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: pass smbXsrv_connection to smbd_do_qfsinfo()Stefan Metzmacher2014-08-061-3/+3
| | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: move sconn->smb1.unix_info.* to xconn->smb1.unix_info.*Stefan Metzmacher2014-08-061-11/+11
| | | | | | | | 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>
* s3:smbd: move sconn->smb1.echo_handler.* to xconn->smb1.echo_handler.*Stefan Metzmacher2014-08-061-1/+2
| | | | | | | | 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>
* s3:smbd: move sconn->smb1.signing_state to xconn->smb1.signing_stateStefan Metzmacher2014-08-061-2/+3
| | | | | | | | 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>
* s3:smbd: move sconn->smb1.sessions.* to xconn->smb1.sessions.*Stefan Metzmacher2014-08-061-1/+2
| | | | | | | | 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>
* smbd/nmbd: Remove HAVE_LONGLONGVolker Lendecke2014-07-221-15/+0
| | | | | | | We always have 64-bit variables available by now Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Use BVALVolker Lendecke2014-07-071-8/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: do_lock does not need "blr" anymoreVolker Lendecke2014-07-041-2/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Convert samba_private_attr_name() to a public functionRalph Boehme2014-06-131-1/+1
| | | | | | Signed-off-by: Ralph Boehme <rb@sernet.de> Reviewed-by: Christof Schmitt <cs@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* param: add const to a local variable to prevent a warning about lp_fstypeGarming Sam2014-02-201-1/+1
| | | | | | | 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>
* param: change fstype to use a constant stringGarming Sam2014-02-121-2/+2
| | | | | | | | 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>
* param: rename lp function and variable from "inherit_perms" to ↵Garming Sam2014-02-071-1/+1
| | | | | | | | "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>
* param: rename lp function and variable from "symlinks" to "follow_symlinks"Garming Sam2014-02-071-1/+1
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: rename lp function and variable from 'manglednames' to 'mangled_names'Garming Sam2014-02-071-1/+1
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: rename lp function and variable from 'dontdescend' to 'dont_descend'Garming Sam2014-02-071-4/+4
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* param: rename lp function and variable from 'force_dir_mode' to ↵Garming Sam2014-02-071-1/+1
| | | | | | | | '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>
* loadparm: rename lp[cfg]_dir_mask to lp[cfg]_directory_mask for consistency ↵Michael Adam2014-02-031-1/+1
| | | | | | | | | 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>
* smbd: Fix a false DEBUG fn nameVolker Lendecke2013-12-141-2/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Fix a const warningVolker Lendecke2013-09-061-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* smbd: Remove FORCE_OPLOCK_BREAK_TO_NONEVolker Lendecke2013-09-061-3/+2
| | | | | | | | | | | | | | | 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
* smbd: Correctly return INFO_LENGTH_MISMATCH for smb1Volker Lendecke2013-08-281-0/+4
| | | | | | | | | 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>
* smbd: Fix error return for STREAM_INFOVolker Lendecke2013-08-281-0/+4
| | | | | | | | | 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>
* smbd: qfsinfo has fixed/variable buffersVolker Lendecke2013-08-281-0/+10
| | | | | | | | | 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>
* smbd: qfilepathinfo has fixed/variable buffersVolker Lendecke2013-08-281-0/+22
| | | | | | | | | 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>
* Fix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN.Jeremy Allison2013-08-261-6/+20
| | | | | | | | | | 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
* Allow UNIX extensions client to act on open fsp instead of pathname if ↵Jeremy Allison2013-08-261-1/+8
| | | | | | | | | available. Eliminates possible race condition on pathname op. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Simo Sorce <idra@samba.org>
* Fix the erroneous masking of chmod requests via the UNIX extensions.Jeremy Allison2013-08-261-8/+10
| | | | | | | | | | 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>
* Revert "Fix the erroneous masking of chmod requests via the UNIX extensions."Jeremy Allison2013-08-251-2/+7
| | | | | | | | | | | | 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 f124d6fbcd0a03bbd95d69477c144f475546de66. Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sun Aug 25 05:44:11 CEST 2013 on sn-devel-104
* Revert "Allow UNIX extensions client to act on open fsp instead of pathname ↵Jeremy Allison2013-08-241-8/+1
| | | | | | | | | | | 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 ce776551abb07f18cf302ee7c0c437ee27952099.
* Pushed from the wrong branch - this is the versionJeremy Allison2013-08-241-14/+6
| | | | | | | | | | 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 cf86adc4419f2636a0b24824ab04ebfcd5bb074d.
* Fix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN.Jeremy Allison2013-08-251-6/+14
| | | | | | | | | 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
* Allow UNIX extensions client to act on open fsp instead of pathname if ↵Jeremy Allison2013-08-241-1/+8
| | | | | | | | available. Eliminates possible race condition on pathname op. Signed-off-by: Jeremy Allison <jra@samba.org>