Make use of gpfs_get_real_filename optional
authorVolker Lendecke <vl@samba.org>
Mon, 2 Mar 2009 13:56:01 +0000 (14:56 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 4 Mar 2009 10:23:12 +0000 (11:23 +0100)
source3/modules/gpfs.c
source3/modules/vfs_gpfs.c

index 16599005b93082e4e3ed71dbfb5d8aad1a0e3bbb..9fc4524654b3263c0605496e30a4ee1cbbc9ec62 100644 (file)
@@ -26,6 +26,7 @@
 
 static bool gpfs_share_modes;
 static bool gpfs_leases;
+static bool gpfs_getrealfilename;
 
 static int (*gpfs_set_share_fn)(int fd, unsigned int allow, unsigned int deny);
 static int (*gpfs_set_lease_fn)(int fd, unsigned int leaseType);
@@ -139,7 +140,8 @@ int smbd_gpfs_putacl(char *pathname, int flags, void *acl)
 int smbd_gpfs_get_realfilename_path(char *pathname, char *filenamep,
                                    int *buflen)
 {
-       if (gpfs_get_realfilename_path_fn == NULL) {
+       if ((!gpfs_getrealfilename)
+           || (gpfs_get_realfilename_path_fn == NULL)) {
                errno = ENOSYS;
                return -1;
        }
@@ -208,6 +210,8 @@ void init_gpfs(void)
 
        gpfs_share_modes = lp_parm_bool(-1, "gpfs", "sharemodes", True);
        gpfs_leases      = lp_parm_bool(-1, "gpfs", "leases", True);
+       gpfs_getrealfilename = lp_parm_bool(-1, "gpfs", "getrealfilename",
+                                           True);
 
        return;
 }
index 1d7cdba01412c975a8635c176bdce0da0b146a92..3c061ece79ce965aeba93ce3c141c2d00f822f25 100644 (file)
@@ -96,6 +96,11 @@ static int vfs_gpfs_get_real_filename(struct vfs_handle_struct *handle,
 
        TALLOC_FREE(full_path);
 
+       if ((result == -1) && (errno == ENOSYS)) {
+               return SMB_VFS_NEXT_GET_REAL_FILENAME(
+                       handle, path, name, mem_ctx, found_name);
+       }
+
        if (result == -1) {
                DEBUG(10, ("smbd_gpfs_get_realfilename_path returned %s\n",
                           strerror(errno)));