@pmatilai commented on this pull request.

        if (gpg_path && *gpg_path != '\0')
            (void) setenv("GNUPGHOME", gpg_path, 1);
+       if (tty)
+           setenv("GPG_TTY", tty, 0);
+       else if (!getenv("GPG_TTY"))
+           rpmlog(RPMLOG_WARNING, _("Could not set GPG_TTY to stdin: %m\n"));

This seems a bit fishy: technically, setenv() can fail too, but this getenv() 
check would not catch that even if the message basically says to do so. Instead 
that %m might be related to ttyname() or setenv() for GNUPGHOME failing, or 
even earlier, getenv() does not set errno itself at all. I'd suggest moving 
this section before the GNUPGHOME section and doing the GPG_TTY environment 
check always. 

Seems to me this should be moved section should be moved before the 
gpg_path/GNUPGHOME thing to eliminate that ambiguity, and the getenv("GPG_TTY") 
check always performed (ie remove the 'else'). 

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
Rpm-maint mailing list

Reply via email to