Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/private/Setup/MySQL.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ private function createSpecificUser(string $username, IDBConnection $connection)

//we don't have a dbuser specified in config
if ($this->dbUser !== $oldUser) {
//add prefix to the admin username to prevent collisions
$adminUser = substr('oc_' . $username, 0, 16);
//cap to 16 characters
$adminUser = substr($username, 0, 16);

$i = 1;
while (true) {
Expand All @@ -169,7 +169,7 @@ private function createSpecificUser(string $username, IDBConnection $connection)
} else {
//repeat with different username
$length = strlen((string)$i);
$adminUser = substr('oc_' . $username, 0, 16 - $length) . $i;
$adminUser = substr($username, 0, 16 - $length) . $i;
$i++;
}
}
Expand Down
Loading