Skip to content

Commit

Permalink
Revert "enable fdb auth by default 8.0"
Browse files Browse the repository at this point in the history
This reverts commit db9b6a0.

Signed-off-by: mohitkhullar <[email protected]>
  • Loading branch information
mohitkhullar committed Dec 2, 2024
1 parent 7be2427 commit 4b20468
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions db/db_access.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,10 @@ static int check_user_password(struct sqlclntstate *clnt)
int password_rc = 0;
int valid_user;

clnt->authdata = get_authdata(clnt);

if ((gbl_uses_externalauth || gbl_uses_externalauth_connect) &&
(externalComdb2AuthenticateUserMakeRequest || debug_switch_ignore_null_auth_func()) &&
!clnt->admin && !clnt->current_user.bypass_auth) {
clnt->authdata = get_authdata(clnt);
if (!clnt->authdata && clnt->secure && !gbl_allow_anon_id_for_spmux)
return reject_anon_id(clnt);
if (gbl_externalauth_warn && !clnt->authdata) {
Expand Down
2 changes: 1 addition & 1 deletion db/db_tunables.h
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ REGISTER_TUNABLE("foreign_db_push_remote", NULL, TUNABLE_BOOLEAN,
&gbl_fdb_push_remote, NOARG, NULL, NULL, NULL, NULL);
REGISTER_TUNABLE("foreign_db_push_redirect", "Redirect fdb query to run via client instead of on server. (Default: off)", TUNABLE_BOOLEAN,
&gbl_fdb_push_redirect_foreign, NOARG, NULL, NULL, NULL, NULL);
REGISTER_TUNABLE("foreign_db_auth_enabled", "Redirect extern auth data to remote server. (Default: on)",
REGISTER_TUNABLE("foreign_db_auth_enabled", "Redirect extern auth data to remote server. (Default: off)",
TUNABLE_BOOLEAN, &gbl_fdb_auth_enabled, NOARG, NULL, NULL, NULL, NULL);
REGISTER_TUNABLE("fullrecovery", "Attempt to run database "
"recovery from the beginning of "
Expand Down
2 changes: 1 addition & 1 deletion db/fdb_fend.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ int gbl_fdb_incoherence_percentage = 0;
int gbl_fdb_io_error_retries = 16;
int gbl_fdb_io_error_retries_phase_1 = 6;
int gbl_fdb_io_error_retries_phase_2_poll = 100;
int gbl_fdb_auth_enabled = 1;
int gbl_fdb_auth_enabled = 0;

struct fdb_tbl;
struct fdb;
Expand Down
2 changes: 1 addition & 1 deletion db/fdb_push.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ int handle_fdb_push(struct sqlclntstate *clnt, struct errstat *err)
return -1;
}

if (gbl_fdb_auth_enabled && externalComdb2getAuthIdBlob)
if (gbl_uses_externalauth && gbl_fdb_auth_enabled && externalComdb2getAuthIdBlob)
cdb2_setIdentityBlob(hndl, externalComdb2getAuthIdBlob(clnt->authdata));

rc = cdb2_run_statement(hndl, clnt->sql);
Expand Down
2 changes: 1 addition & 1 deletion plugins/remsql/fdb_comm.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ extern int gbl_fdb_auth_enabled;

static int fdb_auth_enabled()
{
return gbl_fdb_auth_enabled;
return (gbl_fdb_auth_enabled && gbl_uses_externalauth);
}

/* matches fdb_svc_callback_t callbacks */
Expand Down
2 changes: 1 addition & 1 deletion tests/tunables.test/t00_all_tunables.expected
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@
(name='force_old_cursors', description='Replicant will use old cursors', type='BOOLEAN', value='OFF', read_only='N')
(name='force_writesql', description='Force admin mode to for write sql. (Default: on)', type='BOOLEAN', value='ON', read_only='N')
(name='foreign_db_allow_cross_class', description='', type='BOOLEAN', value='OFF', read_only='Y')
(name='foreign_db_auth_enabled', description='Redirect extern auth data to remote server. (Default: on)', type='BOOLEAN', value='ON', read_only='N')
(name='foreign_db_auth_enabled', description='Redirect extern auth data to remote server. (Default: off)', type='BOOLEAN', value='OFF', read_only='N')
(name='foreign_db_push_redirect', description='Redirect fdb query to run via client instead of on server. (Default: off)', type='BOOLEAN', value='OFF', read_only='N')
(name='foreign_db_push_remote', description='', type='BOOLEAN', value='OFF', read_only='N')
(name='foreign_db_resolve_local', description='', type='BOOLEAN', value='OFF', read_only='Y')
Expand Down

0 comments on commit 4b20468

Please sign in to comment.