bos: Remove MR-AFS commands and options
[openafs.git] / src / bozo / bos.c
index e7e7f33..a0b1704 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
- * 
+ *
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
@@ -9,77 +9,41 @@
 
 #include <afsconfig.h>
 #include <afs/param.h>
+#include <afs/stds.h>
 
+#include <afs/procmgmt.h>
+#include <roken.h>
+#include <afs/opr.h>
+
+#include <hcrypto/ui.h>
 
-#include <afs/stds.h>
-#include <stdlib.h>
-#include <stddef.h>
-#include <sys/types.h>
-#ifdef AFS_NT40_ENV
-#include <winsock2.h>
-#include <io.h>
-#include <fcntl.h>
-#else
-#include <sys/file.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <sys/socket.h>
-#include <strings.h>
-#endif /* AFS_NT40_ENV */
-#include <string.h>
-#include <afs/procmgmt.h>      /* signal(), kill(), wait(), etc. */
-#include <time.h>
 #include "bnode.h"
-#include <errno.h>
 #include <afs/afsutil.h>
 #include <afs/cellconfig.h>
 #include <rx/rx.h>
-#include <sys/stat.h>
 #include <rx/xdr.h>
 #include <afs/auth.h>
 #include <afs/cellconfig.h>
-#include <stdio.h>
 #include <afs/cmd.h>
 #include <afs/com_err.h>
 #include <ubik.h>
 #include <afs/ktime.h>
-#include <des.h>
-#include <des_prototypes.h>
 #include <afs/kautils.h>
+#include <afs/afsint.h>
 #include <afs/volser.h>
 
-static int IStatServer(register struct cmd_syndesc *as, int int32p);
-static int DoStat(char *aname, register struct rx_connection *aconn, 
+static int IStatServer(struct cmd_syndesc *as, int int32p);
+static int DoStat(char *aname, struct rx_connection *aconn,
                  int aint32p, int firstTime);
 
 #include "bosint.h"
+#include "bnode_internal.h"
+#include "bosprototypes.h"
 
 /* command offsets for bos salvage command */
 #define MRAFS_OFFSET  10
 #define ADDPARMOFFSET 27
 
-/* MR-AFS salvage parameters */
-struct MRAFSSalvageParms {
-    afs_int32 Optdebug;
-    afs_int32 Optnowrite;
-    afs_int32 Optforce;
-    afs_int32 Optoktozap;
-    afs_int32 Optrootfiles;
-    afs_int32 Optsalvagedirs;
-    afs_int32 Optblockreads;
-    afs_int32 OptListResidencies;
-    afs_int32 OptSalvageRemote;
-    afs_int32 OptSalvageArchival;
-    afs_int32 OptIgnoreCheck;
-    afs_int32 OptForceOnLine;
-    afs_int32 OptUseRootDirACL;
-    afs_int32 OptTraceBadLinkCounts;
-    afs_int32 OptDontAskFS;
-    afs_int32 OptLogLevel;
-    afs_int32 OptRxDebug;
-    afs_uint32 OptResidencies;
-};
-
 /* dummy routine for the audit work.  It should do nothing since audits */
 /* occur at the server level and bos is not a server. */
 int osi_audit(void )
@@ -99,69 +63,21 @@ em(afs_int32 acode)
        return (char *)afs_error_message(acode);
 }
 
-/* get partition id from a name */
-/* XXX - unused code - could be removed? */
-#if 0
-static afs_int32
-GetPartitionID(char *aname)
-{
-    register char tc;
-    char ascii[3];
-
-    tc = *aname;
-    if (tc == 0)
-       return -1;              /* unknown */
-    /* numbers go straight through */
-    if (tc >= '0' && tc <= '9') {
-       return atoi(aname);
-    }
-    /* otherwise check for vicepa or /vicepa, or just plain "a" */
-    ascii[2] = 0;
-    if (strlen(aname) <= 2) {
-       strcpy(ascii, aname);
-    } else if (!strncmp(aname, "/vicep", 6)) {
-       strncpy(ascii, aname + 6, 2);
-    } else if (!strncmp(aname, "vicep", 5)) {
-       strncpy(ascii, aname + 5, 2);
-    } else
-       return -1;              /* bad partition name */
-    /* now partitions are named /vicepa ... /vicepz, /vicepaa, /vicepab,
-     * .../vicepzz, and are numbered from 0.  Do the appropriate conversion */
-    if (ascii[1] == 0) {
-       /* one char name, 0..25 */
-       if (ascii[0] < 'a' || ascii[0] > 'z')
-           return -1;          /* wrongo */
-       return ascii[0] - 'a';
-    } else {
-       /* two char name, 26 .. <whatever> */
-       if (ascii[0] < 'a' || ascii[0] > 'z')
-           return -1;          /* wrongo */
-       if (ascii[1] < 'a' || ascii[1] > 'z')
-           return -1;          /* just as bad */
-       return (ascii[0] - 'a') * 26 + (ascii[1] - 'a') + 26;
-    }
-}
-#endif
-
 /* make ctime easier to use */
 static char *
-DateOf(afs_int32 atime)
+DateOf(time_t atime)
 {
     static char tbuffer[30];
-    register char *tp;
-    time_t t = (time_t) atime;
-    tp = ctime(&t);
+    char *tp;
+    tp = ctime(&atime);
     if (tp) {
-       strcpy(tbuffer, tp);
+       strlcpy(tbuffer, tp, sizeof(tbuffer));
        tbuffer[24] = 0;        /* get rid of new line */
     } else
        strcpy(tbuffer, "BAD TIME");
     return tbuffer;
 }
 
-/* global stuff from main for communicating with GetConn */
-static struct rx_securityClass *sc[3];
-static int scIndex;
 
 /* use the syntax descr to get a connection, authenticated appropriately.
  * aencrypt is set if we want to encrypt the data on the wire.
@@ -171,15 +87,15 @@ GetConn(struct cmd_syndesc *as, int aencrypt)
 {
     struct hostent *th;
     char *hostname;
-    register afs_int32 code;
-    register struct rx_connection *tconn;
-    afs_int32 addr;
-    register struct afsconf_dir *tdir;
-    int encryptLevel;
-    struct ktc_principal sname;
-    struct ktc_token ttoken;
-    int localauth;
+    char *cellname = NULL;
     const char *confdir;
+    afs_int32 code;
+    struct rx_connection *tconn;
+    afs_int32 addr;
+    struct afsconf_dir *tdir = NULL;
+    afsconf_secflags secFlags;
+    struct rx_securityClass *sc;
+    afs_int32 scIndex;
 
     hostname = as->parms[0].items->data;
     th = hostutil_GetHostByName(hostname);
@@ -189,94 +105,51 @@ GetConn(struct cmd_syndesc *as, int aencrypt)
     }
     memcpy(&addr, th->h_addr, sizeof(afs_int32));
 
-    /* Start with no authentication */
-    sc[0] = rxnull_NewClientSecurityObject();
-    sc[1] = 0;
-    sc[2] = 0;
-    scIndex = 0;
-
-    if (!as->parms[ADDPARMOFFSET + 1].items) { /* not -noauth */
-        /* get tokens for making authenticated connections */
-        localauth = (as->parms[ADDPARMOFFSET + 2].items != 0);
-        confdir =
-            (localauth ? AFSDIR_SERVER_ETC_DIRPATH : AFSDIR_CLIENT_ETC_DIRPATH);
-        tdir = afsconf_Open(confdir);
-        if (tdir) {
-            struct afsconf_cell info;
-            char *tname;
-
-            if (as->parms[ADDPARMOFFSET].items)
-                tname = as->parms[ADDPARMOFFSET].items->data;
-            else
-                tname = NULL;
-            /* next call expands cell name abbrevs for us and handles looking up
-            * local cell */
-            code = afsconf_GetCellInfo(tdir, tname, NULL, &info);
-            if (code) {
-                afs_com_err("bos", code, "(can't find cell '%s' in cell database)",
-                             (tname ? tname : "<default>"));
-                exit(1);
-            } else
-                strcpy(sname.cell, info.name);
-        } else {
-            printf("bos: can't open cell database (%s)\n", confdir);
-            exit(1);
-        }
-        sname.instance[0] = 0;
-        strcpy(sname.name, "afs");
-
-       if (as->parms[ADDPARMOFFSET + 2].items) {       /* -localauth */
-           code = afsconf_GetLatestKey(tdir, 0, 0);
-           if (code)
-               afs_com_err("bos", code, "(getting key from local KeyFile)");
-           else {
-               if (aencrypt)
-                   code = afsconf_ClientAuthSecure(tdir, &sc[2], &scIndex);
-               else
-                   code = afsconf_ClientAuth(tdir, &sc[2], &scIndex);
-               if (code)
-                   afs_com_err("bos", code, "(calling ClientAuth)");
-               else if (scIndex != 2)  /* this shouldn't happen */
-                   sc[scIndex] = sc[2];
-           }
-       } else {                /* not -localauth, check for tickets */
-           code = ktc_GetToken(&sname, &ttoken, sizeof(ttoken), NULL);
-           if (code == 0) {
-               /* have tickets, will travel */
-               if (ttoken.kvno >= 0 && ttoken.kvno <= 256);
-               else {
-                   fprintf(stderr,
-                           "bos: funny kvno (%d) in ticket, proceeding\n",
-                           ttoken.kvno);
-               }
-               /* kerberos tix */
-               if (aencrypt)
-                   encryptLevel = rxkad_crypt;
-               else
-                   encryptLevel = rxkad_clear;
-               sc[2] = (struct rx_securityClass *)
-                   rxkad_NewClientSecurityObject(encryptLevel,
-                                                 &ttoken.sessionKey,
-                                                 ttoken.kvno,
-                                                 ttoken.ticketLen,
-                                                 ttoken.ticket);
-               scIndex = 2;
-           } else
-               afs_com_err("bos", code, "(getting tickets)");
-       }
-       if ((scIndex == 0) || (sc[scIndex] == 0)) {
-           fprintf(stderr, "bos: running unauthenticated\n");
-           scIndex = 0;
+    if (aencrypt)
+       secFlags = AFSCONF_SECOPTS_ALWAYSENCRYPT;
+    else
+       secFlags = AFSCONF_SECOPTS_FALLBACK_NULL;
+
+
+    if (as->parms[ADDPARMOFFSET + 2].items) { /* -localauth */
+       secFlags |= AFSCONF_SECOPTS_LOCALAUTH;
+       confdir = AFSDIR_SERVER_ETC_DIRPATH;
+    } else {
+       confdir = AFSDIR_CLIENT_ETC_DIRPATH;
+    }
+
+    if (as->parms[ADDPARMOFFSET + 1].items) { /* -noauth */
+       secFlags |= AFSCONF_SECOPTS_NOAUTH;
+    } else {
+       /* If we're running with -noauth, we don't need a configuration
+        * directory */
+       tdir = afsconf_Open(confdir);
+       if (tdir == NULL) {
+           printf("bos: can't open cell database (%s)\n", confdir);
+           exit(1);
        }
     }
+
+    if (as->parms[ADDPARMOFFSET].items) /* -cell */
+        cellname = as->parms[ADDPARMOFFSET].items->data;
+
+    code = afsconf_PickClientSecObj(tdir, secFlags, NULL, cellname,
+                                   &sc, &scIndex, NULL);
+    if (code) {
+       afs_com_err("bos", code, "(configuring connection security)");
+       exit(1);
+    }
+
+    if (scIndex == RX_SECIDX_NULL)
+       fprintf(stderr, "bos: running unauthenticated\n");
+
     tconn =
-       rx_NewConnection(addr, htons(AFSCONF_NANNYPORT), 1, sc[scIndex],
-                        scIndex);
+       rx_NewConnection(addr, htons(AFSCONF_NANNYPORT), 1, sc, scIndex);
     if (!tconn) {
        fprintf(stderr, "bos: could not create rx connection\n");
        exit(1);
     }
-    rxs_Release(sc[scIndex]);
+    rxs_Release(sc);
 
     return tconn;
 }
@@ -284,10 +157,10 @@ GetConn(struct cmd_syndesc *as, int aencrypt)
 static int
 SetAuth(struct cmd_syndesc *as, void *arock)
 {
-    register afs_int32 code;
-    register struct rx_connection *tconn;
+    afs_int32 code;
+    struct rx_connection *tconn;
     afs_int32 flag;
-    register char *tp;
+    char *tp;
 
     tconn = GetConn(as, 0);
     tp = as->parms[1].items->data;
@@ -312,7 +185,7 @@ SetAuth(struct cmd_syndesc *as, void *arock)
 static int
 ComputeDestDir(char *aname, char *adir, char *aresult, afs_int32 alen)
 {
-    register char *tp;
+    char *tp;
 
     strcpy(aresult, adir);
     tp = strrchr(aname, '/');
@@ -329,10 +202,10 @@ ComputeDestDir(char *aname, char *adir, char *aresult, afs_int32 alen)
 
 /* copy data from fd afd to rx call acall */
 static int
-CopyBytes(int afd, register struct rx_call *acall)
+CopyBytes(int afd, struct rx_call *acall)
 {
-    register afs_int32 code;
-    register afs_int32 len;
+    afs_int32 code;
+    afs_int32 len;
     char tbuffer[256];
 
     while (1) {
@@ -348,11 +221,11 @@ CopyBytes(int afd, register struct rx_call *acall)
 }
 
 static int
-Prune(register struct cmd_syndesc *as, void *arock)
+Prune(struct cmd_syndesc *as, void *arock)
 {
-    register afs_int32 code;
-    register struct rx_connection *tconn;
-    register afs_int32 flags;
+    afs_int32 code;
+    struct rx_connection *tconn;
+    afs_int32 flags;
 
     tconn = GetConn(as, 0);
     flags = 0;
@@ -371,10 +244,10 @@ Prune(register struct cmd_syndesc *as, void *arock)
 }
 
 static int
-Exec(register struct cmd_syndesc *as, void *arock)
+Exec(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
-    register afs_int32 code;
+    struct rx_connection *tconn;
+    afs_int32 code;
 
     tconn = GetConn(as, 0);
     code = BOZO_Exec(tconn, as->parms[1].items->data);
@@ -384,14 +257,14 @@ Exec(register struct cmd_syndesc *as, void *arock)
 }
 
 static int
-GetDate(register struct cmd_syndesc *as, void *arock)
+GetDate(struct cmd_syndesc *as, void *arock)
 {
-    register afs_int32 code;
+    afs_int32 code;
     char tbuffer[256];
     char destDir[256];
     afs_int32 time, bakTime, oldTime;
-    register struct rx_connection *tconn;
-    register struct cmd_item *ti;
+    struct rx_connection *tconn;
+    struct cmd_item *ti;
 
     tconn = GetConn(as, 0);
     if (!as->parms[1].items) {
@@ -434,13 +307,13 @@ GetDate(register struct cmd_syndesc *as, void *arock)
 }
 
 static int
-UnInstall(register struct cmd_syndesc *as, void *arock)
+UnInstall(struct cmd_syndesc *as, void *arock)
 {
-    register afs_int32 code;
+    afs_int32 code;
     char tbuffer[256];
     char destDir[256];
-    register struct cmd_item *ti;
-    register struct rx_connection *tconn;
+    struct cmd_item *ti;
+    struct rx_connection *tconn;
 
     tconn = GetConn(as, 0);
     if (!as->parms[1].items) {
@@ -472,7 +345,7 @@ GetServerGoal(struct rx_connection *aconn, char *aname)
 {
     char buffer[500];
     char *tp;
-    register afs_int32 code;
+    afs_int32 code;
     struct bozo_status istatus;
 
     tp = buffer;
@@ -493,8 +366,8 @@ static int
 Install(struct cmd_syndesc *as, void *arock)
 {
     struct rx_connection *tconn;
-    register afs_int32 code;
-    register struct cmd_item *ti;
+    afs_int32 code;
+    struct cmd_item *ti;
     struct stat tstat;
     char tbuffer[256];
     int fd;
@@ -549,9 +422,9 @@ Install(struct cmd_syndesc *as, void *arock)
 static int
 Shutdown(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
-    register afs_int32 code;
-    register struct cmd_item *ti;
+    struct rx_connection *tconn;
+    afs_int32 code;
+    struct cmd_item *ti;
 
     tconn = GetConn(as, 0);
     if (as->parms[1].items == 0) {
@@ -576,41 +449,9 @@ Shutdown(struct cmd_syndesc *as, void *arock)
 }
 
 static int
-BlockScannerCmd(struct cmd_syndesc *as, void *arock)
-{
-    register afs_int32 code;
-    struct rx_connection *tconn;
-    char BlockCommand[] = "/usr/afs/bin/scanner -block";
-
-    tconn = GetConn(as, 0);
-    code = BOZO_Exec(tconn, BlockCommand);
-    if (code)
-       printf
-           ("bos: failed to block scanner from making migration requests (%s)\n",
-            em(code));
-    return 0;
-}
-
-static int
-UnBlockScannerCmd(struct cmd_syndesc *as, void *arock)
-{
-    register afs_int32 code;
-    struct rx_connection *tconn;
-    char UnBlockCommand[] = "/usr/afs/bin/scanner -unblock";
-
-    tconn = GetConn(as, 0);
-    code = BOZO_Exec(tconn, UnBlockCommand);
-    if (code)
-       printf
-           ("bos: failed to allow scanner daemon to make migration requests again (%s)\n",
-            em(code));
-    return 0;
-}
-
-static int
 GetRestartCmd(struct cmd_syndesc *as, void *arock)
 {
-    register afs_int32 code;
+    afs_int32 code;
     struct ktime generalTime, newBinaryTime;
     char messageBuffer[256];
     struct rx_connection *tconn;
@@ -654,7 +495,7 @@ static int
 SetRestartCmd(struct cmd_syndesc *as, void *arock)
 {
     afs_int32 count = 0;
-    register afs_int32 code;
+    afs_int32 code;
     struct ktime restartTime;
     afs_int32 type = 0 ;
     struct rx_connection *tconn;
@@ -693,9 +534,9 @@ SetRestartCmd(struct cmd_syndesc *as, void *arock)
 static int
 Startup(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
-    register afs_int32 code;
-    register struct cmd_item *ti;
+    struct rx_connection *tconn;
+    afs_int32 code;
+    struct cmd_item *ti;
 
     tconn = GetConn(as, 0);
     if (as->parms[1].items == 0) {
@@ -716,9 +557,9 @@ Startup(struct cmd_syndesc *as, void *arock)
 static int
 Restart(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
-    register afs_int32 code;
-    register struct cmd_item *ti;
+    struct rx_connection *tconn;
+    afs_int32 code;
+    struct cmd_item *ti;
 
     tconn = GetConn(as, 0);
     if (as->parms[2].items) {
@@ -761,8 +602,8 @@ Restart(struct cmd_syndesc *as, void *arock)
 static int
 SetCellName(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
-    register afs_int32 code;
+    struct rx_connection *tconn;
+    afs_int32 code;
 
     tconn = GetConn(as, 0);
     code = BOZO_SetCellName(tconn, as->parms[1].items->data);
@@ -772,11 +613,11 @@ SetCellName(struct cmd_syndesc *as, void *arock)
 }
 
 static int
-AddHost(register struct cmd_syndesc *as, void *arock)
+AddHost(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
-    register afs_int32 code;
-    register struct cmd_item *ti;
+    struct rx_connection *tconn;
+    afs_int32 code;
+    struct cmd_item *ti;
     char name[MAXHOSTCHARS];
 
     tconn = GetConn(as, 0);
@@ -799,11 +640,11 @@ AddHost(register struct cmd_syndesc *as, void *arock)
 }
 
 static int
-RemoveHost(register struct cmd_syndesc *as, void *arock)
+RemoveHost(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
-    register afs_int32 code;
-    register struct cmd_item *ti;
+    struct rx_connection *tconn;
+    afs_int32 code;
+    struct cmd_item *ti;
 
     tconn = GetConn(as, 0);
     for (ti = as->parms[1].items; ti; ti = ti->next) {
@@ -816,13 +657,13 @@ RemoveHost(register struct cmd_syndesc *as, void *arock)
 }
 
 static int
-ListHosts(register struct cmd_syndesc *as, void *arock)
+ListHosts(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
-    register afs_int32 code;
+    struct rx_connection *tconn;
+    afs_int32 code;
     char tbuffer[256];
     char *tp;
-    register afs_int32 i;
+    afs_int32 i;
 
     tp = tbuffer;
     tconn = GetConn(as, 0);
@@ -846,29 +687,30 @@ ListHosts(register struct cmd_syndesc *as, void *arock)
 }
 
 static int
-AddKey(register struct cmd_syndesc *as, void *arock)
+AddKey(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
-    register afs_int32 code;
+    struct rx_connection *tconn;
+    afs_int32 code;
     struct ktc_encryptionKey tkey;
     afs_int32 temp;
-    char *tcell;
-    char cellBuffer[256];
     char buf[BUFSIZ], ver[BUFSIZ];
 
     tconn = GetConn(as, 1);
     memset(&tkey, 0, sizeof(struct ktc_encryptionKey));
 
-    if (as->parms[1].items)
-       strcpy(buf, as->parms[1].items->data);
-    else {
+    if (as->parms[1].items) {
+       if (strlcpy(buf, as->parms[1].items->data, sizeof(buf)) >= sizeof(buf)) {
+           fprintf(stderr, "Key data too long for buffer\n");
+           exit(1);
+       }
+    } else {
        /* prompt for key */
-       code = des_read_pw_string(buf, sizeof(buf), "input key: ", 0);
+       code = UI_UTIL_read_pw_string(buf, sizeof(buf), "input key: ", 0);
        if (code || strlen(buf) == 0) {
            fprintf(stderr, "Bad key: \n");
            exit(1);
        }
-       code = des_read_pw_string(ver, sizeof(ver), "Retype input key: ", 0);
+       code = UI_UTIL_read_pw_string(ver, sizeof(ver), "Retype input key: ", 0);
        if (code || strlen(ver) == 0) {
            fprintf(stderr, "Bad key: \n");
            exit(1);
@@ -888,25 +730,31 @@ AddKey(register struct cmd_syndesc *as, void *arock)
 */
        strcpy((char *)&tkey, buf);
     } else {                   /* kerberos key */
+       char *tcell;
        if (as->parms[ADDPARMOFFSET].items) {
-           strcpy(cellBuffer, as->parms[ADDPARMOFFSET].items->data);
+           tcell = strdup(as->parms[ADDPARMOFFSET].items->data);
+           if (tcell == NULL) {
+               fprintf(stderr, "bos: Unable to allocate memory for cellname\n");
+               exit(1);
+           }
 
            /* string to key needs upper-case cell names */
 
            /* I don't believe this is true.  The string to key function
             * actually expands the cell name, then LOWER-CASES it.  Perhaps it
             * didn't use to??? */
-           ucstring(cellBuffer, cellBuffer, strlen(cellBuffer));
-           tcell = cellBuffer;
+           ucstring(tcell, tcell, strlen(tcell));
        } else
            tcell = NULL;       /* no cell specified, use current */
 /*
        ka_StringToKey(as->parms[1].items->data, tcell, &tkey);
 */
        ka_StringToKey(buf, tcell, &tkey);
+
+       if (tcell)
+           free(tcell);
     }
-    tconn = GetConn(as, 1);
-    code = BOZO_AddKey(tconn, temp, &tkey);
+    code = BOZO_AddKey(tconn, temp, ktc_to_bozoptr(&tkey));
     if (code) {
        printf("bos: failed to set key %d (%s)\n", temp, em(code));
        exit(1);
@@ -915,12 +763,12 @@ AddKey(register struct cmd_syndesc *as, void *arock)
 }
 
 static int
-RemoveKey(register struct cmd_syndesc *as, void *arock)
+RemoveKey(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
-    register afs_int32 code;
+    struct rx_connection *tconn;
+    afs_int32 code;
     afs_int32 temp;
-    register struct cmd_item *ti;
+    struct cmd_item *ti;
 
     tconn = GetConn(as, 0);
     for (ti = as->parms[1].items; ti; ti = ti->next) {
@@ -935,27 +783,28 @@ RemoveKey(register struct cmd_syndesc *as, void *arock)
 }
 
 static int
-ListKeys(register struct cmd_syndesc *as, void *arock)
+ListKeys(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
-    register afs_int32 code;
+    struct rx_connection *tconn;
+    afs_int32 code;
     struct ktc_encryptionKey tkey;
     afs_int32 kvno;
     struct bozo_keyInfo keyInfo;
     int everWorked;
-    register afs_int32 i;
+    afs_int32 i;
 
     tconn = GetConn(as, 1);
     everWorked = 0;
     for (i = 0;; i++) {
-       code = BOZO_ListKeys(tconn, i, &kvno, &tkey, &keyInfo);
+       code = BOZO_ListKeys(tconn, i, &kvno, ktc_to_bozoptr(&tkey), &keyInfo);
        if (code)
            break;
        everWorked = 1;
        /* first check if key is returned */
-       if ((!ka_KeyIsZero(&tkey, sizeof(tkey))) && (as->parms[1].items)) {
+       if ((!ka_KeyIsZero((char *)&tkey, sizeof(tkey)))
+           && (as->parms[1].items)) {
            printf("key %d is '", kvno);
-           ka_PrintBytes(&tkey, sizeof(tkey));
+           ka_PrintBytes((char *)&tkey, sizeof(tkey));
            printf("'\n");
        } else {
            if (keyInfo.keyCheckSum == 0)       /* shouldn't happen */
@@ -975,12 +824,12 @@ ListKeys(register struct cmd_syndesc *as, void *arock)
 }
 
 static int
-AddSUser(register struct cmd_syndesc *as, void *arock)
+AddSUser(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
-    register afs_int32 code;
+    struct rx_connection *tconn;
+    afs_int32 code;
     int failed;
-    register struct cmd_item *ti;
+    struct cmd_item *ti;
 
     failed = 0;
     tconn = GetConn(as, 0);
@@ -995,11 +844,11 @@ AddSUser(register struct cmd_syndesc *as, void *arock)
 }
 
 static int
-RemoveSUser(register struct cmd_syndesc *as, void *arock)
+RemoveSUser(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
-    register struct cmd_item *ti;
-    register afs_int32 code;
+    struct rx_connection *tconn;
+    struct cmd_item *ti;
+    afs_int32 code;
     int failed;
 
     failed = 0;
@@ -1020,11 +869,11 @@ RemoveSUser(register struct cmd_syndesc *as, void *arock)
 
 #define        NPERLINE    10          /* dudes to print per line */
 static int
-ListSUsers(register struct cmd_syndesc *as, void *arock)
+ListSUsers(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
-    register int i;
-    register afs_int32 code;
+    struct rx_connection *tconn;
+    int i;
+    afs_int32 code;
     char tbuffer[256];
     char *tp;
     int lastNL, printGreeting;
@@ -1059,11 +908,11 @@ ListSUsers(register struct cmd_syndesc *as, void *arock)
 }
 
 static int
-StatServer(register struct cmd_syndesc *as, void *arock)
+StatServer(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
-    register afs_int32 code;
-    register int i;
+    struct rx_connection *tconn;
+    afs_int32 code;
+    int i;
     char ibuffer[BOZO_BSSIZE];
     char *tp;
     int int32p;
@@ -1093,13 +942,13 @@ StatServer(register struct cmd_syndesc *as, void *arock)
 }
 
 static int
-CreateServer(register struct cmd_syndesc *as, void *arock)
+CreateServer(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
-    register afs_int32 code;
+    struct rx_connection *tconn;
+    afs_int32 code;
     char *parms[6];
-    register struct cmd_item *ti;
-    register int i;
+    struct cmd_item *ti;
+    int i;
     char *type, *name, *notifier = NONOTIFIER;
 
     tconn = GetConn(as, 0);
@@ -1125,11 +974,11 @@ CreateServer(register struct cmd_syndesc *as, void *arock)
 }
 
 static int
-DeleteServer(register struct cmd_syndesc *as, void *arock)
+DeleteServer(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
-    register afs_int32 code;
-    register struct cmd_item *ti;
+    struct rx_connection *tconn;
+    afs_int32 code;
+    struct cmd_item *ti;
 
     code = 0;
     tconn = GetConn(as, 0);
@@ -1147,11 +996,11 @@ DeleteServer(register struct cmd_syndesc *as, void *arock)
 }
 
 static int
-StartServer(register struct cmd_syndesc *as, void *arock)
+StartServer(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
-    register afs_int32 code;
-    register struct cmd_item *ti;
+    struct rx_connection *tconn;
+    afs_int32 code;
+    struct cmd_item *ti;
 
     code = 0;
     tconn = GetConn(as, 0);
@@ -1165,11 +1014,11 @@ StartServer(register struct cmd_syndesc *as, void *arock)
 }
 
 static int
-StopServer(register struct cmd_syndesc *as, void *arock)
+StopServer(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
-    register afs_int32 code;
-    register struct cmd_item *ti;
+    struct rx_connection *tconn;
+    afs_int32 code;
+    struct cmd_item *ti;
 
     code = 0;
     tconn = GetConn(as, 0);
@@ -1191,12 +1040,11 @@ StopServer(register struct cmd_syndesc *as, void *arock)
 #define PARMBUFFERSSIZE 32
 
 static afs_int32
-DoSalvage(struct rx_connection * aconn, char * aparm1, char * aparm2, 
-         char * aoutName, afs_int32 showlog, char * parallel, 
-         char * atmpDir, char * orphans, int dafs, 
-         struct MRAFSSalvageParms * mrafsParm)
+DoSalvage(struct rx_connection * aconn, char * aparm1, char * aparm2,
+         char * aoutName, afs_int32 showlog, char * parallel,
+         char * atmpDir, char * orphans, int dafs)
 {
-    register afs_int32 code;
+    afs_int32 code;
     char *parms[6];
     char buffer;
     char tbuffer[BOZO_BSSIZE];
@@ -1206,9 +1054,9 @@ DoSalvage(struct rx_connection * aconn, char * aparm1, char * aparm2,
     FILE *outFile;
     int closeIt;
     char partName[20];         /* canonical name for partition */
-    char pbuffer[PARMBUFFERSSIZE];
     afs_int32 partNumber;
     char *notifier = NONOTIFIER;
+    int count;
 
     /* if a partition was specified, canonicalize the name, since
      * the salvager has a stupid partition ID parser */
@@ -1293,7 +1141,7 @@ DoSalvage(struct rx_connection * aconn, char * aparm1, char * aparm2,
     /* For DAFS, specifying a single volume does not result in a standard
      * salvager call.  Instead, it simply results in a SALVSYNC call to the
      * online salvager daemon.  This interface does not give us the same rich
-     * set of call flags.  Thus, we skip these steps for DAFS single-volume 
+     * set of call flags.  Thus, we skip these steps for DAFS single-volume
      * calls */
     if (!dafs || (*aparm2 == 0)) {
        /* add the parallel option if given */
@@ -1325,48 +1173,6 @@ DoSalvage(struct rx_connection * aconn, char * aparm1, char * aparm2,
            strcat(tbuffer, " -orphans ");
            strcat(tbuffer, orphans);
        }
-
-       if (mrafsParm->Optdebug)
-           strcat(tbuffer, " -debug");
-       if (mrafsParm->Optnowrite)
-           strcat(tbuffer, " -nowrite");
-       if (mrafsParm->Optforce)
-           strcat(tbuffer, " -force");
-       if (mrafsParm->Optoktozap)
-           strcat(tbuffer, " -oktozap");
-       if (mrafsParm->Optrootfiles)
-           strcat(tbuffer, " -rootfiles");
-       if (mrafsParm->Optsalvagedirs)
-           strcat(tbuffer, " -salvagedirs");
-       if (mrafsParm->Optblockreads)
-           strcat(tbuffer, " -blockreads");
-       if (mrafsParm->OptListResidencies)
-           strcat(tbuffer, " -ListResidencies");
-       if (mrafsParm->OptSalvageRemote)
-           strcat(tbuffer, " -SalvageRemote");
-       if (mrafsParm->OptSalvageArchival)
-           strcat(tbuffer, " -SalvageArchival");
-       if (mrafsParm->OptIgnoreCheck)
-           strcat(tbuffer, " -IgnoreCheck");
-       if (mrafsParm->OptForceOnLine)
-           strcat(tbuffer, " -ForceOnLine");
-       if (mrafsParm->OptUseRootDirACL)
-           strcat(tbuffer, " -UseRootDirACL");
-       if (mrafsParm->OptTraceBadLinkCounts)
-           strcat(tbuffer, " -TraceBadLinkCounts");
-       if (mrafsParm->OptDontAskFS)
-           strcat(tbuffer, " -DontAskFS");
-       if (mrafsParm->OptLogLevel) {
-           sprintf(pbuffer, " -LogLevel %ld", afs_printable_int32_ld(mrafsParm->OptLogLevel));
-           strcat(tbuffer, pbuffer);
-       }
-       if (mrafsParm->OptRxDebug)
-           strcat(tbuffer, " -rxdebug");
-       if (mrafsParm->OptResidencies) {
-           sprintf(pbuffer, " -Residencies %lu", 
-                   afs_printable_uint32_lu(mrafsParm->OptResidencies));
-           strcat(tbuffer, pbuffer);
-       }
     }
 
     parms[0] = tbuffer;
@@ -1379,13 +1185,15 @@ DoSalvage(struct rx_connection * aconn, char * aparm1, char * aparm2,
        goto done;
     }
     /* now wait for bnode to disappear */
+    count = 0;
     while (1) {
-       IOMGR_Sleep(5);
+       IOMGR_Sleep(1);
        tp = tbuffer;
        code = BOZO_GetInstanceInfo(aconn, "salvage-tmp", &tp, &istatus);
        if (code)
            break;
-       printf("bos: waiting for salvage to complete.\n");
+       if ((++count % 5) == 0)
+           printf("bos: waiting for salvage to complete.\n");
     }
     if (code != BZNOENT) {
        printf("bos: salvage failed (%s)\n", em(code));
@@ -1425,11 +1233,11 @@ DoSalvage(struct rx_connection * aconn, char * aparm1, char * aparm2,
 }
 
 static int
-GetLogCmd(register struct cmd_syndesc *as, void *arock)
+GetLogCmd(struct cmd_syndesc *as, void *arock)
 {
     struct rx_connection *tconn;
-    register struct rx_call *tcall;
-    register afs_int32 code;
+    struct rx_call *tcall;
+    afs_int32 code;
     char buffer;
     int error;
 
@@ -1463,43 +1271,59 @@ GetLogCmd(register struct cmd_syndesc *as, void *arock)
 }
 
 static int
+IsDAFS(struct rx_connection *aconn)
+{
+    char buffer[BOZO_BSSIZE];
+    char *tp;
+    struct bozo_status istatus;
+    afs_int32 code;
+
+    tp = &buffer[0];
+
+    code = BOZO_GetInstanceInfo(aconn, "dafs", &tp, &istatus);
+    if (code) {
+       /* no dafs bnode; cannot be dafs */
+       return 0;
+    }
+    if (istatus.goal) {
+       /* dafs bnode is running; we must be dafs */
+       return 1;
+    }
+
+    /* At this point, either we have neither a dafs nor fs bnode running, or
+     * we have an fs bnode running but the dafs bnode is stopped.
+     *
+     * If an fs bnode is running, we are obviously not DAFS. If an fs bnode
+     * is not running and a dafs bnode is not running... it's not certain if
+     * we are DAFS or not DAFS. Just return 0 in that case; it shouldn't much
+     * matter what we return, anyway */
+    return 0;
+}
+
+static int
 SalvageCmd(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
-    register afs_int32 code, rc, i;
+    struct rx_connection *tconn;
+    afs_int32 code, rc;
     char *outName;
     char tname[BOZO_BSSIZE];
     afs_int32 newID;
     extern struct ubik_client *cstruct;
-    afs_int32 curGoal, showlog = 0, dafs = 0, mrafs = 0;
+    afs_int32 curGoal, showlog = 0, dafs = 0;
     char *parallel;
     char *tmpDir;
     char *orphans;
-    char *tp;
     char * serviceName;
-    struct MRAFSSalvageParms mrafsParm;
-
-    memset(&mrafsParm, 0, sizeof(mrafsParm));
 
     /* parm 0 is machine name, 1 is partition, 2 is volume, 3 is -all flag */
     tconn = GetConn(as, 0);
 
-    tp = &tname[0];
-
     /* find out whether fileserver is running demand attach fs */
-    if ((code = BOZO_GetInstanceParm(tconn, "dafs", 0, &tp) == 0)) {
+    if (IsDAFS(tconn)) {
        dafs = 1;
        serviceName = "dafs";
-       /* Find out whether fileserver is running MR-AFS (has a scanner instance) */
-       /* XXX this should really be done some other way, potentially by RPC */
-       if ((code = BOZO_GetInstanceParm(tconn, serviceName, 4, &tp) == 0))
-           mrafs = 1;
     } else {
        serviceName = "fs";
-       /* Find out whether fileserver is running MR-AFS (has a scanner instance) */
-       /* XXX this should really be done some other way, potentially by RPC */
-       if ((code = BOZO_GetInstanceParm(tconn, serviceName, 3, &tp) == 0))
-           mrafs = 1;
     }
 
     /* we can do a volume, a partition or the whole thing, but not mixtures
@@ -1539,10 +1363,6 @@ SalvageCmd(struct cmd_syndesc *as, void *arock)
     /* -orphans option */
     orphans = NULL;
     if (as->parms[8].items) {
-       if (mrafs) {
-           printf("Can't specify -orphans for MR-AFS fileserver\n");
-           return EINVAL;
-       }
        orphans = as->parms[8].items->data;
     }
 
@@ -1554,72 +1374,6 @@ SalvageCmd(struct cmd_syndesc *as, void *arock)
        }
     }
 
-    if (mrafs) {
-       if (as->parms[MRAFS_OFFSET].items)
-           mrafsParm.Optdebug = 1;
-       if (as->parms[MRAFS_OFFSET + 1].items)
-           mrafsParm.Optnowrite = 1;
-       if (as->parms[MRAFS_OFFSET + 2].items)
-           mrafsParm.Optforce = 1;
-       if (as->parms[MRAFS_OFFSET + 3].items)
-           mrafsParm.Optoktozap = 1;
-       if (as->parms[MRAFS_OFFSET + 4].items)
-           mrafsParm.Optrootfiles = 1;
-       if (as->parms[MRAFS_OFFSET + 5].items)
-           mrafsParm.Optsalvagedirs = 1;
-       if (as->parms[MRAFS_OFFSET + 6].items)
-           mrafsParm.Optblockreads = 1;
-       if (as->parms[MRAFS_OFFSET + 7].items)
-           mrafsParm.OptListResidencies = 1;
-       if (as->parms[MRAFS_OFFSET + 8].items)
-           mrafsParm.OptSalvageRemote = 1;
-       if (as->parms[MRAFS_OFFSET + 9].items)
-           mrafsParm.OptSalvageArchival = 1;
-       if (as->parms[MRAFS_OFFSET + 10].items)
-           mrafsParm.OptIgnoreCheck = 1;
-       if (as->parms[MRAFS_OFFSET + 11].items)
-           mrafsParm.OptForceOnLine = 1;
-       if (as->parms[MRAFS_OFFSET + 12].items)
-           mrafsParm.OptUseRootDirACL = 1;
-       if (as->parms[MRAFS_OFFSET + 13].items)
-           mrafsParm.OptTraceBadLinkCounts = 1;
-       if (as->parms[MRAFS_OFFSET + 14].items)
-           mrafsParm.OptDontAskFS = 1;
-       if (as->parms[MRAFS_OFFSET + 15].items)
-           mrafsParm.OptLogLevel =
-               atoi(as->parms[MRAFS_OFFSET + 15].items->data);
-       if (as->parms[MRAFS_OFFSET + 16].items)
-           mrafsParm.OptRxDebug = 1;
-       if (as->parms[MRAFS_OFFSET + 17].items) {
-           if (as->parms[MRAFS_OFFSET + 8].items
-               || as->parms[MRAFS_OFFSET + 9].items) {
-               printf
-                   ("Can't specify -Residencies with -SalvageRemote or -SalvageArchival\n");
-               return EINVAL;
-           }
-           code =
-               util_GetUInt32(as->parms[MRAFS_OFFSET + 17].items->data,
-                              &mrafsParm.OptResidencies);
-           if (code) {
-               printf("bos: '%s' is not a valid residency mask.\n",
-                      as->parms[MRAFS_OFFSET + 13].items->data);
-               return code;
-           }
-       }
-    } else {
-       int stop = 0;
-
-       for (i = MRAFS_OFFSET; i < ADDPARMOFFSET; i++) {
-           if (as->parms[i].items) {
-               printf(" %s only possible for MR-AFS fileserver.\n",
-                      as->parms[i].name);
-               stop = 1;
-           }
-       }
-       if (stop)
-           exit(1);
-    }
-
     if (as->parms[4].items) {
        /* salvage whole enchilada */
        curGoal = GetServerGoal(tconn, serviceName);
@@ -1638,7 +1392,7 @@ SalvageCmd(struct cmd_syndesc *as, void *arock)
        /* now do the salvage operation */
        printf("Starting salvage.\n");
        rc = DoSalvage(tconn, NULL, NULL, outName, showlog, parallel, tmpDir,
-                      orphans, dafs, &mrafsParm);
+                      orphans, dafs);
        if (curGoal == BSTAT_NORMAL) {
            printf("bos: restarting %s.\n", serviceName);
            code = BOZO_SetTStatus(tconn, serviceName, BSTAT_NORMAL);
@@ -1680,7 +1434,7 @@ SalvageCmd(struct cmd_syndesc *as, void *arock)
        /* now do the salvage operation */
        printf("Starting salvage.\n");
        rc = DoSalvage(tconn, as->parms[1].items->data, NULL, outName,
-                      showlog, parallel, tmpDir, orphans, dafs, &mrafsParm);
+                      showlog, parallel, tmpDir, orphans, dafs);
        if (curGoal == BSTAT_NORMAL) {
            printf("bos: restarting '%s'.\n", serviceName);
            code = BOZO_SetTStatus(tconn, serviceName, BSTAT_NORMAL);
@@ -1709,8 +1463,12 @@ SalvageCmd(struct cmd_syndesc *as, void *arock)
        confdir =
            (localauth ? AFSDIR_SERVER_ETC_DIRPATH :
             AFSDIR_CLIENT_ETC_DIRPATH);
-       code = vsu_ClientInit( /* noauth */ 1, confdir, tmpname,
-                             /* server auth */ 0, &cstruct, (int (*)())0);
+
+       code = vsu_ClientInit(confdir, tmpname,
+                             AFSCONF_SECOPTS_FALLBACK_NULL |
+                             AFSCONF_SECOPTS_NOAUTH,
+                             NULL, &cstruct);
+
        if (code == 0) {
            newID = vsu_GetVolumeID(as->parms[2].items->data, cstruct, &err);
            if (newID == 0) {
@@ -1735,7 +1493,7 @@ SalvageCmd(struct cmd_syndesc *as, void *arock)
        }
        printf("Starting salvage.\n");
        rc = DoSalvage(tconn, as->parms[1].items->data, tname, outName,
-                      showlog, parallel, tmpDir, orphans, dafs, &mrafsParm);
+                      showlog, parallel, tmpDir, orphans, dafs);
        if (rc)
            return rc;
     }
@@ -1743,10 +1501,10 @@ SalvageCmd(struct cmd_syndesc *as, void *arock)
 }
 
 static int
-IStatServer(register struct cmd_syndesc *as, int int32p)
+IStatServer(struct cmd_syndesc *as, int int32p)
 {
-    register struct rx_connection *tconn;
-    register struct cmd_item *ti;
+    struct rx_connection *tconn;
+    struct cmd_item *ti;
     int firstTime = 1;
 
     tconn = GetConn(as, 0);
@@ -1758,15 +1516,15 @@ IStatServer(register struct cmd_syndesc *as, int int32p)
 }
 
 static int
-DoStat(IN char *aname, 
-       IN register struct rx_connection *aconn, 
-       IN int aint32p, 
+DoStat(IN char *aname,
+       IN struct rx_connection *aconn,
+       IN int aint32p,
        IN int firstTime)       /* true iff first instance in cmd */
 {
     afs_int32 temp;
     char buffer[500];
-    register afs_int32 code;
-    register afs_int32 i;
+    afs_int32 code;
+    afs_int32 i;
     struct bozo_status istatus;
     char *tp;
     char *is1, *is2, *is3, *is4;       /* instance strings */
@@ -1875,11 +1633,10 @@ DoStat(IN char *aname,
     return 0;
 }
 
-#ifdef BOS_RESTRICTED_MODE
 static int
 GetRestrict(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
+    struct rx_connection *tconn;
     afs_int32 code, val;
 
     tconn = GetConn(as, 0);
@@ -1895,7 +1652,7 @@ GetRestrict(struct cmd_syndesc *as, void *arock)
 static int
 SetRestrict(struct cmd_syndesc *as, void *arock)
 {
-    register struct rx_connection *tconn;
+    struct rx_connection *tconn;
     afs_int32 code, val;
 
     tconn = GetConn(as, 0);
@@ -1905,10 +1662,9 @@ SetRestrict(struct cmd_syndesc *as, void *arock)
        printf("bos: failed to set restricted mode (%s)\n", em(code));
     return 0;
 }
-#endif
 
 static void
-add_std_args(register struct cmd_syndesc *ts)
+add_std_args(struct cmd_syndesc *ts)
 {
     cmd_Seek(ts, ADDPARMOFFSET);
     /* + 0 */ cmd_AddParm(ts, "-cell", CMD_SINGLE, CMD_OPTIONAL, "cell name");
@@ -1923,14 +1679,17 @@ add_std_args(register struct cmd_syndesc *ts)
 int
 main(int argc, char **argv)
 {
-    register afs_int32 code;
-    register struct cmd_syndesc *ts;
+    afs_int32 code;
+    struct cmd_syndesc *ts;
+#ifdef AFS_NT40_ENV
+    __declspec(dllimport)
+#endif
     extern int afsconf_SawCell;
 
 #ifdef AFS_AIX32_ENV
     /*
-     * The following signal action for AIX is necessary so that in case of a 
-     * crash (i.e. core is generated) we can include the user's data section 
+     * The following signal action for AIX is necessary so that in case of a
+     * crash (i.e. core is generated) we can include the user's data section
      * in the core dump. Unfortunately, by default, only a partial core is
      * generated which, in many cases, isn't too useful.
      */
@@ -2134,11 +1893,13 @@ main(int argc, char **argv)
     cmd_AddParm(ts, "-newbinary", CMD_FLAG, CMD_OPTIONAL,
                "set new binary restart time");
     add_std_args(ts);
+    cmd_CreateAlias(ts, "setr");
 
     ts = cmd_CreateSyntax("getrestart", GetRestartCmd, NULL,
                          "get restart times");
     cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "machine name");
     add_std_args(ts);
+    cmd_CreateAlias(ts, "getr");
 
     ts = cmd_CreateSyntax("salvage", SalvageCmd, NULL,
                          "salvage partition or volumes");
@@ -2160,55 +1921,8 @@ main(int argc, char **argv)
                "ignore | remove | attach");
     cmd_AddParm(ts, "-forceDAFS", CMD_FLAG, CMD_OPTIONAL,
                "(DAFS) force salvage of demand attach fileserver");
-    cmd_AddParm(ts, "-debug", CMD_FLAG, CMD_OPTIONAL,
-               "(MR-AFS) Run in Debugging mode");
-    cmd_AddParm(ts, "-nowrite", CMD_FLAG, CMD_OPTIONAL,
-               "(MR-AFS) Run readonly/test mode");
-    cmd_AddParm(ts, "-force", CMD_FLAG, CMD_OPTIONAL,
-               "(MR-AFS) Force full salvaging");
-    cmd_AddParm(ts, "-oktozap", CMD_FLAG, CMD_OPTIONAL,
-               "(MR-AFS) Give permission to destroy bogus file residencies/volumes - debugging flag");
-    cmd_AddParm(ts, "-rootfiles", CMD_FLAG, CMD_OPTIONAL,
-               "(MR-AFS) Show files owned by root - debugging flag");
-    cmd_AddParm(ts, "-salvagedirs", CMD_FLAG, CMD_OPTIONAL,
-               "(MR-AFS) Force rebuild/salvage of all directories");
-    cmd_AddParm(ts, "-blockreads", CMD_FLAG, CMD_OPTIONAL,
-               "(MR-AFS) Read smaller blocks to handle IO/bad blocks");
-    cmd_AddParm(ts, "-ListResidencies", CMD_FLAG, CMD_OPTIONAL,
-               "(MR-AFS) Just list affected file residencies - debugging flag");
-    cmd_AddParm(ts, "-SalvageRemote", CMD_FLAG, CMD_OPTIONAL,
-               "(MR-AFS) Salvage storage systems that are not directly attached");
-    cmd_AddParm(ts, "-SalvageArchival", CMD_FLAG, CMD_OPTIONAL,
-               "(MR-AFS) Salvage HSM storage systems");
-    cmd_AddParm(ts, "-IgnoreCheck", CMD_FLAG, CMD_OPTIONAL,
-               "(MR-AFS) Don't perform VLDB safety check when deleting unreferenced files.  Only a good idea in single server cell.");
-    cmd_AddParm(ts, "-ForceOnLine", CMD_FLAG, CMD_OPTIONAL,
-               "(MR-AFS) Force the volume to come online, even if it hasn't salvaged cleanly.");
-    cmd_AddParm(ts, "-UseRootDirACL", CMD_FLAG, CMD_OPTIONAL,
-               "(MR-AFS) Use the root directory ACL for lost+found directory if it is created.");
-    cmd_AddParm(ts, "-TraceBadLinkCounts", CMD_FLAG, CMD_OPTIONAL,
-               "(MR-AFS) Print out lines about volume reference count changes.");
-    cmd_AddParm(ts, "-DontAskFS", CMD_FLAG, CMD_OPTIONAL,
-               "(MR-AFS) Don't ask fileserver to take volume offline.  THIS IS VERY DANGEROUS.");
-    cmd_AddParm(ts, "-LogLevel", CMD_SINGLE, CMD_OPTIONAL,
-               "(MR-AFS) log level");
-    cmd_AddParm(ts, "-rxdebug", CMD_FLAG, CMD_OPTIONAL,
-               "(MR-AFS) Write out rx debug information.");
-    cmd_AddParm(ts, "-Residencies", CMD_SINGLE, CMD_OPTIONAL,
-               "(MR-AFS) Numeric mask of residencies to be included in the salvage.  Do not use with -SalvageRemote or -SalvageArchival");
-    add_std_args(ts);
-
-    ts = cmd_CreateSyntax("blockscanner", BlockScannerCmd, NULL,
-                         "block scanner daemon from making migration requests");
-    cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "machine name");
     add_std_args(ts);
 
-    ts = cmd_CreateSyntax("unblockscanner", UnBlockScannerCmd, NULL,
-                         "allow scanner daemon to make migration requests again");
-    cmd_AddParm(ts, "-server", CMD_SINGLE, CMD_REQUIRED, "machine name");
-    add_std_args(ts);
-
-#ifdef BOS_RESTRICTED_MODE
     ts = cmd_CreateSyntax("getrestricted", GetRestrict, NULL,
                          "get restrict mode");
     cmd_AddParm(ts, "-server", CMD_SINGLE, 0, "machine name");
@@ -2220,7 +1934,6 @@ main(int argc, char **argv)
     cmd_AddParm(ts, "-mode", CMD_SINGLE, 0, "mode to set");
     add_std_args(ts);
 #endif
-#endif
 
     code = cmd_Dispatch(argc, argv);
     rx_Finalize();