Bug 1738 - openbsd-compat wants xstrdup but it's in libssh.a
Summary: openbsd-compat wants xstrdup but it's in libssh.a
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Build system (show other bugs)
Version: 5.4p1
Hardware: Other Linux
: P2 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_5_5
  Show dependency treegraph
 
Reported: 2010-03-23 22:46 AEDT by Alan Hourihane
Modified: 2010-04-16 15:50 AEST (History)
1 user (show)

See Also:


Attachments
provide provde xstrdup for bsd-misc.c (841 bytes, patch)
2010-03-23 22:46 AEDT, Alan Hourihane
no flags Details | Diff
add -lssh again to link pksc11-helper (664 bytes, patch)
2010-03-24 01:44 AEDT, Alan Hourihane
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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