Ignore:
Timestamp:
Sep 24, 2009, 9:15:13 AM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.2 to 3.2.14 (final)

File:
1 edited

Legend:

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

    r272 r335  
    49204920        if (setting_write_time) {
    49214921                /*
    4922                  * This was a setfileinfo on an open file.
     4922                 * This was a Windows setfileinfo on an open file.
    49234923                 * NT does this a lot. We also need to
    49244924                 * set the time here, as it can be read by
     
    59975997        bool delete_on_fail = False;
    59985998        enum perm_type ptype;
     5999        files_struct *all_fsps = NULL;
     6000        bool modify_mtime = true;
     6001        struct file_id id;
    59996002
    60006003        if (total_data < 100) {
     
    61436146
    61446147        /* Deal with any time changes. */
    6145 
    6146         return smb_set_file_time(conn,
     6148        id = vfs_file_id_from_sbuf(conn, psbuf);
     6149        for(all_fsps = file_find_di_first(id); all_fsps;
     6150                        all_fsps = file_find_di_next(all_fsps)) {
     6151                /*
     6152                 * We're setting the time explicitly for UNIX.
     6153                 * Cancel any pending changes over all handles.
     6154                 */
     6155                all_fsps->update_write_time_on_close = false;
     6156                TALLOC_FREE(all_fsps->update_write_time_event);
     6157        }
     6158
     6159        /*
     6160         * Override the "setting_write_time"
     6161         * parameter here as it almost does what
     6162         * we need. Just remember if we modified
     6163         * mtime and send the notify ourselves.
     6164         */
     6165        if (null_timespec(ts[1])) {
     6166                modify_mtime = false;
     6167        }
     6168
     6169        status = smb_set_file_time(conn,
    61476170                                fsp,
    61486171                                fname,
    61496172                                psbuf,
    61506173                                ts,
    6151                                 true);
     6174                                false);
     6175
     6176        if (modify_mtime) {
     6177                notify_fname(conn, NOTIFY_ACTION_MODIFIED,
     6178                        FILE_NOTIFY_CHANGE_LAST_WRITE, fname);
     6179        }
     6180        return status;
    61526181}
    61536182
     
    67766805        }
    67776806
    6778         if (!CAN_WRITE(conn)) {
    6779                 reply_doserror(req, ERRSRV, ERRaccess);
    6780                 return;
    6781         }
    6782 
    67836807        if (INFO_LEVEL_IS_UNIX(info_level) && !lp_unix_extensions()) {
    67846808                reply_nterror(req, NT_STATUS_INVALID_LEVEL);
    67856809                return;
     6810        }
     6811
     6812        if (!CAN_WRITE(conn)) {
     6813                /* Allow POSIX opens. The open path will deny
     6814                 * any non-readonly opens. */
     6815                if (info_level != SMB_POSIX_PATH_OPEN) {
     6816                        reply_doserror(req, ERRSRV, ERRaccess);
     6817                        return;
     6818                }
    67866819        }
    67876820
     
    70907123
    70917124        DEBUG(3,("call_trans2mkdir : name = %s\n", directory));
     7125
     7126        status = resolve_dfspath(ctx,
     7127                                conn,
     7128                                req->flags2 & FLAGS2_DFS_PATHNAMES,
     7129                                directory,
     7130                                &directory);
     7131        if (!NT_STATUS_IS_OK(status)) {
     7132                if (NT_STATUS_EQUAL(status,NT_STATUS_PATH_NOT_COVERED)) {
     7133                        reply_botherror(req,
     7134                                        NT_STATUS_PATH_NOT_COVERED,
     7135                                        ERRSRV, ERRbadpath);
     7136                }
     7137                reply_nterror(req, status);
     7138                return;
     7139        }
    70927140
    70937141        status = unix_convert(ctx, conn, directory, False, &directory, NULL, &sbuf);
Note: See TracChangeset for help on using the changeset viewer.