Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/kerberosbasic.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
**/

#include <krb5.h>
#include <gssapi/gssapi.h>
#include <gssapi/gssapi_generic.h>
#include <gssapi/gssapi_krb5.h>

#define krb5_get_err_text(context,code) error_message(code)
Expand Down
8 changes: 5 additions & 3 deletions src/kerberosgss.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ char* server_principal_details(const char* service, const char* hostname)
int code;
krb5_context kcontext;
krb5_keytab kt = NULL;
krb5_kt_cursor cursor = NULL;
krb5_kt_cursor cursor;
int seq_get_started = 0;
krb5_keytab_entry entry;
char* pname = NULL;

Expand Down Expand Up @@ -68,6 +69,7 @@ char* server_principal_details(const char* service, const char* hostname)
goto end;
}

seq_get_started = 1;
while ((code = krb5_kt_next_entry(kcontext, kt, &entry, &cursor)) == 0)
{
if ((code = krb5_unparse_name(kcontext, entry.principal, &pname)))
Expand Down Expand Up @@ -97,7 +99,7 @@ char* server_principal_details(const char* service, const char* hostname)
}

end:
if (cursor)
if (seq_get_started)
krb5_kt_end_seq_get(kcontext, kt, &cursor);
if (kt)
krb5_kt_close(kcontext, kt);
Expand Down Expand Up @@ -130,7 +132,7 @@ int authenticate_gss_client_init(const char* service, const char* principal, lon
if (strchr(service, '/'))
mech = GSS_C_NO_OID;
else
mech = gss_krb5_nt_service_name;
mech = GSS_KRB5_NT_PRINCIPAL_NAME;

maj_stat = gss_import_name(&min_stat, &name_token, mech, &state->server_name);

Expand Down
2 changes: 1 addition & 1 deletion src/kerberosgss.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
* limitations under the License.
**/

#include <krb5.h>
#include <gssapi/gssapi.h>
#include <gssapi/gssapi_generic.h>
#include <gssapi/gssapi_krb5.h>
#ifdef GSSAPI_EXT
#include <gssapi/gssapi_ext.h>
Expand Down
2 changes: 1 addition & 1 deletion src/kerberospw.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
*
**/

#include <krb5.h>
#include <gssapi/gssapi.h>
#include <gssapi/gssapi_generic.h>
#include <gssapi/gssapi_krb5.h>

#define krb5_get_err_text(context,code) error_message(code)
Expand Down