From e50cdeb1a7e5dfd685e1d5f17046db19b1aff471 Mon Sep 17 00:00:00 2001 From: Pragya Gandhi Date: Fri, 19 Sep 2025 10:26:16 +0000 Subject: [PATCH] Changes --- include/libnfs-private.h | 2 +- lib/libnfs.c | 4 ++++ lib/socket.c | 7 +++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/include/libnfs-private.h b/include/libnfs-private.h index 5e7272c4..030c55b7 100644 --- a/include/libnfs-private.h +++ b/include/libnfs-private.h @@ -292,7 +292,7 @@ struct auth_context { /* /account/container for which the token is required */ char *export_path; - /* AuthType, currently only AzAuthAAD is supported */ + /* AuthType, currently only AzAuthAAD and AzAuthNone is supported */ char *auth_type; /* Version of the client which initiates the auth request */ diff --git a/lib/libnfs.c b/lib/libnfs.c index f3c26249..798a1175 100755 --- a/lib/libnfs.c +++ b/lib/libnfs.c @@ -1151,6 +1151,7 @@ rpc_connect_program_4_cb(struct rpc_context *rpc, int status, (rpc->wanted_xprtsec == RPC_XPRTSEC_TLS || rpc->wanted_xprtsec == RPC_XPRTSEC_MTLS); if (rpc->use_tls) { + RPC_LOG(rpc, 2, "Securing connection with TLS [lOG ADDED]"); /* We should not use TLS for anything other than NFS */ assert(data->program == NFS_PROGRAM); @@ -1171,6 +1172,9 @@ rpc_connect_program_4_cb(struct rpc_context *rpc, int status, #ifdef ENABLE_INSECURE_AUTH_FOR_DEVTEST if (rpc->use_azauth) { + + RPC_LOG(rpc, 2, "Performing AZAUTH over insecure connection " + "[lOG ADDED]"); /* * Insecure connection, if azauth is enabled perform auth. * diff --git a/lib/socket.c b/lib/socket.c index e48c2226..7e51a556 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -383,6 +383,7 @@ rpc_write_to_socket(struct rpc_context *rpc) */ if (rpc->use_azauth && !rpc->auth_context.is_authorized && + strcmp(rpc->auth_context.auth_type, "AzAuthAAD") == 0 && !pdu->is_head_prio) { RPC_LOG(rpc, 2, "Not sending queued RPC pdu %p as " "connection is not authorized", pdu); @@ -785,7 +786,9 @@ rpc_read_from_socket(struct rpc_context *rpc) } if (rpc->buf) { + RPC_LOG(rpc, 5, "Reading %d bytes into %p", count, rpc->buf); count = recv(rpc->fd, rpc->buf, count, MSG_DONTWAIT); + RPC_LOG(rpc, 5, "Reading %d bytes into %p log after", count, rpc->buf); } else { assert(rpc->pdu->in.iovcnt > 0); assert(count <= rpc->pdu->in.remaining_size); @@ -1301,6 +1304,10 @@ rpc_auth_needs_refresh(struct rpc_context *rpc) return FALSE; } + if (strcmp(rpc->auth_context.auth_type, "AzAuthAAD") != 0) { + return FALSE; + } + /* * If auth type is AzAuthNone, we should not do a token refresh as it is * not required.