D23454: Fixing bug where MTP slave does not return error in stat()/mimetype()
Alexander Saoutkin
noreply at phabricator.kde.org
Sun Aug 25 20:47:53 BST 2019
feverfew created this revision.
feverfew added reviewers: chinmoyr, akrutzler, elvisangelaccio, dfaure.
Herald added projects: Dolphin, Frameworks.
Herald added subscribers: kfm-devel, kde-frameworks-devel.
feverfew requested review of this revision.
REVISION SUMMARY
This patch fixes two cases where invalid KTMPFile objects would be treated as
valid. In particular, this would manifest in KIO::stat() and KIO::mimetype()
returning without error when they, in fact, should do. One would note that in
the rest of the code, KMTPFile objects that are received via
KMTPStorageInterface::getFileMetaData() always have a isValid() check applied
before use. The two previously mentioned functions, incorrectly, do not have
this check applied. This patch simply adds these necessary checks.
TEST PLAN
KIOFuse uses KIO::stat() to complete a lookup. Before this patch lookup would
always succeed and this was determined to be because stat would always succeed.
This bug could be easily found as tab completion would never work correctly.
Trying to tab complete would seem to add what was already typed in to the
directory. With this patch applied, lookup no longer always succeeds and tab
completion now works.
REPOSITORY
R320 KIO Extras
BRANCH
mtpFixStat (branched from master)
REVISION DETAIL
https://phabricator.kde.org/D23454
AFFECTED FILES
mtp/kio_mtp.cpp
To: feverfew, chinmoyr, akrutzler, elvisangelaccio, dfaure
Cc: kde-frameworks-devel, kfm-devel, fvogt, aprcela, vmarinescu, fprice, LeGast00n, MrPepe, fbampaloukas, alexde, GB_2, Codezela, feverfew, meven, michaelh, spoorun, navarromorales, firef, ngraham, andrebarros, bruns, emmanuelp, mikesomov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20190825/9907e80d/attachment.htm>
More information about the kfm-devel
mailing list