From guerinp01 at gmail.com Mon Dec 13 03:13:33 2021 From: guerinp01 at gmail.com (Paul Guerin) Date: Mon, 13 Dec 2021 13:13:33 +1000 Subject: GPG is now a poor encryption tool? Message-ID: GnuPG is still widely regarded as an industry standard. However, I have recently come across some negative press against GnuPG. ie GPG. For example, the following post: https://latacora.micro.blog/2019/07/16/the-pgp-problem.html The GPG tool is claimed to be not very secure by modern standards, and has a legacy code-base that holds the project back. In response, there are other encryption projects that aim to be much better. eg https://sequoia-pgp.org/ Just wondering, what the community thinks about GPG, and whether it still deserves to continue to be used as the encryption engine for Pass? From ayush at fastmail.in Mon Dec 13 03:56:33 2021 From: ayush at fastmail.in (Ayush Agarwal) Date: Mon, 13 Dec 2021 09:26:33 +0530 Subject: GPG is now a poor encryption tool? In-Reply-To: References: Message-ID: <6013ca1e-9c4b-4970-b1a4-34c88e924ebe@www.fastmail.com> Hi Paul, I've been considering writing a patch which would make pass choose between age[^1] and gpg during `pass init` although it seems like Filippo Valsorda already has this on his list of goals[^2]. I won't say much about gpg considering I'm not a cryptographer but I'd like to point out that if you want to create ed25519 key pairs using gpg, you have execute `gpg --expert --full-gen-key` as of gpg version 2.2.x. The man page of gpg describes the `--expert` flag as "allow the user to do certain nonsensical or silly things ...". This isn't really the user experience a modern encryption tool should have, to say the least. If I'm not mistaken, gpg version 2.3.x, which has been released recently, may have switched to ed25519 key pairs by default but that doesn't really solve the problem that gpg allows you to shoot yourself in the foot by using algorithms and protocols which should have been deprecated and removed a long time ago but haven't been for the sake of backwards compatibility. [^1]: https://github.com/FiloSottile/age [^2]: https://docs.google.com/document/d/11yHom20CrsuX8KQJXBBw04s80Unjv8zCg_A7sPAX_9Y/edit# Regards, Ayush From stephane.maniaci at gmail.com Fri Dec 17 15:11:18 2021 From: stephane.maniaci at gmail.com (=?UTF-8?Q?St=C3=A9phane_Maniaci?=) Date: Fri, 17 Dec 2021 15:11:18 +0000 Subject: [PATCH] emacs: allow generating passwords in place Message-ID: Hello, This is my first patch so apologies if formatting is off or if GMail screws up my message. Cheers, St?phane. -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-emacs-allow-generating-passwords-in-place.patch Type: text/x-patch Size: 2902 bytes Desc: not available URL: From stephane.maniaci at gmail.com Fri Dec 17 15:13:05 2021 From: stephane.maniaci at gmail.com (=?UTF-8?Q?St=C3=A9phane_Maniaci?=) Date: Fri, 17 Dec 2021 15:13:05 +0000 Subject: [PATCH] emacs: allow generating passwords in place Message-ID: Hello, This is my first patch so apologies if formatting is off or if GMail screws up my message. Cheers, St?phane. -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-emacs-allow-generating-passwords-in-place.patch Type: text/x-patch Size: 2902 bytes Desc: not available URL: From stephane.maniaci at gmail.com Fri Dec 17 15:21:22 2021 From: stephane.maniaci at gmail.com (=?UTF-8?q?St=C3=A9phane=20Maniaci?=) Date: Fri, 17 Dec 2021 15:21:22 +0000 Subject: [PATCH] emacs: allow generating passwords in place Message-ID: <20211217152122.28770-1-stephane.maniaci@gmail.com> Previously, generating a password would `--force` over the entry and replace the whole file with a new password. Amend this behaviour by detecting whether the entry exists and leveraging pass's `--in-place` flag to only replace the password (i.e the top line). This requires a bit of logic because `--force` and `--in-place` are mutally exclusive. Also remove the optional arguments to `password-store--run-generate` as they were only used, arbitrarily, from `password-store-generate`. --- contrib/emacs/password-store.el | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/contrib/emacs/password-store.el b/contrib/emacs/password-store.el index 61c339e..726cecf 100644 --- a/contrib/emacs/password-store.el +++ b/contrib/emacs/password-store.el @@ -143,12 +143,16 @@ Nil arguments are ignored. Output is discarded." (password-store--run-async "edit" entry)) -(defun password-store--run-generate (entry password-length &optional force no-symbols) - (password-store--run "generate" - (if force "--force") - (if no-symbols "--no-symbols") - entry - (number-to-string password-length))) +(defun password-store--run-generate (entry password-length) + (let ((existing-entry (password-store-parse-entry entry)) + (args '("generate"))) + (if existing-entry + (add-to-list 'args "--in-place") + (add-to-list 'args "--force")) + (add-to-list 'args entry) + (add-to-list 'args (number-to-string password-length)) + + (apply #'password-store--run (reverse args)))) (defun password-store--run-remove (entry &optional recursive) (password-store--run "remove" @@ -241,7 +245,7 @@ When CALLBACK is non-`NIL', call CALLBACK with the first line instead." ;;;###autoload (defun password-store-get-field (entry field &optional callback) "Return FIELD for ENTRY. -FIELD is a string, for instance \"url\". +FIELD is a string, for instance \"url\". When CALLBACK is non-`NIL', call it with the line associated to FIELD instead. If FIELD equals to symbol secret, then this function reduces to `password-store-get'." (let* ((inhibit-message t) @@ -346,7 +350,7 @@ Default PASSWORD-LENGTH is `password-store-password-length'." (unless password-length (setq password-length password-store-password-length)) ;; A message with the output of the command is not printed because ;; the output contains the password. - (password-store--run-generate entry password-length t) + (password-store--run-generate entry password-length) nil) ;;;###autoload -- 2.33.1 From stephane.maniaci at gmail.com Fri Dec 17 15:22:41 2021 From: stephane.maniaci at gmail.com (=?UTF-8?Q?St=C3=A9phane_Maniaci?=) Date: Fri, 17 Dec 2021 15:22:41 +0000 Subject: [PATCH] emacs: allow generating passwords in place In-Reply-To: References: Message-ID: Apologies, GMail did make this whole entreprise very messy. I've sent a new patch via git-send-email, which I believe should be correct. Sorry about the noise. On Fri, 17 Dec 2021 at 15:13, St?phane Maniaci wrote: > > Hello, > > This is my first patch so apologies if formatting is off or if GMail > screws up my message. > > Cheers, > St?phane. From mail at rkta.de Mon Dec 20 12:40:26 2021 From: mail at rkta.de (Rene Kita) Date: Mon, 20 Dec 2021 13:40:26 +0100 Subject: [RFC PATCH] Add option to print the first line of an entry Message-ID: <20211220124026.28413-1-mail@rkta.de> This commit enables the use of '-1' to print only the first line of an entry. A typical use-case would be: 'password=$(pass -1 example.org)' or 'pass -1 example.org | tmux loadb -'. Before this change one had to use 'sed 1q' or similar when using multi-line entries. Signed-off-by: Rene Kita --- man/pass.1 | 9 +++++---- src/password-store.sh | 7 +++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/man/pass.1 b/man/pass.1 index a555dcb..cd0ebf0 100644 --- a/man/pass.1 +++ b/man/pass.1 @@ -94,10 +94,11 @@ List names of passwords inside the tree that match \fIpass-names\fP by using the .BR tree (1) program. This command is alternatively named \fBsearch\fP. .TP -\fBshow\fP [ \fI--clip\fP[=\fIline-number\fP], \fI-c\fP[\fIline-number\fP] ] [ \fI--qrcode\fP[=\fIline-number\fP], \fI-q\fP[\fIline-number\fP] ] \fIpass-name\fP -Decrypt and print a password named \fIpass-name\fP. If \fI--clip\fP or \fI-c\fP -is specified, do not print the password but instead copy the first (or otherwise specified) -line to the clipboard using +\fBshow\fP [ \fI-1\fP ] [ \fI--clip\fP[=\fIline-number\fP], \fI-c\fP[\fIline-number\fP] ] [ \fI--qrcode\fP[=\fIline-number\fP], \fI-q\fP[\fIline-number\fP] ] \fIpass-name\fP +Decrypt and print a password named \fIpass-name\fP. If \fI-1\fP is specified, +print only the first line. If \fI--clip\fP or \fI-c\fP is specified, do not +print the password but instead copy the first (or otherwise specified) line to +the clipboard using .BR xclip (1) or .BR wl-clipboard(1) diff --git a/src/password-store.sh b/src/password-store.sh index aef8d72..f496131 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -367,12 +367,13 @@ cmd_init() { cmd_show() { local opts selected_line clip=0 qrcode=0 - opts="$($GETOPT -o q::c:: -l qrcode::,clip:: -n "$PROGRAM" -- "$@")" + opts="$($GETOPT -o :1q::c::: -l qrcode::,clip:: -n "$PROGRAM" -- "$@")" local err=$? eval set -- "$opts" while true; do case $1 in -q|--qrcode) qrcode=1; selected_line="${2:-1}"; shift 2 ;; -c|--clip) clip=1; selected_line="${2:-1}"; shift 2 ;; + -1) selected_line=1; shift ;; --) shift; break ;; esac done @@ -383,7 +384,7 @@ cmd_show() { local passfile="$PREFIX/$path.gpg" check_sneaky_paths "$path" if [[ -f $passfile ]]; then - if [[ $clip -eq 0 && $qrcode -eq 0 ]]; then + if [[ $clip -eq 0 && $qrcode -eq 0 && -z $selected_line ]]; then pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | $BASE64)" || exit $? echo "$pass" | $BASE64 -d else @@ -394,6 +395,8 @@ cmd_show() { clip "$pass" "$path" elif [[ $qrcode -eq 1 ]]; then qrcode "$pass" "$path" + else + echo "$pass" fi fi elif [[ -d $PREFIX/$path ]]; then -- 2.30.2 From minshall at umich.edu Tue Dec 21 07:41:51 2021 From: minshall at umich.edu (Greg Minshall) Date: Tue, 21 Dec 2021 10:41:51 +0300 Subject: [RFC PATCH] Add option to print the first line of an entry In-Reply-To: <20211220124026.28413-1-mail@rkta.de> References: <20211220124026.28413-1-mail@rkta.de> Message-ID: <1819944.1640072511@apollo2.minshall.org> Rene, i wonder if it might make sense to do this as a separate extension, a companion, e.g., to pass-extension-tail? cheers, Greg From mail at rkta.de Wed Dec 22 12:23:42 2021 From: mail at rkta.de (Rene Kita) Date: Wed, 22 Dec 2021 13:23:42 +0100 Subject: [RFC PATCH] Add option to print the first line of an entry In-Reply-To: <1819944.1640072511@apollo2.minshall.org> References: <20211220124026.28413-1-mail@rkta.de> <1819944.1640072511@apollo2.minshall.org> Message-ID: On Tue, Dec 21, 2021 at 10:41:51AM +0300, Greg Minshall wrote: > Rene, Hi Greg! > i wonder if it might make sense to do this as a separate extension, a > companion, e.g., to pass-extension-tail? I don't think this warrants a separate extension. An extension would be a lot of code to avoid a '| sed 1q'. The code to get the first line is already in pass. The idea is to make piping the password as easy as copying it to the clipboard. IMHO this should be a feature of pass. > cheers, Greg > Cheers, Rene From minshall at umich.edu Wed Dec 22 14:04:05 2021 From: minshall at umich.edu (Greg Minshall) Date: Wed, 22 Dec 2021 17:04:05 +0300 Subject: [RFC PATCH] Add option to print the first line of an entry In-Reply-To: References: <20211220124026.28413-1-mail@rkta.de> <1819944.1640072511@apollo2.minshall.org> Message-ID: <2038845.1640181845@apollo2.minshall.org> Rene, > The idea is to make piping the password as easy as copying it to the > clipboard. IMHO this should be a feature of pass. easy is good! here is how i, at least, use `pass tail` (*): ---- bash wonderful (master): {316} pass tail foo/bar username: everyone at example.com bash wonderful (master): {317} ---- on the question of whether this is easier, harder, i am neutral! cheers, Greg (*) once i have it installed, e.g., in ---- /usr/local/lib/password-store/extensions/tail.bash ---- From aclopte at gmail.com Sat Dec 25 09:19:59 2021 From: aclopte at gmail.com (Johannes Altmanninger) Date: Sat, 25 Dec 2021 10:19:59 +0100 Subject: [RFC PATCH] Add option to print the first line of an entry In-Reply-To: <20211220124026.28413-1-mail@rkta.de> References: <20211220124026.28413-1-mail@rkta.de> Message-ID: <20211225091959.2x4367quz7uuigdq@gmail.com> On Mon, Dec 20, 2021 at 01:40:26PM +0100, Rene Kita wrote: > This commit enables the use of '-1' to print only the first line of an > entry. A typical use-case would be: 'password=$(pass -1 example.org)' or > 'pass -1 example.org | tmux loadb -'. Before this change one had to use > 'sed 1q' or similar when using multi-line entries. I like this feature, thanks. It adds convenience, and is consistent with --clip= and --qrcode= Of course -1 is probably way less common than --clip, so maybe it's not worth it, I'm not sure. (Regarding the other thread, I also don't think this should be pushed to extensions, since it's a pretty common/core feature, and making the user type the extension name kind of defeats the point.) The synopsis on error (like "pass -h") also needs an update: diff --git a/src/password-store.sh b/src/password-store.sh index 77f7ad5..bb50431 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -378,7 +378,7 @@ cmd_show() { --) shift; break ;; esac done - [[ $err -ne 0 || ( $qrcode -eq 1 && $clip -eq 1 ) ]] && die "Usage: $PROGRAM $COMMAND [--clip[=line-number],-c[line-number]] [--qrcode[=line-number],-q[line-number]] [pass-name]" + [[ $err -ne 0 || ( $qrcode -eq 1 && $clip -eq 1 ) ]] && die "Usage: $PROGRAM $COMMAND [-1] [--clip[=line-number],-c[line-number]] [--qrcode[=line-number],-q[line-number]] [pass-name]" local pass local path="$1" > > Signed-off-by: Rene Kita > --- > man/pass.1 | 9 +++++---- > src/password-store.sh | 7 +++++-- > 2 files changed, 10 insertions(+), 6 deletions(-) > > diff --git a/man/pass.1 b/man/pass.1 > index a555dcb..cd0ebf0 100644 > --- a/man/pass.1 > +++ b/man/pass.1 > @@ -94,10 +94,11 @@ List names of passwords inside the tree that match \fIpass-names\fP by using the > .BR tree (1) > program. This command is alternatively named \fBsearch\fP. > .TP > -\fBshow\fP [ \fI--clip\fP[=\fIline-number\fP], \fI-c\fP[\fIline-number\fP] ] [ \fI--qrcode\fP[=\fIline-number\fP], \fI-q\fP[\fIline-number\fP] ] \fIpass-name\fP > -Decrypt and print a password named \fIpass-name\fP. If \fI--clip\fP or \fI-c\fP > -is specified, do not print the password but instead copy the first (or otherwise specified) > -line to the clipboard using > +\fBshow\fP [ \fI-1\fP ] [ \fI--clip\fP[=\fIline-number\fP], \fI-c\fP[\fIline-number\fP] ] [ \fI--qrcode\fP[=\fIline-number\fP], \fI-q\fP[\fIline-number\fP] ] \fIpass-name\fP > +Decrypt and print a password named \fIpass-name\fP. If \fI-1\fP is specified, > +print only the first line. If \fI--clip\fP or \fI-c\fP is specified, do not > +print the password but instead copy the first (or otherwise specified) line to > +the clipboard using > .BR xclip (1) > or > .BR wl-clipboard(1) > diff --git a/src/password-store.sh b/src/password-store.sh > index aef8d72..f496131 100755 > --- a/src/password-store.sh > +++ b/src/password-store.sh > @@ -367,12 +367,13 @@ cmd_init() { > > cmd_show() { > local opts selected_line clip=0 qrcode=0 > - opts="$($GETOPT -o q::c:: -l qrcode::,clip:: -n "$PROGRAM" -- "$@")" > + opts="$($GETOPT -o :1q::c::: -l qrcode::,clip:: -n "$PROGRAM" -- "$@")" > local err=$? > eval set -- "$opts" > while true; do case $1 in > -q|--qrcode) qrcode=1; selected_line="${2:-1}"; shift 2 ;; > -c|--clip) clip=1; selected_line="${2:-1}"; shift 2 ;; > + -1) selected_line=1; shift ;; > --) shift; break ;; > esac done > > @@ -383,7 +384,7 @@ cmd_show() { > local passfile="$PREFIX/$path.gpg" > check_sneaky_paths "$path" > if [[ -f $passfile ]]; then > - if [[ $clip -eq 0 && $qrcode -eq 0 ]]; then > + if [[ $clip -eq 0 && $qrcode -eq 0 && -z $selected_line ]]; then > pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | $BASE64)" || exit $? > echo "$pass" | $BASE64 -d > else > @@ -394,6 +395,8 @@ cmd_show() { > clip "$pass" "$path" > elif [[ $qrcode -eq 1 ]]; then > qrcode "$pass" "$path" > + else > + echo "$pass" > fi > fi > elif [[ -d $PREFIX/$path ]]; then > -- > 2.30.2 > From sven.willenbuecher at Kuehne-Nagel.com Mon Dec 27 10:57:55 2021 From: sven.willenbuecher at Kuehne-Nagel.com (Willenbuecher, Sven / Kuehne + Nagel / Ham MI-GI) Date: Mon, 27 Dec 2021 10:57:55 +0000 Subject: Get the "pass" password manager running on AIX Message-ID: <9058730d7e0b42d59d583356f93df0dd@Kuehne-Nagel.com> Dear pass maintainers, The documentation of the pass program does not say anything about the supported platforms. I would like to use it on an AIX 7.2 system. I have used https://git.zx2c4.com/password-store/snapshot/password-store-1.7.4.tar.xz for the installation and applied the attached patches. With these patches I was able to execute all tests successfully. One issue that I was not able to overcome refers to src/password-store.sh:370: opts="$($GETOPT -o q::c:: -l qrcode::,clip:: -n "$PROGRAM" -- "$@")" The AIX getopt does not know the double colons syntax. I don't know how to fix that because I have never worked with optional option arguments and I doubt that I would ever use this kind or proprietary feature. Please check, if the patches could be applied to the existing pass source code. Thanks and kind regards Sven K?hne + Nagel (AG & Co.) KG Rechtsform: Kommanditgesellschaft, Bremen HRA 21928, USt-IdNr.: DE 812773878. Gesch?ftsleitung K?hne + Nagel (AG & Co.) KG: Holger Ketz (Vors.), Simon Bitter, Martin Brinkmann, Lars-Olof Gr?n, Matthias Knicky, Axel Krichel, Johannes Trimborn, Lars Wedel. Pers?nlich haftende Gesellschafterin: K?hne & Nagel A.G., Rechtsform: Aktiengesellschaft nach luxemburgischem Recht, HR-Nr.: B 18745, Gesch?ftsf?hrendes Verwaltungsratsmitglied: Karl Gernandt. Gesch?ftsleitung Region Europa: Dr. Hansj?rg Rodi (Vors.), Ants Anupold, Dominic Edmonds, Thierry Held, Uwe H?tt, Richard Huhn, Jan-Hendrik K?stergarten, Andr? Schiffer, Heiko Schuhmacher. Wir arbeiten ausschlie?lich auf Grundlage der Allgemeinen Deutschen Spediteurbedingungen 2017 (ADSp 2017). Hinweis: Die ADSp 2017 weichen in Ziffer 23 hinsichtlich des Haftungsh?chstbetrages f?r G?tersch?den (? 431 HGB) vom Gesetz ab, indem sie die Haftung bei multimodalen Transporten unter Einschluss einer Seebef?rderung und bei unbekanntem Schadenort auf 2 SZR/kg und im ?brigen die Regelhaftung von 8,33 SZR/kg zus?tzlich auf 1,25 Millionen Euro je Schadenfall sowie 2,5 Millionen Euro je Schadenereignis, mindestens aber 2 SZR/kg, beschr?nken. Die ADSp sind auf unserer Webseite als Download erh?ltlich. Auf Anfrage senden wir Ihnen diese auch gerne zu. -------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-add-hints-script-for-the-platform-aix.patch Type: application/octet-stream Size: 3597 bytes Desc: 0001-add-hints-script-for-the-platform-aix.patch URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0002-use-new-VERBOSE_MODE-macro-variable.patch Type: application/octet-stream Size: 3689 bytes Desc: 0002-use-new-VERBOSE_MODE-macro-variable.patch URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0003-use-new-GREP_COLOR_OPTION-macro-variable.patch Type: application/octet-stream Size: 1182 bytes Desc: 0003-use-new-GREP_COLOR_OPTION-macro-variable.patch URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 0004-implement-a-LINUX-to-AIX-getopt-converter-function.patch Type: application/octet-stream Size: 1455 bytes Desc: 0004-implement-a-LINUX-to-AIX-getopt-converter-function.patch URL: From aclopte at gmail.com Tue Dec 28 18:19:53 2021 From: aclopte at gmail.com (Johannes Altmanninger) Date: Tue, 28 Dec 2021 19:19:53 +0100 Subject: Get the "pass" password manager running on AIX In-Reply-To: <9058730d7e0b42d59d583356f93df0dd@Kuehne-Nagel.com> References: <9058730d7e0b42d59d583356f93df0dd@Kuehne-Nagel.com> Message-ID: <20211228180825.2cjid2kyrg6cwte5@gmail.com> On Mon, Dec 27, 2021 at 10:57:55AM +0000, Willenbuecher, Sven / Kuehne + Nagel / Ham MI-GI wrote: > Dear pass maintainers, > > The documentation of the pass program does not say anything about the > supported platforms. I would like to use it on an AIX 7.2 system. I have used > > https://git.zx2c4.com/password-store/snapshot/password-store-1.7.4.tar.xz > > for the installation and applied the attached patches. With these patches > I was able to execute all tests successfully. One issue that I was not > able to overcome refers to > > src/password-store.sh:370: opts="$($GETOPT -o q::c:: -l qrcode::,clip:: -n "$PROGRAM" -- "$@")" > > The AIX getopt does not know the double colons syntax. I don't know how > to fix that because I have never worked with optional option arguments > and I doubt that I would ever use this kind or proprietary feature. The readme mentions http://software.frodo.looijaard.name/getopt/ can you use that? The existing OpenBSD platform support indicates that the binary is called "gnugetopt" there, presumably to avoid a name clash. > From: Sven Willenbuecher > Date: Thu, 23 Dec 2021 11:42:40 +0100 > Subject: [PATCH 2/4] use new VERBOSE_MODE macro variable > > --- > src/password-store.sh | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > > diff --git a/src/password-store.sh b/src/password-store.sh > index 6abd8ce..4657145 100755 > --- a/src/password-store.sh > +++ b/src/password-store.sh > @@ -245,7 +245,7 @@ tmpdir() { > GETOPT="getopt" > SHRED="shred -f -z" > BASE64="base64" > -MKDIR="mkdir -p -v" > +VERBOSE_MODE="-v" This patch obsoletes parts of the first patch, it would be easier to read if MKDIR was never introduced > From: Sven Willenbuecher > Date: Thu, 23 Dec 2021 15:24:36 +0100 > Subject: [PATCH 4/4] implement a LINUX to AIX getopt converter function > > --- > src/platform/aix.sh | 47 ++++++++++++++++++++++++++++++++++++++++++++- > 1 file changed, 46 insertions(+), 1 deletion(-) > > diff --git a/src/platform/aix.sh b/src/platform/aix.sh > index 03a3958..93a120f 100644 > --- a/src/platform/aix.sh > +++ b/src/platform/aix.sh > @@ -1 +1,46 @@ > -MKDIR='mkdir -p' > +#!/usr/bin/sh > + > +quote() ( > + arg=$1 > + > + quoted_arg="'" > + while true; do > + case ${arg} in > + *\'* ) quoted_arg=${quoted_arg}${arg%%\'*}"'\''" > + arg=${arg#*\'};; > + * ) break;; > + esac > + done > + [ -z "${arg}" ] || quoted_arg=${quoted_arg}${arg} > + quoted_arg=${quoted_arg}"'" > + > + printf %s "${quoted_arg}" > +) > + > +quote_lazy() { > + case $1 in > + *[\ \']* ) quote "$1";; > + * ) printf %s "${1:-''}";; I'm not sure if this is safe, what if the input contains characters like $? I'd always quote unless the input is from a set of known-safe characters. > + esac > +} > + > +getopt() ( > + while getopts :ahl:n:o:qQs:uTV opt; do > + case ${opt} in > + o ) shortopts=$OPTARG;; > + * ) true;; > + esac > + done > + getopt_args= > + shift $((OPTIND - 1)) > + for arg; do > + quoted_arg=$(quote_lazy "${arg}") > + quoted_arg=$(quote_lazy "${quoted_arg}") You quote twice but eval only once. I don't think that works as intended (unless getopt performs shell expansions?). In practice, it probably works for args without ' or space because of the lazy_quote trick. > + getopt_args="${getopt_args} ${quoted_arg}" > + done > + eval command getopt "${shortopts}" "${getopt_args}" > +) > + > +GETOPT=getopt > +VERBOSE_MODE= > +GREP_COLOR_OPTION= these should be in their respective patches. Perhaps squashing into a larger commit also works here. > -- > 2.20.1 From sven.willenbuecher at Kuehne-Nagel.com Wed Dec 29 07:12:20 2021 From: sven.willenbuecher at Kuehne-Nagel.com (Willenbuecher, Sven / Kuehne + Nagel / Ham MI-GI) Date: Wed, 29 Dec 2021 07:12:20 +0000 Subject: AW: Get the "pass" password manager running on AIX In-Reply-To: <20211228180825.2cjid2kyrg6cwte5@gmail.com> References: <9058730d7e0b42d59d583356f93df0dd@Kuehne-Nagel.com> <20211228180825.2cjid2kyrg6cwte5@gmail.com> Message-ID: >The readme mentions http://software.frodo.looijaard.name/getopt/ >can you use that? >The existing OpenBSD platform support indicates that the binary is called "gnugetopt" there, presumably to avoid a name clash. It is the policy of the company that I am working for to install either official IBM/AIX filesets or packages from the "AIX Toolbox for Linux Applications" repository (https://www.ibm.com/support/pages/aix-toolbox-linux-applications-downloads-alpha). Sorry but the answer to your question is no. >This patch obsoletes parts of the first patch, it would be easier to read if MKDIR was never introduced Yes a later commit (the one that introduces the VERBOSE_MODE macro variable) , obsoletes the introduction of the MKDIR macro variable. I have never worked with git patches before. Therefore I have created a patch per commit, knowing that later commits undo/revert things that I have implemented before. >I'm not sure if this is safe, what if the input contains characters like $? >I'd always quote unless the input is from a set of known-safe characters. I don't understand what "safe" means. quote_lazy() applies strong quoting if the argument to be quoted contains either SPACES and/or SINGLE QUOTES. Interpolation of variables like $? will happen before quoting. >You quote twice but eval only once. I don't think that works as intended (unless getopt performs shell expansions?). >In practice, it probably works for args without ' or space because of the lazy_quote trick. The following is an extract of https://linux.die.net/man/1/getopt "Traditional implementations of getopt(1) are unable to cope with whitespace and other (shell-specific) special characters in arguments and non-option parameters. To solve this problem, this implementation can generate quoted output which must once again be interpreted by the shell (usually by using the eval command). This has the effect of preserving those characters, but you must call getopt in a way that is no longer compatible with other versions (the second or third format in the SYNOPSIS). To determine whether this enhanced version of getopt(1) is installed, a special test option (-T) can be used." This should explain why quoting twice with only one eval is needed, if getopt is traditionally implemented. Here is a simplistic more concrete example AIX getopt (traditional implementation) getopt mef -e 'I am a cred with lots of spaces' -e -- I am a cred with lots of spaces LINUX getopt getopt -o mef -- -e 'I am a cred with lots of spaces' -e -- 'I am a cred with lots of spaces' >these should be in their respective patches. >Perhaps squashing into a larger commit also works here. As mentioned before git patches are new to me. Help on how to consolidate the 4 commits that I have made into one single net patch, would be very much appreciated. K?hne + Nagel (AG & Co.) KG Rechtsform: Kommanditgesellschaft, Bremen HRA 21928, USt-IdNr.: DE 812773878. Gesch?ftsleitung K?hne + Nagel (AG & Co.) KG: Holger Ketz (Vors.), Simon Bitter, Martin Brinkmann, Lars-Olof Gr?n, Matthias Knicky, Axel Krichel, Johannes Trimborn, Lars Wedel. Pers?nlich haftende Gesellschafterin: K?hne & Nagel A.G., Rechtsform: Aktiengesellschaft nach luxemburgischem Recht, HR-Nr.: B 18745, Gesch?ftsf?hrendes Verwaltungsratsmitglied: Karl Gernandt. Gesch?ftsleitung Region Europa: Dr. Hansj?rg Rodi (Vors.), Ants Anupold, Dominic Edmonds, Thierry Held, Uwe H?tt, Richard Huhn, Jan-Hendrik K?stergarten, Andr? Schiffer, Heiko Schuhmacher. Wir arbeiten ausschlie?lich auf Grundlage der Allgemeinen Deutschen Spediteurbedingungen 2017 (ADSp 2017). Hinweis: Die ADSp 2017 weichen in Ziffer 23 hinsichtlich des Haftungsh?chstbetrages f?r G?tersch?den (? 431 HGB) vom Gesetz ab, indem sie die Haftung bei multimodalen Transporten unter Einschluss einer Seebef?rderung und bei unbekanntem Schadenort auf 2 SZR/kg und im ?brigen die Regelhaftung von 8,33 SZR/kg zus?tzlich auf 1,25 Millionen Euro je Schadenfall sowie 2,5 Millionen Euro je Schadenereignis, mindestens aber 2 SZR/kg, beschr?nken. Die ADSp sind auf unserer Webseite als Download erh?ltlich. Auf Anfrage senden wir Ihnen diese auch gerne zu. From aclopte at gmail.com Wed Dec 29 07:25:50 2021 From: aclopte at gmail.com (Johannes Altmanninger) Date: Wed, 29 Dec 2021 08:25:50 +0100 Subject: Get the "pass" password manager running on AIX In-Reply-To: References: <9058730d7e0b42d59d583356f93df0dd@Kuehne-Nagel.com> <20211228180825.2cjid2kyrg6cwte5@gmail.com> Message-ID: <20211229072550.iqvnppckmc4kxrbi@gmail.com> On Wed, Dec 29, 2021 at 07:12:20AM +0000, Willenbuecher, Sven / Kuehne + Nagel / Ham MI-GI wrote: > >these should be in their respective patches. > >Perhaps squashing into a larger commit also works here. > > As mentioned before git patches are new to me. Help on how to consolidate the 4 commits that I have made into one single net patch, would be very much appreciated. Sure; here is a nice tutorial for using Git's oddly named "interactive rebase" to change history: https://git-rebase.io/ Also, I think it's more conventional to send patches inline rather than as attachments; if you're motivated to do that I recommend using "git send-email". Once you have configured authentication, it's pretty self-explanatory; there's a tutorial at https://git-send-email.io/ Will take a look at the rest later (I didn't even check what the double colon in getopt does, I guess it would be nice to explain that in the commit message) From sven.willenbuecher at Kuehne-Nagel.com Wed Dec 29 11:40:39 2021 From: sven.willenbuecher at Kuehne-Nagel.com (Willenbuecher, Sven / Kuehne + Nagel / Ham MI-GI) Date: Wed, 29 Dec 2021 11:40:39 +0000 Subject: AW: Get the "pass" password manager running on AIX In-Reply-To: <20211229072550.iqvnppckmc4kxrbi@gmail.com> References: <9058730d7e0b42d59d583356f93df0dd@Kuehne-Nagel.com> <20211228180825.2cjid2kyrg6cwte5@gmail.com> <20211229072550.iqvnppckmc4kxrbi@gmail.com> Message-ID: <7909255a643c4a3eb5d62bd3679ad308@Kuehne-Nagel.com> I have now cleanup my commit history following your recommendation to interactively rebase. 2 commits remain 8154b55 - 2021-12-29 10:13:33 +0100 (HEAD -> master) implement a LINUX to AIX getopt converter function 72f3b9a - 2021-12-29 10:12:35 +0100 add hints script for the platform aix Should I resend patche"s" for them using "git send-email"? K?hne + Nagel (AG & Co.) KG Rechtsform: Kommanditgesellschaft, Bremen HRA 21928, USt-IdNr.: DE 812773878. Gesch?ftsleitung K?hne + Nagel (AG & Co.) KG: Holger Ketz (Vors.), Simon Bitter, Martin Brinkmann, Lars-Olof Gr?n, Matthias Knicky, Axel Krichel, Johannes Trimborn, Lars Wedel. Pers?nlich haftende Gesellschafterin: K?hne & Nagel A.G., Rechtsform: Aktiengesellschaft nach luxemburgischem Recht, HR-Nr.: B 18745, Gesch?ftsf?hrendes Verwaltungsratsmitglied: Karl Gernandt. Gesch?ftsleitung Region Europa: Dr. Hansj?rg Rodi (Vors.), Ants Anupold, Dominic Edmonds, Thierry Held, Uwe H?tt, Richard Huhn, Jan-Hendrik K?stergarten, Andr? Schiffer, Heiko Schuhmacher. Wir arbeiten ausschlie?lich auf Grundlage der Allgemeinen Deutschen Spediteurbedingungen 2017 (ADSp 2017). Hinweis: Die ADSp 2017 weichen in Ziffer 23 hinsichtlich des Haftungsh?chstbetrages f?r G?tersch?den (? 431 HGB) vom Gesetz ab, indem sie die Haftung bei multimodalen Transporten unter Einschluss einer Seebef?rderung und bei unbekanntem Schadenort auf 2 SZR/kg und im ?brigen die Regelhaftung von 8,33 SZR/kg zus?tzlich auf 1,25 Millionen Euro je Schadenfall sowie 2,5 Millionen Euro je Schadenereignis, mindestens aber 2 SZR/kg, beschr?nken. Die ADSp sind auf unserer Webseite als Download erh?ltlich. Auf Anfrage senden wir Ihnen diese auch gerne zu. From aclopte at gmail.com Wed Dec 29 12:11:05 2021 From: aclopte at gmail.com (Johannes Altmanninger) Date: Wed, 29 Dec 2021 13:11:05 +0100 Subject: Get the "pass" password manager running on AIX In-Reply-To: <7909255a643c4a3eb5d62bd3679ad308@Kuehne-Nagel.com> References: <9058730d7e0b42d59d583356f93df0dd@Kuehne-Nagel.com> <20211228180825.2cjid2kyrg6cwte5@gmail.com> <20211229072550.iqvnppckmc4kxrbi@gmail.com> <7909255a643c4a3eb5d62bd3679ad308@Kuehne-Nagel.com> Message-ID: <20211229121105.ueujpp4mxsp3fmij@gmail.com> On Wed, Dec 29, 2021 at 11:40:39AM +0000, Willenbuecher, Sven / Kuehne + Nagel / Ham MI-GI wrote: > I have now cleanup my commit history following your recommendation to interactively rebase. 2 commits remain > > 8154b55 - 2021-12-29 10:13:33 +0100 (HEAD -> master) implement a LINUX to AIX getopt converter function > 72f3b9a - 2021-12-29 10:12:35 +0100 add hints script for the platform aix > > Should I resend patche"s" for them using "git send-email"? Sure, you can send the last two commits with the "-2" argument, or equivalently "origin/master..", which means send every commit since origin/master. Something like this should work git send-email -v2 origin/master.. \ --to=password-store at lists.zx2c4.com \ --in-reply-to=7909255a643c4a3eb5d62bd3679ad308 at Kuehne-Nagel.com (I think that doesn't keep other people from the thread in CC but that's okay) From sven.willenbuecher at kuehne-nagel.com Wed Dec 29 12:38:30 2021 From: sven.willenbuecher at kuehne-nagel.com (Sven Willenbuecher) Date: Wed, 29 Dec 2021 13:38:30 +0100 Subject: [PATCH v2 1/2] add hints script for the platform aix In-Reply-To: <7909255a643c4a3eb5d62bd3679ad308@Kuehne-Nagel.com> References: <7909255a643c4a3eb5d62bd3679ad308@Kuehne-Nagel.com> Message-ID: <20211229123832.23069008-1-sven.willenbuecher@kuehne-nagel.com> - introduce new macro variables VERBOSE_MODE and GREP_COLOR_OPTION - get rid of the options -iname and -print0 of GNU find because the aix find does not known these --- src/password-store.sh | 26 ++++++++++++++------------ src/platform/aix.sh | 2 ++ 2 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 src/platform/aix.sh diff --git a/src/password-store.sh b/src/password-store.sh index aef8d72..3da3a61 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -137,7 +137,7 @@ reencrypt_path() { mv "$passfile_temp" "$passfile" || rm -f "$passfile_temp" fi prev_gpg_recipients="${GPG_RECIPIENTS[*]}" - done < <(find "$1" -path '*/.git' -prune -o -path '*/.extensions' -prune -o -iname '*.gpg' -print0) + done < <(find "$1" -path '*/.git' -prune -o -path '*/.extensions' -prune -o -name '*.[Gg][Pp][Gg]' -exec printf '%s\0' {} \;) } check_sneaky_paths() { local path @@ -245,6 +245,8 @@ tmpdir() { GETOPT="getopt" SHRED="shred -f -z" BASE64="base64" +VERBOSE_MODE="-v" +GREP_COLOR_OPTION="--color=always" source "$(dirname "$0")/platform/$(uname | cut -d _ -f 1 | tr '[:upper:]' '[:lower:]').sh" 2>/dev/null # PLATFORM_FUNCTION_FILE @@ -337,14 +339,14 @@ cmd_init() { if [[ $# -eq 1 && -z $1 ]]; then [[ ! -f "$gpg_id" ]] && die "Error: $gpg_id does not exist and so cannot be removed." - rm -v -f "$gpg_id" || exit 1 + rm $VERBOSE_MODE -f "$gpg_id" || exit 1 if [[ -n $INNER_GIT_DIR ]]; then git -C "$INNER_GIT_DIR" rm -qr "$gpg_id" git_commit "Deinitialize ${gpg_id}${id_path:+ ($id_path)}." fi rmdir -p "${gpg_id%/*}" 2>/dev/null else - mkdir -v -p "$PREFIX/$id_path" + mkdir -p $VERBOSE_MODE "$PREFIX/$id_path" printf "%s\n" "$@" > "$gpg_id" local id_print="$(printf "%s, " "$@")" echo "Password store initialized for ${id_print%, }${id_path:+ ($id_path)}" @@ -421,7 +423,7 @@ cmd_grep() { [[ $# -lt 1 ]] && die "Usage: $PROGRAM $COMMAND [GREPOPTIONS] search-string" local passfile grepresults while read -r -d "" passfile; do - grepresults="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | grep --color=always "$@")" + grepresults="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | grep $GREP_COLOR_OPTION "$@")" [[ $? -ne 0 ]] && continue passfile="${passfile%.gpg}" passfile="${passfile#$PREFIX/}" @@ -430,7 +432,7 @@ cmd_grep() { passfile="${passfile##*/}" printf "\e[94m%s\e[1m%s\e[0m:\n" "$passfile_dir" "$passfile" echo "$grepresults" - done < <(find -L "$PREFIX" -path '*/.git' -prune -o -path '*/.extensions' -prune -o -iname '*.gpg' -print0) + done < <(find -L "$PREFIX" -path '*/.git' -prune -o -path '*/.extensions' -prune -o -name '*.[Gg][Pp][Gg]' -exec printf '%s\0' {} \;) } cmd_insert() { @@ -453,7 +455,7 @@ cmd_insert() { [[ $force -eq 0 && -e $passfile ]] && yesno "An entry already exists for $path. Overwrite it?" - mkdir -p -v "$PREFIX/$(dirname -- "$path")" + mkdir -p $VERBOSE_MODE "$PREFIX/$(dirname -- "$path")" set_gpg_recipients "$(dirname -- "$path")" if [[ $multiline -eq 1 ]]; then @@ -487,7 +489,7 @@ cmd_edit() { local path="${1%/}" check_sneaky_paths "$path" - mkdir -p -v "$PREFIX/$(dirname -- "$path")" + mkdir -p $VERBOSE_MODE "$PREFIX/$(dirname -- "$path")" set_gpg_recipients "$(dirname -- "$path")" local passfile="$PREFIX/$path.gpg" set_git "$passfile" @@ -529,7 +531,7 @@ cmd_generate() { check_sneaky_paths "$path" [[ $length =~ ^[0-9]+$ ]] || die "Error: pass-length \"$length\" must be a number." [[ $length -gt 0 ]] || die "Error: pass-length must be greater than zero." - mkdir -p -v "$PREFIX/$(dirname -- "$path")" + mkdir -p $VERBOSE_MODE "$PREFIX/$(dirname -- "$path")" set_gpg_recipients "$(dirname -- "$path")" local passfile="$PREFIX/$path.gpg" set_git "$passfile" @@ -584,7 +586,7 @@ cmd_delete() { [[ $force -eq 1 ]] || yesno "Are you sure you would like to delete $path?" - rm $recursive -f -v "$passfile" + rm $recursive -f $VERBOSE_MODE "$passfile" set_git "$passfile" if [[ -n $INNER_GIT_DIR && ! -e $passfile ]]; then git -C "$INNER_GIT_DIR" rm -qr "$passfile" @@ -618,7 +620,7 @@ cmd_copy_move() { echo "$old_path" [[ -e $old_path ]] || die "Error: $1 is not in the password store." - mkdir -p -v "${new_path%/*}" + mkdir -p $VERBOSE_MODE "${new_path%/*}" [[ -d $old_path || -d $new_path || $new_path == */ ]] || new_path="${new_path}.gpg" local interactive="-i" @@ -626,7 +628,7 @@ cmd_copy_move() { set_git "$new_path" if [[ $move -eq 1 ]]; then - mv $interactive -v "$old_path" "$new_path" || exit 1 + mv $interactive $VERBOSE_MODE "$old_path" "$new_path" || exit 1 [[ -e "$new_path" ]] && reencrypt_path "$new_path" set_git "$new_path" @@ -643,7 +645,7 @@ cmd_copy_move() { fi rmdir -p "$old_dir" 2>/dev/null else - cp $interactive -r -v "$old_path" "$new_path" || exit 1 + cp $interactive -r $VERBOSE_MODE "$old_path" "$new_path" || exit 1 [[ -e "$new_path" ]] && reencrypt_path "$new_path" git_add_file "$new_path" "Copy ${1} to ${2}." fi diff --git a/src/platform/aix.sh b/src/platform/aix.sh new file mode 100644 index 0000000..e94ee73 --- /dev/null +++ b/src/platform/aix.sh @@ -0,0 +1,2 @@ +VERBOSE_MODE= +GREP_COLOR_OPTION= -- 2.31.1 From sven.willenbuecher at kuehne-nagel.com Wed Dec 29 12:38:31 2021 From: sven.willenbuecher at kuehne-nagel.com (Sven Willenbuecher) Date: Wed, 29 Dec 2021 13:38:31 +0100 Subject: [PATCH v2 2/2] implement a LINUX to AIX getopt converter function In-Reply-To: <20211229123832.23069008-1-sven.willenbuecher@kuehne-nagel.com> References: <7909255a643c4a3eb5d62bd3679ad308@Kuehne-Nagel.com> <20211229123832.23069008-1-sven.willenbuecher@kuehne-nagel.com> Message-ID: <20211229123832.23069008-2-sven.willenbuecher@kuehne-nagel.com> --- src/platform/aix.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/platform/aix.sh b/src/platform/aix.sh index e94ee73..93a120f 100644 --- a/src/platform/aix.sh +++ b/src/platform/aix.sh @@ -1,2 +1,46 @@ +#!/usr/bin/sh + +quote() ( + arg=$1 + + quoted_arg="'" + while true; do + case ${arg} in + *\'* ) quoted_arg=${quoted_arg}${arg%%\'*}"'\''" + arg=${arg#*\'};; + * ) break;; + esac + done + [ -z "${arg}" ] || quoted_arg=${quoted_arg}${arg} + quoted_arg=${quoted_arg}"'" + + printf %s "${quoted_arg}" +) + +quote_lazy() { + case $1 in + *[\ \']* ) quote "$1";; + * ) printf %s "${1:-''}";; + esac +} + +getopt() ( + while getopts :ahl:n:o:qQs:uTV opt; do + case ${opt} in + o ) shortopts=$OPTARG;; + * ) true;; + esac + done + getopt_args= + shift $((OPTIND - 1)) + for arg; do + quoted_arg=$(quote_lazy "${arg}") + quoted_arg=$(quote_lazy "${quoted_arg}") + getopt_args="${getopt_args} ${quoted_arg}" + done + eval command getopt "${shortopts}" "${getopt_args}" +) + +GETOPT=getopt VERBOSE_MODE= GREP_COLOR_OPTION= -- 2.31.1 From listmail at cox.net Wed Dec 29 14:52:41 2021 From: listmail at cox.net (David A.) Date: Wed, 29 Dec 2021 07:52:41 -0700 Subject: [PATCH v2 1/2] add hints script for the platform aix In-Reply-To: <20211229123832.23069008-1-sven.willenbuecher@kuehne-nagel.com> References: <7909255a643c4a3eb5d62bd3679ad308@Kuehne-Nagel.com> <20211229123832.23069008-1-sven.willenbuecher@kuehne-nagel.com> Message-ID: On Wed, 29 Dec 2021 13:38:30 +0100, Sven Willenbuecher wrote: >- introduce new macro variables VERBOSE_MODE and GREP_COLOR_OPTION >- get rid of the options -iname and -print0 of GNU find because the aix >find does not known these Another path you could take is to use GNU find and grep installed from the Linux Toolbox for AIX. From mail at rkta.de Wed Dec 29 16:19:15 2021 From: mail at rkta.de (Rene Kita) Date: Wed, 29 Dec 2021 17:19:15 +0100 Subject: [RFC PATCH] Add option to print the first line of an entry In-Reply-To: <20211225091959.2x4367quz7uuigdq@gmail.com> References: <20211220124026.28413-1-mail@rkta.de> <20211225091959.2x4367quz7uuigdq@gmail.com> Message-ID: On Sat, Dec 25, 2021 at 10:19:59AM +0100, Johannes Altmanninger wrote: > On Mon, Dec 20, 2021 at 01:40:26PM +0100, Rene Kita wrote: > > This commit enables the use of '-1' to print only the first line of an > > entry. A typical use-case would be: 'password=$(pass -1 example.org)' or > > 'pass -1 example.org | tmux loadb -'. Before this change one had to use > > 'sed 1q' or similar when using multi-line entries. > > I like this feature, thanks. It adds convenience, and is consistent with > --clip= and --qrcode= Thanks for your feedback! > Of course -1 is probably way less common than --clip, so maybe it's not > worth it, I'm not sure. I have to disagree. ;) I need -1 way more often then --clip. But maybe I just have an unusual workflow. > (Regarding the other thread, I also don't think this should be pushed to > extensions, since it's a pretty common/core feature, and making the user > type the extension name kind of defeats the point.) > > The synopsis on error (like "pass -h") also needs an update: > > diff --git a/src/password-store.sh b/src/password-store.sh > index 77f7ad5..bb50431 100755 > --- a/src/password-store.sh > +++ b/src/password-store.sh > @@ -378,7 +378,7 @@ cmd_show() { > --) shift; break ;; > esac done > > - [[ $err -ne 0 || ( $qrcode -eq 1 && $clip -eq 1 ) ]] && die "Usage: $PROGRAM $COMMAND [--clip[=line-number],-c[line-number]] [--qrcode[=line-number],-q[line-number]] [pass-name]" > + [[ $err -ne 0 || ( $qrcode -eq 1 && $clip -eq 1 ) ]] && die "Usage: $PROGRAM $COMMAND [-1] [--clip[=line-number],-c[line-number]] [--qrcode[=line-number],-q[line-number]] [pass-name]" > > local pass > local path="$1" Thanks, will add that to v1. The completion files/functions also need an update; I'll add that too. From aclopte at gmail.com Wed Dec 29 16:28:23 2021 From: aclopte at gmail.com (Johannes Altmanninger) Date: Wed, 29 Dec 2021 17:28:23 +0100 Subject: [RFC PATCH] Add option to print the first line of an entry In-Reply-To: References: <20211220124026.28413-1-mail@rkta.de> <20211225091959.2x4367quz7uuigdq@gmail.com> Message-ID: <20211229162823.elw467w4vnecyzno@gmail.com> On Wed, Dec 29, 2021 at 05:19:15PM +0100, Rene Kita wrote: > On Sat, Dec 25, 2021 at 10:19:59AM +0100, Johannes Altmanninger wrote: > > On Mon, Dec 20, 2021 at 01:40:26PM +0100, Rene Kita wrote: > > > Of course -1 is probably way less common than --clip, so maybe it's not > > worth it, I'm not sure. > I have to disagree. ;) I need -1 way more often then --clip. But maybe I > just have an unusual workflow. yeah it depends on the workflow; stdout should be a first class citizen so I'm in favor. I recently used it in rdesktop -p (pass ...) From mail at rkta.de Wed Dec 29 16:45:43 2021 From: mail at rkta.de (Rene Kita) Date: Wed, 29 Dec 2021 17:45:43 +0100 Subject: [PATCH v2 2/2] implement a LINUX to AIX getopt converter function In-Reply-To: <20211229123832.23069008-2-sven.willenbuecher@kuehne-nagel.com> References: <7909255a643c4a3eb5d62bd3679ad308@Kuehne-Nagel.com> <20211229123832.23069008-1-sven.willenbuecher@kuehne-nagel.com> <20211229123832.23069008-2-sven.willenbuecher@kuehne-nagel.com> Message-ID: On Wed, Dec 29, 2021 at 01:38:31PM +0100, Sven Willenbuecher wrote: > --- > src/platform/aix.sh | 44 ++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 44 insertions(+) > > diff --git a/src/platform/aix.sh b/src/platform/aix.sh > index e94ee73..93a120f 100644 > --- a/src/platform/aix.sh > +++ b/src/platform/aix.sh > @@ -1,2 +1,46 @@ > +#!/usr/bin/sh > + > +quote() ( > + arg=$1 > + > + quoted_arg="'" > + while true; do > + case ${arg} in > + *\'* ) quoted_arg=${quoted_arg}${arg%%\'*}"'\''" > + arg=${arg#*\'};; > + * ) break;; > + esac > + done > + [ -z "${arg}" ] || quoted_arg=${quoted_arg}${arg} > + quoted_arg=${quoted_arg}"'" > + > + printf %s "${quoted_arg}" > +) > + > +quote_lazy() { > + case $1 in > + *[\ \']* ) quote "$1";; > + * ) printf %s "${1:-''}";; > + esac > +} > + > +getopt() ( > + while getopts :ahl:n:o:qQs:uTV opt; do > + case ${opt} in > + o ) shortopts=$OPTARG;; > + * ) true;; > + esac > + done > + getopt_args= > + shift $((OPTIND - 1)) > + for arg; do > + quoted_arg=$(quote_lazy "${arg}") > + quoted_arg=$(quote_lazy "${quoted_arg}") > + getopt_args="${getopt_args} ${quoted_arg}" > + done > + eval command getopt "${shortopts}" "${getopt_args}" > +) > + > +GETOPT=getopt > VERBOSE_MODE= > GREP_COLOR_OPTION= > -- > 2.31.1 > Shouldn't this use the same indentation style as all other files? Rene From kenny.evitt at gmail.com Wed Dec 29 23:55:38 2021 From: kenny.evitt at gmail.com (Kenny Evitt) Date: Wed, 29 Dec 2021 18:55:38 -0500 Subject: Problems in the macOS Terminal app with `pass show -c some/password`? Message-ID: I installed `pass` via Homebrew ? version `v1.7.4`. I'm setting-up a new Mac (macOS 12.0.1) and I've noticed a weird problem with the (macOS included) Terminal app whenever I use the `pass show -c ...` command. It _seems_ like maybe the 'clip' program that's being used doesn't work well with the (new?) version of the Terminal app ? or something along those lines. After I run `show -c` commands (which works), the "Copied ... to clipboard" messages 'clobbers' the shell prompt and then further input doesn't _visibly_ work ? I can type and maybe (?) run commands, but the command seems to be 'erased' after I run it (i.e. hit Enter) and no output is visible in the shell. I'd _guess_ somehow the same 'line' of the shell output/history is being repeatedly overwritten. Any ideas? From yanchenko.igor at gmail.com Thu Dec 30 05:43:34 2021 From: yanchenko.igor at gmail.com (yanchenko.igor at gmail.com) Date: Thu, 30 Dec 2021 07:43:34 +0200 Subject: Problems in the macOS Terminal app with `pass show -c some/password`? In-Reply-To: References: Message-ID: I suggest to record your terminal using script: script logfile.txt pass show -c some/password exit And then check the logfile.txt, which might give you some ideas. On Thu, Dec 30, 2021 at 1:57 AM Kenny Evitt wrote: > > I installed `pass` via Homebrew ? version `v1.7.4`. > > I'm setting-up a new Mac (macOS 12.0.1) and I've noticed a weird > problem with the (macOS included) Terminal app whenever I use the > `pass show -c ...` command. > > It _seems_ like maybe the 'clip' program that's being used doesn't > work well with the (new?) version of the Terminal app ? or something > along those lines. > > After I run `show -c` commands (which works), the "Copied ... to > clipboard" messages 'clobbers' the shell prompt and then further input > doesn't _visibly_ work ? I can type and maybe (?) run commands, but > the command seems to be 'erased' after I run it (i.e. hit Enter) and > no output is visible in the shell. I'd _guess_ somehow the same 'line' > of the shell output/history is being repeatedly overwritten. > > Any ideas? From sven.willenbuecher at Kuehne-Nagel.com Thu Dec 30 06:24:15 2021 From: sven.willenbuecher at Kuehne-Nagel.com (Willenbuecher, Sven / Kuehne + Nagel / Ham MI-GI) Date: Thu, 30 Dec 2021 06:24:15 +0000 Subject: AW: [PATCH v2 1/2] add hints script for the platform aix In-Reply-To: References: <7909255a643c4a3eb5d62bd3679ad308@Kuehne-Nagel.com> <20211229123832.23069008-1-sven.willenbuecher@kuehne-nagel.com> Message-ID: Of course, but I have decided against this approach. My strategy was to use as few add-on programs from the Linux Toolbox for AIX as possible because packages from that repository have to be installed by sysadmins as root. It would be nice, if "pass" could be used by normal user without bothering our sysadmins. -----Urspr?ngliche Nachricht----- Von: David A. Gesendet: Mittwoch, 29. Dezember 2021 15:53 An: Willenbuecher, Sven / Kuehne + Nagel / Ham MI-GI Cc: password-store at lists.zx2c4.com; Willenbuecher, Sven / Kuehne + Nagel / Ham MI-GI Betreff: Re: [PATCH v2 1/2] add hints script for the platform aix On Wed, 29 Dec 2021 13:38:30 +0100, Sven Willenbuecher wrote: >- introduce new macro variables VERBOSE_MODE and GREP_COLOR_OPTION >- get rid of the options -iname and -print0 of GNU find because the aix >find does not known these Another path you could take is to use GNU find and grep installed from the Linux Toolbox for AIX. K?hne + Nagel (AG & Co.) KG Rechtsform: Kommanditgesellschaft, Bremen HRA 21928, USt-IdNr.: DE 812773878. Gesch?ftsleitung K?hne + Nagel (AG & Co.) KG: Holger Ketz (Vors.), Simon Bitter, Martin Brinkmann, Lars-Olof Gr?n, Matthias Knicky, Axel Krichel, Johannes Trimborn, Lars Wedel. Pers?nlich haftende Gesellschafterin: K?hne & Nagel A.G., Rechtsform: Aktiengesellschaft nach luxemburgischem Recht, HR-Nr.: B 18745, Gesch?ftsf?hrendes Verwaltungsratsmitglied: Karl Gernandt. Gesch?ftsleitung Region Europa: Dr. Hansj?rg Rodi (Vors.), Ants Anupold, Dominic Edmonds, Thierry Held, Uwe H?tt, Richard Huhn, Jan-Hendrik K?stergarten, Andr? Schiffer, Heiko Schuhmacher. Wir arbeiten ausschlie?lich auf Grundlage der Allgemeinen Deutschen Spediteurbedingungen 2017 (ADSp 2017). Hinweis: Die ADSp 2017 weichen in Ziffer 23 hinsichtlich des Haftungsh?chstbetrages f?r G?tersch?den (? 431 HGB) vom Gesetz ab, indem sie die Haftung bei multimodalen Transporten unter Einschluss einer Seebef?rderung und bei unbekanntem Schadenort auf 2 SZR/kg und im ?brigen die Regelhaftung von 8,33 SZR/kg zus?tzlich auf 1,25 Millionen Euro je Schadenfall sowie 2,5 Millionen Euro je Schadenereignis, mindestens aber 2 SZR/kg, beschr?nken. Die ADSp sind auf unserer Webseite als Download erh?ltlich. Auf Anfrage senden wir Ihnen diese auch gerne zu. From sven.willenbuecher at Kuehne-Nagel.com Thu Dec 30 06:53:52 2021 From: sven.willenbuecher at Kuehne-Nagel.com (Willenbuecher, Sven / Kuehne + Nagel / Ham MI-GI) Date: Thu, 30 Dec 2021 06:53:52 +0000 Subject: AW: [PATCH v2 2/2] implement a LINUX to AIX getopt converter function In-Reply-To: References: <7909255a643c4a3eb5d62bd3679ad308@Kuehne-Nagel.com> <20211229123832.23069008-1-sven.willenbuecher@kuehne-nagel.com> <20211229123832.23069008-2-sven.willenbuecher@kuehne-nagel.com> Message-ID: <4915c8c6c7184c99a2eea44539d85974@Kuehne-Nagel.com> >Shouldn't this use the same indentation style as all other files? I have changed the indentation style using real tabs only. I will not send an extra patch for that now. Note that the shebang "#!/usr/bin/sh" line exists on purpose: I am checking the POSIX compliance (no bashism) of the aix.sh hints file using shellcheck. K?hne + Nagel (AG & Co.) KG Rechtsform: Kommanditgesellschaft, Bremen HRA 21928, USt-IdNr.: DE 812773878. Gesch?ftsleitung K?hne + Nagel (AG & Co.) KG: Holger Ketz (Vors.), Simon Bitter, Martin Brinkmann, Lars-Olof Gr?n, Matthias Knicky, Axel Krichel, Johannes Trimborn, Lars Wedel. Pers?nlich haftende Gesellschafterin: K?hne & Nagel A.G., Rechtsform: Aktiengesellschaft nach luxemburgischem Recht, HR-Nr.: B 18745, Gesch?ftsf?hrendes Verwaltungsratsmitglied: Karl Gernandt. Gesch?ftsleitung Region Europa: Dr. Hansj?rg Rodi (Vors.), Ants Anupold, Dominic Edmonds, Thierry Held, Uwe H?tt, Richard Huhn, Jan-Hendrik K?stergarten, Andr? Schiffer, Heiko Schuhmacher. Wir arbeiten ausschlie?lich auf Grundlage der Allgemeinen Deutschen Spediteurbedingungen 2017 (ADSp 2017). Hinweis: Die ADSp 2017 weichen in Ziffer 23 hinsichtlich des Haftungsh?chstbetrages f?r G?tersch?den (? 431 HGB) vom Gesetz ab, indem sie die Haftung bei multimodalen Transporten unter Einschluss einer Seebef?rderung und bei unbekanntem Schadenort auf 2 SZR/kg und im ?brigen die Regelhaftung von 8,33 SZR/kg zus?tzlich auf 1,25 Millionen Euro je Schadenfall sowie 2,5 Millionen Euro je Schadenereignis, mindestens aber 2 SZR/kg, beschr?nken. Die ADSp sind auf unserer Webseite als Download erh?ltlich. Auf Anfrage senden wir Ihnen diese auch gerne zu. From mail at rkta.de Thu Dec 30 09:14:53 2021 From: mail at rkta.de (Rene Kita) Date: Thu, 30 Dec 2021 10:14:53 +0100 Subject: [PATCH] Add option to print the first line of an entry Message-ID: <20211230091453.17525-1-mail@rkta.de> This commit enables the use of '-1' to print only the first line of an entry. A typical use-case would be: 'password=$(pass -1 example.org)' or 'pass -1 example.org | tmux loadb -'. Before this change one had to use 'sed 1q' or similar when using multi-line entries. Signed-off-by: Rene Kita --- Changes since the RFC: - Add option to Usage: (shown on error and with -h) - Add option to the completions for bash, fish and zsh man/pass.1 | 9 +++++---- src/completion/pass.bash-completion | 2 +- src/completion/pass.fish-completion | 3 +++ src/completion/pass.zsh-completion | 1 + src/password-store.sh | 9 ++++++--- 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/man/pass.1 b/man/pass.1 index a555dcb..cd0ebf0 100644 --- a/man/pass.1 +++ b/man/pass.1 @@ -94,10 +94,11 @@ List names of passwords inside the tree that match \fIpass-names\fP by using the .BR tree (1) program. This command is alternatively named \fBsearch\fP. .TP -\fBshow\fP [ \fI--clip\fP[=\fIline-number\fP], \fI-c\fP[\fIline-number\fP] ] [ \fI--qrcode\fP[=\fIline-number\fP], \fI-q\fP[\fIline-number\fP] ] \fIpass-name\fP -Decrypt and print a password named \fIpass-name\fP. If \fI--clip\fP or \fI-c\fP -is specified, do not print the password but instead copy the first (or otherwise specified) -line to the clipboard using +\fBshow\fP [ \fI-1\fP ] [ \fI--clip\fP[=\fIline-number\fP], \fI-c\fP[\fIline-number\fP] ] [ \fI--qrcode\fP[=\fIline-number\fP], \fI-q\fP[\fIline-number\fP] ] \fIpass-name\fP +Decrypt and print a password named \fIpass-name\fP. If \fI-1\fP is specified, +print only the first line. If \fI--clip\fP or \fI-c\fP is specified, do not +print the password but instead copy the first (or otherwise specified) line to +the clipboard using .BR xclip (1) or .BR wl-clipboard(1) diff --git a/src/completion/pass.bash-completion b/src/completion/pass.bash-completion index 2d23cbf..266c26b 100644 --- a/src/completion/pass.bash-completion +++ b/src/completion/pass.bash-completion @@ -101,7 +101,7 @@ _pass() _pass_complete_entries ;; show|-*) - COMPREPLY+=($(compgen -W "-c --clip" -- ${cur})) + COMPREPLY+=($(compgen -W "-1 -c --clip" -- ${cur})) _pass_complete_entries 1 ;; insert) diff --git a/src/completion/pass.fish-completion b/src/completion/pass.fish-completion index 0f57dd2..ea804d9 100644 --- a/src/completion/pass.fish-completion +++ b/src/completion/pass.fish-completion @@ -96,11 +96,14 @@ complete -c $PROG -f -n '__fish_pass_needs_command' -a edit -d 'Command: edit pa complete -c $PROG -f -n '__fish_pass_uses_command edit' -a "(__fish_pass_print_entries)" complete -c $PROG -f -n '__fish_pass_needs_command' -a show -d 'Command: show existing password' +complete -c $PROG -f -n '__fish_pass_uses_command show' -s 1 -d 'Show password only' complete -c $PROG -f -n '__fish_pass_uses_command show' -s c -l clip -d 'Put password in clipboard' complete -c $PROG -f -n '__fish_pass_uses_command show' -a "(__fish_pass_print_entries)" # When no command is given, `show` is defaulted. +complete -c $PROG -f -n '__fish_pass_needs_command' -s 1 -d 'Show password only' complete -c $PROG -f -n '__fish_pass_needs_command' -s c -l clip -d 'Put password in clipboard' complete -c $PROG -f -n '__fish_pass_needs_command' -a "(__fish_pass_print_entries)" +complete -c $PROG -f -n '__fish_pass_uses_command -1' -a "(__fish_pass_print_entries)" complete -c $PROG -f -n '__fish_pass_uses_command -c' -a "(__fish_pass_print_entries)" complete -c $PROG -f -n '__fish_pass_uses_command --clip' -a "(__fish_pass_print_entries)" diff --git a/src/completion/pass.zsh-completion b/src/completion/pass.zsh-completion index d911e12..768744a 100644 --- a/src/completion/pass.zsh-completion +++ b/src/completion/pass.zsh-completion @@ -116,6 +116,7 @@ _pass () { _pass_cmd_show () { _arguments : \ + "-1[show password only]" \ "-c[put it on the clipboard]" \ "--clip[put it on the clipboard]" _pass_complete_entries diff --git a/src/password-store.sh b/src/password-store.sh index aef8d72..87f6d07 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -367,23 +367,24 @@ cmd_init() { cmd_show() { local opts selected_line clip=0 qrcode=0 - opts="$($GETOPT -o q::c:: -l qrcode::,clip:: -n "$PROGRAM" -- "$@")" + opts="$($GETOPT -o :1q::c::: -l qrcode::,clip:: -n "$PROGRAM" -- "$@")" local err=$? eval set -- "$opts" while true; do case $1 in -q|--qrcode) qrcode=1; selected_line="${2:-1}"; shift 2 ;; -c|--clip) clip=1; selected_line="${2:-1}"; shift 2 ;; + -1) selected_line=1; shift ;; --) shift; break ;; esac done - [[ $err -ne 0 || ( $qrcode -eq 1 && $clip -eq 1 ) ]] && die "Usage: $PROGRAM $COMMAND [--clip[=line-number],-c[line-number]] [--qrcode[=line-number],-q[line-number]] [pass-name]" + [[ $err -ne 0 || ( $qrcode -eq 1 && $clip -eq 1 ) ]] && die "Usage: $PROGRAM $COMMAND [-1] [--clip[=line-number],-c[line-number]] [--qrcode[=line-number],-q[line-number]] [pass-name]" local pass local path="$1" local passfile="$PREFIX/$path.gpg" check_sneaky_paths "$path" if [[ -f $passfile ]]; then - if [[ $clip -eq 0 && $qrcode -eq 0 ]]; then + if [[ $clip -eq 0 && $qrcode -eq 0 && -z $selected_line ]]; then pass="$($GPG -d "${GPG_OPTS[@]}" "$passfile" | $BASE64)" || exit $? echo "$pass" | $BASE64 -d else @@ -394,6 +395,8 @@ cmd_show() { clip "$pass" "$path" elif [[ $qrcode -eq 1 ]]; then qrcode "$pass" "$path" + else + echo "$pass" fi fi elif [[ -d $PREFIX/$path ]]; then -- 2.30.2