summaryrefslogtreecommitdiffstats
path: root/source/smbd/close.c
Commit message (Collapse)AuthorAgeFilesLines
* Allow server manager to close open files selected by id.Jeremy Allison2008-05-271-0/+34
| | | | Jeremy.
* Remove "user" from connection_structVolker Lendecke2008-05-101-1/+1
|
* Remove the "stat_open()" function, flag, and all associated code. It was onlyJeremy Allison2008-05-021-16/+0
| | | | | | | 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.
* smbd: implement the strange write time update logicStefan Metzmacher2008-04-071-5/+73
| | | | | | | | | | | | | | | | | | | | We now never call file_ntimes() directly, every update is done via smb_set_file_time(). This let samba3 pass the BASE-DELAYWRITE test. The write time is only updated 2 seconds after the first write() on any open handle to the current time (not the time of the first write). Each handle which had write requests updates the write time to the current time on close(). If the write time is set explicit via setfileinfo or setpathinfo the write time is visible directly and a following close on the same handle doesn't update the write time. metze
* locking: store the write time in the locking.tdbStefan Metzmacher2008-04-071-2/+4
| | | | | | | | | This is needed to implement the strange write time update logic later. We need to store 2 time timestamps to distinguish between the time the file system had before the first client opened the file and a forced timestamp update. metze
* smbd: always close the base_fsp even if the real close returned an errorStefan Metzmacher2008-04-011-4/+0
| | | | | | | | Otherwise we may end up with share mode entry without an open file. Volker, Jeremy: please check... metze
* Add streams supportVolker Lendecke2008-01-191-4/+111
| | | | | | | | | | This is the core of the streams support. The main change is that in files_struct there is now a base_fsp pointer that holds the main file open while a stream is open. This is necessary to get the rather strange delete semantics right: You can't delete the main file while a stream is open without FILE_SHARE_DELETE, and while a stream is open a successful unlink of the main file leads to DELETE_PENDING for all further access on the main file or any stream.
* Fix a build warning.Günther Deschner2008-01-111-0/+1
| | | | Guenther
* Don't switch user contexts unless you have to. SavesJeremy Allison2008-01-101-14/+25
| | | | | a bunch of syscalls on close. Noticed by Volker. Jeremy.
* use talloc_tos in a few more placesVolker Lendecke2008-01-101-2/+2
|
* Remove redundant connection_struct from check_magic() parameter list.Michael Adam2007-12-221-2/+3
| | | | Michael
* Remove redundant connection_struct from fd_close() parameter list.Michael Adam2007-12-221-1/+1
| | | | Michael
* smbd: close_stat() should be staticStefan Metzmacher2007-11-231-1/+1
| | | | metze
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-4/+4
| | | | | | | bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy.
* [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.samba-misc-tags/initial-v3-2-testGerald (Jerry) Carter2007-10-101-3/+17
|
* r25118: More pstring elimination.Jeremy Allison2007-10-101-45/+58
| | | | Jeremy.
* r25117: The mega-patch Jerry was waiting for. Remove all pstrings fromJeremy Allison2007-10-101-1/+2
| | | | | | | | the main server code paths. We should now be able to cope with paths up to PATH_MAX length now. Final job will be to add the TALLOC_CTX * parameter to unix_convert to make it explicit (for Volker). Jeremy.
* r25055: Add file_id_string_tosVolker Lendecke2007-10-101-2/+2
| | | | This removes file_id_string_static and file_id_string_static2
* r24464: Now Volker removed the readbmpx we don't need cached errors any more.Jeremy Allison2007-10-101-1/+0
| | | | Jeremy.
* r24120: add a file_id_create() hook into the VFS layerStefan Metzmacher2007-10-101-1/+1
| | | | | | | it's needed for some cluster filesystems to overload this function. metze
* r23906: Fix POSIX unlink bug found by Steve. If weJeremy Allison2007-10-101-2/+9
| | | | | | used lstat during the open (which we always do for POSIX) then use lstat for the unlink. Jeremy.
* r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-10-101-2/+1
|
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-101-1/+1
| | | | Jeremy.
* r23183: Check in a change made by Tridge:Volker Lendecke2007-10-101-7/+10
| | | | | | | | | | | | | This replaces the internal explicit dev/ino file id representation by a "struct file_id". This is necessary as cluster file systems and NFS don't necessarily assign the same device number to the shared file system. With this structure in place we can now easily add different schemes to map a file to a unique 64-bit device node. Jeremy, you might note that I did not change the external interface of smb_share_modes.c. Volker
* r22868: Replace some message_send_pid calls with messaging_send_pid calls. MoreVolker Lendecke2007-10-101-2/+4
| | | | tomorrow.
* r22846: Chunk one to replace message_send_pid with messaging_send: Deep insideVolker Lendecke2007-10-101-1/+1
| | | | | | locking/locking.c we have to send retry messages to timed lock holders. The majority of this patch passes a "struct messaging_context" down there. No functional change, survives make test.
* r22784: fixed change notify for delete on closeAndrew Tridgell2007-10-101-0/+4
|
* r21714: Change the VFS interface to use struct timespecJeremy Allison2007-10-101-2/+2
| | | | | | | | | | for utimes - change the call to ntimes. This preserves nsec timestamps we get from stat (if the system supports it) and only maps back down to usec or sec resolution on time set. Looks bigger than it is as I had to move lots of internal code from using time_t and struct utimebuf to struct timespec. Jeremy.
* r21409: saved_status1 is not used anymore after aio write behind was removedVolker Lendecke2007-10-101-5/+2
|
* r21280: Fix an uninitialized variable warning. Jeremy, please check.Volker Lendecke2007-10-101-3/+3
| | | | Volker
* r21279: Get rid of 'aio write behind', this is broken.Volker Lendecke2007-10-101-12/+1
| | | | | | It should probably better be integrated with our write cache. Volker
* r21274: As we now have POSIX opens which can unlinkJeremy Allison2007-10-101-0/+9
| | | | | | | | with other open files we may have taken the delete code path with more than one share mode entry - ensure we only delete once by resetting the delete on close flag. Jeremy.
* r21191: Add in the POSIX open/mkdir/unlink calls.Jeremy Allison2007-10-101-55/+56
| | | | | | | | Move more error code returns to NTSTATUS. Client test code to follow... See if this passes the build-farm before I add it into 3.0.25. Jeremy.
* r20931: This changes the notify infrastructure from a polling-based to an ↵Volker Lendecke2007-10-101-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | event-driven based approach. The only remaining hook into the backend is now void *(*notify_add)(TALLOC_CTX *mem_ctx, struct event_context *event_ctx, files_struct *fsp, uint32 *filter); (Should we put this through the VFS, so that others can more easily plug in?) The trick here is that the backend can pick filter bits that the main smbd should not handle anymore. Thanks to tridge for this idea. The backend can notify the main smbd process via void notify_fsp(files_struct *fsp, uint32 action, char *name); The core patch is not big, what makes this more than 1800 lines are the individual backends that are considerably changed but can be reviewed one by one. Based on this I'll continue with inotify now. Volker
* r20916: Add in the delete on close final fix - but only enabledJeremy Allison2007-10-101-0/+1
| | | | | with -DDEVELOPER. Jeremy.
* r20883: W00t! I now understand how "delete on close" reallyJeremy Allison2007-10-101-2/+37
| | | | | | | | | | | | | | | | works - even with the strange "initial delete on close" semantics. The "initial delete on close" flag isn't committed to the share mode db until the handle is closed, and is discarded if any real "delete on close" was set. This allows me to remove the "initial_delete_on_close" flag from the share db, and move it into a BOOL in files_struct. Warning ! You must do a make clean after this. Cope with the wrinkle in directory delete on close which is done differently from files. We now pass all Samba4 smbtortute BASE-DELETE tests except for the one checking that files can't be created in a directory which has the delete on close set (possibly expensive to fix). Jeremy.
* r20542: Make close_remove_share_mode retun NTSTATUS. Not that anybody cares ↵Volker Lendecke2007-10-101-4/+16
| | | | yet...
* r20525: Closing a dir with del-on-close set requires the same as files: ↵Volker Lendecke2007-10-101-0/+12
| | | | | | | | | | Don't actually unlink/rmdir if another process still has it open. Jeremy, this is a potential merger to 3.0.24. Volker
* r20524: Simplify logic of close_remove_share_mode().Volker Lendecke2007-10-101-51/+67
| | | | Volker
* r20442: Slight rewrite of the change notify infrastructure. This now ↵Volker Lendecke2007-10-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | survives the first of the raw-notify subtests, the one-level test_notify_dir without any flags around yet. The tricky part was getting the data structures right, I hope the next tests don't let that fall over. fsp->notify is now by default NULL, meaning that nobody has issued a changenotify call. This means nobody is interested in changes for this directory. If that has happened, notify_change_buf collects the changes if no current request is outstanding, and it collects the requests if no change has happened since the last request. Happy New Year, somewhere on this planet it's already 2007 :-) Volker P.S: Jeremy, there's a question for you in smbd/files.c line 367.
* r17293: After the results from the cluster tests in Germany,Jeremy Allison2007-10-101-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | fix the messaging code to call the efficient calls : save_re_uid() set_effective_uid(0); messaging_op restore_re_uid(); instead of using heavyweight become_root()/unbecome_root() pairs around all messaging code. Fixup the messaging code to ensure sec_init() is called (only once) so that non-root processes still work when sending messages. This is a lighter weight solution to become_root()/unbecome_root() (which swaps all the supplemental groups) and should be more efficient. I will migrate all server code over to using this (a similar technique should be used in the passdb backend where needed). Jeremy.
* r17098: Samba3 now cleanly passes Samba4 RAW-LOCK tortureJeremy Allison2007-10-101-2/+0
| | | | | | | | test. Phew - that was painful :-). But what it means is that we now implement lock cancels and I can add lock cancels into POSIX lock handling which will fix the fast/slow system call issue with cifsfs ! Jeremy.
* r15668: DOS or FCB opens share one share mode entry from differentJeremy Allison2007-10-101-65/+73
| | | | | | | fsp pointers. Ensure we cope with this to pass Samba4 DENY tests (we used to pass these, there must have been a regression with newer code). We now pass them. Jeremy
* r15660: Without this when using smbcquotas I getVolker Lendecke2007-10-101-0/+2
| | | | | | | | | | | | | | close fd=-1 fnum=4321 (numopen=1) close_file: Could not get share mode lock for file $Extend/$Quota:$Q:$INDEX_ALLOCATION unix_error_packet: error string = Das Argument ist ungültig error packet at smbd/reply.c(3325) cmd=4 (SMBclose) NT_STATUS_INVALID_HANDLE so a fake file needs special close handling I think. Jeremy, can you check this? Thanks, Volker
* r13748: Don't reference memory after we just freed it (Doh!).Jeremy Allison2007-10-101-2/+3
| | | | | | Thanks to tridge's changes to the directory delete on close tests for catching this. Jeremy.
* r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()Gerald Carter2007-10-101-2/+2
| | | | macro which sets the freed pointer to NULL.
* r13293: Rather a big patch I'm afraid, but this should fix bug #3347Jeremy Allison2007-10-101-15/+51
| | | | | | | | by saving the UNIX token used to set a delete on close flag, and using it when doing the delete. libsmbsharemodes.so still needs updating to cope with this change. Samba4 torture tests to follow. Jeremy.
* r13274: Fix for bug #3467. Not a show stopper.Jeremy Allison2007-10-101-2/+2
| | | | | | jason qian <jason@infrant.com> was a *fantastic* help in tracking this down. Jeremy.
* r12877: Stop passing structs around in smb messages, insteadJeremy Allison2007-10-101-1/+5
| | | | | | | | | always linearize into little-endian. Should fix all Solaris issues with this, plus provide a cleaner base moving forward for cluster-aware Samba where smbd's can communicate across different compilers/architectures (eventually these message will have to go cross-machine). Jeremy.
* r12460: Fixes for bug 3349Volker Lendecke2007-10-101-0/+2
|