rxgen, kauth: Set but not used variables
authorMarc Dionne <marc.c.dionne@gmail.com>
Sat, 11 Sep 2010 17:19:47 +0000 (13:19 -0400)
committerDerrick Brashear <shadow@dementia.org>
Mon, 20 Sep 2010 07:29:00 +0000 (00:29 -0700)
Remove a few variables that are not actually used, and the
associated code.

foundcurrentkey is only used in the AUTH_DBM_LOG case, so
scope the declaration and assignment accordingly.

Spotted by gcc 4.6

Change-Id: I281ca37488e69bfe46a8e63bdc5990f5f3cff940
Reviewed-on: http://gerrit.openafs.org/2734
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/kauth/authclient.c
src/kauth/kadatabase.c
src/kauth/kkids.c
src/kauth/kpasswd.c
src/rxgen/rpc_parse.c

index 2831a12..0d57771 100644 (file)
@@ -352,12 +352,10 @@ CheckTicketAnswer(ka_BBS * oanswer, afs_int32 challenge,
                  afs_int32 * pwexpires)
 {
     struct ka_ticketAnswer *answer;
-    afs_uint32 cksum;
     unsigned char tempc;
 
     answer = (struct ka_ticketAnswer *)oanswer->SeqBody;
 
-    cksum = ntohl(answer->cksum);
     if (challenge != ntohl(answer->challenge))
        return KABADPROTOCOL;
     memcpy(&token->sessionKey, &answer->sessionKey,
index b204225..21b40fe 100644 (file)
@@ -411,7 +411,10 @@ ka_NewKey(struct ubik_trans *tt, afs_int32 tentryaddr,
     Date now = time(0);
     afs_int32 newkeyver;       /* new key version number */
     afs_int32 newtotalkeyentries = 0, oldtotalkeyentries = 0, keyentries;
-    int foundcurrentkey = 0, addednewkey = 0, modified;
+    int addednewkey = 0, modified;
+#ifdef AUTH_DBM_LOG
+    int foundcurrentkey = 0;
+#endif
 
     es_Report("Newkey for %s.%s\n", tentry->userID.name,
              tentry->userID.instance);
@@ -460,8 +463,8 @@ ka_NewKey(struct ubik_trans *tt, afs_int32 tentryaddr,
                            ("Warning: Entry %s.%s contains more than one valid key: fixing\n",
                             tentry->userID.name, tentry->userID.instance));
                }
-#endif
                foundcurrentkey = 1;
+#endif
            }
 
            /* If we find an oldkey of the same version or
index d004028..5d9fb7a 100644 (file)
@@ -51,10 +51,8 @@ static FILE *childin, *childout;     /* file pointers on pipe to kpwvalid */
 static int
 simplify_name(char *orig_name, char *true_name)
 {
-    int thru_symlink;
     struct stat statbuff;
 
-    thru_symlink = 0;
 
 #ifdef AFS_NT40_ENV
     if (stat(orig_name, &statbuff) < 0) {
@@ -80,7 +78,6 @@ simplify_name(char *orig_name, char *true_name)
         * the contents of the link for the file name.
         */
        if ((statbuff.st_mode & S_IFMT) == S_IFLNK) {
-           thru_symlink = 1;
            link_chars_read = readlink(orig_name, true_name, 1024);
            if (link_chars_read <= 0) {
                *true_name = '\0';
index c40640a..d81cbef 100644 (file)
@@ -218,7 +218,6 @@ CommandProc(struct cmd_syndesc *as, void *arock)
     struct passwd pwent;
     struct passwd *pw = &pwent;
 
-    int insist;                        /* insist on good password quality */
     int lexplicit = 0;         /* servers specified explicitly */
     int local;                 /* explicit cell is same a local cell */
     int foundPassword = 0;     /*Not yet, anyway */
@@ -410,7 +409,6 @@ CommandProc(struct cmd_syndesc *as, void *arock)
     give_to_child(passwd);
 
     /* Get new password if it wasn't provided. */
-    insist = 0;
     if (!foundNewPassword) {
        if (Pipe)
            getpipepass(npasswd, sizeof(npasswd));
index 5ebd08e..28f07fa 100644 (file)
@@ -1650,14 +1650,8 @@ ss_ProcTail_setup(definition * defp, int somefrees)
        f_print(fout, "\tz_xdrs->x_op = XDR_FREE;\n");
     for (plist = defp->pc.plists; plist; plist = plist->next) {
        if (plist->component_kind == DEF_PARAM
-           && (plist->pl.param_flag & FREETHIS_PARAM)) {
-           char *dot = "", *extens = "";
-           if (plist->pl.string_name) {
-               dot = ".";
-               extens = plist->pl.string_name;
-           }
+               && (plist->pl.param_flag & FREETHIS_PARAM))
            f_print(fout, "\tif (!%s) goto fail1;\n", plist->scode);
-       }
     }
     for (listp = typedef_defined; listp != NULL; listp = listp->next) {
        defp1 = (definition *) listp->val;