Docker: Add a way to force file access via docker itself

Use a QTC_DOCKER_DENY_LOCAL_ACCESS environment variable.

On Linux we usually try to access the container file system directly
as part of the host file system. In some cases this fails, and in some
cases we might want to disable it for testing purposes.

Change-Id: Iebc8e7fbbc968cd6dfbc6da2d08d71dd53bfa097
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
hjk
2021-12-13 18:17:01 +01:00
parent 3b7453e3ed
commit 353314a777

View File

@@ -949,6 +949,9 @@ void DockerDevicePrivate::tryCreateLocalFileAccess()
bool DockerDevice::hasLocalFileAccess() const
{
static const bool denyLocalAccess = qEnvironmentVariableIsSet("QTC_DOCKER_DENY_LOCAL_ACCESS");
if (denyLocalAccess)
return false;
return !d->m_mergedDir.isEmpty();
}