summaryrefslogtreecommitdiff
path: root/source3/smbd/open.c
AgeCommit message (Collapse)AuthorFilesLines
2012-07-18loadparm: make the source3/ lp_ functions take an explicit TALLOC_CTX *.Rusty Russell1-1/+1
They use talloc_tos() internally: hoist that up to the callers, some of whom don't want to us talloc_tos(). A simple patch, but hits a lot of files. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-07-12Set fsp->initial_allocation_size before calling open_file_ntcreate().Jeremy Allison1-0/+5
Allows an SMB_VFS_OPEN() vfs module to do something interesting with the request.
2012-07-12Make sure we reset fsp->initial_allocation_size to zero if we didn't create ↵Jeremy Allison1-0/+2
the file. This will become important as we set fsp->initial_allocation_size before create.
2012-07-10Cope with a (non-security) open race we've had for ever as NTCreateX isn't ↵Jeremy Allison1-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
2012-07-10Now we have a guaranteed indication of a file being created, use it to set ↵Jeremy Allison1-12/+8
the create disposition correctly.
2012-07-10Add function fd_open_atomic() which uses O_CREAT|O_EXCL to return a ↵Jeremy Allison1-4/+107
guaranteed indication of creation of a new file.
2012-07-10Simplify the logic in open_file() some more.Jeremy Allison1-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
2012-07-09Simplify the logic in open_file().Jeremy Allison1-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.
2012-07-09Make check_same_stat() and check_same_dev_ino() common functions.Jeremy Allison1-29/+0
2012-07-09Factor out check_same_dev_ino() from check_same_stat() so it can be called ↵Jeremy Allison1-2/+15
separately.
2012-07-03s3-smbd: Remove deprecated 'share modes' option.Andreas Schneider1-4/+0
2012-06-30Don't allow asynchronous creates to be canceled in SMB2.Jeremy Allison1-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
2012-06-30Allow for async opens.Jeremy Allison1-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.
2012-06-30Add new bool field async_open to struct deferred_open_record. Not used yet.Jeremy Allison1-0/+4
2012-06-30Fix defer_open() fuction in the open code path to cope with a NULL lck ↵Jeremy Allison1-11/+16
parameter.
2012-06-25s3: Fix a typoVolker Lendecke1-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
2012-06-21s3:util: rename procid_equal() to serverid_equal()Michael Adam1-2/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-15s3: Slightly simplify grant_fsp_oplock_typeVolker Lendecke1-1/+3
The "else" is not necessary, we did a return in the if-branch Signed-off-by: Jeremy Allison <jra@samba.org>
2012-06-15s3:smbd: change open.c to use fsp_fnum_dbg() for fsp->fnum logging.Michael Adam1-4/+4
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-10s3: fix build on systems without O_NOFOLLOWBjörn Jacke1-1/+1
2012-06-10s3: handle non-POSIX compliant Tru64, NetBSD and FreeBSD errno on O_NOFOLLOW ↵Björn Jacke1-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
2012-06-08s3:smbd: change set_file_oplock() to return NTSTATUSMichael Adam1-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
2012-06-08s3: Replace an if with a boolean short circuitVolker Lendecke1-5/+3
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-08s3: Assigning ?True:False to a bool is a bit pointlessVolker Lendecke1-3/+2
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-08s3: Remove unnecessary ()Volker Lendecke1-1/+1
Signed-off-by: Michael Adam <obnox@samba.org>
2012-06-06s3:smbd: let fcb_or_dos_open() take a uint64_t vuidStefan Metzmacher1-1/+1
metze
2012-06-06s3:include: change files_struct->vuid to uint64_tStefan Metzmacher1-2/+2
metze
2012-06-06s3:smbd: fcb_or_dos_open() can be staticStefan Metzmacher1-10/+10
metze
2012-06-05Fix bug #8972 - Directory group write permission bit is set if unix ↵Jeremy Allison1-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
2012-06-03s3:smbd/open: avoid procid_is_me()Stefan Metzmacher1-4/+5
metze
2012-05-25Ensure we only return NT_STATUS_DELETE_PENDING if the share modes are valid.Jeremy Allison1-3/+20
Ensure we only return *file_existed = true if there were valid share modes. Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-25s3: Check for serverid_exists in find_oplock_typesVolker Lendecke1-0/+18
Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-25s3: Check for serverid_exists in open_mode_checkVolker Lendecke1-0/+5
Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-05-18s3: Revert the serverid changes, they need more workVolker Lendecke1-25/+0
Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Fri May 18 13:12:14 CEST 2012 on sn-devel-104
2012-05-17s3: Check for serverid_exists in find_oplock_typesVolker Lendecke1-0/+20
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-05-17s3: Check for serverid_exists in open_mode_checkVolker Lendecke1-0/+5
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-05-04s3: Remove an unused parameter from check_parent_access()Volker Lendecke1-10/+3
2012-05-04s3: In mkdir_internal, don't retrieve parent_dir from check_parent_accessVolker Lendecke1-1/+1
We have already created that ourselves a few lines above
2012-05-04s3: Fix a typoVolker Lendecke1-1/+1
2012-02-19s3: Remove a pointless else branchVolker Lendecke1-2/+1
Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Sun Feb 19 23:14:15 CET 2012 on sn-devel-104
2012-02-19s3: get_share_mode_lock_fresh->get_share_mode_lockVolker Lendecke1-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
2012-02-19s3: get_share_mode_lock->get_existing_share_mode_lockVolker Lendecke1-1/+2
2012-02-14s3: files_struct->mode is only written, remove itVolker Lendecke1-2/+0
Autobuild-User: Volker Lendecke <vl@samba.org> Autobuild-Date: Tue Feb 14 19:14:29 CET 2012 on sn-devel-104
2012-01-31s3: Simplify an if-statementVolker Lendecke1-1/+1
is_ntfs_default_stream_smb_fname already contains all checks that the variable "stream_name" gives us here.
2012-01-31s3: Unify stream testing in open_directoryVolker Lendecke1-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
2012-01-31s3: Re-indent an && sequence for better understandingVolker Lendecke1-2/+2
2012-01-23Another fix for bug #8556 - ACL permissions ignored when SMBsetatr is requested.Richard Sharpe1-0/+1
Prevent systems with "store dos attributes = yes" from overriding FILE_WRITE_ATTRIBUITES.
2012-01-18Revert "Fix bug #8175 - smbd deadlock."Volker Lendecke1-68/+26
This reverts commit 5a2b5b6cfed74e0e9c2965525995f64cdad7b7c9.
2012-01-12s3: Put an indirection layer into share_mode_lockVolker Lendecke1-19/+19
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-01-12s3: Introduce get_share_mode_lock_fresh()Volker Lendecke1-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>