[SCM] Samba Shared Repository - branch v3-3-stable updated - release-3-3-0rc1-142-gd6d326e

Karolin Seeger kseeger at samba.org
Fri Dec 12 16:37:05 GMT 2008


The branch, v3-3-stable has been updated
       via  d6d326e3de830259dfc0af66f2bc7414145fecd1 (commit)
       via  73560a92ffd6e156b7b4079b089617de53da8747 (commit)
       via  d7bfadeb8b85d88e9c0940297f4e3d149af52530 (commit)
       via  feaeac1d21151ca358dbec2de42336aa3afbd45e (commit)
       via  cfa9a2d7df668b12b334cf638d4253f107cebfa9 (commit)
       via  ba59c4b0ab938b5533082cd396f0c1a3fc45dcfb (commit)
       via  32900ece556bbf4d8cca19e7c88eb4692a93c8e1 (commit)
       via  b3902eac2d0981cfded674ba33cbfe930001e428 (commit)
       via  51a956d049459bf13689e01a51d5cdb994d34d4b (commit)
       via  1f6b7f5b2d5a49eaa19cd92d91fc3c6db197e5e0 (commit)
      from  e114894a5b8e3187d28f830ff67792d96367b21e (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-stable


- Log -----------------------------------------------------------------
commit d6d326e3de830259dfc0af66f2bc7414145fecd1
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Dec 10 16:58:40 2008 +0100

    Fix the build
    
    Crap, too many trees and no instant, infinitely fast rebuild
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    (cherry picked from commit 6459f00d1cad1d5e9e14851610ca7a92406ad54a)

commit 73560a92ffd6e156b7b4079b089617de53da8747
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Dec 10 18:17:59 2008 +0100

    Also search for -lgpfs which is available as GPL in GPFS PTF8 (cherry picked from commit 3c93c96fd0fe362c35fe8127058f94868abc9342)
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    (cherry picked from commit 011bcdec1960f4e62538046814d381938956644c)

commit d7bfadeb8b85d88e9c0940297f4e3d149af52530
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Dec 10 12:32:24 2008 +0100

    Make use of smbd_gpfs_get_realfilename_path in unix_convert (cherry picked from commit b37684ffcec4ba0beada55d37bcaf4f5e79bcd58)
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    (cherry picked from commit 25e2ff536b2eeffa18b91ab2141d8350d2130824)

commit feaeac1d21151ca358dbec2de42336aa3afbd45e
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Dec 10 03:22:04 2008 +0100

    Fix nonempty blank lines in vfs_gpfs.c
    
    Signed-off-by: Michael Adam <obnox at samba.org>
    (cherry picked from commit ca5ee1861f0aa170eb862efdb27256a62f20e2b0)

commit cfa9a2d7df668b12b334cf638d4253f107cebfa9
Author: Volker Lendecke <vl at sernet.de>
Date:   Wed Oct 1 12:26:55 2008 +0200

    s3:modules/gpfs: Fix nonempty blank lines
    (cherry picked from commit efa578bbfe49fdcb14ae6e390a0d54810174dfbc)

commit ba59c4b0ab938b5533082cd396f0c1a3fc45dcfb
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Dec 10 03:17:19 2008 +0100

    Pass the get_real_filename operation through the VFS
    
    This is done to help file systems that can tell us about the real upper/lower
    case combination given a case-insensitive file name. The sample I will soon
    push is the gpfs module (recent gpfs has a get_real_filename function), others
    might have a similar function to help alleviate the 1million files in a single
    directory problem.
    
    Jeremy, please comment!
    
    Thanks,
    
    Volker
    (cherry picked from commit bddb6a770f036a21f5485e4f1167628f70d56079)

commit 32900ece556bbf4d8cca19e7c88eb4692a93c8e1
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Dec 10 03:03:51 2008 +0100

    Change get_real_filename() to unix syscall conventions, make it non-static
    
    It sets errno, so it might as well return 0/-1.
    (cherry picked from commit 95050a708c145e99f3c317a5e6834352cbdf5a8c)

commit b3902eac2d0981cfded674ba33cbfe930001e428
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Dec 9 13:50:22 2008 +0100

    Apply some const
    (cherry picked from commit 915b6fbf269a542603da289d8f67b6ca5226e1a0)

commit 51a956d049459bf13689e01a51d5cdb994d34d4b
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Dec 9 13:40:41 2008 +0100

    Rename "scan_directory" to "get_real_filename"
    (cherry picked from commit 9ce0855c11ed437e7e0776dbf725751ea7b84959)

commit 1f6b7f5b2d5a49eaa19cd92d91fc3c6db197e5e0
Author: root <root at bando.(none)>
Date:   Fri Dec 12 16:51:34 2008 +0100

    s3 sesssetup.c: Add missing line break to debug message.
    
    Karolin
    (cherry picked from commit eef7ee5f31dc94639580b01283bc0dbe9a90dbde)

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

Summary of changes:
 source/configure.in          |   14 ++++
 source/include/proto.h       |    3 +
 source/include/vfs.h         |    8 ++
 source/include/vfs_macros.h  |    3 +
 source/modules/gpfs.c        |   29 +++++++-
 source/modules/vfs_default.c |   12 +++
 source/modules/vfs_gpfs.c    |  166 ++++++++++++++++++++++++++++--------------
 source/modules/vfs_gpfs.h    |    2 +
 source/smbd/filename.c       |   32 ++++----
 source/smbd/sesssetup.c      |    2 +-
 10 files changed, 196 insertions(+), 75 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/configure.in b/source/configure.in
index 798a0f8..97d9eb0 100644
--- a/source/configure.in
+++ b/source/configure.in
@@ -1078,6 +1078,20 @@ if test x"$samba_cv_HAVE_GPFS" = x"yes"; then
 fi
 LIBS="$save_LIBS"
 
+printf "%s" "checking for GPFS libs (with 3.2.1 PTF8 available as GPL)... "
+save_LIBS="$LIBS"
+LIBS="$LIBS -lgpfs"
+AC_TRY_LINK([#include <gpfs.h>],
+          [gpfs_set_share(0,GPFS_SHARE_READ,GPFS_DENY_NONE)],
+          samba_cv_HAVE_GPFS=yes,
+          samba_cv_HAVE_GPFS=no)
+echo $samba_cv_HAVE_GPFS
+if test x"$samba_cv_HAVE_GPFS" = x"yes"; then
+    AC_DEFINE(HAVE_GPFS,1,[Whether GPFS GPL libs are available])
+    default_shared_modules="$default_shared_modules vfs_gpfs"
+fi
+LIBS="$save_LIBS"
+
 # Note that all the libunwind symbols in the API are defined to internal
 # platform-specific version, so we must include libunwind.h before checking
 # any of them.
diff --git a/source/include/proto.h b/source/include/proto.h
index 7cc1adc..9d0b190 100644
--- a/source/include/proto.h
+++ b/source/include/proto.h
@@ -9663,6 +9663,9 @@ NTSTATUS unix_convert(TALLOC_CTX *ctx,
 			char **pp_saved_last_component,
 			SMB_STRUCT_STAT *pst);
 NTSTATUS check_name(connection_struct *conn, const char *name);
+int get_real_filename(connection_struct *conn, const char *path,
+		      const char *name, TALLOC_CTX *mem_ctx,
+		      char **found_name);
 
 /* The following definitions come from smbd/files.c  */
 
diff --git a/source/include/vfs.h b/source/include/vfs.h
index a3d38f6..9801c11 100644
--- a/source/include/vfs.h
+++ b/source/include/vfs.h
@@ -205,6 +205,7 @@ typedef enum _vfs_op_type {
 	SMB_VFS_OP_CHFLAGS,
 	SMB_VFS_OP_FILE_ID_CREATE,
 	SMB_VFS_OP_STREAMINFO,
+	SMB_VFS_OP_GET_REAL_FILENAME,
 
 	/* NT ACL operations. */
 
@@ -353,6 +354,12 @@ struct vfs_ops {
 				       unsigned int *num_streams,
 				       struct stream_struct **streams);
 
+		int (*get_real_filename)(struct vfs_handle_struct *handle,
+					 const char *path,
+					 const char *name,
+					 TALLOC_CTX *mem_ctx,
+					 char **found_name);
+
 		/* NT ACL operations. */
 
 		NTSTATUS (*fget_nt_acl)(struct vfs_handle_struct *handle,
@@ -487,6 +494,7 @@ struct vfs_ops {
 		struct vfs_handle_struct *chflags;
 		struct vfs_handle_struct *file_id_create;
 		struct vfs_handle_struct *streaminfo;
+		struct vfs_handle_struct *get_real_filename;
 
 		/* NT ACL operations. */
 
diff --git a/source/include/vfs_macros.h b/source/include/vfs_macros.h
index 8fbc21b..e65ced0 100644
--- a/source/include/vfs_macros.h
+++ b/source/include/vfs_macros.h
@@ -84,6 +84,7 @@
 #define SMB_VFS_CHFLAGS(conn, path, flags) ((conn)->vfs.ops.chflags((conn)->vfs.handles.chflags, (path), (flags)))
 #define SMB_VFS_FILE_ID_CREATE(conn, dev, inode) ((conn)->vfs.ops.file_id_create((conn)->vfs.handles.file_id_create, (dev), (inode)))
 #define SMB_VFS_STREAMINFO(conn, fsp, fname, mem_ctx, num_streams, streams) ((conn)->vfs.ops.streaminfo((conn)->vfs.handles.streaminfo, (fsp), (fname), (mem_ctx), (num_streams), (streams)))
+#define SMB_VFS_GET_REAL_FILENAME(conn, path, name, mem_ctx, found_name) ((conn)->vfs.ops.get_real_filename((conn)->vfs.handles.get_real_filename, (path), (name), (mem_ctx), (found_name)))
 
 /* NT ACL operations. */
 #define SMB_VFS_FGET_NT_ACL(fsp, security_info, ppdesc) ((fsp)->conn->vfs.ops.fget_nt_acl((fsp)->conn->vfs.handles.fget_nt_acl, (fsp), (security_info), (ppdesc)))
@@ -209,6 +210,7 @@
 #define SMB_VFS_OPAQUE_CHFLAGS(conn, path, flags) ((conn)->vfs_opaque.ops.chflags((conn)->vfs_opaque.handles.chflags, (path), (flags)))
 #define SMB_VFS_OPAQUE_FILE_ID_CREATE(conn, dev, inode) ((conn)->vfs.ops_opaque.file_id_create((conn)->vfs_opaque.handles.file_id_create, (dev), (inode)))
 #define SMB_VFS_OPAQUE_STREAMINFO(conn, fsp, fname, mem_ctx, num_streams, streams) ((conn)->vfs_opaque.ops.streaminfo((conn)->vfs_opaque.handles.streaminfo, (fsp), (fname), (mem_ctx), (num_streams), (streams)))
+#define SMB_VFS_OPAQUE_GET_REAL_FILENAME(conn, path, name, mem_ctx, found_name) ((conn)->vfs_opaque.ops.get_real_filename((conn)->vfs_opaque.handles.get_real_filename, (path), (name), (mem_ctx), (found_name)))
 
 /* NT ACL operations. */
 #define SMB_VFS_OPAQUE_FGET_NT_ACL(fsp, security_info, ppdesc) ((fsp)->conn->vfs_opaque.ops.fget_nt_acl((fsp)->conn->vfs_opaque.handles.fget_nt_acl, (fsp), (security_info), (ppdesc)))
@@ -335,6 +337,7 @@
 #define SMB_VFS_NEXT_CHFLAGS(handle, path, flags) ((handle)->vfs_next.ops.chflags((handle)->vfs_next.handles.chflags, (path), (flags)))
 #define SMB_VFS_NEXT_FILE_ID_CREATE(handle, dev, inode) ((handle)->vfs_next.ops.file_id_create((handle)->vfs_next.handles.file_id_create, (dev), (inode)))
 #define SMB_VFS_NEXT_STREAMINFO(handle, fsp, fname, mem_ctx, num_streams, streams) ((handle)->vfs_next.ops.streaminfo((handle)->vfs_next.handles.streaminfo, (fsp), (fname), (mem_ctx), (num_streams), (streams)))
+#define SMB_VFS_NEXT_GET_REAL_FILENAME(conn, path, name, mem_ctx, found_name) ((conn)->vfs_next.ops.get_real_filename((conn)->vfs_next.handles.get_real_filename, (path), (name), (mem_ctx), (found_name)))
 
 /* NT ACL operations. */
 #define SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, ppdesc) ((handle)->vfs_next.ops.fget_nt_acl((handle)->vfs_next.handles.fget_nt_acl, (fsp), (security_info), (ppdesc)))
diff --git a/source/modules/gpfs.c b/source/modules/gpfs.c
index 11869d8..92aecb9 100644
--- a/source/modules/gpfs.c
+++ b/source/modules/gpfs.c
@@ -31,6 +31,8 @@ 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);
 static int (*gpfs_getacl_fn)(char *pathname, int flags, void *acl);
 static int (*gpfs_putacl_fn)(char *pathname, int flags, void *acl);
+static int (*gpfs_get_realfilename_path_fn)(char *pathname, char *filenamep,
+					    int *buflen);
 
 
 bool set_gpfs_sharemode(files_struct *fsp, uint32 access_mask,
@@ -43,7 +45,7 @@ bool set_gpfs_sharemode(files_struct *fsp, uint32 access_mask,
 	if (!gpfs_share_modes) {
 		return True;
 	}
-	
+
 	if (gpfs_set_share_fn == NULL) {
 		return False;
 	}
@@ -104,7 +106,7 @@ int set_gpfs_lease(int fd, int leasetype)
 	if (leasetype == F_WRLCK) {
 		gpfs_type = GPFS_LEASE_WRITE;
 	}
-	
+
 	/* we unconditionally set CAP_LEASE, rather than looking for
 	   -1/EACCES as there is a bug in some versions of
 	   libgpfs_gpl.so which results in a leaked fd on /dev/ss0
@@ -134,6 +136,17 @@ int smbd_gpfs_putacl(char *pathname, int flags, void *acl)
 	return gpfs_putacl_fn(pathname, flags, acl);
 }
 
+int smbd_gpfs_get_realfilename_path(char *pathname, char *filenamep,
+				    int *buflen)
+{
+	if (gpfs_get_realfilename_path_fn == NULL) {
+		errno = ENOSYS;
+		return -1;
+	}
+
+	return gpfs_get_realfilename_path_fn(pathname, filenamep, buflen);
+}
+
 static bool init_gpfs_function_lib(void *plibhandle_pointer,
 				   const char *libname,
 				   void *pfn_pointer, const char *fn_name)
@@ -142,6 +155,9 @@ static bool init_gpfs_function_lib(void *plibhandle_pointer,
 	void **libhandle_pointer = (void **)plibhandle_pointer;
 	void **fn_pointer = (void **)pfn_pointer;
 
+	DEBUG(10, ("trying to load name %s from %s\n",
+		   fn_name, libname));
+
 	if (*libhandle_pointer == NULL) {
 		*libhandle_pointer = sys_dlopen(libname, RTLD_LAZY);
 		did_open_here = true;
@@ -187,6 +203,8 @@ void init_gpfs(void)
 	init_gpfs_function(&gpfs_set_lease_fn, "gpfs_set_lease");
 	init_gpfs_function(&gpfs_getacl_fn, "gpfs_getacl");
 	init_gpfs_function(&gpfs_putacl_fn, "gpfs_putacl");
+	init_gpfs_function(&gpfs_get_realfilename_path_fn,
+			   "gpfs_get_realfilename_path");
 
 	gpfs_share_modes = lp_parm_bool(-1, "gpfs", "sharemodes", True);
 	gpfs_leases      = lp_parm_bool(-1, "gpfs", "leases", True);
@@ -226,6 +244,13 @@ int smbd_gpfs_putacl(char *pathname, int flags, void *acl)
 	return -1;
 }
 
+int smbd_gpfs_get_realfilename_path(char *pathname, char *fileamep,
+				    int *buflen)
+{
+	errno = ENOSYS;
+	return -1;
+}
+
 void init_gpfs(void)
 {
 	return;
diff --git a/source/modules/vfs_default.c b/source/modules/vfs_default.c
index 372cdf2..09ad3cb 100644
--- a/source/modules/vfs_default.c
+++ b/source/modules/vfs_default.c
@@ -1012,6 +1012,16 @@ static NTSTATUS vfswrap_streaminfo(vfs_handle_struct *handle,
 	return NT_STATUS_OK;
 }
 
+static int vfswrap_get_real_filename(struct vfs_handle_struct *handle,
+				     const char *path,
+				     const char *name,
+				     TALLOC_CTX *mem_ctx,
+				     char **found_name)
+{
+	return get_real_filename(handle->conn, path, name, mem_ctx,
+				 found_name);
+}
+
 static NTSTATUS vfswrap_fget_nt_acl(vfs_handle_struct *handle,
 				    files_struct *fsp,
 				    uint32 security_info, SEC_DESC **ppdesc)
@@ -1431,6 +1441,8 @@ static vfs_op_tuple vfs_default_ops[] = {
 	 SMB_VFS_LAYER_OPAQUE},
 	{SMB_VFS_OP(vfswrap_streaminfo),	SMB_VFS_OP_STREAMINFO,
 	 SMB_VFS_LAYER_OPAQUE},
+	{SMB_VFS_OP(vfswrap_get_real_filename),	SMB_VFS_OP_GET_REAL_FILENAME,
+	 SMB_VFS_LAYER_OPAQUE},
 
 	/* NT ACL operations. */
 
diff --git a/source/modules/vfs_gpfs.c b/source/modules/vfs_gpfs.c
index fa0b4e9..1d7cdba 100644
--- a/source/modules/vfs_gpfs.c
+++ b/source/modules/vfs_gpfs.c
@@ -1,26 +1,24 @@
 /*
    Unix SMB/CIFS implementation.
    Wrap gpfs calls in vfs functions.
- 
+
    Copyright (C) Christian Ambach <cambach1 at de.ibm.com> 2006
-   
+
    Major code contributions by Chetan Shringarpure <chetan.sh at in.ibm.com>
                             and Gomati Mohanan <gomati.mohanan at in.ibm.com>
-   
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
-   
+
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
-   
+
    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
-  
-
 */
 
 #include "includes.h"
@@ -55,14 +53,14 @@ static int vfs_gpfs_setlease(vfs_handle_struct *handle, files_struct *fsp,
 			     int leasetype)
 {
 	int ret;
-	
+
 	START_PROFILE(syscall_linux_setlease);
-	
+
 	if ( linux_set_lease_sighandler(fsp->fh->fd) == -1)
 		return -1;
 
 	ret = set_gpfs_lease(fsp->fh->fd,leasetype);
-	
+
 	if ( ret < 0 ) {
 		/* This must have come from GPFS not being available */
 		/* or some other error, hence call the default */
@@ -74,7 +72,64 @@ static int vfs_gpfs_setlease(vfs_handle_struct *handle, files_struct *fsp,
 	return ret;
 }
 
+static int vfs_gpfs_get_real_filename(struct vfs_handle_struct *handle,
+				      const char *path,
+				      const char *name,
+				      TALLOC_CTX *mem_ctx,
+				      char **found_name)
+{
+	int result;
+	char *full_path;
+	char real_pathname[PATH_MAX+1];
+	int buflen;
+
+	full_path = talloc_asprintf(talloc_tos(), "%s/%s", path, name);
+	if (full_path == NULL) {
+		errno = ENOMEM;
+		return -1;
+	}
+
+	buflen = sizeof(real_pathname) - 1;
+
+	result = smbd_gpfs_get_realfilename_path(full_path, real_pathname,
+						 &buflen);
+
+	TALLOC_FREE(full_path);
+
+	if (result == -1) {
+		DEBUG(10, ("smbd_gpfs_get_realfilename_path returned %s\n",
+			   strerror(errno)));
+		return -1;
+	}
+
+	/*
+	 * GPFS does not necessarily null-terminate the returned path
+	 * but instead returns the buffer length in buflen.
+	 */
+
+	if (buflen < sizeof(real_pathname)) {
+		real_pathname[buflen] = '\0';
+	} else {
+		real_pathname[sizeof(real_pathname)-1] = '\0';
+	}
+
+	DEBUG(10, ("smbd_gpfs_get_realfilename_path: %s/%s -> %s\n",
+		   path, name, real_pathname));
+
+	name = strrchr_m(real_pathname, '/');
+	if (name == NULL) {
+		errno = ENOENT;
+		return -1;
+	}
+
+	*found_name = talloc_strdup(mem_ctx, name+1);
+	if (*found_name == NULL) {
+		errno = ENOMEM;
+		return -1;
+	}
 
+	return 0;
+}
 
 static void gpfs_dumpacl(int level, struct gpfs_acl *gacl)
 {
@@ -301,13 +356,13 @@ static bool gpfsacl_process_smbacl(files_struct *fsp, SMB4ACL_T *smbacl)
 		gace->aceType = aceprop->aceType;
 		gace->aceFlags = aceprop->aceFlags;
 		gace->aceMask = aceprop->aceMask;
-		
+
 		/*
 		 * GPFS can't distinguish between WRITE and APPEND on
 		 * files, so one being set without the other is an
 		 * error. Sorry for the many ()'s :-)
 		 */
-		
+
 		if (!fsp->is_directory
 		    &&
 		    ((((gace->aceMask & ACE4_MASK_WRITE) == 0)
@@ -323,9 +378,9 @@ static bool gpfsacl_process_smbacl(files_struct *fsp, SMB4ACL_T *smbacl)
 				  fsp->fsp_name));
 			gace->aceMask |= ACE4_MASK_WRITE|ACE4_MASK_APPEND;
 		}
-		
+
 		gace->aceIFlags = (aceprop->flags&SMB_ACE4_ID_SPECIAL) ? ACE4_IFLAG_SPECIAL_ID : 0;
-		
+
 		if (aceprop->flags&SMB_ACE4_ID_SPECIAL)
 		{
 			switch(aceprop->who.special_id)
@@ -478,7 +533,7 @@ static SMB_ACL_T gpfsacl_get_posix_acl(const char *path, gpfs_aclType_t type)
 		errno = EINVAL;
 		goto done;
 	}
-	
+
 	DEBUG(10, ("len: %d, level: %d, version: %d, nace: %d\n",
 		   pacl->acl_len, pacl->acl_level, pacl->acl_version,
 		   pacl->acl_nace));
@@ -497,7 +552,6 @@ static SMB_ACL_T gpfsacl_get_posix_acl(const char *path, gpfs_aclType_t type)
 }
 
 SMB_ACL_T gpfsacl_sys_acl_get_file(vfs_handle_struct *handle,
-				    
 				    const char *path_p,
 				    SMB_ACL_TYPE_T type)
 {
@@ -557,7 +611,7 @@ static struct gpfs_acl *smb2gpfs_acl(const SMB_ACL_T pacl,
 	for (i=0; i<pacl->count; i++) {
 		const struct smb_acl_entry *ace = &pacl->acl[i];
 		struct gpfs_ace_v1 *g_ace = &result->ace_v1[i];
-		
+
 		DEBUG(10, ("Converting type %d perm %x\n",
 			   (int)ace->a_type, (int)ace->a_perm));
 
@@ -612,7 +666,6 @@ static struct gpfs_acl *smb2gpfs_acl(const SMB_ACL_T pacl,
 }
 
 int gpfsacl_sys_acl_set_file(vfs_handle_struct *handle,
-			      
 			      const char *name,
 			      SMB_ACL_TYPE_T type,
 			      SMB_ACL_T theacl)
@@ -639,7 +692,6 @@ int gpfsacl_sys_acl_set_fd(vfs_handle_struct *handle,
 }
 
 int gpfsacl_sys_acl_delete_def_file(vfs_handle_struct *handle,
-				     
 				     const char *path)
 {
 	errno = ENOTSUP;
@@ -661,11 +713,11 @@ static uint32 gpfsacl_mask_filter(uint32 aceType, uint32 aceMask, uint32 rwx)
 	uint32_t        posix_mask = 0x01;
 	uint32_t        posix_bit;
 	uint32_t        nfs4_bits;
-	
+
 	for(i=0; i<3; i++) {
 		nfs4_bits = posix_nfs4map[i];
 		posix_bit = rwx & posix_mask;
-		
+
 		if (aceType==SMB_ACE4_ACCESS_ALLOWED_ACE_TYPE) {
 			if (posix_bit)
 				aceMask |= nfs4_bits;
@@ -678,10 +730,10 @@ static uint32 gpfsacl_mask_filter(uint32 aceType, uint32 aceMask, uint32 rwx)
 			else
 				aceMask &= ~nfs4_bits;
 		} /* other ace types are unexpected */
-		
+
 		posix_mask <<= 1;
 	}
-	
+
 	return aceMask;
 }
 
@@ -693,30 +745,30 @@ static int gpfsacl_emu_chmod(const char *path, mode_t mode)
 	int     i;
 	files_struct    fake_fsp; /* TODO: rationalize parametrization */
 	SMB4ACE_T       *smbace;
-	
+
 	DEBUG(10, ("gpfsacl_emu_chmod invoked for %s mode %o\n", path, mode));
-	
+
 	result = gpfs_get_nfs4_acl(path, &pacl);
 	if (result)
 		return result;
-	
+
 	if (mode & ~(S_IRWXU | S_IRWXG | S_IRWXO)) {
 		DEBUG(2, ("WARNING: cutting extra mode bits %o on %s\n", mode, path));
 	}
-	
+
 	for (smbace=smb_first_ace4(pacl); smbace!=NULL; smbace = smb_next_ace4(smbace)) {
 		SMB_ACE4PROP_T  *ace = smb_get_ace4(smbace);
 		uint32_t        specid = ace->who.special_id;
-		
+
 		if (ace->flags&SMB_ACE4_ID_SPECIAL &&
 		    ace->aceType<=SMB_ACE4_ACCESS_DENIED_ACE_TYPE &&
 		    specid <= SMB_ACE4_WHO_EVERYONE) {
-			
+
 			uint32_t newMask;
-			
+
 			if (ace->aceType==SMB_ACE4_ACCESS_ALLOWED_ACE_TYPE)
 				haveAllowEntry[specid] = True;
-			
+
 			/* mode >> 6 for @owner, mode >> 3 for @group,
 			 * mode >> 0 for @everyone */
 			newMask = gpfsacl_mask_filter(ace->aceType, ace->aceMask,
@@ -735,35 +787,35 @@ static int gpfsacl_emu_chmod(const char *path, mode_t mode)
 	 */
 	for(i = SMB_ACE4_WHO_OWNER; i<=SMB_ACE4_WHO_EVERYONE; i++) {
 		SMB_ACE4PROP_T  ace;
-		
+
 		if (haveAllowEntry[i]==True)
 			continue;
-		
+
 		ZERO_STRUCT(ace);
 		ace.aceType = SMB_ACE4_ACCESS_ALLOWED_ACE_TYPE;
 		ace.flags |= SMB_ACE4_ID_SPECIAL;
 		ace.who.special_id = i;
-		
+
 		if (i==SMB_ACE4_WHO_GROUP) /* not sure it's necessary... */
 			ace.aceFlags |= SMB_ACE4_IDENTIFIER_GROUP;
-		
+
 		ace.aceMask = gpfsacl_mask_filter(ace.aceType, ace.aceMask,
 						  mode >> ((SMB_ACE4_WHO_EVERYONE - i) * 3));
-		
+
 		/* don't add unnecessary aces */
 		if (!ace.aceMask)
 			continue;
-		
+
 		/* we add it to the END - as windows expects allow aces */
 		smb_add_ace4(pacl, &ace);
 		DEBUG(10, ("Added ALLOW ace for %s, mode=%o, id=%d, aceMask=%x\n",
 			   path, mode, i, ace.aceMask));


-- 
Samba Shared Repository


More information about the samba-cvs mailing list