Skip to content

Commit

Permalink
mechglue: add trace debugging
Browse files Browse the repository at this point in the history
This is enabled via --with-gssidebug.

Signed-off-by: Simo Sorce <simo@redhat.com>
  • Loading branch information
Günther Deschner authored and simo5 committed Mar 14, 2013
1 parent 9fd4d3a commit 25e52de
Show file tree
Hide file tree
Showing 13 changed files with 146 additions and 0 deletions.
14 changes: 14 additions & 0 deletions proxy/conf_macros.m4
Expand Up @@ -219,3 +219,17 @@ AC_DEFUN([WITH_CC_PATH],
AC_DEFINE_UNQUOTED(CCACHE_PATH, "$config_ccpath", [Where to store ccache files for gssproxy])
])

AC_DEFUN([WITH_GSSIDEBUG],
[ AC_ARG_WITH([gssidebug],
[AC_HELP_STRING([--with-gssidebug],
[Whether to build with interposer debugging support [no]]
)
],
[],
with_gssidebug=no
)
if test x"$with_gssidebug" = xyes; then
AC_DEFINE_UNQUOTED(GSSI_DEBUGGING, 1, [Build with interposer debugging support])
fi
])

1 change: 1 addition & 0 deletions proxy/configure.ac
Expand Up @@ -65,6 +65,7 @@ WITH_TEST_DIR
WITH_MANPAGES
WITH_XML_CATALOG
WITH_SELINUX
WITH_GSSIDEBUG

m4_include([external/pkg.m4])
m4_include([external/libpopt.m4])
Expand Down
2 changes: 2 additions & 0 deletions proxy/src/mechglue/gpp_accept_sec_context.c
Expand Up @@ -44,6 +44,8 @@ OM_uint32 gssi_accept_sec_context(OM_uint32 *minor_status,
struct gpp_name_handle *name = NULL;
OM_uint32 maj, min;

GSSI_TRACE();

behavior = gpp_get_behavior();

if (*context_handle) {
Expand Down
6 changes: 6 additions & 0 deletions proxy/src/mechglue/gpp_acquire_cred.c
Expand Up @@ -83,6 +83,8 @@ OM_uint32 gssi_acquire_cred(OM_uint32 *minor_status,
OM_uint32 maj, min;
OM_uint32 tmaj, tmin;

GSSI_TRACE();

if (!output_cred_handle) {
*minor_status = gpp_map_error(EINVAL);
return GSS_S_FAILURE;
Expand Down Expand Up @@ -175,6 +177,8 @@ OM_uint32 gssi_add_cred(OM_uint32 *minor_status,
OM_uint32 time_req, time_rec;
OM_uint32 maj, min;

GSSI_TRACE();

if (!output_cred_handle) {
return GSS_S_CALL_INACCESSIBLE_WRITE;
}
Expand Down Expand Up @@ -250,6 +254,8 @@ OM_uint32 gssi_acquire_cred_with_password(OM_uint32 *minor_status,
gss_OID_set special_mechs;
OM_uint32 maj, min;

GSSI_TRACE();

name = (struct gpp_name_handle *)desired_name;

if (!output_cred_handle) {
Expand Down
19 changes: 19 additions & 0 deletions proxy/src/mechglue/gpp_context.c
Expand Up @@ -35,6 +35,8 @@ OM_uint32 gssi_export_sec_context(OM_uint32 *minor_status,
gss_buffer_desc output_token;
OM_uint32 maj, min;

GSSI_TRACE();

ctx = (struct gpp_context_handle *)context_handle;
if (!ctx) {
return GSS_S_CALL_INACCESSIBLE_READ;
Expand Down Expand Up @@ -64,6 +66,7 @@ OM_uint32 gssi_import_sec_context(OM_uint32 *minor_status,
gss_buffer_t interprocess_token,
gss_ctx_id_t *context_handle)
{
GSSI_TRACE();
return GSS_S_UNAVAILABLE;
}

Expand All @@ -78,6 +81,8 @@ OM_uint32 gssi_import_sec_context_by_mech(OM_uint32 *minor_status,
OM_uint32 maj, min = 0;
uint32_t len;

GSSI_TRACE();

ctx = calloc(1, sizeof(struct gpp_context_handle));
if (!ctx) {
*minor_status = 0;
Expand Down Expand Up @@ -128,6 +133,8 @@ OM_uint32 gssi_process_context_token(OM_uint32 *minor_status,
struct gpp_context_handle *ctx;
OM_uint32 maj, min;

GSSI_TRACE();

ctx = (struct gpp_context_handle *)context_handle;
if (!ctx) {
return GSS_S_CALL_INACCESSIBLE_READ;
Expand All @@ -153,6 +160,8 @@ OM_uint32 gssi_context_time(OM_uint32 *minor_status,
struct gpp_context_handle *ctx;
OM_uint32 maj, min;

GSSI_TRACE();

*minor_status = 0;

ctx = (struct gpp_context_handle *)context_handle;
Expand Down Expand Up @@ -201,6 +210,8 @@ OM_uint32 gssi_inquire_context(OM_uint32 *minor_status,
gss_OID mech_oid;
OM_uint32 maj, min;

GSSI_TRACE();

if (!context_handle) {
return GSS_S_CALL_INACCESSIBLE_READ;
}
Expand Down Expand Up @@ -291,6 +302,8 @@ OM_uint32 gssi_inquire_sec_context_by_oid(OM_uint32 *minor_status,
struct gpp_context_handle *ctx;
OM_uint32 maj, min;

GSSI_TRACE();

ctx = (struct gpp_context_handle *)context_handle;
if (!ctx) {
return GSS_S_CALL_INACCESSIBLE_READ;
Expand Down Expand Up @@ -318,6 +331,8 @@ OM_uint32 gssi_set_sec_context_option(OM_uint32 *minor_status,
struct gpp_context_handle *ctx;
OM_uint32 maj, min;

GSSI_TRACE();

if (context_handle) {
ctx = (struct gpp_context_handle *)context_handle;
} else {
Expand Down Expand Up @@ -354,6 +369,8 @@ OM_uint32 gssi_delete_sec_context(OM_uint32 *minor_status,
OM_uint32 maj, min;
OM_uint32 rmaj = GSS_S_COMPLETE;

GSSI_TRACE();

ctx = (struct gpp_context_handle *)*context_handle;

*context_handle = GSS_C_NO_CONTEXT;
Expand Down Expand Up @@ -387,6 +404,8 @@ OM_uint32 gssi_pseudo_random(OM_uint32 *minor_status,
struct gpp_context_handle *ctx;
OM_uint32 maj, min;

GSSI_TRACE();

ctx = (struct gpp_context_handle *)context_handle;
if (!ctx) {
return GSS_S_CALL_INACCESSIBLE_READ;
Expand Down
17 changes: 17 additions & 0 deletions proxy/src/mechglue/gpp_creds.c
Expand Up @@ -126,6 +126,8 @@ OM_uint32 gssi_inquire_cred(OM_uint32 *minor_status,
struct gpp_name_handle *gpname = NULL;
OM_uint32 maj, min;

GSSI_TRACE();

if (cred_handle == GSS_C_NO_CREDENTIAL) {
maj = gppint_get_def_creds(&min, gpp_get_behavior(), NULL,
GSS_C_INITIATE, &cred);
Expand Down Expand Up @@ -183,6 +185,8 @@ OM_uint32 gssi_inquire_cred_by_mech(OM_uint32 *minor_status,
struct gpp_name_handle *gpname = NULL;
OM_uint32 maj, min;

GSSI_TRACE();

if (cred_handle == GSS_C_NO_CREDENTIAL) {
maj = gppint_get_def_creds(&min, gpp_get_behavior(), NULL,
GSS_C_INITIATE, &cred);
Expand Down Expand Up @@ -239,6 +243,8 @@ OM_uint32 gssi_inquire_cred_by_oid(OM_uint32 *minor_status,
struct gpp_cred_handle *cred = NULL;
OM_uint32 maj, min;

GSSI_TRACE();

*minor_status = 0;
if (cred_handle == GSS_C_NO_CREDENTIAL) {
return GSS_S_CALL_INACCESSIBLE_READ;
Expand Down Expand Up @@ -266,6 +272,8 @@ OM_uint32 gssi_set_cred_option(OM_uint32 *minor_status,
struct gpp_cred_handle *cred = NULL;
OM_uint32 maj, min;

GSSI_TRACE();

*minor_status = 0;
if (*cred_handle == GSS_C_NO_CREDENTIAL) {
return GSS_S_CALL_INACCESSIBLE_READ;
Expand Down Expand Up @@ -295,6 +303,8 @@ OM_uint32 gssi_store_cred(OM_uint32 *minor_status,
struct gpp_cred_handle *cred = NULL;
OM_uint32 maj, min;

GSSI_TRACE();

*minor_status = 0;
if (input_cred_handle == GSS_C_NO_CREDENTIAL) {
return GSS_S_CALL_INACCESSIBLE_READ;
Expand Down Expand Up @@ -322,6 +332,8 @@ OM_uint32 gssi_release_cred(OM_uint32 *minor_status,
OM_uint32 maj, min;
OM_uint32 rmaj = GSS_S_COMPLETE;

GSSI_TRACE();

if (*cred_handle == GSS_C_NO_CREDENTIAL) {
*minor_status = 0;
return GSS_S_COMPLETE;
Expand Down Expand Up @@ -355,6 +367,8 @@ OM_uint32 gssi_export_cred(OM_uint32 *minor_status,
{
struct gpp_cred_handle *cred;

GSSI_TRACE();

cred = (struct gpp_cred_handle *)cred_handle;
if (!cred) {
return GSS_S_CALL_INACCESSIBLE_READ;
Expand All @@ -373,6 +387,7 @@ OM_uint32 gssi_import_cred(OM_uint32 *minor_status,
gss_buffer_t token,
gss_cred_id_t *cred_handle)
{
GSSI_TRACE();
return GSS_S_UNAVAILABLE;
}

Expand All @@ -387,6 +402,8 @@ OM_uint32 gssi_import_cred_by_mech(OM_uint32 *minor_status,
OM_uint32 maj, min = 0;
uint32_t len;

GSSI_TRACE();

cred = calloc(1, sizeof(struct gpp_cred_handle));
if (!cred) {
*minor_status = 0;
Expand Down
2 changes: 2 additions & 0 deletions proxy/src/mechglue/gpp_display_status.c
Expand Up @@ -34,6 +34,8 @@ OM_uint32 gssi_display_status(OM_uint32 *minor_status,
{
OM_uint32 maj, min, val;

GSSI_TRACE();

/* This function is only ever called for minor status values */
if (status_type != GSS_C_MECH_CODE) {
return GSS_S_BAD_STATUS;
Expand Down
25 changes: 25 additions & 0 deletions proxy/src/mechglue/gpp_import_and_canon_name.c
Expand Up @@ -33,6 +33,8 @@ OM_uint32 gssi_display_name(OM_uint32 *minor_status,
struct gpp_name_handle *name;
OM_uint32 maj, min = 0;

GSSI_TRACE();

name = (struct gpp_name_handle *)input_name;
if (!name->local && !name->remote) {
return GSS_S_BAD_NAME;
Expand Down Expand Up @@ -62,6 +64,8 @@ OM_uint32 gssi_display_name_ext(OM_uint32 *minor_status,
struct gpp_name_handle *name;
OM_uint32 maj, min = 0;

GSSI_TRACE();

name = (struct gpp_name_handle *)input_name;
if (!name->local && !name->remote) {
return GSS_S_BAD_NAME;
Expand All @@ -86,6 +90,7 @@ OM_uint32 gssi_import_name(OM_uint32 *minor_status,
gss_OID input_name_type,
gss_name_t *output_name)
{
GSSI_TRACE();
return GSS_S_UNAVAILABLE;
}

Expand All @@ -98,6 +103,8 @@ OM_uint32 gssi_import_name_by_mech(OM_uint32 *minor_status,
struct gpp_name_handle *name;
OM_uint32 maj, min = 0;

GSSI_TRACE();

if (mech_type == GSS_C_NO_OID) {
return GSS_S_CALL_INACCESSIBLE_READ;
}
Expand Down Expand Up @@ -144,6 +151,8 @@ OM_uint32 gssi_export_name(OM_uint32 *minor_status,
struct gpp_name_handle *name;
OM_uint32 maj, min = 0;

GSSI_TRACE();

name = (struct gpp_name_handle *)input_name;
if (!name->local && !name->remote) {
return GSS_S_BAD_NAME;
Expand All @@ -166,6 +175,8 @@ OM_uint32 gssi_export_name_composite(OM_uint32 *minor_status,
struct gpp_name_handle *name;
OM_uint32 maj, min = 0;

GSSI_TRACE();

name = (struct gpp_name_handle *)input_name;
if (!name->local && !name->remote) {
return GSS_S_BAD_NAME;
Expand All @@ -191,6 +202,8 @@ OM_uint32 gssi_duplicate_name(OM_uint32 *minor_status,
struct gpp_name_handle *out_name;
OM_uint32 maj, min = 0;

GSSI_TRACE();

in_name = (struct gpp_name_handle *)input_name;
if (!in_name->local && !in_name->remote) {
return GSS_S_BAD_NAME;
Expand Down Expand Up @@ -239,6 +252,8 @@ OM_uint32 gssi_inquire_name(OM_uint32 *minor_status,
struct gpp_name_handle *name;
OM_uint32 maj, min = 0;

GSSI_TRACE();

name = (struct gpp_name_handle *)input_name;
if (!name->local && !name->remote) {
return GSS_S_BAD_NAME;
Expand Down Expand Up @@ -268,6 +283,8 @@ OM_uint32 gssi_release_name(OM_uint32 *minor_status,
struct gpp_name_handle *name;
OM_uint32 maj, min = 0;

GSSI_TRACE();

name = (struct gpp_name_handle *)*input_name;
if (!name->local && !name->remote) {
return GSS_S_BAD_NAME;
Expand Down Expand Up @@ -295,6 +312,8 @@ OM_uint32 gssi_compare_name(OM_uint32 *minor_status,
struct gpp_name_handle *gpname2;
OM_uint32 maj, min = 0;

GSSI_TRACE();

gpname1 = (struct gpp_name_handle *)name1;
gpname2 = (struct gpp_name_handle *)name2;

Expand Down Expand Up @@ -349,6 +368,8 @@ OM_uint32 gssi_get_name_attribute(OM_uint32 *minor_status,
struct gpp_name_handle *name;
OM_uint32 maj, min = 0;

GSSI_TRACE();

name = (struct gpp_name_handle *)input_name;
if (!name->local && !name->remote) {
return GSS_S_BAD_NAME;
Expand Down Expand Up @@ -376,6 +397,8 @@ OM_uint32 gssi_set_name_attribute(OM_uint32 *minor_status,
struct gpp_name_handle *name;
OM_uint32 maj, min = 0;

GSSI_TRACE();

name = (struct gpp_name_handle *)input_name;
if (!name->local && !name->remote) {
return GSS_S_BAD_NAME;
Expand All @@ -400,6 +423,8 @@ OM_uint32 gssi_delete_name_attribute(OM_uint32 *minor_status,
struct gpp_name_handle *name;
OM_uint32 maj, min = 0;

GSSI_TRACE();

name = (struct gpp_name_handle *)input_name;
if (!name->local && !name->remote) {
return GSS_S_BAD_NAME;
Expand Down
8 changes: 8 additions & 0 deletions proxy/src/mechglue/gpp_indicate_mechs.c
Expand Up @@ -28,6 +28,7 @@
/* This will never be called, added only for completeness */
OM_uint32 gssi_indicate_mechs(OM_uint32 *minor_status, gss_OID_set *mech_set)
{
GSSI_TRACE();
*minor_status = 0;
return GSS_S_FAILURE;
}
Expand All @@ -40,6 +41,8 @@ OM_uint32 gssi_inquire_names_for_mech(OM_uint32 *minor_status,
OM_uint32 tmaj, tmin;
OM_uint32 maj, min;

GSSI_TRACE();

behavior = gpp_get_behavior();
tmaj = GSS_S_COMPLETE;
tmin = 0;
Expand Down Expand Up @@ -91,6 +94,8 @@ OM_uint32 gssi_inquire_attrs_for_mech(OM_uint32 *minor_status,
OM_uint32 tmaj, tmin;
OM_uint32 maj, min;

GSSI_TRACE();

behavior = gpp_get_behavior();
tmaj = GSS_S_COMPLETE;
tmin = 0;
Expand Down Expand Up @@ -142,6 +147,8 @@ OM_uint32 gssi_inquire_saslname_for_mech(OM_uint32 *minor_status,
OM_uint32 tmaj, tmin;
OM_uint32 maj, min;

GSSI_TRACE();

behavior = gpp_get_behavior();
tmaj = GSS_S_COMPLETE;
tmin = 0;
Expand Down Expand Up @@ -191,6 +198,7 @@ OM_uint32 gssi_inquire_mech_for_saslname(OM_uint32 *minor_status,
const gss_buffer_t sasl_mech_name,
gss_OID *mech_type)
{
GSSI_TRACE();
/* FIXME: How to call into mechglue ? */
return GSS_S_UNAVAILABLE;
}

0 comments on commit 25e52de

Please sign in to comment.