[Bug 978] The supplied realpath function mangles pathnames.

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Thu Feb 3 08:55:24 EST 2005


http://bugzilla.mindrot.org/show_bug.cgi?id=978

           Summary: The supplied realpath function mangles pathnames.
           Product: Portable OpenSSH
           Version: 3.9p1
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: minor
          Priority: P3
         Component: Miscellaneous
        AssignedTo: openssh-bugs at mindrot.org
        ReportedBy: Paul.Green at stratus.com


When the realpath function supplied with Portable OpenSSH is used, one quickly 
discovers that it mangles the pathnames.  The code that combines the 'real' 
directory name with the name of the last component has a special-case to 
handle a directory name consisting of only '/'.  Sadly, when it comes time to 
use the 'needslash' variable, the test is backwards.  When it needs a slash, 
it doesn't put one in, and vice versa.  needslash==1 is supposed to mean that 
a slash is needed but the code tests for needslash==0.  I guess I must have 
one of the few operating systems (the Stratus VOS POSIX environment) that 
doesn't supply a working version of realpath, and so rely upon this version.  
I found this bug in 3.7.1p2 but it is still present in 3.9p1.  I've tested the 
fix and it works great.  Found by using PuTTY psftp client get request to a 
system with the broken code; it only worked on files in the root ('/') 
directory; a file in a lower-level directory failed; the echoed pathname was 
always missing the final slash.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.




More information about the openssh-bugs mailing list