The branch, master has been updated
       via  6395bc55db6b5926c42d3419084a6ccc1256c9c7 (commit)
       via  eb8c658fcdda5d1337605ed5e2e8da15bc51ba20 (commit)
       via  9001c53406241aeab4a3cfe0f663b71f67611cde (commit)
       via  da9cee8ee5424d79e5c51082e1b74a1bb2cc162e (commit)
       via  2ccd50122058df1fb5da0ab4d30085bb4ef5e867 (commit)
       via  358ccc3282681b3df0ba76fecc114ad4376c8ff1 (commit)
      from  9c48f5bf2dcc12e6eb6170ab3a2af5ca119cf008 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 6395bc55db6b5926c42d3419084a6ccc1256c9c7
Author: Tim Prouty <[email protected]>
Date:   Thu Jun 25 18:40:17 2009 -0700

    s3: pass a valid stat into file_ntimes()
    
    file_ntimes() calls can_write_to_file() which expects a valid stat struct

commit eb8c658fcdda5d1337605ed5e2e8da15bc51ba20
Author: Tim Prouty <[email protected]>
Date:   Thu Jun 25 18:19:09 2009 -0700

    s3 file_access: Convert some more functions over to use smb_filneame

commit 9001c53406241aeab4a3cfe0f663b71f67611cde
Author: Tim Prouty <[email protected]>
Date:   Thu Jun 25 17:24:19 2009 -0700

    s3: simplify some redundant logic in is_ntfs_default_stream_smb_fname()

commit da9cee8ee5424d79e5c51082e1b74a1bb2cc162e
Author: Tim Prouty <[email protected]>
Date:   Thu Jun 25 14:44:23 2009 -0700

    s3: Remove get_full_smb_filename() from open_directory()
    
    This is possible because open_directory() returns an error if
    the fname is a stream, so the base_name can be used.

commit 2ccd50122058df1fb5da0ab4d30085bb4ef5e867
Author: Tim Prouty <[email protected]>
Date:   Thu Jun 25 11:20:36 2009 -0700

    s3 onefs: Plumb smb_filename through onefs createfile path

commit 358ccc3282681b3df0ba76fecc114ad4376c8ff1
Author: Tim Prouty <[email protected]>
Date:   Thu Jun 25 14:16:46 2009 -0700

    s3: Change set_ea() and its callers to use smb_filename

-----------------------------------------------------------------------

Summary of changes:
 source3/include/proto.h                 |    8 +-
 source3/modules/onefs.h                 |   10 +-
 source3/modules/onefs_open.c            |  376 ++++++++++++++++---------------
 source3/modules/onefs_streams.c         |  137 +++++++++---
 source3/modules/vfs_onefs_shadow_copy.c |   20 +-
 source3/smbd/dir.c                      |   39 ++--
 source3/smbd/dosmode.c                  |   30 ++-
 source3/smbd/file_access.c              |   19 +--
 source3/smbd/nttrans.c                  |   10 +-
 source3/smbd/open.c                     |   39 +---
 source3/smbd/posix_acls.c               |   14 +-
 source3/smbd/trans2.c                   |   22 ++-
 12 files changed, 418 insertions(+), 306 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/proto.h b/source3/include/proto.h
index a223059..3da1caf 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -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);
@@ -6268,7 +6268,8 @@ bool can_delete_file_in_directory(connection_struct *conn,
 bool can_access_file_data(connection_struct *conn,
                          const struct smb_filename *smb_fname,
                          uint32 access_mask);
-bool can_write_to_file(connection_struct *conn, const char *fname, const 
SMB_STRUCT_STAT *psbuf);
+bool can_write_to_file(connection_struct *conn,
+                      const struct smb_filename *smb_fname);
 bool directory_has_default_acl(connection_struct *conn, const char *fname);
 
 /* The following definitions come from smbd/fileio.c  */
@@ -7004,7 +7005,8 @@ NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, 
connection_struct *conn,
 NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx, connection_struct *conn,
                                files_struct *fsp, const char *fname,
                                char ***pnames, size_t *pnum_names);
-NTSTATUS set_ea(connection_struct *conn, files_struct *fsp, const char *fname, 
struct ea_list *ea_list);
+NTSTATUS set_ea(connection_struct *conn, files_struct *fsp,
+               const struct smb_filename *smb_fname, struct ea_list *ea_list);
 struct ea_list *read_ea_list_entry(TALLOC_CTX *ctx, const char *pdata, size_t 
data_size, size_t *pbytes_used);
 void send_trans2_replies(connection_struct *conn,
                        struct smb_request *req,
diff --git a/source3/modules/onefs.h b/source3/modules/onefs.h
index 3e6cd29..6cb8036 100644
--- a/source3/modules/onefs.h
+++ b/source3/modules/onefs.h
@@ -64,14 +64,12 @@ int onefs_close(vfs_handle_struct *handle, struct 
files_struct *fsp);
 int onefs_rename(vfs_handle_struct *handle, const char *oldname,
                 const char *newname);
 
-int onefs_stat(vfs_handle_struct *handle, const char *fname,
-              SMB_STRUCT_STAT *sbuf);
+int onefs_stat(vfs_handle_struct *handle, struct smb_filename *smb_fname);
 
 int onefs_fstat(vfs_handle_struct *handle, struct files_struct *fsp,
                SMB_STRUCT_STAT *sbuf);
 
-int onefs_lstat(vfs_handle_struct *handle, const char *path,
-               SMB_STRUCT_STAT *sbuf);
+int onefs_lstat(vfs_handle_struct *handle, struct smb_filename *smb_fname);
 
 int onefs_unlink(vfs_handle_struct *handle, const char *path);
 
@@ -141,6 +139,10 @@ NTSTATUS onefs_samba_sd_to_sd(uint32_t security_info_sent, 
SEC_DESC *psd,
 NTSTATUS onefs_split_ntfs_stream_name(TALLOC_CTX *mem_ctx, const char *fname,
                                      char **pbase, char **pstream);
 
+NTSTATUS onefs_stream_prep_smb_fname(TALLOC_CTX *ctx,
+                                    const struct smb_filename *smb_fname_in,
+                                    struct smb_filename **smb_fname_out);
+
 int onefs_rdp_add_dir_state(connection_struct *conn, SMB_STRUCT_DIR *dirp);
 
 /*
diff --git a/source3/modules/onefs_open.c b/source3/modules/onefs_open.c
index 8b6ae20..5aade2c 100644
--- a/source3/modules/onefs_open.c
+++ b/source3/modules/onefs_open.c
@@ -46,7 +46,7 @@ struct onefs_fsp_data {
 
 static NTSTATUS onefs_create_file_unixpath(connection_struct *conn,
                              struct smb_request *req,
-                             const char *fname,
+                             struct smb_filename *smb_fname,
                              uint32_t access_mask,
                              uint32_t share_access,
                              uint32_t create_disposition,
@@ -58,8 +58,7 @@ static NTSTATUS onefs_create_file_unixpath(connection_struct 
*conn,
                              struct ea_list *ea_list,
                              files_struct **result,
                              int *pinfo,
-                             struct onefs_fsp_data *fsp_data,
-                             SMB_STRUCT_STAT *psbuf);
+                             struct onefs_fsp_data *fsp_data);
 
 /****************************************************************************
  Open a file.
@@ -69,9 +68,7 @@ static NTSTATUS onefs_open_file(files_struct *fsp,
                                connection_struct *conn,
                                struct smb_request *req,
                                const char *parent_dir,
-                               const char *name,
-                               const char *path,
-                               SMB_STRUCT_STAT *psbuf,
+                               struct smb_filename *smb_fname,
                                int flags,
                                mode_t unx_mode,
                                uint32 access_mask,
@@ -84,18 +81,24 @@ static NTSTATUS onefs_open_file(files_struct *fsp,
                                struct security_descriptor *sd,
                                int *granted_oplock)
 {
+       char *path = NULL;
+       struct smb_filename *smb_fname_onefs = NULL;
        NTSTATUS status = NT_STATUS_OK;
        int accmode = (flags & O_ACCMODE);
        int local_flags = flags;
-       bool file_existed = VALID_STAT(*psbuf);
+       bool file_existed = VALID_STAT(smb_fname->st);
        const char *wild;
-       char *base = NULL;
-       char *stream = NULL;
        int base_fd = -1;
 
        fsp->fh->fd = -1;
        errno = EPERM;
 
+       status = get_full_smb_filename(talloc_tos(), smb_fname,
+                                      &path);
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
        /* Check permissions */
 
        /*
@@ -111,7 +114,8 @@ static NTSTATUS onefs_open_file(files_struct *fsp,
        if (!CAN_WRITE(conn)) {
                /* It's a read-only share - fail if we wanted to write. */
                if(accmode != O_RDONLY) {
-                       DEBUG(3,("Permission denied opening %s\n", path));
+                       DEBUG(3, ("Permission denied opening %s\n",
+                                 smb_fname_str_dbg(smb_fname)));
                        return NT_STATUS_ACCESS_DENIED;
                } else if(flags & O_CREAT) {
                        /* We don't want to write - but we must make sure that
@@ -137,7 +141,7 @@ static NTSTATUS onefs_open_file(files_struct *fsp,
 
        if ((accmode == O_RDONLY) && ((flags & O_TRUNC) == O_TRUNC)) {
                DEBUG(10,("onefs_open_file: truncate requested on read-only "
-                         "open for file %s\n", path));
+                         "open for file %s\n", smb_fname_str_dbg(smb_fname)));
                local_flags = (flags & ~O_ACCMODE)|O_RDWR;
        }
 
@@ -148,7 +152,7 @@ static NTSTATUS onefs_open_file(files_struct *fsp,
         * open flags. JRA.
         */
 
-       if (file_existed && S_ISFIFO(psbuf->st_ex_mode)) {
+       if (file_existed && S_ISFIFO(smb_fname->st.st_ex_mode)) {
                local_flags |= O_NONBLOCK;
        }
 #endif
@@ -174,7 +178,7 @@ static NTSTATUS onefs_open_file(files_struct *fsp,
                 * then was copied via Samba.
                 */
                DEBUG(1, ("onefs_open_file: creating file with wildcard: %s\n",
-                         path));
+                         smb_fname_str_dbg(smb_fname)));
                return NT_STATUS_OBJECT_NAME_INVALID;
        }
 
@@ -190,25 +194,30 @@ static NTSTATUS onefs_open_file(files_struct *fsp,
                flags |= O_NOFOLLOW;
        }
 #endif
-       /* Stream handling */
-       if (is_ntfs_stream_name(path)) {
-               status = onefs_split_ntfs_stream_name(talloc_tos(), path,
-                                                     &base, &stream);
+       /* Setup a onefs-style smb_fname struct. */
+       status = onefs_stream_prep_smb_fname(talloc_tos(), smb_fname,
+                                            &smb_fname_onefs);
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
        }
-       /* It's a stream, so pass in the base_fd */
-       if ((conn->fs_capabilities & FILE_NAMED_STREAMS) && stream != NULL) {
+
+       /* If it's a stream pass in the base_fd */
+       if ((conn->fs_capabilities & FILE_NAMED_STREAMS) &&
+           is_ntfs_stream_smb_fname(smb_fname_onefs)) {
                SMB_ASSERT(fsp->base_fsp);
 
-               DEBUG(10,("Opening a stream: base=%s(%d), stream=%s\n",
-                         base, fsp->base_fsp->fh->fd, stream));
+               DEBUG(10, ("Opening a stream: base=%s(%d), stream=%s\n",
+                          smb_fname_onefs->base_name, fsp->base_fsp->fh->fd,
+                          smb_fname_onefs->stream_name));
 
                base_fd = fsp->base_fsp->fh->fd;
        }
 
        fsp->fh->fd = onefs_sys_create_file(conn,
                                            base_fd,
-                                           stream != NULL ? stream :
-                                           (base != NULL ? base : path),
+                                           smb_fname_onefs->stream_name != 
NULL ?
+                                           smb_fname_onefs->stream_name :
+                                           smb_fname_onefs->base_name,
                                            access_mask,
                                            open_access_mask,
                                            share_access,
@@ -220,6 +229,7 @@ static NTSTATUS onefs_open_file(files_struct *fsp,
                                            sd,
                                            new_dos_attributes,
                                            granted_oplock);
+       TALLOC_FREE(smb_fname_onefs);
 
        if (fsp->fh->fd == -1) {
                if (errno == EMFILE) {
@@ -237,9 +247,9 @@ static NTSTATUS onefs_open_file(files_struct *fsp,
                }
 
                status = map_nt_error_from_unix(errno);
-               DEBUG(3,("Error opening file %s (%s) (local_flags=%d) "
-                       "(flags=%d)\n",
-                       path, strerror(errno), local_flags, flags));
+               DEBUG(3, ("Error opening file %s (%s) (local_flags=%d) "
+                         "(flags=%d)\n", smb_fname_str_dbg(smb_fname),
+                         strerror(errno), local_flags, flags));
                return status;
        }
 
@@ -265,13 +275,15 @@ static NTSTATUS onefs_open_file(files_struct *fsp,
                int ret;
 
                if (fsp->fh->fd == -1) {
-                       ret = SMB_VFS_STAT(conn, path, psbuf);
+                       ret = SMB_VFS_STAT(conn, smb_fname);
                } else {
-                       ret = SMB_VFS_FSTAT(fsp, psbuf);
+                       ret = SMB_VFS_FSTAT(fsp, &smb_fname->st);
                        /* If we have an fd, this stat should succeed. */
                        if (ret == -1) {
-                               DEBUG(0,("Error doing fstat on open file %s "
-                                        "(%s)\n", path,strerror(errno) ));
+                               DEBUG(0, ("Error doing fstat on open file %s "
+                                         "(%s)\n",
+                                         smb_fname_str_dbg(smb_fname),
+                                         strerror(errno) ));
                        }
                }
 
@@ -289,14 +301,14 @@ static NTSTATUS onefs_open_file(files_struct *fsp,
         * so catch a directory open and return an EISDIR. JRA.
         */
 
-       if(S_ISDIR(psbuf->st_ex_mode)) {
+       if(S_ISDIR(smb_fname->st.st_ex_mode)) {
                fd_close(fsp);
                errno = EISDIR;
                return NT_STATUS_FILE_IS_A_DIRECTORY;
        }
 
-       fsp->mode = psbuf->st_ex_mode;
-       fsp->file_id = vfs_file_id_from_sbuf(conn, psbuf);
+       fsp->mode = smb_fname->st.st_ex_mode;
+       fsp->file_id = vfs_file_id_from_sbuf(conn, &smb_fname->st);
        fsp->vuid = req ? req->vuid : UID_FIELD_INVALID;
        fsp->file_pid = req ? req->smbpid : 0;
        fsp->can_lock = True;
@@ -419,7 +431,7 @@ static void schedule_defer_open(struct share_mode_lock *lck,
 ****************************************************************************/
 NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
                                  struct smb_request *req,
-                                 const char *fname,
+                                 struct smb_filename *smb_fname,
                                  uint32 access_mask,
                                  uint32 share_access,
                                  uint32 create_disposition,
@@ -429,12 +441,11 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
                                  struct security_descriptor *sd,
                                  files_struct *fsp,
                                  int *pinfo,
-                                 struct onefs_fsp_data *fsp_data,
-                                 SMB_STRUCT_STAT *psbuf)
+                                 struct onefs_fsp_data *fsp_data)
 {
        int flags=0;
        int flags2=0;
-       bool file_existed = VALID_STAT(*psbuf);
+       bool file_existed = VALID_STAT(smb_fname->st);
        bool def_acl = False;
        bool posix_open = False;
        bool new_file_created = False;
@@ -451,13 +462,19 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
        NTSTATUS status;
        int ret_flock;
        char *parent_dir;
-       const char *newname;
        int granted_oplock;
        uint64_t oplock_callback_id = 0;
        uint32 createfile_attributes = 0;
+       char *fname = NULL;
 
        ZERO_STRUCT(id);
 
+       status = get_full_smb_filename(talloc_tos(), smb_fname,
+                                      &fname);
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
+
        if (conn->printer) {
                /*
                 * Printers are handled completely differently.
@@ -469,12 +486,14 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
                }
 
                DEBUG(10, ("onefs_open_file_ntcreate: printer open fname=%s\n",
-                         fname));
+                          smb_fname_str_dbg(smb_fname)));
 
-               return print_fsp_open(req, conn, fname, req->vuid, fsp, psbuf);
+               return print_fsp_open(req, conn, fname, req->vuid, fsp,
+                                     &smb_fname->st);
        }
 
-       if (!parent_dirname(talloc_tos(), fname, &parent_dir, &newname)) {
+       if (!parent_dirname(talloc_tos(), smb_fname->base_name, &parent_dir,
+                           NULL)) {
                return NT_STATUS_NO_MEMORY;
        }
 
@@ -493,9 +512,9 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
                  "access_mask=0x%x share_access=0x%x "
                  "create_disposition = 0x%x create_options=0x%x "
                  "unix mode=0%o oplock_request=0x%x\n",
-                 fname, new_dos_attributes, access_mask, share_access,
-                 create_disposition, create_options, unx_mode,
-                 oplock_request));
+                 smb_fname_str_dbg(smb_fname), new_dos_attributes,
+                 access_mask, share_access, create_disposition,
+                 create_options, unx_mode, oplock_request));
 
        /*
         * Any non-stat-only open has the potential to contend oplocks, which
@@ -514,7 +533,8 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
         *         it off, but if a customer were to turn it on it would be
         *         bad.
         */
-       if (req == NULL && !is_stat_open(access_mask) && 
!is_ntfs_stream_name(fname)) {
+       if (req == NULL && !is_stat_open(access_mask) &&
+           !is_ntfs_stream_smb_fname(smb_fname)) {
                smb_panic("NULL req on a non-stat-open!");
        }
 
@@ -563,7 +583,7 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
                }
        }
 
-       status = check_name(conn, fname);
+       status = check_name(conn, smb_fname->base_name);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
@@ -571,7 +591,8 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
        if (!posix_open) {
                new_dos_attributes &= SAMBA_ATTRIBUTES_MASK;
                if (file_existed) {
-                       existing_dos_attributes = dos_mode(conn, fname, psbuf);
+                       existing_dos_attributes = dos_mode(conn, fname,
+                                                          &smb_fname->st);
                }
        }
 
@@ -583,13 +604,13 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
 
        /* Ignore oplock requests if oplocks are disabled. */
        if (!lp_oplocks(SNUM(conn)) || global_client_failed_oplock_break ||
-           IS_VETO_OPLOCK_PATH(conn, fname)) {
+           IS_VETO_OPLOCK_PATH(conn, smb_fname->base_name)) {
                /* Mask off everything except the private Samba bits. */
                oplock_request &= SAMBA_PRIVATE_OPLOCK_MASK;
        }
 
        /* this is for OS/2 long file names - say we don't support them */
-       if (!lp_posix_pathnames() && strstr(fname,".+,;=[].")) {
+       if (!lp_posix_pathnames() && strstr(smb_fname->base_name,".+,;=[].")) {
                /* OS/2 Workplace shell fix may be main code stream in a later
                 * release. */
                DEBUG(5,("onefs_open_file_ntcreate: OS/2 long filenames are "
@@ -632,7 +653,8 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
                        if (!file_existed) {
                                DEBUG(5,("onefs_open_file_ntcreate: FILE_OPEN "
                                         "requested for file %s and file "
-                                        "doesn't exist.\n", fname ));
+                                        "doesn't exist.\n",
+                                        smb_fname_str_dbg(smb_fname)));
                                errno = ENOENT;
                                return NT_STATUS_OBJECT_NAME_NOT_FOUND;
                        }
@@ -645,7 +667,7 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
                                DEBUG(5, ("onefs_open_file_ntcreate: "
                                          "FILE_OVERWRITE requested for file "
                                          "%s and file doesn't exist.\n",
-                                         fname));
+                                         smb_fname_str_dbg(smb_fname)));
                                errno = ENOENT;
                                return NT_STATUS_OBJECT_NAME_NOT_FOUND;
                        }
@@ -660,8 +682,8 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
                                DEBUG(5, ("onefs_open_file_ntcreate: "
                                          "FILE_CREATE requested for file %s "
                                          "and file already exists.\n",
-                                         fname));
-                               if (S_ISDIR(psbuf->st_ex_mode)) {
+                                         smb_fname_str_dbg(smb_fname)));
+                               if (S_ISDIR(smb_fname->st.st_ex_mode)) {
                                        errno = EISDIR;
                                } else {
                                        errno = EEXIST;
@@ -686,13 +708,15 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
            ((create_disposition == FILE_OVERWRITE) ||
                (create_disposition == FILE_OVERWRITE_IF))) {
                if (!open_match_attributes(conn, existing_dos_attributes,
-                                          new_dos_attributes, 
psbuf->st_ex_mode,
+                                          new_dos_attributes,
+                                          smb_fname->st.st_ex_mode,
                                           unx_mode, &new_unx_mode)) {
                        DEBUG(5, ("onefs_open_file_ntcreate: attributes "
                                  "missmatch for file %s (%x %x) (0%o, 0%o)\n",
-                                 fname, existing_dos_attributes,
+                                 smb_fname_str_dbg(smb_fname),
+                                 existing_dos_attributes,
                                  new_dos_attributes,
-                                 (unsigned int)psbuf->st_ex_mode,
+                                 (unsigned int)smb_fname->st.st_ex_mode,
                                  (unsigned int)unx_mode ));
                        errno = EACCES;
                        return NT_STATUS_ACCESS_DENIED;
@@ -720,7 +744,8 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
 
        DEBUG(10, ("onefs_open_file_ntcreate: fname=%s, after mapping "
                   "open_access_mask=%#x, access_mask=0x%x\n",
-                  fname, open_access_mask, access_mask));
+                  smb_fname_str_dbg(smb_fname), open_access_mask,
+                  access_mask));
 
        /*
         * Note that we ignore the append flag as append does not
@@ -792,14 +817,15 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
            (!CAN_WRITE(conn) || IS_DOS_READONLY(existing_dos_attributes))) {
                DEBUG(5, ("onefs_open_file_ntcreate: write access requested "
                          "for file %s on read only %s\n",
-                         fname, !CAN_WRITE(conn) ? "share" : "file" ));
+                         smb_fname_str_dbg(smb_fname),
+                         !CAN_WRITE(conn) ? "share" : "file" ));
                errno = EACCES;
                return NT_STATUS_ACCESS_DENIED;
        }
 
        DEBUG(10, ("fsp = %p\n", fsp));
 
-       fsp->file_id = vfs_file_id_from_sbuf(conn, psbuf);
+       fsp->file_id = vfs_file_id_from_sbuf(conn, &smb_fname->st);
        fsp->share_access = share_access;
        fsp->fh->private_options = create_options;
        fsp->access_mask = open_access_mask; /* We change this to the
@@ -815,8 +841,8 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
        }
 
        if (file_existed) {
-               struct timespec old_write_time = psbuf->st_ex_mtime;
-               id = vfs_file_id_from_sbuf(conn, psbuf);
+               struct timespec old_write_time = smb_fname->st.st_ex_mtime;
+               id = vfs_file_id_from_sbuf(conn, &smb_fname->st);
 
                lck = get_share_mode_lock(talloc_tos(), id,
                                          conn->connectpath,
@@ -874,9 +900,7 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
                                 conn,
                                 req,
                                 parent_dir,
-                                newname,
-                                fname,
-                                psbuf,
+                                smb_fname,
                                 flags|flags2,
                                 unx_mode,
                                 access_mask,
@@ -899,18 +923,19 @@ NTSTATUS onefs_open_file_ntcreate(connection_struct *conn,
                                struct deferred_open_record state;
                                struct timespec old_write_time;
 
-                               old_write_time = psbuf->st_ex_mtime;
+                               old_write_time = smb_fname->st.st_ex_mtime;
 
                                DEBUG(3, ("Someone created file %s with an "
                                          "oplock after we looked: Retrying\n",
-                                         fname));
+                                         smb_fname_str_dbg(smb_fname)));
                                /*
                                 * We hit the race that when we did the stat
                                 * on the file it did not exist, and someone
                                 * has created it in between the stat and the
                                 * open_file() call. Just retry immediately.


-- 
Samba Shared Repository

Reply via email to