summaryrefslogtreecommitdiffstats
path: root/source3/smbd/open.c
Commit message (Collapse)AuthorAgeFilesLines
* s3: Fix open path to delete streams depending on the create dispositionTim Prouty2009-01-091-0/+14
| | | | | The new create disposition test in smbtorture RAW-STREAMS verifies this fix.
* s3:smbd: move all globals and static variables in globals.[ch]Stefan Metzmacher2009-01-081-2/+1
| | | | | | The goal is to move all this variables into a big context structure. metze
* Fix a "nested extern" warningVolker Lendecke2008-12-311-1/+1
|
* Rename parent_dirname_talloc() to parent_dirname()Volker Lendecke2008-12-311-4/+2
|
* Fix an ancient uninitialized variable readVolker Lendecke2008-12-311-1/+1
| | | | The callers of open_file_ntcreate expect *psbuf to be filled correctly
* Fix bug #5979 - Level 2 oplocks being granted improperly,Jeremy Allison2008-12-171-65/+96
| | | | Jeremy.
* Fix a valgrind error in get_relative_fid_filenameVolker Lendecke2008-12-131-1/+1
| | | | | | | It doesn't really make sense to check the length of a not-yet-allocated string :-) Volker
* Fix error code when smbclient puts a file over an existing directoryVolker Lendecke2008-12-121-1/+1
| | | | | | | | | | | | | | | | | Windows returns NT_STATUS_FILE_IS_A_DIRECTORY, as does Samba 3.0. 3.2 and following returned NT_STATUS_INVALID_PARAMETER which is wrong. Before I converted reply_open_and_X to create_file() we called open_file_ntcreate directly. Passing through open&X for a filename that exists as a directory ends up in open_directory after having tried open_file_ntcreate. Some check in there returns NT_STATUS_INVALID_PARAMETER. With this additional FILE_NON_DIRECTORY_FILE flag we get the correct error message back from create_file_unixpath before trying open_directory(). Survives make test, but as this also touches the other open variants I would like others to review this. Volker
* s3: [3/3]: Fix a delete on close divergence from windows and the associated ↵Tim Prouty2008-12-091-3/+2
| | | | | | | torture test This third patch cleans up by removing all of the code that is made obsolete by the first patch. It should cause no functional changes.
* s3: [1/3] Fix a delete on close divergence from windows and the associated ↵Tim Prouty2008-12-091-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | torture test smbtorture4's BASE-DELETE:deltest17 was failing against win2k8, win2k3, and winXPsp2 but passing against samba. deltest17 does the following: 1. open file -> file is created 2. closes file 3. open file with DOC -> fnum1 4. check that DOC is not reported as being set from fnum1 5. opens file again Read Only -> fnum2 6. check that DOC is not reported as being set from either file handle 7. close fnum1 (the file handle that requested DOC to be set) 8. check if DOC is reported as being set from fnum2 * This is where windows and samba begin to diverge. Windows reports that the DOC bit is set, while samba reports that it is not set. 9. close fnum2 (the last remaining open handle for the file) 10.See if the file has been deleted. * On samba the file still exists. On windows the file was deleted. The way open_file_ntcreate is written now, if an open has the DOC bit set on the wire, DOC (fsp->initial_delete_on_close) is not set unless: a. the open creates the file, or b. there is an open file handle with a share_entry in the struct lck that has the SHARE_MODE_ALLOW_INITIAL_DELETE_ON_CLOSE bit set (let's call it SM_AIDOC). My understanding of SM_AIDOC is that it was added to differentiate between DOC being set on an open that creates a file vs an open that opens an existing. As described in step 8/10 above, it appears that windows does not make this differentiation. To resolve this issue there are three patches. This first patch is a simple proof of concept change that is sufficient to fix the bug. It removes the differentiation in open_file_ntcreate, and updates deltest17 to allow it to pass against win2k3/xp. This makes open_file_ntcreate more closely match the semantics in open_directory and rename_internals_fsp. This change also does not break any other tests in BASE-DELETE or "make test". Specifically test deltest20b which verifies the CIFSFS rename DOC semantics still passes :).
* s3: Refactor calculating path from relative_fid into a separate functionTim Prouty2008-12-091-78/+96
|
* s3: Refactor getting sec_info from a security_descriptor into separate functionTim Prouty2008-12-091-13/+2
|
* s3: Make a few open utility functions non-staticTim Prouty2008-12-091-16/+16
| | | | | This allows vfs modules that implement SMB_VFS_CREATE_FILE to access some of the useful utility functions.
* s3: Fix FILE_FLAG_POSIX_SEMANTICS handling underneath SMB_VFS_CREATE_FILETim Prouty2008-12-031-2/+2
|
* s3: Change SMB_VFS_CREATE_FILE to take a create_file_flags argumentTim Prouty2008-12-031-6/+6
| | | | | | This replaces the is_dos_path bool with a more future-proof argument. The next step is to plumb INTERNAL_OPEN_ONLY through this flag instead of overridding the oplock_request.
* s3: Simplify the create_file_unix_path->open_file_ntcreate pathTim Prouty2008-12-031-93/+38
| | | | | Also removed open_file_ntcreate/open_file from proto.h so they can no longer be called directly.
* s3: Modify direct caller of open_file to call SMB_VFS_CREATE_FILETim Prouty2008-12-031-4/+19
|
* s3: Modify direct callers of open_file_ntcreate and open_directory to call ↵Tim Prouty2008-12-031-8/+18
| | | | SMB_VFS_CREATE_FILE
* s3: Modify direct callers of create_file_unix_path to call SMB_VFS_CREATE_FILETim Prouty2008-12-031-16/+42
|
* s3: Add new "is_dos_path" argument to SMB_VFS_CREATE_FILETim Prouty2008-12-031-3/+4
| | | | | Now unix paths can be differentiated from windows paths so the underlying create_file implementations can convert paths correctly.
* s3: Add SMB_VFS_CREATE_FILE to the vfs layerTim Prouty2008-12-031-17/+17
| | | | Modify all callers of create_file to go through SMB_VFS_CREATE_FILE
* s3:smbd: close the low level fd of the base_fsp, if the file was createdStefan Metzmacher2008-12-011-0/+2
| | | | metze
* s3:smbd: only try and fallback to open a directory if it's not a stream openStefan Metzmacher2008-12-011-0/+7
| | | | metze
* s3:smbd: wildcard characters are allowed in stream namesStefan Metzmacher2008-12-011-1/+11
| | | | | | We only check the filename of the basefile now. metze
* Rever 83ff6979f504d50caf725ee62549604630b69be7 - "Fix the logic bug that ↵Jeremy Allison2008-11-211-7/+1
| | | | | | | | caused us to run into kernel oplocks on an open for a stream inside a file with stream_xattr module. On opening the base_fsp we must break existing oplocks." as it broke make test. Jeremy.
* Fix the logic bug that caused us to run into kernel oplocks on an open for a ↵Jeremy Allison2008-11-211-1/+7
| | | | | | stream inside a file with stream_xattr module. On opening the base_fsp we must break existing oplocks. Jeremy.
* Second part of the fix for bug #5903 - vfs_streams_xattr breaks contents of ↵Jeremy Allison2008-11-211-15/+46
| | | | | | | the file (also fix a bad merge of the previous patch from 3.3). Jeremy.
* First part of fix for bug #5903 - vfs_streams_xattr breaks contents of the file.Jeremy Allison2008-11-211-61/+82
| | | | | | Restructures parts of open code so that fsp must be allocated before calling open_file_ntcreate(_internal). Also fix up file ref-counting inside files.c. Jeremy.
* Don't call FSET_NT_ACL on file create if there's no SD to set. Leave the ↵Jeremy Allison2008-11-061-1/+6
| | | | | | default ACL in place. Jeremy.
* Pass all of RAW-ACLS except for inheritence. Working on that next.Jeremy Allison2008-11-041-2/+79
| | | | Jeremy.
* Pass the directory versions of the RAW-ACL (still not inheritance). Refactor ↵Jeremy Allison2008-11-031-43/+83
| | | | | | some common code between open_file_ntcreate() and open_directory(). Jeremy.
* Pass all the non-inherited S4 RAW-ACL tests.Jeremy Allison2008-11-031-14/+4
| | | | Jeremy.
* Get closer to passing S4 RAW-ACLs.Jeremy Allison2008-10-311-5/+42
| | | | Jeremy.
* Start moving us closer to passing S4 RAW-ACL test using the vfs_acl_xattr ↵Jeremy Allison2008-10-301-0/+9
| | | | | | module. Inheritance fails at the moment though. Jeremy.
* Use {u,}int64_t instead of SMB_BIG_{U,}INT.Jelmer Vernooij2008-10-141-3/+3
|
* Pass struct smb_request to file_freeVolker Lendecke2008-10-131-26/+26
| | | | on the way to get rid of chain_fsp
* Pass struct smb_request to file_newVolker Lendecke2008-10-131-9/+11
| | | | Goal is to remove the chain_fsp global variable
* Pass struct smb_request to file_fspVolker Lendecke2008-10-131-1/+1
| | | | The goal is to get rid of the chain_fsp global variable
* For the vfs_acl_xattr.c module, make sure we map GENERIC file and directory bitsJeremy Allison2008-10-081-0/+4
| | | | | | | to specific bits every time a security descriptor is set. The S4 torture suite proves that generic bits are not returned when querying an ACL set using them (ie. only the specific bits are stored on disk). Jeremy.
* Fix bug #5797 - Moving readonly files fails. Reported by infomail@lordb.de.Jeremy Allison2008-09-261-3/+1
| | | | | | | | We don't need to deny a DELETE open on a readonly file (I'm also adding a s4 torture test for this), the set_file_disposition call will return NT_STATUS_CANNOT_DELETE if the delete-on-close bit is set on a readonly file (and we already do this). Jeremy.
* Fix bug 5761 "open of mangled directory name results in 'is a stream name'"Jeremy Allison2008-09-151-3/+7
| | | | | reported by Regan Heath <Regan.Heath@BridgeHeadSoftware.com>. Jeremy.
* smbd: fix the handling of create_options to pass RAW-OPENStefan Metzmacher2008-08-201-0/+5
| | | | | | | | | Some of the bits generate INVALID_PARAMETER and some bits are ignored when they come from a client, that's why we need to use bits from the ignored range for our internal usage. metze (This used to be commit 7b4c8a4e39f310eb450918fa841b0ea1b4af19f7)
* If we're not allowing streams on this conn ptr,Jeremy Allison2008-07-241-0/+5
| | | | | | | then don't allow create_file() to call down to create_file_unixpath() with a stream name. Jeremy. (This used to be commit 167d611b525db6d103a7f83fd5a19792be4e7745)
* Remove current_user reference from printfsp.cVolker Lendecke2008-06-261-1/+1
| | | | (This used to be commit 510f45d01a19ce1c226755ac42a328241098b2e0)
* Wrap the unix token info in a unix_user_token in auth_serversupplied_infoVolker Lendecke2008-06-191-3/+4
| | | | | No functional change, this is a preparation for more current_user ref removal (This used to be commit dcaedf345e62ab74ea87f0a3fa1e3199c75c5445)
* Remove the current_user references from open.cVolker Lendecke2008-06-151-6/+4
| | | | | | current_user_info was "only" used in a debug msg, and current_user.ut.uid is also available via conn->server_info (This used to be commit d0386914ff0f7b0f1edc3302fdc6a25f211712fa)
* Remove the current_user reference from fake_file.cVolker Lendecke2008-06-151-1/+2
| | | | | | The current vuid is not only available there, it is also in the current smb_request structure. (This used to be commit c8fd5eef32a86888c7a28317f0fdf717a26b7d4c)
* Remove "user" from connection_structVolker Lendecke2008-05-101-2/+3
| | | | (This used to be commit 368454a27cb53a408ec416cbf37235b304592fb5)
* Remove the "stat_open()" function, flag, and all associated code. It was onlyJeremy Allison2008-05-021-55/+1
| | | | | | | | being (correctly) used in the can_read/can_write checks for hide unreadable/unwritable and this is more properly done using the functions in smbd/file_access.c. Preparing to do NT access checks on all file access. Jeremy. (This used to be commit 6bfb06ad95963ae2acb67c4694a98282d3b29faa)
* Rename inherit_access_acl() -> inherit_access_posix_acl() to make use clear.Jeremy Allison2008-05-021-2/+2
| | | | | Jeremy. (This used to be commit b739c7f1cdb2b19a380b06681b00dcf490d788a9)