Skip to content

pinentry fails with "Inappropriate ioctl for device" in graphical session #167

@tstarling

Description

@tstarling

On a new installation of Kubuntu I installed yubikey-agent and pcscd, and then rebooted. When I tried to use ssh, I got "agent refused operation" and the syslog had

agent 13: pin prompt: unexpected response: ERR 83918950 Inappropriate ioctl for device <Pinentry>

So it seems very similar to #150. I may have misunderstood, but I don't think the root cause is the same. I'm running ssh from a graphical session, and the error message originates from pinentry-curses.c which should not be used in this situation. Reviewing pinentry_have_display suggests that either DISPLAY should be set or it should be forwarded on the command line.

The unit file in the Debian package has WantedBy=default.target which causes it to start before X, without DISPLAY. So a sufficient workaround for my purposes is

sudo mv /etc/systemd/user/default.target.wants/yubikey-agent.service /etc/systemd/user/graphical-session.target.wants/
systemctl --user daemon-reload
systemctl --user restart yubikey-agent

Then pinentry works, at least in graphical sessions. If you wanted it to work in a non-graphical session, pinentry would have to be started with the terminal as stdin and stdout.

Debian's unit file is based on the upstream unit file which also has WantedBy=default.target, so I think this is the right place to file the bug.

Note that manually starting the service from a graphical session also works. To reproduce the bug, you have to enable the unit and then reboot or log out.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions