Ignore:
Timestamp:
Aug 4, 2009, 8:51:22 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.3 to 3.3.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/source/smbd/trans2.c

    r222 r309  
    49384938        if (setting_write_time) {
    49394939                /*
    4940                  * This was a setfileinfo on an open file.
     4940                 * This was a Windows setfileinfo on an open file.
    49414941                 * NT does this a lot. We also need to
    49424942                 * set the time here, as it can be read by
     
    60166016        bool delete_on_fail = False;
    60176017        enum perm_type ptype;
     6018        files_struct *all_fsps = NULL;
     6019        bool modify_mtime = true;
     6020        struct file_id id;
    60186021
    60196022        if (total_data < 100) {
     
    61626165
    61636166        /* Deal with any time changes. */
    6164 
    6165         return smb_set_file_time(conn,
     6167        id = vfs_file_id_from_sbuf(conn, psbuf);
     6168        for(all_fsps = file_find_di_first(id); all_fsps;
     6169                        all_fsps = file_find_di_next(all_fsps)) {
     6170                /*
     6171                 * We're setting the time explicitly for UNIX.
     6172                 * Cancel any pending changes over all handles.
     6173                 */
     6174                all_fsps->update_write_time_on_close = false;
     6175                TALLOC_FREE(all_fsps->update_write_time_event);
     6176        }
     6177
     6178        /*
     6179         * Override the "setting_write_time"
     6180         * parameter here as it almost does what
     6181         * we need. Just remember if we modified
     6182         * mtime and send the notify ourselves.
     6183         */
     6184        if (null_timespec(ts[1])) {
     6185                modify_mtime = false;
     6186        }
     6187
     6188        status = smb_set_file_time(conn,
    61666189                                fsp,
    61676190                                fname,
    61686191                                psbuf,
    61696192                                ts,
    6170                                 true);
     6193                                false);
     6194
     6195        if (modify_mtime) {
     6196                notify_fname(conn, NOTIFY_ACTION_MODIFIED,
     6197                        FILE_NOTIFY_CHANGE_LAST_WRITE, fname);
     6198        }
     6199        return status;
    61716200}
    61726201
     
    67956824        }
    67966825
    6797         if (!CAN_WRITE(conn)) {
    6798                 reply_doserror(req, ERRSRV, ERRaccess);
    6799                 return;
    6800         }
    6801 
    68026826        if (INFO_LEVEL_IS_UNIX(info_level) && !lp_unix_extensions()) {
    68036827                reply_nterror(req, NT_STATUS_INVALID_LEVEL);
    68046828                return;
     6829        }
     6830
     6831        if (!CAN_WRITE(conn)) {
     6832                /* Allow POSIX opens. The open path will deny
     6833                 * any non-readonly opens. */
     6834                if (info_level != SMB_POSIX_PATH_OPEN) {
     6835                        reply_doserror(req, ERRSRV, ERRaccess);
     6836                        return;
     6837                }
    68056838        }
    68066839
     
    71097142
    71107143        DEBUG(3,("call_trans2mkdir : name = %s\n", directory));
     7144
     7145        status = resolve_dfspath(ctx,
     7146                                conn,
     7147                                req->flags2 & FLAGS2_DFS_PATHNAMES,
     7148                                directory,
     7149                                &directory);
     7150        if (!NT_STATUS_IS_OK(status)) {
     7151                if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
     7152                        reply_botherror(req,
     7153                                        NT_STATUS_PATH_NOT_COVERED,
     7154                                        ERRSRV, ERRbadpath);
     7155                }
     7156                reply_nterror(req, status);
     7157                return;
     7158        }
    71117159
    71127160        status = unix_convert(ctx, conn, directory, False, &directory, NULL, &sbuf);
Note: See TracChangeset for help on using the changeset viewer.