Add a specific error string for ENOTEMPTY return code in SMB slave.
ClosedPublic

Authored by madcatx on Oct 1 2018, 9:20 AM.

Details

Summary

ENOEMPTY return code may be a valid return code from i.e. smbc_rmdir(). The current error reporting code lets such an error code fall through to the default report case, leading to confusing information reported back to the user. This patch adds such a case branch.

Diff Detail

Repository
R320 KIO Extras
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
madcatx created this revision.Oct 1 2018, 9:20 AM
Restricted Application added projects: Dolphin, Frameworks. · View Herald TranscriptOct 1 2018, 9:20 AM
Restricted Application added subscribers: kfm-devel, kde-frameworks-devel. · View Herald Transcript
madcatx requested review of this revision.Oct 1 2018, 9:20 AM
dfaure added a subscriber: dfaure.Oct 3 2018, 12:21 PM

kio_file returns KIO::ERR_CANNOT_RMDIR when trying to delete a non-empty directory, maybe kio_smb could do the same? Although I see that the above isn't dependent on the command being executed.... But well, is there any other operation that would return ENOTEMPTY? If not, then ERR_CANNOT_RMDIR would be better IMHO (so KIO code or app code can check for it, if needed).

Well, this (https://api.kde.org/frameworks/kio/html/deprecated.html#_deprecated000015) marks KIO::ERR_COULD_NOT_RMDIR as deprecated. Is there an alternative I should use instead?

Ah, sorry, apparently there is ERR_CANNOT_RMDIR and ERR_COULD_NOT_RMDIR which translate to the same value with the latter being deprecated. I'll update the patch to use ERR_CANNOT_RMDIR.

madcatx updated this revision to Diff 42807.Oct 3 2018, 5:48 PM

Changed the KIO error code from ERR_INTERNAL to more specific ERR_CANNOT_RMDIR.

dfaure accepted this revision.Oct 3 2018, 10:18 PM
This revision is now accepted and ready to land.Oct 3 2018, 10:18 PM
This revision was automatically updated to reflect the committed changes.