Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error if nonsuperuser #15

Open
vut12 opened this issue Feb 1, 2023 · 1 comment
Open

Error if nonsuperuser #15

vut12 opened this issue Feb 1, 2023 · 1 comment

Comments

@vut12
Copy link

vut12 commented Feb 1, 2023

CREATE USER MAPPING FOR map_t SERVER myserver OPTIONS(password 'ZAQ!xsw2', username 'info_user');

when execute "select * from foreign_table" i get error.
debug log:

DEBUG:  StartTransaction(1) name: unnamed; blockState: DEFAULT; state: INPROGRESS, xid/subid/cid: 0/1/0
DEBUG:  In jdbcGetForeignRelSize
DEBUG:  Added server = test to hashtable
DEBUG:  In jq_connect_db_params
DEBUG:  In jdbc_jvm_init
DEBUG:  JVMEnvStat: JNI_EDETACHED; the current thread is not attached to the VM
DEBUG:  In jdbc_attach_jvm
DEBUG:  In jdbc_create_JDBC_connection
DEBUG:  Created a JDBC connection: jdbc:sap://localhost:31015
DEBUG:  In jq_connection_used_password
DEBUG:  In jq_finish for conn=0xfa73c0
DEBUG:  In jdbc_detach_jvm
ERROR:  password is required
DETAIL:  Non-superuser cannot connect if the server does not request a password.
HINT:  Target server's authentication method must be changed.

we check password here

jdbc_check_conn_params(keywords, values);

then check again (for non-superuser all conditions true. jq_connection_used_password always return 0)
if (!superuser() && !jq_connection_used_password(conn))

@sklenarikr
Copy link

I think, the jq_connection_used_password function isn't developed yet. There is simple return 0 without any test.
And the place of the check in connection.c is also curious.

jan-zajic added a commit to corpus-solutions/jdbc_fdw that referenced this issue Jul 14, 2023
jan-zajic added a commit to corpus-solutions/jdbc_fdw that referenced this issue Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants