Mailing List Archive

[Bug 1566] New: superfluous descriptor duplications in sftp-server
https://bugzilla.mindrot.org/show_bug.cgi?id=1566

Summary: superfluous descriptor duplications in sftp-server
Product: Portable OpenSSH
Version: 5.2p1
Platform: All
OS/Version: Solaris
Status: NEW
Severity: normal
Priority: P3
Component: sftp-server
AssignedTo: unassigned-bugs@mindrot.org
ReportedBy: Jan.Pechanec@Sun.COM


Created an attachment (id=1609)
--> (http://bugzilla.mindrot.org/attachment.cgi?id=1609)
suggested patch

pfiles on running sftp-server shows:

...
...
3: S_IFIFO mode:0000 dev:329,0 ino:91352 uid:0 gid:0 size:0
O_RDWR
4: S_IFIFO mode:0000 dev:329,0 ino:91353 uid:0 gid:0 size:0
O_RDWR

those descriptors are created by 2 dup() calls on STD(IN|OUT)_FILENO.
However, there is no need for that and sftp-server can work directly
with 0 and 1. I see that this code came with the 1st sftp-server
implementation in version 2.3.0p1 and hasn't change since then. Even
the Cygwin code that follows those dup()'s and which looks like it
might need those came long after that. After the attached patch was
applied, the full output of pfiles follows and there is no regression.

0: S_IFIFO mode:0000 dev:340,0 ino:1570 uid:0 gid:0 size:0
O_RDWR
1: S_IFIFO mode:0000 dev:340,0 ino:1571 uid:0 gid:0 size:0
O_RDWR
2: S_IFIFO mode:0000 dev:340,0 ino:1572 uid:0 gid:0 size:0
O_RDWR

the "make tests" passed all tests.

--
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
_______________________________________________
openssh-bugs mailing list
openssh-bugs@mindrot.org
https://lists.mindrot.org/mailman/listinfo/openssh-bugs