Uh oh!
There was an error while loading. Please reload this page.
Bugfix: user is not allowed - #15187
Conversation
The created user don't has permission to connect to database. I changed the code to give permission Signed-off-by: Vitor Mattos <vitor@php.rio>
1157db1 to
824cc0aCompareSigned-off-by: Vitor Mattos <vitor@php.rio>
vitormattos
commented
Apr 22, 2019
I believe that continuous integration is in trouble. The status is that it is still running. Another point is that the tests that broke in my PR are not influenced by my PR. |
Uh oh!
There was an error while loading. Please reload this page.
Signed-off-by: Vitor Mattos <vitor@php.rio>
vitormattos
commented
Apr 23, 2019
@shyim done! |
nickvergessen
left a comment
There was a problem hiding this comment.
Fine by me, but can't test
vitormattos
commented
May 6, 2019
Hello @nickvergessen! |
rullzer
commented
May 11, 2019
@icewind1991 mind to have a look and check? |
vitormattos
commented
Jun 3, 2019
Hello everybody! |
J0WI
commented
Jun 7, 2019
Can we plan this for the next release? nextcloud/docker#345 is a frequently discussed issue. |
kesselb
commented
Jun 7, 2019
@J0WI I don't like these create database / database user code. Would it be a problem for the docker images if we remove those? Nextcloud should use the database / database user provided. |
kesselb
left a comment
There was a problem hiding this comment.
Make sense 👍
I think you could move the logic into another method. There is already a createDatabase method. If the database already exist we drop all the permission there. You may add the grant statment to this method.
charlag
commented
Jun 7, 2019
In case it helps: I tried this little patch on my system and it finally worked. |
charlag
commented
Jun 7, 2019
I would also say that using credentials other than provided is super confusing and I was blaming the |
J0WI
commented
Jun 8, 2019
That's fine for Docker. It can already be created in the database container. |
Brightside56
commented
Jun 12, 2019
Oh... I see, power of opensource 👍 |
vitormattos
commented
Jun 25, 2019
@rullzer have any pending for me to do in this PR? |
Merge? I dont need to use volume ( of course DB is needed ) and this will not work, but it should work.. |
Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22 |
J0WI
commented
Aug 8, 2019
/backport to stable16 |
J0WI
commented
Aug 8, 2019
/backport to stable15 |
J0WI
commented
Aug 8, 2019
/backport to stable14 |
The backport to stable16 failed. Please do this backport manually. |
The backport to stable15 failed. Please do this backport manually. |
The backport to stable14 failed. Please do this backport manually. |
| $query = $connection->prepare("CREATE USER " . addslashes($this->dbUser) . " CREATEDB PASSWORD '" . addslashes($this->dbPassword) . "'"); | ||
| $query->execute(); | ||
| if ($this->databaseExists($connection)) { | ||
| $query = $connection->prepare('GRANT CONNECT ON DATABASE ' . addslashes($this->dbName) . ' TO '.addslashes($this->dbUser)); |
There was a problem hiding this comment.
Given that this is using ->prepare, shouldn't this be using ? and arguments instead of addslashes?
(https://www.php.net/addslashes -- "The addslashes() is sometimes incorrectly used to try to prevent SQL Injection. Instead, database-specific escaping functions and/or prepared statements should be used.")
I think this is one of the roots of what's being discussed over in docker-library/official-images#6252 (comment) (in PostgreSQL, - needs to be escaped, but addslashes won't do so, for example).
This reverts commit 4df6f79. The upstream bug has been fixed in nextcloud/server#15187
This reverts commit 4df6f79. The upstream bug has been fixed in nextcloud/server#15187 Signed-off-by: J0WI <J0WI@users.noreply.github.com>
This reverts commit 4df6f79. The upstream bug has been fixed in nextcloud/server#15187 Signed-off-by: J0WI <J0WI@users.noreply.github.com>
…cloud#961) This reverts commit 4df6f79. The upstream bug has been fixed in nextcloud/server#15187 Signed-off-by: J0WI <J0WI@users.noreply.github.com>
skjnldsv
commented
Apr 10, 2020
Please backport manually |
nickvergessen
commented
Apr 10, 2020
Not needed anymore as it is in 17+ and 16 goes EOL soon |
This reverts commit 4df6f79. The upstream bug has been fixed in nextcloud/server#15187 Signed-off-by: J0WI <J0WI@users.noreply.github.com>
The created user using PostgreSQL database don't has permission to connect to database.
I changed the code to give permission
resolve#11311