interleaving lines of stdout with status when using --status-fd 1

Andreas Stieger astieger at suse.com
Mon Sep 12 13:34:23 CEST 2016


Hello,

I have an issue with 2.1.15 when printing status information to stdout.
After ff71521d9698c7c5df94831a1398e948213af433,
print_status_key_considered is called in the middle of printing a line
in the output of --list-public-keys (--with-colons, -fixed-lost-mode,
--with-dig-list).

Even though use --status-fd 1 can be considered to do exactly what is
sais on the tin, there are some usages: Some usages:
https://github.com/search?utf8=✓&q=--status-fd&type=Code   Would you say
that it would be beneficial to some library usages to flush the previous
line, or print the status line after the regular list output has
finished a line in stdout?

Output is as follows:

+ gpg2 --import --homedir /tmp/tmp.8a043nlHjQ --no-default-keyring
--quiet --no-tty --no-greeting --no-permission-warning --status-fd 1
/tmp/tmp.8a043nlHjQ/test.key
[GNUPG:] KEY_CONSIDERED D7DD7C85D9598661D889F8C092AB3F6E6CB7B81F 0
[GNUPG:] IMPORTED 92AB3F6E6CB7B81F home:AndreasStieger OBS Project
<home:AndreasStieger at build.opensuse.org>
[GNUPG:] IMPORT_OK 1 D7DD7C85D9598661D889F8C092AB3F6E6CB7B81F
[GNUPG:] IMPORT_RES 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0
+ gpg --list-public-keys --homedir /tmp/tmp.8a043nlHjQ
--no-default-keyring --quiet --with-colons --fixed-list-mode
--with-fingerprint --with-sig-list --no-tty --no-greeting --batch
--status-fd 1
tru::1:1473679477:0:3:1:5
pub:-:1024:17:92AB3F6E6CB7B81F:1217757506:1474311950::-:::scSC:::::::
fpr:::::::::D7DD7C85D9598661D889F8C092AB3F6E6CB7B81F:
uid:-::::1405191950::1371C6CD4E3A77BDA5CFBE1C940ACD55D2895B25::home\x3aAndreasStieger
OBS Project <home\x3aAndreasStieger at build.opensuse.org>:::::::::
sig:::17:92AB3F6E6CB7B81F:1405191950::::[GNUPG:] KEY_CONSIDERED
D7DD7C85D9598661D889F8C092AB3F6E6CB7B81F 0
home\x3aAndreasStieger OBS Project
<home\x3aAndreasStieger at build.opensuse.org>:13x:::::2:
sig:::17:3B3011B76B9D6523:1217757506::::[User ID not found]:13x:::::2:

The following would be suggested:

tru::1:1473679477:0:3:1:5
pub:-:1024:17:92AB3F6E6CB7B81F:1217757506:1474311950::-:::scSC:::::::
fpr:::::::::D7DD7C85D9598661D889F8C092AB3F6E6CB7B81F:
uid:-::::1405191950::1371C6CD4E3A77BDA5CFBE1C940ACD55D2895B25::home\x3aAndreasStieger
OBS Project <home\x3aAndreasStieger at build.opensuse.org>:::::::::
sig:::17:92AB3F6E6CB7B81F:1405191950::::home\x3aAndreasStieger OBS
Project <home\x3aAndreasStieger at build.opensuse.org>:13x:::::2:
[GNUPG:] KEY_CONSIDERED D7DD7C85D9598661D889F8C092AB3F6E6CB7B81F 0
sig:::17:3B3011B76B9D6523:1217757506::::[User ID not found]:13x:::::2:

Reproducer script:

#!/bin/sh -x
TMPHOME=`mktemp -d`
wget -O $TMPHOME/test.key
http://download.opensuse.org/repositories/home:/AndreasStieger/openSUSE_Leap_42.1/repodata/repomd.xml.key
gpg2 --import --homedir $TMPHOME --no-default-keyring --quiet --no-tty
--no-greeting --no-permission-warning --status-fd 1 $TMPHOME/test.key
gpg --list-public-keys --homedir $TMPHOME --no-default-keyring --quiet
--with-colons --fixed-list-mode --with-fingerprint --with-sig-list
--no-tty --no-greeting --batch --status-fd 1


Thanks,
Andreas

-- 
Andreas Stieger <astieger at suse.com>
Project Manager Security
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton,
HRB 21284 (AG Nürnberg)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: OpenPGP digital signature
URL: </pipermail/attachments/20160912/ae367923/attachment-0001.sig>


More information about the Gnupg-devel mailing list