log: Relocate pagsh
[openafs.git] / src / log / unlog.c
index ba4939d..f2760aa 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
 #include <afsconfig.h>
 #include <afs/param.h>
 
-RCSID
-    ("$Header$");
-
-#include <stdio.h>
-#include <potpourri.h>
-#ifdef AFS_AIX32_ENV
-#include <signal.h>
-#endif
+#include <roken.h>
+#include <afs/opr.h>
 
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <sys/ioctl.h>
 #include <afs/vice.h>
-#include <sys/file.h>
 
 #include <afs/auth.h>
 #include <afs/cellconfig.h>
@@ -69,9 +50,13 @@ struct tokenInfo {
     int deleted;
 };
 
+static int unlog_ForgetCertainTokens(char **, int);
+static int unlog_NormalizeCellNames(char **, int);
+static int unlog_CheckUnlogList(char **, int, struct ktc_principal *);
+static int unlog_VerifyUnlog(char **, int, struct tokenInfo *, int);
 
-int 
-CommandProc(struct cmd_syndesc *as, char *arock)
+static int
+CommandProc(struct cmd_syndesc *as, void *arock)
 {
 #define        MAXCELLS 20             /* XXX */
     struct cmd_item *itp;
@@ -105,12 +90,12 @@ int
 main(int argc, char *argv[])
 {                              /*Main routine */
     struct cmd_syndesc *ts;
-    register afs_int32 code;
+    afs_int32 code;
 
 #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.
      */
@@ -122,7 +107,7 @@ main(int argc, char *argv[])
     sigaction(SIGSEGV, &nsa, NULL);
 #endif
 
-    ts = cmd_CreateSyntax(NULL, CommandProc, 0,
+    ts = cmd_CreateSyntax(NULL, CommandProc, NULL,
                          "Release Kerberos authentication");
     cmd_AddParm(ts, "-cell", CMD_LIST, CMD_OPTIONAL, "cell name");
 
@@ -140,10 +125,11 @@ main(int argc, char *argv[])
  *           then re-register the good ones.  Ugly, but it works.
  */
 
-int
+static int
 unlog_ForgetCertainTokens(char **list, int listSize)
 {
-    unsigned count, index, index2;
+    int index, index2;
+    int count;
     afs_int32 code;
     struct ktc_principal serviceName;
     struct tokenInfo *tokenInfoP;
@@ -157,8 +143,7 @@ unlog_ForgetCertainTokens(char **list, int listSize)
        code = ktc_ListTokens(count, &count, &serviceName);
     } while (!code);
 
-    tokenInfoP =
-       (struct tokenInfo *)malloc((sizeof(struct tokenInfo) * count));
+    tokenInfoP = malloc((sizeof(struct tokenInfo) * count));
     if (!tokenInfoP) {
        perror("unlog_ForgetCertainTokens -- osi_Alloc failed");
        exit(1);
@@ -229,7 +214,7 @@ unlog_CheckUnlogList(char **list, int count, struct ktc_principal *principal)
 int
 unlog_NormalizeCellNames(char **list, int size)
 {
-    char *newCellName, *lcstring();
+    char *newCellName;
     unsigned index;
     struct afsconf_dir *conf;
     int code;
@@ -266,6 +251,7 @@ unlog_NormalizeCellNames(char **list, int size)
        *list = newCellName;
     }
     afsconf_Close(conf);
+    return 0;
 }
 
 /*
@@ -290,4 +276,5 @@ unlog_VerifyUnlog(char **cellList, int cellListSize, struct tokenInfo *tokenList
            fprintf(stderr, "unlog: Warning - no tokens held for cell %s\n",
                    cellList[index]);
     }
+    return 0;
 }