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 include/libnfs-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 4 additions & 0 deletions lib/libnfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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.
*
Expand Down
7 changes: 7 additions & 0 deletions lib/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -1301,6 +1304,10 @@ rpc_auth_needs_refresh(struct rpc_context *rpc)
return FALSE;
}

if (strcmp(rpc->auth_context.auth_type, "AzAuthAAD") != 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this line ?

return FALSE;
}

/*
* If auth type is AzAuthNone, we should not do a token refresh as it is
* not required.
Expand Down