If we are looking root of that package (It's equal to path() but needed in 
dashboard to set "root" to this) then basepath is /some/path/ and canonical is 
/some/path and startsWith does not match. Is it ok to add '/' to 
canonicalPath?

Index: package.cpp
===================================================================
--- package.cpp (revision 860648)
+++ package.cpp (working copy)
@@ -136,7 +136,7 @@
         // ensure that we don't return files outside of our base path
         // due to symlink or ../ games
         QDir dir(path);
-        QString canonicalized = dir.canonicalPath();
+        QString canonicalized = dir.canonicalPath() + '/';
         if (canonicalized.startsWith(d->basePath)) {
             return path;
         }

Petri

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel

Reply via email to