fix(core): remove duplicate MySQL user prefix#59514
Open
Conversation
a3e51f3 to
29fe029
Compare
29fe029 to
37f0f54
Compare
PR #53212 implemented a hardcoded database username, instead of deriving it from the Nextcloud admin username, to be able to setup Nextcloud without admin user. This has the additional benefit that knowing one of them does not allow to derive the other. However, it used `oc_admin`, while the MySQL database setup adds `oc_` again in the dedicated `createSpecificUser()` function, resulting in `oc_oc_admin`. In case of PostgreSQL, this was done in `setupDatabase()`, replaced with the hardcoded username. Signed-off-by: MichaIng <micha@dietpi.com>
37f0f54 to
fd046ed
Compare
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.
Summary
PR #53212 implemented a hardcoded database username, instead of deriving it from the Nextcloud admin username, to be able to setup Nextcloud without admin user. This has the additional benefit that knowing one of them does not allow to derive the other.
However, it used
oc_admin, while the MySQL database setup addsoc_again in the dedicatedcreateSpecificUser()function, resulting inoc_oc_admin. In case of PostgreSQL, this was done insetupDatabase(), replaced with the hardcoded username.I kept the 16 characters limit, not sure whether this is still needed. The function is actually called only internally, only in this very script, so it should never see any other value than
oc_admin. Let me know if I should remove the 0-16 substring, along with the confusing$adminUservariable (since this user is neither the database admin, nor the Nextcloud admin).TODO
Checklist
3. to review, feature component)stable32)AI (if applicable)