Skip to content

Commit

Permalink
lib/util/gpfswrap: add gpfswrap_fgetacl()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
slowfranklin authored and jrasamba committed Jun 3, 2022
1 parent 1b2c70f commit d373ff3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/util/gpfswrap.c
Expand Up @@ -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,
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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) {
Expand Down
1 change: 1 addition & 0 deletions lib/util/gpfswrap.h
Expand Up @@ -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,
Expand Down

0 comments on commit d373ff3

Please sign in to comment.