Bug 418647 - kphotoalbum --db always uses 'index.xml' even if a different filename is specified
Summary: kphotoalbum --db always uses 'index.xml' even if a different filename is spec...
Status: RESOLVED FIXED
Alias: None
Product: kphotoalbum
Classification: Applications
Component: Backend (show other bugs)
Version: GIT master
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: KPhotoAlbum Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-08 22:13 UTC by rlk
Modified: 2024-09-13 21:30 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rlk 2020-03-08 22:13:57 UTC
SUMMARY

kphotoalbum always uses index.xml as the file part of the path, even if --db specifies otherwise, e. g.

kphotoalbum --db index2.xml

STEPS TO REPRODUCE
1. Create (or not) a database file named something other than index.xml
2. run kphotoalbum --db something_not_named_index.xml

OBSERVED RESULT

kphotoalbum loads index.xml if present, or prompts to create one if not, regardless of whether the specified file name exists.

EXPECTED RESULT

kphotoalbum should use the specified filename.

SOFTWARE/OS VERSIONS
All irrelevant; the issue is in kphotoalbum proper.  This happens to be with revision c4a5190fc63879f4d3051550cbe30d0604dc5b68
Comment 1 Johannes Zarl-Zierl 2024-08-03 15:50:46 UTC
Thanks to the work by rsquared on https://invent.kde.org/graphics/kphotoalbum/-/merge_requests/33, this bug is now resolved: KPhotoAlbum now rejects file names other than index.xml instead of silently changing the file name to index.xml.

I do accept follow-up bug reports to actually allow different file names, but fixing that is significantly more work because 'index.xml' is hard-coded at various places in the code-base.
Comment 2 Johannes Zarl-Zierl 2024-08-03 15:50:53 UTC
Git commit a35ae72934d6fd370486e65492a652ad62b6c9ce by Johannes Zarl-Zierl.
Committed on 03/08/2024 at 15:45.
Pushed by johanneszarl into branch 'master'.

Update Changelog

Add change log entry for the following change:
fa8150d1 Don't allow non-existant directories with --db
2499bcbf Be more restricting in allowed filenames.
4940a38a Remove unintended change.
ba245601 Move and refactor per review comments.
cadf882a Bail with an error message on invalid input.

Kudos to rsquared for doing most of the work on this!

M  +1    -0    CHANGELOG.md

https://invent.kde.org/graphics/kphotoalbum/-/commit/a35ae72934d6fd370486e65492a652ad62b6c9ce
Comment 3 Johannes Zarl-Zierl 2024-09-13 21:30:04 UTC
Git commit 562c4dfeda0528c32ede7764c82067698a9f7d2e by Johannes Zarl-Zierl.
Committed on 13/09/2024 at 21:28.
Pushed by johanneszarl into branch 'kf6'.

Update Changelog

Add change log entry for the following change:
e32f2038 Don't allow non-existant directories with --db
b7367c78 Be more restricting in allowed filenames.
a38583d7 Remove unintended change.
b66ed4d4 Move and refactor per review comments.
0281fcc2 Bail with an error message on invalid input.
76590ed9 Handle directory passed on the command line.

Kudos to rsquared for doing most of the work on this!

Note: this is a port of the existing bugfix on the KF5/Qt5 branch
(master) to the kf6 branch.

M  +1    -0    CHANGELOG.md

https://invent.kde.org/graphics/kphotoalbum/-/commit/562c4dfeda0528c32ede7764c82067698a9f7d2e