From c38fea29c5daefd35800eda63f0dcef56eb74357 Mon Sep 17 00:00:00 2001 From: Marc Dionne Date: Sat, 11 Sep 2010 13:19:47 -0400 Subject: [PATCH] rxgen, kauth: Set but not used variables 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 Reviewed-by: Andrew Deason Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/kauth/authclient.c | 2 -- src/kauth/kadatabase.c | 7 +++++-- src/kauth/kkids.c | 3 --- src/kauth/kpasswd.c | 2 -- src/rxgen/rpc_parse.c | 8 +------- 5 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/kauth/authclient.c b/src/kauth/authclient.c index 2831a12a4..0d577714e 100644 --- a/src/kauth/authclient.c +++ b/src/kauth/authclient.c @@ -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, diff --git a/src/kauth/kadatabase.c b/src/kauth/kadatabase.c index b204225da..21b40fe50 100644 --- a/src/kauth/kadatabase.c +++ b/src/kauth/kadatabase.c @@ -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 diff --git a/src/kauth/kkids.c b/src/kauth/kkids.c index d004028a5..5d9fb7a6c 100644 --- a/src/kauth/kkids.c +++ b/src/kauth/kkids.c @@ -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'; diff --git a/src/kauth/kpasswd.c b/src/kauth/kpasswd.c index c40640a70..d81cbefe9 100644 --- a/src/kauth/kpasswd.c +++ b/src/kauth/kpasswd.c @@ -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)); diff --git a/src/rxgen/rpc_parse.c b/src/rxgen/rpc_parse.c index 5ebd08efc..28f07fa43 100644 --- a/src/rxgen/rpc_parse.c +++ b/src/rxgen/rpc_parse.c @@ -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; -- 2.39.5