<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<!-- Template generated by Exclaimer Mail Disclaimers on 08:55:49 Monday, 18 November 2013 -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">P.f758a8b8-08bf-4bab-8d22-45dba9e71175 {
        MARGIN: 0cm 0cm 0pt
}
LI.f758a8b8-08bf-4bab-8d22-45dba9e71175 {
        MARGIN: 0cm 0cm 0pt
}
DIV.f758a8b8-08bf-4bab-8d22-45dba9e71175 {
        MARGIN: 0cm 0cm 0pt
}
TABLE.f758a8b8-08bf-4bab-8d22-45dba9e71175Table {
        MARGIN: 0cm 0cm 0pt
}
DIV.Section1 {
        page: Section1
}
</style>
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<p class="f758a8b8-08bf-4bab-8d22-45dba9e71175"></p>
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">File descriptors are just ways to keep track of open files. (Remember everything in Linux/UNIX is really a “file” just not necessarily a “regular file”.)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">There’s a good discussion of ways to set and use FDs other than 0-2 at:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><a href="http://www.tldp.org/LDP/abs/html/io-redirection.html">http://www.tldp.org/LDP/abs/html/io-redirection.html</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Additionally I notice the man page for gpg has other options to SET file descriptors.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">You might look at the rest of the script (or whatever calls it) to see if it is setting a FD before it gets to the line below.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"><o:p> </o:p></span></p>
<div></div>
</div>
<p></p>
<p class="f758a8b8-08bf-4bab-8d22-45dba9e71175"> </p>
<p class="f758a8b8-08bf-4bab-8d22-45dba9e71175"> </p>
<p class="f758a8b8-08bf-4bab-8d22-45dba9e71175"></p>
<div class="WordSection1">
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">From:</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> ale-bounces@ale.org [mailto:ale-bounces@ale.org]
<b>On Behalf Of </b>Neal Rhodes<br>
<b>Sent:</b> Sunday, November 17, 2013 11:57 PM<br>
<b>To:</b> Atlanta Linux Enthusiasts<br>
<b>Subject:</b> [ale] FD 3 on gpg?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-bottom:12.0pt">Here is a boiled down script buried in the bowels of a system which uploads data from pharmacies:
<o:p></o:p></p>
<p class="MsoNormal">CMD="gpg --homedir $HOME_DIR/.gnupg --batch --passphrase-fd 3 --decrypt $HOLD 2> /tmp/gpg.err.$$ | /usr/local/bin/$PARSER 2>> $LOG_FILE"<br>
eval "$CMD"<o:p></o:p></p>
<p class="MsoNormal"><br>
Which actually works. I cannot fathom how. The FM says it will read the passphrase from file descriptor 3. Uh...Stdin, Stdout, Stderr, There goes 0, 1, 2. uh, that would be a file defined within gpg?
<br>
<br>
Well, it sorta works. If you wiggle it, or jiggle it, modify it various ways, it stops working and typically says "Bad passphrase".
<br>
<br>
This:<o:p></o:p></p>
<p class="MsoNormal">CMD="cat something-something-icanttellyou/k_file.asc | gpg --homedir $HOME_DIR/.gnupg --batch --passphrase-fd 0 --decrypt $HOLD 2> /tmp/gpg.err.$$ | /usr/local/bin/$PARSER 2>> $LOG_FILE"<br>
eval "$CMD"<o:p></o:p></p>
<p class="MsoNormal"><br>
Does work reliably under various combinations. <br>
<br>
Maybe there is some magic about FD 3 here, but I'm not finding it. Something about gpg-agent?
<br>
<br>
Neal Rhodes<br>
MNOP Ltd <o:p></o:p></p>
</div>
<p></p>
<p class="f758a8b8-08bf-4bab-8d22-45dba9e71175"><font face="Arial"><font color="fuchsia"><font style="FONT-FAMILY: Arial; FONT-SIZE: 10pt" size="2"></font></font></font> </p>
<p class="f758a8b8-08bf-4bab-8d22-45dba9e71175"> </p>
<p class="f758a8b8-08bf-4bab-8d22-45dba9e71175"><font face="Arial"><font color="fuchsia"><font style="FONT-FAMILY: Arial; FONT-SIZE: 10pt" size="2">Athena<font size="1">®</font>, Created for the Cause</font><font size="1">™
</font></font></font></p>
<p class="f758a8b8-08bf-4bab-8d22-45dba9e71175"><font size="2" face="Arial">Making a Difference in the Fight Against Breast Cancer</font></p>
<p class="f758a8b8-08bf-4bab-8d22-45dba9e71175"><font size="2" face="Arial"></font> </p>
<p class="f758a8b8-08bf-4bab-8d22-45dba9e71175"><font size="2" face="Arial"></font> </p>
<p class="f758a8b8-08bf-4bab-8d22-45dba9e71175"><font face="Arial"><font size="2"><strong>How and Why I Should Support Bottled Water!<br>
</strong>Do not relinquish your right to choose bottled water as a healthy alternative to beverages that contain sugar, calories, etc. Your support of bottled water will make a difference! Your signatures count! Go to
<a href="http://www.bottledwatermatters.org/luv-bottledwater-iframe/dswaters">http://www.bottledwatermatters.org/luv-bottledwater-iframe/dswaters</a> and sign a petition to support your right to always choose bottled water. Help fight federal and state issues,
such as bottle deposits (or taxes) and organizations that want to ban the sale of bottled water. Support community curbside recycling programs. Support bottled water as a healthy way to maintain proper hydration. Our goal is 50,000 signatures. Share this petition
with your friends and family today!</font></font></p>
<p class="f758a8b8-08bf-4bab-8d22-45dba9e71175"><font size="2" face="Arial"></font> </p>
<p class="f758a8b8-08bf-4bab-8d22-45dba9e71175"><span style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">---------------------------------<br>
CONFIDENTIALITY NOTICE: This e-mail may contain privileged or confidential information and is for the sole use of the intended recipient(s). If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information
is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.<br>
----------------------------------</span><span style="FONT-FAMILY: 'Courier New'; FONT-SIZE: 9pt"><o:p></o:p></span></p>
<p> </p>
<p></p>
<p></p>
</body>
</html>