<div dir="ltr"><div>If this is a bug I'd characterize it as a localtime.c bug rather than a zdump bug.</div><div><br></div><div>Note first that zdump arguments are time zone names rather than file names. However, the localtime.c code is prepared to use a zone name as the name of a file when appropriate. If a zdump argument beginning with a slash is passed to tzalloc, it will be taken as an absolute filename. But if a name does NOT begin with a slash (for example, "./New_York") it is taken as a name within the default time zone directory. In the case at hand, there's no "New_York" file in the default directory (although there is an "America/New_York" file), so the software punts to its default; thus the differing behaviors. The "taken as a name within the default time zone directory" behavior is arguably worng (and, even if not worng, might best be documented).<br></div><div><br></div><div>The relevant code is in the "tzloadbody" function. There's some complexity in that code that may not be necessary. Since time zone code gets compiled into programs run with root privileges, we want to ensure that the real user is entitled to read a file specified as the source of time zone information; that's done with an "access" call. The code tries to avoid the access call in "safe" cases--cases where the file is sure to be somewhere under zoneinfo (not specified as an absolute file name, and with no possibility of a ".." in the name). If we're willing to call access in all cases, the code for avoiding the access call can go.</div><div><br></div><div>    @dashdashado<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Sun, Oct 28, 2018 at 6:31 PM Matt Johnson <<a href="mailto:mj1856@hotmail.com">mj1856@hotmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
I notice when I run zdump like this:</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span>zdump /usr/share/zoneinfo/America/New_York<br>
</span>
<div><br>
</div>
<div>The output is normal:</div>
<div>America/New_York  Sun Oct 28 18:23:35 2018 EDT<br>
</div>
<div><br>
</div>
<div>But if I change to the America directory...</div>
<div>cd /usr/share/zoneinfo/America</div>
<div>zdump ./New_York</div>
<div><br>
</div>
<div>The output is missing the abbreviation:</div>
<span>./New_York  Sun Oct 28 22:23:48 2018</span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span>Is this expected? Seems like a subtle bug to me.  The abbreviations are also missing with -v output.</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span>(Ran on Ubuntu Linux 16.04.5 LTS)</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span>Thanks,</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<span>Matt</span></div>
</div>

</blockquote></div>