#ifdef HAVE_PWD_H
#include <pwd.h>
+static
void get_name_from_passwd_file(program_name, kcontext, me)
char * program_name;
krb5_context kcontext;
{
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);
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
*/
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);
}
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);
}
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");
}
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);
}