summaryrefslogtreecommitdiff
path: root/source3/smbd/service.c
Commit message (Collapse)AuthorAgeFilesLines
* 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: Enhance debugging if chdir failsVolker Lendecke2019-09-111-6/+34
| | | | | | | | | | This helps admins to figure out which user has a problem Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Spelling fixes s/withing/within/Mathieu Parent2019-09-011-1/+1
| | | | | | Signed-off-by: Mathieu Parent <math.parent@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* s3: VFS: change connection_struct cwd_fname to cwd_fspRalph Boehme2019-08-161-4/+4
| | | | | | Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: smbd: Remove call to dptr_closecnum() on connection shutdown.Jeremy Allison2019-08-061-4/+0
| | | | | | | | | | | Now all client enumerations use fsp file handles we will aleady close them in file_close_conn() above. The only user of dptr_closecnum() is for the strange old OS/2 semantics, so I can't get rid of it until SMB1 is removed. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* smbd: Use dom_sid_str_bufVolker Lendecke2018-12-201-1/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* auth: move copy_session_info() from source3 into the global auth contextBjörn Baumbach2018-10-111-0/+1
| | | | | Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Volker Lendecke <vl@samba.org>
* Revert "s3/service: convert lp_force_group() to const"David Disseldorp2018-07-101-7/+12
| | | | | | | | | | | | This reverts commit c53646bccd87ef3b3133d3f7526ef85591909528. As mentioned by Andrew, we shouldn't break environments where "force group" has been configured to use substituted variables. 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 Jul 10 00:12:19 CEST 2018 on sn-devel-144
* Revert "s3/service: convert lp_force_user() to const"David Disseldorp2018-07-091-2/+2
| | | | | | | | | This reverts commit c58194e3d296f4e14e7689bdf192c561635ae161. As mentioned by Andrew, we shouldn't break environments where "force user" has been configured to use substituted variables. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3/service: convert lp_force_user() to constDavid Disseldorp2018-07-061-2/+2
| | | | | | | Avoid set_conn_force_user_group() talloc stackframe leaks in doing so. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3/service: convert lp_force_group() to constDavid Disseldorp2018-07-061-12/+7
| | | | | | | | set_conn_force_user_group() and change_to_user_internal() leak onto the callers' talloc stackframe. Drop the unnecessary heap allocations. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3/service: use lp_const_servicename() where possibleDavid Disseldorp2018-07-061-33/+33
| | | | | | | | The majority of these lp_servicename(talloc_tos(), ...) callers leak onto the talloc stackframe. Drop the unnecessary heap allocations. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: remove unused tevent_context argument from notify_initStefan Metzmacher2018-06-181-1/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* smbd: remove unused set_current_service()Stefan Metzmacher2018-06-181-20/+0
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* smbd: remember that the tcon completely setup connection_structStefan Metzmacher2018-06-181-0/+1
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* smbd: make it explicit that make_connection_snum() returns NT_STATUS_OK on ↵Stefan Metzmacher2018-06-181-1/+1
| | | | | | | success Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* smbd: call set_current_case_sensitive() before chdir_current_service()Stefan Metzmacher2018-06-181-1/+2
| | | | | | | | | | I guess we better setup conn->case_sensitive before doing the vfs_ChDir() calls, so we have a consistent result everytime. Otherwise vfs_Chdir() would get conn->case_sensitive from last request. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* smbd: split out set_current_case_sensitive() and chdir_current_service() ↵Stefan Metzmacher2018-06-181-26/+53
| | | | | | | | | functions We'll soon use them independend from set_current_service(). Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: VFS: Change SMB_VFS_REALPATH to take and return struct smb_filename * ↵Jeremy Allison2017-07-011-4/+6
| | | | | | | | | | instead of char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* s3: VFS: Change SMB_VFS_GETWD to return struct smb_filename * instead of char *.Jeremy Allison2017-07-011-4/+11
| | | | | | | | We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* s3: VFS: Change SMB_VFS_CHDIR to use const struct smb_filename * instead of ↵Jeremy Allison2017-07-011-7/+20
| | | | | | | | | | const char *. We need to migrate all pathname based VFS calls to use a struct to finish modernising the VFS with extra timestamp and flags parameters. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
* s3: smbd: Make set_conn_connectpath() call canonicalize_absolute_path().Jeremy Allison2017-01-301-100/+3
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=12531 Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
* s3/smbd: ensure global "smb encrypt = off" is effective for SMB 1 clientsRalph Boehme2017-01-271-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | If encryption is disabled globally, per definition we shouldn't allow enabling encryption on individual shares. The behaviour of setting [Global] smb encrypt = off [share_required] smb encrypt = required [share_desired] smb encrypt = desired must be to completely deny access to the share "share_required" and an unencrypted connection to "share_desired". Bug: https://bugzilla.samba.org/show_bug.cgi?id=12520 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Update smbrun to allow for settings environment variables.Trever L. Adams2016-10-131-4/+4
| | | | | | | | | Signed-off-by: Trever L. Adams <trever.adams@gmail.com> Reviewed-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Oct 13 04:26:26 CEST 2016 on sn-devel-144
* smbd: Re-register notify requestsVolker Lendecke2016-07-201-0/+12
| | | | | | | | When notifyd is restarted, the parent will broadcast that fact to all workers. They will then re-register their notify requests. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Pass "sconn" via notify to notify_callback()Volker Lendecke2016-07-201-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: There's only one notify_callbackVolker Lendecke2016-07-201-1/+2
| | | | | | | | We do not have different callbacks per notify, put the callback function into the notify context Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Factor out notify_initVolker Lendecke2016-07-201-7/+30
| | | | | | | | | Before this patch, failure of notify_init was ignored. Also, no proper error handling of a messaging_register failure was done. Fix those, also adding some debug messages. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: sconn->sys_notify_ctx is not usedVolker Lendecke2016-07-201-4/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd/service apply some code formattingChristian Ambach2016-05-041-23/+29
| | | | | | | reduce indentation in switch statement, obey 80 char line limit, use C99 bool Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd/service disable case-sensitivity for SMB2/3 connectionsChristian Ambach2016-05-041-1/+3
| | | | | | | | | in SMB2, there is no flag to let us know if the client wants to have case-sensitive behavior, so in Auto mode, disable case-sensitivity Bug: https://bugzilla.samba.org/show_bug.cgi?id=11438 Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: Filenames: Add uint32_t flags parameter to synthetic_smb_fname().Jeremy Allison2016-03-241-2/+5
| | | | | | | | | Get it from parent/deriving smb_filename if present. Use 0 (as usually this a Windows-style lookup) if not. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org>
* s3:smbd: change a loglevel from 0 to 1 when SMB_VFS_CONNECT failsRalph Boehme2015-07-161-1/+3
| | | | | | | | | | | Logging at level 0 may result in log flooding. Additionally log the share name that failed in SMB_VFS_CONNECT. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Thu Jul 16 20:24:47 CEST 2015 on sn-devel-104
* param: Make "change notify" globalVolker Lendecke2015-07-071-1/+1
| | | | | | | | With a central notifyd, we can't do this per share anymore. Notifyd will only look at absolute paths, not shares. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Convert all uses of uint8/16/32 to _t in source3/smbd.Richard Sharpe2015-05-061-1/+1
| | | | | Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Cancel pending notifies if the directory goes awayVolker Lendecke2015-04-221-0/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Stop using vfs_Chdir after SMB_VFS_DISCONNECT.Ira Cooper2015-01-161-3/+3
| | | | | | | | | | | This sequencing is causing problems for vfs_ceph, and likely other vfs modules. Signed-off-by: Ira Cooper <ira@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Jan 16 00:13:17 CET 2015 on sn-devel-104
* fileserver: raise debug level for share connection closing for non-IPC to 2.Jelmer Vernooij2014-09-281-1/+1
| | | | | | | | | | This reduces spamming during 'make test' runs. This change is consistent with aad5eeb9b4f67b03988ceefb7888cb63ecefcf30, which raised the log level for logging of new non-IPC connections. Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Change-Id: I4343570c8d6158b6715e514a8a7cd323a9c727ae Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: use xconn->client->sconn in make_connection_snum()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 make_connection_snum()Stefan Metzmacher2014-09-191-4/+4
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: pass smb_request to make_connection_smb1()Stefan Metzmacher2014-09-191-7/+7
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: pass smbd_smb2_request to make_connection_smb2()Stefan Metzmacher2014-09-191-1/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: pass smb_request to make_connection()Stefan Metzmacher2014-09-191-1/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@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/+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:lib/afs move afs.c to common lib dirChristian Ambach2014-06-041-0/+1
| | | | | | | | | | some of the code in afs.c is needed by wbinfo that lives in the toplevel nsswitch directory, so move the afs.c file to a new top-level lib/afs directory. Use the name afs_funcs to avoid collisions with the afs.h header from OpenAFS Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:smbd: fix typo in comment for set_conn_force_user_group()Michael Adam2014-04-231-1/+1
| | | | | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Kamen Mazdrashki <kamenim@samba.org> Autobuild-User(master): Kamen Mazdrashki <kamenim@samba.org> Autobuild-Date(master): Wed Apr 23 01:49:09 CEST 2014 on sn-devel-104
* s3: smbd: Fileserving share access checks.Jeremy Allison2014-03-181-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Git commit 86d1e1db8e2747e30c89627cda123fde1e84f579 fixed share_access not being reset between users, by changing make_connection_snum() to call a common function check_user_share_access() in the same way that change_to_user() (which can be called on any incoming packet) does. Unfortunately that bugfix was incorrect and broke "force user" and "force group" as it called check_user_share_access() inside make_connection_snum() using the conn->session_info pointer instead of the vuser->session_info pointer. conn->session_info represents the token to use when actually accessing the file system, and so is modified by force user and force group. conn->session_info represents the "pristine" token of the user logging in, and is never modified by force user and force group. Samba 3.6.x checked the share access based on the "pristine" token of the user logging in, not the token modified by force user and force group. This change restores the expected behavior. Fixes bug #9878 - force user does not work as expected https://bugzilla.samba.org/show_bug.cgi?id=9878 Signed-off-by: Jeremy Allison <jra@samba.org> Tested-by: Gerhard Wiesinger <lists@wiesinger.com> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Mar 18 19:19:31 CET 2014 on sn-devel-104
* 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 "rootpreexec" to "root_preexec"Garming Sam2014-02-071-3/+3
| | | | | | 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 "rootpostexec" to "root_postexec"Garming Sam2014-02-071-2/+2
| | | | | | Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>