summaryrefslogtreecommitdiff
path: root/source3/smbd/open.c
AgeCommit message (Collapse)AuthorFilesLines
2012-09-10s3: delete requests are not specialVolker Lendecke1-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>
2012-09-08s3:smbd: make fd_open() publicMichael Adam1-4/+4
2012-09-08s3:smbd: don't set kernel flock if "kernel share modes = no"Michael Adam1-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
2012-09-08s3:smbd: add disconnected checks to the open code.Stefan Metzmacher1-0/+31
(delay_for_batch_oplocks, open_mode_check, and delay_for_exclusive_oplocks) Pair-Programmed-With: Michael Adam <obnox@samba.org>
2012-09-05Remove an unncessary FTRUNCATE call in the open path. We can rely on O_TRUC.Jeremy Allison1-29/+1
Suggested by Volker.
2012-09-05s3: Slightly simplify fd_open_atomicVolker Lendecke1-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
2012-09-04s3: Put a comment into the right placeVolker Lendecke1-4/+5
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-09-04s3: Factor out disposition_to_open_flagsVolker Lendecke1-24/+57
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-09-04s3: Factor out calculation of clear_adsVolker Lendecke1-5/+17
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-09-04s3: Slightly simplify open_file_ntcreateVolker Lendecke1-5/+5
We have not set flags2 before, so do direct assignment and not |= Signed-off-by: Jeremy Allison <jra@samba.org>
2012-09-04s3: Make "open_match_attributes" staticVolker Lendecke1-6/+6
Signed-off-by: Jeremy Allison <jra@samba.org>
2012-09-01s3: Make an if statement a bit easier to readVolker Lendecke1-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
2012-08-31Change the S3 fileserver over to se_file_access_check().Jeremy Allison1-6/+9
Don't set the priv_open_requested yet until the open-for-backup request is correctly passed in.
2012-08-30Change the other two places where we set a security descriptor given by the ↵Jeremy Allison1-5/+1
client to got through set_sd(), the canonicalize sd function.
2012-07-31s3: Make request_timed_out() staticVolker Lendecke1-2/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org>
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>