Ignore:
Timestamp:
May 20, 2009, 6:46:53 PM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.2 branch to 3.2.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.2.x/source/smbd/dosmode.c

    r149 r204  
    632632}
    633633
    634 /*******************************************************************
    635  Change a filetime - possibly allowing DOS semantics.
    636 *******************************************************************/
    637 
    638 bool set_write_time_path(connection_struct *conn, const char *fname,
    639                          struct file_id fileid, const struct timespec mtime,
    640                          bool overwrite)
     634/******************************************************************
     635 Force a "sticky" write time on a pathname. This will always be
     636 returned on all future write time queries and set on close.
     637******************************************************************/
     638
     639bool set_sticky_write_time_path(connection_struct *conn, const char *fname,
     640                         struct file_id fileid, const struct timespec mtime)
    641641{
    642642        if (null_timespec(mtime)) {
     
    644644        }
    645645
    646         if (!set_write_time(fileid, mtime, overwrite)) {
     646        if (!set_sticky_write_time(fileid, mtime)) {
    647647                return false;
    648648        }
    649649
    650         /* in the overwrite case the caller should trigger the notify */
    651         if (!overwrite) {
    652                 notify_fname(conn, NOTIFY_ACTION_MODIFIED,
    653                              FILE_NOTIFY_CHANGE_LAST_WRITE, fname);
    654         }
    655 
    656650        return true;
    657651}
    658652
    659 bool set_write_time_fsp(struct files_struct *fsp, const struct timespec mtime,
    660                         bool overwrite)
    661 {
    662         if (overwrite) {
    663                 fsp->write_time_forced = true;
    664                 TALLOC_FREE(fsp->update_write_time_event);
    665         }
    666 
    667         return set_write_time_path(fsp->conn, fsp->fsp_name, fsp->file_id,
    668                                    mtime, overwrite);
    669 }
     653/******************************************************************
     654 Force a "sticky" write time on an fsp. This will always be
     655 returned on all future write time queries and set on close.
     656******************************************************************/
     657
     658bool set_sticky_write_time_fsp(struct files_struct *fsp, const struct timespec mtime)
     659{
     660        fsp->write_time_forced = true;
     661        TALLOC_FREE(fsp->update_write_time_event);
     662
     663        return set_sticky_write_time_path(fsp->conn, fsp->fsp_name,
     664                        fsp->file_id, mtime);
     665}
     666
     667/******************************************************************
     668 Update a write time immediately, without the 2 second delay.
     669******************************************************************/
     670
     671bool update_write_time(struct files_struct *fsp)
     672{
     673        if (!set_write_time(fsp->file_id, timespec_current())) {
     674                return false;
     675        }
     676
     677        notify_fname(fsp->conn, NOTIFY_ACTION_MODIFIED,
     678                        FILE_NOTIFY_CHANGE_LAST_WRITE, fsp->fsp_name);
     679
     680        return true;
     681}
Note: See TracChangeset for help on using the changeset viewer.