s3: Plumb smb_filename through SMB_VFS_STAT and SMB_VFS_LSTAT
[metze/samba/wip.git] / source3 / modules / vfs_fake_perms.c
index cc3ab6220d0cb597cb6dbbcb83b1bce6904ee006..2740b612caa5b444f686f30a296c2835ecd56e3d 100644 (file)
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_VFS
 
-static int fake_perms_stat(vfs_handle_struct *handle, const char *fname, SMB_STRUCT_STAT *sbuf)
+static int fake_perms_stat(vfs_handle_struct *handle,
+                          struct smb_filename *smb_fname)
 {
        int ret = -1;
 
-       ret = SMB_VFS_NEXT_STAT(handle, fname, sbuf);
+       ret = SMB_VFS_NEXT_STAT(handle, smb_fname);
        if (ret == 0) {
-               if (S_ISDIR(sbuf->st_ex_mode)) {
-                       sbuf->st_ex_mode = S_IFDIR | S_IRWXU;
+               if (S_ISDIR(smb_fname->st.st_ex_mode)) {
+                       smb_fname->st.st_ex_mode = S_IFDIR | S_IRWXU;
                } else {
-                       sbuf->st_ex_mode = S_IRWXU;
+                       smb_fname->st.st_ex_mode = S_IRWXU;
                }
-               sbuf->st_ex_uid = handle->conn->server_info->utok.uid;
-               sbuf->st_ex_gid = handle->conn->server_info->utok.gid;
+               smb_fname->st.st_ex_uid = handle->conn->server_info->utok.uid;
+               smb_fname->st.st_ex_gid = handle->conn->server_info->utok.gid;
        }
 
        return ret;