summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src
diff options
context:
space:
mode:
authorAnand Avati <avati@gluster.com>2011-07-01 17:19:29 +0000
committerAnand Avati <avati@gluster.com>2011-07-08 02:26:22 -0700
commit57b3b7e62487eef4c534e3fe65f954cf5d6d0ce4 (patch)
tree4d08941898e2c79c8bddfb740a84d4db0f35becc /libglusterfs/src
parent4b643cfa8847be71bb381b5a8a1a420837722e51 (diff)
glusterfs: add --acl command line option to load ACLs on the client side
also set the turn off filtering of ACL keys in FUSE xattr FOPs. Signed-off-by: Anand Avati <avati@gluster.com> BUG: 2815 (Server-enforced ACLs) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2815
Diffstat (limited to 'libglusterfs/src')
-rw-r--r--libglusterfs/src/glusterfs.h1
-rw-r--r--libglusterfs/src/graph.c23
2 files changed, 24 insertions, 0 deletions
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h
index ba5619d0f0a..78af68c0081 100644
--- a/libglusterfs/src/glusterfs.h
+++ b/libglusterfs/src/glusterfs.h
@@ -275,6 +275,7 @@ struct _cmd_args {
char *run_id;
int debug_mode;
int read_only;
+ int acl;
int mac_compat;
struct list_head xlator_options; /* list of xlator_option_t */
diff --git a/libglusterfs/src/graph.c b/libglusterfs/src/graph.c
index 990e96e2fd8..2cfed066919 100644
--- a/libglusterfs/src/graph.c
+++ b/libglusterfs/src/graph.c
@@ -232,6 +232,23 @@ glusterfs_graph_readonly (glusterfs_graph_t *graph, glusterfs_ctx_t *ctx)
int
+glusterfs_graph_acl (glusterfs_graph_t *graph, glusterfs_ctx_t *ctx)
+{
+ int ret = 0;
+ cmd_args_t *cmd_args = NULL;
+
+ cmd_args = &ctx->cmd_args;
+
+ if (!cmd_args->acl)
+ return 0;
+
+ ret = glusterfs_graph_insert (graph, ctx, "system/posix-acl",
+ "posix-acl-autoload");
+ return ret;
+}
+
+
+int
glusterfs_graph_mac_compat (glusterfs_graph_t *graph, glusterfs_ctx_t *ctx)
{
int ret = 0;
@@ -458,6 +475,12 @@ glusterfs_graph_prepare (glusterfs_graph_t *graph, glusterfs_ctx_t *ctx)
return -1;
}
+ ret = glusterfs_graph_acl (graph, ctx);
+ if (ret) {
+ gf_log ("graph", GF_LOG_ERROR, "glusterfs graph ACL failed");
+ return -1;
+ }
+
/* XXX: MAC COMPAT */
ret = glusterfs_graph_mac_compat (graph, ctx);
if (ret) {