summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2022-05-17 15:43:39 +0200
committerJule Anger <janger@samba.org>2022-06-09 08:54:16 +0000
commit1d4f8f3e472608531ae61ba6af50fd73b3ff0cef (patch)
treeac934be1539d7c94d0bdef8e16f7533ac0342099
parent069354e74800d4d7ea2ca045e747369e107b920a (diff)
downloadsamba-1d4f8f3e472608531ae61ba6af50fd73b3ff0cef.tar.gz
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 <slow@samba.org> Reviewed-by: Christof Schmitt <cs@samba.org> (cherry picked from commit d373ff3c01c2c50cd539b78494c0673974a0f046)
-rw-r--r--lib/util/gpfswrap.c12
-rw-r--r--lib/util/gpfswrap.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/util/gpfswrap.c b/lib/util/gpfswrap.c
index 5cf6d2148e7..ff0b9bd7031 100644
--- a/lib/util/gpfswrap.c
+++ b/lib/util/gpfswrap.c
@@ -24,6 +24,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,
@@ -71,6 +72,7 @@ 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");
@@ -122,6 +124,16 @@ int gpfswrap_getacl(const char *pathname, int flags, void *acl)
return gpfs_getacl_fn(pathname, flags, acl);
}
+int gpfswrap_fgetacl(int fd, int flags, void *acl)
+{
+ if (gpfs_fgetacl_fn == NULL) {
+ errno = ENOSYS;
+ return -1;
+ }
+
+ return gpfs_fgetacl_fn(fd, flags, acl);
+}
+
int gpfswrap_putacl(const char *pathname, int flags, void *acl)
{
if (gpfs_putacl_fn == NULL) {
diff --git a/lib/util/gpfswrap.h b/lib/util/gpfswrap.h
index 764cf686d2e..db541b31f10 100644
--- a/lib/util/gpfswrap.h
+++ b/lib/util/gpfswrap.h
@@ -30,6 +30,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,