Bug 670 - SunOS 4.1.2 libs do not contain strtoul, used in moduli.c
Summary: SunOS 4.1.2 libs do not contain strtoul, used in moduli.c
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Build system (show other bugs)
Version: 3.7p1
Hardware: SPARC SunOS
: P2 normal
Assignee: OpenSSH Bugzilla mailing list
URL:
Keywords: patch
: 735 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-09-18 07:34 AEST by Ned Forrester
Modified: 2004-04-14 12:24 AEST (History)
1 user (show)

See Also:


Attachments
Add strtoul in openbsd-compat/ (5.42 KB, patch)
2003-09-18 13:56 AEST, Darren Tucker
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ned Forrester 2003-09-18 07:34:04 AEST
Make fails on SunOS 4.1.2 system when linking ssh-keygen for lack of "strtoul"
in library.  Using gcc with Sun provided libraries (libc?) rather than gnu
libraries.  strtoul is used in moduli.c, which is a new file in openssh 3.7p1
vs. 3.5p1, which previously compiled fine.

I am unsure whether the right approach is a change in the configure process to
detect this and provide an alternate strtoul, or whether the use of strtoul
could be avoided through use of strtol in this case.  

Of course the other solution is to declare a lack of support for old OSs, but
those legacy applications just live on...

I have not the knowledge required to propose a fix, but I am willing to test.
Comment 1 Ned Forrester 2003-09-18 07:52:31 AEST
Oops forgot to say that I configured with the following command:

./configure --prefix=/usr/local --sysconfdir=/etc/ssh --with-tcp-wrappers
--without-shadow --with-prngd-socket=/var/run/egd-pool

then:

make
Comment 2 Darren Tucker 2003-09-18 13:43:41 AEST
I don't think strtol is an acceptable substitute.

It should be relatively easy to use OpenBSD's strtoul in openbsd-compat:
http://www.openbsd.org/cgi-bin/cvsweb/src/lib/libc/stdlib/strtoul.c
Comment 3 Darren Tucker 2003-09-18 13:56:28 AEST
Created attachment 420 [details]
Add strtoul in openbsd-compat/

Please try the attached patch.	Note that you will need to run "autoconf" to
rebuild configure.

If you don't have autoconf, you can use this file:
http://www.zip.com.au/~dtucker/openssh/configure-strtoul.gz , just replace the
configure from 3.7.1p1 with it.
Comment 4 Ned Forrester 2003-09-19 05:59:48 AEST
The patch seems to fix the problem nicely.  Thanks.  As I do not have autoconf
on that machine, I did use your alternate configure.

patch <patchfile
configure-strtoul [options]
make
make install

all worked fine, and ssh and sshd seem to run fine.

Thanks again.
Comment 5 Darren Tucker 2003-10-07 17:10:34 AEST
Anyone object to patch id 420 going into -current?
Comment 6 Damien Miller 2003-10-07 17:26:06 AEST
ok by me
Comment 7 Darren Tucker 2003-10-07 17:50:38 AEST
Applied to -current, thanks.
Comment 8 Darren Tucker 2003-10-09 01:02:01 AEST
*** Bug 735 has been marked as a duplicate of this bug. ***
Comment 9 Damien Miller 2004-04-14 12:24:19 AEST
Mass change of RESOLVED bugs to CLOSED