The branch, v4-16-test has been updated
       via  1397656cebf s3:printing: Start samba-bgqd as soon as possible
       via  8507fa6fc7d s3:printing: Initialize the printcap cache as soon as 
the bgqd starts
       via  c3ce1fec590 lib/util/gpfswrap: remove unused 
gpfswrap_get_winattrs_path()
       via  b8cc300d226 vfs_gpfs: use handle based gpfswrap_get_winattrs()
       via  72ef38a9747 lib/util/gpfswrap: remove unused gpfswrap_getacl()
       via  bdb2714671f vfs_gpfs: finally: use gpfswrap_fgetacl() instead of 
gpfswrap_getacl()
       via  1d4f8f3e472 lib/util/gpfswrap: add gpfswrap_fgetacl()
       via  069354e7480 vfs_gpfs: pass fsp to gpfs_getacl_with_capability()
       via  bce1de5580f vfs_gpfs: pass fsp to vfs_gpfs_getacl()
       via  a039780c01c vfs_gpfs: use fsp in gpfsacl_get_posix_acl()
       via  d9222188190 vfs_gpfs: pass fsp to gpfsacl_get_posix_acl()
       via  f752c389740 vfs_gpfs: pass fsp to gpfs_get_nfs4_acl()
       via  2a50ba5ae19 vfs_gpfs: pass fsp to gpfsacl_emu_chmod()
       via  ea39a8894a2 vfs_gpfs: indentation and README.Coding fixes
      from  e3de2bdb859 s3/client: Restore '-E' handling

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-16-test


- Log -----------------------------------------------------------------
commit 1397656cebf2cdd00a28727ec8f4b65308106440
Author: Andreas Schneider <a...@samba.org>
Date:   Tue May 31 08:35:00 2022 +0200

    s3:printing: Start samba-bgqd as soon as possible
    
    We need some time to fill the printcap cache.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15081
    
    Signed-off-by: Andreas Schneider <a...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>
    (cherry picked from commit ac16351ff5a0c5b46f461c26516b85e8483bba83)
    
    Autobuild-User(v4-16-test): Jule Anger <jan...@samba.org>
    Autobuild-Date(v4-16-test): Thu Jun  9 10:03:29 UTC 2022 on sn-devel-184

commit 8507fa6fc7daa29746ed81578669070a32bd0427
Author: Andreas Schneider <a...@samba.org>
Date:   Mon May 30 17:22:21 2022 +0200

    s3:printing: Initialize the printcap cache as soon as the bgqd starts
    
    As soon as the background daemon starts, we need to initialize the
    printcap cache so that rpcd-spoolssd can serve printers.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15081
    
    Signed-off-by: Andreas Schneider <a...@samba.org>
    Reviewed-by: Jeremy Allison <j...@samba.org>
    (cherry picked from commit 3b5b80e99603e4c1d4d1080ed45bd75116a9fa8e)

commit c3ce1fec590d95a2d848bce52b059784eeda430a
Author: Ralph Boehme <s...@samba.org>
Date:   Tue May 17 16:52:21 2022 +0200

    lib/util/gpfswrap: remove unused gpfswrap_get_winattrs_path()
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15069
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Christof Schmitt <c...@samba.org>
    
    Autobuild-User(master): Jeremy Allison <j...@samba.org>
    Autobuild-Date(master): Fri Jun  3 21:53:31 UTC 2022 on sn-devel-184
    
    (cherry picked from commit 3bd753983c8dac33b483affa859984b7e3350d65)

commit b8cc300d226fe6a04ce26d6f91fcd484e4f0403a
Author: Ralph Boehme <s...@samba.org>
Date:   Tue May 17 16:32:23 2022 +0200

    vfs_gpfs: use handle based gpfswrap_get_winattrs()
    
    Fixes detecting offline flag for files in snapshot – no idea if this is
    actually expected.
    
    Replaces path based gpfswrap_get_winattrs_path() with handle based version
    gpfswrap_get_winattrs(). When dealing with files in snapshots fsp->fsp_name
    points to the active dataset, which will cause ENOENT failures if files are
    deleted there any only present in the snapshot.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15069
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Christof Schmitt <c...@samba.org>
    (cherry picked from commit 8ae672f955bf07bb97f38b7d2f965f14e8315e9e)

commit 72ef38a9747b576c6640e9b43f7b70e37f5839cb
Author: Ralph Boehme <s...@samba.org>
Date:   Tue May 17 16:27:58 2022 +0200

    lib/util/gpfswrap: remove unused gpfswrap_getacl()
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15069
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Christof Schmitt <c...@samba.org>
    (cherry picked from commit 9172c5ff6a419e4daef451564650d4a3ce96bfae)

commit bdb2714671f5ee168c07d9ab3c549fd7532a5a45
Author: Ralph Boehme <s...@samba.org>
Date:   Tue May 17 16:02:10 2022 +0200

    vfs_gpfs: finally: use gpfswrap_fgetacl() instead of gpfswrap_getacl()
    
    Replaces path based gpfswrap_getacl() with handle based version
    gpfswrap_fgetacl(). When dealing with files in snapshots fsp->fsp_name 
points to
    the active dataset, which will cause ENOENT failures if files are deleted 
there
    any only present in the snapshot:
    
    [2022/05/06 11:32:55.233435,  4, pid=12962, effective(1460548, 273710), 
real(1460548, 0)]
       calling open_file with flags=0x0 flags2=0x800 mode=0644, access_mask = 
0x80, open_access_mask = 0x80
    [2022/05/06 11:32:55.233460, 10, pid=12962, effective(1460548, 273710), 
real(1460548, 0), class=vfs]
       gpfs_get_nfs4_acl invoked for dir/subdir/file.txt
    [2022/05/06 11:32:55.233495,  5, pid=12962, effective(1460548, 273710), 
real(1460548, 0), class=vfs]
       smbd_gpfs_getacl failed with No such file or directory
    [2022/05/06 11:32:55.233521,  9, pid=12962, effective(1460548, 273710), 
real(1460548, 0), class=vfs]
       gpfs_getacl failed for dir/subdir/file.txt with No such file or directory
    [2022/05/06 11:32:55.233546, 10, pid=12962, effective(1460548, 273710), 
real(1460548, 0)]
       smbd_check_access_rights_fsp: Could not get acl on dir/subdir/file.txt 
{@GMT-2022.05.04-11.58.53}: NT_STATUS_OBJECT_NAME_NOT_FOUND
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15069
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Christof Schmitt <c...@samba.org>
    (cherry picked from commit a0dc4c9026519c949070dc001e7addad7c7d35ce)

commit 1d4f8f3e472608531ae61ba6af50fd73b3ff0cef
Author: Ralph Boehme <s...@samba.org>
Date:   Tue May 17 15:43:39 2022 +0200

    lib/util/gpfswrap: add gpfswrap_fgetacl()
    
    Adds handle based version of gpfswrap_getacl().
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15069
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Christof Schmitt <c...@samba.org>
    (cherry picked from commit d373ff3c01c2c50cd539b78494c0673974a0f046)

commit 069354e74800d4d7ea2ca045e747369e107b920a
Author: Ralph Boehme <s...@samba.org>
Date:   Tue May 17 16:01:48 2022 +0200

    vfs_gpfs: pass fsp to gpfs_getacl_with_capability()
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15069
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Christof Schmitt <c...@samba.org>
    (cherry picked from commit 1b2c70f4d16e48998c9c8bc9e22ee8eb3c0ad53e)

commit bce1de5580ffd07287741543c62aa13c68646ffb
Author: Ralph Boehme <s...@samba.org>
Date:   Tue May 17 15:35:26 2022 +0200

    vfs_gpfs: pass fsp to vfs_gpfs_getacl()
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15069
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Christof Schmitt <c...@samba.org>
    (cherry picked from commit ac458648aa3f557b7f137f7efa88806f7cb0da71)

commit a039780c01cb505958ab10a08eb6fbed9493c3ed
Author: Ralph Boehme <s...@samba.org>
Date:   Tue May 17 15:34:35 2022 +0200

    vfs_gpfs: use fsp in gpfsacl_get_posix_acl()
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15069
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Christof Schmitt <c...@samba.org>
    (cherry picked from commit 3764be70319d8e953a6205649fecaed06c93dbc8)

commit d9222188190db6f72349bbc35b89b85b1150864c
Author: Ralph Boehme <s...@samba.org>
Date:   Tue May 17 15:32:24 2022 +0200

    vfs_gpfs: pass fsp to gpfsacl_get_posix_acl()
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15069
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Christof Schmitt <c...@samba.org>
    (cherry picked from commit c26efe0c23b426c4a1e7073b040da85df6f1ea61)

commit f752c3897403af189ddea581eb27ad0783deb73c
Author: Ralph Boehme <s...@samba.org>
Date:   Tue May 17 15:25:35 2022 +0200

    vfs_gpfs: pass fsp to gpfs_get_nfs4_acl()
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15069
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Christof Schmitt <c...@samba.org>
    (cherry picked from commit 5f4625a2859bf622ea2034e5bbf63f9959e58b78)

commit 2a50ba5ae191081c6341b49ef31391cd8759277b
Author: Ralph Boehme <s...@samba.org>
Date:   Tue May 17 15:17:34 2022 +0200

    vfs_gpfs: pass fsp to gpfsacl_emu_chmod()
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15069
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Christof Schmitt <c...@samba.org>
    (cherry picked from commit ad06d806831c80a1169468d18b3e59b239a5ba77)

commit ea39a8894a2054b34fdc568973e575c00d8056c8
Author: Ralph Boehme <s...@samba.org>
Date:   Tue May 17 14:47:03 2022 +0200

    vfs_gpfs: indentation and README.Coding fixes
    
    Best viewed with git show -w.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=15069
    
    Signed-off-by: Ralph Boehme <s...@samba.org>
    Reviewed-by: Christof Schmitt <c...@samba.org>
    (cherry picked from commit a0f7ced610013cad145ff14cedcfbb5388d1ea4f)

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

Summary of changes:
 lib/util/gpfswrap.c              | 24 +++--------
 lib/util/gpfswrap.h              |  4 +-
 source3/modules/vfs_gpfs.c       | 89 ++++++++++++++++++++++------------------
 source3/printing/queue_process.c | 11 +++--
 4 files changed, 61 insertions(+), 67 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/gpfswrap.c b/lib/util/gpfswrap.c
index 5cf6d2148e7..d05358e141e 100644
--- a/lib/util/gpfswrap.c
+++ b/lib/util/gpfswrap.c
@@ -23,7 +23,7 @@
 
 static int (*gpfs_set_share_fn)(int fd, unsigned int allow, unsigned int deny);
 static int (*gpfs_set_lease_fn)(int fd, unsigned int type);
-static int (*gpfs_getacl_fn)(const char *pathname, int flags, void *acl);
+static int (*gpfs_fgetacl_fn)(int fd, int flags, void *acl);
 static int (*gpfs_putacl_fn)(const char *pathname, int flags, void *acl);
 static int (*gpfs_get_realfilename_path_fn)(const char *pathname,
                                            char *filenamep,
@@ -33,8 +33,6 @@ static int (*gpfs_set_winattrs_path_fn)(const char *pathname,
                                        struct gpfs_winattr *attrs);
 static int (*gpfs_set_winattrs_fn)(int fd, int flags,
                                   struct gpfs_winattr *attrs);
-static int (*gpfs_get_winattrs_path_fn)(const char *pathname,
-                                       struct gpfs_winattr *attrs);
 static int (*gpfs_get_winattrs_fn)(int fd, struct gpfs_winattr *attrs);
 static int (*gpfs_ftruncate_fn)(int fd, gpfs_off64_t length);
 static int (*gpfs_lib_init_fn)(int flags);
@@ -70,12 +68,11 @@ int gpfswrap_init(void)
 
        gpfs_set_share_fn             = dlsym(l, "gpfs_set_share");
        gpfs_set_lease_fn             = dlsym(l, "gpfs_set_lease");
-       gpfs_getacl_fn                = dlsym(l, "gpfs_getacl");
+       gpfs_fgetacl_fn               = dlsym(l, "gpfs_getacl_fd");
        gpfs_putacl_fn                = dlsym(l, "gpfs_putacl");
        gpfs_get_realfilename_path_fn = dlsym(l, "gpfs_get_realfilename_path");
        gpfs_set_winattrs_path_fn     = dlsym(l, "gpfs_set_winattrs_path");
        gpfs_set_winattrs_fn          = dlsym(l, "gpfs_set_winattrs");
-       gpfs_get_winattrs_path_fn     = dlsym(l, "gpfs_get_winattrs_path");
        gpfs_get_winattrs_fn          = dlsym(l, "gpfs_get_winattrs");
        gpfs_ftruncate_fn             = dlsym(l, "gpfs_ftruncate");
        gpfs_lib_init_fn              = dlsym(l, "gpfs_lib_init");
@@ -112,14 +109,14 @@ int gpfswrap_set_lease(int fd, unsigned int type)
        return gpfs_set_lease_fn(fd, type);
 }
 
-int gpfswrap_getacl(const char *pathname, int flags, void *acl)
+int gpfswrap_fgetacl(int fd, int flags, void *acl)
 {
-       if (gpfs_getacl_fn == NULL) {
+       if (gpfs_fgetacl_fn == NULL) {
                errno = ENOSYS;
                return -1;
        }
 
-       return gpfs_getacl_fn(pathname, flags, acl);
+       return gpfs_fgetacl_fn(fd, flags, acl);
 }
 
 int gpfswrap_putacl(const char *pathname, int flags, void *acl)
@@ -166,17 +163,6 @@ int gpfswrap_set_winattrs(int fd, int flags, struct 
gpfs_winattr *attrs)
        return gpfs_set_winattrs_fn(fd, flags, attrs);
 }
 
-int gpfswrap_get_winattrs_path(const char *pathname,
-                              struct gpfs_winattr *attrs)
-{
-       if (gpfs_get_winattrs_path_fn == NULL) {
-               errno = ENOSYS;
-               return -1;
-       }
-
-       return gpfs_get_winattrs_path_fn(pathname, attrs);
-}
-
 int gpfswrap_get_winattrs(int fd, struct gpfs_winattr *attrs)
 {
        if (gpfs_get_winattrs_fn == NULL) {
diff --git a/lib/util/gpfswrap.h b/lib/util/gpfswrap.h
index 764cf686d2e..1e74496c060 100644
--- a/lib/util/gpfswrap.h
+++ b/lib/util/gpfswrap.h
@@ -29,7 +29,7 @@
 int gpfswrap_init(void);
 int gpfswrap_set_share(int fd, unsigned int allow, unsigned int deny);
 int gpfswrap_set_lease(int fd, unsigned int type);
-int gpfswrap_getacl(const char *pathname, int flags, void *acl);
+int gpfswrap_fgetacl(int fd, int flags, void *acl);
 int gpfswrap_putacl(const char *pathname, int flags, void *acl);
 int gpfswrap_get_realfilename_path(const char *pathname,
                                   char *filenamep,
@@ -38,8 +38,6 @@ 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_path(const char *pathname,
-                              struct gpfs_winattr *attrs);
 int gpfswrap_get_winattrs(int fd, struct gpfs_winattr *attrs);
 int gpfswrap_ftruncate(int fd, gpfs_off64_t length);
 int gpfswrap_lib_init(int flags);
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c
index e6b2a5d142b..6b084fd79a5 100644
--- a/source3/modules/vfs_gpfs.c
+++ b/source3/modules/vfs_gpfs.c
@@ -413,13 +413,15 @@ static void gpfs_dumpacl(int level, struct gpfs_acl *gacl)
        }
 }
 
-static int gpfs_getacl_with_capability(const char *fname, int flags, void *buf)
+static int gpfs_getacl_with_capability(struct files_struct *fsp,
+                                      int flags,
+                                      void *buf)
 {
        int ret, saved_errno;
 
        set_effective_capability(DAC_OVERRIDE_CAPABILITY);
 
-       ret = gpfswrap_getacl(fname, flags, buf);
+       ret = gpfswrap_fgetacl(fsp_get_pathref_fd(fsp), flags, buf);
        saved_errno = errno;
 
        drop_effective_capability(DAC_OVERRIDE_CAPABILITY);
@@ -438,11 +440,11 @@ static int gpfs_getacl_with_capability(const char *fname, 
int flags, void *buf)
  *
  */
 static void *vfs_gpfs_getacl(TALLOC_CTX *mem_ctx,
-                        const char *fname,
+                        struct files_struct *fsp,
                         const bool raw,
                         const gpfs_aclType_t type)
 {
-
+       const char *fname = fsp->fsp_name->base_name;
        void *aclbuf;
        size_t size = 512;
        int ret, flags;
@@ -478,13 +480,13 @@ again:
        *len = size;
 
        if (use_capability) {
-               ret = gpfs_getacl_with_capability(fname, flags, aclbuf);
+               ret = gpfs_getacl_with_capability(fsp, flags, aclbuf);
        } else {
-               ret = gpfswrap_getacl(fname, flags, aclbuf);
+               ret = gpfswrap_fgetacl(fsp_get_pathref_fd(fsp), flags, aclbuf);
                if ((ret != 0) && (errno == EACCES)) {
                        DBG_DEBUG("Retry with DAC capability for %s\n", fname);
                        use_capability = true;
-                       ret = gpfs_getacl_with_capability(fname, flags, aclbuf);
+                       ret = gpfs_getacl_with_capability(fsp, flags, aclbuf);
                }
        }
 
@@ -519,15 +521,17 @@ again:
  * On failure returns -1 if there is system (GPFS) error, check errno.
  * Returns 0 on success
  */
-static int gpfs_get_nfs4_acl(TALLOC_CTX *mem_ctx, const char *fname,
+static int gpfs_get_nfs4_acl(TALLOC_CTX *mem_ctx,
+                            struct files_struct *fsp,
                             struct SMB4ACL_T **ppacl)
 {
+       const char *fname = fsp->fsp_name->base_name;
        gpfs_aclCount_t i;
        struct gpfs_acl *gacl = NULL;
        DEBUG(10, ("gpfs_get_nfs4_acl invoked for %s\n", fname));
 
        /* Get the ACL */
-       gacl = (struct gpfs_acl*) vfs_gpfs_getacl(talloc_tos(), fname,
+       gacl = (struct gpfs_acl*) vfs_gpfs_getacl(talloc_tos(), fsp,
                                                  false, 0);
        if (gacl == NULL) {
                DEBUG(9, ("gpfs_getacl failed for %s with %s\n",
@@ -640,7 +644,7 @@ static NTSTATUS gpfsacl_fget_nt_acl(vfs_handle_struct 
*handle,
                return status;
        }
 
-       result = gpfs_get_nfs4_acl(frame, fsp->fsp_name->base_name, &pacl);
+       result = gpfs_get_nfs4_acl(frame, fsp, &pacl);
 
        if (result == 0) {
                status = smb_fget_nt_acl_nfs4(fsp, &config->nfs4_params,
@@ -819,7 +823,7 @@ static NTSTATUS 
gpfsacl_set_nt_acl_internal(vfs_handle_struct *handle, files_str
        NTSTATUS result = NT_STATUS_ACCESS_DENIED;
 
        acl = (struct gpfs_acl*) vfs_gpfs_getacl(talloc_tos(),
-                                                fsp->fsp_name->base_name,
+                                                fsp,
                                                 false, 0);
        if (acl == NULL) {
                return map_nt_error_from_unix(errno);
@@ -938,17 +942,18 @@ static SMB_ACL_T gpfs2smb_acl(const struct gpfs_acl 
*pacl, TALLOC_CTX *mem_ctx)
        return result;
 }
 
-static SMB_ACL_T gpfsacl_get_posix_acl(const char *path, gpfs_aclType_t type,
+static SMB_ACL_T gpfsacl_get_posix_acl(struct files_struct *fsp,
+                                      gpfs_aclType_t type,
                                       TALLOC_CTX *mem_ctx)
 {
        struct gpfs_acl *pacl;
        SMB_ACL_T result = NULL;
 
-       pacl = vfs_gpfs_getacl(talloc_tos(), path, false, type);
+       pacl = vfs_gpfs_getacl(talloc_tos(), fsp, false, type);
 
        if (pacl == NULL) {
-               DEBUG(10, ("vfs_gpfs_getacl failed for %s with %s\n",
-                          path, strerror(errno)));
+               DBG_DEBUG("vfs_gpfs_getacl failed for %s with %s\n",
+                          fsp_str_dbg(fsp), strerror(errno));
                if (errno == 0) {
                        errno = EINVAL;
                }
@@ -1009,8 +1014,7 @@ static SMB_ACL_T gpfsacl_sys_acl_get_fd(vfs_handle_struct 
*handle,
                DEBUG(0, ("Got invalid type: %d\n", type));
                smb_panic("exiting");
        }
-       return gpfsacl_get_posix_acl(fsp->fsp_name->base_name,
-                                    gpfs_type, mem_ctx);
+       return gpfsacl_get_posix_acl(fsp, gpfs_type, mem_ctx);
 }
 
 static int gpfsacl_sys_acl_blob_get_fd(vfs_handle_struct *handle,
@@ -1035,7 +1039,7 @@ static int gpfsacl_sys_acl_blob_get_fd(vfs_handle_struct 
*handle,
 
        errno = 0;
        acl = (struct gpfs_opaque_acl *) vfs_gpfs_getacl(mem_ctx,
-                                               fsp->fsp_name->base_name,
+                                               fsp,
                                                true,
                                                GPFS_ACL_TYPE_NFS4);
 
@@ -1253,9 +1257,11 @@ static uint32_t gpfsacl_mask_filter(uint32_t aceType, 
uint32_t aceMask, uint32_t
 }
 
 static int gpfsacl_emu_chmod(vfs_handle_struct *handle,
-                            const struct smb_filename *fname, mode_t mode)
+                            struct files_struct *fsp,
+                            mode_t mode)
 {
-       char *path = fname->base_name;
+       struct smb_filename *fname = fsp->fsp_name;
+       char *path = fsp->fsp_name->base_name;
        struct SMB4ACL_T *pacl = NULL;
        int     result;
        bool    haveAllowEntry[SMB_ACE4_WHO_EVERYONE + 1] = {False, False, 
False, False};
@@ -1266,7 +1272,7 @@ static int gpfsacl_emu_chmod(vfs_handle_struct *handle,
 
        DEBUG(10, ("gpfsacl_emu_chmod invoked for %s mode %o\n", path, mode));
 
-       result = gpfs_get_nfs4_acl(frame, path, &pacl);
+       result = gpfs_get_nfs4_acl(frame, fsp, &pacl);
        if (result) {
                TALLOC_FREE(frame);
                return result;
@@ -1355,23 +1361,24 @@ static int gpfsacl_emu_chmod(vfs_handle_struct *handle,
 
 static int vfs_gpfs_fchmod(vfs_handle_struct *handle, files_struct *fsp, 
mode_t mode)
 {
-                SMB_STRUCT_STAT st;
-                int rc;
+       SMB_STRUCT_STAT st;
+       int rc;
 
-                if (SMB_VFS_NEXT_FSTAT(handle, fsp, &st) != 0) {
-                        return -1;
-                }
+       rc = SMB_VFS_NEXT_FSTAT(handle, fsp, &st);
+       if (rc != 0) {
+               return -1;
+       }
 
-                /* avoid chmod() if possible, to preserve acls */
-                if ((st.st_ex_mode & ~S_IFMT) == mode) {
-                        return 0;
-                }
+       /* avoid chmod() if possible, to preserve acls */
+       if ((st.st_ex_mode & ~S_IFMT) == mode) {
+               return 0;
+       }
 
-                rc = gpfsacl_emu_chmod(handle, fsp->fsp_name,
-                                       mode);
-                if (rc == 1)
-                        return SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
-                return rc;
+       rc = gpfsacl_emu_chmod(handle, fsp, mode);
+       if (rc == 1) {
+               return SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
+       }
+       return rc;
 }
 
 static uint32_t vfs_gpfs_winattrs_to_dosmode(unsigned int winattrs)
@@ -1904,7 +1911,7 @@ static int vfs_gpfs_ftruncate(vfs_handle_struct *handle, 
files_struct *fsp,
 }
 
 static bool vfs_gpfs_is_offline(struct vfs_handle_struct *handle,
-                               const struct smb_filename *fname,
+                               struct files_struct *fsp,
                                SMB_STRUCT_STAT *sbuf)
 {
        struct gpfs_winattr attrs;
@@ -1919,17 +1926,17 @@ static bool vfs_gpfs_is_offline(struct 
vfs_handle_struct *handle,
                return false;
        }
 
-       ret = gpfswrap_get_winattrs_path(fname->base_name, &attrs);
+       ret = gpfswrap_get_winattrs(fsp_get_pathref_fd(fsp), &attrs);
        if (ret == -1) {
                return false;
        }
 
        if ((attrs.winAttrs & GPFS_WINATTR_OFFLINE) != 0) {
-               DBG_DEBUG("%s is offline\n", fname->base_name);
+               DBG_DEBUG("%s is offline\n", fsp_str_dbg(fsp));
                return true;
        }
 
-       DBG_DEBUG("%s is online\n", fname->base_name);
+       DBG_DEBUG("%s is online\n", fsp_str_dbg(fsp));
        return false;
 }
 
@@ -1943,7 +1950,7 @@ static bool vfs_gpfs_fsp_is_offline(struct 
vfs_handle_struct *handle,
                /*
                 * Something bad happened, always ask.
                 */
-               return vfs_gpfs_is_offline(handle, fsp->fsp_name,
+               return vfs_gpfs_is_offline(handle, fsp,
                                           &fsp->fsp_name->st);
        }
 
@@ -1951,7 +1958,7 @@ static bool vfs_gpfs_fsp_is_offline(struct 
vfs_handle_struct *handle,
                /*
                 * As long as it's offline, ask.
                 */
-               ext->offline = vfs_gpfs_is_offline(handle, fsp->fsp_name,
+               ext->offline = vfs_gpfs_is_offline(handle, fsp,
                                                   &fsp->fsp_name->st);
        }
 
diff --git a/source3/printing/queue_process.c b/source3/printing/queue_process.c
index 3b0ef55c3cc..6613e8f9f55 100644
--- a/source3/printing/queue_process.c
+++ b/source3/printing/queue_process.c
@@ -319,6 +319,9 @@ struct bq_state *register_printing_bq_handlers(
                goto fail_free_handlers;
        }
 
+       /* Initialize the printcap cache as soon as the daemon starts. */
+       pcap_cache_reload(state->ev, state->msg, reload_pcap_change_notify);
+
        ok = printing_subsystem_queue_tasks(state);
        if (!ok) {
                goto fail_free_handlers;
@@ -420,16 +423,16 @@ bool printing_subsystem_init(struct tevent_context 
*ev_ctx,
 {
        pid_t pid = -1;
 
-       if (!print_backend_init(msg_ctx)) {
-               return false;
-       }
-
        pid = start_background_queue(NULL, NULL, NULL);
        if (pid == -1) {
                return false;
        }
        background_lpq_updater_pid = pid;
 
+       if (!print_backend_init(msg_ctx)) {
+               return false;
+       }
+
        return true;
 }
 


-- 
Samba Shared Repository

Reply via email to