kauth: Remove unused lclpw structure from klog
[openafs.git] / src / kauth / klog.c
index c82ac7d..ea15360 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,34 +9,20 @@
 
 #include <afsconfig.h>
 #include <afs/param.h>
+#include <afs/stds.h>
 
-RCSID
-    ("$Header$");
+#include <roken.h>
 
-#include <afs/stds.h>
-#include <sys/types.h>
 #include <rx/xdr.h>
-#ifdef AFS_AIX32_ENV
-#include <signal.h>
-#endif
-#ifdef HAVE_STRING_H
-#include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
-
 #include <lock.h>
 #include <ubik.h>
-
-#include <stdio.h>
-#include <pwd.h>
 #include <afs/com_err.h>
 #include <afs/cellconfig.h>
 #include <afs/cmd.h>
+
 #include "kauth.h"
 #include "kautils.h"
+#include "kauth_internal.h"
 #include "assert.h"
 
 
@@ -70,7 +56,7 @@ RCSID
 #define KLOGEXIT(code) assert(!code || code >= KAMINERROR); \
                        rx_Finalize(); \
                        (!code ? exit(0) : exit((code)-KAMINERROR+1))
-extern int CommandProc(struct cmd_syndesc *as, char *arock);
+int CommandProc(struct cmd_syndesc *as, void *arock);
 
 static int zero_argc;
 static char **zero_argv;
@@ -88,8 +74,8 @@ main(int argc, char *argv[])
     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.
      */
@@ -104,7 +90,7 @@ main(int argc, char *argv[])
     zero_argc = argc;
     zero_argv = argv;
 
-    ts = cmd_CreateSyntax(NULL, CommandProc, 0,
+    ts = cmd_CreateSyntax(NULL, CommandProc, NULL,
                          "obtain Kerberos authentication");
 
 #define aXFLAG 0
@@ -145,7 +131,7 @@ getpipepass(void)
 {
     static char gpbuf[BUFSIZ];
     /* read a password from stdin, stop on \n or eof */
-    register int i, tc;
+    int i, tc;
     memset(gpbuf, 0, sizeof(gpbuf));
     for (i = 0; i < (sizeof(gpbuf) - 1); i++) {
        tc = fgetc(stdin);
@@ -157,13 +143,13 @@ getpipepass(void)
 }
 
 int
-CommandProc(struct cmd_syndesc *as, char *arock)
+CommandProc(struct cmd_syndesc *as, void *arock)
 {
     char name[MAXKTCNAMELEN];
     char instance[MAXKTCNAMELEN];
     char cell[MAXKTCREALMLEN];
     char realm[MAXKTCREALMLEN];
-    afs_int32 serverList[MAXSERVERS];
+    afs_uint32 serverList[MAXSERVERS];
     char *lcell;               /* local cellname */
     char lrealm[MAXKTCREALMLEN];       /* uppercase copy of local cellname */
     int code;
@@ -172,7 +158,6 @@ CommandProc(struct cmd_syndesc *as, char *arock)
 
     struct passwd pwent;
     struct passwd *pw = &pwent;
-    struct passwd *lclpw = &pwent;
     char passwd[BUFSIZ];
 
     static char rn[] = "klog"; /*Routine name */
@@ -224,7 +209,7 @@ CommandProc(struct cmd_syndesc *as, char *arock)
            afs_com_err(rn, code, "Can't get local cell name!");
        KLOGEXIT(code);
     }
-    if (code = ka_CellToRealm(lcell, lrealm, 0))
+    if ((code = ka_CellToRealm(lcell, lrealm, 0)))
        goto nocell;
 
     strcpy(instance, "");
@@ -283,7 +268,6 @@ CommandProc(struct cmd_syndesc *as, char *arock)
            foundExplicitCell = 1;
            strncpy(realm, cell, sizeof(realm));
        }
-       lclpw->pw_name = name;
     } else {
        /* No explicit name provided: use Unix uid. */
        pw = getpwuid(getuid());
@@ -296,7 +280,6 @@ CommandProc(struct cmd_syndesc *as, char *arock)
            }
            KLOGEXIT(KABADARGUMENT);
        }
-       lclpw = pw;
     }
 
     if (as->parms[aPASSWORD].items) {
@@ -351,7 +334,7 @@ CommandProc(struct cmd_syndesc *as, char *arock)
 
     if (!foundExplicitCell)
        strcpy(realm, lcell);
-    if (code = ka_CellToRealm(realm, realm, &local)) {
+    if ((code = ka_CellToRealm(realm, realm, &local))) {
        if (!Silent)
            afs_com_err(rn, code, "Can't convert cell to realm");
        KLOGEXIT(code);