Bug 1738

Summary: openbsd-compat wants xstrdup but it's in libssh.a
Product: Portable OpenSSH Reporter: Alan Hourihane <alanh>
Component: Build systemAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED FIXED    
Severity: normal CC: djm
Priority: P2    
Version: 5.4p1   
Hardware: Other   
OS: Linux   
Bug Depends on:    
Bug Blocks: 1743    
Attachments:
Description Flags
provide provde xstrdup for bsd-misc.c
none
add -lssh again to link pksc11-helper none

Description Alan Hourihane 2010-03-23 22:46:08 AEDT
Created attachment 1816 [details]
provide provde xstrdup for bsd-misc.c

When building a static only openssh the link order is -lssh -lopenbsd-compat. But xstrdup exists in bsd-misc.c (and an aix file).

The problem is that on a static only build xstrdup is in libssh.a and yet openbsd-compat needs it and fails because of the link order.

This patch adds a private copy of xstrdup to bsd-misc.c but doesn't fix the aix file, as most will probably never build static only on AIX.
Comment 1 Alan Hourihane 2010-03-23 23:22:24 AEDT
The patch is broken as it uses xmalloc() and suffers the same linkage problem. Sorry about that, a bit hasty with the patch.

We'd need to duplicate xmalloc into here too. But maybe you guys have a better solution ?

Or perhaps do "-lssh -lopenbsd-compat -lssh" for the pksc11-helper application ? then no patch would be required to bsd-misc.c
Comment 2 Alan Hourihane 2010-03-24 01:44:30 AEDT
Created attachment 1817 [details]
add -lssh again to link pksc11-helper
Comment 3 Damien Miller 2010-03-26 10:28:27 AEDT
Already fixed in -current:

http://anoncvs.mindrot.org/index.cgi/openssh/Makefile.in?view=log

The fix will be in openssh-5.5p1, due shortly.
Comment 4 Damien Miller 2010-04-16 15:50:41 AEST
Mass move of bugs RESOLVED->CLOSED following the release of openssh-5.5p1