openssh portable on FreeBSD i386

mike tancsa mike at sentex.net
Fri Jun 2 00:54:59 AEST 2023


Hi All,

     I am trying to compile OpenSSH portable 9.3p1 on FreeBSD RELENG_13  
but on *i386*.  With the compiler defaults, it errors out with


-D_PATH_PRIVSEP_CHROOT_DIR=\"/var/empty\" -DHAVE_CONFIG_H -c channels.c 
-o channels.o
channels.c:2569:12: error: comparison of integers of different signs: 
'time_t' (aka 'int') and 'unsigned int' [-Werror,-Wsign-compare]
                             now >= c->lastused + c->inactive_deadline) {
                             ~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
*** Error code 1


Not sure if this is the right approach / patch, but I am able to compile 
and run with

--- channels.c.orig     2023-03-15 21:28:19 UTC
+++ channels.c
@@ -2566,7 +2566,12 @@ channel_handler(struct ssh *ssh, int table, 
struct tim
                         if (table == CHAN_PRE &&
                             c->type == SSH_CHANNEL_OPEN &&
                             c->inactive_deadline != 0 && c->lastused != 
0 &&
+                           #if defined(__i386__)
+                           now >= (time_t) c->lastused + (time_t) 
c->inactive_deadline) {
+                           #else
                             now >= c->lastused + c->inactive_deadline) {
+                           #endif
+
                                 /* channel closed for inactivity */
                                 verbose("channel %d: closing after %u 
seconds "
                                     "of inactivity", c->self,


Is that the right approach, or am I potentially breaking something 
somewhere else that also needs a cast ?

tracked at
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271172

for any FreeBSD people

     ---Mike




More information about the openssh-unix-dev mailing list