Proof password.h round 2

This commit is contained in:
наб 2021-11-20 12:12:57 +01:00
parent ea0a5bd52e
commit f02bf1c094
No known key found for this signature in database
GPG Key ID: BCFD0B018D2658F1
2 changed files with 11 additions and 14 deletions

View File

@ -28,7 +28,7 @@ OS_LD_LIBS :=
CXXVER := $(shell $(CXX) --version)
ifneq "$(findstring clang,$(CXXVER))" ""
# GCC doesn't have this granularity
CXXSPECIFIC := -flto=full -pedantic -Wno-gnu-statement-expression -Wno-gnu-include-next
CXXSPECIFIC := -flto=full -pedantic -Wno-gnu-statement-expression -Wno-gnu-include-next -Wno-gnu-conditional-omitted-operand
else
CXXSPECIFIC := -flto
endif

View File

@ -5,20 +5,22 @@
.It Ev TZPFMS_PASSPHRASE_HELPER
If set and nonempty, will be run via
.Pa /bin/ Ns Nm sh Fl c
.\"Li \&"$TZPFMS_PASSPHRASE_HELPER" \&"$TZPFMS_PASSPHRASE_HELPER" Qo Ar prepared prompt Qc Qo Ar target Qc Qo Oo Li new Oc Qc Qo Oo Li again Oc Qc
to provide a passphrase, instead of reading from the standard input stream.
.Pp
The standard output stream of the helper is tied to an anonymous file and used in its entirety as the passphrase, except for a trailing new-line, if any.
The arguments are:
.Bl -enum -compact -offset "@@" -width "@"
.It
Pre-formatted noun phrase with all the information below
.It
Either the dataset name or the element of the TPM hierarchy.
.It
.Bl -tag -compact -offset "@@" -width "@@"
.It Li $1
Pre-formatted noun phrase with all the information below, like
.Qq Passphrase for tarta-zoot
or
.Qq New passphrase for tarta-zoot (again)
.It Li $2
Either the dataset name or the element of the TPM hierarchy
.It Li $3
.Qq new
if this is for a new passphrase
.It
.It Li $4
.Qq again
if it's the second prompt for that passphrase
.El
@ -27,9 +29,4 @@ If the helper doesn't exist
.Pq the shell exits with Sy 127 ,
a diagnostic is issued and the normal prompt is used as fall-back.
If it fails for any other reason, the prompting is aborted.
.Pp
An example value facilitating
.Xr systemd 1
integration would be:
.No ' Ns Ic exec Nm systemd-ask-password Fl -id Ns Li = Ns Qo Li tzpfms:\& Ns Ar $2 Qc Qo Ar $1 Ns Li ": " Qc Ns ' .
.El