]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmb: remove mode from struct file_info
authorRalph Boehme <slow@samba.org>
Sun, 29 Oct 2023 14:27:08 +0000 (15:27 +0100)
committerRalph Boehme <slow@samba.org>
Tue, 31 Oct 2023 04:38:42 +0000 (04:38 +0000)
There's already the "attr" member and this is even used in list_posix_helper()
in pylibsmb.c. While at it, remove the cast in list_posix_helper() by using "I"
instead of "i" format.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: David Mulder <dmulder@samba.org>
source3/include/client.h
source3/libsmb/cli_smb2_fnum.c
source3/libsmb/pylibsmb.c

index 9634166428cc18ad75ad7581bfb703a1dbd7c29b..e1a394af4b537c50df4e48e48e9a312da22a49e9 100644 (file)
@@ -109,7 +109,6 @@ struct file_info {
        struct timespec ctime_ts;
        char *name;
        char *short_name;
-       uint32_t mode;
        uint32_t reparse_tag;
        dev_t st_ex_dev;
        mode_t st_ex_mode;
index c2cca874b6519486c35cbc539cbe2d11cbd430a4..08d95cf35798bc0647613efa6ebd3adfeed5ed1a 100644 (file)
@@ -1266,7 +1266,7 @@ static NTSTATUS parse_finfo_posix_info(const uint8_t *dir_data,
        finfo->ctime_ts = interpret_long_date(info.change_time);
        finfo->allocated_size = info.allocation_size;
        finfo->size = info.end_of_file;
-       finfo->mode = info.file_attributes;
+       finfo->attr = info.file_attributes;
        finfo->ino = info.inode;
        finfo->st_ex_dev = info.device;
        finfo->st_ex_nlink = info.cc.nlinks;
index 5330cffbf50569b7d2643495408274f2ad81f8bb..fd8232d2e11fffea0782c8bc3591b83813f38e0d 100644 (file)
@@ -1891,9 +1891,9 @@ static NTSTATUS list_posix_helper(struct file_info *finfo,
        /*
         * Build a dictionary representing the file info.
         */
-       file = Py_BuildValue("{s:s,s:i,s:K,s:l,s:i,s:i,s:i,s:s,s:s}",
+       file = Py_BuildValue("{s:s,s:I,s:K,s:l,s:i,s:i,s:i,s:s,s:s}",
                             "name", finfo->name,
-                            "attrib", (int)finfo->attr,
+                            "attrib", finfo->attr,
                             "size", finfo->size,
                             "mtime",
                             convert_timespec_to_time_t(finfo->mtime_ts),