summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2010-09-06 08:12:36 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-06 09:38:04 -0700
commit8d64ca70b4c2467d4ed8c76a9eae385abdebd7a7 (patch)
tree2bdcafdc2c16c868eb47f3efd3f79f346dd62804 /cli
parent698ff066c1d32d9774d7d662ab87528b85b66774 (diff)
cli: Only admin should run gluster CLI
Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1546 (gluster commandline should be available only for super user) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1546
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cli/src/cli.c b/cli/src/cli.c
index 48490ddf4..58cb61bb4 100644
--- a/cli/src/cli.c
+++ b/cli/src/cli.c
@@ -459,6 +459,11 @@ main (int argc, char *argv[])
int ret = -1;
glusterfs_ctx_t *ctx = NULL;
+ if (geteuid ()) {
+ printf ("Only super user can run this command\n");
+ return EPERM;
+ }
+
ret = glusterfs_globals_init ();
if (ret)
return ret;