remove cmd-suite-option-for-hiding-admin-commands
authorMichael Meffie <mmeffie@sinenomine.net>
Thu, 21 Aug 2014 04:06:26 +0000 (00:06 -0400)
committerD Brashear <shadow@your-file-system.com>
Wed, 5 Nov 2014 13:30:35 +0000 (08:30 -0500)
Remove the incomplete and non-functional cmd option for hiding admin
commands, introduced in commit 36d02757fd6863a845163daf0d730bdcc0a28343.

This patch removes the CMD_ADMIN flag, the non-functional help -admin
parameter, and the non-functional cmd_IsAdministratorCommand() function.

Thanks to Jeffrey Altman for pointing out this old commit and for
suggestions on cleanup.

Change-Id: I72c7d2ed7109b1238713fe0d6d177c5af6fc6b7d
Reviewed-on: http://gerrit.openafs.org/11429
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil>
Reviewed-by: Garrett Wollman <wollman@csail.mit.edu>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: D Brashear <shadow@your-file-system.com>

src/cmd/cmd.c
src/cmd/cmd.p.h
src/cmd/liboafs_cmd.la.sym
src/venus/afsio.c

index 7e87475..317b0d2 100644 (file)
@@ -515,13 +515,6 @@ cmd_DisableAbbreviations(void)
 }
 
 int
-cmd_IsAdministratorCommand(struct cmd_syndesc *as)
-{
-    as->flags |= CMD_ADMIN;
-    return 0;
-}
-
-int
 cmd_Seek(struct cmd_syndesc *as, int apos)
 {
     if (apos >= CMD_MAXPARMS)
@@ -761,7 +754,6 @@ initSyntax(void)
        ts = cmd_CreateSyntax("help", HelpProc, NULL,
                              "get help on commands");
        cmd_AddParm(ts, "-topic", CMD_LIST, CMD_OPTIONAL, "help string");
-       cmd_AddParm(ts, "-admin", CMD_FLAG, CMD_OPTIONAL, NULL);
 
        ts = cmd_CreateSyntax("apropos", AproposProc, NULL,
                              "search by help text");
index dd0ff4c..19c5057 100644 (file)
@@ -18,7 +18,6 @@
 
 /* syndesc flags */
 #define        CMD_ALIAS       1       /* this is an alias */
-#define CMD_ADMIN       2      /* admin. command, show only with -admin */
 #define CMD_HIDDEN      4      /* A hidden command - similar to CMD_HIDE */
 
 #define CMD_HELPPARM   (CMD_MAXPARMS-1)        /* last one is used by -help switch */
@@ -82,7 +81,6 @@ extern int cmd_Dispatch(int argc, char **argv);
 extern int cmd_FreeArgv(char **argv);
 extern int cmd_ParseLine(char *aline, char **argv, afs_int32 * an,
                         afs_int32 amaxn);
-extern int cmd_IsAdministratorCommand(struct cmd_syndesc *as);
 extern void cmd_DisablePositionalCommands(void);
 extern void cmd_DisableAbbreviations(void);
 extern void PrintSyntax(struct cmd_syndesc *as);
index 517b659..09ca373 100644 (file)
@@ -8,7 +8,6 @@ cmd_DisablePositionalCommands
 cmd_Dispatch
 cmd_FreeArgv
 cmd_FreeOptions
-cmd_IsAdministratorCommand
 cmd_OpenConfigFile
 cmd_OptionAsFlag
 cmd_OptionAsInt
index bef94a2..43de5e4 100644 (file)
@@ -311,7 +311,6 @@ main(int argc, char **argv)
 
     ts = cmd_CreateSyntax("fidlock", lockFile, (void *)LockWrite,
                          "lock by FID a file from AFS");
-    cmd_IsAdministratorCommand(ts);
     cmd_AddParm(ts, "-fid", CMD_SINGLE, CMD_REQUIRED,
                "volume.vnode.uniquifier");
     cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cellname");
@@ -336,7 +335,6 @@ main(int argc, char **argv)
 
     ts = cmd_CreateSyntax("fidunlock", lockFile, (void *)LockRelease,
                          "unlock by FID a file from AFS");
-    cmd_IsAdministratorCommand(ts);
     cmd_AddParm(ts, "-fid", CMD_SINGLE, CMD_REQUIRED,
                "volume.vnode.uniquifier");
     cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cellname");
@@ -359,7 +357,6 @@ main(int argc, char **argv)
 
     ts = cmd_CreateSyntax("fidread", readFile, CMD_REQUIRED,
                          "read on a non AFS-client a file from AFS");
-    cmd_IsAdministratorCommand(ts);
     cmd_AddParm(ts, "-fid", CMD_SINGLE, CMD_REQUIRED,
                "volume.vnode.uniquifier");
     cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cellname");
@@ -384,7 +381,6 @@ main(int argc, char **argv)
 
     ts = cmd_CreateSyntax("fidwrite", writeFile, CMD_REQUIRED,
                          "write a file into AFS");
-    cmd_IsAdministratorCommand(ts);
     cmd_AddParm(ts, "-vnode", CMD_SINGLE, CMD_REQUIRED,
                "volume.vnode.uniquifier");
     cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cellname");
@@ -407,7 +403,6 @@ main(int argc, char **argv)
 
     ts = cmd_CreateSyntax("fidappend", writeFile, NULL,
                          "append to a file in AFS");
-    cmd_IsAdministratorCommand(ts);
     cmd_AddParm(ts, "-vnode", CMD_SINGLE, CMD_REQUIRED,
                "volume.vnode.uniquifier");
     cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cellname");