Summary: | net-misc/openssh fails to compile on Gentoo/FBSD 9.0 | ||
---|---|---|---|
Product: | Gentoo/Alt | Reporter: | Yuta SATOH <nigoro.dev> |
Component: | FreeBSD | Assignee: | Gentoo/BSD Team <bsd+disabled> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | 4glitch, alexxy, base-system, robbat2, ryao, tibor.vago |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | FreeBSD | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
openssh-5.9p1 patch for freebsd9
sample patch for openssh-5.9_p1-r4.ebuild autoconf patch to disable utmp and wtmp simpe patch to fix non POSIX test construction A patch for the openssh-6.0_p1.ebuild to solve this problem Configure script patch to unconditionally disable utmp and wtmp on FreeBSD |
Description
Yuta SATOH
2011-11-19 12:42:54 UTC
Same problem here. Created attachment 294555 [details, diff]
openssh-5.9p1 patch for freebsd9
This is a possible patch for freebsd9. I've tested and sshd compiles and works fine. The ebuild dependency check could be:
[[ ${CHOST} == *-freebsd9* ]] && epatch "${FILESDIR}/openssh-5.9p1-fbsd90.patch"
Attached patch must be applied after eautoreconf and before configure. FYI, ports/160389: [patch] security/openssh-portable: fix build on 9.x http://www.freebsd.org/cgi/query-pr.cgi?pr=160389 Comment on attachment 294555 [details, diff] openssh-5.9p1 patch for freebsd9 this patch is wrong, openssh fails to properly detect libutil, that's all iirc. configure.ac contains: dnl Checks for libutil functions AC_CHECK_HEADERS([libutil.h]) AC_SEARCH_LIBS([login], [util bsd], [AC_DEFINE([HAVE_LOGIN], [1], [Define if your libraries define login()])]) AC_CHECK_FUNCS([fmt_scaled logout updwtmp logwtmp]) but, in freebsd 9, this commit removed the 'login' function: http://svnweb.freebsd.org/base/stable/9/lib/libutil/libutil.h?r1=200035&r2=202216 we should check for another function in libutil (openpty for example) ccing maintainer but i guess some patch should be sent upstream first Created attachment 305875 [details, diff] sample patch for openssh-5.9_p1-r4.ebuild This patch is added to the ebuild to fix comment #4 + Makefile from FreeBSD ports. http://www.freebsd.org/cgi/cvsweb.cgi/ports/security/openssh-portable/Makefile?rev=1.157;content-type=text%2Fplain > .if ${OSVERSION} >= 900007 > CONFIGURE_ARGS+= --disable-utmp --disable-wtmp --disable-wtmpx --without-lastlog > .endif might want to have a look at: https://lists.mindrot.org/pipermail/openssh-unix-dev/2012-March/030313.html and follow-ups (In reply to comment #7) > Created attachment 305875 [details, diff] [details, diff] > sample patch for openssh-5.9_p1-r4.ebuild > > This patch is added to the ebuild to fix comment #4 + Makefile from FreeBSD > ports. > > http://www.freebsd.org/cgi/cvsweb.cgi/ports/security/openssh-portable/ > Makefile?rev=1.157;content-type=text%2Fplain > > > .if ${OSVERSION} >= 900007 > > CONFIGURE_ARGS+= --disable-utmp --disable-wtmp --disable-wtmpx --without-lastlog > > .endif OpenSSH suffers from an --as-needed failure with this patch, but removing -Wl,--as-needed from your LDFLAGS is a viable workaround. Despite that, this patch is an improvement. If base-system has no objections, this should be committed to portage. The --as-needed failure can be fixed separately. this should help but is apparently not enough (needs some EXTRA_ECONF to disable utmp, wtmp & friends): http://hg.mindrot.org/openssh/raw-rev/37678d290982 @base-system, mind if I apply this or do you prefer to wait for openssh-6 ? (this version should be fine) (In reply to comment #10) > this should help but is apparently not enough (needs some EXTRA_ECONF to > disable utmp, wtmp & friends): > http://hg.mindrot.org/openssh/raw-rev/37678d290982 > > @base-system, mind if I apply this or do you prefer to wait for openssh-6 ? > (this version should be fine) actually: http://openbsd.org.ar/pub/OpenBSD/OpenSSH/portable/openssh-6.0p1.tar.gz so i'll just wait for you to update it :=) (In reply to comment #11) > (In reply to comment #10) > > this should help but is apparently not enough (needs some EXTRA_ECONF to > > disable utmp, wtmp & friends): > > http://hg.mindrot.org/openssh/raw-rev/37678d290982 > > > > @base-system, mind if I apply this or do you prefer to wait for openssh-6 ? > > (this version should be fine) > > actually: > http://openbsd.org.ar/pub/OpenBSD/OpenSSH/portable/openssh-6.0p1.tar.gz > > so i'll just wait for you to update it :=) OpenSSH 6.0 is now in the tree. EXTRA_ECONF='--disable-utmp --disable-wtmp --disable-wtmpx --without-lastlog' emerge -1 openssh passed. I'm thinking how to deal with these utmp and wtmp things. Something broke pkg-config in Gentoo/FreeBSD. `pkg-config --libs openssl` returns the following, which causes a configure failure in dev-libs/openssl: Package pÀ was not found in the pkg-config search path. Perhaps you should add the directory containing `pÀ.pc' to the PKG_CONFIG_PATH environment variable No package 'pÀ' found Setting PKG_CONFIG_PATH=/usr/lib64/pkgconfig in the environment before attempting to merge it will permit configure to pass. Then there are further build errors that need to be addressed. The following will permit net-misc/openssh-6.0_p1 to install without any build failures: env EXTRA_ECONF='--disable-utmp --disable-wtmp' PKG_CONFIG_PATH=/usr/lib64/pkgconfig emerge openssh emerge will print the following warning at the end of an emerge: * Found a non POSIX test construction in a configure script * The configure checks of this package may not function properly * Please report this on Gentoo Bugzilla in Gentoo/Alt product for component FreeBSD. * http://bugs.gentoo.org/enter_bug.cgi?product=Gentoo%2FAlt&component=FreeBSD&op_sys=FreeBSD Lastly, with regard to utmp and wtmp, Wikipedia claims the following: 1. utmp and wtmp are extensions to UNIX that are not implemented on FreeBSD. 2. utmpx is an extension of the extension by Sun Microsystems. 3. utmpx was included in the POSIX standard. 4. FreeBSD 9 added support for utmpx http://en.wikipedia.org/wiki/Utmp It looks like the right thing to do will be to disable utmp and wtmp unconditionally on FreeBSD and disable utmpx on FreeBSD 8 and earlier. (In reply to comment #14) > Something broke pkg-config in Gentoo/FreeBSD. `pkg-config --libs openssl` > returns the following, which causes a configure failure in dev-libs/openssl: > > Package pÀ was not found in the pkg-config search path. > Perhaps you should add the directory containing `pÀ.pc' > to the PKG_CONFIG_PATH environment variable > No package 'pÀ' found > > Setting PKG_CONFIG_PATH=/usr/lib64/pkgconfig in the environment before > attempting to merge it will permit configure to pass. Then there are further > build errors that need to be addressed. Didn't have that error here on x86-fbsd. May be another issue? Anyone has this on amd64-fbsd? Created attachment 311795 [details, diff] autoconf patch to disable utmp and wtmp (In reply to comment #14) > Lastly, with regard to utmp and wtmp, Wikipedia claims the following: > > 1. utmp and wtmp are extensions to UNIX that are not implemented on FreeBSD. > 2. utmpx is an extension of the extension by Sun Microsystems. > 3. utmpx was included in the POSIX standard. > 4. FreeBSD 9 added support for utmpx > > http://en.wikipedia.org/wiki/Utmp > > It looks like the right thing to do will be to disable utmp and wtmp > unconditionally on FreeBSD and disable utmpx on FreeBSD 8 and earlier. utmp and wtmp are not auto-enabled/auto-disabled in the autoconf script. They are disabled one by one according to CHOST value. We can add these lines to the autoconf script to disable them. (In reply to comment #15) > (In reply to comment #14) > > Something broke pkg-config in Gentoo/FreeBSD. `pkg-config --libs openssl` > > returns the following, which causes a configure failure in dev-libs/openssl: > > > > Package pÀ was not found in the pkg-config search path. > > Perhaps you should add the directory containing `pÀ.pc' > > to the PKG_CONFIG_PATH environment variable > > No package 'pÀ' found > > > > Setting PKG_CONFIG_PATH=/usr/lib64/pkgconfig in the environment before > > attempting to merge it will permit configure to pass. Then there are further > > build errors that need to be addressed. > > Didn't have that error here on x86-fbsd. May be another issue? Anyone has > this on amd64-fbsd? It was a bug in pkgconf 0.4. nenolod fixed it a few hours after I provided him with traces from truss. Strangely, switching from pkgconf to pkg-config did not appear to remove the bug when I was debugging my install, but I assume that was due to some error on my part. Created attachment 311797 [details, diff] simpe patch to fix non POSIX test construction (In reply to comment #14) > emerge will print the following warning at the end of an emerge: > > * Found a non POSIX test construction in a configure script > * The configure checks of this package may not function properly > * Please report this on Gentoo Bugzilla in Gentoo/Alt product for component > FreeBSD. > * > http://bugs.gentoo.org/enter_bug. > cgi?product=Gentoo%2FAlt&component=FreeBSD&op_sys=FreeBSD # cd /var/tmp/portage/net-misc/openssh-6.0_p1/work/openssh-6.0p1 # grep test configure|grep == test "x$have_seccomp_filter" == "x1" && \ Comment on attachment 311797 [details, diff]
simpe patch to fix non POSIX test construction
i had sent this patch upstream some time ago, but i guess it hasn't been applied. i added it to the 6.0_p1 ebuild now.
Running `mkdir -p /etc/portage/env/net-misc && echo "EXTRA_ECONF='--disable-utmp --disable-wtmp'" > /etc/portage/env/net-misc/openssh` is sufficent to workaround this problem in net-misc/openssh-6.0_p1 on Gentoo FreeBSD 9. Created attachment 313463 [details, diff]
A patch for the openssh-6.0_p1.ebuild to solve this problem
I have attached a patch for the ebuild that addresses this problem on Gentoo FreeBSD 9. Gentoo FreeBSD 8 is still affected, but I am undecided on whether or not it is a good idea to fix it given the need to either turn off utmpx on Gentoo FreeBSD 9 or implement more complicated logic to make this decision. I will let others decide that.
Created attachment 313473 [details, diff]
Configure script patch to unconditionally disable utmp and wtmp on FreeBSD
After conferring with naota on this, both of us agreed that it would be best to do this inside the configure script, so I have rewritten my patch as a patch to the ./configure script.
Comment on attachment 313473 [details, diff]
Configure script patch to unconditionally disable utmp and wtmp on FreeBSD
It seems that naota beat me to writing this and I did not notice. I am marking my patch obsolete.
Comment on attachment 305875 [details, diff]
sample patch for openssh-5.9_p1-r4.ebuild
I am also marking nigoro's patch as obsolete because naota's ./configure script patch takes care of this.
Fix committed to CVS with Chainsaw's approval. (In reply to comment #25) did you send this upstream ? there's a bugzilla for openssh ... (In reply to comment #26) > (In reply to comment #25) > > did you send this upstream ? there's a bugzilla for openssh ... I did not send this upstream. naota wrote this patch, but I do not know if he sent it upstream. Sorry, my patch was totally wrong. Upstream won't accept it. We should revert it and apply proper fix. In configure.ac: > if test -z "$conf_utmp_location"; then > if test x"$system_utmp_path" = x"no" ; then > for f in /etc/utmp /usr/adm/utmp /var/run/utmp; do > if test -f $f ; then > conf_utmp_location=$f > fi > done > if test -z "$conf_utmp_location"; then > AC_DEFINE([DISABLE_UTMP]) > fi > fi > fi > if test -n "$conf_utmp_location"; then > AC_DEFINE_UNQUOTED([CONF_UTMP_FILE], ["$conf_utmp_location"], > [Define if you want to specify the path to your utmp file]) > fi This code try to detect system utmp path and set detected path to CONF_UTMP_FILE. In defines.h: > #ifndef UTMP_FILE > # ifdef _PATH_UTMP > # define UTMP_FILE _PATH_UTMP > # else > # ifdef CONF_UTMP_FILE > # define UTMP_FILE CONF_UTMP_FILE > # endif > # endif > #endif ... > #if defined(HAVE_LOGIN) && !defined(DISABLE_LOGIN) > # define USE_LOGIN > > #else ... > # if defined(UTMP_FILE) && !defined(DISABLE_UTMP) > # define USE_UTMP > # endif When CONF_UTMP_FILE is set, this code defines USE_UTMP and causes utmp error. wtmp is also detected and set USE_WTMP in the same manner. FreeBSD-9.0 obsolete utmp and wtmp, however utmp file and wtmp file still exist after updating from -8.x. These obsoleted files confuse the configure script to use utmp and wtmp. ok, we should do - disable utmp and wtmp by adding configure parameter or - detect these old files and remove them in pkg_setup() phase Removing /var/run/utmp and /var/log/wtmp resolved the compilation error here. (In reply to comment #28) > FreeBSD-9.0 obsolete utmp and wtmp, however utmp file and wtmp file still > exist after updating from -8.x. These obsoleted files confuse the configure > script to use utmp and wtmp. > > ok, we should do > > - disable utmp and wtmp by adding configure parameter > or > - detect these old files and remove them in pkg_setup() phase > > Removing /var/run/utmp and /var/log/wtmp resolved the compilation error here. I've updated the Upgrade Guide on wiki. added the steps to delete old files related to utmp. http://wiki.gentoo.org/wiki/Gentoo_FreeBSD#Updating_FreeBSD_userland FYI, http://svnweb.freebsd.org/base/releng/9.1/UPDATING?r1=201879&r2=202219 patch merged to 6.1_p1-r1 @robbat2 I've checked openssh-6.1_p1-r1.ebuild. And I have noticed that attachment 305875 [details, diff] patch has been applied. This problem has been fixed in openssh-6.0 (please see comment #11). So, I believe that FreeBSD-specific settings are not required. Please remove it. |