Bug 2961

Summary: session.c:523: error: too few arguments to function ‘session_set_fds’ when USE_PIPES is not defined
Product: Portable OpenSSH Reporter: Adrian Fita <adrian.fita>
Component: sshdAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED FIXED    
Severity: normal CC: dtucker
Priority: P5    
Version: 7.9p1   
Hardware: amd64   
OS: Linux   
Bug Depends on:    
Bug Blocks: 2915    

Description Adrian Fita 2019-02-05 21:06:20 AEDT
Hi. I'm encountering the following compilation error when I empty the
line with "#define USE_PIPES 1":

session.c: In function ‘do_exec_no_pty’:
session.c:523: warning: passing argument 1 of ‘session_set_fds’ from
incompatible pointer type
session.c:116: note: expected ‘struct ssh *’ but argument is of type
‘struct Session *’
session.c:523: warning: passing argument 2 of ‘session_set_fds’ makes
pointer from integer without a cast
session.c:116: note: expected ‘struct Session *’ but argument is of type ‘int’
session.c:523: error: too few arguments to function ‘session_set_fds’

The following patch fixes it:

$ diff -ur openssh-7.7p1-orig openssh-7.7p1-fixed
diff -ur openssh-7.7p1-orig/session.c openssh-7.7p1-fixed/session.c
--- openssh-7.7p1-orig/session.c        2018-04-02 05:38:28.000000000 +0000
+++ openssh-7.7p1-fixed/session.c       2018-06-15 13:55:26.000000000 +0000
@@ -519,7 +519,7 @@
         * Enter the interactive session.  Note: server_loop must be able to
         * handle the case that fdin and fdout are the same.
         */
-       session_set_fds(s, inout[1], inout[1], err[1],
+       session_set_fds(ssh, s, inout[1], inout[1], err[1],
            s->is_subsystem, 0);
 #endif
        return 0;

I don't get the compilation error when I don't remove "#define USE_PIPES 1".

Regards,
-- 
Fita Adrian
Comment 1 Darren Tucker 2019-02-05 22:36:27 AEDT
Thanks, patch applied and will be in the 8.0 release.
Comment 2 Damien Miller 2019-05-03 14:42:33 AEST
Move resolved bugs -> CLOSED after 8.0 release