Re: Migration von i-MSCP zu KeyHelp
Posted: Thu 19. May 2022, 08:33
Das offizielle KeyHelp Forum der Keyweb AG / The official KeyHelp forum of Keyweb AG
https://community.keyhelp.de/
Code: Select all
Traceback (most recent call last):
File "/root/i-mscp-keyhelp-migration/./i-mscp_keyhelp_migration.py", line 397, in <module>
keyhelpAddData.addHtAccessUsersFromImscp(keyhelpAddApiData)
File "/root/i-mscp-keyhelp-migration/_keyhelp.py", line 800, in addHtAccessUsersFromImscp
cursor.execute("INSERT INTO directory_protections (id_user, path, auth_name, username, password) VALUES ('" + str(
File "/usr/local/lib/python3.9/dist-packages/mysql/connector/cursor.py", line 551, in execute
self._handle_result(self._connection.cmd_query(stmt))
File "/usr/local/lib/python3.9/dist-packages/mysql/connector/connection.py", line 490, in cmd_query
result = self._handle_result(self._send_cmd(ServerCmd.QUERY, query))
File "/usr/local/lib/python3.9/dist-packages/mysql/connector/connection.py", line 395, in _handle_result
raise errors.get_exception(packet)
mysql.connector.errors.ProgrammingError: 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ']/0DlPjfC$mZxkpWVYs6C/fsfEyk7Fn/L.CViDYVvEXEJMcDzIsrGZ5t.pr1qaU.ON0TBkOl0Tzeu...' at line 1
Keine Sonderzeichen in Passwörtern.
Wenn nicht explizit drauf geparsed wurde: Ja. ' und " sind Stringbegrenzer, und jede Sprache reagiert da unterschiedlich drauf.
Oha, das kannte ich noch garnicht
Hallo,24unix wrote: ↑Sat 28. May 2022, 23:47Keine Sonderzeichen in Passwörtern.
Besonders " und ' sind immer kritisch.
Kann man nicht oft genug posten: https://xkcd.com/936/
Wenn nicht explizit drauf geparsed wurde: Ja. ' und " sind Stringbegrenzer, und jede Sprache reagiert da unterschiedlich drauf.
Sein lassen.
Das sind die Hashes der Passwörter, denen sieht man natürlich nicht an, ob die PW Umlaute haben.Viktor wrote: ↑Sun 29. May 2022, 13:46Hallo,24unix wrote: ↑Sat 28. May 2022, 23:47Keine Sonderzeichen in Passwörtern.
Besonders " und ' sind immer kritisch.
Kann man nicht oft genug posten: https://xkcd.com/936/
Wenn nicht explizit drauf geparsed wurde: Ja. ' und " sind Stringbegrenzer, und jede Sprache reagiert da unterschiedlich drauf.
Sein lassen.
oh aber woran sieht man das da Umlaute mit drin sind.
Muss ich alle mit "$6$rounds=" löschen oder hat das nichts damit zu tun.
Gruß
Viktor
Nein!!!Viktor wrote: ↑Sun 29. May 2022, 13:46Hallo,24unix wrote: ↑Sat 28. May 2022, 23:47Keine Sonderzeichen in Passwörtern.
Besonders " und ' sind immer kritisch.
Kann man nicht oft genug posten: https://xkcd.com/936/
Wenn nicht explizit drauf geparsed wurde: Ja. ' und " sind Stringbegrenzer, und jede Sprache reagiert da unterschiedlich drauf.
Sein lassen.
oh aber woran sieht man das da Umlaute mit drin sind.
Muss ich alle mit "$6$rounds=" löschen oder hat das nichts damit zu tun.
Gruß
Viktor
https://www.php.net/manual/en/function.crypt.php
CRYPT_SHA512 - SHA-512 hash with a sixteen character salt prefixed with $6$. If the salt string starts with 'rounds=<N>$', the numeric value of N is used to indicate how many times the hashing loop should be executed, much like the cost parameter on Blowfish. The default number of rounds is 5000, there is a minimum of 1000 and a maximum of 999,999,999. Any selection of N outside this range will be truncated to the nearest limit.
Hallo,space2place wrote: ↑Sun 29. May 2022, 14:40 Sehr komisch. Du bist der Erste der so etwas meldet.
Poste mal den kompletten Passwort Hash. Ich schau mir das an und versuche es im Import zu escapen.
Code: Select all
$6$rounds=1724$xNi'>Dv]/0DlPjfC$mZxkpWVYs6C/fsfEyk7Fn/L.CViDYVvEXEJMcDzIsrGZ5t.pr1qaU.ON0TBkOl0TzeuoLYh9/DuRuqH/1pN4//
Genau daran liegt es. Ich überprüfe meinen Code
Code: Select all
self.imscpDomainHtAcccessUsers[index]['iHtAccessPassword'] = imscpDomainHtAccessData[2]
Code: Select all
self.imscpDomainHtAcccessUsers[index]['iHtAccessPassword'] = re.sub(r"'", "\'", imscpDomainHtAccessData[2], flags=re.UNICODE))
Hallo,space2place wrote: ↑Mon 30. May 2022, 07:04Genau daran liegt es. Ich überprüfe meinen Code
Edit:
Mach bitte folgendes.. In der Datei "_imscp.py" ersetze die Zeile 547mitCode: Select all
self.imscpDomainHtAcccessUsers[index]['iHtAccessPassword'] = imscpDomainHtAccessData[2]
Damit müsste es funktionieren.Code: Select all
self.imscpDomainHtAcccessUsers[index]['iHtAccessPassword'] = re.sub(r"'", "\'", imscpDomainHtAccessData[2], flags=re.UNICODE))
Ich schau mir das auch bei den FTP Passwörten noch an. Wenn es funktioniert pushe ich es später ins Git.
Moin Viktor.. Gut aufgepasst...
Code: Select all
self.imscpDomainHtAcccessUsers[index]['iHtAccessPassword'] = re.sub(r"'", "\'", imscpDomainHtAccessData[2], flags=re.UNICODE)