summaryrefslogtreecommitdiffstats
path: root/source3
diff options
context:
space:
mode:
authorChristof Schmitt <cs@samba.org>2015-02-18 14:22:55 -0700
committerChristof Schmitt <cs@samba.org>2015-03-02 22:31:07 +0100
commit5fb2568d5b723fcd77861f14d4ba7de1978876a9 (patch)
tree0d07e5bb3c7da6ea32e9d014539da4adfd9097d9 /source3
parentca69d43dfd13ddc4d501d3e36944f56e13e75c0f (diff)
downloadsamba-5fb2568d5b723fcd77861f14d4ba7de1978876a9.tar.gz
samba-5fb2568d5b723fcd77861f14d4ba7de1978876a9.tar.xz
samba-5fb2568d5b723fcd77861f14d4ba7de1978876a9.zip
gpfs: Introduce wrapper for gpfs_set_share
Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/gpfs.c21
-rw-r--r--source3/modules/vfs_gpfs.h1
2 files changed, 15 insertions, 7 deletions
diff --git a/source3/modules/gpfs.c b/source3/modules/gpfs.c
index 933d491e0a..e2628a56d1 100644
--- a/source3/modules/gpfs.c
+++ b/source3/modules/gpfs.c
@@ -76,6 +76,16 @@ int gpfswrap_init(void)
return 0;
}
+int gpfswrap_set_share(int fd, unsigned int allow, unsigned int deny)
+{
+ if (gpfs_set_share_fn == NULL) {
+ errno = ENOSYS;
+ return -1;
+ }
+
+ return gpfs_set_share_fn(fd, allow, deny);
+}
+
bool set_gpfs_sharemode(files_struct *fsp, uint32 access_mask,
uint32 share_access)
{
@@ -83,10 +93,6 @@ bool set_gpfs_sharemode(files_struct *fsp, uint32 access_mask,
unsigned int deny = GPFS_DENY_NONE;
int result;
- if (gpfs_set_share_fn == NULL) {
- return False;
- }
-
if ((fsp == NULL) || (fsp->fh == NULL) || (fsp->fh->fd < 0)) {
/* No real file, don't disturb */
return True;
@@ -109,11 +115,12 @@ bool set_gpfs_sharemode(files_struct *fsp, uint32 access_mask,
DEBUG(10, ("am=%x, allow=%d, sa=%x, deny=%d\n",
access_mask, allow, share_access, deny));
- result = gpfs_set_share_fn(fsp->fh->fd, allow, deny);
+ result = gpfswrap_set_share(fsp->fh->fd, allow, deny);
if (result != 0) {
if (errno == ENOSYS) {
- DEBUG(5, ("VFS module vfs_gpfs loaded, but no gpfs "
- "support has been compiled into Samba. Allowing access\n"));
+ DEBUG(5, ("VFS module vfs_gpfs loaded, but gpfs "
+ "set_share function support not available. "
+ "Allowing access\n"));
return True;
} else {
DEBUG(10, ("gpfs_set_share failed: %s\n",
diff --git a/source3/modules/vfs_gpfs.h b/source3/modules/vfs_gpfs.h
index 37b58f712c..5ab9ff3649 100644
--- a/source3/modules/vfs_gpfs.h
+++ b/source3/modules/vfs_gpfs.h
@@ -28,6 +28,7 @@
#endif
int gpfswrap_init(void);
+int gpfswrap_set_share(int fd, unsigned int allow, unsigned int deny);
bool set_gpfs_sharemode(files_struct *fsp, uint32 access_mask,
uint32 share_access);
int set_gpfs_lease(int fd, int leasetype);