From d79eb4a3328c272c5f367d071750f42e4a4b222c Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Wed, 14 Feb 2018 01:24:49 +0100 Subject: [PATCH] Document an alternative password prompt with pinentry(1) --- doc/pinentry-sudo-askpass.in | 44 ++++++++++++++++++++++++++++++++++++ doc/project.conf | 10 ++++++-- 2 files changed, 52 insertions(+), 2 deletions(-) create mode 100755 doc/pinentry-sudo-askpass.in diff --git a/doc/pinentry-sudo-askpass.in b/doc/pinentry-sudo-askpass.in new file mode 100755 index 0000000..5c6d351 --- /dev/null +++ b/doc/pinentry-sudo-askpass.in @@ -0,0 +1,44 @@ +#!/bin/sh +#$Id$ +#Copyright (c) 2018 Pierre Pronchery +#This file is part of DeforaOS Desktop Browser +#Redistribution and use in source and binary forms, with or without +#modification, are permitted provided that the following conditions are +#met: +# +#1. Redistributions of source code must retain the above copyright notice, +# this list of conditions and the following disclaimer. +# +#2. Redistributions in binary form must reproduce the above copyright notice +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +#3. Neither the name of the authors nor the names of the contributors may be +# used to endorse or promote products derived from this software without +# specific prior written permission. +# +#THIS SOFTWARE IS PROVIDED BY ITS AUTHORS AND CONTRIBUTORS "AS IS" AND ANY +#EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +#WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +#DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY +#DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +#(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +#LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +#ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +#(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +#THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +ret=2 +echo "SETTITLE sudo password prompt +SETDESC Your password is needed to perform this operation. +SETPROMPT Password: +GETPIN +BYE" | @BINDIR@/pinentry-gtk-2 | while read key values; do + case "$key" in + D) + echo "$values" + ret=0 + ;; + esac +done +exit $ret diff --git a/doc/project.conf b/doc/project.conf index 06e1729..99cfae7 100644 --- a/doc/project.conf +++ b/doc/project.conf @@ -1,5 +1,5 @@ -targets=browser.1,browser.html,browser.xml,copy.1,copy.html,copy.xml,delete.1,delete.html,delete.xml,desktop.1,desktop.html,desktop.xml,desktopctl.1,desktopctl.html,desktopctl.xml,move.1,move.html,move.xml,open.1,open.html,open.xml,properties.1,properties.html,properties.xml,view.1,view.html,view.xml,zenity-sudo-askpass -dist=Makefile,browser.css.xml,browser.xml.in,copy.css.xml,copy.xml.in,delete.css.xml,delete.xml.in,desktop.css.xml,desktop.xml.in,desktopctl.css.xml,desktopctl.xml.in,docbook.sh,manual.css.xml,mime.conf,move.css.xml,move.xml.in,open.css.xml,open.xml.in,properties.css.xml,properties.xml.in,view.css.xml,view.xml.in,zenity-sudo-askpass.in +targets=browser.1,browser.html,browser.xml,copy.1,copy.html,copy.xml,delete.1,delete.html,delete.xml,desktop.1,desktop.html,desktop.xml,desktopctl.1,desktopctl.html,desktopctl.xml,move.1,move.html,move.xml,open.1,open.html,open.xml,pinentry-sudo-askpass,properties.1,properties.html,properties.xml,view.1,view.html,view.xml,zenity-sudo-askpass +dist=Makefile,browser.css.xml,browser.xml.in,copy.css.xml,copy.xml.in,delete.css.xml,delete.xml.in,desktop.css.xml,desktop.xml.in,desktopctl.css.xml,desktopctl.xml.in,docbook.sh,manual.css.xml,mime.conf,move.css.xml,move.xml.in,open.css.xml,open.xml.in,pinentry-sudo-askpass.in,properties.css.xml,properties.xml.in,view.css.xml,view.xml.in,zenity-sudo-askpass.in [browser.1] type=script @@ -120,6 +120,12 @@ type=script script=../tools/subst.sh depends=open.xml.in +[pinentry-sudo-askpass] +type=script +script=../tools/subst.sh +depends=pinentry-sudo-askpass.in +install=$(PREFIX)/share/doc/Browser + [properties.1] type=script script=./docbook.sh