Skip to content

Commit

Permalink
Give correct user if hndl is used after auth error 8.0
Browse files Browse the repository at this point in the history
Signed-off-by: mohitkhullar <[email protected]>
  • Loading branch information
mohitkhullar committed Dec 24, 2024
1 parent 97df609 commit b6a0cf8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugins/newsql/newsql.c
Original file line number Diff line number Diff line change
Expand Up @@ -2170,9 +2170,6 @@ newsql_loop_result newsql_loop(struct sqlclntstate *clnt, CDB2SQLQUERY *sql_quer
if (sql_query->client_info->stack) {
clnt->stack = strdup(sql_query->client_info->stack);
}
if (sql_query->identity) {
clnt->externalAuthUser = sql_query->identity->principal;
}
}
if (clnt->rawnodestats == NULL) {
clnt->rawnodestats =
Expand Down Expand Up @@ -2263,9 +2260,12 @@ static void *newsql_get_authdata(struct sqlclntstate *clnt)
if (appdata) {
CDB2SQLQUERY *sql_query = appdata->sqlquery;
if (sql_query && sql_query->identity) {
clnt->externalAuthUser = sql_query->identity->principal;
if (externalMakeNewsqlAuthData) {
return externalMakeNewsqlAuthData(clnt->authdata, sql_query->identity);
}
} else {
clnt->externalAuthUser = NULL;
}
}
if (clnt->authdata) {
Expand Down

0 comments on commit b6a0cf8

Please sign in to comment.