summaryrefslogtreecommitdiffstats
path: root/source3/smbd/open.c
Commit message (Collapse)AuthorAgeFilesLines
* s3-secdesc: use SEC_FLAG_SYSTEM_SECURITY instead of SEC_RIGHT_SYSTEM_SECURITY.Günther Deschner2009-04-281-4/+4
| | | | | | Guenther (cherry picked from commit da92e54236293460e307edd52ca7f1e20c6f23ef) (cherry picked from commit 3e9ee3fa54b514987f40a477b3049b18e87390e9)
* Fix bug #6254 - PUT/GET produces an error in IPv6 to a smb-server(3.3) has ↵Jeremy Allison2009-04-151-18/+23
| | | | | | | | | | | | parameter "msdfs root = yes" This was broken by the refactoring around create_file(). MSDFS pathname processing must be done FIRST. MSDFS pathnames containing IPv6 addresses can be confused with NTFS stream names (they contain ":" characters. Jeremy. (cherry picked from commit b8251a7e01304afce96cb0bee15a1fee2bd57490)
* Fix bug #6186 - map readonly does not workJeremy Allison2009-03-121-3/+25
| | | | Jeremy.
* Fix bug #6160 - Office 2007 fails saving files to a Samba mapped drive.Jeremy Allison2009-03-051-0/+22
| | | | | Confirmed by reporters. Jeremy.
* s3: Change open_streams_for_delete to call through the vfs layerTim Prouty2009-03-041-5/+7
| | | | This eliminates the last direct caller of create_file_unixpath
* Second part of fix for #6154, ensure we return max accessJeremy Allison2009-03-041-0/+9
| | | | | if admin user. Jeremy.
* Fix bug #6082 - smbd_gpfs_getacl failed: Windows client can´t rename orJeremy Allison2009-02-281-0/+19
| | | | | delete file (directory fix). Jeremy.
* More warning fixes for Solaris.Jeremy Allison2009-02-231-1/+1
| | | | Jeremy.
* S3: Detect max_open_files from systemtodd stecher2009-02-201-0/+12
| | | | | - Attempt to use syscalls to determine max-open-files value. - Add in periodic logging when max file limit reached
* s3: Add extid to the dev/inode pairTim Prouty2009-02-191-2/+2
| | | | | | | | | | | This extends the file_id struct to add an additional generic uint64_t field: extid. For backwards compatibility with dev/inodes stored in xattr_tdbs and acl_tdbs, the ext id is ignored for these databases. This patch should cause no functional change on systems that don't use SMB_VFS_FILE_ID_CREATE to set the extid. Existing code that uses the smb_share_mode library will need to be updated to be compatibile with the new extid.
* s3: Fix bug opening streams with truncating dispositionTim Prouty2009-02-181-1/+1
| | | | | | | Do not attempt to delete streams on a truncating open, if the name we're opening is itself a stream. Port 176e8857203944bc332844b700749120ce90c891 to standard open path
* Fix bug #Bug 6090 renaming or deleting a "not matching/resolving" symlink is ↵Jeremy Allison2009-02-041-20/+34
| | | | | | | | | | failing. Reported by Kukks. Make sure we correctly use LSTAT in all cases where POSIX pathnames are being used. This matters when dealing with symlinks pointing to invalid paths being renamed or deleted not all deletes and renames are done via an nt_create open. Jeremy.
* Fix bug #6082 - smbd_gpfs_getacl failed: Windows client can´t rename or ↵Jeremy Allison2009-02-021-10/+46
| | | | | | | | | delete file This fixes the generic rename/delete problem for 3.3.0 and above. Fixed slightly differently to discussions, user viewable modified ACLs are not a good idea :-). Jeremy.
* 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