Skip to content

Commit

Permalink
Remove unused variables from kprop.c
Browse files Browse the repository at this point in the history
Commit 29dee7d removed the
need for a ccache to hold the credentials used by the process,
but did not remove the ccname and ccache variables which became
unused as a result.
  • Loading branch information
kaduk committed Oct 24, 2014
1 parent 62894f8 commit 1bc9764
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/slave/kprop.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ static char *file = KPROP_DEFAULT_FILE;
/* The Kerberos principal we'll be sending as, initialized in get_tickets. */
static krb5_principal my_principal;

static krb5_ccache ccache; /* Credentials cache which we'll be using */
static krb5_creds creds;
static krb5_address *sender_addr;
static krb5_address *receiver_addr;
Expand Down Expand Up @@ -174,7 +173,6 @@ parse_args(int argc, char **argv)
static void
get_tickets(krb5_context context)
{
char const ccname[] = "MEMORY:kpropcc";
char *def_realm, *server;
krb5_error_code retval;
krb5_keytab keytab = NULL;
Expand Down Expand Up @@ -211,27 +209,12 @@ get_tickets(krb5_context context)
}
}

/* Use a memory cache to avoid possible filesystem conflicts. */
retval = krb5_cc_resolve(context, ccname, &ccache);
if (retval) {
com_err(progname, retval, _("while opening credential cache %s"),
ccname);
exit(1);
}

retval = krb5_cc_initialize(context, ccache, my_principal);
if (retval) {
com_err(progname, retval, _("when initializing cache %s"), ccname);
exit(1);
}

/* Construct the principal name for the slave host. */
memset(&creds, 0, sizeof(creds));
retval = krb5_sname_to_principal(context, slave_host, KPROP_SERVICE_NAME,
KRB5_NT_SRV_HST, &server_princ);
if (retval) {
com_err(progname, errno, _("while setting server principal name"));
krb5_cc_destroy(context, ccache);
exit(1);
}
retval = krb5_unparse_name_flags(context, server_princ,
Expand All @@ -245,15 +228,13 @@ get_tickets(krb5_context context)
retval = krb5_copy_principal(context, my_principal, &creds.client);
if (retval) {
com_err(progname, retval, _("while copying client principal"));
krb5_cc_destroy(context, ccache);
exit(1);
}

if (srvtab != NULL) {
retval = krb5_kt_resolve(context, srvtab, &keytab);
if (retval) {
com_err(progname, retval, _("while resolving keytab"));
krb5_cc_destroy(context, ccache);
exit(1);
}
}
Expand All @@ -262,7 +243,6 @@ get_tickets(krb5_context context)
0, server, NULL);
if (retval) {
com_err(progname, retval, _("while getting initial credentials\n"));
krb5_cc_destroy(context, ccache);
exit(1);
}

Expand Down

0 comments on commit 1bc9764

Please sign in to comment.