summaryrefslogtreecommitdiff
path: root/source3/smbd/trans2.c
AgeCommit message (Collapse)AuthorFilesLines
2013-09-06smbd: Fix a const warningVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2013-09-06smbd: Remove FORCE_OPLOCK_BREAK_TO_NONEVolker Lendecke1-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
2013-08-28smbd: Correctly return INFO_LENGTH_MISMATCH for smb1Volker Lendecke1-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>
2013-08-28smbd: Fix error return for STREAM_INFOVolker Lendecke1-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>
2013-08-28smbd: qfsinfo has fixed/variable buffersVolker Lendecke1-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>
2013-08-28smbd: qfilepathinfo has fixed/variable buffersVolker Lendecke1-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>
2013-08-26Fix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN.Jeremy Allison1-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
2013-08-26Allow UNIX extensions client to act on open fsp instead of pathname if ↵Jeremy Allison1-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>
2013-08-26Fix the erroneous masking of chmod requests via the UNIX extensions.Jeremy Allison1-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>
2013-08-25Revert "Fix the erroneous masking of chmod requests via the UNIX extensions."Jeremy Allison1-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
2013-08-24Revert "Allow UNIX extensions client to act on open fsp instead of pathname ↵Jeremy Allison1-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.
2013-08-24Pushed from the wrong branch - this is the versionJeremy Allison1-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.
2013-08-25Fix the UNIX extensions CHOWN calls to use FCHOWN if available, else LCHOWN.Jeremy Allison1-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
2013-08-24Allow UNIX extensions client to act on open fsp instead of pathname if ↵Jeremy Allison1-1/+8
available. Eliminates possible race condition on pathname op. Signed-off-by: Jeremy Allison <jra@samba.org>
2013-08-24Fix the erroneous masking of chmod requests via the UNIX extensions.Jeremy Allison1-7/+2
Signed-off-by: Jeremy Allison <jra@samba.org>
2013-08-23smbd: Fix a debug messageVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-08-19Fix bug #10097 - MacOSX 10.9 will not follow path-based DFS referrals handed ↵Richard Sharpe1-6/+13
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-15s3:lib: Factor read_ea_list_entry() and read_nttrans_ea_list() out so they ↵Jeremy Allison1-61/+1
can be used by the SMB2 client code. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-08-05s3:smbd: allow info class SMB_QUERY_FS_ATTRIBUTE_INFO to return partial dataRalph Wuerthner1-0/+6
Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2013-08-05s3:smbd: allow info class SMB_QUERY_FS_VOLUME_INFO to return partial dataRalph Wuerthner1-0/+6
Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2013-08-05s3:smbd: allow status code in smbd_do_qfsinfo() to be set by information ↵Ralph Wuerthner1-1/+2
class handler Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
2013-08-04Ensure we can never integer wrap when working on client-supplied max_data_bytes.Jeremy Allison1-0/+22
This would only be possible with SMB2, and is already checked in the upper SMB2 layers, but it really doesn't hurt to have these extra checks at time of use also. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Sun Aug 4 16:54:04 CEST 2013 on sn-devel-104
2013-07-19Reply with correct trans2 message on a setpathinfo with a bad EA name.Jeremy Allison1-1/+10
Bug 9992 - Windows error 0x800700FE when copying files with xattr names containing ":" Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-07-19Ensure we can't create a file using TRANS2_OPEN with an invalid EA list.Jeremy Allison1-0/+14
Bug 9992 - Windows error 0x800700FE when copying files with xattr names containing ":" Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-07-19Add the ability to send an NTSTATUS result back with a trans2 reply so we ↵Jeremy Allison1-13/+30
can return a parameter block with an error code. This is needed when returning a STATUS_INVALID_NAME result (tested from Windows 2012). Bug 9992 - Windows error 0x800700FE when copying files with xattr names containing ":" Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-07-19Ensure we never return an EA name to a Windows client it can't handle.Jeremy Allison1-0/+9
Bug 9992 - Windows error 0x800700FE when copying files with xattr names containing ":" Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-07-19Ensure set_ea cannot set invalid Windows EA names.Jeremy Allison1-0/+9
Bug 9992 - Windows error 0x800700FE when copying files with xattr names containing ":" Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-04-17smbd: Convert smb_file_rename_information to synthetic_smb_fnameVolker Lendecke1-5/+4
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17smbd: Convert smb_file_rename_information to synthetic_smb_fnameVolker Lendecke1-4/+5
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17smbd: Convert smb2_file_rename_information to synthetic_smb_fnameVolker Lendecke1-4/+5
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17smbd: Convert smb_set_file_dosmode to synthetic_smb_fnameVolker Lendecke1-6/+5
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17smbd: Convert call_trans2qfilepathinfo to synthetic_smb_fnameVolker Lendecke1-8/+6
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17smbd: Convert call_trans2setfilepathinfo to cp_smb_filenameVolker Lendecke1-4/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17smbd: Convert smb_set_file_unix_basic to cp_smb_filenameVolker Lendecke1-4/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17smbd: Convert smb_set_file_size to cp_smb_filenameVolker Lendecke1-3/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-17smbd: Convert call_trans2qfilepathinfo to cp_smb_filenameVolker Lendecke1-4/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-04-02Ensure EA value is allocated on the right context.Jeremy Allison1-1/+2
Ensure we free on error condition (tidyup, not a leak). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@suse.de> Autobuild-User(master): David Disseldorp <ddiss@samba.org> Autobuild-Date(master): Tue Apr 2 21:54:33 CEST 2013 on sn-devel-104
2013-04-02Final fix for bug #9130 - Certain xattrs cause Windows error 0x800700FFJeremy Allison1-1/+1
The spec lies when it says that NextEntryOffset is the only value considered when finding the next EA. We were adding 4 more extra pad bytes than needed (i.e. if the next entry already was on a 4 byte boundary, then we were adding 4 additional pad bytes). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@suse.de>
2013-04-02Ensure we don't return uninitialized memory in the pad bytes.Jeremy Allison1-1/+7
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@suse.de>
2013-04-02Fix bug #9130 - Certain xattrs cause Windows error 0x800700FFJeremy Allison1-0/+9
Ensure we never return any zero-length EA's. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@suse.de>
2013-04-02Change estimate_ea_size() to correctly estimate the EA size over SMB2.Jeremy Allison1-0/+20
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@suse.de>
2013-04-02Modify fill_ea_chained_buffer() to be able to do size calculation only, no ↵Jeremy Allison1-12/+15
marshalling. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@suse.de>
2013-04-02Ensure we can never return an uninitialized EA list.Jeremy Allison1-1/+2
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: David Disseldorp <ddiss@suse.de>
2013-02-12Fix bug 9519 - Samba returns unexpected error on SMB posix open.Jeremy Allison1-2/+9
Explicitly ignore bare O_EXCL flags instead of returning INVALID_PARAMETER. That's what the Linux kernel does. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Jeff Layton <jlayton@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Feb 12 22:59:21 CET 2013 on sn-devel-104
2013-02-08s3: Make SMB2_GETINFO multi-volume aware.Ira Cooper1-9/+18
Not all shares are a single volume. Some actually expose multiple volumes under a single share. In these cases showing the amount of space free as the space free at the base of the directory heirarchy is wrong. Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Feb 8 21:44:37 CET 2013 on sn-devel-104
2013-01-28Fix bug #9571 - Unlink after open causes smbd to panic.Pavel Shilovsky1-3/+3
s3:smbd: fix wrong lock order in posix unlink Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-12-06Fix bug #9460 - Samba 3.6.x and Master respond incorrectly to ↵Richard Sharpe1-1/+22
FILE_STREAM_INFO requests. Ensure we check the buffer size correctly. Reviewed by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Dec 6 01:31:08 CET 2012 on sn-devel-104
2012-10-11smbd: Add mem_ctx to sys_acl_init() and all callersAndrew Bartlett1-4/+8
This changes from allocation on NULL to allocation on the supplied memory context. Currently that supplied context is talloc_tos() at the the final consumer of the ACL. Andrew Bartlett
2012-10-04Remove all uses of ↵Jeremy Allison1-12/+2
lp_security_mask/lp_force_security_mode/lp_dir_security_mask/lp_force_dir_security_mode and replace with the normal masks. Now these parameters can be removed.
2012-09-14Add bool use_privs parameter to smbd_check_access_rights()Jeremy Allison1-0/+1
If this is set we should use it in preference to blindly assuming root can do anything. Currently set to 'false' in (most) callers.