Merge pull request #180 from jonaski/blockservername_macos

SingleApplicationPrivate: Use MD5 on macOS for block server name
This commit is contained in:
Itay Grudev 2023-10-13 01:39:07 +03:00 committed by GitHub
commit 8c48163c4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## 3.5.1
* Bug Fix: Maximum QNativeIpcKey key size on macOS. - _Jonas Kvinge_
## 3.5.0
* Switch to the new QNativeIpcKey based QSharedMemory constructor with Qt 6.6 and higher. - _Jonas Kvinge_

View File

@ -131,7 +131,12 @@ QString SingleApplicationPrivate::getUsername()
void SingleApplicationPrivate::genBlockServerName()
{
#ifdef Q_OS_MACOS
// Maximum key size on macOS is PSHMNAMLEN (31).
QCryptographicHash appData( QCryptographicHash::Md5 );
#else
QCryptographicHash appData( QCryptographicHash::Sha256 );
#endif
#if QT_VERSION < QT_VERSION_CHECK(6, 3, 0)
appData.addData( "SingleApplication", 17 );
#else