[Bug 2314] New: ls -l a_symlink does not list the link permissions

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Sat Nov 15 01:23:27 EST 2014


https://bugzilla.mindrot.org/show_bug.cgi?id=2314

            Bug ID: 2314
           Summary: ls -l a_symlink  does not list the link permissions
           Product: Portable OpenSSH
           Version: -current
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: sftp
          Assignee: unassigned-bugs at mindrot.org
          Reporter: kirk at dovetail.com

Created attachment 2505
  --> https://bugzilla.mindrot.org/attachment.cgi?id=2505&action=edit
don't override lstat in glob2 for GLOB_MARK processing

In 1.139 of sftp.c, which was released in 5.7p1:

- djm at cvs.openbsd.org 2010/09/25 09:30:16
     [sftp.c configure.ac openbsd-compat/glob.c openbsd-compat/glob.h]
     make use of new glob(3) GLOB_KEEPSTAT extension to save extra
server
     rountrips to fetch per-file stat(2) information.
     NB. update openbsd-compat/ glob(3) implementation from OpenBSD
libc to
     match.


This changed the behavior of a symlink listing:

$ sftp -D /usr/lib/openssh/sftp-server
Attached to /usr/lib/openssh/sftp-server.
sftp> !ln -s /etc/profile /tmp/lprofile
sftp> ls -al /tmp/lprofile
-rw-r--r--    0 0        0             665 Jan 21  2014 /tmp/lprofile

prior to 5.7:

sftp -P /usr/lib/ssh/sftp-server                                        
Attaching to /usr/lib/ssh/sftp-server...
sftp> !ln -s /etc/profile /tmp/lprofile
sftp> ls -al /tmp/lprofile
lrwxrwxrwx    1 7001     0              12 Nov 14 08:15 /tmp/lprofile

See a suggested patch to openbsd-compat/glob.c
When using GLOB_KEEPSTAT, don't replace the lstat mode with stat when
checking for a symlink to a directory when handling GLOB_MARK

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list