summaryrefslogtreecommitdiffstats
path: root/source3/smbd/nttrans.c
Commit message (Collapse)AuthorAgeFilesLines
* s3:smbd: pass smbXsrv_connection to open_was_deferred()Stefan Metzmacher2014-09-191-3/+3
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: use req->sconn in reply_ntcancel()Stefan Metzmacher2014-09-191-1/+1
| | | | | | | xconn->sconn will go away soon. 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 comment typoRalph Boehme2014-09-091-1/+1
| | | | | | Signed-off-by: Ralph Boehme <rb@sernet.de> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
* s3:smbd: mask security_information input values with SMB_SUPPORTED_SECINFO_FLAGSStefan Metzmacher2014-08-221-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes Windows clients doesn't filter SECINFO_[UN]PROTECTED_[D|S]ACL flags before sending the security_information to the server. security_information = SECINFO_PROTECTED_DACL| SECINFO_DACL results in a NULL dacl being returned from an GetSecurityDecriptor request. This happens because posix_get_nt_acl_common() has the following logic: if ((security_info & SECINFO_DACL) && !(security_info & SECINFO_PROTECTED_DACL)) { ... create DACL ... } I'm not sure if the logic is correct or wrong in this place (I guess it's wrong...). But what I know is that the SMB server should filter the given security_information flags before passing to the filesystem. [MS-SMB2] 3.3.5.20.3 Handling SMB2_0_INFO_SECURITY ... The server MUST ignore any flag value in the AdditionalInformation field that is not specified in section 2.2.37. Section 2.2.37 lists: OWNER_SECURITY_INFORMATION GROUP_SECURITY_INFORMATION DACL_SECURITY_INFORMATION SACL_SECURITY_INFORMATION LABEL_SECURITY_INFORMATION ATTRIBUTE_SECURITY_INFORMATION SCOPE_SECURITY_INFORMATION BACKUP_SECURITY_INFORMATION Bug: https://bugzilla.samba.org/show_bug.cgi?id=10773 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* vfs3: Pass "lease" through SMB_VFS_CREATE_FILEVolker Lendecke2014-08-111-0/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: use req->xconn in nttrans.cStefan Metzmacher2014-08-061-5/+6
| | | | | | 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-1/+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: Always use UCF_PREP_CREATEFILE for filename_convert calls to resolve a ↵Jeremy Allison2013-12-091-4/+2
| | | | | | | | | | | | path for open. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10297 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Dec 9 21:02:21 CET 2013 on sn-devel-104
* smbd: change flag name from UCF_CREATING_FILE to UCF_PREP_CREATEFILEJeremy Allison2013-12-091-2/+2
| | | | | | | | | In preparation to using it for all open calls. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10297 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* smbd: Pull mtime handling into open_file_ntcreateVolker Lendecke2013-11-231-18/+0
| | | | | | | | | | | | | | This is a performance improvement for heavily contended files, in particular in a cluster. The separate call to get_file_infos makes us pull the locking.tdb record twice per open. For a contended file this can be a performance penalty, this gets the # of record accesses for the open/close cycle down from 3 to 2. 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): Sat Nov 23 00:40:49 CET 2013 on sn-devel-104
* s3:lib: Factor read_ea_list_entry() and read_nttrans_ea_list() out so they ↵Jeremy Allison2013-08-151-43/+1
| | | | | | | can be used by the SMB2 client code. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Fix bug #10010 - Missing integer wrap protection in EA list reading can ↵Jeremy Allison2013-08-051-0/+12
| | | | | | | | cause server to loop with DOS. Ensure we never wrap whilst adding client provided input. Signed-off-by: Jeremy Allison <jra@samba.org>
* Fix bug 9678 - Windows 8 Roaming profiles failGregor Beck2013-08-011-7/+2
| | | | | | | | | | | | | Windows 8 tries to set 'ATTRIBUTE_SECURITY_INFORMATION' on some dirs. Ignoring it makes roaming profiles work again. Just like w2k3 gracefully ignore all the other bits. Signed-off-by: Gregor Beck <gbeck@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Aug 1 20:58:25 CEST 2013 on sn-devel-104
* Ensure we do pathname processing before SD and EA processing in NTTRANS_CREATE.Jeremy Allison2013-07-191-38/+38
| | | | | | | | 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>
* Ensure we can't create a file using NTTRANS with an invalid EA list.Jeremy Allison2013-07-191-0/+20
| | | | | | | | 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>
* smbd: Fix a profile problemVolker Lendecke2013-07-091-2/+4
| | | | | | | | | | | | | | | | | | | | | When trying to read a profile, under certain circumstances Windows tries to read with its machine account first. The profile previously written was stored with an ACL that only allows access for the user and not the machine. Windows should get an NT_STATUS_ACCESS_DENIED when using the machine account, making it retry with the user account (which would then succeed). Samba under these circumstances erroneously gives NT_STATUS_OBJECT_PATH_NOT_FOUND, which makes Windows give up and not retry. The reasons is the "dropbox" patch in unix_convert, turning EACCESS on the last path component to OBJECT_PATH_NOT_FOUND. This patch makes the dropbox behaviour only kick in when we are creating a file. I think this is an abstraction violation. unix_convert() should not have to know about the create_disposition, but given that we have pathname resolution separated from the core open code right now this is the best we can do. Signed-off-by: Volker Lendecke <Volker.Lendecke@SerNet.DE> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Always free the talloc_stackframe() before leaving ↵Andrew Bartlett2012-10-111-0/+3
| | | | | | | smbd_do_query_security_desc Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Oct 11 15:20:54 CEST 2012 on sn-devel-104
* smbd: Add mem_ctx to {f,}get_nt_acl VFS callAndrew Bartlett2012-10-111-6/+7
| | | | | | | | | | | This makes it clear which context the returned SD is allocated on, as a number of callers do not want it on talloc_tos(). As the ACL transformation allocates and then no longer needs a great deal of memory, a talloc_stackframe() call is used to contain the memory that is not returned further up the stack. Andrew Bartlett
* Don't call can_write_to_file() if we already have 'fsp->can_write' set.Jeremy Allison2012-09-141-0/+2
|
* Windows does canonicalization of inheritance bits. Do the same.Jeremy Allison2012-08-301-0/+35
| | | | | | | | | | | | | We need to filter out the SEC_DESC_DACL_AUTO_INHERITED|SEC_DESC_DACL_AUTO_INHERIT_REQ bits. If both are set we store SEC_DESC_DACL_AUTO_INHERITED as this alters whether SEC_ACE_FLAG_INHERITED_ACE is set when an ACE is inherited. Otherwise we zero these bits out. See: http://social.msdn.microsoft.com/Forums/eu/os_fileservices/thread/11f77b68-731e-407d-b1b3-064750716531 for details.
* Re-add set_sd(), called from set_sd_blob(). Allows us to centralize all ACL ↵Jeremy Allison2012-08-301-14/+26
| | | | canonicalization.
* Rename set_sd() to set_sd_blob() - this describes what it does.Jeremy Allison2012-08-301-4/+4
|
* loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.Rusty Russell2012-07-181-2/+2
| | | | | | | | | | They use talloc_tos() internally: hoist that up to the callers, some of whom don't want to us talloc_tos(). A simple patch, but hits a lot of files. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* s3:smbd: change nt_open_pipe() to uint16_t pnum/fnumStefan Metzmacher2012-06-281-3/+3
| | | | | | | | | This is SMB1 code... metze Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Jun 28 14:47:45 CEST 2012 on sn-devel-104
* Remove unused code now we set the correct command codes.Jeremy Allison2012-06-191-5/+0
|
* Fix Bug 8989 - Samba 3.5.x (and probably all other versions of Samba) does ↵Jeremy Allison2012-06-151-0/+6
| | | | | | | | not send correct responses to NT Transact Secondary when no data and no params Found by Richard Sharpe <realrichardsharpe@gmail.com>. The correct command code in a reply to NT Transact Secondary (0xa1) is NT Transact (0xa0).
* s3:smbd: change nttrans.c to use fsp_fnum_dbg() for fsp->fnum logging.Michael Adam2012-06-151-3/+5
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3:smbd: make use of change_notify_fsp_has_changes()Stefan Metzmacher2012-06-061-1/+1
| | | | metze
* s3:smbd: only strip \\ off the name if present (for ntcreatex)Stefan Metzmacher2012-05-281-2/+4
| | | | metze
* build: Remove SMB_OFF_T, replace with off_tAndrew Bartlett2012-04-061-4/+4
| | | | | | | | | Now that we always require a 64 bit off_t, we no longer need SMB_OFF_T. Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Fri Apr 6 01:47:43 CEST 2012 on sn-devel-104
* Add DEBUG statements to show when access has been denied and why.Richard Sharpe2012-03-281-0/+2
| | | | | Autobuild-User: Richard Sharpe <sharpe@samba.org> Autobuild-Date: Wed Mar 28 07:07:26 CEST 2012 on sn-devel-104
* s3: Remove chain_replyVolker Lendecke2012-03-101-3/+0
| | | | <insert your favourite tombstone ascii art here>
* s3: Make sure the andX chains are ended correctlyVolker Lendecke2012-03-101-0/+6
| | | | Normally chain_reply took care of this. This will go away soon.
* s3: Fix typosVolker Lendecke2012-02-211-2/+2
|
* Fix bug 8636 - When returning an ACL without SECINFO_DACL requested, we ↵Jeremy Allison2011-11-301-0/+2
| | | | | | | still set SEC_DESC_DACL_PRESENT in the type field. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Nov 30 04:59:07 CET 2011 on sn-devel-104
* s3: Remove duplicate fsctl function definitionsDavid Disseldorp2011-10-191-1/+0
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* First part of fix for bug #8419 - Make VFS op "streaminfo" stackable.Frank Lahm2011-10-171-2/+2
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Mon Oct 17 21:39:32 CEST 2011 on sn-devel-104
* Add support for VFS op streaminfo chaining in all relevant VFS modules.Frank Lahm2011-10-141-2/+2
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Oct 14 03:26:06 CEST 2011 on sn-devel-104
* Move FSCTL handling into the VFS. Initial code changes. Passes smbtorture ↵Richard Sharpe2011-10-011-335/+32
| | | | NTTRANS-FSCTL. Test added to selftests.
* Fix bug #8458] - IE9 on Windows 7 cannot download files to samba 3.5.11 shareJeremy Allison2011-09-211-0/+25
| | | | Handle the SECINFO_LABEL flag in the same was as Win2k3.
* s3: Pass sconn explicitly to open_was_deferredVolker Lendecke2011-08-021-3/+3
|
* s3-auth Use struct auth_user_info_unix for unix_name and sanitized_usernameAndrew Bartlett2011-07-201-2/+2
| | | | | | | | This is closer to the layout of struct auth_session_info in auth.idl Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
* s3-talloc Change TALLOC_ZERO_P() to talloc_zero()Andrew Bartlett2011-06-091-1/+1
| | | | | Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_P isn't standard talloc.
* s3-talloc Change TALLOC_P() to talloc()Andrew Bartlett2011-06-091-1/+1
| | | | | Using the standard macro makes it easier to move code into common, as TALLOC_P isn't standard talloc.
* struct make "struct shadow_copy_data" its own talloc contextVolker Lendecke2011-05-311-16/+5
|
* s3: Remove SHADOW_COPY_DATA typedefVolker Lendecke2011-05-311-2/+3
|
* s3-libsmb: move protos to libsmb/proto.hGünther Deschner2011-05-061-0/+1
| | | | Guenther
* Fix many const compiler warnings.Jeremy Allison2011-05-051-2/+2
|