Introduce "struct stat_ex" as a replacement for SMB_STRUCT_STAT
[gd/samba/.git] / source3 / modules / vfs_fake_perms.c
index 29893221471ecbfe3d90f257cfe96b143b2d69fe..cc3ab6220d0cb597cb6dbbcb83b1bce6904ee006 100644 (file)
@@ -32,13 +32,13 @@ static int fake_perms_stat(vfs_handle_struct *handle, const char *fname, SMB_STR
 
        ret = SMB_VFS_NEXT_STAT(handle, fname, sbuf);
        if (ret == 0) {
-               if (S_ISDIR(sbuf->st_mode)) {
-                       sbuf->st_mode = S_IFDIR | S_IRWXU;
+               if (S_ISDIR(sbuf->st_ex_mode)) {
+                       sbuf->st_ex_mode = S_IFDIR | S_IRWXU;
                } else {
-                       sbuf->st_mode = S_IRWXU;
+                       sbuf->st_ex_mode = S_IRWXU;
                }
-               sbuf->st_uid = handle->conn->server_info->utok.uid;
-               sbuf->st_gid = handle->conn->server_info->utok.gid;
+               sbuf->st_ex_uid = handle->conn->server_info->utok.uid;
+               sbuf->st_ex_gid = handle->conn->server_info->utok.gid;
        }
 
        return ret;
@@ -50,13 +50,13 @@ static int fake_perms_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_ST
 
        ret = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
        if (ret == 0) {
-               if (S_ISDIR(sbuf->st_mode)) {
-                       sbuf->st_mode = S_IFDIR | S_IRWXU;
+               if (S_ISDIR(sbuf->st_ex_mode)) {
+                       sbuf->st_ex_mode = S_IFDIR | S_IRWXU;
                } else {
-                       sbuf->st_mode = S_IRWXU;
+                       sbuf->st_ex_mode = S_IRWXU;
                }
-               sbuf->st_uid = handle->conn->server_info->utok.uid;
-               sbuf->st_gid = handle->conn->server_info->utok.gid;
+               sbuf->st_ex_uid = handle->conn->server_info->utok.uid;
+               sbuf->st_ex_gid = handle->conn->server_info->utok.gid;
        }
        return ret;
 }