Repository navigation
fix: handle errors if domain socket file is invalid - #164
Merged
Merged
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.
|
olavloite
marked this pull request as ready for review
May 25, 2022 15:41
…udPlatform/pgadapter into fix-default-domain-socket-file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.