summaryrefslogtreecommitdiff
path: root/source3/smbd/smb2_setinfo.c
Commit message (Collapse)AuthorAgeFilesLines
* smbd: use session->global->session_wire_id instead of session->compat->vuidRalph Boehme2020-01-131-2/+3
| | | | | | | | | session->compat->vuid is set to session->global->session_wire_id after a successful session setup, so both variables will always carry the same value. Cf the next commit which removes vuid from user_struct. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use share_mode_watch_send()Volker Lendecke2019-11-221-3/+3
| | | | | | | This removes some dependencies on share_mode_data->record Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use share_mode_forall_leases() in delay_rename_for_lease_break()Volker Lendecke2019-09-171-35/+48
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Pass "struct file_id" to get_lease_type()Volker Lendecke2019-09-171-1/+1
| | | | | | | It does not have to depend on the whole struct share_mode_data. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: rename change_to_user() to change_to_user_and_service()Ralph Boehme2019-09-111-2/+2
| | | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Simplify smbd_smb2_setinfo_send()Volker Lendecke2019-07-081-4/+2
| | | | | | | Avoid an "else" branch Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Use share_mode_entry's lease data in delay_rename_for_lease_break()Volker Lendecke2019-04-141-5/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org>
* libsmb: Rename InfoType from [MS-SMB2] according to the specVolker Lendecke2019-04-011-4/+4
| | | | | | | This makes it easier to find this via internet search Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: smbd: Clarify POSIX name handling in SMB2 get/setinfo calls.Jeremy Allison2019-03-191-1/+1
| | | | | | | | | | | | We should never be looking at the info level here, the create call will have set the correct POSIX flag on the smb_filename struct. 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): Tue Mar 19 22:55:11 UTC 2019 on sn-devel-144
* Revert "smbd: add an effective {smb,smbd_smb2}_request->ev_ctx that holds ↵Ralph Boehme2019-01-111-1/+1
| | | | | | | | | | | | | | | | the event context used for the request processing" This reverts commit 894e5001c747ce765dad5517778dda55d7d1f4d9. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Revert "smbd: avoid explicit change_to_user() in defer_rename_done() already ↵Ralph Boehme2019-01-111-0/+11
| | | | | | | | | | | | | | | | done by impersonation" This reverts commit e37e41b3cac52e3623f0c79f83733a51edb35c10. See the discussion in https://lists.samba.org/archive/samba-technical/2018-December/131731.html for the reasoning behind this revert. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Slightly optimize delay_rename_for_lease_breakVolker Lendecke2018-10-251-5/+7
| | | | | | | Do the checks with increasing cost, possibly avoid more expensive ones Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3/smbd: Ensure quota code is only called when quota support detectedNoel Power2018-08-101-0/+5
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13563 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Aug 10 02:43:33 CEST 2018 on sn-devel-144
* s3/smbd: smb2 server implementation for query get/set info.Noel Power2018-07-311-0/+36
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13553 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: avoid explicit change_to_user() in defer_rename_done() already done by ↵Stefan Metzmacher2018-07-121-11/+0
| | | | | | | impersonation Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* smbd: add an effective {smb,smbd_smb2}_request->ev_ctx that holds the event ↵Stefan Metzmacher2018-06-181-1/+1
| | | | | | | | | | context used for the request processing In future this will an impersonation wrapper tevent_context based on the user session. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* smbd: remove set_current_service() from defer_rename_done()Stefan Metzmacher2018-06-181-6/+0
| | | | | | | | The change_to_user() above already called chdir_current_service(). And for smb2 we don't have per packet conn->case_sensitive anyway. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: debug: smb2: Create a new DBGC_SMB2 debug class and mark all ↵Jeremy Allison2018-03-221-0/+3
| | | | | | | | | | | smbd/smb2_*.c files with it. Will allow easier smb2-specific debugging. https://bugzilla.samba.org/show_bug.cgi?id=13347 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* smbd: Pass "file_id" explicitly to send_break_message()Volker Lendecke2018-02-131-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap_watch: Remove the "prec" parameter from watch_recvVolker Lendecke2017-11-291-2/+1
| | | | | | | | | | | The initial idea was to have some "atomicity" in this API. Every caller interested in a record would have to do something with it once it changes. However, only one caller really used this feature, and that is easily changed to not use it. So remove the complexity. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* smbd: Convert locking.tdb to new dbwrap_watchVolker Lendecke2016-07-151-4/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* dbwrap: Add "blocker" to record_watch_sendVolker Lendecke2016-07-151-2/+4
| | | | | | | | | | Typicall, when we watch a record, we wait for a process to give up some resource. Be it an oplock, a share mode or the g_lock. If everything goes well, the blocker sends us a message. If the blocker dies hard, we want to also be informed immediately. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd remove todo commentsChristian Ambach2016-05-041-1/+0
| | | | | | | | | | | as the service is set to be case insensitive for SMB2 now, there is no need to set FLAG_CASELESS_PATHNAMES as flag Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed May 4 05:00:36 CEST 2016 on sn-devel-144
* Fix the smb2_setinfo to handle FS info types and FSQUOTA infolevelPartha Sarathi2016-04-271-0/+18
| | | | | | | | | Signed-off-by: Partha Sarathi <partha@exablox.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org> Autobuild-User(master): Uri Simchoni <uri@samba.org> Autobuild-Date(master): Wed Apr 27 05:39:01 CEST 2016 on sn-devel-144
* s3:smb2_setinfo: fix memory leak in the defer_rename caseStefan Metzmacher2015-06-171-0/+9
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11329 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Fix CID 1273088 Resource leakVolker Lendecke2015-03-031-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: leases: Make SMB2 setinfo SMB2_FILE_RENAME_INFORMATION_INTERNAL async.Jeremy Allison2014-12-051-0/+218
| | | | | | | | | | If there are any RH leases we must break them to read and must wait for the client response before doing the rename. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3:smbd: mask security_information input values with SMB_SUPPORTED_SECINFO_FLAGSStefan Metzmacher2014-08-221-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* s3:smb2_server: pass smbXsrv_connection to smbd_server_connection_terminate*()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:smb2_*: make use of smb2req->xconn where possibleStefan Metzmacher2014-08-061-1/+1
| | | | | | | | We need to use the connection that is used by the current request. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smb2_server: use xconn->smb2.server.max_* instead of sconn->smb2.max_*Stefan Metzmacher2014-08-061-2/+3
| | | | | | | | We don't need this twice... Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smb2_setinfo: make use of smbd_smb2_generate_outbody()Stefan Metzmacher2014-03-051-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Rename set_sd() to set_sd_blob() - this describes what it does.Jeremy Allison2012-08-301-1/+1
|
* s3:smb2_setinfo: make use of SMBD_SMB2_* macrosStefan Metzmacher2012-08-051-5/+4
| | | | metze
* s3:smbd: make use of smbXsrv_tcon and smbXsrv_session for smb2Stefan Metzmacher2012-06-251-1/+1
| | | | | | | | | The removes the protocol specific smbd_smb2_session and smbd_smb2_tcon. Pair-Programmed-With: Michael Adam <obnox@samba.org> metze
* s3:smbd: change smb2_setinfo.c to use fsp_fnum_dbg() for fsp->fnum logging.Michael Adam2012-06-151-3/+4
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3:smb2_setinfo: make use of file_fsp_smb2()Stefan Metzmacher2012-06-091-29/+12
| | | | metze
* s3: Fix some 64-bit warningsVolker Lendecke2012-05-311-2/+2
| | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Thu May 31 10:06:56 CEST 2012 on sn-devel-104
* s3:smbd/smb2_setinfo add a debug messageChristian Ambach2012-05-291-0/+4
| | | | | | similar to the ones present in other paths Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3:smb2_server verify creditchargeChristian Ambach2012-03-091-0/+6
| | | | | | | for all requests that have max_???? checks, also do a check of the creditcharge the client has sent (when using largemtu) Signed-off-by: Jeremy Allison <jra@samba.org>
* s3:smb2_server: use sconn->ev_ctx instead of sconn->smb2.event_ctxStefan Metzmacher2011-12-121-1/+1
| | | | | | | metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Mon Dec 12 16:08:59 CET 2011 on sn-devel-104
* s3:smb2_server: pass explicit defer_times to smbd_smb2_request_pending_queue()Stefan Metzmacher2011-11-151-1/+1
| | | | metze
* s3:smb2_server: get/set info are limited by max_trans size (bug #8473)Stefan Metzmacher2011-10-131-0/+4
| | | | | | | metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Thu Oct 13 03:32:02 CEST 2011 on sn-devel-104
* s3:smb2_server: use smbd_smb2_request_verify_sizes() in smb2_setinfo.cStefan Metzmacher2011-09-071-13/+5
| | | | metze
* Fix bug 8412 - Microsoft Office 2007 (Microsoft Word) fails to save as on a ↵Jeremy Allison2011-08-291-6/+0
| | | | Samba share with SMB2.
* s3-tevent: only include ../lib/util/tevent wrappers where needed.Günther Deschner2011-04-291-0/+1
| | | | | | | Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Fri Apr 29 14:00:30 CEST 2011 on sn-devel-104
* s3: include smbd/smbd.h where needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3-trans2: only include trans2.h where needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* SMB2 renames return SHARING_VIOLATION if there is any existing oplock on a file.Jeremy Allison2011-03-181-0/+6
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Fri Mar 18 23:39:49 CET 2011 on sn-devel-104
* If possible (O_DIRECTORY exists) open an fd for a directory open.Jeremy Allison2011-02-081-1/+1
| | | | | | | | | | | Start of the move towards handle-based code for directory access. Currently makes fstat/fchown code work for directories rather than falling back to pathnames. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Tue Feb 8 06:34:41 CET 2011 on sn-devel-104