D6197: Add basic KAuth support to file ioslave

Elvis Angelaccio noreply at phabricator.kde.org
Sat Jun 17 08:52:40 UTC 2017


elvisangelaccio requested changes to this revision.
elvisangelaccio added a comment.
This revision now requires changes to proceed.


  If I don't enter the authentication password, after ~20 seconds I get the "Access denied to <PATH>" error. Is this some timeout in the ioslave?

INLINE COMMENTS

> file.cpp:1382
> +{
> +#ifdef Q_OS_UNIX
> +    QVariantMap argv;

Can't this go in file_unix.cpp, without ifdefs?

> file.cpp:1387
> +
> +    KAuth::Action execAction(QStringLiteral("org.kde.kio.file.") + action);
> +    execAction.setHelperId(QStringLiteral("org.kde.kio.file"));

Prefer `QLatin1String` if you want to concatenate. Or you could use `QStringLiteral("org.kde.kio.file.%1").arg(action)`.

> file.cpp:1443
> +{
> +    int status = messageBox(WarningContinueCancel, warningMessage(warnId), QStringLiteral("Warning!"), QStringLiteral("Continue"), QStringLiteral("Cancel"));
> +    return status != 2;

I didn't get this messagebox after deleting something when I was already authenticated. What did I do wrong?

> file.h:108
> +    bool execWithRoot(const QString &action, const QString &subAction, const QVariant &args, PriviledgeWarning warning);
> +    void endPriviledgeOp();
> +    QString warningMessage(PriviledgeWarning warnId) const;

`endProvidiledgeOperation()` is more descriptive, no?

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D6197

To: chinmoyr, elvisangelaccio, #frameworks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170617/43241176/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list