dropbear icon indicating copy to clipboard operation
dropbear copied to clipboard

Build on Illumos and Solaris

Open jhessane opened this issue 5 months ago • 4 comments

Dropbear didn't build on Illumos and Solaris for a few reasons:

  • mv is not the coreutils one, so the -v option doesn't exist. However, the gnu coreutils are shipped under /usr/gnu/bin so we can just change which mv to use on Illumos or Solaris to /usr/gnu/bin/mv, if not on Solaris or Illumos it will default to mv;

  • we need to set STDC_WANT_LIB_EXT1 to 1 to use memory safe functions, so I added a definition for Solaris, defined to 1 if we are on Solaris/Illumos and a check in dbhelper.h to define STDC_WANT_LIB_EXT1 to 1 if we are on Solaris and then we can use memset_s;

  • there is no lastlog file on Solaris/Illumos;

  • linking fails only on Solaris because we need to link with libssp (-lssp) to use __stack_chk_guard and __stack_chk_fail, linking with libssp on Illumos doesn't seem to add problems.

With all those little fixes, Dropbear now works on Illumos and Solaris. I tested those fixes on OmniOS r151054 (latest LTS), SmartOS 20250710T000436Z (latest release), on Solaris 11.4 and also on Void Linux with glibc to see if didn't obliterate something. However while working on that, I did not pay attention to the version of autoconf installed of my system, it was 2.72, so I rolled back to 2.71 to generate a new configure script, as it was before.

jhessane avatar Jul 21 '25 09:07 jhessane

I'll investigate checks later today, at first glance it doesn't seem too weird. Checks also don't work on solaris and illumos because calling make in the Makefile calls dmake (sun make). Should add something to specify gmake if we are on solaris.

jhessane avatar Jul 21 '25 11:07 jhessane

I'll investigate checks later today, at first glance it doesn't seem too weird.

Don't bother about it - it's a spurious failure I've been meaning to track down.

Checks also don't work on solaris and illumos because calling make in the Makefile calls dmake (sun make). Should add something to specify gmake if we are on solaris.

Ah, I'll see how easy it is to make more portable.

mkj avatar Jul 21 '25 12:07 mkj

Checks also don't work on solaris and illumos because calling make in the Makefile calls dmake (sun make). Should add something to specify gmake if we are on solaris.

Hopefully it's a bit better in https://github.com/mkj/dropbear/commit/beb0616d21539c3eb024e30a76d370392f205620

mkj avatar Sep 02 '25 14:09 mkj

There are still a few problems related to tests with some python libraries, I'll see what's possible to be done there. In the meantime, it looks good.

jhessane avatar Sep 02 '25 19:09 jhessane