summaryrefslogtreecommitdiff
path: root/source3/smbd/proto.h
Commit message (Collapse)AuthorAgeFilesLines
* s3: smbd: Remove vfs_chown_fsp().Jeremy Allison2019-10-151-1/+0
| | | | | | | | | No longer used. This gets rid of another case where we were playing directory changing games that are eliminated by just using a file handle. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* s3: VFS: Use SMB_VFS_FCNTL to set fd flags in open_file()Anoop C S2019-10-081-0/+1
| | | | | | | | | Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Tue Oct 8 09:57:19 UTC 2019 on sn-devel-184
* smbd: Pass "struct file_id" to get_lease_type()Volker Lendecke2019-09-171-2/+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: Make fsp->fh->gen_id unique per processVolker Lendecke2019-09-171-0/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: rename [un]become_user*() to [un]become_user_without_service*()Stefan Metzmacher2019-09-111-4/+4
| | | | | | | | | | | | We should make the behavior change (that gives up some protection) more obvious, by changing the function names. At least some OEMs have patches relying on the 4.9/4.10 behaviour and we want them to detect that they have to do more work when they need to change directories. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: rename change_to_user_by_fsp() to change_to_user_and_service_by_fsp()Ralph Boehme2019-09-111-1/+1
| | | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: rename change_to_user() to change_to_user_and_service()Ralph Boehme2019-09-111-1/+1
| | | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: replace fsp_stat() with vfs_stat_fsp()Ralph Boehme2019-09-101-1/+0
| | | | | | | | | Both functions do the same, they differ just in the type of the returned result. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14121 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:blocking: move from 'timeout' to 'smbd_smb1_do_locks_state->timeout'Stefan Metzmacher2019-09-091-1/+1
| | | | | | | | | | This will make it possible to just use smbd_smb1_do_locks_try() in a later commit. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3:blocking: remove unused timeval_brl_min()Stefan Metzmacher2019-09-091-2/+0
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14113 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* smbd: Simplify has_other_nonposix_opens()Volker Lendecke2019-08-191-2/+1
| | | | | | | | | We pick quite some information from "fsp" already, so from an API design perspecitve it's only fair to only use its implicit server_id. This is what all the callers did anyway. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
* smbd: Make sys_disk_free staticChristof Schmitt2019-08-141-2/+0
| | | | | | | | | | The function is only called from the same file. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Wed Aug 14 17:47:33 UTC 2019 on sn-devel-184
* smbd: Make "lease" const in create_file_default()Volker Lendecke2019-08-091-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Add defer_sharing_violation_smb1Volker Lendecke2019-08-071-0/+1
| | | | | | | | | | This is close to what Windows SMB1 does: Instead of waiting for the share entry causing the SHARING_VIOLATION to disappear, retry every 200msec up to one second. Windows does it a little differently: Retry up to 5 times. But up to one second should be close enough. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Make remove_oplock_under_lock staticVolker Lendecke2019-08-061-1/+0
| | | | | | | | | | | We have support for nested get_share_mode_lock calls, so we can avoid this additional function. It's one more talloc/free per close, but I hope this can't be measurable. Our open/close path is pretty expensive anyway. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Move fsp_client_guid() to locking/Volker Lendecke2019-08-061-1/+0
| | | | | | | | Yes, this adds another peek from locking/ back into smbd/proto.h, but locking/locking.c does the same already. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Remove "share_access" from dup_file_fsp()Volker Lendecke2019-08-061-3/+6
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Use "req->request_time" in schedule_async_open()Volker Lendecke2019-08-061-4/+3
| | | | | | | All callers passed that in Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: smbd: remove redundant smb_dname arg from dptr_create()Ralph Boehme2019-08-061-1/+0
| | | | | | | Now that dptr_create() is handle based, we can simply used the fsp name. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: smbd: Remove dptr_close().Jeremy Allison2019-08-061-1/+0
| | | | | | | No longer used. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: smbd: Remove dptr_fsp(). No longer used.Jeremy Allison2019-08-061-1/+0
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: smbd: Remove dptr_fetch_lanman2() - unused.Jeremy Allison2019-08-061-2/+0
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: smbd: Add dptr_fetch_lanman2_fsp() - to replace dptr_fetch_lanman2().Jeremy Allison2019-08-061-0/+2
| | | | | | | Not yet used. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: smbd: Remove dptr_fetch() - replace internals with dptr_fetch_fsp().Jeremy Allison2019-08-061-2/+0
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: smbd: Add dptr_fetch_fsp() for SMB1 code. We will use this to replace ↵Jeremy Allison2019-08-061-0/+2
| | | | | | | | | dptr_fetch(). Not yet used. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: smbd: Remove now unused dptr_activecnum().Jeremy Allison2019-08-061-2/+0
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: smbd: Remove now unused dptr_closepath().Jeremy Allison2019-08-061-2/+0
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: smbd: Add dptr_fsp() to return any stored files_struct pointer.Jeremy Allison2019-08-061-0/+1
| | | | | | | | | Will allow [find/search]_next() calls to find and close any associated fsp. This function is temporary and will eventually go away once I modify dptr_fetch() to return an fsp. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: smbd: Naming consistency. Change all uses of struct smb_Dir * variables ↵Jeremy Allison2019-07-241-1/+1
| | | | | | | | | to be dir_hnd. Fixes RewindDir(). No logic changes. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3: smbd: Naming consistency. Change all uses of struct smb_Dir * variables ↵Jeremy Allison2019-07-241-1/+1
| | | | | | | | | to be dir_hnd. Fixes ReadDirName(). No logic changes. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3: smbd: Remove now unused dptr_idlecnum().Jeremy Allison2019-07-091-1/+0
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* s3: smbd: Add dptr_activecnum(), not yet used.Jeremy Allison2019-07-091-0/+2
| | | | | | | | Will be used to help remove the SMB1 idle directory code. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* smbd: Make get_relative_fid_filename() static to open.cVolker Lendecke2019-07-081-6/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* smbd: Don't store num_read_oplocks in brlock.tdbVolker Lendecke2019-07-041-1/+0
| | | | | | | | | | | | | | This removes a kludgy implementation that worked around a locking hierarchy problem: Setting a byte range lock had to contend the level2 oplocks, which are stored in locking.tdb/leases.tdb. We could not access locking.tdb in the brlock.tdb code, as brlock.tdb might have been locked first without locking.tdb, violating the locking hierarchy locking.tdb->brlock.tdb. Now that that problem is gone (see the commit wrapping do_lock() in share_mode_do_locked()), we can remove this kludge. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* smbd: Remove unused "msg_ctx" from smbd_smb1_do_locks_send()Volker Lendecke2019-07-021-1/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Remove unused "msg_ctx" from smbd_do_locks_try()Volker Lendecke2019-07-021-1/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs_fruit: move zero file-id to vfs_fruitRalph Boehme2019-07-011-1/+0
| | | | | | | Now that this stuff goes through the VFS, let's do it right. :) Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:vfs: move get_fs_file_id to vfs_defaultRalph Boehme2019-07-011-1/+0
| | | | | | | | This makes get_fs_file_id() the default implementation of SMB_VFS_FS_FILE_ID(). No change in behaviour. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: rename get_FileIndex() to get_fs_file_id()Ralph Boehme2019-07-011-1/+1
| | | | | | | | Also rename all variable used to store the result of the renamed get_fs_file_id() in the callers. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3: smbd: Make set_unix_posix_default_acl() take an fsp argument, not smb_fname.Jeremy Allison2019-06-241-1/+1
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: smbd: Only pass fsp to set_unix_posix_acl(). No longer uses smb_fname.Jeremy Allison2019-06-241-1/+0
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: smbd: Change set_unix_posix_default_acl() to return NTSTATUS.Jeremy Allison2019-06-241-1/+1
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: smbd: Make set_unix_posix_acl() return NTSTATUS.Jeremy Allison2019-06-241-1/+1
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* smbd: Remove unused brlock codeVolker Lendecke2019-06-201-33/+0
| | | | | | | No PENDING locks in brlock.tdb anymore. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Add smbd_smb1_do_locks_send/recv()Volker Lendecke2019-06-201-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | This contains the SMB1-specific brlock logic. Right now our core brlock code has specialized code to deal with pending locks. For dealing with pending requests waiting for something nowadays we recommend to use tevent_req. This code also provides the basis to remove the SMB1 special case handling from the core logic, isolating protocol features specific to SMB1 and not exposed in SMB2 in SMB1-specific code. The core brlock code will not see blocking locks anymore. Instead, the code in this patch will always immediately fail and take care of the retries and timeouts. Retries are implemented by a dbwrap_watch_record_send on the corresponding locking.tdb entry. A later commit will make unlocks trigger wakeups there. I chose locking.tdb and not brlock itself to simplify the implementation. We already have oplock break watchers on locking.tdb, this will only add one more. This might lead to spurious wakeups, but they are taken care of by careful retries. An advantage of doing that is the implicit handling of a killed blocker PID through dbwrap_watch, obsoleting brl_revalidate. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Only remove locks by mid if necessaryVolker Lendecke2019-06-201-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Simplify fsp_lease_update()Volker Lendecke2019-05-281-3/+1
| | | | | | | | | | We don't need a share mode lock from a data dependency point of view anymore, the leases data moved to leases.tdb. However, from a coherency point of view it's probably wise to do this under a share mode lock. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:smbd: Return NTSTATUS for srv_calculate_sign_mac()Andreas Schneider2019-05-211-2/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* smbd: Make "check_access()" static to trans2.cVolker Lendecke2019-05-031-4/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Remove share_mode_lease and the leases array from share_mode_entryVolker Lendecke2019-04-141-5/+0
| | | | | | | | | | This also removes the temporary functions introduced during the patchset. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Sun Apr 14 05:18:14 UTC 2019 on sn-devel-144