summaryrefslogtreecommitdiffstats
path: root/source3/smbd/open.c
Commit message (Collapse)AuthorAgeFilesLines
...
* smbd: Use dbwrap_record_watch_send for defer_openVolker Lendecke2013-04-261-1/+67
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Convert create_file_unixpath to synthetic_smb_fnameVolker Lendecke2013-04-171-5/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Convert open_streams_for_delete to synthetic_smb_fnameVolker Lendecke2013-04-171-5/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Convert msg_file_was_renamed to synthetic_smb_fnameVolker Lendecke2013-04-171-3/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Convert change_dir_owner_to_parent to synthetic_smb_fnameVolker Lendecke2013-04-171-3/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Convert change_dir_owner_to_parent to synthetic_smb_fnameVolker Lendecke2013-04-171-5/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Convert change_file_owner_to_parent to synthetic_smb_fnameVolker Lendecke2013-04-171-5/+4
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* smbd: Fix an error return in change_dir_owner_to_parentVolker Lendecke2013-04-151-1/+1
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com> Autobuild-User(master): Richard Sharpe <sharpe@samba.org> Autobuild-Date(master): Mon Apr 15 18:05:06 CEST 2013 on sn-devel-104
* s3:smbd/open: fall back to Builtin_Administrators if SYSTEM doesn't map to a ↵Stefan Metzmacher2012-12-021-0/+54
| | | | | | | group Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd/open: try the primary sid (user) as group_sid if the token has just ↵Stefan Metzmacher2012-12-021-1/+5
| | | | | | | one sid Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd/open: use Builtin_Administrators as owner of files (if possible)Stefan Metzmacher2012-12-021-4/+41
| | | | | | | | | We do this if the idmap layer resolves Builtin_Administrators as ID_TYPE_BOTH and if the current token has the Builtin_Administrators SID or it's SYSTEM. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s4:smbd/open: add missing TALLOC_FREE(frame) to inherit_new_acl()Stefan Metzmacher2012-11-281-0/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* Add comments explaining exactly *why* we don't check FILE_READ_ATTRIBUTES ↵Jeremy Allison2012-11-191-3/+21
| | | | | | | | | | | | | when evaluating file/directory ACE's. If we can access the path to this file, by default we have FILE_READ_ATTRIBUTES from the containing directory. See the section. "Algorithm to Check Access to an Existing File" in MS-FSA.pdf. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* s3:smbd: fix brace placements in validate_my_share_entries() for readabilityMichael Adam2012-10-171-2/+4
| | | | | | | | | | according to coding guidelines Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Oct 17 14:37:58 CEST 2012 on sn-devel-104
* smbd: Add mem_ctx to {f,}get_nt_acl VFS callAndrew Bartlett2012-10-111-8/+14
| | | | | | | | | | | 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
* Revert "When creating a new file/directory, we need to obey the create ↵Jeremy Allison2012-10-041-15/+0
| | | | | | | | | mask/directory mask parameters." This reverts commit c251a6b0442abc13bc8be4ff8de324c1d7706a78. Remove this as we're planning to remove the security mask, directory security mask parameters and only use create mask/directory mask.
* When creating a new file/directory, we need to obey the create ↵Jeremy Allison2012-10-021-0/+15
| | | | | | | | | | | | | | mask/directory mask parameters. Currently we call FSET_NT_ACL to inherit any ACLs on create. However FSET_NT_ACL uses the security mask/directory security mask parameters instead of the create mask/directory mask parameters. Swap them temporarily when creating to ensure the correct masks are applied. Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Oct 2 22:27:17 CEST 2012 on sn-devel-104
* s3: Fix opening a file under kernel oplocksVolker Lendecke2012-09-291-0/+79
| | | | | | | | | With the prior code we assumed that we do not have kernel oplocks around when we open a file because we handled samba-internal oplock breaks before the open attempt. Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Sat Sep 29 19:29:36 CEST 2012 on sn-devel-104
* s3: Remove a SMB_ASSERTVolker Lendecke2012-09-291-2/+0
| | | | With the simplified logic this became unnecessary
* s3: Close the now opened file descriptor in error pathsVolker Lendecke2012-09-291-0/+3
|
* s3: No code change, just re-indentVolker Lendecke2012-09-291-188/+187
| | | | Look at this with "git diff -b" if you don't believe me :-)
* s3: Remove share mode handling before we open the fileVolker Lendecke2012-09-291-204/+1
| | | | | | | | This is a significant behaviour change: We do not open the file under the share mode lock anymore. This might lead to more open calls in case of oplock breaks or sharing violations, but those are slow error paths and as such might be not too performance sensitive. The benefit of this patch is a significant reduction of complexity of open_file_ntcreate()
* s3: Fix fcb_or_dos_open after logic changeVolker Lendecke2012-09-291-1/+2
| | | | | | With the new behaviour, we call fcb_or_dos_open after open_file(). It is open_file() that sets up the fsp so that fcb_or_dos_open can find it in the list of fsps. Avoid finding the fsp we are just setting up.
* s3: Copy share mode handling from before to after open_fileVolker Lendecke2012-09-291-17/+124
| | | | | | This is a 1:1 copy&paste of the oplock/sharemode code that we do before an existing file is opened. It is a prerequiste for a patch that removes all of that handling before we open the file.
* s3: Fix rejecting mkdir on read-only sharesVolker Lendecke2012-09-271-1/+1
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Slightly simplify open_file()Volker Lendecke2012-09-261-1/+2
| | | | | | | The "else" is not necessary. In the if-branch we just returned. Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Sep 26 18:08:03 CEST 2012 on sn-devel-104
* s3: Slightly simplify calculate_open_access_flagsVolker Lendecke2012-09-261-9/+10
|
* s3: Slightly simplify calculate_open_access_flagsVolker Lendecke2012-09-261-13/+17
|
* s3: Factor out calculate_open_access_flagsVolker Lendecke2012-09-261-15/+31
| | | | | Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Sep 26 00:22:56 CEST 2012 on sn-devel-104
* s3: Fix a typoVolker Lendecke2012-09-251-1/+1
|
* s3: Slightly simplify is_stat_openVolker Lendecke2012-09-251-3/+2
| | | | | | | | The "access_bits" clause is redundant. is_stat_open says that exactly at least one of the stat_open_bits must be set and none else. Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Sep 25 20:05:06 CEST 2012 on sn-devel-104
* s3: Make is_stat_open() a bit more readableVolker Lendecke2012-09-251-4/+7
|
* s3: Fix indentation of if-expressionsVolker Lendecke2012-09-251-2/+3
| | | | | | | To me this makes open_file_ntcreate a little easier to understand Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Sep 25 10:08:15 CEST 2012 on sn-devel-104
* Fix bug #9189 - SMB2 Create doesn't return correct MAX ACCESS access mask in ↵Jeremy Allison2012-09-251-0/+7
| | | | | | | blob. If we aren't already granted DELETE access, check if we have DELETE_CHILD in the containing directory.
* s3:smbd: release the share mode lock before calling exit_server() (bug #9191)Stefan Metzmacher2012-09-211-0/+2
| | | | | | | metze Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Sep 21 22:36:57 CEST 2012 on sn-devel-104
* Add 'bool use_privs' to smbd_calculate_access_mask().Jeremy Allison2012-09-151-4/+7
| | | | | | | | Replaces blanket root allow if set. Set to 'false' for all current callers. Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Sep 15 00:37:49 CEST 2012 on sn-devel-104
* Fix bad string in debug message (remove it).Jeremy Allison2012-09-141-4/+2
|
* Add bool use_privs parameter to smbd_check_access_rights()Jeremy Allison2012-09-141-4/+12
| | | | | If this is set we should use it in preference to blindly assuming root can do anything. Currently set to 'false' in (most) callers.
* s3: delete requests are not specialVolker Lendecke2012-09-101-16/+0
| | | | | | | The only difference between batch and exclusive oplocks is the time of the check: Batch is checked before the share mode check, exclusive after. Signed-off-by: Jeremy Allison <jra@samba.org>
* s3:smbd: make fd_open() publicMichael Adam2012-09-081-4/+4
|
* s3:smbd: don't set kernel flock if "kernel share modes = no"Michael Adam2012-09-081-1/+1
| | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Sat Sep 8 13:05:05 CEST 2012 on sn-devel-104
* s3:smbd: add disconnected checks to the open code.Stefan Metzmacher2012-09-081-0/+31
| | | | | | (delay_for_batch_oplocks, open_mode_check, and delay_for_exclusive_oplocks) Pair-Programmed-With: Michael Adam <obnox@samba.org>
* Remove an unncessary FTRUNCATE call in the open path. We can rely on O_TRUC.Jeremy Allison2012-09-051-29/+1
| | | | Suggested by Volker.
* s3: Slightly simplify fd_open_atomicVolker Lendecke2012-09-051-8/+7
| | | | | | | | | Replace an if-statement by a direct assignment Signed-off-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Sep 5 01:56:46 CEST 2012 on sn-devel-104
* s3: Put a comment into the right placeVolker Lendecke2012-09-041-4/+5
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Factor out disposition_to_open_flagsVolker Lendecke2012-09-041-24/+57
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Factor out calculation of clear_adsVolker Lendecke2012-09-041-5/+17
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Slightly simplify open_file_ntcreateVolker Lendecke2012-09-041-5/+5
| | | | | | We have not set flags2 before, so do direct assignment and not |= Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Make "open_match_attributes" staticVolker Lendecke2012-09-041-6/+6
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Make an if statement a bit easier to readVolker Lendecke2012-09-011-2/+3
| | | | | | | | | Fix indentation a bit Signed-off-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Sep 1 07:07:12 CEST 2012 on sn-devel-104