aboutsummaryrefslogtreecommitdiff
path: root/src/clients/kpasswd
diff options
context:
space:
mode:
authorEzra Peisach <epeisach@mit.edu>2000-07-29 19:17:30 +0000
committerEzra Peisach <epeisach@mit.edu>2000-07-29 19:17:30 +0000
commit775240bdbf47dbb90f5a79fa2943210434944ff8 (patch)
tree9de5a9c25a415998b47765105d5efbb6c1d32756 /src/clients/kpasswd
parent0da65eb46350d27c35b19e7721d474e57fe8a09a (diff)
downloadkrb5-775240bdbf47dbb90f5a79fa2943210434944ff8.zip
krb5-775240bdbf47dbb90f5a79fa2943210434944ff8.tar.gz
krb5-775240bdbf47dbb90f5a79fa2943210434944ff8.tar.bz2
kpasswd.c (main): Warnings cleanup
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12593 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/clients/kpasswd')
-rw-r--r--src/clients/kpasswd/ChangeLog4
-rw-r--r--src/clients/kpasswd/kpasswd.c30
2 files changed, 18 insertions, 16 deletions
diff --git a/src/clients/kpasswd/ChangeLog b/src/clients/kpasswd/ChangeLog
index cc48688..6ef626a 100644
--- a/src/clients/kpasswd/ChangeLog
+++ b/src/clients/kpasswd/ChangeLog
@@ -1,3 +1,7 @@
+2000-07-29 Ezra Peisach <epeisach@mit.edu>
+
+ * kpasswd.c (main): Warnings cleanup.
+
2000-03-16 Ezra Peisach <epeisach@mit.edu>
* kpasswd.c (main): Remove unused variables.
diff --git a/src/clients/kpasswd/kpasswd.c b/src/clients/kpasswd/kpasswd.c
index 94c8d51..8256850 100644
--- a/src/clients/kpasswd/kpasswd.c
+++ b/src/clients/kpasswd/kpasswd.c
@@ -13,6 +13,7 @@
#ifdef HAVE_PWD_H
#include <pwd.h>
+static
void get_name_from_passwd_file(program_name, kcontext, me)
char * program_name;
krb5_context kcontext;
@@ -20,7 +21,7 @@ void get_name_from_passwd_file(program_name, kcontext, me)
{
struct passwd *pw;
krb5_error_code code;
- if (pw = getpwuid((int) getuid())) {
+ if ((pw = getpwuid((int) getuid()))) {
if ((code = krb5_parse_name(kcontext, pw->pw_name, me))) {
com_err (program_name, code, "when parsing name %s", pw->pw_name);
exit(1);
@@ -62,15 +63,12 @@ int main(int argc, char *argv[])
pname = argv[1];
- if (ret = krb5_init_context(&context)) {
+ ret = krb5_init_context(&context);
+ if (ret) {
com_err(argv[0], ret, "initializing kerberos library");
exit(1);
}
-#if 0
- krb5_init_ets(context);
-#endif
-
/* in order, use the first of:
- a name specified on the command line
- the principal name from an existing ccache
@@ -80,7 +78,7 @@ int main(int argc, char *argv[])
*/
if (pname) {
- if (ret = krb5_parse_name(context, pname, &princ)) {
+ if ((ret = krb5_parse_name(context, pname, &princ))) {
com_err(argv[0], ret, "parsing client name");
exit(1);
}
@@ -90,12 +88,12 @@ int main(int argc, char *argv[])
exit(1);
}
- if (ret = krb5_cc_get_principal(context, ccache, &princ)) {
+ if ((ret = krb5_cc_get_principal(context, ccache, &princ))) {
com_err(argv[0], ret, "getting principal from ccache");
exit(1);
}
- if (ret = krb5_cc_close(context, ccache)) {
+ if ((ret = krb5_cc_close(context, ccache))) {
com_err(argv[0], ret, "closing ccache");
exit(1);
}
@@ -109,9 +107,9 @@ int main(int argc, char *argv[])
krb5_get_init_creds_opt_set_forwardable(&opts, 0);
krb5_get_init_creds_opt_set_proxiable(&opts, 0);
- if (ret = krb5_get_init_creds_password(context, &creds, princ, NULL,
- krb5_prompter_posix, NULL,
- 0, "kadmin/changepw", &opts)) {
+ if ((ret = krb5_get_init_creds_password(context, &creds, princ, NULL,
+ krb5_prompter_posix, NULL,
+ 0, "kadmin/changepw", &opts))) {
if (ret == KRB5KRB_AP_ERR_BAD_INTEGRITY)
com_err(argv[0], 0,
"Password incorrect while getting initial ticket");
@@ -121,14 +119,14 @@ int main(int argc, char *argv[])
}
pwlen = sizeof(pw);
- if (ret = krb5_read_password(context, P1, P2, pw, &pwlen)) {
+ if ((ret = krb5_read_password(context, P1, P2, pw, &pwlen))) {
com_err(argv[0], ret, "while reading password");
exit(1);
}
- if (ret = krb5_change_password(context, &creds, pw,
- &result_code, &result_code_string,
- &result_string)) {
+ if ((ret = krb5_change_password(context, &creds, pw,
+ &result_code, &result_code_string,
+ &result_string))) {
com_err(argv[0], ret, "changing password");
exit(1);
}