.\" $MirOS: contrib/hosted/tg/code/kwalletcli/kwalletcli_getpin.1,v 1.20 2018/12/25 19:38:13 tg Exp $ .\"- .\" Copyright © 2009, 2011, 2016, 2018 .\" mirabilos .\" .\" Provided that these terms and disclaimer and all copyright notices .\" are retained or reproduced in an accompanying document, permission .\" is granted to deal in this work without restriction, including un‐ .\" limited rights to use, publicly perform, distribute, sell, modify, .\" merge, give away, or sublicence. .\" .\" This work is provided “AS IS” and WITHOUT WARRANTY of any kind, to .\" the utmost extent permitted by applicable law, neither express nor .\" implied; without malicious intent or gross negligence. In no event .\" may a licensor, author or contributor be held liable for indirect, .\" direct, other damage, loss, or other issues arising in any way out .\" of dealing in the work, even if advised of the possibility of such .\" damage or existence of a defect, except proven that it results out .\" of said person’s immediate fault when using the work as intended. .\"- .\" Try to make GNU groff and AT&T nroff more compatible .\" * ` generates ‘ in gnroff, so use \` .\" * ' generates ’ in gnroff, \' generates ´, so use \*(aq .\" * - generates ‐ in gnroff, \- generates −, so .tr it to - .\" thus use - for hyphens and \- for minus signs and option dashes .\" * ~ is size-reduced and placed atop in groff, so use \*(TI .\" * ^ is size-reduced and placed atop in groff, so use \*(ha .\" * \(en does not work in nroff, so use \*(en .\" * <>| are problematic, so redefine and use \*(Lt\*(Gt\*(Ba .\" Also make sure to use \& *before* a punctuation char that is to not .\" be interpreted as punctuation, and especially with two-letter words .\" but also (after) a period that does not end a sentence (“e.g.\&”). .\" The section after the "doc" macropackage has been loaded contains .\" additional code to convene between the UCB mdoc macropackage (and .\" its variant as BSD mdoc in groff) and the GNU mdoc macropackage. .\" .ie \n(.g \{\ . if \*[.T]ascii .tr \-\N'45' . if \*[.T]latin1 .tr \-\N'45' . if \*[.T]utf8 .tr \-\N'45' . ds <= \[<=] . ds >= \[>=] . ds Rq \[rq] . ds Lq \[lq] . ds sL \(aq . ds sR \(aq . if \*[.T]utf8 .ds sL ` . if \*[.T]ps .ds sL ` . if \*[.T]utf8 .ds sR ' . if \*[.T]ps .ds sR ' . ds aq \(aq . ds TI \(ti . ds ha \(ha . ds en \(en .\} .el \{\ . ds aq ' . ds TI ~ . ds ha ^ . ds en \(em .\} .\" .\" Implement .Dd with the Mdocdate RCS keyword .\" .rn Dd xD .de Dd .ie \\$1$Mdocdate: \{\ . xD \\$2 \\$3, \\$4 .\} .el .xD \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 .. .\" .\" .Dd must come before definition of .Mx, because when called .\" with -mandoc, it might implement .Mx itself, but we want to .\" use our own definition. And .Dd must come *first*, always. .\" .Dd $Mdocdate: December 25 2018 $ .\" .\" Check which macro package we use, and do other -mdoc setup. .\" .ie \n(.g \{\ . if \*[.T]utf8 .tr \[la]\*(Lt . if \*[.T]utf8 .tr \[ra]\*(Gt . ie d volume-ds-1 .ds tT gnu . el .ie d doc-volume-ds-1 .ds tT gnp . el .ds tT bsd .\} .el .ds tT ucb .\" .\" Implement .Mx (MirBSD) .\" .ie "\*(tT"gnu" \{\ . eo . de Mx . nr curr-font \n[.f] . nr curr-size \n[.ps] . ds str-Mx \f[\n[curr-font]]\s[\n[curr-size]u] . ds str-Mx1 \*[Tn-font-size]\%MirBSD\*[str-Mx] . if !\n[arg-limit] \ . if \n[.$] \{\ . ds macro-name Mx . parse-args \$@ . \} . if (\n[arg-limit] > \n[arg-ptr]) \{\ . nr arg-ptr +1 . ie (\n[type\n[arg-ptr]] == 2) \ . as str-Mx1 \~\*[arg\n[arg-ptr]] . el \ . nr arg-ptr -1 . \} . ds arg\n[arg-ptr] "\*[str-Mx1] . nr type\n[arg-ptr] 2 . ds space\n[arg-ptr] "\*[space] . nr num-args (\n[arg-limit] - \n[arg-ptr]) . nr arg-limit \n[arg-ptr] . if \n[num-args] \ . parse-space-vector . print-recursive .. . ec . ds sP \s0 . ds tN \*[Tn-font-size] .\} .el .ie "\*(tT"gnp" \{\ . eo . de Mx . nr doc-curr-font \n[.f] . nr doc-curr-size \n[.ps] . ds doc-str-Mx \f[\n[doc-curr-font]]\s[\n[doc-curr-size]u] . ds doc-str-Mx1 \*[doc-Tn-font-size]\%MirBSD\*[doc-str-Mx] . if !\n[doc-arg-limit] \ . if \n[.$] \{\ . ds doc-macro-name Mx . doc-parse-args \$@ . \} . if (\n[doc-arg-limit] > \n[doc-arg-ptr]) \{\ . nr doc-arg-ptr +1 . ie (\n[doc-type\n[doc-arg-ptr]] == 2) \ . as doc-str-Mx1 \~\*[doc-arg\n[doc-arg-ptr]] . el \ . nr doc-arg-ptr -1 . \} . ds doc-arg\n[doc-arg-ptr] "\*[doc-str-Mx1] . nr doc-type\n[doc-arg-ptr] 2 . ds doc-space\n[doc-arg-ptr] "\*[doc-space] . nr doc-num-args (\n[doc-arg-limit] - \n[doc-arg-ptr]) . nr doc-arg-limit \n[doc-arg-ptr] . if \n[doc-num-args] \ . doc-parse-space-vector . doc-print-recursive .. . ec . ds sP \s0 . ds tN \*[doc-Tn-font-size] .\} .el \{\ . de Mx . nr cF \\n(.f . nr cZ \\n(.s . ds aa \&\f\\n(cF\s\\n(cZ . if \\n(aC==0 \{\ . ie \\n(.$==0 \&MirBSD\\*(aa . el .aV \\$1 \\$2 \\$3 \\$4 \\$5 \\$6 \\$7 \\$8 \\$9 . \} . if \\n(aC>\\n(aP \{\ . nr aP \\n(aP+1 . ie \\n(C\\n(aP==2 \{\ . as b1 \&MirBSD\ #\&\\*(A\\n(aP\\*(aa . ie \\n(aC>\\n(aP \{\ . nr aP \\n(aP+1 . nR . \} . el .aZ . \} . el \{\ . as b1 \&MirBSD\\*(aa . nR . \} . \} .. .\} .\"- .Dt KWALLETCLI_GETPIN 1 .Os .Sh NAME .Nm kwalletcli_getpin .Nd command line interface to pinentry .Sh SYNOPSIS .Nm .Op Fl q .Op Fl b | m | p Ar prompt .Op Fl E | e Ar errortext .br .Op Fl N Ar NoText .Op Fl t Ar desctext .Op Fl Y Ar YesText .Sh DESCRIPTION The .Nm utility is a shell wrapper speaking to .Nm pinentry using the Assuan protocol. It will ask the user for a passphrase and print it, without any trailing newline, to standard output. There are options for asking a boolean question or displaying a message. .Pp If .Ev PINENTRY is not empty but points to a non-existing or failing program, .Nm pinentry is not called. Instead, .Xr xmessage 1 is used for boolean queries and messages if .Ev DISPLAY is set; otherwise, .Nm uses simple terminal I/O on .Ev GPG_TTY using .Xr stty 1 to disable echo of terminal input for passphrase queries. .Pp The options are as follows: .Bl -tag -width xPxdesctxt .It Fl b Ask for a confirmation (boolean) instead of a passphrase. .It Fl E Unset a previously set error text. .It Fl E Ar errtxt Set the error text to .Ar errtxt , displaying a dialogue box with a red X icon indicating that this is a retry question. .It Fl m Display a message (one-button query) instead of asking. .It Fl N Ar NoText Use .Ar NoText instead of .Ic Cancel for the text of the abort button, if any. .It Fl p Ar prompt Set the small descriptive text shown in front of the input field .Pq Dq the Prompt to .Ar prompt . .It Fl q Be more quiet. .It Fl t Ar desctxt Set the descriptive text .Pq the input challenge to .Ar desctxt . .It Fl Y Ar YesText Use .Ar YesText instead of .Ic OK for the text of the confirm button. .El .Pp All input and output is assumed to be in UTF-8. .Sh RETURN VALUES The .Nm utility exits 0 on success, 1 if the passphrase input was cancelled by the user, or \*(Gt1 if an error occurred. Confirmation (boolean) error codes are 0 for Yes, 1 for No, or \*(Gt1 if an error occurred. Messages return \*(Gt0 if an error occurred, 0 otherwise. .Pp A summary of the error codes follows: .Bl -tag -width X -compact .It 0 Read password successfully. Boolean question returned Yes/OK. .It 1 Boolean question returned No/Cancel. .It 2 Wrong command line syntax. .It 3 The process reading user input unexpectedly terminated or errored out. .It 4 Unexpected result reading from pinentry. .It 5 Unable to determine controlling tty, caller must set .Ev GPG_TTY . .It 6 Caught SIGHUP, SIGINT, SIGQUIT, SIGTRAP, SIGPIPE, or SIGTERM. .El .Sh ENVIRONMENT .Bl -tag -width LC_MESSAGES .It Ev DISPLAY If not set, pass current terminal information to .Nm pinentry . .It Ev GPG_TERM Terminal type of the current tty. Defaults to the value of the environment variable .Ev TERM , or .Dq vt100 if unset. .It Ev GPG_TTY The current terminal, determined by .Xr tty 1 if unset. .It Ev LC_CTYPE Passed to .Nm pinentry . Default: .Dq en_US.UTF\-8 .It Ev LC_MESSAGES Passed to .Nm pinentry . Unset by default. .It Ev PINENTRY The .Nm pinentry program to use. Default: .Dq pinentry .El .Sh SEE ALSO .Xr gpg\-agent 1 , .Xr kwalletcli 1 , .Xr pinentry 1 , .Xr stty 1 , .Xr tset 1 , .Xr tty 1 .Sh AUTHORS .Nm was written by .An mirabilos Aq m@mirbsd.org mostly for tarent solutions GmbH. .Sh CAVEATS Some newer pinentry features, such as three-button operation or setting the window title, are not supported yet. .Sh BUGS Some .Nm pinentry programs may not support messages correctly and display them as boolean queries instead. .Pp Some implementations display labels with the wrong charset. .Pp Neither of these two problems is an issue in .Nm but a bug of the backend implementation.