diff --git a/src/plugins/auth/munge/auth_munge.c b/src/plugins/auth/munge/auth_munge.c index fa8f4d365de7eea6fe72cedb37cb84a31d159ac7..cc5a61cedb1ac1400ad52fb4eb6b99c3227dca2b 100644 --- a/src/plugins/auth/munge/auth_munge.c +++ b/src/plugins/auth/munge/auth_munge.c @@ -53,6 +53,7 @@ #include <stdio.h> #include <stdlib.h> +#include <arpa/inet.h> #include <munge.h> @@ -95,11 +96,9 @@ typedef struct _slurm_auth_credential { * Munge info structure for print* function */ typedef struct munge_info { + struct in_addr addr; time_t encoded; time_t decoded; - munge_cipher_t cipher; - munge_mac_t mac; - munge_zip_t zip; } munge_info_t; @@ -509,6 +508,11 @@ cred_info_create(munge_ctx_t ctx) munge_err_t e; munge_info_t *mi = cred_info_alloc(); + e = munge_ctx_get(ctx, MUNGE_OPT_ADDR4, &mi->addr); + if (e != EMUNGE_SUCCESS) + error ("auth_munge: Unable to retrieve origin addr: %s", + munge_ctx_strerror(ctx)); + e = munge_ctx_get(ctx, MUNGE_OPT_ENCODE_TIME, &mi->encoded); if (e != EMUNGE_SUCCESS) error ("auth_munge: Unable to retrieve encode time: %s", @@ -519,21 +523,6 @@ cred_info_create(munge_ctx_t ctx) error ("auth_munge: Unable to retrieve decode time: %s", munge_ctx_strerror(ctx)); - e = munge_ctx_get(ctx, MUNGE_OPT_CIPHER_TYPE, &mi->cipher); - if (e != EMUNGE_SUCCESS) - error ("auth_munge: Unable to retrieve cipher type: %s", - munge_ctx_strerror(ctx)); - - e = munge_ctx_get(ctx, MUNGE_OPT_MAC_TYPE, &mi->mac); - if (e != EMUNGE_SUCCESS) - error ("auth_munge: Unable to retrieve mac type: %s", - munge_ctx_strerror(ctx)); - - e = munge_ctx_get(ctx, MUNGE_OPT_ZIP_TYPE, &mi->zip); - if (e != EMUNGE_SUCCESS) - error ("auth_munge: Unable to retrieve zip type: %s", - munge_ctx_strerror(ctx)); - return mi; } @@ -545,27 +534,18 @@ static void _print_cred_info(munge_info_t *mi) { char buf[256]; + char addrbuf[INET_ADDRSTRLEN]; xassert(mi != NULL); - if (mi->encoded > 0) { + if (inet_ntop(AF_INET, &mi->addr, addrbuf, sizeof(addrbuf))) + info ("ORIGIN: %s", addrbuf); + + if (mi->encoded > 0) info ("ENCODED: %s", ctime_r(&mi->encoded, buf)); - } - if (mi->decoded > 0) { + + if (mi->decoded > 0) info ("DECODED: %s", ctime_r(&mi->decoded, buf)); - } - if (munge_enum_is_valid(MUNGE_ENUM_CIPHER, mi->cipher)) { - info ("CIPHER: %s", - munge_enum_int_to_str(MUNGE_ENUM_CIPHER, mi->cipher)); - } - if (munge_enum_is_valid(MUNGE_ENUM_MAC, mi->mac)) { - info ("MAC: %s", - munge_enum_int_to_str(MUNGE_ENUM_MAC, mi->mac)); - } - if (munge_enum_is_valid(MUNGE_ENUM_ZIP, mi->zip)) { - info ("ZIP: %s", - munge_enum_int_to_str(MUNGE_ENUM_ZIP, mi->zip)); - } }