s3: pass a valid stat into file_ntimes()
authorTim Prouty <tprouty@samba.org>
Fri, 26 Jun 2009 01:40:17 +0000 (18:40 -0700)
committerTim Prouty <tprouty@samba.org>
Fri, 26 Jun 2009 01:40:32 +0000 (18:40 -0700)
file_ntimes() calls can_write_to_file() which expects a valid stat struct

source3/include/proto.h
source3/smbd/dosmode.c
source3/smbd/trans2.c

index 731934d71490c285f9e7d31d23c9d66a416ec4a6..3da1caf60b440a3ceb28b0a426731f02ef5e80a5 100644 (file)
@@ -6224,7 +6224,7 @@ int file_set_dosmode(connection_struct *conn, const char *fname,
                     const char *parent_dir,
                     bool newfile);
 int file_ntimes(connection_struct *conn, const char *fname,
-               struct smb_file_time *ft);
+               struct smb_file_time *ft, const SMB_STRUCT_STAT *psbuf);
 bool set_sticky_write_time_path(connection_struct *conn, const char *fname,
                         struct file_id fileid, const struct timespec mtime);
 bool set_sticky_write_time_fsp(struct files_struct *fsp, const struct timespec mtime);
index 26d3320a4c5f4dcc2d62f15be9d370f4ddd66ad9..03ac0897efbb82f5567f6806bf49fc906602afa1 100644 (file)
@@ -718,7 +718,7 @@ int file_set_dosmode(connection_struct *conn, const char *fname,
 *******************************************************************/
 
 int file_ntimes(connection_struct *conn, const char *fname,
-               struct smb_file_time *ft)
+               struct smb_file_time *ft, const SMB_STRUCT_STAT *psbuf)
 {
        struct smb_filename *smb_fname = NULL;
        NTSTATUS status;
@@ -762,7 +762,7 @@ int file_ntimes(connection_struct *conn, const char *fname,
           (as DOS does).
         */
 
-       status = create_synthetic_smb_fname_split(talloc_tos(), fname, NULL,
+       status = create_synthetic_smb_fname_split(talloc_tos(), fname, psbuf,
                                                  &smb_fname);
 
        if (!NT_STATUS_IS_OK(status)) {
index 8bd37633d05a1132db5b7e1849024a69943e6a56..ef3d6d7a9a5111f20de442ff525f610e8b2c11eb 100644 (file)
@@ -5013,7 +5013,7 @@ NTSTATUS smb_set_file_time(connection_struct *conn,
                fname = fsp->base_fsp->fsp_name;
        }
 
-       if(file_ntimes(conn, fname, ft)!=0) {
+       if(file_ntimes(conn, fname, ft, psbuf)!=0) {
                return map_nt_error_from_unix(errno);
        }
        notify_fname(conn, NOTIFY_ACTION_MODIFIED, action, fname);