clean up and make work, require libheim-ipcs

This commit is contained in:
Love Hornquist Astrand
2009-11-21 23:54:00 -08:00
parent 368536bc08
commit fe2dfe83a8
10 changed files with 1022 additions and 829 deletions

View File

@@ -2,6 +2,8 @@
* Copyright (c) 2005, PADL Software Pty Ltd.
* All rights reserved.
*
* Portions Copyright (c) 2009 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -33,8 +35,6 @@
#include "kcm_locl.h"
#include <pwd.h>
RCSID("$Id$");
krb5_error_code
kcm_ccache_resolve_client(krb5_context context,
kcm_client *client,
@@ -54,7 +54,7 @@ kcm_ccache_resolve_client(krb5_context context,
ret = kcm_access(context, client, opcode, *ccache);
if (ret) {
ret = KRB5_FCC_NOFILE; /* don't disclose */
kcm_release_ccache(context, ccache);
kcm_release_ccache(context, *ccache);
}
return ret;
@@ -76,19 +76,12 @@ kcm_ccache_destroy_client(krb5_context context,
}
ret = kcm_access(context, client, KCM_OP_DESTROY, ccache);
if (ret) {
kcm_release_ccache(context, &ccache);
kcm_cleanup_events(context, ccache);
kcm_release_ccache(context, ccache);
if (ret)
return ret;
}
ret = kcm_ccache_destroy(context, ccache->name);
if (ret == 0) {
/* don't leave any events dangling */
kcm_cleanup_events(context, ccache);
}
kcm_release_ccache(context, &ccache);
return ret;
return kcm_ccache_destroy(context, name);
}
krb5_error_code
@@ -142,12 +135,13 @@ kcm_ccache_new_client(krb5_context context,
/* bind to current client */
ccache->uid = client->uid;
ccache->gid = client->gid;
ccache->session = client->session;
} else {
ret = kcm_zero_ccache_data(context, ccache);
if (ret) {
kcm_log(1, "Failed to empty cache %s: %s",
name, krb5_get_err_text(context, ret));
kcm_release_ccache(context, &ccache);
kcm_release_ccache(context, ccache);
return ret;
}
kcm_cleanup_events(context, ccache);
@@ -155,7 +149,7 @@ kcm_ccache_new_client(krb5_context context,
ret = kcm_access(context, client, KCM_OP_INITIALIZE, ccache);
if (ret) {
kcm_release_ccache(context, &ccache);
kcm_release_ccache(context, ccache);
kcm_ccache_destroy(context, name);
return ret;
}