Skip to content

Commit

Permalink
Remove more dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
frozencemetery authored and greghudson committed May 10, 2019
1 parent 13ba540 commit 0269810
Show file tree
Hide file tree
Showing 11 changed files with 10 additions and 75 deletions.
5 changes: 0 additions & 5 deletions src/clients/klist/klist.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,11 +720,6 @@ show_credential(krb5_creds *cred)
extra_field += 2;
}

if (extra_field > 3) {
fputs("\n", stdout);
extra_field = 0;
}

if (show_flags) {
flags = flags_string(cred);
if (flags && *flags) {
Expand Down
2 changes: 0 additions & 2 deletions src/kadmin/dbutil/kdb5_mkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,6 @@ kdb5_purge_mkeys(int argc, char *argv[])
if (actkvno_entry == actkvno_list) {
/* remove from head */
actkvno_list = actkvno_entry->next;
prev_actkvno_entry = actkvno_list;
} else if (actkvno_entry->next == NULL) {
/* remove from tail */
prev_actkvno_entry->next = NULL;
Expand All @@ -1263,7 +1262,6 @@ kdb5_purge_mkeys(int argc, char *argv[])
if (mkey_aux_entry->mkey_kvno == args.kvnos[j].kvno) {
if (mkey_aux_entry == mkey_aux_list) {
mkey_aux_list = mkey_aux_entry->next;
prev_mkey_aux_entry = mkey_aux_list;
} else if (mkey_aux_entry->next == NULL) {
prev_mkey_aux_entry->next = NULL;
} else {
Expand Down
4 changes: 0 additions & 4 deletions src/kadmin/server/ipropd_svc.c
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,6 @@ ipropx_resync(uint32_t vers, struct svc_req *rqstp)
int pret, fret;
FILE *p;
kadm5_server_handle_t handle = global_server_handle;
OM_uint32 min_stat;
gss_name_t name = NULL;
char *client_name = NULL, *service_name = NULL;
char *whoami = "iprop_full_resync_1";

Expand Down Expand Up @@ -440,8 +438,6 @@ ipropx_resync(uint32_t vers, struct svc_req *rqstp)
debprret(whoami, ret.ret, 0);
free(client_name);
free(service_name);
if (name)
gss_release_name(&min_stat, &name);
free(ubuf);
return (&ret);
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/gssapi/krb5/gssapi_krb5.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ krb5_gss_localname(OM_uint32 *minor,
localname->value = gssalloc_strdup(lname);
localname->length = strlen(lname);

return (code == 0) ? GSS_S_COMPLETE : GSS_S_FAILURE;
return GSS_S_COMPLETE;
}


Expand Down
5 changes: 2 additions & 3 deletions src/lib/gssapi/krb5/k5sealv3.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,8 @@ gss_krb5int_make_seal_token_v3 (krb5_context context,
/* TOK_ID */
store_16_be(KG2_TOK_WRAP_MSG, outbuf);
/* flags */
outbuf[2] = (acceptor_flag
| (conf_req_flag ? FLAG_WRAP_CONFIDENTIAL : 0)
| (ctx->have_acceptor_subkey ? FLAG_ACCEPTOR_SUBKEY : 0));
outbuf[2] = (acceptor_flag | FLAG_WRAP_CONFIDENTIAL |
(ctx->have_acceptor_subkey ? FLAG_ACCEPTOR_SUBKEY : 0));
/* filler */
outbuf[3] = 0xff;
/* EC */
Expand Down
5 changes: 2 additions & 3 deletions src/lib/gssapi/krb5/k5sealv3iov.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,8 @@ gss_krb5int_make_seal_token_v3_iov(krb5_context context,
/* TOK_ID */
store_16_be(KG2_TOK_WRAP_MSG, outbuf);
/* flags */
outbuf[2] = (acceptor_flag
| (conf_req_flag ? FLAG_WRAP_CONFIDENTIAL : 0)
| (ctx->have_acceptor_subkey ? FLAG_ACCEPTOR_SUBKEY : 0));
outbuf[2] = (acceptor_flag | FLAG_WRAP_CONFIDENTIAL |
(ctx->have_acceptor_subkey ? FLAG_ACCEPTOR_SUBKEY : 0));
/* filler */
outbuf[3] = 0xFF;
/* EC */
Expand Down
36 changes: 4 additions & 32 deletions src/lib/kdb/kdb_convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,6 @@ ulog_conv_2logentry(krb5_context context, krb5_db_entry *entry,
krb5_error_code ret;
kdbe_attr_type_t *attr_types;
int kadm_data_yes;
/* always exclude non-replicated attributes, for now */
krb5_boolean exclude_nra = TRUE;

nattrs = tmpint = 0;
final = -1;
Expand Down Expand Up @@ -356,7 +354,8 @@ ulog_conv_2logentry(krb5_context context, krb5_db_entry *entry,
nattrs++;
}
} else {
find_changed_attrs(curr, entry, exclude_nra, attr_types, &nattrs);
/* Always exclude non-replicated attributes for now. */
find_changed_attrs(curr, entry, TRUE, attr_types, &nattrs);
krb5_db_free_principal(context, curr);
}

Expand Down Expand Up @@ -402,31 +401,6 @@ ulog_conv_2logentry(krb5_context context, krb5_db_entry *entry,
}
break;

case AT_LAST_SUCCESS:
if (!exclude_nra && entry->last_success >= 0) {
ULOG_ENTRY_TYPE(update, ++final).av_type = AT_LAST_SUCCESS;
ULOG_ENTRY(update, final).av_last_success =
(uint32_t)entry->last_success;
}
break;

case AT_LAST_FAILED:
if (!exclude_nra && entry->last_failed >= 0) {
ULOG_ENTRY_TYPE(update, ++final).av_type = AT_LAST_FAILED;
ULOG_ENTRY(update, final).av_last_failed =
(uint32_t)entry->last_failed;
}
break;

case AT_FAIL_AUTH_COUNT:
if (!exclude_nra) {
ULOG_ENTRY_TYPE(update, ++final).av_type =
AT_FAIL_AUTH_COUNT;
ULOG_ENTRY(update, final).av_fail_auth_count =
(uint32_t)entry->fail_auth_count;
}
break;

case AT_PRINC:
if (entry->princ->length > 0) {
ULOG_ENTRY_TYPE(update, ++final).av_type = AT_PRINC;
Expand Down Expand Up @@ -552,10 +526,8 @@ ulog_conv_2logentry(krb5_context context, krb5_db_entry *entry,
/* END CSTYLED */

case AT_LEN:
if (entry->len >= 0) {
ULOG_ENTRY_TYPE(update, ++final).av_type = AT_LEN;
ULOG_ENTRY(update, final).av_len = (int16_t)entry->len;
}
ULOG_ENTRY_TYPE(update, ++final).av_type = AT_LEN;
ULOG_ENTRY(update, final).av_len = (int16_t)entry->len;
break;

default:
Expand Down
4 changes: 0 additions & 4 deletions src/plugins/kdb/ldap/ldap_util/kdb5_ldap_services.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,6 @@ kdb5_ldap_stash_service_password(int argc, char **argv)
print_usage = TRUE;
goto cleanup;
}
if (file_name == NULL) {
com_err(me, ENOMEM, _("while setting service object password"));
goto cleanup;
}
} else { /* argc == 2 */
service_object = strdup (argv[1]);
if (service_object == NULL) {
Expand Down
10 changes: 0 additions & 10 deletions src/plugins/kdb/ldap/libkdb_ldap/ldap_create.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ krb5_ldap_create(krb5_context context, char *conf_section, char **db_args)
krb5_ldap_realm_params *rparams = NULL;
krb5_ldap_context *ldap_context=NULL;
krb5_boolean realm_obj_created = FALSE;
krb5_boolean krbcontainer_obj_created = FALSE;
int mask = 0;

/* Clear the global error string */
Expand Down Expand Up @@ -121,15 +120,6 @@ krb5_ldap_create(krb5_context context, char *conf_section, char **db_args)
goto cleanup;

cleanup:
/* If the krbcontainer/realm creation is not complete, do the roll-back here */
if ((krbcontainer_obj_created) && (!realm_obj_created)) {
int rc;
rc = krb5_ldap_delete_krbcontainer(context,
ldap_context->container_dn);
k5_setmsg(context, rc, _("could not complete roll-back, error "
"deleting Kerberos Container"));
}

if (rparams)
krb5_ldap_free_realm_params(rparams);

Expand Down
8 changes: 0 additions & 8 deletions src/plugins/preauth/pkinit/pkinit_srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,15 +258,7 @@ verify_client_san(krb5_context context,
}
pkiDebug("%s: no upn san match found\n", __FUNCTION__);

/* We found no match */
if (princs != NULL || upns != NULL) {
*valid_san = 0;
/* XXX ??? If there was one or more name in the cert, but
* none matched the client name, then return mismatch? */
retval = KRB5KDC_ERR_CLIENT_NAME_MISMATCH;
}
retval = 0;

out:
if (princs != NULL) {
for (i = 0; princs[i] != NULL; i++)
Expand Down
4 changes: 1 addition & 3 deletions src/tests/hammer/kdc5_hammer.c
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,6 @@ int get_tgt (context, p_client_str, p_client, ccache)
krb5_principal *p_client;
krb5_ccache ccache;
{
char *cache_name = NULL; /* -f option */
long lifetime = KRB5_DEFAULT_LIFE; /* -l option */
krb5_error_code code;
krb5_creds my_creds;
Expand All @@ -464,8 +463,7 @@ int get_tgt (context, p_client_str, p_client, ccache)

code = krb5_cc_initialize (context, ccache, *p_client);
if (code != 0) {
com_err (prog, code, "when initializing cache %s",
cache_name?cache_name:"");
com_err (prog, code, "when initializing cache");
return(-1);
}

Expand Down

0 comments on commit 0269810

Please sign in to comment.