r24120: add a file_id_create() hook into the VFS layer
[samba.git] / source / smbd / trans2.c
index 77a13ad18623e6a3b1d7426ff5d5991f52ddb9ca..2b0925d195b521894e97b4ed45f04080a7c8aa1f 100644 (file)
@@ -3312,6 +3312,7 @@ static int call_trans2qfilepathinfo(connection_struct *conn, char *inbuf, char *
        time_t create_time, mtime, atime;
        struct timespec create_time_ts, mtime_ts, atime_ts;
        files_struct *fsp = NULL;
+       struct file_id fileid;
        TALLOC_CTX *data_ctx = NULL;
        struct ea_list *ea_list = NULL;
        uint32 access_mask = 0x12019F; /* Default - GENERIC_EXECUTE mapping from Windows */
@@ -3378,7 +3379,8 @@ static int call_trans2qfilepathinfo(connection_struct *conn, char *inbuf, char *
                                return UNIXERROR(ERRDOS,ERRbadpath);
                        }
 
-                       delete_pending = get_delete_on_close_flag(file_id_sbuf(&sbuf));
+                       fileid = vfs_file_id_from_sbuf(conn, &sbuf);
+                       delete_pending = get_delete_on_close_flag(fileid);
                } else {
                        /*
                         * Original code - this is an open file.
@@ -3391,7 +3393,8 @@ static int call_trans2qfilepathinfo(connection_struct *conn, char *inbuf, char *
                                return(UNIXERROR(ERRDOS,ERRbadfid));
                        }
                        pos = fsp->fh->position_information;
-                       delete_pending = get_delete_on_close_flag(file_id_sbuf(&sbuf));
+                       fileid = vfs_file_id_from_sbuf(conn, &sbuf);
+                       delete_pending = get_delete_on_close_flag(fileid);
                        access_mask = fsp->access_mask;
                }
        } else {
@@ -3446,7 +3449,8 @@ static int call_trans2qfilepathinfo(connection_struct *conn, char *inbuf, char *
                        return UNIXERROR(ERRDOS,ERRbadpath);
                }
 
-               delete_pending = get_delete_on_close_flag(file_id_sbuf(&sbuf));
+               fileid = vfs_file_id_from_sbuf(conn, &sbuf);
+               delete_pending = get_delete_on_close_flag(fileid);
                if (delete_pending) {
                        return ERROR_NT(NT_STATUS_DELETE_PENDING);
                }
@@ -3572,8 +3576,10 @@ total_data=%u (should be %u)\n", (unsigned int)total_data, (unsigned int)IVAL(pd
                        mtime_ts = fsp->pending_modtime;
                }
        } else {
+               files_struct *fsp1;
                /* Do we have this path open ? */
-               files_struct *fsp1 = file_find_di_first(file_id_sbuf(&sbuf));
+               fileid = vfs_file_id_from_sbuf(conn, &sbuf);
+               fsp1 = file_find_di_first(fileid);
                if (fsp1 && !null_timespec(fsp1->pending_modtime)) {
                        /* the pending modtime overrides the current modtime */
                        mtime_ts = fsp1->pending_modtime;