Bug 421478 - Files written outside proper directories
Summary: Files written outside proper directories
Status: RESOLVED FIXED
Alias: None
Product: digikam
Classification: Applications
Component: Setup-FirstRun (show other bugs)
Version: 6.4.0
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Digikam Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-13 18:22 UTC by Dario Panico
Modified: 2020-05-28 16:15 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 7.0.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dario Panico 2020-05-13 18:22:01 UTC
When starting Digikam for the first time I selected the same directory X both for the main collection path and the Database path (SQLite). 

The installer kept saying I didn't have permission to write in this directory and that I could experience problems, even blocking the configuration due to the impossibility to create the database. This was wrong because my user was the owner of directory X.

I gave Edit permissions on directory X/.. (the parent) to the same user and it magically went on without problems.

That was probably because it had to write a couple empty files in the parent directory.

They are called XeptCLB and XihdHtH, where X is the name of my directory.

Those files should not be written there IMO


STEPS TO REPRODUCE
1. Create the following hierarchy of directory:
   Y -> user can only read content
   Y/X -> user is the owner of that subdirectory
2. Run Digikam to use X as both main collection directory and database location
3. Experience installation forbidden and warning popups
4. Change Y permissions to add Edit
5. Re-run first time configuration without any problem
6. Find a couple empty files in Y

OBSERVED RESULT
Files created outside the proper directory


EXPECTED RESULT
No need to expand permissions and no files created outside X


SOFTWARE/OS VERSIONS
Windows: 10 Version 1903
KDE Frameworks 5.61.0
Qt 5.13.1 (built with 5.13.1)
Comment 1 Maik Qualmann 2020-05-13 18:36:43 UTC
DigiKam can only create files on the system drive (usually C:\) in the user directory, not outside. You can't fix it through permission, even though Explorer can. It has to do with the UAC, digiKam is an unknown program for Windows without a signature. What was your exact path?

Maik
Comment 2 Maik Qualmann 2020-05-13 18:37:58 UTC

*** This bug has been marked as a duplicate of bug 398288 ***
Comment 3 Dario Panico 2020-05-17 10:50:27 UTC
X resides on D:\Immagini\X, it is a second hard drive on the same PC.

What I get from your comment is that DK shouldn't be able to write in that path, but:
A. It wrote files in D:\Immagini (where it shouldn't)
B. It wrote files (metadata) in D:\Immagini\X (where it is desirable)

Anyway #398288 doesn't seem related to me, since there's no migration involved here, it's just first time setup
Comment 4 Dario Panico 2020-05-24 10:03:31 UTC
So, judging by this comment (https://bugs.kde.org/show_bug.cgi?id=398288#c20), a path on D: shouldn't be protected by UAC, so this is a different unrelated issue.
I just reopened this bug report.
Regards
Comment 5 Maik Qualmann 2020-05-24 10:55:27 UTC
Was there a Windows installed on the D: hard drive before? If so, it is also still marked as a system drive. This problem has also been confirmed to us by users.

Maik
Comment 6 Dario Panico 2020-05-24 16:18:29 UTC
No it hasn't. Anyway the problem is that DK was able to create files outside its scope.

So either:
- It can't write in X
- It did write in X/..

And the latter happened
Comment 7 Maik Qualmann 2020-05-25 06:10:32 UTC
Git commit cc707f5b13f95d194fe9158cd9935eeb9a790d47 by Maik Qualmann.
Committed on 25/05/2020 at 06:08.
Pushed by mqualmann into branch 'master'.

first step save user sidcare extensions as case sensitive

M  +1    -1    core/utilities/setup/metadata/setupmetadata.cpp

https://invent.kde.org/graphics/digikam/commit/cc707f5b13f95d194fe9158cd9935eeb9a790d47
Comment 8 Maik Qualmann 2020-05-25 06:37:53 UTC
In the comment 7 posted, the bug number was wrong.

Maik
Comment 9 Maik Qualmann 2020-05-26 17:05:44 UTC
Git commit a3ada534db3f5362d4f884b8decf7a54fe601b58 by Maik Qualmann.
Committed on 26/05/2020 at 17:03.
Pushed by mqualmann into branch 'master'.

fix create temporary test file in album root directory
Related: bug 398288

M  +3    -1    NEWS
M  +1    -1    core/utilities/firstrun/collectionpage.cpp

https://invent.kde.org/graphics/digikam/commit/a3ada534db3f5362d4f884b8decf7a54fe601b58
Comment 10 Maik Qualmann 2020-05-28 16:15:21 UTC
Git commit fddb9298b614f5d8526f634c861815130af8dafa by Maik Qualmann.
Committed on 28/05/2020 at 16:13.
Pushed by mqualmann into branch 'master'.

the same fix for the database directory
Related: bug 398288

M  +6    -1    core/libs/database/utils/widgets/dbsettingswidget.cpp

https://invent.kde.org/graphics/digikam/commit/fddb9298b614f5d8526f634c861815130af8dafa