[SCM] SAMBA-CTDB repository - branch v3-2-ctdb updated - build_3.2.3_ctdb.51-178-gd92c4f2

Michael Adam obnox at samba.org
Wed Dec 17 09:41:10 GMT 2008


The branch, v3-2-ctdb has been updated
       via  d92c4f2b213ec05142ca2c15f5801c08db0c1160 (commit)
       via  13a3426248d8177f52c05c2cca06805f0040b2ed (commit)
       via  ca03c3edb93c5d120177a6937f3cf0f7efd245e4 (commit)
       via  27e8a629e5e1f3a82980c6a710ec74088075ec12 (commit)
       via  d43be6d1365fb923aaad2da543d45a409787a598 (commit)
       via  299755daa352fccb76ed5569fa0358f5e327cd4e (commit)
       via  8a2e0608d84c5acd76ae4581c3e964ffcee71fd6 (commit)
       via  e922af32e7258bb9797f3fbb02ca119d338243a6 (commit)
       via  779d4bff8e1d25b4c07217d6892982c03f16b8eb (commit)
      from  9f7d6d9e1df43349642c1d1ceeceb0f15644fbef (commit)

http://gitweb.samba.org/?p=obnox/samba-ctdb.git;a=shortlog;h=v3-2-ctdb


- Log -----------------------------------------------------------------
commit d92c4f2b213ec05142ca2c15f5801c08db0c1160
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Dec 15 00:16:56 2008 +0100

    Add the "net groupfilter" command
    
    This is the start of a bad hack for even worse systems: Many Unix systems still
    have the NGROUPS problem: A user can not be member of more than a very limited
    number of groups. Solaris for example limits this to 16 by default. Many
    Windows environments have a *LOT* more groups per user, some even go to
    hundreds. Whether that is efficient is debatable, but it's there.
    
    This patch implements the
    
    "net groupfilter"
    
    command with the "addsid", "delsid" and "list" subcommands. If any SIDs are
    present according to "net groupfilter list" (they are stored in secrets.tdb),
    then only the SIDs in that list are converted to GIDs for a user at login time.
    
    This gives the Administrator the possibility to define a set of groups that are
    used on the Unix box, making sure that no user is in more than NGROUPS of those
    at a time.
    
    This patch is incomplete in the sense that winbind is not aware of this, only
    smbd. So it is kind of an emergency hack for smbd-only machines.
    
    Volker
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 13a3426248d8177f52c05c2cca06805f0040b2ed
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Dec 10 13:58:24 2008 +0100

    also search for -lgpfs
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit ca03c3edb93c5d120177a6937f3cf0f7efd245e4
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
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 27e8a629e5e1f3a82980c6a710ec74088075ec12
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>

commit d43be6d1365fb923aaad2da543d45a409787a598
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
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 299755daa352fccb76ed5569fa0358f5e327cd4e
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.
    
    Signed-off-by: Michael Adam <obnox at samba.org>

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

    Apply some const
    
    Signed-off-by: Michael Adam <obnox at samba.org>

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

    Rename "scan_directory" to "get_real_filename"
    
    Signed-off-by: Michael Adam <obnox at samba.org>

commit 779d4bff8e1d25b4c07217d6892982c03f16b8eb
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Dec 2 17:37:42 2008 +0100

    Fix shadow_copy2 for "wide links = yes"
    
    Signed-off-by: Michael Adam <obnox at samba.org>

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

Summary of changes:
 source/auth/auth_util.c           |   31 +++++++
 source/configure.in               |   14 +++
 source/include/secrets.h          |    2 +
 source/include/vfs.h              |    8 ++
 source/include/vfs_macros.h       |    3 +
 source/lib/util_sid.c             |   29 +++++++
 source/modules/gpfs.c             |   25 ++++++
 source/modules/vfs_default.c      |   12 +++
 source/modules/vfs_gpfs.c         |  168 ++++++++++++++++++++++++------------
 source/modules/vfs_shadow_copy2.c |   22 +++++-
 source/passdb/secrets.c           |   33 +++++++
 source/smbd/filename.c            |   32 ++++----
 source/smbd/vfs.c                 |    9 ++
 source/utils/net.c                |  130 ++++++++++++++++++++++++++++
 14 files changed, 444 insertions(+), 74 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/auth/auth_util.c b/source/auth/auth_util.c
index a183afb..9118c73 100644
--- a/source/auth/auth_util.c
+++ b/source/auth/auth_util.c
@@ -701,6 +701,8 @@ NTSTATUS create_local_token(auth_serversupplied_info *server_info)
 	NTSTATUS status;
 	size_t i;
 	
+	struct dom_sid *filter_sids;
+	size_t num_filter_sids;
 
 	mem_ctx = talloc_new(NULL);
 	if (mem_ctx == NULL) {
@@ -744,11 +746,37 @@ NTSTATUS create_local_token(auth_serversupplied_info *server_info)
 	server_info->n_groups = 0;
 	server_info->groups = NULL;
 
+	if (!secrets_groupfilter_fetch(mem_ctx, &filter_sids,
+				       &num_filter_sids)) {
+		num_filter_sids = 0;
+	}
+
 	/* Start at index 1, where the groups start. */
 
 	for (i=1; i<server_info->ptok->num_sids; i++) {
 		gid_t gid;
 		DOM_SID *sid = &server_info->ptok->user_sids[i];
+		size_t sidindex;
+
+		/*
+		 * For secondary groups, potentially apply a group
+		 * filter for hosts with a silly groups-per-user limit
+		 * such as for example Solaris
+		 */
+
+		if ((i > 1) && (num_filter_sids != 0)) {
+			/*
+			 * We have a SID filter in secrets.tdb, only
+			 * convert the SIDs in that filter to GIDs.
+			 */
+			if (bsearch(sid, filter_sids, num_filter_sids,
+				    sizeof(struct dom_sid),
+				    sid_compare_sort) == NULL) {
+				DEBUG(10, ("Filtering out SID %s\n",
+					   sid_string_dbg(sid)));
+				continue;
+			}
+		}
 
 		if (!sid_to_gid(sid, &gid)) {
 			DEBUG(10, ("Could not convert SID %s to gid, "
@@ -760,6 +788,9 @@ NTSTATUS create_local_token(auth_serversupplied_info *server_info)
 	}
 	
 	debug_nt_user_token(DBGC_AUTH, 10, server_info->ptok);
+	debug_unix_user_token(DBGC_AUTH, 10, server_info->uid,
+			      server_info->gid, server_info->n_groups,
+			      server_info->groups);
 
 	status = log_nt_token(mem_ctx, server_info->ptok);
 
diff --git a/source/configure.in b/source/configure.in
index fea3f51..7272054 100644
--- a/source/configure.in
+++ b/source/configure.in
@@ -1072,6 +1072,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/secrets.h b/source/include/secrets.h
index d9f4575..944585b 100644
--- a/source/include/secrets.h
+++ b/source/include/secrets.h
@@ -51,6 +51,8 @@
 #define SECRETS_AUTH_DOMAIN      "SECRETS/AUTH_DOMAIN"
 #define SECRETS_AUTH_PASSWORD  "SECRETS/AUTH_PASSWORD"
 
+#define SECRETS_GROUPFILTER_KEY "SECRETS/GROUPFILTER"
+
 /* structure for storing machine account password
    (ie. when samba server is member of a domain */
 struct machine_acct_pass {
diff --git a/source/include/vfs.h b/source/include/vfs.h
index bed1472..cd779e7 100644
--- a/source/include/vfs.h
+++ b/source/include/vfs.h
@@ -202,6 +202,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. */
 
@@ -351,6 +352,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,
@@ -490,6 +497,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 0acf861..be57c9e 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)))
@@ -210,6 +211,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)))
@@ -337,6 +339,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/lib/util_sid.c b/source/lib/util_sid.c
index f656bb1..a41bb2e 100644
--- a/source/lib/util_sid.c
+++ b/source/lib/util_sid.c
@@ -467,6 +467,35 @@ int sid_compare(const DOM_SID *sid1, const DOM_SID *sid2)
 	return sid_compare_auth(sid1, sid2);
 }
 
+int sid_compare_sort(const void *p1, const void *p2)
+{
+	const struct dom_sid *sid1 = (const struct dom_sid *)p1;
+	const struct dom_sid *sid2 = (const struct dom_sid *)p2;
+	int i, res;
+
+	if (sid1->sid_rev_num != sid2->sid_rev_num) {
+		return sid1->sid_rev_num - sid2->sid_rev_num;
+	}
+
+	for (i = 0; i < 6; i++) {
+		if (sid1->id_auth[i] != sid2->id_auth[i]) {
+			return sid1->id_auth[i] - sid2->id_auth[i];
+		}
+	}
+
+	if (sid1->num_auths != sid2->num_auths) {
+		return sid1->num_auths - sid2->num_auths;
+	}
+
+	for (i = 0; i<sid1->num_auths; i++) {
+		if (sid1->sub_auths[i] != sid2->sub_auths[i]) {
+			return sid1->sub_auths[i] - sid2->sub_auths[i];
+		}
+	}
+
+	return 0;
+}
+
 /*****************************************************************
  See if 2 SIDs are in the same domain
  this just compares the leading sub-auths
diff --git a/source/modules/gpfs.c b/source/modules/gpfs.c
index c4b2518..cba14ac 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,
@@ -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(1, ("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 88c7237..7baef25 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)
@@ -1441,6 +1451,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 fe07097..383d8ce 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)
@@ -483,7 +538,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));
@@ -502,7 +557,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)
 {
@@ -562,7 +616,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));
 
@@ -617,7 +671,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)
@@ -644,7 +697,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;
@@ -666,11 +718,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;
@@ -683,10 +735,10 @@ static uint32 gpfsacl_mask_filter(uint32 aceType, uint32 aceMask, uint32 rwx)
 			else
 				aceMask &= ~nfs4_bits;


-- 
SAMBA-CTDB repository


More information about the samba-cvs mailing list