summaryrefslogtreecommitdiffstats
path: root/source3/smbd/open.c
Commit message (Collapse)AuthorAgeFilesLines
* Set fsp->initial_allocation_size before calling open_file_ntcreate().Jeremy Allison2012-07-121-0/+5
| | | | | Allows an SMB_VFS_OPEN() vfs module to do something interesting with the request.
* Make sure we reset fsp->initial_allocation_size to zero if we didn't create ↵Jeremy Allison2012-07-121-0/+2
| | | | | | | the file. This will become important as we set fsp->initial_allocation_size before create.
* Cope with a (non-security) open race we've had for ever as NTCreateX isn't ↵Jeremy Allison2012-07-101-0/+25
| | | | | | | | | | | | | | | | atomic on POSIX. On open without create, the file did exist, but some other (local or NFS) process either renamed/unlinked and re-created the file with different dev/ino after we walked the path, but before we did the open. We could retry the open but it's a rare enough case it's easier to just fail the open to prevent creating any problems in the open file db having the wrong dev/ino key. Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Jul 10 21:57:33 CEST 2012 on sn-devel-104
* Now we have a guaranteed indication of a file being created, use it to set ↵Jeremy Allison2012-07-101-12/+8
| | | | the create disposition correctly.
* Add function fd_open_atomic() which uses O_CREAT|O_EXCL to return a ↵Jeremy Allison2012-07-101-4/+107
| | | | guaranteed indication of creation of a new file.
* Simplify the logic in open_file() some more.Jeremy Allison2012-07-101-48/+36
| | | | | | | | | | Move the inheritance work into the if block where we created the file. We can never have created the file (and thus need no inheritance) for a stat-open. Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Jul 10 03:30:22 CEST 2012 on sn-devel-104
* Simplify the logic in open_file().Jeremy Allison2012-07-091-22/+15
| | | | | | Move the fstat call into the block which opens a file descriptor. Remove the stat() call in the stat-open case. We already failed the open if !file_existed.
* Make check_same_stat() and check_same_dev_ino() common functions.Jeremy Allison2012-07-091-29/+0
|
* Factor out check_same_dev_ino() from check_same_stat() so it can be called ↵Jeremy Allison2012-07-091-2/+15
| | | | separately.
* s3-smbd: Remove deprecated 'share modes' option.Andreas Schneider2012-07-031-4/+0
|
* Don't allow asynchronous creates to be canceled in SMB2.Jeremy Allison2012-06-301-3/+14
| | | | | Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Jun 30 04:10:02 CEST 2012 on sn-devel-104
* Allow for async opens.Jeremy Allison2012-06-301-4/+35
| | | | | If the SMB_VFS_OPEN() function returns -1, EINTR -> NT_STATUS_RETRY, then queue the open up to be completed when the async open completes.
* Add new bool field async_open to struct deferred_open_record. Not used yet.Jeremy Allison2012-06-301-0/+4
|
* Fix defer_open() fuction in the open code path to cope with a NULL lck ↵Jeremy Allison2012-06-301-11/+16
| | | | parameter.
* s3: Fix a typoVolker Lendecke2012-06-251-1/+1
| | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Mon Jun 25 17:13:59 CEST 2012 on sn-devel-104
* s3:util: rename procid_equal() to serverid_equal()Michael Adam2012-06-211-2/+2
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: Slightly simplify grant_fsp_oplock_typeVolker Lendecke2012-06-151-1/+3
| | | | | | The "else" is not necessary, we did a return in the if-branch Signed-off-by: Jeremy Allison <jra@samba.org>
* s3:smbd: change open.c to use fsp_fnum_dbg() for fsp->fnum logging.Michael Adam2012-06-151-4/+4
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: fix build on systems without O_NOFOLLOWBjörn Jacke2012-06-101-1/+1
|
* s3: handle non-POSIX compliant Tru64, NetBSD and FreeBSD errno on O_NOFOLLOW ↵Björn Jacke2012-06-101-1/+20
| | | | | | | | | | | | | symlink open calls or should we leave the NetBSD and FreeBSD platforms just broken? Actually these two *want* to have broken platforms as they use different errno's than POSIX demands *interntionally*. The POSIX errno ELOOP for O_NOFOLLOW open calls on symlinks is clear and unambiguous. See http://gnats.netbsd.org/43154 for the interesting NetBSD discussion on that. Autobuild-User(master): Björn Jacke <bj@sernet.de> Autobuild-Date(master): Sun Jun 10 16:10:02 CEST 2012 on sn-devel-104
* s3:smbd: change set_file_oplock() to return NTSTATUSMichael Adam2012-06-081-1/+2
| | | | | | | | Pair-Programmed-With: Volker Lendecke <vl@samba.org> Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Fri Jun 8 23:20:20 CEST 2012 on sn-devel-104
* s3: Replace an if with a boolean short circuitVolker Lendecke2012-06-081-5/+3
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* s3: Assigning ?True:False to a bool is a bit pointlessVolker Lendecke2012-06-081-3/+2
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* s3: Remove unnecessary ()Volker Lendecke2012-06-081-1/+1
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* s3:smbd: let fcb_or_dos_open() take a uint64_t vuidStefan Metzmacher2012-06-061-1/+1
| | | | metze
* s3:include: change files_struct->vuid to uint64_tStefan Metzmacher2012-06-061-2/+2
| | | | metze
* s3:smbd: fcb_or_dos_open() can be staticStefan Metzmacher2012-06-061-10/+10
| | | | metze
* Fix bug #8972 - Directory group write permission bit is set if unix ↵Jeremy Allison2012-06-051-2/+4
| | | | | | | | | | extensions are enabled We can't manipulate file_attributes if it's a posix call. I'll look at adding a test for this asap. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Tue Jun 5 04:26:11 CEST 2012 on sn-devel-104
* s3:smbd/open: avoid procid_is_me()Stefan Metzmacher2012-06-031-4/+5
| | | | metze
* Ensure we only return NT_STATUS_DELETE_PENDING if the share modes are valid.Jeremy Allison2012-05-251-3/+20
| | | | | | Ensure we only return *file_existed = true if there were valid share modes. Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: Check for serverid_exists in find_oplock_typesVolker Lendecke2012-05-251-0/+18
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: Check for serverid_exists in open_mode_checkVolker Lendecke2012-05-251-0/+5
| | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
* s3: Revert the serverid changes, they need more workVolker Lendecke2012-05-181-25/+0
| | | | | Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Fri May 18 13:12:14 CEST 2012 on sn-devel-104
* s3: Check for serverid_exists in find_oplock_typesVolker Lendecke2012-05-171-0/+20
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Check for serverid_exists in open_mode_checkVolker Lendecke2012-05-171-0/+5
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Remove an unused parameter from check_parent_access()Volker Lendecke2012-05-041-10/+3
|
* s3: In mkdir_internal, don't retrieve parent_dir from check_parent_accessVolker Lendecke2012-05-041-1/+1
| | | | We have already created that ourselves a few lines above
* s3: Fix a typoVolker Lendecke2012-05-041-1/+1
|
* s3: Remove a pointless else branchVolker Lendecke2012-02-191-2/+1
| | | | | Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Sun Feb 19 23:14:15 CET 2012 on sn-devel-104
* s3: get_share_mode_lock_fresh->get_share_mode_lockVolker Lendecke2012-02-191-9/+9
| | | | | | | get_share_mode_lock_fresh is just a confusing name Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Sun Feb 19 19:16:41 CET 2012 on sn-devel-104
* s3: get_share_mode_lock->get_existing_share_mode_lockVolker Lendecke2012-02-191-1/+2
|
* s3: files_struct->mode is only written, remove itVolker Lendecke2012-02-141-2/+0
| | | | | Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Tue Feb 14 19:14:29 CET 2012 on sn-devel-104
* s3: Simplify an if-statementVolker Lendecke2012-01-311-1/+1
| | | | | is_ntfs_default_stream_smb_fname already contains all checks that the variable "stream_name" gives us here.
* s3: Unify stream testing in open_directoryVolker Lendecke2012-01-311-9/+5
| | | | | | | | | | The second if-statement could never have kicked in, assuming the SMB_ASSERT above was right. Jeremy, please check! Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Tue Jan 31 20:15:36 CET 2012 on sn-devel-104
* s3: Re-indent an && sequence for better understandingVolker Lendecke2012-01-311-2/+2
|
* Another fix for bug #8556 - ACL permissions ignored when SMBsetatr is requested.Richard Sharpe2012-01-231-0/+1
| | | | | Prevent systems with "store dos attributes = yes" from overriding FILE_WRITE_ATTRIBUITES.
* Revert "Fix bug #8175 - smbd deadlock."Volker Lendecke2012-01-181-68/+26
| | | | This reverts commit 5a2b5b6cfed74e0e9c2965525995f64cdad7b7c9.
* s3: Put an indirection layer into share_mode_lockVolker Lendecke2012-01-121-19/+19
| | | | Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Introduce get_share_mode_lock_fresh()Volker Lendecke2012-01-121-9/+6
| | | | | | | | This slightly simplifies the code path for all callers which assume that a share mode exists already. Only the callers in open_file_ntcreate and open_directory will ever create new share modes. Signed-off-by: Jeremy Allison <jra@samba.org>
* s3: Remove the unused "file_existed" parameter from smbd_calculate_access_maskVolker Lendecke2012-01-031-3/+2
| | | | | Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Tue Jan 3 15:16:50 CET 2012 on sn-devel-104