Skip to content

Commit

Permalink
Change permission of cert/key files to please pg
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Nov 8, 2024
1 parent 7892761 commit 4cce203
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/core/qfieldcloudconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,10 @@ QFieldCloudConnection::CloudError::CloudError( QNetworkReply *reply )

int QFieldCloudConnection::uploadPendingAttachments()
{
qDebug() << "QFieldCloudConnection::uploadPendingAttachments()";
qDebug() << "QFieldCloudConnection::uploadPendingAttachments()";
qDebug() << "QFieldCloudConnection::uploadPendingAttachments()";
qDebug() << "QFieldCloudConnection::uploadPendingAttachments()";
if ( mUploadPendingCount > 0 )
return mUploadPendingCount;

Expand Down
9 changes: 8 additions & 1 deletion src/core/qgismobileapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,19 @@ QgisMobileapp::QgisMobileapp( QgsApplication *app, QObject *parent )

if ( !dataDirs.isEmpty() )
{
#if defined( Q_OS_ANDROID ) || defined( Q_OS_IOS )
#if !defined( Q_OS_ANDROID ) || !defined( Q_OS_IOS )
for ( const QString &dataDir : dataDirs )
{
QFileInfo pgServiceFile( QStringLiteral( "%1/pg_service.conf" ).arg( dataDir ) );
if ( pgServiceFile.exists() && pgServiceFile.isReadable() )
{
QDir dir( dataDir );
QStringList files = dir.entryList( QStringList() << QStringLiteral( "*.crt" ) << QStringLiteral( "*.key" ), QDir::Files );
for ( const QString &file : files )
{
qInfo() << QStringLiteral( "Tweaking permission for cert/key file %1" ).arg( file );
QFile::setPermissions( QStringLiteral( "%1/%2" ).arg( dataDir, file ), QFileDevice::ReadOwner | QFileDevice::WriteOwner );
}
setenv( "PGSYSCONFDIR", dataDir.toUtf8(), true );
break;
}
Expand Down

0 comments on commit 4cce203

Please sign in to comment.