@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:
https://github.com/rpm-software-management/rpm/pull/938#pullrequestreview-427995405
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to