summaryrefslogtreecommitdiffstats
path: root/source3/smbd/close.c
Commit message (Collapse)AuthorAgeFilesLines
* s3-auth struct security_unix_token replaces UNIX_USER_TOKENAndrew Bartlett2011-03-011-2/+2
|
* Fix bug found against the new Mac client @ Connectathon. Mac clientsJeremy Allison2011-02-231-1/+9
| | | | | | | | don't open with FILE_WRITE_ATTRIBUTES when just doing a write, so updating the write time on close fails as smb_set_file_time() now (correctly) checks for FILE_WRITE_ATTRIBUTES in the access_mask before allowing client time update. This is an internal time update being done on a close, not a handle-based client request.
* s3-auth Rename auth_serversupplied_info varaiables: server_info -> session_infoAndrew Bartlett2011-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | | These variables, of type struct auth_serversupplied_info were poorly named when added into 2001, and in good consistant practice, this has extended all over the codebase in the years since. The structure is also not ideal for it's current purpose. Originally intended to convey the results of the authentication modules, it really describes all the essential attributes of a session. This rename will reduce the volume of a future patch to replaced these with a struct auth_session_info, with auth_serversupplied_info confined to the lower levels of the auth subsystem, and then eliminated. (The new structure will be the output of create_local_token(), and the change in struct definition will ensure that this is always run, populating local groups and privileges). Andrew Bartlett Signed-off-by: Stefan Metzmacher <metze@samba.org>
* Put OpenDir() back the way it was - don't overload with an fsp arg. Create ↵Jeremy Allison2011-02-101-2/+1
| | | | | | | OpenDir_fsp for new usage. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Feb 10 02:43:31 CET 2011 on sn-devel-104
* Allow SMB2_FIND to actually use the open fd handle if we support fdopendir. ↵Jeremy Allison2011-02-091-1/+2
| | | | Fallback to pathname opendir if not.
* Pass fsp to dptr_CloseDir(). Cope with setting the fd if we're closing an fd ↵Jeremy Allison2011-02-081-4/+0
| | | | that opendir knows about.
* Fix bug #7863 - Unlink may unlink wrong file when hardlinks are involved.Jeremy Allison2011-01-251-25/+34
| | | | | | Do this by keeping a linked list of delete on close tokens, one for each filename that identifies a path to the dev/inode. Use the jenkins hash of the pathname to identify the correct token.
* s3: Fix a deadlock between smbd and ctdbdVolker Lendecke2011-01-211-4/+18
| | | | | | | | | | | | Do the notification after we released the share mode lock. Inside notify_fname we take out another tdb lock. With ctdb also accessing our databases, this can lead to deadlocks. Putting this notify after the TALLOC_FREE(lck) above we avoid locking two records simultaneously. Notifies are async and informational only, so calling the notify_fname without holding the share mode lock should not do any harm. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Fri Jan 21 12:29:21 CET 2011 on sn-devel-104
* s3: Remove smbd_server_conn from msg_close_fileVolker Lendecke2010-10-031-1/+8
|
* s3: Attempt to fix a ton of warnings on the build farmVolker Lendecke2010-10-031-0/+1
|
* s3: Lift smbd_server_conn from file_find_difVolker Lendecke2010-09-281-1/+1
|
* s3: Remove smbd_messaging_context() from send_stat_cache_delete_message()Volker Lendecke2010-08-071-1/+2
|
* s3-smbd: Migrated to new spoolss functions for printing.Simo Sorce2010-07-271-1/+3
| | | | Signed-off-by: Jim McDonough <jmcd@samba.org>
* s3: Remove smbd_messaging_context() from close_normal_file()Volker Lendecke2010-07-051-1/+1
|
* s3: Remove smbd_messaging_context() from notify_deferred_opens()Volker Lendecke2010-07-051-4/+5
|
* Fix a long-standing bug with async io that would only be triggered by SMB2.Jeremy Allison2010-06-041-5/+5
| | | | | | | | | On normal or shutdown close, ensure we wait for any pending IO to complete before returning. Implement a blocking aio_suspend inside vfs_aio_fork.c. These changes pass make test when the aio_fork module is used by default on the test shares. Jeremy.
* Make us pass all SMB2 lock tests except MULTIPLE-UNLOCK and CONTEXT. Them ↵Jeremy Allison2010-05-071-1/+1
| | | | | | next :-). Jeremy.
* s3: only include gen_ndr headers where needed.Günther Deschner2010-05-061-0/+1
| | | | | | | | | | | | | | | | | This shrinks include/includes.h.gch by the size of 7 MB and reduces build time as follows: ccache build w/o patch real 4m21.529s ccache build with patch real 3m6.402s pch build w/o patch real 4m26.318s pch build with patch real 3m6.932s Guenther
* Plumb SMB2 stubs into all the places we defer SMB1 operations.Jeremy Allison2010-04-091-1/+1
| | | | | | | | Rename functions to be internally consistent. Next step is to cope queueing single (non-compounded) SMB2 requests to put some code inside the stubs. Jeremy.
* Switch over to using get_currect_XXX() accessor functions.Jeremy Allison2010-03-151-7/+5
| | | | Jeremy.
* Rever e80ceb1d7355c8c46a2ed90d5721cf367640f4e8 "Remove more uses of "extern ↵Jeremy Allison2010-03-151-5/+7
| | | | | | | | struct current_user current_user;"." As requested by Volker, split this into smaller commits. Jeremy.
* Remove more uses of "extern struct current_user current_user;".Jeremy Allison2010-03-121-7/+5
| | | | | | | | | | | | | Use accessor functions to get to this value. Tidies up much of the user context code. Volker, please look at the changes in smbd/uid.c to familiarize yourself with these changes as I think they make the logic in there cleaner. Cause smbd/posix_acls.c code to look at current user context, not stored context on the conn struct - allows correct use of these function calls under a become_root()/unbecome_root() pair. Jeremy.
* Fix bug #7033 - SMBrmdir call always returns true, even on failure to delete ↵Jeremy Allison2010-01-121-2/+6
| | | | | | | | a directory. Argh. Missed the second (and essential) part of the fix for the above :-(. Jeremy
* Fix bug #6876 - Delete of an object whose parent folder does not have delete ↵Jeremy Allison2010-01-121-0/+3
| | | | | | | | | | rights fails even if the delete right is set on the object. Final fix for the vfs_acl_xattr and vfs_acl_tdb code. Ensure we can delete a file even if the underlying POSIX permissions don't allow it, if the Windows permissions do. Jeremy.
* Refactor reply_rmdir to use handle based code. AllJeremy Allison2009-12-031-2/+258
| | | | | | calls are now handle based. Put rmdir into close.c and make it private. Jeremy.
* s3: "check_magic" only looks at the sizeVolker Lendecke2009-11-291-1/+1
|
* s3: Pass the "fake dir create times" parameter to sys_*statVolker Lendecke2009-11-291-1/+1
| | | | Step 0 to restore it as a per-share paramter
* Got the logic simplification worked out so we still passJeremy Allison2009-11-051-22/+37
| | | | | BASE-DELAYWRITE and also RAW-CLOSE. Jeremy.
* Revert commit "0551284dc08eb93ef7b2b2227a45e5ec21d482fb" - simplifyJeremy Allison2009-11-051-7/+27
| | | | | the logic. This was incorrect (I'll revisit this tomorrow). Jeremy.
* Simplify the logic - remove extraneous argument and calls to ↵Jeremy Allison2009-11-051-27/+7
| | | | | | | | set_close_write_time(). We were treating a file time set on close as a sticky write time set, and I don't think it is. I will add a torture test later to RAW-CLOSE to confirm this. Jeremy.
* Fix explicit set of write time on close.Jeremy Allison2009-11-051-1/+5
| | | | Jeremy.
* Get closer to an accurate model of Windows timestamp changes.Jeremy Allison2009-11-051-2/+19
| | | | | | | | "Normal" non truncate writes always cause the timestamp to be set on close. Once a close is done on a handle this can reset the sticky write time to current time also. Updated smbtorture4 confirms this. Jeremy.
* Remove lots of duplicate code and move it into oneJeremy Allison2009-10-021-22/+7
| | | | | | function vfs_stat_fsp(). Stops code looking at fsp->posix_open except for exceptional circumstances. Jeremy.
* s3:smbd: store a dirptr on the files_struct for SMB2 Query DirectoryStefan Metzmacher2009-08-191-0/+4
| | | | metze
* s3: Remove unnecessary callers of get_full_smb_filenameTim Prouty2009-07-211-4/+1
| | | | | | | This often times means explicitly denying certain operations on a stream as they are not supported or don't make sense at a particular level. At some point in the future these can be enabled, but for now it's better to remove ambiguity
* s3: Change fsp->fsp_name to be an smb_filename struct!Tim Prouty2009-07-201-93/+70
|
* s3: Plumb smb_filename through SMB_VFS_NTIMESTim Prouty2009-07-061-14/+21
|
* s3: Plumb smb_filename through SMB_VFS_UNLINKTim Prouty2009-07-061-35/+67
|
* s3: Plumb smb_filename through SMB_VFS_STAT and SMB_VFS_LSTATTim Prouty2009-06-241-4/+6
| | | | | | | | | | | | | This patch introduces two new temporary helper functions vfs_stat_smb_fname and vfs_lstat_smb_fname. They basically allowed me to call the new smb_filename version of stat, while avoiding plumbing it through callers that are still too inconvenient. As the conversion moves along, I will be able to remove callers of this, with the goal being to remove all callers. There was also a bug in create_synthetic_smb_fname_split (also a temporary utility function) that caused it to incorrectly handle filenames with ':'s in them when in posix mode. This is now fixed.
* Check for error in transfer_file return also.Jeremy Allison2009-06-121-1/+7
| | | | Jeremy.
* Fix bug 6440Volker Lendecke2009-06-121-11/+19
| | | | Don't ignore the close error of the output file in check_magic()
* Simplify close_normal_file()Volker Lendecke2009-06-121-22/+21
|
* Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STATVolker Lendecke2009-05-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch introduces struct stat_ex { dev_t st_ex_dev; ino_t st_ex_ino; mode_t st_ex_mode; nlink_t st_ex_nlink; uid_t st_ex_uid; gid_t st_ex_gid; dev_t st_ex_rdev; off_t st_ex_size; struct timespec st_ex_atime; struct timespec st_ex_mtime; struct timespec st_ex_ctime; struct timespec st_ex_btime; /* birthtime */ blksize_t st_ex_blksize; blkcnt_t st_ex_blocks; }; typedef struct stat_ex SMB_STRUCT_STAT; It is really large because due to the friendly libc headers playing macro tricks with fields like st_ino, so I renamed them to st_ex_xxx. Why this change? To support birthtime, we already have quite a few #ifdef's at places where it does not really belong. With a stat struct that we control, we can consolidate the nanosecond timestamps and the birthtime deep in the VFS stat calls. At this moment it is triggered by a request to support the birthtime field for GPFS. GPFS does not extend the system level struct stat, but instead has a separate call that gets us the additional information beyond posix. Without being able to do that within the VFS stat calls, that support would have to be scattered around the main smbd code. It will very likely break all the onefs modules, but I think the changes will be reasonably easy to do.
* Fix more POSIX path lstat calls. Fix bug where close can returnJeremy Allison2009-02-251-5/+17
| | | | | | | | | failure if we have a pending modtime and the containing directory of the file has been renamed (there is no POSIX "update time by fd" call). This can't happen on Windows as the rename will fail if there are open files beneath it. Will add a torture test for this. Jeremy.
* s3 oplocks: Remove oplocks before handling delete on close semanticsTim Prouty2009-02-091-4/+5
| | | | | | Unlinking a file while still holding an oplock can cause problems with kernel oplocks. This simply releases the oplock before actually unlinking the file.
* s3 oplocks: Add capabilites flags field to the kernel_oplocks structTim Prouty2009-02-091-0/+4
| | | | | | | | | | | | | | | | Here is a short description for each of the new capability flags: KOPLOCKS_LEVEL2_SUPPORTED: Level 2 oplocks are supported natively in the kernel. KOPLOCKS_DEFERRED_OPEN_NOTIFICATION: The kernel notifies deferred openers when they can retry the open. KOPLOCKS_TIMEOUT_NOTIFICATION: The kernel notifies smbds when an oplock break times out. KOPLOCKS_OPLOCK_BROKEN_NOTIFICATION: The kernel notifies smbds when an oplock is broken.
* Extend NTIMES to allow setting create_timetodd stecher2009-01-231-4/+4
| | | | | | | | | 1) Add in smb_file_time struct to clarify code and make room for createtime. 2) Get and set create time from SMB messages. 3) Fixup existing VFS modules + examples Some OS'es allow for the setting of the birthtime through kernel interfaces. This value is generically used for Windows createtime, but is not settable in the code today.
* s3: Add delete_all_streams to proto.hTim Prouty2009-01-091-1/+1
|
* Fix bug #6017, - magic script does not work. based on a patch from ↵Jeremy Allison2009-01-061-3/+13
| | | | | | monyo@samba.gr.jp. Jeremy.
* s3: Call fd_close from close_directoryTim Prouty2008-12-091-0/+7
| | | | | | | | | Some implementations of SMB_VFS_CREATE_FILE implementations actually keep an fd open for directories just as files. In this case it is necessary to call fd_close when closing directories. This is safe because fd_close is a no-op when fd == -1, which is true for directory opens originating from open.c (the default SMB_VFS_CREATE_FILE implementation).