libadmin: Don't try to release garbage connection
[openafs.git] / src / libadmin / bos / afs_bosAdmin.c
index 8c44ea7..0d7cb38 100644 (file)
@@ -7,64 +7,23 @@
  * directory or online at http://www.openafs.org/dl/license10.html
  */
 
-#include <stdio.h>
+#include <afsconfig.h>
+#include <afs/param.h>
 #include <afs/stds.h>
-#include "afs_bosAdmin.h"
-#include "../adminutil/afs_AdminInternal.h"
+
+#include <roken.h>
+
+#include <rx/rx.h>
+#include <rx/rxstat.h>
 #include <afs/afs_AdminErrors.h>
 #include <afs/afs_utilAdmin.h>
 #include <afs/bosint.h>
 #include <afs/bnode.h>
 #include <afs/ktime.h>
 #include <afs/dirpath.h>
-#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#ifdef AFS_NT40_ENV
-#include <io.h>
-#endif
-#include "../../permit_xprt.h"
-
 
-/*
- * Prototypes for functions that don't exist in any header files
- */
-
-extern int BOZO_AddCellHost();
-extern int BOZO_AddKey();
-extern int BOZO_AddSUser();
-extern int BOZO_CreateBnode();
-extern int BOZO_DeleteBnode();
-extern int BOZO_DeleteCellHost();
-extern int BOZO_DeleteKey();
-extern int BOZO_DeleteSUser();
-extern int BOZO_EnumerateInstance();
-extern int BOZO_Exec();
-extern int BOZO_GetCellHost();
-extern int BOZO_GetCellName();
-extern int BOZO_GetDates();
-extern int BOZO_GetInstanceInfo();
-extern int BOZO_GetInstanceParm();
-extern int BOZO_GetInstanceParm();
-extern int BOZO_GetRestartTime();
-extern int BOZO_GetStatus();
-extern int BOZO_ListSUsers();
-extern int BOZO_ListKeys();
-extern int BOZO_Prune();
-extern int BOZO_ReBozo();
-extern int BOZO_Restart();
-extern int BOZO_RestartAll();
-extern int BOZO_SetCellName();
-extern int BOZO_SetNoAuthFlag();
-extern int BOZO_SetRestartTime();
-extern int BOZO_SetStatus(struct rx_connection *, const char *, long);
-extern int BOZO_SetTStatus(struct rx_connection *, const char *, long);
-extern int BOZO_ShutdownAll();
-extern int BOZO_StartupAll();
-extern int BOZO_UnInstall();
-extern int BOZO_WaitAll();
-extern int StartBOZO_GetLog();
-extern int StartBOZO_Install();
+#include "afs_bosAdmin.h"
+#include "../adminutil/afs_AdminInternal.h"
 
 typedef struct bos_server {
     int begin_magic;
@@ -91,47 +50,47 @@ typedef struct bos_server {
  * Returns != 0 upon successful completion.
  */
 
-int isValidServerHandle (
-  const bos_server_p serverHandle,
-  afs_status_p st)
+int
+isValidServerHandle(const bos_server_p serverHandle, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
 
     if (serverHandle == NULL) {
-        tst = ADMBOSSERVERHANDLENULL;
-        goto fail_IsValidServerHandle;
+       tst = ADMBOSSERVERHANDLENULL;
+       goto fail_IsValidServerHandle;
     }
 
-    if ((serverHandle->begin_magic != BEGIN_MAGIC) ||
-        (serverHandle->end_magic != END_MAGIC)) {
-        tst = ADMBOSSERVERHANDLEBADMAGIC;
-        goto fail_IsValidServerHandle;
+    if ((serverHandle->begin_magic != BEGIN_MAGIC)
+       || (serverHandle->end_magic != END_MAGIC)) {
+       tst = ADMBOSSERVERHANDLEBADMAGIC;
+       goto fail_IsValidServerHandle;
     }
 
     if (serverHandle->is_valid == 0) {
-        tst = ADMBOSSERVERHANDLEINVALID;
-        goto fail_IsValidServerHandle;
+       tst = ADMBOSSERVERHANDLEINVALID;
+       goto fail_IsValidServerHandle;
     }
 
     if (serverHandle->server == NULL) {
-        tst = ADMBOSSERVERHANDLENOSERVER;
-        goto fail_IsValidServerHandle;
+       tst = ADMBOSSERVERHANDLENOSERVER;
+       goto fail_IsValidServerHandle;
     }
 
     if (serverHandle->server_encrypt == NULL) {
-        tst = ADMBOSSERVERHANDLENOSERVER;
-        goto fail_IsValidServerHandle;
+       tst = ADMBOSSERVERHANDLENOSERVER;
+       goto fail_IsValidServerHandle;
     }
     rc = 1;
 
-fail_IsValidServerHandle:
+  fail_IsValidServerHandle:
+
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
+
 /*
  * IsValidCellHandle - verify that a cell handle can be used to make bos
  * requests.
@@ -148,32 +107,31 @@ fail_IsValidServerHandle:
  *
  * Returns != 0 upon successful completion.
  */
-static int IsValidCellHandle(
-  afs_cell_handle_p cellHandle,
-  afs_status_p st)
+
+static int
+IsValidCellHandle(afs_cell_handle_p cellHandle, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
-    if (!CellHandleIsValid((void *) cellHandle, &tst)) {
-        goto fail_IsValidCellHandle;
+
+    if (!CellHandleIsValid((void *)cellHandle, &tst)) {
+       goto fail_IsValidCellHandle;
     }
+
     if (cellHandle->tokens == NULL) {
-        tst = ADMBOSCELLHANDLENOTOKENS;
-        goto fail_IsValidCellHandle;
+       tst = ADMBOSCELLHANDLENOTOKENS;
+       goto fail_IsValidCellHandle;
     }
     rc = 1;
-fail_IsValidCellHandle:
+
+  fail_IsValidCellHandle:
+
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
+
 /*
  * bos_ServerOpen - open a bos server for work.
  *
@@ -196,18 +154,16 @@ fail_IsValidCellHandle:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI bos_ServerOpen(
-  const void *cellHandle,
-  const char *serverName,
-  void **serverHandleP,
-  afs_status_p st)
+int ADMINAPI
+bos_ServerOpen(const void *cellHandle, const char *serverName,
+              void **serverHandleP, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_cell_handle_p c_handle = (afs_cell_handle_p) cellHandle;
-    bos_server_p bos_server = (bos_server_p) malloc(sizeof(bos_server_t));
+    bos_server_p bos_server = calloc(1, sizeof(bos_server_t));
     int serverAddress;
+
     /*
      * Validate parameters
      */
@@ -226,7 +182,8 @@ int ADMINAPI bos_ServerOpen(
        goto fail_bos_ServerOpen;
     }
 
-    if (util_AdminServerAddressGetFromName(serverName, &serverAddress, &tst) == 0) {
+    if (util_AdminServerAddressGetFromName(serverName, &serverAddress, &tst)
+       == 0) {
        goto fail_bos_ServerOpen;
     }
 
@@ -235,18 +192,27 @@ int ADMINAPI bos_ServerOpen(
        goto fail_bos_ServerOpen;
     }
 
-    bos_server->server = rx_GetCachedConnection(htonl(serverAddress),
-                                               htons(AFSCONF_NANNYPORT), 1,
-                                               c_handle->tokens->afs_sc[c_handle->tokens->sc_index], c_handle->tokens->sc_index);
-
-    bos_server->server_encrypt = rx_GetCachedConnection(htonl(serverAddress),
-                                               htons(AFSCONF_NANNYPORT), 1,
-                                               c_handle->tokens->afs_encrypt_sc[c_handle->tokens->sc_index], c_handle->tokens->sc_index);
-                                               
-    bos_server->server_stats = rx_GetCachedConnection(htonl(serverAddress),
-                                               htons(AFSCONF_NANNYPORT),
-                                               RX_STATS_SERVICE_ID,
-                                               c_handle->tokens->afs_sc[c_handle->tokens->sc_index], c_handle->tokens->sc_index);
+    bos_server->server =
+       rx_GetCachedConnection(htonl(serverAddress), htons(AFSCONF_NANNYPORT),
+                              1,
+                              c_handle->tokens->afs_sc[c_handle->tokens->
+                                                       sc_index],
+                              c_handle->tokens->sc_index);
+
+    bos_server->server_encrypt =
+       rx_GetCachedConnection(htonl(serverAddress), htons(AFSCONF_NANNYPORT),
+                              1,
+                              c_handle->tokens->afs_encrypt_sc[c_handle->
+                                                               tokens->
+                                                               sc_index],
+                              c_handle->tokens->sc_index);
+
+    bos_server->server_stats =
+       rx_GetCachedConnection(htonl(serverAddress), htons(AFSCONF_NANNYPORT),
+                              RX_STATS_SERVICE_ID,
+                              c_handle->tokens->afs_sc[c_handle->tokens->
+                                                       sc_index],
+                              c_handle->tokens->sc_index);
 
     if ((bos_server->server == NULL) || (bos_server->server_encrypt == NULL)) {
        tst = ADMBOSSERVERNOCONNECTION;
@@ -257,10 +223,10 @@ int ADMINAPI bos_ServerOpen(
     bos_server->is_valid = 1;
     bos_server->end_magic = END_MAGIC;
 
-    *serverHandleP = (void *) bos_server;
+    *serverHandleP = (void *)bos_server;
     rc = 1;
 
-fail_bos_ServerOpen:
+  fail_bos_ServerOpen:
 
     if ((rc == 0) && (bos_server != NULL)) {
        if (bos_server->server) {
@@ -273,7 +239,7 @@ fail_bos_ServerOpen:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -294,14 +260,13 @@ fail_bos_ServerOpen:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI bos_ServerClose(
-  const void *serverHandle,
-  afs_status_p st)
+int ADMINAPI
+bos_ServerClose(const void *serverHandle, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (isValidServerHandle(b_handle, &tst)) {
        rx_ReleaseCachedConnection(b_handle->server);
        b_handle->is_valid = 0;
@@ -310,7 +275,7 @@ int ADMINAPI bos_ServerClose(
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -345,21 +310,17 @@ int ADMINAPI bos_ServerClose(
  * CAUTION - this list must match bos_ProcessType_t definition
  */
 
-static char *processTypes[] = {"simple", "fs", "cron", 0};
+static char *processTypes[] = { "simple", "fs", "cron", 0 };
 
-int ADMINAPI bos_ProcessCreate(
-  const void *serverHandle,
-  const char *processName, 
-  bos_ProcessType_t processType,
-  const char *process,
-  const char *cronTime,
-  const char *notifier, 
-  afs_status_p st)
+int ADMINAPI
+bos_ProcessCreate(const void *serverHandle, char *processName,
+                 bos_ProcessType_t processType, char *process,
+                 char *cronTime, char *notifier, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ProcessCreate;
     }
@@ -389,18 +350,18 @@ int ADMINAPI bos_ProcessCreate(
        goto fail_bos_ProcessCreate;
     }
 
-    tst = BOZO_CreateBnode(b_handle->server, processTypes[processType],
-                          processName, process,
-                          (cronTime) ? cronTime : "", "", "", "", 
-                          (notifier) ? notifier : NONOTIFIER);
+    tst =
+       BOZO_CreateBnode(b_handle->server, processTypes[processType],
+                        processName, process, (cronTime) ? cronTime : "", "",
+                        "", "", (notifier) ? notifier : NONOTIFIER);
     if (tst == 0) {
        rc = 1;
     }
 
-fail_bos_ProcessCreate:
+  fail_bos_ProcessCreate:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -431,19 +392,16 @@ fail_bos_ProcessCreate:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI bos_FSProcessCreate(
-  const void *serverHandle,
-  const char *processName, 
-  const char *fileserverPath,
-  const char *volserverPath,
-  const char *salvagerPath,
-  const char *notifier, 
-  afs_status_p st)
+int ADMINAPI
+bos_FSProcessCreate(const void *serverHandle, char *processName,
+                   char *fileserverPath, char *volserverPath,
+                   char *salvagerPath, char *notifier,
+                   afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ProcessCreate;
     }
@@ -468,23 +426,19 @@ int ADMINAPI bos_FSProcessCreate(
        goto fail_bos_ProcessCreate;
     }
 
-    tst = BOZO_CreateBnode(b_handle->server,
-                          processTypes[BOS_PROCESS_FS],
-                          processName,
-                          fileserverPath,
-                          volserverPath,
-                          salvagerPath,
-                          "",
-                          "", 
-                          (notifier) ? notifier : NONOTIFIER);
+    tst =
+       BOZO_CreateBnode(b_handle->server, processTypes[BOS_PROCESS_FS],
+                        processName, fileserverPath, volserverPath,
+                        salvagerPath, "", "",
+                        (notifier) ? notifier : NONOTIFIER);
     if (tst == 0) {
        rc = 1;
     }
 
-fail_bos_ProcessCreate:
+  fail_bos_ProcessCreate:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -507,15 +461,14 @@ fail_bos_ProcessCreate:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI bos_ProcessDelete(
-  const void *serverHandle,
-  const char *processName, 
-  afs_status_p st)
+int ADMINAPI
+bos_ProcessDelete(const void *serverHandle, char *processName,
+                 afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ProcessDelete;
     }
@@ -531,10 +484,10 @@ int ADMINAPI bos_ProcessDelete(
        rc = 1;
     }
 
-fail_bos_ProcessDelete:
+  fail_bos_ProcessDelete:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -563,18 +516,17 @@ fail_bos_ProcessDelete:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI bos_ProcessExecutionStateGet(
-  const void *serverHandle,
-  const char *processName, 
-  bos_ProcessExecutionState_p processStatusP,
-  char *auxiliaryProcessStatus,
-  afs_status_p st)
+int ADMINAPI
+bos_ProcessExecutionStateGet(const void *serverHandle,
+                            char *processName,
+                            bos_ProcessExecutionState_p processStatusP,
+                            char *auxiliaryProcessStatus, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
     afs_int32 state;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ProcessExecutionStateGet;
     }
@@ -594,7 +546,9 @@ int ADMINAPI bos_ProcessExecutionStateGet(
        goto fail_bos_ProcessExecutionStateGet;
     }
 
-    tst = BOZO_GetStatus(b_handle->server, processName, &state, &auxiliaryProcessStatus);
+    tst =
+       BOZO_GetStatus(b_handle->server, processName, &state,
+                      &auxiliaryProcessStatus);
 
     if (tst != 0) {
        goto fail_bos_ProcessExecutionStateGet;
@@ -603,10 +557,10 @@ int ADMINAPI bos_ProcessExecutionStateGet(
     *processStatusP = (bos_ProcessExecutionState_t) state;
     rc = 1;
 
-fail_bos_ProcessExecutionStateGet:
+  fail_bos_ProcessExecutionStateGet:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -633,18 +587,17 @@ fail_bos_ProcessExecutionStateGet:
  * Returns != 0 upon successful completion.
  */
 
-static int SetExecutionState(
-  const void *serverHandle,
-  const char *processName, 
-  const bos_ProcessExecutionState_t processStatus,
-  int (*func)(struct rx_connection *, const char *, afs_int32),
-  afs_status_p st)
+static int
+SetExecutionState(const void *serverHandle, const char *processName,
+                 const bos_ProcessExecutionState_t processStatus,
+                 int (*func) (struct rx_connection *, const char *,
+                              afs_int32), afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
     afs_int32 state;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_SetExecutionState;
     }
@@ -654,24 +607,24 @@ static int SetExecutionState(
        goto fail_SetExecutionState;
     }
 
-    if ((processStatus != BOS_PROCESS_STOPPED) &&
-       (processStatus != BOS_PROCESS_RUNNING)) {
+    if ((processStatus != BOS_PROCESS_STOPPED)
+       && (processStatus != BOS_PROCESS_RUNNING)) {
        tst = ADMBOSPROCESSSTATUSSET;
        goto fail_SetExecutionState;
     }
 
     state = (afs_int32) processStatus;
 
-    tst = func(b_handle->server, processName, state);
+    tst = func(b_handle->server, (char *)processName, state);
 
     if (tst == 0) {
        rc = 1;
     }
 
-fail_SetExecutionState:
+  fail_SetExecutionState:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -696,11 +649,11 @@ fail_SetExecutionState:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI bos_ProcessExecutionStateSet(
-  const void *serverHandle,
-  const char *processName, 
-  bos_ProcessExecutionState_t processStatus,
-  afs_status_p st)
+int ADMINAPI
+bos_ProcessExecutionStateSet(const void *serverHandle,
+                            const char *processName,
+                            const bos_ProcessExecutionState_t processStatus,
+                            afs_status_p st)
 {
     return SetExecutionState(serverHandle, processName, processStatus,
                             BOZO_SetStatus, st);
@@ -727,11 +680,11 @@ int ADMINAPI bos_ProcessExecutionStateSet(
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI bos_ProcessExecutionStateSetTemporary(
-  const void *serverHandle,
-  const char *processName, 
-  bos_ProcessExecutionState_t processStatus,
-  afs_status_p st)
+int ADMINAPI
+bos_ProcessExecutionStateSetTemporary(const void *serverHandle,
+                                     char *processName,
+                                     bos_ProcessExecutionState_t
+                                     processStatus, afs_status_p st)
 {
     return SetExecutionState(serverHandle, processName, processStatus,
                             BOZO_SetTStatus, st);
@@ -742,22 +695,19 @@ int ADMINAPI bos_ProcessExecutionStateSetTemporary(
  */
 
 typedef struct process_name_get {
-  int next;
-  struct rx_connection *server;
-  char process[CACHED_ITEMS][BOS_MAX_NAME_LEN];
+    int next;
+    struct rx_connection *server;
+    char process[CACHED_ITEMS][BOS_MAX_NAME_LEN];
 } process_name_get_t, *process_name_get_p;
 
-static int GetProcessNameRPC(
-  void *rpc_specific,
-  int slot,
-  int *last_item,
-  int *last_item_contains_data,
-  afs_status_p st)
+static int
+GetProcessNameRPC(void *rpc_specific, int slot, int *last_item,
+                 int *last_item_contains_data, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     process_name_get_p proc = (process_name_get_p) rpc_specific;
-    char *ptr = (char *) &proc->process[slot];
+    char *ptr = (char *)&proc->process[slot];
 
     tst = BOZO_EnumerateInstance(proc->server, proc->next++, &ptr);
 
@@ -776,17 +726,15 @@ static int GetProcessNameRPC(
     return rc;
 }
 
-static int GetProcessNameFromCache(
-  void *rpc_specific,
-  int slot,
-  void *dest,
-  afs_status_p st)
+static int
+GetProcessNameFromCache(void *rpc_specific, int slot, void *dest,
+                       afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     process_name_get_p proc = (process_name_get_p) rpc_specific;
 
-    strcpy((char *) dest, (char *) &proc->process[slot]);
+    strcpy((char *)dest, (char *)&proc->process[slot]);
     rc = 1;
 
     if (st != NULL) {
@@ -794,7 +742,7 @@ static int GetProcessNameFromCache(
     }
     return rc;
 }
-  
+
 /*
  * bos_ProcessNameGetBegin - begin iterating over the list of processes
  * at a particular bos server.
@@ -816,17 +764,16 @@ static int GetProcessNameFromCache(
  *
  */
 
-int ADMINAPI bos_ProcessNameGetBegin(
-  const void *serverHandle,
-  void **iterationIdP,
-  afs_status_p st)
+int ADMINAPI
+bos_ProcessNameGetBegin(const void *serverHandle, void **iterationIdP,
+                       afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
-    afs_admin_iterator_p iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
-    process_name_get_p proc = (process_name_get_p) malloc(sizeof(process_name_get_t));
+    afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
+    process_name_get_p proc = malloc(sizeof(process_name_get_t));
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ProcessNameGetBegin;
     }
@@ -844,14 +791,16 @@ int ADMINAPI bos_ProcessNameGetBegin(
     proc->next = 0;
     proc->server = b_handle->server;
 
-    if (IteratorInit(iter, (void *) proc, GetProcessNameRPC, GetProcessNameFromCache, NULL, NULL, &tst)) {
-       *iterationIdP = (void *) iter;
+    if (IteratorInit
+       (iter, (void *)proc, GetProcessNameRPC, GetProcessNameFromCache, NULL,
+        NULL, &tst)) {
+       *iterationIdP = (void *)iter;
     } else {
        goto fail_bos_ProcessNameGetBegin;
     }
     rc = 1;
 
-fail_bos_ProcessNameGetBegin:
+  fail_bos_ProcessNameGetBegin:
 
     if (rc == 0) {
        if (iter != NULL) {
@@ -863,11 +812,11 @@ fail_bos_ProcessNameGetBegin:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
-  
+
 /*
  * bos_ProcessNameGetNext - retrieve the next process name from the bos server.
  *
@@ -888,15 +837,14 @@ fail_bos_ProcessNameGetBegin:
  *
  */
 
-int ADMINAPI bos_ProcessNameGetNext(
-  const void *iterationId,
-  char *processName,
-  afs_status_p st)
+int ADMINAPI
+bos_ProcessNameGetNext(const void *iterationId, char *processName,
+                      afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
+
     if (processName == NULL) {
        tst = ADMBOSPROCESSNAMENULL;
        goto fail_bos_ProcessNameGetNext;
@@ -907,12 +855,12 @@ int ADMINAPI bos_ProcessNameGetNext(
        goto fail_bos_ProcessNameGetNext;
     }
 
-    rc = IteratorNext(iter, (void *) processName, &tst);
+    rc = IteratorNext(iter, (void *)processName, &tst);
 
-fail_bos_ProcessNameGetNext:
+  fail_bos_ProcessNameGetNext:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -934,14 +882,13 @@ fail_bos_ProcessNameGetNext:
  *
  */
 
-int ADMINAPI bos_ProcessNameGetDone(
-  const void *iterationId,
-  afs_status_p st)
+int ADMINAPI
+bos_ProcessNameGetDone(const void *iterationId, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
+
     if (iterationId == NULL) {
        tst = ADMITERATIONIDPNULL;
        goto fail_bos_ProcessNameGetDone;
@@ -949,10 +896,10 @@ int ADMINAPI bos_ProcessNameGetDone(
 
     rc = IteratorDone(iter, &tst);
 
-fail_bos_ProcessNameGetDone:
+  fail_bos_ProcessNameGetDone:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -980,12 +927,10 @@ fail_bos_ProcessNameGetDone:
  *
  */
 
-int ADMINAPI bos_ProcessInfoGet(
-  const void *serverHandle,
-  const char *processName,
-  bos_ProcessType_p processTypeP, 
-  bos_ProcessInfo_p processInfoP,
-  afs_status_p st)
+int ADMINAPI
+bos_ProcessInfoGet(const void *serverHandle, char *processName,
+                  bos_ProcessType_p processTypeP,
+                  bos_ProcessInfo_p processInfoP, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -994,7 +939,7 @@ int ADMINAPI bos_ProcessInfoGet(
     char *ptr = type;
     struct bozo_status status;
     int i;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ProcessInfoGet;
     }
@@ -1021,7 +966,7 @@ int ADMINAPI bos_ProcessInfoGet(
     }
 
 
-    for(i=0;(processTypes[i] != NULL); i++) {
+    for (i = 0; (processTypes[i] != NULL); i++) {
        if (!strcmp(processTypes[i], type)) {
            *processTypeP = (bos_ProcessType_t) i;
            break;
@@ -1053,10 +998,10 @@ int ADMINAPI bos_ProcessInfoGet(
     }
     rc = 1;
 
-fail_bos_ProcessInfoGet:
+  fail_bos_ProcessInfoGet:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1066,26 +1011,24 @@ fail_bos_ProcessInfoGet:
  */
 
 typedef struct param_get {
-  int next;
-  struct rx_connection *server;
-  char processName[BOS_MAX_NAME_LEN];
-  char param[CACHED_ITEMS][BOS_MAX_NAME_LEN];
+    int next;
+    struct rx_connection *server;
+    char processName[BOS_MAX_NAME_LEN];
+    char param[CACHED_ITEMS][BOS_MAX_NAME_LEN];
 } param_get_t, *param_get_p;
 
-static int GetParameterRPC(
-  void *rpc_specific,
-  int slot,
-  int *last_item,
-  int *last_item_contains_data,
-  afs_status_p st)
+static int
+GetParameterRPC(void *rpc_specific, int slot, int *last_item,
+               int *last_item_contains_data, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     param_get_p param = (param_get_p) rpc_specific;
-    char *ptr = (char *) &param->param[slot];
+    char *ptr = (char *)&param->param[slot];
 
-    tst = BOZO_GetInstanceParm(param->server, param->processName,
-                              param->next++, &ptr);
+    tst =
+       BOZO_GetInstanceParm(param->server, param->processName, param->next++,
+                            &ptr);
 
     if (tst == 0) {
        rc = 1;
@@ -1102,17 +1045,15 @@ static int GetParameterRPC(
     return rc;
 }
 
-static int GetParameterFromCache(
-  void *rpc_specific,
-  int slot,
-  void *dest,
-  afs_status_p st)
+static int
+GetParameterFromCache(void *rpc_specific, int slot, void *dest,
+                     afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     param_get_p param = (param_get_p) rpc_specific;
 
-    strcpy((char *) dest, (char *) &param->param[slot]);
+    strcpy((char *)dest, (char *)&param->param[slot]);
     rc = 1;
 
     if (st != NULL) {
@@ -1120,7 +1061,7 @@ static int GetParameterFromCache(
     }
     return rc;
 }
-  
+
 /*
  * bos_ProcessParameterGetBegin - begin iterating over the parameters
  * of a particular process.
@@ -1144,18 +1085,17 @@ static int GetParameterFromCache(
  *
  */
 
-int ADMINAPI bos_ProcessParameterGetBegin(
-  const void *serverHandle,
-  const char *processName,
-  void **iterationIdP,
-  afs_status_p st)
+int ADMINAPI
+bos_ProcessParameterGetBegin(const void *serverHandle,
+                            const char *processName, void **iterationIdP,
+                            afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
-    afs_admin_iterator_p iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
-    param_get_p param = (param_get_p) malloc(sizeof(param_get_t));
+    afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
+    param_get_p param = malloc(sizeof(param_get_t));
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ProcessParameterGetBegin;
     }
@@ -1179,15 +1119,16 @@ int ADMINAPI bos_ProcessParameterGetBegin(
     param->server = b_handle->server;
     strcpy(param->processName, processName);
 
-    if (IteratorInit(iter, (void *) param, GetParameterRPC,
-                    GetParameterFromCache, NULL, NULL, &tst)) {
-       *iterationIdP = (void *) iter;
+    if (IteratorInit
+       (iter, (void *)param, GetParameterRPC, GetParameterFromCache, NULL,
+        NULL, &tst)) {
+       *iterationIdP = (void *)iter;
     } else {
        goto fail_bos_ProcessParameterGetBegin;
     }
     rc = 1;
 
-fail_bos_ProcessParameterGetBegin:
+  fail_bos_ProcessParameterGetBegin:
 
     if (rc == 0) {
        if (iter != NULL) {
@@ -1199,7 +1140,7 @@ fail_bos_ProcessParameterGetBegin:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1225,32 +1166,31 @@ fail_bos_ProcessParameterGetBegin:
  * Returns != 0 upon successful completion.
  *
  */
-  
-int ADMINAPI bos_ProcessParameterGetNext(
-  const void *iterationId,
-  char *parameter,
-  afs_status_p st)
+
+int ADMINAPI
+bos_ProcessParameterGetNext(const void *iterationId, char *parameter,
+                           afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
+
     if (iterationId == NULL) {
        tst = ADMITERATIONIDPNULL;
        goto fail_bos_ProcessParameterGetNext;
     }
+
     if (parameter == NULL) {
        tst = ADMBOSPARAMETERNULL;
        goto fail_bos_ProcessParameterGetNext;
     }
 
-    rc = IteratorNext(iter, (void *) parameter, &tst);
+    rc = IteratorNext(iter, (void *)parameter, &tst);
 
-fail_bos_ProcessParameterGetNext:
+  fail_bos_ProcessParameterGetNext:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1273,14 +1213,13 @@ fail_bos_ProcessParameterGetNext:
  *
  */
 
-int ADMINAPI bos_ProcessParameterGetDone(
-  const void *iterationId,
-  afs_status_p st)
+int ADMINAPI
+bos_ProcessParameterGetDone(const void *iterationId, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
+
     if (iterationId == NULL) {
        tst = ADMITERATIONIDPNULL;
        goto fail_bos_ProcessParameterGetDone;
@@ -1288,10 +1227,10 @@ int ADMINAPI bos_ProcessParameterGetDone(
 
     rc = IteratorDone(iter, &tst);
 
-fail_bos_ProcessParameterGetDone:
+  fail_bos_ProcessParameterGetDone:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1318,16 +1257,14 @@ fail_bos_ProcessParameterGetDone:
  *
  */
 
-int ADMINAPI bos_ProcessNotifierGet(
-  const void *serverHandle,
-  const char *processName,
-  char *notifier, 
-  afs_status_p st)
+int ADMINAPI
+bos_ProcessNotifierGet(const void *serverHandle, const char *processName,
+                      char *notifier, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ProcessNotifierGet;
     }
@@ -1336,22 +1273,23 @@ int ADMINAPI bos_ProcessNotifierGet(
        tst = ADMBOSPROCESSNAMENULL;
        goto fail_bos_ProcessNotifierGet;
     }
+
     if (notifier == NULL) {
        tst = ADMBOSNOTIFIERNULL;
        goto fail_bos_ProcessNotifierGet;
     }
 
-    tst = BOZO_GetInstanceParm(b_handle->server, processName, 999, &notifier);
+    tst = BOZO_GetInstanceParm(b_handle->server, (char *)processName,
+                              999, &notifier);
 
     if (tst == 0) {
        rc = 1;
     }
 
-fail_bos_ProcessNotifierGet:
+  fail_bos_ProcessNotifierGet:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1375,15 +1313,14 @@ fail_bos_ProcessNotifierGet:
  *
  */
 
-int ADMINAPI bos_ProcessRestart(
-  const void *serverHandle,
-  const char *processName,
-  afs_status_p st)
+int ADMINAPI
+bos_ProcessRestart(const void *serverHandle, const char *processName,
+                  afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ProcessRestart;
     }
@@ -1393,16 +1330,16 @@ int ADMINAPI bos_ProcessRestart(
        goto fail_bos_ProcessRestart;
     }
 
-    tst = BOZO_Restart(b_handle->server, processName);
+    tst = BOZO_Restart(b_handle->server, (char *)processName);
 
     if (tst == 0) {
        rc = 1;
     }
 
-fail_bos_ProcessRestart:
+  fail_bos_ProcessRestart:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1424,28 +1361,27 @@ fail_bos_ProcessRestart:
  *
  */
 
-int ADMINAPI bos_ProcessAllStop(
-  const void *serverHandle,
-  afs_status_p st)
+int ADMINAPI
+bos_ProcessAllStop(const void *serverHandle, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ProcessAllStop;
     }
+
     tst = BOZO_ShutdownAll(b_handle->server);
 
     if (tst == 0) {
        rc = 1;
     }
 
-fail_bos_ProcessAllStop:
+  fail_bos_ProcessAllStop:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1468,28 +1404,27 @@ fail_bos_ProcessAllStop:
  *
  */
 
-int ADMINAPI bos_ProcessAllStart(
-  const void *serverHandle,
-  afs_status_p st)
+int ADMINAPI
+bos_ProcessAllStart(const void *serverHandle, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ProcessAllStart;
     }
+
     tst = BOZO_StartupAll(b_handle->server);
 
     if (tst == 0) {
        rc = 1;
     }
 
-fail_bos_ProcessAllStart:
+  fail_bos_ProcessAllStart:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1512,18 +1447,17 @@ fail_bos_ProcessAllStart:
  *
  */
 
-int ADMINAPI bos_ProcessAllWaitStop(
-  const void *serverHandle,
-  afs_status_p st)
+int ADMINAPI
+bos_ProcessAllWaitStop(const void *serverHandle, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ProcessAllWaitStop;
     }
+
     if (!bos_ProcessAllStop(serverHandle, &tst)) {
        goto fail_bos_ProcessAllWaitStop;
     }
@@ -1534,10 +1468,10 @@ int ADMINAPI bos_ProcessAllWaitStop(
        rc = 1;
     }
 
-fail_bos_ProcessAllWaitStop:
+  fail_bos_ProcessAllWaitStop:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1560,28 +1494,27 @@ fail_bos_ProcessAllWaitStop:
  *
  */
 
-int ADMINAPI bos_ProcessAllWaitTransition(
-  const void *serverHandle,
-  afs_status_p st)
+int ADMINAPI
+bos_ProcessAllWaitTransition(const void *serverHandle, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ProcessAllWaitTransition;
     }
+
     tst = BOZO_WaitAll(b_handle->server);
 
     if (tst == 0) {
        rc = 1;
     }
 
-fail_bos_ProcessAllWaitTransition:
+  fail_bos_ProcessAllWaitTransition:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1607,15 +1540,15 @@ fail_bos_ProcessAllWaitTransition:
  *
  */
 
-int ADMINAPI bos_ProcessAllStopAndRestart(
-  const void *serverHandle,
-  bos_RestartBosServer_t restartBosServer,
-  afs_status_p st)
+int ADMINAPI
+bos_ProcessAllStopAndRestart(const void *serverHandle,
+                            bos_RestartBosServer_t restartBosServer,
+                            afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ProcessAllStopAndRestart;
     }
@@ -1628,15 +1561,15 @@ int ADMINAPI bos_ProcessAllStopAndRestart(
     }
 
     tst = BOZO_RestartAll(b_handle->server);
-    
+
     if (tst == 0) {
        rc = 1;
     }
 
-fail_bos_ProcessAllStopAndRestart:
+  fail_bos_ProcessAllStopAndRestart:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1660,15 +1593,14 @@ fail_bos_ProcessAllStopAndRestart:
  *
  */
 
-int ADMINAPI bos_AdminCreate(
-  const void *serverHandle,
-  const char *adminName,
-  afs_status_p st)
+int ADMINAPI
+bos_AdminCreate(const void *serverHandle, const char *adminName,
+               afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_AdminCreate;
     }
@@ -1677,17 +1609,17 @@ int ADMINAPI bos_AdminCreate(
        tst = ADMBOSADMINNAMENULL;
        goto fail_bos_AdminCreate;
     }
-    tst = BOZO_AddSUser(b_handle->server, adminName);
-    
+
+    tst = BOZO_AddSUser(b_handle->server, (char *)adminName);
+
     if (tst == 0) {
        rc = 1;
     }
 
-fail_bos_AdminCreate:
+  fail_bos_AdminCreate:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1711,15 +1643,14 @@ fail_bos_AdminCreate:
  *
  */
 
-int ADMINAPI bos_AdminDelete(
-  const void *serverHandle,
-  const char *adminName,
-  afs_status_p st)
+int ADMINAPI
+bos_AdminDelete(const void *serverHandle, const char *adminName,
+               afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_AdminDelete;
     }
@@ -1728,17 +1659,17 @@ int ADMINAPI bos_AdminDelete(
        tst = ADMBOSADMINNAMENULL;
        goto fail_bos_AdminDelete;
     }
-    tst = BOZO_DeleteSUser(b_handle->server, adminName);
-    
+
+    tst = BOZO_DeleteSUser(b_handle->server, (char *)adminName);
+
     if (tst == 0) {
        rc = 1;
     }
 
-fail_bos_AdminDelete:
+  fail_bos_AdminDelete:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1748,22 +1679,19 @@ fail_bos_AdminDelete:
  */
 
 typedef struct admin_get {
-  int next;
-  struct rx_connection *server;
-  char admin[CACHED_ITEMS][BOS_MAX_NAME_LEN];
+    int next;
+    struct rx_connection *server;
+    char admin[CACHED_ITEMS][BOS_MAX_NAME_LEN];
 } admin_get_t, *admin_get_p;
 
-static int GetAdminRPC(
-  void *rpc_specific,
-  int slot,
-  int *last_item,
-  int *last_item_contains_data,
-  afs_status_p st)
+static int
+GetAdminRPC(void *rpc_specific, int slot, int *last_item,
+           int *last_item_contains_data, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     admin_get_p admin = (admin_get_p) rpc_specific;
-    char *ptr = (char *) &admin->admin[slot];
+    char *ptr = (char *)&admin->admin[slot];
 
     tst = BOZO_ListSUsers(admin->server, admin->next++, &ptr);
 
@@ -1786,17 +1714,14 @@ static int GetAdminRPC(
     return rc;
 }
 
-static int GetAdminFromCache(
-  void *rpc_specific,
-  int slot,
-  void *dest,
-  afs_status_p st)
+static int
+GetAdminFromCache(void *rpc_specific, int slot, void *dest, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     admin_get_p admin = (admin_get_p) rpc_specific;
 
-    strcpy((char *) dest, (char *) &admin->admin[slot]);
+    strcpy((char *)dest, (char *)&admin->admin[slot]);
     rc = 1;
 
     if (st != NULL) {
@@ -1804,7 +1729,7 @@ static int GetAdminFromCache(
     }
     return rc;
 }
-  
+
 /*
  * bos_AdminGetBegin - begin iterating over the administrators.
  *
@@ -1825,21 +1750,20 @@ static int GetAdminFromCache(
  *
  */
 
-int ADMINAPI bos_AdminGetBegin(
-  const void *serverHandle,
-  void **iterationIdP,
-  afs_status_p st)
+int ADMINAPI
+bos_AdminGetBegin(const void *serverHandle, void **iterationIdP,
+                 afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
-    afs_admin_iterator_p iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
-    admin_get_p admin = (admin_get_p) malloc(sizeof(admin_get_t));
+    afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
+    admin_get_p admin = malloc(sizeof(admin_get_t));
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_AdminGetBegin;
     }
+
     if (iterationIdP == NULL) {
        tst = ADMITERATIONIDPNULL;
        goto fail_bos_AdminGetBegin;
@@ -1853,13 +1777,14 @@ int ADMINAPI bos_AdminGetBegin(
     admin->next = 0;
     admin->server = b_handle->server;
 
-    if (IteratorInit(iter, (void *) admin, GetAdminRPC,
-                    GetAdminFromCache, NULL, NULL, &tst)) {
-       *iterationIdP = (void *) iter;
+    if (IteratorInit
+       (iter, (void *)admin, GetAdminRPC, GetAdminFromCache, NULL, NULL,
+        &tst)) {
+       *iterationIdP = (void *)iter;
        rc = 1;
     }
 
-fail_bos_AdminGetBegin:
+  fail_bos_AdminGetBegin:
 
     if (rc == 0) {
        if (iter != NULL) {
@@ -1871,7 +1796,7 @@ fail_bos_AdminGetBegin:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1897,16 +1822,14 @@ fail_bos_AdminGetBegin:
  * Returns != 0 upon successful completion.
  *
  */
-  
-int ADMINAPI bos_AdminGetNext(
-  const void *iterationId,
-  char *adminName,
-  afs_status_p st)
+
+int ADMINAPI
+bos_AdminGetNext(const void *iterationId, char *adminName, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
+
     if (iterationId == NULL) {
        tst = ADMITERATIONIDPNULL;
        goto fail_bos_AdminGetNext;
@@ -1917,12 +1840,12 @@ int ADMINAPI bos_AdminGetNext(
        goto fail_bos_AdminGetNext;
     }
 
-    rc = IteratorNext(iter, (void *) adminName, &tst);
+    rc = IteratorNext(iter, (void *)adminName, &tst);
 
-fail_bos_AdminGetNext:
+  fail_bos_AdminGetNext:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1945,14 +1868,13 @@ fail_bos_AdminGetNext:
  *
  */
 
-int ADMINAPI bos_AdminGetDone(
-  const void *iterationId,
-  afs_status_p st)
+int ADMINAPI
+bos_AdminGetDone(const void *iterationId, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
+
     if (iterationId == NULL) {
        tst = ADMITERATIONIDPNULL;
        goto fail_bos_AdminGetDone;
@@ -1960,10 +1882,10 @@ int ADMINAPI bos_AdminGetDone(
 
     rc = IteratorDone(iter, &tst);
 
-fail_bos_AdminGetDone:
+  fail_bos_AdminGetDone:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -1989,16 +1911,14 @@ fail_bos_AdminGetDone:
  *
  */
 
-int ADMINAPI bos_KeyCreate(
-  const void *serverHandle,
-  int keyVersionNumber,
-  const kas_encryptionKey_p key,
-  afs_status_p st)
+int ADMINAPI
+bos_KeyCreate(const void *serverHandle, int keyVersionNumber,
+             const kas_encryptionKey_p key, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_KeyCreate;
     }
@@ -2007,17 +1927,17 @@ int ADMINAPI bos_KeyCreate(
        tst = ADMBOSKEYNULL;
        goto fail_bos_KeyCreate;
     }
-    tst = BOZO_AddKey(b_handle->server_encrypt, keyVersionNumber, key);
+
+    tst = BOZO_AddKey(b_handle->server_encrypt, keyVersionNumber, kas_to_bozoptr(key));
 
     if (tst == 0) {
        rc = 1;
     }
 
-fail_bos_KeyCreate:
+  fail_bos_KeyCreate:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2041,29 +1961,27 @@ fail_bos_KeyCreate:
  *
  */
 
-int ADMINAPI bos_KeyDelete(
-  const void *serverHandle,
-  int keyVersionNumber,
-  afs_status_p st)
+int ADMINAPI
+bos_KeyDelete(const void *serverHandle, int keyVersionNumber, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_KeyDelete;
     }
+
     tst = BOZO_DeleteKey(b_handle->server, keyVersionNumber);
 
     if (tst == 0) {
        rc = 1;
     }
 
-fail_bos_KeyDelete:
+  fail_bos_KeyDelete:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2073,33 +1991,30 @@ fail_bos_KeyDelete:
  */
 
 typedef struct key_get {
-  int next;
-  struct rx_connection *server;
-  bos_KeyInfo_t key[CACHED_ITEMS];
+    int next;
+    struct rx_connection *server;
+    bos_KeyInfo_t key[CACHED_ITEMS];
 } key_get_t, *key_get_p;
 
-static int GetKeyRPC(
-  void *rpc_specific,
-  int slot,
-  int *last_item,
-  int *last_item_contains_data,
-  afs_status_p st)
+static int
+GetKeyRPC(void *rpc_specific, int slot, int *last_item,
+         int *last_item_contains_data, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     key_get_p key = (key_get_p) rpc_specific;
-    char *ptr = (char *) &key->key[slot];
     struct bozo_keyInfo keyInfo;
 
-    tst = BOZO_ListKeys(key->server, key->next++,
-                       &key->key[slot].keyVersionNumber,
-                       &key->key[slot].key, &keyInfo);
+    tst =
+       BOZO_ListKeys(key->server, key->next++,
+                     &key->key[slot].keyVersionNumber, kas_to_bozoptr(&key->key[slot].key),
+                     &keyInfo);
+
 
     if (tst == 0) {
        key->key[slot].keyStatus.lastModificationDate = keyInfo.mod_sec;
-       key->key[slot].keyStatus.lastModificationMicroSeconds = 
-                                                             keyInfo.mod_usec;
+       key->key[slot].keyStatus.lastModificationMicroSeconds =
+           keyInfo.mod_usec;
        key->key[slot].keyStatus.checkSum = keyInfo.keyCheckSum;
        rc = 1;
     } else if (tst == BZDOM) {
@@ -2115,11 +2030,8 @@ static int GetKeyRPC(
     return rc;
 }
 
-static int GetKeyFromCache(
-  void *rpc_specific,
-  int slot,
-  void *dest,
-  afs_status_p st)
+static int
+GetKeyFromCache(void *rpc_specific, int slot, void *dest, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -2133,7 +2045,7 @@ static int GetKeyFromCache(
     }
     return rc;
 }
-  
+
 /*
  * bos_KeyGetBegin - begin iterating over the keys.
  *
@@ -2154,21 +2066,20 @@ static int GetKeyFromCache(
  *
  */
 
-int ADMINAPI bos_KeyGetBegin(
-  const void *serverHandle,
-  void **iterationIdP,
-  afs_status_p st)
+int ADMINAPI
+bos_KeyGetBegin(const void *serverHandle, void **iterationIdP,
+               afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
-    afs_admin_iterator_p iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
-    key_get_p key = (key_get_p) malloc(sizeof(key_get_t));
+    afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
+    key_get_p key = malloc(sizeof(key_get_t));
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_KeyGetBegin;
     }
+
     if (iterationIdP == NULL) {
        tst = ADMITERATIONIDPNULL;
        goto fail_bos_KeyGetBegin;
@@ -2182,13 +2093,13 @@ int ADMINAPI bos_KeyGetBegin(
     key->next = 0;
     key->server = b_handle->server_encrypt;
 
-    if (IteratorInit(iter, (void *) key, GetKeyRPC,
-                    GetKeyFromCache, NULL, NULL, &tst)) {
-       *iterationIdP = (void *) iter;
+    if (IteratorInit
+       (iter, (void *)key, GetKeyRPC, GetKeyFromCache, NULL, NULL, &tst)) {
+       *iterationIdP = (void *)iter;
        rc = 1;
     }
 
-fail_bos_KeyGetBegin:
+  fail_bos_KeyGetBegin:
 
     if (rc == 0) {
        if (iter != NULL) {
@@ -2200,7 +2111,7 @@ fail_bos_KeyGetBegin:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2227,31 +2138,29 @@ fail_bos_KeyGetBegin:
  *
  */
 
-int ADMINAPI bos_KeyGetNext(
-  const void *iterationId,
-  bos_KeyInfo_p keyP,
-  afs_status_p st)
+int ADMINAPI
+bos_KeyGetNext(const void *iterationId, bos_KeyInfo_p keyP, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
+
     if (iterationId == NULL) {
        tst = ADMITERATIONIDPNULL;
        goto fail_bos_KeyGetNext;
     }
+
     if (keyP == NULL) {
        tst = ADMBOSKEYPNULL;
        goto fail_bos_KeyGetNext;
     }
 
-    rc = IteratorNext(iter, (void *) keyP, &tst);
+    rc = IteratorNext(iter, (void *)keyP, &tst);
 
-fail_bos_KeyGetNext:
+  fail_bos_KeyGetNext:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2274,14 +2183,13 @@ fail_bos_KeyGetNext:
  *
  */
 
-int ADMINAPI bos_KeyGetDone(
-  const void *iterationId,
-  afs_status_p st)
+int ADMINAPI
+bos_KeyGetDone(const void *iterationId, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
+
     if (iterationId == NULL) {
        tst = ADMITERATIONIDPNULL;
        goto fail_bos_KeyGetDone;
@@ -2289,10 +2197,10 @@ int ADMINAPI bos_KeyGetDone(
 
     rc = IteratorDone(iter, &tst);
 
-fail_bos_KeyGetDone:
+  fail_bos_KeyGetDone:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2315,15 +2223,13 @@ fail_bos_KeyGetDone:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI bos_CellSet(
-  const void *serverHandle,
-  const char *cellName,
-  afs_status_p st)
+int ADMINAPI
+bos_CellSet(const void *serverHandle, const char *cellName, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_CellSet;
     }
@@ -2332,17 +2238,17 @@ int ADMINAPI bos_CellSet(
        tst = ADMCLIENTCELLNAMENULL;
        goto fail_bos_CellSet;
     }
-    tst = BOZO_SetCellName(b_handle->server, cellName);
+
+    tst = BOZO_SetCellName(b_handle->server, (char *)cellName);
 
     if (tst == 0) {
        rc = 1;
     }
 
-fail_bos_CellSet:
+  fail_bos_CellSet:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2365,15 +2271,13 @@ fail_bos_CellSet:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI bos_CellGet(
-  const void *serverHandle,
-  char *cellName,
-  afs_status_p st)
+int ADMINAPI
+bos_CellGet(const void *serverHandle, char *cellName, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_CellGet;
     }
@@ -2382,21 +2286,21 @@ int ADMINAPI bos_CellGet(
        tst = ADMCLIENTCELLNAMENULL;
        goto fail_bos_CellGet;
     }
+
     tst = BOZO_GetCellName(b_handle->server, &cellName);
 
     if (tst == 0) {
        rc = 1;
     }
-fail_bos_CellGet:
+
+  fail_bos_CellGet:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
+
 /*
  * bos_HostCreate - add a new host to the cell.
  *
@@ -2415,15 +2319,14 @@ fail_bos_CellGet:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI bos_HostCreate(
-  const void *serverHandle,
-  const char *hostName,
-  afs_status_p st)
+int ADMINAPI
+bos_HostCreate(const void *serverHandle, const char *hostName,
+              afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_HostCreate;
     }
@@ -2432,21 +2335,21 @@ int ADMINAPI bos_HostCreate(
        tst = ADMBOSHOSTNAMENULL;
        goto fail_bos_HostCreate;
     }
-    tst = BOZO_AddCellHost(b_handle->server, hostName);
+
+    tst = BOZO_AddCellHost(b_handle->server, (char *)hostName);
 
     if (tst == 0) {
        rc = 1;
     }
-fail_bos_HostCreate:
+
+  fail_bos_HostCreate:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
+
 /*
  * bos_HostDelete - delete a host from the cell.
  *
@@ -2465,34 +2368,33 @@ fail_bos_HostCreate:
  * Returns != 0 upon successful completion.
  */
 
-int ADMINAPI bos_HostDelete(
-  const void *serverHandle,
-  const char *hostName,
-  afs_status_p st)
+int ADMINAPI
+bos_HostDelete(const void *serverHandle, const char *hostName,
+              afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_HostDelete;
     }
+
     if ((hostName == NULL) || (*hostName == 0)) {
        tst = ADMBOSHOSTNAMENULL;
        goto fail_bos_HostDelete;
     }
-    tst = BOZO_DeleteCellHost(b_handle->server, hostName);
+
+    tst = BOZO_DeleteCellHost(b_handle->server, (char *)hostName);
 
     if (tst == 0) {
        rc = 1;
     }
 
-fail_bos_HostDelete:
+  fail_bos_HostDelete:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2502,22 +2404,19 @@ fail_bos_HostDelete:
  */
 
 typedef struct host_get {
-  int next;
-  struct rx_connection *server;
-  char host[CACHED_ITEMS][BOS_MAX_NAME_LEN];
+    int next;
+    struct rx_connection *server;
+    char host[CACHED_ITEMS][BOS_MAX_NAME_LEN];
 } host_get_t, *host_get_p;
 
-static int GetHostRPC(
-  void *rpc_specific,
-  int slot,
-  int *last_item,
-  int *last_item_contains_data,
-  afs_status_p st)
+static int
+GetHostRPC(void *rpc_specific, int slot, int *last_item,
+          int *last_item_contains_data, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     host_get_p host = (host_get_p) rpc_specific;
-    char *ptr = (char *) &host->host[slot];
+    char *ptr = (char *)&host->host[slot];
 
     tst = BOZO_GetCellHost(host->server, host->next++, &ptr);
 
@@ -2536,17 +2435,14 @@ static int GetHostRPC(
     return rc;
 }
 
-static int GetHostFromCache(
-  void *rpc_specific,
-  int slot,
-  void *dest,
-  afs_status_p st)
+static int
+GetHostFromCache(void *rpc_specific, int slot, void *dest, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     host_get_p host = (host_get_p) rpc_specific;
 
-    strcpy((char *) dest, (char *) &host->host[slot]);
+    strcpy((char *)dest, (char *)&host->host[slot]);
     rc = 1;
 
     if (st != NULL) {
@@ -2554,7 +2450,7 @@ static int GetHostFromCache(
     }
     return rc;
 }
-  
+
 /*
  * bos_HostGetBegin - begin iterating over the hosts in a cell
  * at a particular bos server.
@@ -2576,21 +2472,20 @@ static int GetHostFromCache(
  *
  */
 
-int ADMINAPI bos_HostGetBegin(
-  const void *serverHandle,
-  void **iterationIdP,
-  afs_status_p st)
+int ADMINAPI
+bos_HostGetBegin(const void *serverHandle, void **iterationIdP,
+                afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
-    afs_admin_iterator_p iter = (afs_admin_iterator_p) malloc(sizeof(afs_admin_iterator_t));
-    host_get_p host = (host_get_p) malloc(sizeof(host_get_t));
+    afs_admin_iterator_p iter = malloc(sizeof(afs_admin_iterator_t));
+    host_get_p host = malloc(sizeof(host_get_t));
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_HostGetBegin;
     }
+
     if (iterationIdP == NULL) {
        tst = ADMITERATIONIDPNULL;
        goto fail_bos_HostGetBegin;
@@ -2604,13 +2499,14 @@ int ADMINAPI bos_HostGetBegin(
     host->next = 0;
     host->server = b_handle->server;
 
-    if (IteratorInit(iter, (void *) host, GetHostRPC,
-                    GetHostFromCache, NULL, NULL, &tst)) {
-       *iterationIdP = (void *) iter;
+    if (IteratorInit
+       (iter, (void *)host, GetHostRPC, GetHostFromCache, NULL, NULL,
+        &tst)) {
+       *iterationIdP = (void *)iter;
        rc = 1;
     }
 
-fail_bos_HostGetBegin:
+  fail_bos_HostGetBegin:
 
     if (rc == 0) {
        if (iter != NULL) {
@@ -2622,7 +2518,7 @@ fail_bos_HostGetBegin:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2649,31 +2545,29 @@ fail_bos_HostGetBegin:
  *
  */
 
-int ADMINAPI bos_HostGetNext(
-  const void *iterationId,
-  char *hostName,
-  afs_status_p st)
+int ADMINAPI
+bos_HostGetNext(const void *iterationId, char *hostName, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
+
     if (iterationId == NULL) {
        tst = ADMITERATIONIDPNULL;
        goto fail_bos_HostGetNext;
     }
+
     if (hostName == NULL) {
        tst = ADMBOSHOSTNAMENULL;
        goto fail_bos_HostGetNext;
     }
 
-    rc = IteratorNext(iter, (void *) hostName, &tst);
+    rc = IteratorNext(iter, (void *)hostName, &tst);
 
-fail_bos_HostGetNext:
+  fail_bos_HostGetNext:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2696,14 +2590,13 @@ fail_bos_HostGetNext:
  *
  */
 
-int ADMINAPI bos_HostGetDone(
-  const void *iterationId,
-  afs_status_p st)
+int ADMINAPI
+bos_HostGetDone(const void *iterationId, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     afs_admin_iterator_p iter = (afs_admin_iterator_p) iterationId;
+
     if (iterationId == NULL) {
        tst = ADMITERATIONIDPNULL;
        goto fail_bos_HostGetDone;
@@ -2711,10 +2604,10 @@ int ADMINAPI bos_HostGetDone(
 
     rc = IteratorDone(iter, &tst);
 
-fail_bos_HostGetDone:
+  fail_bos_HostGetDone:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2740,11 +2633,9 @@ fail_bos_HostGetDone:
  *
  */
 
-int ADMINAPI bos_ExecutableCreate(
-  const void *serverHandle,
-  const char *sourceFile,
-  const char *destFile,
-  afs_status_p st)
+int ADMINAPI
+bos_ExecutableCreate(const void *serverHandle, const char *sourceFile,
+                    const char *destFile, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -2752,7 +2643,7 @@ int ADMINAPI bos_ExecutableCreate(
     int fd;
     struct stat estat;
     struct rx_call *tcall;
+
     /*
      * Validate arguments
      */
@@ -2793,9 +2684,10 @@ int ADMINAPI bos_ExecutableCreate(
 
     tcall = rx_NewCall(b_handle->server);
 
-    tst = StartBOZO_Install(tcall, destFile, estat.st_size,
-                           (afs_int32) estat.st_mode, estat.st_mtime);
-    
+    tst =
+       StartBOZO_Install(tcall, (char *)destFile, estat.st_size,
+                         (afs_int32) estat.st_mode, estat.st_mtime);
+
     if (tst) {
        rx_EndCall(tcall, tst);
        goto fail_bos_ExecutableCreate;
@@ -2805,9 +2697,9 @@ int ADMINAPI bos_ExecutableCreate(
      * Copy the data to the server
      */
 
-    while(1) {
+    while (1) {
        char tbuffer[512];
-       size_t len;
+       ssize_t len;
        len = read(fd, tbuffer, sizeof(tbuffer));
        if (len < 0) {
            tst = ADMBOSCANTREADSOURCEFILE;
@@ -2836,10 +2728,10 @@ int ADMINAPI bos_ExecutableCreate(
        rc = 1;
     }
 
-fail_bos_ExecutableCreate:
+  fail_bos_ExecutableCreate:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2863,15 +2755,14 @@ fail_bos_ExecutableCreate:
  *
  */
 
-int ADMINAPI bos_ExecutableRevert(
-  const void *serverHandle,
-  const char *execFile,
-  afs_status_p st)
+int ADMINAPI
+bos_ExecutableRevert(const void *serverHandle, const char *execFile,
+                    afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ExecutableRevert;
     }
@@ -2881,16 +2772,16 @@ int ADMINAPI bos_ExecutableRevert(
        goto fail_bos_ExecutableRevert;
     }
 
-    tst = BOZO_UnInstall(b_handle->server, execFile);
+    tst = BOZO_UnInstall(b_handle->server, (char *)execFile);
 
     if (tst == 0) {
        rc = 1;
     }
 
-fail_bos_ExecutableRevert:
+  fail_bos_ExecutableRevert:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2916,22 +2807,19 @@ fail_bos_ExecutableRevert:
  *
  */
 
-int ADMINAPI bos_ExecutableTimestampGet(
-  const void *serverHandle,
-  const char *execFile,
-  unsigned long *newTime,
-  unsigned long *oldTime,
-  unsigned long *bakTime,
-  afs_status_p st)
+int ADMINAPI
+bos_ExecutableTimestampGet(const void *serverHandle, const char *execFile,
+                          afs_int32 *newTime, afs_int32 *oldTime,
+                          afs_int32 *bakTime, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ExecutableTimestampGet;
     }
+
     if ((execFile == NULL) || (*execFile == 0)) {
        tst = ADMBOSEXECFILENULL;
        goto fail_bos_ExecutableTimestampGet;
@@ -2951,17 +2839,18 @@ int ADMINAPI bos_ExecutableTimestampGet(
        tst = ADMBOSBAKTIMENULL;
        goto fail_bos_ExecutableTimestampGet;
     }
-    tst = BOZO_GetDates(b_handle->server, execFile, newTime, bakTime, oldTime);
+
+    tst =
+       BOZO_GetDates(b_handle->server, (char *)execFile, newTime, bakTime, oldTime);
 
     if (tst == 0) {
        rc = 1;
     }
-fail_bos_ExecutableTimestampGet:
+
+  fail_bos_ExecutableTimestampGet:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -2990,18 +2879,16 @@ fail_bos_ExecutableTimestampGet:
  *
  */
 
-int ADMINAPI bos_ExecutablePrune(
-  const void *serverHandle,
-  bos_Prune_t oldFiles,
-  bos_Prune_t bakFiles,
-  bos_Prune_t coreFiles,
-  afs_status_p st)
+int ADMINAPI
+bos_ExecutablePrune(const void *serverHandle, bos_Prune_t oldFiles,
+                   bos_Prune_t bakFiles, bos_Prune_t coreFiles,
+                   afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
     afs_int32 flags = 0;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ExecutablePrune;
     }
@@ -3023,11 +2910,11 @@ int ADMINAPI bos_ExecutablePrune(
     if (tst == 0) {
        rc = 1;
     }
-fail_bos_ExecutablePrune:
+
+  fail_bos_ExecutablePrune:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -3054,48 +2941,46 @@ fail_bos_ExecutablePrune:
  *
  */
 
-int ADMINAPI bos_ExecutableRestartTimeSet(
-  const void *serverHandle,
-  bos_Restart_t type,
-  bos_RestartTime_t time,
-  afs_status_p st)
+int ADMINAPI
+bos_ExecutableRestartTimeSet(const void *serverHandle, bos_Restart_t type,
+                            bos_RestartTime_t time, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
     afs_int32 restartType = 0;
-    struct ktime restartTime;
+    struct bozo_netKTime restartTime;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ExecutableRestartTimeSet;
     }
+
     if (type == BOS_RESTART_WEEKLY) {
        restartType = 1;
     } else {
        restartType = 2;
     }
 
-    if ((time.mask & BOS_RESTART_TIME_HOUR) &&
-        (time.hour < 0) || (time.hour > 23)) {
+    if ((time.mask & BOS_RESTART_TIME_HOUR)
+       && ((time.hour < 0) || (time.hour > 23))) {
        tst = ADMBOSHOURINVALID;
        goto fail_bos_ExecutableRestartTimeSet;
     }
 
-    if ((time.mask & BOS_RESTART_TIME_MINUTE) &&
-       (time.min < 0) || (time.min > 60)) {
+    if ((time.mask & BOS_RESTART_TIME_MINUTE)
+       && ((time.min < 0) || (time.min > 60))) {
        tst = ADMBOSMINUTEINVALID;
        goto fail_bos_ExecutableRestartTimeSet;
     }
 
-    if ((time.mask & BOS_RESTART_TIME_SECOND) &&
-       (time.sec < 0) || (time.sec > 60)) {
+    if ((time.mask & BOS_RESTART_TIME_SECOND)
+       && ((time.sec < 0) || (time.sec > 60))) {
        tst = ADMBOSSECONDINVALID;
        goto fail_bos_ExecutableRestartTimeSet;
     }
 
-    if ((time.mask & BOS_RESTART_TIME_DAY) &&
-       (time.day < 0) || (time.day > 6)) {
+    if ((time.mask & BOS_RESTART_TIME_DAY)
+       && ((time.day < 0) || (time.day > 6))) {
        tst = ADMBOSDAYINVALID;
        goto fail_bos_ExecutableRestartTimeSet;
     }
@@ -3106,16 +2991,16 @@ int ADMINAPI bos_ExecutableRestartTimeSet(
     restartTime.sec = time.sec;
     restartTime.day = time.day;
 
-    tst = BOZO_SetRestartTime(b_handle->server, restartType, restartTime);
+    tst = BOZO_SetRestartTime(b_handle->server, restartType, &restartTime);
 
     if (tst == 0) {
        rc = 1;
     }
-fail_bos_ExecutableRestartTimeSet:
+
+  fail_bos_ExecutableRestartTimeSet:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -3142,18 +3027,16 @@ fail_bos_ExecutableRestartTimeSet:
  *
  */
 
-int ADMINAPI bos_ExecutableRestartTimeGet(
-  const void *serverHandle,
-  bos_Restart_t type,
-  bos_RestartTime_p timeP,
-  afs_status_p st)
+int ADMINAPI
+bos_ExecutableRestartTimeGet(const void *serverHandle, bos_Restart_t type,
+                            bos_RestartTime_p timeP, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
     afs_int32 restartType = 0;
-    struct ktime restartTime;
+    struct bozo_netKTime restartTime;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_ExecutableRestartTimeGet;
     }
@@ -3162,7 +3045,7 @@ int ADMINAPI bos_ExecutableRestartTimeGet(
        tst = ADMBOSTIMEPNULL;
        goto fail_bos_ExecutableRestartTimeGet;
     }
+
     if (type == BOS_RESTART_WEEKLY) {
        restartType = 1;
     } else {
@@ -3181,11 +3064,11 @@ int ADMINAPI bos_ExecutableRestartTimeGet(
     timeP->sec = restartTime.sec;
     timeP->day = restartTime.day;
     rc = 1;
-fail_bos_ExecutableRestartTimeGet:
+
+  fail_bos_ExecutableRestartTimeGet:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -3214,22 +3097,19 @@ fail_bos_ExecutableRestartTimeGet:
  *
  */
 
-int ADMINAPI bos_LogGet(
-  const void *serverHandle,
-  const char *log,
-  unsigned long *logBufferSizeP,
-  char *logData,
-  afs_status_p st)
+int ADMINAPI
+bos_LogGet(const void *serverHandle, const char *log,
+          unsigned long *logBufferSizeP, char *logData, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
-    struct rx_call *tcall;
+    struct rx_call *tcall = NULL;
     afs_int32 error;
     char buffer;
     int have_call = 0;
     unsigned long bytes_read = 0;
+
     /*
      * Validate parameters
      */
@@ -3259,7 +3139,7 @@ int ADMINAPI bos_LogGet(
 
     tcall = rx_NewCall(b_handle->server);
     have_call = 1;
-    tst = StartBOZO_GetLog(tcall, log);
+    tst = StartBOZO_GetLog(tcall, (char *) log);
 
     if (tst != 0) {
        goto fail_bos_LogGet;
@@ -3294,21 +3174,21 @@ int ADMINAPI bos_LogGet(
        if (bytes_read <= *logBufferSizeP) {
            *logData++ = buffer;
        } else {
-          tst = ADMMOREDATA;
+           tst = ADMMOREDATA;
        }
     }
     if (tst == 0) {
        rc = 1;
     }
-fail_bos_LogGet:
+
+  fail_bos_LogGet:
 
     if (have_call) {
        rx_EndCall(tcall, 0);
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -3332,16 +3212,14 @@ fail_bos_LogGet:
  *
  */
 
-int ADMINAPI bos_AuthSet(
-  const void *serverHandle,
-  bos_Auth_t auth,
-  afs_status_p st)
+int ADMINAPI
+bos_AuthSet(const void *serverHandle, bos_Auth_t auth, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
     afs_int32 level = 0;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_AuthSet;
     }
@@ -3351,17 +3229,17 @@ int ADMINAPI bos_AuthSet(
     } else {
        level = 1;
     }
+
     tst = BOZO_SetNoAuthFlag(b_handle->server, level);
 
     if (tst == 0) {
        rc = 1;
     }
 
-fail_bos_AuthSet:
+  fail_bos_AuthSet:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -3385,15 +3263,14 @@ fail_bos_AuthSet:
  *
  */
 
-int ADMINAPI bos_CommandExecute(
-  const void *serverHandle,
-  const char *command,
-  afs_status_p st)
+int ADMINAPI
+bos_CommandExecute(const void *serverHandle, const char *command,
+                  afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
     bos_server_p b_handle = (bos_server_p) serverHandle;
+
     if (!isValidServerHandle(b_handle, &tst)) {
        goto fail_bos_CommandExecute;
     }
@@ -3402,17 +3279,17 @@ int ADMINAPI bos_CommandExecute(
        tst = ADMBOSCOMMANDNULL;
        goto fail_bos_CommandExecute;
     }
-    tst = BOZO_Exec(b_handle->server, command);
+
+    tst = BOZO_Exec(b_handle->server, (char *) command);
 
     if (tst == 0) {
        rc = 1;
     }
 
-fail_bos_CommandExecute:
+  fail_bos_CommandExecute:
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }
@@ -3461,21 +3338,16 @@ fail_bos_CommandExecute:
 
 #define INITIAL_LOG_LEN 4096
 
-int ADMINAPI bos_Salvage(
-  const void *cellHandle,
-  const void *serverHandle,
-  const char *partitionName,
-  const char *volumeName,
-  int numSalvagers,
-  const char *tmpDir,
-  const char *logFile,
-  vos_force_t force,
-  bos_SalvageDamagedVolumes_t salvageDamagedVolumes,
-  bos_WriteInodes_t writeInodes,
-  bos_WriteRootInodes_t writeRootInodes,
-  bos_ForceDirectory_t forceDirectory,
-  bos_ForceBlockRead_t forceBlockRead,
-  afs_status_p st)
+int ADMINAPI
+bos_Salvage(const void *cellHandle, const void *serverHandle,
+           const char *partitionName, const char *volumeName,
+           int numSalvagers, const char *tmpDir, const char *logFile,
+           vos_force_t force,
+           bos_SalvageDamagedVolumes_t salvageDamagedVolumes,
+           bos_WriteInodes_t writeInodes,
+           bos_WriteRootInodes_t writeRootInodes,
+           bos_ForceDirectory_t forceDirectory,
+           bos_ForceBlockRead_t forceBlockRead, afs_status_p st)
 {
     int rc = 0;
     afs_status_t tst = 0;
@@ -3485,7 +3357,6 @@ int ADMINAPI bos_Salvage(
     int have_volume = 0;
     unsigned int part = 0;
     int try_to_stop_fileserver = 0;
-    int stopped_fileserver = 0;
     bos_ProcessType_t procType;
     bos_ProcessInfo_t procInfo;
     FILE *log = NULL;
@@ -3494,7 +3365,7 @@ int ADMINAPI bos_Salvage(
     int poll_rc;
     char *logData = NULL;
     unsigned long logLen = INITIAL_LOG_LEN;
+
     /*
      * Validate arguments
      */
@@ -3508,8 +3379,8 @@ int ADMINAPI bos_Salvage(
     }
 
     if (c_handle->vos_valid == 0) {
-        tst = ADMBOSCELLHANDLENOVOS;
-        goto fail_bos_Salvage;
+       tst = ADMBOSCELLHANDLENOVOS;
+       goto fail_bos_Salvage;
     }
 
     if ((partitionName != NULL) && (*partitionName != 0)) {
@@ -3548,10 +3419,10 @@ int ADMINAPI bos_Salvage(
      */
 
     if (try_to_stop_fileserver) {
-       if (bos_ProcessInfoGet(serverHandle, "fs", &procType, &procInfo,
-                               &tst)) {
+       if (bos_ProcessInfoGet
+           (serverHandle, "fs", &procType, &procInfo, &tst)) {
            if (procInfo.processGoal != BOS_PROCESS_RUNNING) {
-              try_to_stop_fileserver = 0;
+               try_to_stop_fileserver = 0;
            }
        }
     }
@@ -3561,9 +3432,8 @@ int ADMINAPI bos_Salvage(
      */
 
     if (try_to_stop_fileserver) {
-       if (!bos_ProcessExecutionStateSetTemporary(serverHandle, "fs",
-                                                  BOS_PROCESS_STOPPED,
-                                                  &tst)) {
+       if (!bos_ProcessExecutionStateSetTemporary
+           (serverHandle, "fs", BOS_PROCESS_STOPPED, &tst)) {
            goto fail_bos_Salvage;
        }
        bos_ProcessAllWaitTransition(serverHandle, &tst);
@@ -3573,16 +3443,16 @@ int ADMINAPI bos_Salvage(
      * Create the salvage command line arguments
      */
 
-    command_len = sprintf(command, "%s ",
-                         AFSDIR_CANONICAL_SERVER_SALVAGER_FILEPATH);
+    command_len =
+       sprintf(command, "%s ", AFSDIR_CANONICAL_SERVER_SALVAGER_FILEPATH);
     if (have_partition) {
-       command_len += sprintf(&command[command_len], "-partition %s ",
-                              partitionName);
+       command_len +=
+           sprintf(&command[command_len], "-partition %s ", partitionName);
     }
 
     if (have_volume) {
-       command_len += sprintf(&command[command_len], "-volumeid %s ",
-                              volumeName);
+       command_len +=
+           sprintf(&command[command_len], "-volumeid %s ", volumeName);
     }
 
     if (salvageDamagedVolumes == BOS_DONT_SALVAGE_DAMAGED_VOLUMES) {
@@ -3609,7 +3479,8 @@ int ADMINAPI bos_Salvage(
        command_len += sprintf(&command[command_len], "-blockreads ");
     }
 
-    command_len += sprintf(&command[command_len], "-parallel %d ", numSalvagers);
+    command_len +=
+       sprintf(&command[command_len], "-parallel %d ", numSalvagers);
 
     if ((tmpDir != NULL) && (*tmpDir != 0)) {
        command_len += sprintf(&command[command_len], "-tmpdir %s ", tmpDir);
@@ -3624,13 +3495,15 @@ int ADMINAPI bos_Salvage(
      * Create the process at the bosserver and wait until it completes
      */
 
-    if (!bos_ProcessCreate(serverHandle, "salvage-tmp", BOS_PROCESS_CRON,
-                          command, "now", 0, &tst)) {
+    if (!bos_ProcessCreate
+       (serverHandle, "salvage-tmp", BOS_PROCESS_CRON, command, "now", 0,
+        &tst)) {
        goto fail_bos_Salvage;
     }
 
-    while (poll_rc = bos_ProcessInfoGet(serverHandle, "salvage-tmp", &procType,
-                                       &procInfo, &tst)) {
+    while ((poll_rc =
+           bos_ProcessInfoGet(serverHandle, "salvage-tmp", &procType,
+                              &procInfo, &tst))) {
        sleep(5);
     }
 
@@ -3644,17 +3517,17 @@ int ADMINAPI bos_Salvage(
 
     if (log != NULL) {
 
-       logData = (char *) malloc(INITIAL_LOG_LEN);
+       logData = malloc(INITIAL_LOG_LEN);
        if (!logData) {
            tst = ADMNOMEM;
            goto fail_bos_Salvage;
        }
 
-        while(!bos_LogGet(serverHandle,
-                         AFSDIR_CANONICAL_SERVER_SLVGLOG_FILEPATH,
-                         &logLen, logData, &tst)) {
+       while (!bos_LogGet
+              (serverHandle, AFSDIR_CANONICAL_SERVER_SLVGLOG_FILEPATH,
+               &logLen, logData, &tst)) {
            if (logLen > INITIAL_LOG_LEN) {
-               logData = (char *) realloc(logData, (logLen + (logLen / 10)));
+               logData = realloc(logData, (logLen + (logLen / 10)));
                if (logData == NULL) {
                    tst = ADMNOMEM;
                    goto fail_bos_Salvage;
@@ -3672,15 +3545,14 @@ int ADMINAPI bos_Salvage(
 
     if (try_to_stop_fileserver) {
        try_to_stop_fileserver = 0;
-       if (!bos_ProcessExecutionStateSetTemporary(serverHandle, "fs",
-                                                  BOS_PROCESS_RUNNING,
-                                                  &tst)) {
+       if (!bos_ProcessExecutionStateSetTemporary
+           (serverHandle, "fs", BOS_PROCESS_RUNNING, &tst)) {
            goto fail_bos_Salvage;
        }
     }
     rc = 1;
 
-fail_bos_Salvage:
+  fail_bos_Salvage:
 
     if (log != NULL) {
        fclose(log);
@@ -3696,7 +3568,7 @@ fail_bos_Salvage:
     }
 
     if (st != NULL) {
-        *st = tst;
+       *st = tst;
     }
     return rc;
 }