Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent users from setting up vfs on a root drive #8615

Merged
merged 1 commit into from
May 7, 2021
Merged

Conversation

TheOneRing
Copy link
Member

No description provided.

Copy link
Contributor

@michaelstingl michaelstingl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@TheOneRing TheOneRing changed the base branch from master to 2.8 May 7, 2021 13:49
@@ -67,6 +68,10 @@ Result<bool, QString> Vfs::checkAvailability(const QString &path)
const auto mode = bestAvailableVfsMode();
#ifdef Q_OS_WIN
if (mode == Mode::WindowsCfApi) {
const auto winPath = QDir::toNativeSeparators(path);
if (winPath.endsWith(QLatin1Char(':')) || winPath.endsWith(QStringLiteral(":\\"))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't QDir::isRoot be more appropriate?
I'm not entirely sure how this works on Windows, the Qt docs don't have an example for non-POSIX-like OSes.

@TheOneRing TheOneRing merged commit 1287325 into 2.8 May 7, 2021
@delete-merged-branch delete-merged-branch bot deleted the work/vfs_win branch May 7, 2021 14:25
@sonarcloud
Copy link

sonarcloud bot commented May 7, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@gabi18 gabi18 mentioned this pull request May 26, 2021
43 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants