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

[YSQL] ysql_hba_conf field values that contain the line separator "," get improperly formatted in the resulting ysql_hba_conf file #5459

Closed
ajcaldera1 opened this issue Aug 21, 2020 · 0 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL)
Milestone

Comments

@ajcaldera1
Copy link
Contributor

There are some values such as ldapsuffix, ldapurl, and ldapbasedn that could be contained in the GFlag --ysql_hba_conf that cause an erroneous ysql_hba.conf file to be produced. If there are erroneous entries in that file the postgres front-end "postmaster" will fail to start.

Here are some examples from the PG documentation:

Simple bind config:

host ... ldap ldapserver=ldap.example.net ldapprefix="cn=" ldapsuffix=", dc=example, dc=net"

Search+bind written as url string:

host ... ldap ldapurl="ldap://ldap.example.net/dc=example,dc=net?uid?sub"

Another search+bind example with filter:

host ... ldap ldapserver=ldap.example.net ldapbasedn="dc=example, dc=net" ldapsearchfilter="(|(uid=$username)(mail=$username))"
@ajcaldera1 ajcaldera1 added the area/ysql Yugabyte SQL (YSQL) label Aug 21, 2020
@ajcaldera1 ajcaldera1 added this to the v2.2.x milestone Aug 21, 2020
@ndeodhar ndeodhar assigned m-iancu and unassigned ndeodhar Aug 22, 2020
d-uspenskiy added a commit that referenced this issue Oct 29, 2020
Summary:
Include support in all default builds for:

- LDAP Authentication (by including ldap lib in the build)
- UUID (by including uuid-ossp extension with e2fs implementation)

Additional change:
Add `ysql_pg_conf_csv`/`ysql_hba_conf_csv` flags as substitutions for deprecated `ysql_pg_conf` and `ysql_hba_conf`.
Example how to start the cluster with LDAP authentication

```
./bin/yb-ctl start --ysql_hba_conf_csv='host all yugabyte 127.0.0.1/0 password,"host   all         all      0.0.0.0/0  ldap ldapserver=ldap.forumsys.com ldapprefix=""uid="" ldapsuffix="", dc=example, dc=com"" ldapport=389"'
```

Test Plan:
Jenkins:
Existing tests, additional tests in:

TestPgRegressExtension (yb_extensions),

Reviewers: sanketh, mihnea

Reviewed By: mihnea

Subscribers: mikhail, rskannan, yql

Differential Revision: https://phabricator.dev.yugabyte.com/D9692
m-iancu pushed a commit that referenced this issue Nov 1, 2020
…in default builds

Summary:
Include support in all default builds for:

- LDAP Authentication (by including ldap lib in the build)
- UUID (by including uuid-ossp extension with e2fs implementation)

Additional change:
Add `ysql_pg_conf_csv`/`ysql_hba_conf_csv` flags as substitutions for deprecated `ysql_pg_conf` and `ysql_hba_conf`.
Example how to start the cluster with LDAP authentication

```
./bin/yb-ctl start --ysql_hba_conf_csv='host all yugabyte 127.0.0.1/0 password,"host   all         all      0.0.0.0/0  ldap ldapserver=ldap.forumsys.com ldapprefix=""uid="" ldapsuffix="", dc=example, dc=com"" ldapport=389"'
```

Test Plan:
Jenkins: rebase: 2.3
Existing tests, additional tests in:

TestPgRegressExtension (yb_extensions),

Reviewers: sanketh, dmitry, rskannan

Reviewed By: rskannan

Subscribers: yql, rskannan, mikhail

Differential Revision: https://phabricator.dev.yugabyte.com/D9787
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL)
Projects
None yet
Development

No branches or pull requests

3 participants