-
Notifications
You must be signed in to change notification settings - Fork 21
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
fix: handle errors if domain socket file is invalid #164
Conversation
The default Unix domain socket file should be in /var/run/postgresql/
The official default directory for Unix domain sockets is /tmp. This is changed by some distributions to /var/run/postgresql, but that is not very convenient for PGAdapter, as it would require elevated permissions to be able to write anything there.
Codecov Report
@@ Coverage Diff @@
## postgresql-dialect #164 +/- ##
========================================================
+ Coverage 77.51% 77.64% +0.12%
- Complexity 953 958 +5
========================================================
Files 85 85
Lines 3260 3283 +23
Branches 380 384 +4
========================================================
+ Hits 2527 2549 +22
+ Misses 579 578 -1
- Partials 154 156 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
…udPlatform/pgadapter into fix-default-domain-socket-file
The default Unix domain socket file is in the directory
/tmp/
, but some PostgreSQL distributions use/var/run/postgresql/
as the default directory. If anyone tries to change the directory that should be used by PGAdapter to/var/run/postgresql/
, the probability is very high that it will cause a permission denied error when PGAdapter tries to write to that directory. This PR adds error handling for the case that a user specifies an invalid or inaccessible file for Unix domain sockets.Also adds additional tests for Unix domain sockets, and changes some of the psql tests to use domain sockets to connect instead of TCP, to verify that our domain sockets implementation also works with psql.