Skip to content

Missing password MIME type with xkeepassxc-cli #12700

@ccjmne

Description

@ccjmne

Have you searched for an existing issue?

  • Yes, I tried searching and reviewed the pinned issues

Brief Summary

I may be missing something; my apologies if that's the case.

When using the GUI, the MIME type x-kde-passwordManagerHint (not technically "MIME"), see #12696) is adequately set upon copying passwords.
However, in trying out xkeepassxc-cli clip, it appears to be missing.

I can see it's indeed implemented somewhere here:

auto* mime = new QMimeData;
mime->setText(text);
#if defined(Q_OS_MACOS)
mime->setData("application/x-nspasteboard-concealed-type", text.toUtf8());
#elif defined(Q_OS_UNIX)
mime->setData("x-kde-passwordManagerHint", QByteArrayLiteral("secret"));
#elif defined(Q_OS_WIN)
mime->setData("ExcludeClipboardContentFromMonitorProcessing", QByteArrayLiteral("1"));
mime->setData("CanIncludeInClipboardHistory", {4, '\0'});
mime->setData("CanUploadToCloudClipboard ", {4, '\0'});
#endif

But that seems to belong squarely to the GUI side of things only.

Could we align the CLI tool as well?

Steps to Reproduce

  1. Open the GUI,
  2. Ctrl-C some entry,
  3. see its password marked as such in any tool you may use to inspect your clipboard.
    For example, fcitx5's built-in clipboard add-on would highlight passwords as such (and possibly hide them), as implemented somewhere there: https://github.com/fcitx/fcitx5/blob/39274f29116681a16c3a0b02b814369c6530df09/src/modules/clipboard/clipboard.h#L45

Conversely,

  1. keepassxc-cli clip personal.kdbx --attr password
  2. See, for instance, fcitx5 have no qualms about displaying your passwords.

Operating System

Distribution: linux-zen/Arch Linux
Compositor: Wayland/niri

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Bug.

    Projects

    Status

    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions