The branch, master has been updated
       via  152ee22bb5d VERSION: Bump version up to 4.23.0pre1...
       via  fc3005dbad5 VERSION: Disable GIT_SNAPSHOT for the Samba 4.22.0rc1 
release.
       via  5539768a3ac WHATSNEW: Up to Samba 4.22.0rc1.
       via  8d398acbbb7 tevent: version 0.16.2
       via  77229f73c20 talloc: version 2.4.3
       via  70a8c7a89a6 tdb: version 1.4.13
       via  8f27da18b57 vfs_gpfs: Remove one whitespace
       via  edfd45a8f8a gpfswrap: Remove unused gpfs_set_winattrs_path
       via  35538c408ce gpfswrap: Remove unused gpfs_fstat_x
       via  dd4c331bd2e gpfswrap: Remove unused gpfs_stat_x wrapper
       via  2f114d0d110 vfs_gpfs: Remove winattr calls from vfs_gpfs_fntimes
       via  fb8138275f9 vfs_gpfs: Set creation time from 
vfs_gpfs_fset_dos_attributes
       via  d3543e0b77f vfs_gpfs: Simplify vfs_gpfs_fset_dos_attributes
       via  dd7cc4da0f3 vfs_gpfs: Use gpfs_get_winattrs instead of gpfs_fstat_x
       via  4787c737ec0 vfs_gpfs: Remove pathref test
       via  d86986da399 vfs_gpfs: Remove gpfs_stat_x fallback
      from  30b7181d0a4 librpc/ndr: apply some const to ndr_push_union_blob()

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


- Log -----------------------------------------------------------------
commit 152ee22bb5d2725867d34552ded27f2084095aa3
Author: Jule Anger <[email protected]>
Date:   Thu Feb 6 11:23:58 2025 +0100

    VERSION: Bump version up to 4.23.0pre1...
    
    and re-enable GIT_SNAPSHOT.
    
    Signed-off-by: Jule Anger <[email protected]>
    Signed-off-by: Stefan Metzmacher <[email protected]>
    
    Autobuild-User(master): Jule Anger <[email protected]>
    Autobuild-Date(master): Thu Feb  6 12:24:14 UTC 2025 on atb-devel-224

commit fc3005dbad51a4b88047bf769f89cf88bd9e59ca
Author: Jule Anger <[email protected]>
Date:   Thu Feb 6 10:48:47 2025 +0100

    VERSION: Disable GIT_SNAPSHOT for the Samba 4.22.0rc1 release.
    
    Signed-off-by: Jule Anger <[email protected]>
    Signed-off-by: Stefan Metzmacher <[email protected]>

commit 5539768a3ac836b4b1ca472b11dd3054ef5ab4cb
Author: Jule Anger <[email protected]>
Date:   Thu Feb 6 10:59:11 2025 +0100

    WHATSNEW: Up to Samba 4.22.0rc1.
    
    Signed-off-by: Jule Anger <[email protected]>
    Signed-off-by: Stefan Metzmacher <[email protected]>

commit 8d398acbbb7fdc0ff50fe6ba80433deaf92515c6
Author: Jule Anger <[email protected]>
Date:   Thu Feb 6 11:18:30 2025 +0100

    tevent: version 0.16.2
    
    * Documentation fixes
    * Add LGPLv3 LICENSE file
    
    Signed-off-by: Jule Anger <[email protected]>
    Signed-off-by: Stefan Metzmacher <[email protected]>

commit 77229f73c20af69ab0f3c96efbb229ff64a9dfe4
Author: Jule Anger <[email protected]>
Date:   Thu Feb 6 11:16:38 2025 +0100

    talloc: version 2.4.3
    
    * Testsuite and documenation fixes
    * Add LGPLv3 LICENSE file
    
    Signed-off-by: Jule Anger <[email protected]>
    Signed-off-by: Stefan Metzmacher <[email protected]>

commit 70a8c7a89a6d62d2ff172d79b5f4e6439300b88d
Author: Jule Anger <[email protected]>
Date:   Thu Feb 6 11:14:44 2025 +0100

    tdb: version 1.4.13
    
    * Add LGPLv3 LICENSE file
    
    Signed-off-by: Jule Anger <[email protected]>
    Signed-off-by: Stefan Metzmacher <[email protected]>

commit 8f27da18b5718757167c6c079dbf7a3dad06d659
Author: Christof Schmitt <[email protected]>
Date:   Wed Feb 5 14:21:55 2025 -0700

    vfs_gpfs: Remove one whitespace
    
    Signed-off-by: Christof Schmitt <[email protected]>
    Reviewed-by: Ralph Boehme <[email protected]>

commit edfd45a8f8ac254ac8e2340d1125ec1c2348e7ce
Author: Christof Schmitt <[email protected]>
Date:   Tue Feb 4 15:09:56 2025 -0700

    gpfswrap: Remove unused gpfs_set_winattrs_path
    
    Signed-off-by: Christof Schmitt <[email protected]>
    Reviewed-by: Ralph Boehme <[email protected]>

commit 35538c408cec5da42f40b861e558b9b6f0b41174
Author: Christof Schmitt <[email protected]>
Date:   Tue Feb 4 15:07:52 2025 -0700

    gpfswrap: Remove unused gpfs_fstat_x
    
    Signed-off-by: Christof Schmitt <[email protected]>
    Reviewed-by: Ralph Boehme <[email protected]>

commit dd4c331bd2e8ed366b5c55bcc2f587811702fe5c
Author: Christof Schmitt <[email protected]>
Date:   Tue Feb 4 14:57:28 2025 -0700

    gpfswrap: Remove unused gpfs_stat_x wrapper
    
    Signed-off-by: Christof Schmitt <[email protected]>
    Reviewed-by: Ralph Boehme <[email protected]>

commit 2f114d0d1100099d4ea13aeddf99cd1f4735007e
Author: Christof Schmitt <[email protected]>
Date:   Tue Feb 4 14:05:58 2025 -0700

    vfs_gpfs: Remove winattr calls from vfs_gpfs_fntimes
    
    The call to the default function for fntimes already calls back into
    fset_dos_attributes to set the create time. It is not necessary to
    repeat the code in vfs_gpfs_fntimes.
    
    Signed-off-by: Christof Schmitt <[email protected]>
    Reviewed-by: Ralph Boehme <[email protected]>

commit fb8138275f9db5a8f3bfd41b63938daa1b63517a
Author: Christof Schmitt <[email protected]>
Date:   Tue Feb 4 14:40:34 2025 -0700

    vfs_gpfs: Set creation time from vfs_gpfs_fset_dos_attributes
    
    This matches the default behavior of fset_dos_attributes and allows
    removing the fallback case from vfs_gpfs_fntimes.
    
    Signed-off-by: Christof Schmitt <[email protected]>
    Reviewed-by: Ralph Boehme <[email protected]>

commit d3543e0b77fd70d435edb77d58399dd2cc702c31
Author: Christof Schmitt <[email protected]>
Date:   Tue Feb 4 13:35:29 2025 -0700

    vfs_gpfs: Simplify vfs_gpfs_fset_dos_attributes
    
    The gpfs_set_winattrs API call accepts O_PATH descriptors since GPFS
    5.1.2, so switch to fsp_get_pathref_fd and remove the fallback logic.
    
    Signed-off-by: Christof Schmitt <[email protected]>
    Reviewed-by: Ralph Boehme <[email protected]>

commit dd7cc4da0f3962a82382c91c80ae6922f4faa78b
Author: Christof Schmitt <[email protected]>
Date:   Tue Feb 4 13:18:21 2025 -0700

    vfs_gpfs: Use gpfs_get_winattrs instead of gpfs_fstat_x
    
    gpfs_fstat_x had been introduced for querying additional inode
    attributes for fileids. With the fileid code being removed, the simpler
    gpfs_get_winattrs call can be used. gpfs_get_winattrs also accepts
    O_PATH descriptors since GPFS 5.1.2.
    
    Signed-off-by: Christof Schmitt <[email protected]>
    Reviewed-by: Ralph Boehme <[email protected]>

commit 4787c737ec0421ac6286ff5cae9810e5d8587773
Author: Christof Schmitt <[email protected]>
Date:   Tue Feb 4 13:10:22 2025 -0700

    vfs_gpfs: Remove pathref test
    
    The gpfs_stat_x call O_PATH descriptors since GPFS 5.1.2.0 and will also
    be replaced with a simpler API call that also accepts O_PATH
    descriptors. Remove the pathref test that is no longer needed.
    
    Signed-off-by: Christof Schmitt <[email protected]>
    Reviewed-by: Ralph Boehme <[email protected]>

commit d86986da399022b7af74c283e2c5709fbd856615
Author: Christof Schmitt <[email protected]>
Date:   Tue Feb 4 13:09:11 2025 -0700

    vfs_gpfs: Remove gpfs_stat_x fallback
    
    Since GPFS 5.1.2 gpfs_stat_x accepts O_PATH descriptors so the fallback
    case is no longer used and can be removed.
    
    Signed-off-by: Christof Schmitt <[email protected]>
    Reviewed-by: Ralph Boehme <[email protected]>

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

Summary of changes:
 VERSION                                            |   2 +-
 WHATSNEW.txt                                       |   2 +-
 ...oc-util-2.3.0.sigs => pytalloc-util-2.4.3.sigs} |   0
 .../ABI/{talloc-2.3.5.sigs => talloc-2.4.3.sigs}   |   0
 lib/talloc/wscript                                 |   2 +-
 lib/tdb/ABI/{tdb-1.3.17.sigs => tdb-1.4.13.sigs}   |   0
 lib/tdb/wscript                                    |   2 +-
 .../ABI/{tevent-0.15.0.sigs => tevent-0.16.2.sigs} |   0
 lib/tevent/wscript                                 |   2 +-
 lib/util/gpfswrap.c                                |  44 ----
 lib/util/gpfswrap.h                                |   7 -
 source3/modules/vfs_gpfs.c                         | 260 ++++-----------------
 12 files changed, 53 insertions(+), 268 deletions(-)
 copy lib/talloc/ABI/{pytalloc-util-2.3.0.sigs => pytalloc-util-2.4.3.sigs} 
(100%)
 copy lib/talloc/ABI/{talloc-2.3.5.sigs => talloc-2.4.3.sigs} (100%)
 copy lib/tdb/ABI/{tdb-1.3.17.sigs => tdb-1.4.13.sigs} (100%)
 copy lib/tevent/ABI/{tevent-0.15.0.sigs => tevent-0.16.2.sigs} (100%)


Changeset truncated at 500 lines:

diff --git a/VERSION b/VERSION
index a09bd14320e..48f72da7e04 100644
--- a/VERSION
+++ b/VERSION
@@ -26,7 +26,7 @@ SAMBA_COPYRIGHT_STRING="Copyright Andrew Tridgell and the 
Samba Team 1992-2025"
 #  ->  "3.0.0"                                         #
 ########################################################
 SAMBA_VERSION_MAJOR=4
-SAMBA_VERSION_MINOR=22
+SAMBA_VERSION_MINOR=23
 SAMBA_VERSION_RELEASE=0
 
 ########################################################
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 9a056da4810..76aecf200cd 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,7 +1,7 @@
 Release Announcements
 =====================
 
-This is the first pre release of Samba 4.22.  This is *not*
+This is the first release candidate of Samba 4.22.  This is *not*
 intended for production environments and is designed for testing
 purposes only.  Please report any defects via the Samba bug reporting
 system at https://bugzilla.samba.org/.
diff --git a/lib/talloc/ABI/pytalloc-util-2.3.0.sigs 
b/lib/talloc/ABI/pytalloc-util-2.4.3.sigs
similarity index 100%
copy from lib/talloc/ABI/pytalloc-util-2.3.0.sigs
copy to lib/talloc/ABI/pytalloc-util-2.4.3.sigs
diff --git a/lib/talloc/ABI/talloc-2.3.5.sigs b/lib/talloc/ABI/talloc-2.4.3.sigs
similarity index 100%
copy from lib/talloc/ABI/talloc-2.3.5.sigs
copy to lib/talloc/ABI/talloc-2.4.3.sigs
diff --git a/lib/talloc/wscript b/lib/talloc/wscript
index 1b240ae3653..b4b89ec1993 100644
--- a/lib/talloc/wscript
+++ b/lib/talloc/wscript
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 APPNAME = 'talloc'
-VERSION = '2.4.2'
+VERSION = '2.4.3'
 
 import os
 import sys
diff --git a/lib/tdb/ABI/tdb-1.3.17.sigs b/lib/tdb/ABI/tdb-1.4.13.sigs
similarity index 100%
copy from lib/tdb/ABI/tdb-1.3.17.sigs
copy to lib/tdb/ABI/tdb-1.4.13.sigs
diff --git a/lib/tdb/wscript b/lib/tdb/wscript
index 812e5987daf..d647cb5da9a 100644
--- a/lib/tdb/wscript
+++ b/lib/tdb/wscript
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 APPNAME = 'tdb'
-VERSION = '1.4.12'
+VERSION = '1.4.13'
 
 import sys, os
 
diff --git a/lib/tevent/ABI/tevent-0.15.0.sigs 
b/lib/tevent/ABI/tevent-0.16.2.sigs
similarity index 100%
copy from lib/tevent/ABI/tevent-0.15.0.sigs
copy to lib/tevent/ABI/tevent-0.16.2.sigs
diff --git a/lib/tevent/wscript b/lib/tevent/wscript
index 8df1b40febf..317a0c5e0b5 100644
--- a/lib/tevent/wscript
+++ b/lib/tevent/wscript
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 
 APPNAME = 'tevent'
-VERSION = '0.16.1'
+VERSION = '0.16.2'
 
 import sys, os
 
diff --git a/lib/util/gpfswrap.c b/lib/util/gpfswrap.c
index 2f15bf452cf..8012e29163c 100644
--- a/lib/util/gpfswrap.c
+++ b/lib/util/gpfswrap.c
@@ -29,9 +29,6 @@ static int (*gpfs_get_realfilename_path_fn)(const char 
*pathname,
                                            char *filenamep,
                                            int *len);
 static int (*gpfs_register_cifs_export_fn)(void);
-static int (*gpfs_set_winattrs_path_fn)(const char *pathname,
-                                       int flags,
-                                       struct gpfs_winattr *attrs);
 static int (*gpfs_set_winattrs_fn)(int fd, int flags,
                                   struct gpfs_winattr *attrs);
 static int (*gpfs_get_winattrs_fn)(int fd, struct gpfs_winattr *attrs);
@@ -49,10 +46,6 @@ static int (*gpfs_init_trace_fn)(void);
 static int (*gpfs_query_trace_fn)(void);
 static void (*gpfs_add_trace_fn)(int level, const char *msg);
 static void (*gpfs_fini_trace_fn)(void);
-static int (*gpfs_fstat_x_fn)(int fd, unsigned int *litemask,
-                             struct gpfs_iattr64 *iattr, size_t len);
-static int (*gpfs_stat_x_fn)(const char *pathname, unsigned int *litemask,
-                            struct gpfs_iattr64 *iattr, size_t len);
 
 int gpfswrap_init(void)
 {
@@ -73,7 +66,6 @@ int gpfswrap_init(void)
        gpfs_putacl_fn                = dlsym(l, "gpfs_putacl");
        gpfs_get_realfilename_path_fn = dlsym(l, "gpfs_get_realfilename_path");
        gpfs_register_cifs_export_fn  = dlsym(l, "gpfs_register_cifs_export");
-       gpfs_set_winattrs_path_fn     = dlsym(l, "gpfs_set_winattrs_path");
        gpfs_set_winattrs_fn          = dlsym(l, "gpfs_set_winattrs");
        gpfs_get_winattrs_fn          = dlsym(l, "gpfs_get_winattrs");
        gpfs_ftruncate_fn             = dlsym(l, "gpfs_ftruncate");
@@ -85,8 +77,6 @@ int gpfswrap_init(void)
        gpfs_query_trace_fn           = dlsym(l, "gpfs_query_trace");
        gpfs_add_trace_fn             = dlsym(l, "gpfs_add_trace");
        gpfs_fini_trace_fn            = dlsym(l, "gpfs_fini_trace");
-       gpfs_fstat_x_fn       = dlsym(l, "gpfs_fstat_x");
-       gpfs_stat_x_fn                = dlsym(l, "gpfs_stat_x");
 
        return 0;
 }
@@ -153,18 +143,6 @@ int gpfswrap_register_cifs_export(void)
        return gpfs_register_cifs_export_fn();
 }
 
-int gpfswrap_set_winattrs_path(const char *pathname,
-                              int flags,
-                              struct gpfs_winattr *attrs)
-{
-       if (gpfs_set_winattrs_path_fn == NULL) {
-               errno = ENOSYS;
-               return -1;
-       }
-
-       return gpfs_set_winattrs_path_fn(pathname, flags, attrs);
-}
-
 int gpfswrap_set_winattrs(int fd, int flags, struct gpfs_winattr *attrs)
 {
        if (gpfs_set_winattrs_fn == NULL) {
@@ -272,25 +250,3 @@ void gpfswrap_fini_trace(void)
 
        gpfs_fini_trace_fn();
 }
-
-int gpfswrap_fstat_x(int fd, unsigned int *litemask,
-                    struct gpfs_iattr64 *iattr, size_t len)
-{
-       if (gpfs_fstat_x_fn == NULL) {
-               errno = ENOSYS;
-               return -1;
-       }
-
-       return gpfs_fstat_x_fn(fd, litemask, iattr, len);
-}
-
-int gpfswrap_stat_x(const char *pathname, unsigned int *litemask,
-                   struct gpfs_iattr64 *iattr, size_t len)
-{
-       if (gpfs_stat_x_fn == NULL) {
-               errno = ENOSYS;
-               return -1;
-       }
-
-       return gpfs_stat_x_fn(pathname, litemask, iattr, len);
-}
diff --git a/lib/util/gpfswrap.h b/lib/util/gpfswrap.h
index e387a56446b..c1d87b098c5 100644
--- a/lib/util/gpfswrap.h
+++ b/lib/util/gpfswrap.h
@@ -35,9 +35,6 @@ int gpfswrap_get_realfilename_path(const char *pathname,
                                   char *filenamep,
                                   int *len);
 int gpfswrap_register_cifs_export(void);
-int gpfswrap_set_winattrs_path(const char *pathname,
-                              int flags,
-                              struct gpfs_winattr *attrs);
 int gpfswrap_set_winattrs(int fd, int flags, struct gpfs_winattr *attrs);
 int gpfswrap_get_winattrs(int fd, struct gpfs_winattr *attrs);
 int gpfswrap_ftruncate(int fd, gpfs_off64_t length);
@@ -49,9 +46,5 @@ int gpfswrap_init_trace(void);
 int gpfswrap_query_trace(void);
 void gpfswrap_add_trace(int level, const char *msg);
 void gpfswrap_fini_trace(void);
-int gpfswrap_fstat_x(int fd, unsigned int *litemask,
-                    struct gpfs_iattr64 *iattr, size_t len);
-int gpfswrap_stat_x(const char *pathname, unsigned int *litemask,
-                   struct gpfs_iattr64 *iattr, size_t len);
 
 #endif
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index fb3e8c806e1..48f3bbad363 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -56,9 +56,6 @@ struct gpfs_config_data {
        bool settimes;
        bool recalls;
        bool clamp_invalid_times;
-       struct {
-               bool gpfs_fstat_x;
-       } pathref_ok;
 };
 
 struct gpfs_fsp_extension {
@@ -527,7 +524,7 @@ again:
 }
 
 /* Tries to get nfs4 acls and returns SMB ACL allocated.
- * On failure returns 1 if it got non-NFSv4 ACL to prompt 
+ * On failure returns 1 if it got non-NFSv4 ACL to prompt
  * retry with POSIX ACL checks.
  * On failure returns -1 if there is system (GPFS) error, check errno.
  * Returns 0 on success
@@ -1436,21 +1433,12 @@ static unsigned int 
vfs_gpfs_dosmode_to_winattrs(uint32_t dosmode)
        return winattrs;
 }
 
-static struct timespec gpfs_timestruc64_to_timespec(struct gpfs_timestruc64 g)
-{
-       return (struct timespec) { .tv_sec = g.tv_sec, .tv_nsec = g.tv_nsec };
-}
-
 static NTSTATUS vfs_gpfs_fget_dos_attributes(struct vfs_handle_struct *handle,
                                             struct files_struct *fsp,
                                             uint32_t *dosmode)
 {
        struct gpfs_config_data *config;
-       int fd = fsp_get_pathref_fd(fsp);
-       struct sys_proc_fd_path_buf buf;
-       const char *p = NULL;
-       struct gpfs_iattr64 iattr = { };
-       unsigned int litemask = 0;
+       struct gpfs_winattr attrs = { };
        struct timespec ts;
        int ret;
 
@@ -1462,19 +1450,7 @@ static NTSTATUS vfs_gpfs_fget_dos_attributes(struct 
vfs_handle_struct *handle,
                return SMB_VFS_NEXT_FGET_DOS_ATTRIBUTES(handle, fsp, dosmode);
        }
 
-       if (fsp->fsp_flags.is_pathref && !config->pathref_ok.gpfs_fstat_x) {
-               if (fsp->fsp_flags.have_proc_fds) {
-                       p = sys_proc_fd_path(fd, &buf);
-               } else {
-                       p = fsp->fsp_name->base_name;
-               }
-       }
-
-       if (p != NULL) {
-               ret = gpfswrap_stat_x(p, &litemask, &iattr, sizeof(iattr));
-       } else {
-               ret = gpfswrap_fstat_x(fd, &litemask, &iattr, sizeof(iattr));
-       }
+       ret = gpfswrap_get_winattrs(fsp_get_pathref_fd(fsp), &attrs);
        if (ret == -1 && errno == ENOSYS) {
                return SMB_VFS_NEXT_FGET_DOS_ATTRIBUTES(handle, fsp, dosmode);
        }
@@ -1491,17 +1467,7 @@ static NTSTATUS vfs_gpfs_fget_dos_attributes(struct 
vfs_handle_struct *handle,
 
                set_effective_capability(DAC_OVERRIDE_CAPABILITY);
 
-               if (p != NULL) {
-                       ret = gpfswrap_stat_x(p,
-                                             &litemask,
-                                             &iattr,
-                                             sizeof(iattr));
-               } else {
-                       ret = gpfswrap_fstat_x(fd,
-                                              &litemask,
-                                              &iattr,
-                                              sizeof(iattr));
-               }
+               ret = gpfswrap_get_winattrs(fsp_get_pathref_fd(fsp), &attrs);
                if (ret == -1) {
                        saved_errno = errno;
                }
@@ -1519,14 +1485,40 @@ static NTSTATUS vfs_gpfs_fget_dos_attributes(struct 
vfs_handle_struct *handle,
                return map_nt_error_from_unix(errno);
        }
 
-       ts = gpfs_timestruc64_to_timespec(iattr.ia_createtime);
+       ts.tv_sec = attrs.creationTime.tv_sec;
+       ts.tv_nsec = attrs.creationTime.tv_nsec;
 
-       *dosmode |= vfs_gpfs_winattrs_to_dosmode(iattr.ia_winflags);
+       *dosmode |= vfs_gpfs_winattrs_to_dosmode(attrs.winAttrs);
        update_stat_ex_create_time(&fsp->fsp_name->st, ts);
 
        return NT_STATUS_OK;
 }
 
+static int timespec_to_gpfs_timestruc(struct gpfs_config_data *config,
+                                     struct timespec ts,
+                                     struct gpfs_timestruc *gt)
+{
+       if (ts.tv_sec < 0 || ts.tv_sec > UINT32_MAX) {
+               if (!config->clamp_invalid_times) {
+                       DBG_NOTICE("GPFS uses 32-bit unsigned timestamps "
+                                  "and cannot handle %jd.\n",
+                                  (intmax_t)ts.tv_sec);
+                       errno = ERANGE;
+                       return -1;
+               }
+               if (ts.tv_sec < 0) {
+                       ts.tv_sec = 0;
+               } else {
+                       ts.tv_sec = UINT32_MAX;
+               }
+       }
+
+       gt->tv_sec = ts.tv_sec;
+       gt->tv_nsec = ts.tv_nsec;
+
+       return 0;
+}
+
 static NTSTATUS vfs_gpfs_fset_dos_attributes(struct vfs_handle_struct *handle,
                                             struct files_struct *fsp,
                                             uint32_t dosmode)
@@ -1543,43 +1535,19 @@ static NTSTATUS vfs_gpfs_fset_dos_attributes(struct 
vfs_handle_struct *handle,
                return SMB_VFS_NEXT_FSET_DOS_ATTRIBUTES(handle, fsp, dosmode);
        }
 
-       attrs.winAttrs = vfs_gpfs_dosmode_to_winattrs(dosmode);
-
-       if (!fsp->fsp_flags.is_pathref) {
-               ret = gpfswrap_set_winattrs(fsp_get_io_fd(fsp),
-                                           GPFS_WINATTR_SET_ATTRS, &attrs);
-               if (ret == -1) {
-                       DBG_WARNING("Setting winattrs failed for %s: %s\n",
-                                   fsp_str_dbg(fsp), strerror(errno));
-                       return map_nt_error_from_unix(errno);
-               }
-               return NT_STATUS_OK;
+       ret = timespec_to_gpfs_timestruc(config,
+                                        fsp->fsp_name->st.st_ex_btime,
+                                        &attrs.creationTime);
+       if (ret == -1) {
+               return map_nt_error_from_unix(errno);
        }
 
-       if (fsp->fsp_flags.have_proc_fds) {
-               int fd = fsp_get_pathref_fd(fsp);
-               struct sys_proc_fd_path_buf buf;
-
-               ret = gpfswrap_set_winattrs_path(sys_proc_fd_path(fd, &buf),
-                                                GPFS_WINATTR_SET_ATTRS,
-                                                &attrs);
-               if (ret == -1) {
-                       DBG_WARNING("Setting winattrs failed for "
-                                   "[%s][%s]: %s\n",
-                                   buf.buf,
-                                   fsp_str_dbg(fsp),
-                                   strerror(errno));
-                       return map_nt_error_from_unix(errno);
-               }
-               return NT_STATUS_OK;
-       }
+       attrs.winAttrs = vfs_gpfs_dosmode_to_winattrs(dosmode);
 
-       /*
-        * This is no longer a handle based call.
-        */
-       ret = gpfswrap_set_winattrs_path(fsp->fsp_name->base_name,
-                                        GPFS_WINATTR_SET_ATTRS,
-                                        &attrs);
+       ret = gpfswrap_set_winattrs(fsp_get_pathref_fd(fsp),
+                                   GPFS_WINATTR_SET_CREATION_TIME|
+                                   GPFS_WINATTR_SET_ATTRS,
+                                   &attrs);
        if (ret == -1) {
                DBG_WARNING("Setting winattrs failed for [%s]: %s\n",
                            fsp_str_dbg(fsp), strerror(errno));
@@ -1595,28 +1563,18 @@ static int timespec_to_gpfs_time(struct 
gpfs_config_data *config,
                                 int idx,
                                 int *flags)
 {
+       int ret;
+
        if (is_omit_timespec(&ts)) {
                return 0;
        }
 
-       if (ts.tv_sec < 0 || ts.tv_sec > UINT32_MAX) {
-               if (!config->clamp_invalid_times) {
-                       DBG_NOTICE("GPFS uses 32-bit unsigned timestamps "
-                                  "and cannot handle %jd.\n",
-                                  (intmax_t)ts.tv_sec);
-                       errno = ERANGE;
-                       return -1;
-               }
-               if (ts.tv_sec < 0) {
-                       ts.tv_sec = 0;
-               } else {
-                       ts.tv_sec = UINT32_MAX;
-               }
+       ret = timespec_to_gpfs_timestruc(config, ts, &gt[idx]);
+       if (ret == -1) {
+               return ret;
        }
 
        *flags |= 1 << idx;
-       gt[idx].tv_sec = ts.tv_sec;
-       gt[idx].tv_nsec = ts.tv_nsec;
        DBG_DEBUG("Setting GPFS time %d, flags 0x%x\n", idx, *flags);
 
        return 0;
@@ -1701,7 +1659,6 @@ static int vfs_gpfs_fntimes(struct vfs_handle_struct 
*handle,
                struct smb_file_time *ft)
 {
 
-       struct gpfs_winattr attrs;
        int ret;
        struct gpfs_config_data *config;
 
@@ -1715,8 +1672,7 @@ static int vfs_gpfs_fntimes(struct vfs_handle_struct 
*handle,
                return smbd_gpfs_set_times(config, fsp, ft);
        }
 
-       DBG_DEBUG("gpfs_set_times() not available or disabled, "
-                 "use ntimes and winattr\n");
+       DBG_DEBUG("gpfs_set_times() not available or disabled.\n");
 
        ret = SMB_VFS_NEXT_FNTIMES(handle, fsp, ft);
        if (ret == -1) {
@@ -1728,56 +1684,6 @@ static int vfs_gpfs_fntimes(struct vfs_handle_struct 
*handle,
                return -1;
        }
 
-       if (is_omit_timespec(&ft->create_time)) {
-               DBG_DEBUG("Create Time is NULL\n");
-               return 0;
-       }
-
-       if (!config->winattr) {
-               return 0;
-       }
-
-       attrs.winAttrs = 0;
-       attrs.creationTime.tv_sec = ft->create_time.tv_sec;
-       attrs.creationTime.tv_nsec = ft->create_time.tv_nsec;
-
-       if (!fsp->fsp_flags.is_pathref) {
-               ret = gpfswrap_set_winattrs(fsp_get_io_fd(fsp),
-                                           GPFS_WINATTR_SET_CREATION_TIME,
-                                           &attrs);
-               if (ret == -1 && errno != ENOSYS) {
-                       DBG_WARNING("Set GPFS ntimes failed %d\n", ret);
-                       return -1;
-               }
-               return ret;
-       }
-
-       if (fsp->fsp_flags.have_proc_fds) {
-               int fd = fsp_get_pathref_fd(fsp);
-               struct sys_proc_fd_path_buf buf;
-
-               ret = gpfswrap_set_winattrs_path(
-                       sys_proc_fd_path(fd, &buf),
-                       GPFS_WINATTR_SET_CREATION_TIME,
-                       &attrs);
-               if (ret == -1 && errno != ENOSYS) {
-                       DBG_WARNING("Set GPFS ntimes failed %d\n", ret);
-                       return -1;
-               }
-               return ret;
-       }
-
-       /*
-        * This is no longer a handle based call.
-        */
-       ret = gpfswrap_set_winattrs_path(fsp->fsp_name->base_name,
-                                        GPFS_WINATTR_SET_CREATION_TIME,
-                                        &attrs);
-       if (ret == -1 && errno != ENOSYS) {
-               DBG_WARNING("Set GPFS ntimes failed %d\n", ret);
-               return -1;
-       }
-
        return 0;
 }
 
@@ -1896,68 +1802,6 @@ static ssize_t vfs_gpfs_sendfile(vfs_handle_struct 
*handle, int tofd,
        return SMB_VFS_NEXT_SENDFILE(handle, tofd, fsp, hdr, offset, n);
 }
 
-#ifdef O_PATH
-static int vfs_gpfs_check_pathref_fstat_x(struct gpfs_config_data *config,
-                                         struct connection_struct *conn)
-{
-       struct gpfs_iattr64 iattr = {0};
-       unsigned int litemask = 0;
-       int saved_errno;
-       int fd;
-       int ret;
-
-       fd = open(conn->connectpath, O_PATH);
-       if (fd == -1) {


-- 
Samba Shared Repository

Reply via email to