Skip to content
Permalink
Browse files

createUserProfile: ensure qgis.db file is user writable

  • Loading branch information
github-actions authored and nyalldawson committed Jul 21, 2020
1 parent ef1e0d2 commit a79f0e53f57a5ba2d8b97843380021b7a7ceedee
Showing with 11 additions and 0 deletions.
  1. +11 −0 src/core/qgsuserprofilemanager.cpp
@@ -156,6 +156,17 @@ QgsError QgsUserProfileManager::createUserProfile( const QString &name )

//now copy the master file into the users .qgis dir
masterFile.copy( qgisPrivateDbFile.fileName() );

// In some packaging systems, the master can be read-only. Make sure to make
// the copy user writable.
const QFile::Permissions perms = QFile( qgisPrivateDbFile.fileName() ).permissions();
if ( !( perms & QFile::WriteOwner ) )
{
if ( !qgisPrivateDbFile.setPermissions( perms | QFile::WriteOwner ) )
{
error.append( tr( "Can not make '%1' user writable" ).arg( qgisPrivateDbFile.fileName() ) );
}
}
}

if ( error.isEmpty() )

0 comments on commit a79f0e5

Please sign in to comment.
You can’t perform that action at this time.