From scm-commit at wald.intevation.org Sat Nov 1 01:55:15 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Sat, 1 Nov 2008 01:55:15 +0100 (CET) Subject: [Openvas-commits] r1660 - in trunk/openvas-plugins: . scripts Message-ID: <20081101005515.2C5D440762@pyrosoma.intevation.org> Author: reinke Date: 2008-11-01 01:55:10 +0100 (Sat, 01 Nov 2008) New Revision: 1660 Added: trunk/openvas-plugins/scripts/deb_1646_2.nasl trunk/openvas-plugins/scripts/deb_1649_1.nasl trunk/openvas-plugins/scripts/deb_1650_1.nasl trunk/openvas-plugins/scripts/deb_1651_1.nasl trunk/openvas-plugins/scripts/deb_1652_1.nasl trunk/openvas-plugins/scripts/deb_1653_1.nasl trunk/openvas-plugins/scripts/deb_1654_1.nasl trunk/openvas-plugins/scripts/deb_1655_1.nasl trunk/openvas-plugins/scripts/deb_1656_1.nasl trunk/openvas-plugins/scripts/deb_1657_1.nasl trunk/openvas-plugins/scripts/deb_1658_1.nasl trunk/openvas-plugins/scripts/deb_1659_1.nasl trunk/openvas-plugins/scripts/deb_1660_1.nasl trunk/openvas-plugins/scripts/deb_1661_1.nasl trunk/openvas-plugins/scripts/freebsd_cups-base6.nasl trunk/openvas-plugins/scripts/freebsd_drupal57.nasl trunk/openvas-plugins/scripts/freebsd_drupal58.nasl trunk/openvas-plugins/scripts/freebsd_flyspray1.nasl trunk/openvas-plugins/scripts/freebsd_libspf2.nasl trunk/openvas-plugins/scripts/freebsd_libxine10.nasl trunk/openvas-plugins/scripts/freebsd_libxml20.nasl trunk/openvas-plugins/scripts/freebsd_linux-flashplugin4.nasl trunk/openvas-plugins/scripts/freebsd_openx.nasl trunk/openvas-plugins/scripts/freebsd_opera12.nasl trunk/openvas-plugins/scripts/freebsd_opera13.nasl trunk/openvas-plugins/scripts/freebsd_wordpress8.nasl trunk/openvas-plugins/scripts/glsa_200810_02.nasl trunk/openvas-plugins/scripts/glsa_200810_03.nasl Modified: trunk/openvas-plugins/ChangeLog Log: New scripts added Modified: trunk/openvas-plugins/ChangeLog =================================================================== --- trunk/openvas-plugins/ChangeLog 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/ChangeLog 2008-11-01 00:55:10 UTC (rev 1660) @@ -1,3 +1,15 @@ +2008-10-31 Thomas Reinke + * deb_1646_2.nasl deb_1649_1.nasl deb_1650_1.nasl deb_1651_1.nasl + deb_1652_1.nasl deb_1653_1.nasl deb_1654_1.nasl deb_1655_1.nasl + deb_1656_1.nasl deb_1657_1.nasl deb_1658_1.nasl deb_1659_1.nasl + deb_1660_1.nasl deb_1661_1.nasl freebsd_cups-base6.nasl + freebsd_drupal57.nasl freebsd_drupal58.nasl freebsd_flyspray1.nasl + freebsd_libspf2.nasl freebsd_libxine10.nasl freebsd_libxml20.nasl + freebsd_linux-flashplugin4.nasl freebsd_openx.nasl + freebsd_opera12.nasl freebsd_opera13.nasl freebsd_wordpress8.nasl + glsa_200810_02.nasl glsa_200810_03.nasl + Added new plugins. + 2008-10-31 Chandrashekhar B * scripts/gb_phpmyadmin_pmd_pdf_xss_vuln.nasl, scripts/gb_opera_cmd_exec_n_xss_vuln_lin.nasl, Added: trunk/openvas-plugins/scripts/deb_1646_2.nasl =================================================================== --- trunk/openvas-plugins/scripts/deb_1646_2.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/deb_1646_2.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,99 @@ +# OpenVAS Vulnerability Test +# $Id$ +# Description: Auto-generated from advisory DSA 1646-2 (squid) +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisory, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61771); + script_cve_id("CVE-2008-1612", "CVE-2007-6239"); + script_version ("$"); + name["english"] = "Debian Security Advisory DSA 1646-2 (squid)"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to squid +announced via advisory DSA 1646-2. + +In DSA 1646-1, an update was announced for a denial of service +vulnerability in squid, a caching proxy server. Due to an error in +packaging and in testing, the updated packages did not correct the +weakness. An updated release is available which corrects the error. +For reference, the original advisory text follows. + +A weakness has been discovered in squid, a caching proxy server. The +flaw was introduced upstream in response to CVE-2007-6239, and +announced by Debian in DSA-1482-1. The flaw involves an +over-aggressive bounds check on an array resize, and could be +exploited by an authorized client to induce a denial of service +condition against squid. + +For the stable distribution (etch), these problems have been fixed in +version 2.6.5-6etch4. + +We recommend that you upgrade your squid packages. + +Solution: +https://secure1.securityspace.com/smysecure/catid.html?in=DSA%201646-2 + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "Debian Security Advisory DSA 1646-2 (squid)"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "Debian Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/packages"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-deb.inc"); +vuln = 0; +if(isdpkgvuln(pkg:"squid-common", ver:"2.6.5-6etch4", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"squid-cgi", ver:"2.6.5-6etch4", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"squidclient", ver:"2.6.5-6etch4", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"squid", ver:"2.6.5-6etch4", rls:"DEB4.0")) { + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/deb_1649_1.nasl =================================================================== --- trunk/openvas-plugins/scripts/deb_1649_1.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/deb_1649_1.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,115 @@ +# OpenVAS Vulnerability Test +# $Id$ +# Description: Auto-generated from advisory DSA 1649-1 (iceweasel) +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisory, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61770); + if(NASL_LEVEL>=2191) { + script_cve_id("CVE-2008-0016", "CVE-2008-3835", "CVE-2008-3836", "CVE-2008-3837", "CVE-2008-4058", "CVE-2008-4059", "CVE-2008-4060", "CVE-2008-4061", "CVE-2008-4062", "CVE-2008-4065", "CVE-2008-4066", "CVE-2008-4067", "CVE-2008-4068", "CVE-2008-4069"); + } else { + script_cve_id("CVE-2008-0016", "CVE-2008-3835", "CVE-2008-3836", "CVE-2008-3837", "CVE-2008-4058", "CVE-2008-4059", "CVE-2008-4060", "CVE-2008-4061"); + }; + script_version ("$"); + name["english"] = "Debian Security Advisory DSA 1649-1 (iceweasel)"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to iceweasel +announced via advisory DSA 1649-1. + +Several remote vulnerabilities have been discovered in the Iceweasel web +browser, an unbranded version of the Firefox browser. For details, +please visit the referenced security advisories. + +For the stable distribution (etch), these problems have been fixed in +version 2.0.0.17-0etch1. Packages for hppa will be provided later. + +For the unstable distribution (sid), these problems have been fixed in +version 3.0.3 of iceweasel and 1.9.0.3-1 of xulrunner. + +We recommend that you upgrade your iceweasel package. + +Solution: +https://secure1.securityspace.com/smysecure/catid.html?in=DSA%201649-1 + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "Debian Security Advisory DSA 1649-1 (iceweasel)"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "Debian Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/packages"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-deb.inc"); +vuln = 0; +if(isdpkgvuln(pkg:"firefox", ver:"2.0.0.17-0etch1", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"firefox-dom-inspector", ver:"2.0.0.17-0etch1", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"mozilla-firefox-dom-inspector", ver:"2.0.0.17-0etch1", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"mozilla-firefox-gnome-support", ver:"2.0.0.17-0etch1", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"iceweasel-dom-inspector", ver:"2.0.0.17-0etch1", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"mozilla-firefox", ver:"2.0.0.17-0etch1", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"firefox-gnome-support", ver:"2.0.0.17-0etch1", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"iceweasel", ver:"2.0.0.17-0etch1", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"iceweasel-dbg", ver:"2.0.0.17-0etch1", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"iceweasel-gnome-support", ver:"2.0.0.17-0etch1", rls:"DEB4.0")) { + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/deb_1650_1.nasl =================================================================== --- trunk/openvas-plugins/scripts/deb_1650_1.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/deb_1650_1.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,90 @@ +# OpenVAS Vulnerability Test +# $Id$ +# Description: Auto-generated from advisory DSA 1650-1 (openldap2.3) +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisory, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61772); + script_cve_id("CVE-2008-2952"); + script_version ("$"); + name["english"] = "Debian Security Advisory DSA 1650-1 (openldap2.3)"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to openldap2.3 +announced via advisory DSA 1650-1. + +Cameron Hotchkies discovered that the OpenLDAP server slapd, a free +implementation of the Lightweight Directory Access Protocol, could be +crashed by sending malformed ASN1 requests. + +For the stable distribution (etch), this problem has been fixed in +version 2.3.30-5+etch2. + +For the unstable distribution (sid), this problem has been fixed in +version 2.4.10-3 of the openldap package. + +We recommend that you upgrade your openldap2.3 packages. + +Solution: +https://secure1.securityspace.com/smysecure/catid.html?in=DSA%201650-1 + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "Debian Security Advisory DSA 1650-1 (openldap2.3)"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "Debian Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/packages"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-deb.inc"); +vuln = 0; +if(isdpkgvuln(pkg:"slapd", ver:"2.3.30-5+etch2", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libldap-2.3-0", ver:"2.3.30-5+etch2", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"ldap-utils", ver:"2.3.30-5+etch2", rls:"DEB4.0")) { + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/deb_1651_1.nasl =================================================================== --- trunk/openvas-plugins/scripts/deb_1651_1.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/deb_1651_1.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,152 @@ +# OpenVAS Vulnerability Test +# $Id$ +# Description: Auto-generated from advisory DSA 1651-1 (ruby1.8) +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisory, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61773); + script_cve_id("CVE-2008-3655", "CVE-2008-3656", "CVE-2008-3657", "CVE-2008-3790", "CVE-2008-3905"); + script_version ("$"); + name["english"] = "Debian Security Advisory DSA 1651-1 (ruby1.8)"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to ruby1.8 +announced via advisory DSA 1651-1. + +Several vulnerabilities have been discovered in the interpreter for +the Ruby language, which may lead to denial of service and other +security problems. The Common Vulnerabilities and Exposures project +identifies the following problems: + +CVE-2008-3655 + +Keita Yamaguchi discovered that several safe level restrictions +are insufficiently enforced. + +CVE-2008-3656 + +Christian Neukirchen discovered that the WebRick module uses +inefficient algorithms for HTTP header splitting, resulting in +denial of service through resource exhaustion. + +CVE-2008-3657 + +It was discovered that the dl module doesn't perform taintness +checks. + +CVE-2008-3790 + +Luka Treiber and Mitja Kolsek discovered that recursively nested +XML entities can lead to denial of service through resource +exhaustion in rexml. + +CVE-2008-3905 + +Tanaka Akira discovered that the resolv module uses sequential +transaction IDs and a fixed source port for DNS queries, which +makes it more vulnerable to DNS spoofing attacks. + +For the stable distribution (etch), these problems have been fixed in +version 1.8.5-4etch3. Packages for arm will be provided later. + +For the unstable distribution (sid), these problems have been fixed in +version 1.8.7.72-1. + +We recommend that you upgrade your ruby1.8 packages. + +Solution: +https://secure1.securityspace.com/smysecure/catid.html?in=DSA%201651-1 + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "Debian Security Advisory DSA 1651-1 (ruby1.8)"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "Debian Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/packages"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-deb.inc"); +vuln = 0; +if(isdpkgvuln(pkg:"ri1.8", ver:"1.8.5-4etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"ruby1.8-elisp", ver:"1.8.5-4etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"ruby1.8-examples", ver:"1.8.5-4etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"irb1.8", ver:"1.8.5-4etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"rdoc1.8", ver:"1.8.5-4etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"ruby1.8-dev", ver:"1.8.5-4etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libtcltk-ruby1.8", ver:"1.8.5-4etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libdbm-ruby1.8", ver:"1.8.5-4etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libgdbm-ruby1.8", ver:"1.8.5-4etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libruby1.8", ver:"1.8.5-4etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libreadline-ruby1.8", ver:"1.8.5-4etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"ruby1.8", ver:"1.8.5-4etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libruby1.8-dbg", ver:"1.8.5-4etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libopenssl-ruby1.8", ver:"1.8.5-4etch3", rls:"DEB4.0")) { + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/deb_1652_1.nasl =================================================================== --- trunk/openvas-plugins/scripts/deb_1652_1.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/deb_1652_1.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,152 @@ +# OpenVAS Vulnerability Test +# $Id$ +# Description: Auto-generated from advisory DSA 1652-1 (ruby1.9) +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisory, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61774); + script_cve_id("CVE-2008-3655", "CVE-2008-3656", "CVE-2008-3657", "CVE-2008-3790", "CVE-2008-3905"); + script_version ("$"); + name["english"] = "Debian Security Advisory DSA 1652-1 (ruby1.9)"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to ruby1.9 +announced via advisory DSA 1652-1. + +Several vulnerabilities have been discovered in the interpreter for +the Ruby language, which may lead to denial of service and other +security problems. The Common Vulnerabilities and Exposures project +identifies the following problems: + +CVE-2008-3655 + +Keita Yamaguchi discovered that several safe level restrictions +are insufficiently enforced. + +CVE-2008-3656 + +Christian Neukirchen discovered that the WebRick module uses +inefficient algorithms for HTTP header splitting, resulting in +denial of service through resource exhaustion. + +CVE-2008-3657 + +It was discovered that the dl module doesn't perform taintness +checks. + +CVE-2008-3790 + +Luka Treiber and Mitja Kolsek discovered that recursively nested +XML entities can lead to denial of service through resource +exhaustion in rexml. + +CVE-2008-3905 + +Tanaka Akira discovered that the resolv module uses sequential +transaction IDs and a fixed source port for DNS queries, which +makes it more vulnerable to DNS spoofing attacks. + +For the stable distribution (etch), these problems have been fixed in +version 1.9.0+20060609-1etch3. Packages for arm will be provided later. + +For the unstable distribution (sid), these problems have been fixed in +version 1.9.0.2-6. + +We recommend that you upgrade your ruby1.9 packages. + +Solution: +https://secure1.securityspace.com/smysecure/catid.html?in=DSA%201652-1 + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "Debian Security Advisory DSA 1652-1 (ruby1.9)"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "Debian Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/packages"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-deb.inc"); +vuln = 0; +if(isdpkgvuln(pkg:"rdoc1.9", ver:"1.9.0+20060609-1etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"irb1.9", ver:"1.9.0+20060609-1etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"ruby1.9-examples", ver:"1.9.0+20060609-1etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"ruby1.9-elisp", ver:"1.9.0+20060609-1etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"ri1.9", ver:"1.9.0+20060609-1etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libdbm-ruby1.9", ver:"1.9.0+20060609-1etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"ruby1.9", ver:"1.9.0+20060609-1etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libopenssl-ruby1.9", ver:"1.9.0+20060609-1etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libruby1.9-dbg", ver:"1.9.0+20060609-1etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libruby1.9", ver:"1.9.0+20060609-1etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libgdbm-ruby1.9", ver:"1.9.0+20060609-1etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libtcltk-ruby1.9", ver:"1.9.0+20060609-1etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libreadline-ruby1.9", ver:"1.9.0+20060609-1etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"ruby1.9-dev", ver:"1.9.0+20060609-1etch3", rls:"DEB4.0")) { + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/deb_1653_1.nasl =================================================================== --- trunk/openvas-plugins/scripts/deb_1653_1.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/deb_1653_1.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,516 @@ +# OpenVAS Vulnerability Test +# $Id$ +# Description: Auto-generated from advisory DSA 1653-1 (linux-2.6) +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisory, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61775); + script_cve_id("CVE-2007-6716", "CVE-2008-1514", "CVE-2008-3276", "CVE-2008-3525", "CVE-2008-3833", "CVE-2008-4210", "CVE-2008-4302"); + script_version ("$"); + name["english"] = "Debian Security Advisory DSA 1653-1 (linux-2.6)"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to linux-2.6 +announced via advisory DSA 1653-1. + +Several vulnerabilities have been discovered in the Linux kernel that +may lead to a denial of service or privilege escalation. The Common +Vulnerabilities and Exposures project identifies the following +problems: + +CVE-2007-6716 + +Joe Jin reported a local denial of service vulnerability that +allows system users to trigger an oops due to an improperly +initialized data structure. + +CVE-2008-1514 + +Jan Kratochvil reported a local denial of service vulnerability in +the ptrace interface for the s390 architecture. Local users can +trigger an invalid pointer dereference, leading to a system panic. + +CVE-2008-3276 + +Eugene Teo reported an integer overflow in the DCCP subsystem that +may allow remote attackers to cause a denial of service in the +form of a kernel panic. + +CVE-2008-3525 + +Eugene Teo reported a lack of capability checks in the kernel +driver for Granch SBNI12 leased line adapters (sbni), allowing +local users to perform privileged operations. + +CVE-2008-3833 + +The S_ISUID/S_ISGID bits were not being cleared during an inode +splice, which, under certain conditions, can be exploited by local +users to obtain the privileges of a group for which they are not a +member. Mark Fasheh reported this issue. + +CVE-2008-4210 + +David Watson reported an issue in the open()/creat() system calls +which, under certain conditions, can be exploited by local users +to obtain the privileges of a group for which they are not a +member. + +CVE-2008-4302 + +A coding error in the splice subsystem allows local users to +attempt to unlock a page structure that has not been locked, +resulting in a system crash. + +For the stable distribution (etch), this problem has been fixed in +version 2.6.18.dfsg.1-22etch3. + +We recommend that you upgrade your linux-2.6, fai-kernels, and + +Solution: +https://secure1.securityspace.com/smysecure/catid.html?in=DSA%201653-1 + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "Debian Security Advisory DSA 1653-1 (linux-2.6)"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "Debian Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/packages"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-deb.inc"); +vuln = 0; +if(isdpkgvuln(pkg:"linux-manual-2.6.18", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-doc-2.6.18", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-patch-debian-2.6.18", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-source-2.6.18", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-support-2.6.18-6", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-tree-2.6.18", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-vserver", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-alpha-smp", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-alpha-legacy", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-alpha-legacy", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-all-alpha", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-alpha-smp", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-vserver-alpha", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-alpha-generic", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-all", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-alpha-generic", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-vserver-alpha", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-all-amd64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-xen-amd64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-amd64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-modules-2.6.18-6-xen-amd64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-vserver-amd64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-xen-vserver", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-xen-vserver-amd64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-modules-2.6.18-6-xen-vserver-amd64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-xen-vserver-amd64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-amd64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-xen", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"xen-linux-system-2.6.18-6-xen-amd64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-xen-amd64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"fai-kernels", ver:"1.17+etch.22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"xen-linux-system-2.6.18-6-xen-vserver-amd64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-vserver-amd64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-rpc", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-iop32x", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-s3c2410", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-footbridge", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-all-arm", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-rpc", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-ixp4xx", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-ixp4xx", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-iop32x", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-footbridge", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-s3c2410", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-parisc-smp", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-parisc-smp", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-parisc64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-parisc64-smp", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-parisc", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-parisc64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-parisc64-smp", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-all-hppa", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-parisc", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-486", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"xen-linux-system-2.6.18-6-xen-686", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-vserver-686", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-xen-686", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-modules-2.6.18-6-xen-vserver-686", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-vserver-k7", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-vserver-k7", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-486", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-686", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-686-bigmem", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-686", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"xen-linux-system-2.6.18-6-xen-vserver-686", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-k7", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-modules-2.6.18-6-xen-686", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-xen-686", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-vserver-686", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"user-mode-linux", ver:"2.6.18-1um-2etch.22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-xen-vserver-686", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-k7", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-xen-vserver-686", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-686-bigmem", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-all-i386", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-itanium", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-itanium", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-mckinley", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-all-ia64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-mckinley", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-all-mips", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-r4k-ip22", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-r5k-ip32", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-sb1-bcm91250a", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-r4k-ip22", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-qemu", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-sb1a-bcm91480b", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-sb1a-bcm91480b", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-qemu", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-sb1-bcm91250a", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-r5k-ip32", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-r4k-kn04", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-r4k-kn04", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-r3k-kn02", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-r5k-cobalt", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-all-mipsel", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-r5k-cobalt", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-r3k-kn02", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-vserver-powerpc64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-vserver-powerpc", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-powerpc64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-powerpc-miboot", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-prep", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-powerpc-smp", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-prep", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-powerpc", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-powerpc-miboot", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-vserver-powerpc", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-vserver-powerpc64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-all-powerpc", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-powerpc", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-powerpc-smp", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-powerpc64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-s390", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-vserver-s390x", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-s390x", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-s390x", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-vserver-s390x", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-s390", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-s390-tape", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-all-s390", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-sparc64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-vserver-sparc64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-sparc32", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-all-sparc", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-vserver-sparc64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-sparc32", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-sparc64-smp", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.18-6-sparc64-smp", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.18-6-sparc64", ver:"2.6.18.dfsg.1-22etch3", rls:"DEB4.0")) { + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/deb_1654_1.nasl =================================================================== --- trunk/openvas-plugins/scripts/deb_1654_1.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/deb_1654_1.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,99 @@ +# OpenVAS Vulnerability Test +# $Id$ +# Description: Auto-generated from advisory DSA 1654-1 (libxml2) +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisory, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61776); + script_cve_id("CVE-2008-3529"); + script_version ("$"); + name["english"] = "Debian Security Advisory DSA 1654-1 (libxml2)"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to libxml2 +announced via advisory DSA 1654-1. + +It was discovered that libxml2, the GNOME XML library, didn't correctly +handle long entity names. This could allow the execution of arbitrary +code via a malicious XML file. + +For the stable distribution (etch), this problem has been fixed in version +2.6.27.dfsg-5. + +For the unstable distribution (sid), this problem has been fixed in +version 2.6.32.dfsg-4. + +We recommend that you upgrade your libxml2 package. + +Solution: +https://secure1.securityspace.com/smysecure/catid.html?in=DSA%201654-1 + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "Debian Security Advisory DSA 1654-1 (libxml2)"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "Debian Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/packages"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-deb.inc"); +vuln = 0; +if(isdpkgvuln(pkg:"libxml2-doc", ver:"2.6.27.dfsg-5", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libxml2", ver:"2.6.27.dfsg-5", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libxml2-utils", ver:"2.6.27.dfsg-5", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"python-libxml2", ver:"2.6.27.dfsg-5", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libxml2-dev", ver:"2.6.27.dfsg-5", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libxml2-dbg", ver:"2.6.27.dfsg-5", rls:"DEB4.0")) { + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/deb_1655_1.nasl =================================================================== --- trunk/openvas-plugins/scripts/deb_1655_1.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/deb_1655_1.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,334 @@ +# OpenVAS Vulnerability Test +# $Id$ +# Description: Auto-generated from advisory DSA 1655-1 (linux-2.6.24) +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisory, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61777); + script_cve_id("CVE-2008-1514", "CVE-2008-3525", "CVE-2008-3831", "CVE-2008-4113", "CVE-2008-4445"); + script_version ("$"); + name["english"] = "Debian Security Advisory DSA 1655-1 (linux-2.6.24)"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to linux-2.6.24 +announced via advisory DSA 1655-1. + +Several vulnerabilities have been discovered in the Linux kernel that +may lead to a denial of service, privilege escalation or a leak of +sensitive data. The Common Vulnerabilities and Exposures project +identifies the following problems: + +CVE-2008-1514 + +Jan Kratochvil reported a local denial of service vulnerability in +the ptrace interface for the s390 architecture. Local users can +trigger an invalid pointer dereference, leading to a system panic. + +CVE-2008-3525 + +Eugene Teo reported a lack of capability checks in the kernel +driver for Granch SBNI12 leased line adapters (sbni), allowing +local users to perform privileged operations. + +CVE-2008-3831 + +Olaf Kirch discovered an issue with the i915 driver that may allow +local users to cause memory corruption by use of an ioctl with +insufficient privilege restrictions. + +CVE-2008-4113/CVE-2008-4445 + +Eugene Teo discovered two issues in the SCTP subsystem which allow +local users to obtain access to sensitive memory when the +SCTP-AUTH extension is enabled. + +For the stable distribution (etch), these problems have been fixed in +version 2.6.24-6~etchnhalf.6. + +We recommend that you upgrade your linux-2.6.24 packages. + +Solution: +https://secure1.securityspace.com/smysecure/catid.html?in=DSA%201655-1 + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "Debian Security Advisory DSA 1655-1 (linux-2.6.24)"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "Debian Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/packages"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-deb.inc"); +vuln = 0; +if(isdpkgvuln(pkg:"linux-patch-debian-2.6.24", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-support-2.6.24-etchnhalf.1", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-doc-2.6.24", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-tree-2.6.24", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-manual-2.6.24", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-source-2.6.24", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-alpha-generic", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-all", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-all-alpha", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-alpha-legacy", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-common", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-alpha-smp", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-alpha-smp", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-alpha-generic", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-alpha-legacy", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-amd64", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-all-amd64", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-amd64", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-footbridge", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-ixp4xx", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-footbridge", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-all-arm", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-ixp4xx", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-iop32x", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-iop32x", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-parisc", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-parisc-smp", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-parisc", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-parisc64", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-parisc-smp", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-all-hppa", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-parisc64", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-parisc64-smp", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-parisc64-smp", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-686", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-686", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-686-bigmem", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-486", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-all-i386", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-686-bigmem", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-486", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-mckinley", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-itanium", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-all-ia64", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-itanium", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-mckinley", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-sb1a-bcm91480b", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-r5k-cobalt", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-sb1a-bcm91480b", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-4kc-malta", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-all-mipsel", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-r5k-cobalt", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-5kc-malta", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-sb1-bcm91250a", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-sb1-bcm91250a", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-4kc-malta", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-5kc-malta", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-powerpc-smp", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-all-powerpc", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-powerpc", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-powerpc-miboot", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-powerpc", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-powerpc64", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-powerpc64", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-powerpc-smp", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-powerpc-miboot", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-all-s390", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-s390x", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-s390", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-s390", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-s390-tape", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-s390x", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-all-sparc", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-sparc64-smp", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-image-2.6.24-etchnhalf.1-sparc64", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-sparc64", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"linux-headers-2.6.24-etchnhalf.1-sparc64-smp", ver:"2.6.24-6~etchnhalf.6", rls:"DEB4.0")) { + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/deb_1656_1.nasl =================================================================== --- trunk/openvas-plugins/scripts/deb_1656_1.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/deb_1656_1.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,128 @@ +# OpenVAS Vulnerability Test +# $Id$ +# Description: Auto-generated from advisory DSA 1656-1 (cupsys) +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisory, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61778); + script_cve_id("CVE-2008-3639", "CVE-2008-3640", "CVE-2008-3641"); + script_version ("$"); + name["english"] = "Debian Security Advisory DSA 1656-1 (cupsys)"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to cupsys +announced via advisory DSA 1656-1. + +Several local vulnerabilities have been discovered in the Common UNIX +Printing System. The Common Vulnerabilities and Exposures project +identifies the following problems: + +CVE-2008-3639 + +It was discovered that insufficient bounds checking in the SGI +image filter may lead to the execution of arbitrary code. + +CVE-2008-3640 + +It was discovered that an integer overflow in the Postscript +conversion tool texttops may lead to the execution of arbitrary +code. + +CVE-2008-3641 + +It was discovered that insufficient bounds checking in the HPGL +filter may lead to the execution of arbitrary code. + +For the stable distribution (etch), these problems have been fixed in +version 1.2.7-4etch5. + +For the unstable distribution (sid) and the upcoming stable distribution +(lenny), these problems have been fixed in version 1.3.8-1lenny2 of +the source package cups. + +We recommend that you upgrade your cupsys package. + +Solution: +https://secure1.securityspace.com/smysecure/catid.html?in=DSA%201656-1 + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "Debian Security Advisory DSA 1656-1 (cupsys)"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "Debian Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/packages"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-deb.inc"); +vuln = 0; +if(isdpkgvuln(pkg:"cupsys-common", ver:"1.2.7-4etch5", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libcupsys2-gnutls10", ver:"1.2.7-4etch5", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"cupsys-bsd", ver:"1.2.7-4etch5", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"cupsys-dbg", ver:"1.2.7-4etch5", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"cupsys-client", ver:"1.2.7-4etch5", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libcupsys2-dev", ver:"1.2.7-4etch5", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"cupsys", ver:"1.2.7-4etch5", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libcupsimage2", ver:"1.2.7-4etch5", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libcupsys2", ver:"1.2.7-4etch5", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libcupsimage2-dev", ver:"1.2.7-4etch5", rls:"DEB4.0")) { + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/deb_1657_1.nasl =================================================================== --- trunk/openvas-plugins/scripts/deb_1657_1.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/deb_1657_1.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,84 @@ +# OpenVAS Vulnerability Test +# $Id$ +# Description: Auto-generated from advisory DSA 1657-1 (qemu) +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisory, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61779); + script_cve_id("CVE-2008-4553"); + script_version ("$"); + name["english"] = "Debian Security Advisory DSA 1657-1 (qemu)"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to qemu +announced via advisory DSA 1657-1. + +Dmitry E. Oboukhov discovered that the qemu-make-debian-root script in qemu, +fast processor emulator, creates temporary files insecurely, which may lead +to a local denial of service through symlink attacks. + +For the stable distribution (etch), this problem has been fixed in +version 0.8.2-4etch2. + +For the testing (lenny) and unstable distribution (sid), this problem has +been fixed in version 0.9.1-6. + +We recommend that you upgrade your qemu package. + +Solution: +https://secure1.securityspace.com/smysecure/catid.html?in=DSA%201657-1 + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "Debian Security Advisory DSA 1657-1 (qemu)"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "Debian Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/packages"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-deb.inc"); +vuln = 0; +if(isdpkgvuln(pkg:"qemu", ver:"0.8.2-4etch2", rls:"DEB4.0")) { + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/deb_1658_1.nasl =================================================================== --- trunk/openvas-plugins/scripts/deb_1658_1.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/deb_1658_1.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,96 @@ +# OpenVAS Vulnerability Test +# $Id$ +# Description: Auto-generated from advisory DSA 1658-1 (dbus) +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisory, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61780); + script_cve_id("CVE-2008-3834"); + script_version ("$"); + name["english"] = "Debian Security Advisory DSA 1658-1 (dbus)"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to dbus +announced via advisory DSA 1658-1. + +Colin Walters discovered that the dbus_signature_validate function in +dbus, a simple interprocess messaging system, is prone to a denial of +service attack. + +For the stable distribution (etch), this problem has been fixed in +version 1.0.2-1+etch2. + +For the testing distribution (lenny) and unstable distribution (sid) +this problem will be fixed soon. + +We recommend that you upgrade your dbus package. + +Solution: +https://secure1.securityspace.com/smysecure/catid.html?in=DSA%201658-1 + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "Debian Security Advisory DSA 1658-1 (dbus)"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "Debian Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/packages"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-deb.inc"); +vuln = 0; +if(isdpkgvuln(pkg:"dbus-1-doc", ver:"1.0.2-1+etch2", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libdbus-1-dev", ver:"1.0.2-1+etch2", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"dbus-1-utils", ver:"1.0.2-1+etch2", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"dbus", ver:"1.0.2-1+etch2", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libdbus-1-3", ver:"1.0.2-1+etch2", rls:"DEB4.0")) { + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/deb_1659_1.nasl =================================================================== --- trunk/openvas-plugins/scripts/deb_1659_1.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/deb_1659_1.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,97 @@ +# OpenVAS Vulnerability Test +# $Id$ +# Description: Auto-generated from advisory DSA 1659-1 (libspf2) +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisory, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61781); + script_cve_id("CVE-2008-2469"); + script_version ("$"); + name["english"] = "Debian Security Advisory DSA 1659-1 (libspf2)"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to libspf2 +announced via advisory DSA 1659-1. + +Dan Kaminsky discovered that libspf2, an implementation of the Sender +Policy Framework (SPF) used by mail servers for mail filtering, handles +malformed TXT records incorrectly, leading to a buffer overflow +condition (CVE-2008-2469). + +Note that the SPF configuration template in Debian's Exim configuration +recommends to use libmail-spf-query-perl, which does not suffer from +this issue. + +For the stable distribution (etch), this problem has been fixed in +version 1.2.5-4+etch1. + +For the testing distribution (lenny), this problem has been fixed in +version 1.2.5.dfsg-5+lenny1. + +For the unstable distribution (sid), this problem will be fixed soon. + +We recommend that you upgrade your libspf2 package. + +Solution: +https://secure1.securityspace.com/smysecure/catid.html?in=DSA%201659-1 + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "Debian Security Advisory DSA 1659-1 (libspf2)"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "Debian Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/packages"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-deb.inc"); +vuln = 0; +if(isdpkgvuln(pkg:"libspf2-2", ver:"1.2.5-4+etch1", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"spfquery", ver:"1.2.5-4+etch1", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libspf2-dev", ver:"1.2.5-4+etch1", rls:"DEB4.0")) { + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/deb_1660_1.nasl =================================================================== --- trunk/openvas-plugins/scripts/deb_1660_1.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/deb_1660_1.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,116 @@ +# OpenVAS Vulnerability Test +# $Id$ +# Description: Auto-generated from advisory DSA 1660-1 (clamav) +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisory, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61782); + script_cve_id("CVE-2008-3912", "CVE-2008-3913", "CVE-2008-3914"); + script_version ("$"); + name["english"] = "Debian Security Advisory DSA 1660-1 (clamav)"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to clamav +announced via advisory DSA 1660-1. + +Several denial-of-service vulnerabilities have been discovered in +the ClamAV anti-virus toolkit: + +Insufficient checking for out-of-memory conditions results in null +pointer derefences (CVE-2008-3912). + +Incorrect error handling logic leads to memory leaks (CVE-2008-3913) +and file descriptor leaks (CVE-2008-3914). + +For the stable distribution (etch), these problems have been fixed in +version 0.90.1dfsg-4etch15. + +For the unstable distribution (sid) and the testing distribution +(lenny), these problems have been fixed in version 0.94.dfsg-1. + +We recommend that you upgrade your clamav package. + +Solution: +https://secure1.securityspace.com/smysecure/catid.html?in=DSA%201660-1 + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "Debian Security Advisory DSA 1660-1 (clamav)"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "Debian Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/packages"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-deb.inc"); +vuln = 0; +if(isdpkgvuln(pkg:"clamav-docs", ver:"0.90.1dfsg-4etch15", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"clamav-base", ver:"0.90.1dfsg-4etch15", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"clamav-testfiles", ver:"0.90.1dfsg-4etch15", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libclamav2", ver:"0.90.1dfsg-4etch15", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"clamav-daemon", ver:"0.90.1dfsg-4etch15", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libclamav-dev", ver:"0.90.1dfsg-4etch15", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"clamav-freshclam", ver:"0.90.1dfsg-4etch15", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"clamav", ver:"0.90.1dfsg-4etch15", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"clamav-dbg", ver:"0.90.1dfsg-4etch15", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"clamav-milter", ver:"0.90.1dfsg-4etch15", rls:"DEB4.0")) { + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/deb_1661_1.nasl =================================================================== --- trunk/openvas-plugins/scripts/deb_1661_1.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/deb_1661_1.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,479 @@ +# OpenVAS Vulnerability Test +# $Id$ +# Description: Auto-generated from advisory DSA 1661-1 (openoffice.org) +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisory, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61783); + script_cve_id("CVE-2008-2237", "CVE-2008-2238"); + script_version ("$"); + name["english"] = "Debian Security Advisory DSA 1661-1 (openoffice.org)"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to openoffice.org +announced via advisory DSA 1661-1. + +Several vulnerabilities have been discovered in the OpenOffice.org +office suite: + +CVE-2008-2237 + +The SureRun Security team discovered a bug in the WMF file parser +that can be triggered by manipulated WMF files and can lead to +heap overflows and arbitrary code execution. + +CVE-2008-2238 + +An anonymous researcher working with the iDefense discovered a bug +in the EMF file parser that can be triggered by manipulated EMF +files and can lead to heap overflows and arbitrary code execution. + +For the stable distribution (etch) these problems have been fixed in +version 2.0.4.dfsg.2-7etch6. + +For the unstable distribution (sid) these problems have been fixed in +version 2.4.1-12. + +For the experimental distribution these problems have been fixed in +version 3.0.0~rc3-1. + +We recommend that you upgrade your OpenOffice.org package. + +Solution: +https://secure1.securityspace.com/smysecure/catid.html?in=DSA%201661-1 + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "Debian Security Advisory DSA 1661-1 (openoffice.org)"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "Debian Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/packages"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-deb.inc"); +vuln = 0; +if(isdpkgvuln(pkg:"broffice.org", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-common", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-dev-doc", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-dtd-officedocument1.0", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-filter-mobiledev", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-cs", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-da", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-de", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-dz", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-en-gb", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-en-us", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-en", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-es", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-et", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-fr", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-hi-in", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-hu", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-it", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-ja", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-km", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-ko", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-nl", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-pl", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-pt-br", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-ru", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-sl", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-sv", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-zh-cn", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-help-zh-tw", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-java-common", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-af", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-as-in", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-be-by", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-bg", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-bn", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-br", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-bs", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-ca", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-cs", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-cy", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-da", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-de", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-dz", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-el", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-en-gb", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-en-za", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-eo", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-es", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-et", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-fa", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-fi", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-fr", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-ga", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-gu-in", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-he", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-hi-in", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-hi", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-hr", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-hu", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-in", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-it", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-ja", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-ka", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-km", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-ko", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-ku", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-lo", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-lt", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-lv", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-mk", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-ml-in", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-nb", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-ne", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-nl", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-nn", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-nr", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-ns", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-or-in", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-pa-in", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-pl", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-pt-br", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-pt", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-ru", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-rw", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-sk", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-sl", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-sr-cs", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-ss", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-st", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-sv", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-ta-in", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-te-in", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-tg", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-th", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-tn", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-tr", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-ts", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-uk", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-ve", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-vi", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-xh", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-za", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-zh-cn", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-zh-tw", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-l10n-zu", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-qa-api-tests", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"ttf-opensymbol", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"libmythes-dev", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-base", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-calc", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-core", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-dbg", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-dev", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-draw", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-evolution", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-filter-so52", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-gcj", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-gnome", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-gtk", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-gtk-gnome", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-impress", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-kde", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-math", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-officebean", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-qa-tools", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"openoffice.org-writer", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} +if(isdpkgvuln(pkg:"python-uno", ver:"2.0.4.dfsg.2-7etch6", rls:"DEB4.0")) { + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/freebsd_cups-base6.nasl =================================================================== --- trunk/openvas-plugins/scripts/freebsd_cups-base6.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/freebsd_cups-base6.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,96 @@ +# +#VID ce29ce1d-971a-11dd-ab7e-001c2514716c +# OpenVAS Vulnerability Test +# $ +# Description: Auto generated from VID ce29ce1d-971a-11dd-ab7e-001c2514716c +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisories, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61805); + script_cve_id("CVE-2008-3639", "CVE-2008-3640", "CVE-2008-3641"); + script_version ("$"); + name["english"] = "FreeBSD Ports: cups-base"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to the system +as announced in the referenced advisory. + +The following package is affected: cups-base + +CVE-2008-3639 +Heap-based buffer overflow in the read_rle16 function in imagetops in +CUPS before 1.3.9 allows remote attackers to execute arbitrary code +via an SGI image with malformed Run Length Encoded (RLE) data +containing a small image and a large row count. + +CVE-2008-3640 +Integer overflow in the WriteProlog function in texttops in CUPS +before 1.3.9 allows remote attackers to execute arbitrary code via a +crafted PostScript file that triggers a heap-based buffer overflow. + +CVE-2008-3641 +The Hewlett-Packard Graphics Language (HPGL) filter in CUPS before +1.3.9 allows remote attackers to execute arbitrary code via crafted +pen width and pen color opcodes that overwrite arbitrary memory. + +Solution: +Update your system with the appropriate patches or +software upgrades. + + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "FreeBSD Ports: cups-base"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "FreeBSD Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/freebsdrel"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-bsd.inc"); +vuln = 0; +bver = portver(pkg:"cups-base"); +if(!isnull(bver) && revcomp(a:bver, b:"1.3.9")<0) { + security_note(0, data:"Package cups-base version " + bver + " is installed which is known to be vulnerable."); + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/freebsd_drupal57.nasl =================================================================== --- trunk/openvas-plugins/scripts/freebsd_drupal57.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/freebsd_drupal57.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,88 @@ +# +#VID 706c9eef-a077-11dd-b413-001372fd0af2 +# OpenVAS Vulnerability Test +# $ +# Description: Auto generated from VID 706c9eef-a077-11dd-b413-001372fd0af2 +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisories, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61800); + script_version ("$"); + name["english"] = "FreeBSD Ports: drupal5"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to the system +as announced in the referenced advisory. + +The following packages are affected: + drupal5 + drupal6 + +Solution: +Update your system with the appropriate patches or +software upgrades. + +http://drupal.org/node/324824 +http://www.vuxml.org/freebsd/706c9eef-a077-11dd-b413-001372fd0af2.html + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "FreeBSD Ports: drupal5"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "FreeBSD Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/freebsdrel"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-bsd.inc"); +vuln = 0; +bver = portver(pkg:"drupal5"); +if(!isnull(bver) && revcomp(a:bver, b:"5.12")<0) { + security_note(0, data:"Package drupal5 version " + bver + " is installed which is known to be vulnerable."); + vuln = 1; +} +bver = portver(pkg:"drupal6"); +if(!isnull(bver) && revcomp(a:bver, b:"6.6")<0) { + security_note(0, data:"Package drupal6 version " + bver + " is installed which is known to be vulnerable."); + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/freebsd_drupal58.nasl =================================================================== --- trunk/openvas-plugins/scripts/freebsd_drupal58.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/freebsd_drupal58.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,91 @@ +# +#VID 12efc567-9879-11dd-a5e7-0030843d3802 +# OpenVAS Vulnerability Test +# $ +# Description: Auto generated from VID 12efc567-9879-11dd-a5e7-0030843d3802 +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisories, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61804); + script_version ("$"); + name["english"] = "FreeBSD Ports: drupal5"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to the system +as announced in the referenced advisory. + +The following packages are affected: + drupal5 + drupal6 + +Solution: +Update your system with the appropriate patches or +software upgrades. + +http://drupal.org/node/318706 +http://secunia.com/advisories/32200/ +http://secunia.com/advisories/32201/ +http://secunia.com/advisories/32198/ +http://www.vuxml.org/freebsd/12efc567-9879-11dd-a5e7-0030843d3802.html + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "FreeBSD Ports: drupal5"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "FreeBSD Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/freebsdrel"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-bsd.inc"); +vuln = 0; +bver = portver(pkg:"drupal5"); +if(!isnull(bver) && revcomp(a:bver, b:"5.11")<0) { + security_note(0, data:"Package drupal5 version " + bver + " is installed which is known to be vulnerable."); + vuln = 1; +} +bver = portver(pkg:"drupal6"); +if(!isnull(bver) && revcomp(a:bver, b:"6.5")<0) { + security_note(0, data:"Package drupal6 version " + bver + " is installed which is known to be vulnerable."); + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/freebsd_flyspray1.nasl =================================================================== --- trunk/openvas-plugins/scripts/freebsd_flyspray1.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/freebsd_flyspray1.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,105 @@ +# +#VID 9d3020e4-a2c4-11dd-a9f9-0030843d3802 +# OpenVAS Vulnerability Test +# $ +# Description: Auto generated from VID 9d3020e4-a2c4-11dd-a9f9-0030843d3802 +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisories, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61798); + script_cve_id("CVE-2007-6461", "CVE-2008-1165", "CVE-2008-1166"); + script_version ("$"); + name["english"] = "FreeBSD Ports: flyspray"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to the system +as announced in the referenced advisory. + +The following package is affected: flyspray + +CVE-2007-6461 +Multiple cross-site scripting (XSS) vulnerabilities in index.php in +Flyspray 0.9.9 through 0.9.9.3 allow remote attackers to inject +arbitrary web script or HTML via (1) the query string in an index +action, related to the savesearch JavaScript function; and (2) the +details parameter in a details action, related to the History tab and +the getHistory JavaScript function. + +CVE-2008-1165 +Multiple cross-site scripting (XSS) vulnerabilities in Flyspray 0.9.9 +through 0.9.9.4 allow remote attackers to inject arbitrary web script +or HTML via (1) a forced SQL error message or (2) old_value and +new_value database fields in task summaries, related to the +item_summary parameter in a details action in index.php. NOTE: some of +these details are obtained from third party information. + +CVE-2008-1166 +Flyspray 0.9.9.4 generates different error messages depending on +whether the username is valid or invalid, which allows remote +attackers to enumerate usernames. NOTE: the provenance of this +information is unknown; the details are obtained solely from third +party information. + +Solution: +Update your system with the appropriate patches or +software upgrades. + +http://secunia.com/advisories/29215 +http://www.vuxml.org/freebsd/9d3020e4-a2c4-11dd-a9f9-0030843d3802.html + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "FreeBSD Ports: flyspray"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "FreeBSD Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/freebsdrel"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-bsd.inc"); +vuln = 0; +bver = portver(pkg:"flyspray"); +if(!isnull(bver) && revcomp(a:bver, b:"0.9.9.5.1")<0) { + security_note(0, data:"Package flyspray version " + bver + " is installed which is known to be vulnerable."); + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/freebsd_libspf2.nasl =================================================================== --- trunk/openvas-plugins/scripts/freebsd_libspf2.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/freebsd_libspf2.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,86 @@ +# +#VID 2ddbfd29-a455-11dd-a55e-00163e000016 +# OpenVAS Vulnerability Test +# $ +# Description: Auto generated from VID 2ddbfd29-a455-11dd-a55e-00163e000016 +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisories, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61796); + script_cve_id("CVE-2008-2469"); + script_bugtraq_id(31881); + script_version ("$"); + name["english"] = "FreeBSD Ports: libspf2"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to the system +as announced in the referenced advisory. + +The following package is affected: libspf2 + +CVE-2008-2469 +Heap-based buffer overflow in the SPF_dns_resolv_lookup function in +Spf_dns_resolv.c in libspf2 before 1.2.8 allows remote attackers to +execute arbitrary code via a long DNS TXT record with a modified +length field. + +Solution: +Update your system with the appropriate patches or +software upgrades. + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "FreeBSD Ports: libspf2"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "FreeBSD Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/freebsdrel"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-bsd.inc"); +vuln = 0; +bver = portver(pkg:"libspf2"); +if(!isnull(bver) && revcomp(a:bver, b:"1.2.8")<0) { + security_note(0, data:"Package libspf2 version " + bver + " is installed which is known to be vulnerable."); + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/freebsd_libxine10.nasl =================================================================== --- trunk/openvas-plugins/scripts/freebsd_libxine10.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/freebsd_libxine10.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,88 @@ +# +#VID 06eac338-9ddf-11dd-813f-000e35248ad7 +# OpenVAS Vulnerability Test +# $ +# Description: Auto generated from VID 06eac338-9ddf-11dd-813f-000e35248ad7 +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisories, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61801); + script_cve_id("CVE-2008-3231"); + script_version ("$"); + name["english"] = "FreeBSD Ports: libxine"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to the system +as announced in the referenced advisory. + +The following package is affected: libxine + +CVE-2008-3231 +xine before 1.1.5 allows user-assisted attackers to cause a denial of +service (application crash) via a crafted OGG file, as demonstrated by +lol-ffplay.ogg. + +Solution: +Update your system with the appropriate patches or +software upgrades. + +http://www.xinehq.de/index.php/news +http://xforce.iss.net/xforce/xfdb/44040 +http://www.vuxml.org/freebsd/06eac338-9ddf-11dd-813f-000e35248ad7.html + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "FreeBSD Ports: libxine"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "FreeBSD Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/freebsdrel"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-bsd.inc"); +vuln = 0; +bver = portver(pkg:"libxine"); +if(!isnull(bver) && revcomp(a:bver, b:"1.1.15")<0) { + security_note(0, data:"Package libxine version " + bver + " is installed which is known to be vulnerable."); + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/freebsd_libxml20.nasl =================================================================== --- trunk/openvas-plugins/scripts/freebsd_libxml20.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/freebsd_libxml20.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,92 @@ +# +#VID d71da236-9a94-11dd-8f42-001c2514716c +# OpenVAS Vulnerability Test +# $ +# Description: Auto generated from VID d71da236-9a94-11dd-8f42-001c2514716c +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisories, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61803); + script_cve_id("CVE-2008-3281", "CVE-2008-3529"); + script_version ("$"); + name["english"] = "FreeBSD Ports: libxml2"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to the system +as announced in the referenced advisory. + +The following package is affected: libxml2 + +CVE-2008-3281 +libxml2 2.6.32 and earlier does not properly detect recursion during +entity expansion in an attribute value, which allows context-dependent +attackers to cause a denial of service (memory and CPU consumption) +via a crafted XML document. + +CVE-2008-3529 +Heap-based buffer overflow in the xmlParseAttValueComplex function in +parser.c in libxml2 before 2.7.0 allows context-dependent attackers to +cause a denial of service (crash) or possibly execute arbitrary code +via a long XML entity name. + +Solution: +Update your system with the appropriate patches or +software upgrades. + + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "FreeBSD Ports: libxml2"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "FreeBSD Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/freebsdrel"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-bsd.inc"); +vuln = 0; +bver = portver(pkg:"libxml2"); +if(!isnull(bver) && revcomp(a:bver, b:"2.6.32_1")<0) { + security_note(0, data:"Package libxml2 version " + bver + " is installed which is known to be vulnerable."); + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/freebsd_linux-flashplugin4.nasl =================================================================== --- trunk/openvas-plugins/scripts/freebsd_linux-flashplugin4.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/freebsd_linux-flashplugin4.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,121 @@ +# +#VID 78f456fd-9c87-11dd-a55e-00163e000016 +# OpenVAS Vulnerability Test +# $ +# Description: Auto generated from VID 78f456fd-9c87-11dd-a55e-00163e000016 +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisories, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61802); + script_cve_id("CVE-2007-6243", "CVE-2008-3873", "CVE-2007-4324", "CVE-2008-4401", "CVE-2008-4503"); + script_version ("$"); + name["english"] = "FreeBSD Ports: linux-flashplugin"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to the system +as announced in the referenced advisory. + +The following package is affected: linux-flashplugin + +CVE-2007-6243 +Adobe Flash Player 9.x up to 9.0.48.0, 8.x up to 8.0.35.0, and 7.x up +to 7.0.70.0 does not sufficiently restrict the interpretation and +usage of cross-domain policy files, which makes it easier for remote +attackers to conduct cross-domain and cross-site scripting (XSS) +attacks. + +CVE-2008-3873 +The System.setClipboard method in ActionScript in Adobe Flash Player +9.0.124.0 and earlier allows remote attackers to populate the +clipboard with a URL that is difficult to delete and does not require +user interaction to populate the clipboard, as exploited in the wild +in August 2008. + +CVE-2007-4324 +ActionScript 3 (AS3) in Adobe Flash Player 9.0.47.0, and other +versions and other 9.0.124.0 and earlier versions, allows remote +attackers to bypass the Security Sandbox Model, obtain sensitive +information, and port scan arbitrary hosts via a Flash (SWF) movie +that specifies a connection to make, then uses timing discrepancies +from the SecurityErrorEvent error to determine whether a port is open +or not. NOTE: 9.0.115.0 introduces support for a workaround, but does +not fix the vulnerability. + +CVE-2008-4401 +ActionScript in Adobe Flash Player 9.0.124.0 and earlier does not +require user interaction in conjunction with (1) the +FileReference.browse operation in the FileReference upload API or (2) +the FileReference.download operation in the FileReference download +API, which allows remote attackers to create a browse dialog box, and +possibly have unspecified other impact, via an SWF file. + +CVE-2008-4503 +The Settings Manager in Adobe Flash Player 9.0.124.0 and earlier +allows remote attackers to cause victims to unknowingly click on a +link or dialog via access control dialogs disguised as normal +graphical elements, as demonstrated by hijacking the camera or +microphone, and related to 'clickjacking.' + +Solution: +Update your system with the appropriate patches or +software upgrades. + +http://www.adobe.com/support/security/bulletins/apsb08-18.html +http://www.vuxml.org/freebsd/78f456fd-9c87-11dd-a55e-00163e000016.html + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "FreeBSD Ports: linux-flashplugin"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "FreeBSD Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/freebsdrel"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-bsd.inc"); +vuln = 0; +bver = portver(pkg:"linux-flashplugin"); +if(!isnull(bver) && revcomp(a:bver, b:"9.0r124_1")<=0) { + security_note(0, data:"Package linux-flashplugin version " + bver + " is installed which is known to be vulnerable."); + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/freebsd_openx.nasl =================================================================== --- trunk/openvas-plugins/scripts/freebsd_openx.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/freebsd_openx.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,82 @@ +# +#VID 55616fda-a2d0-11dd-a9f9-0030843d3802 +# OpenVAS Vulnerability Test +# $ +# Description: Auto generated from VID 55616fda-a2d0-11dd-a9f9-0030843d3802 +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisories, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61797); + script_version ("$"); + name["english"] = "FreeBSD Ports: openx"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to the system +as announced in the referenced advisory. + +The following package is affected: openx + +Solution: +Update your system with the appropriate patches or +software upgrades. + +http://secunia.com/advisories/32114/ +http://blog.openx.org/10/openx-security-update/ +http://www.vuxml.org/freebsd/55616fda-a2d0-11dd-a9f9-0030843d3802.html + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "FreeBSD Ports: openx"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "FreeBSD Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/freebsdrel"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-bsd.inc"); +vuln = 0; +bver = portver(pkg:"openx"); +if(!isnull(bver) && revcomp(a:bver, b:"2.6.2")<0) { + security_note(0, data:"Package openx version " + bver + " is installed which is known to be vulnerable."); + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/freebsd_opera12.nasl =================================================================== --- trunk/openvas-plugins/scripts/freebsd_opera12.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/freebsd_opera12.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,90 @@ +# +#VID f5c4d7f7-9f4b-11dd-bab1-001999392805 +# OpenVAS Vulnerability Test +# $ +# Description: Auto generated from VID f5c4d7f7-9f4b-11dd-bab1-001999392805 +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisories, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61795); + script_version ("$"); + name["english"] = "FreeBSD Ports: opera, linux-opera"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to the system +as announced in the referenced advisory. + +The following packages are affected: + opera + linux-opera + +Solution: +Update your system with the appropriate patches or +software upgrades. + +http://www.opera.com/support/search/view/903/ +http://www.opera.com/support/search/view/904/ +http://www.opera.com/support/search/view/905/ +http://www.vuxml.org/freebsd/f5c4d7f7-9f4b-11dd-bab1-001999392805.html + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "FreeBSD Ports: opera, linux-opera"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "FreeBSD Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/freebsdrel"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-bsd.inc"); +vuln = 0; +bver = portver(pkg:"opera"); +if(!isnull(bver) && revcomp(a:bver, b:"9.61")<0) { + security_note(0, data:"Package opera version " + bver + " is installed which is known to be vulnerable."); + vuln = 1; +} +bver = portver(pkg:"linux-opera"); +if(!isnull(bver) && revcomp(a:bver, b:"9.61")<0) { + security_note(0, data:"Package linux-opera version " + bver + " is installed which is known to be vulnerable."); + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/freebsd_opera13.nasl =================================================================== --- trunk/openvas-plugins/scripts/freebsd_opera13.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/freebsd_opera13.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,89 @@ +# +#VID fb84d5dd-9528-11dd-9a00-001999392805 +# OpenVAS Vulnerability Test +# $ +# Description: Auto generated from VID fb84d5dd-9528-11dd-9a00-001999392805 +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisories, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61806); + script_version ("$"); + name["english"] = "FreeBSD Ports: opera, linux-opera"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to the system +as announced in the referenced advisory. + +The following packages are affected: + opera + linux-opera + +Solution: +Update your system with the appropriate patches or +software upgrades. + +http://www.opera.com/support/search/view/901/ +http://www.opera.com/support/search/view/902/ +http://www.vuxml.org/freebsd/fb84d5dd-9528-11dd-9a00-001999392805.html + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "FreeBSD Ports: opera, linux-opera"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "FreeBSD Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/freebsdrel"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-bsd.inc"); +vuln = 0; +bver = portver(pkg:"opera"); +if(!isnull(bver) && revcomp(a:bver, b:"9.60")<0) { + security_note(0, data:"Package opera version " + bver + " is installed which is known to be vulnerable."); + vuln = 1; +} +bver = portver(pkg:"linux-opera"); +if(!isnull(bver) && revcomp(a:bver, b:"9.60")<0) { + security_note(0, data:"Package linux-opera version " + bver + " is installed which is known to be vulnerable."); + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/freebsd_wordpress8.nasl =================================================================== --- trunk/openvas-plugins/scripts/freebsd_wordpress8.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/freebsd_wordpress8.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,96 @@ +# +#VID 3a4a3e9c-a1fe-11dd-81be-001c2514716c +# OpenVAS Vulnerability Test +# $ +# Description: Auto generated from VID 3a4a3e9c-a1fe-11dd-81be-001c2514716c +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisories, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if(description) +{ + script_id(61799); + script_bugtraq_id(31887); + script_version ("$"); + name["english"] = "FreeBSD Ports: wordpress, de-wordpress, wordpress-mu"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing an update to the system +as announced in the referenced advisory. + +The following packages are affected: + wordpress + de-wordpress + wordpress-mu + +Solution: +Update your system with the appropriate patches or +software upgrades. + +http://secunia.com/Advisories/32361/ +http://wordpress.org/development/2008/10/wordpress-263/ +http://www.vuxml.org/freebsd/3a4a3e9c-a1fe-11dd-81be-001c2514716c.html + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "FreeBSD Ports: wordpress, de-wordpress, wordpress-mu"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "FreeBSD Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/freebsdrel"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-bsd.inc"); +vuln = 0; +bver = portver(pkg:"wordpress"); +if(!isnull(bver) && revcomp(a:bver, b:"2.6.3")<0) { + security_note(0, data:"Package wordpress version " + bver + " is installed which is known to be vulnerable."); + vuln = 1; +} +bver = portver(pkg:"de-wordpress"); +if(!isnull(bver) && revcomp(a:bver, b:"2.6.3")<0) { + security_note(0, data:"Package de-wordpress version " + bver + " is installed which is known to be vulnerable."); + vuln = 1; +} +bver = portver(pkg:"wordpress-mu"); +if(!isnull(bver) && revcomp(a:bver, b:"2.6.3")<0) { + security_note(0, data:"Package wordpress-mu version " + bver + " is installed which is known to be vulnerable."); + vuln = 1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/glsa_200810_02.nasl =================================================================== --- trunk/openvas-plugins/scripts/glsa_200810_02.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/glsa_200810_02.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,88 @@ +# +# OpenVAS Vulnerability Test +# $ +# Description: Auto generated from Gentoo's XML based advisory +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisories, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + + +if(description) +{ + script_id(61785); + script_cve_id("CVE-2008-4394"); + script_version ("$"); + name["english"] = "Gentoo Security Advisory GLSA 200810-02 (portage)"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing updates announced in +advisory GLSA 200810-02. + +A search path vulnerability in Portage allows local attackers to execute +commands with root privileges if emerge is called from untrusted +directories. + +Solution: +All Portage users should upgrade to the latest version: + + # cd /root + # emerge --sync + # emerge --ask --oneshot --verbose '>=sys-apps/portage-2.1.4.5' + +NOTE: To upgrade to Portage 2.1.4.5 using 2.1.4.4 or prior, you must run +emerge from a trusted working directory, such as '/root'. + +http://www.securityspace.com/smysecure/catid.html?in=GLSA%20200810-02 +http://bugs.gentoo.org/show_bug.cgi?id=239560 + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "Gentoo Security Advisory GLSA 200810-02 (portage)"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "Gentoo Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/gentoo"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-gentoo.inc"); +vuln = 0; +if(ispkgvuln(pkg:"sys-apps/portage", unaffected: make_list("ge 2.1.4.5"), vulnerable: make_list("lt 2.1.4.5"))) { + vuln=1; +} + +if(vuln) { + security_hole(0); +} Added: trunk/openvas-plugins/scripts/glsa_200810_03.nasl =================================================================== --- trunk/openvas-plugins/scripts/glsa_200810_03.nasl 2008-10-31 17:44:56 UTC (rev 1659) +++ trunk/openvas-plugins/scripts/glsa_200810_03.nasl 2008-11-01 00:55:10 UTC (rev 1660) @@ -0,0 +1,83 @@ +# +# OpenVAS Vulnerability Test +# $ +# Description: Auto generated from Gentoo's XML based advisory +# +# Authors: +# Thomas Reinke +# +# Copyright: +# Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com +# Text descriptions are largely excerpted from the referenced +# advisories, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + + +if(description) +{ + script_id(61786); + script_cve_id("CVE-2008-2469"); + script_version ("$"); + name["english"] = "Gentoo Security Advisory GLSA 200810-03 (libspf2)"; + script_name(english:name["english"]); + + desc["english"] = " +The remote host is missing updates announced in +advisory GLSA 200810-03. + +A memory management error in libspf2 might allow for remote execution of +arbitrary code. + +Solution: +All libspf2 users should upgrade to the latest version: + + # emerge --sync + # emerge --ask --oneshot --verbose '>=mail-filter/libspf2-1.2.8' + +http://www.securityspace.com/smysecure/catid.html?in=GLSA%20200810-03 +http://bugs.gentoo.org/show_bug.cgi?id=242254 + +Risk factor : High"; + + script_description(english:desc["english"]); + + summary["english"] = "Gentoo Security Advisory GLSA 200810-03 (libspf2)"; + script_summary(english:summary["english"]); + + script_category(ACT_GATHER_INFO); + + script_copyright(english:"Copyright (c) 2008 E-Soft Inc. http://www.securityspace.com"); + family["english"] = "Gentoo Local Security Checks"; + script_family(english:family["english"]); + script_dependencies("gather-package-list.nasl"); + script_require_keys("ssh/login/gentoo"); + exit(0); +} + +# +# The script code starts here +# + +include("revisions-lib.inc"); +include("pkg-lib-gentoo.inc"); +vuln = 0; +if(ispkgvuln(pkg:"mail-filter/libspf2", unaffected: make_list("ge 1.2.8"), vulnerable: make_list("lt 1.2.8"))) { + vuln=1; +} + +if(vuln) { + security_hole(0); +} From scm-commit at wald.intevation.org Tue Nov 4 11:50:19 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Tue, 4 Nov 2008 11:50:19 +0100 (CET) Subject: [Openvas-commits] r1661 - trunk/openvas-server Message-ID: <20081104105019.5B21D40736@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-04 11:50:18 +0100 (Tue, 04 Nov 2008) New Revision: 1661 Modified: trunk/openvas-server/ChangeLog trunk/openvas-server/configure.in Log: * configure.in: Updated version requirements for -libraries and -libnasl. Modified: trunk/openvas-server/ChangeLog =================================================================== --- trunk/openvas-server/ChangeLog 2008-11-01 00:55:10 UTC (rev 1660) +++ trunk/openvas-server/ChangeLog 2008-11-04 10:50:18 UTC (rev 1661) @@ -1,3 +1,8 @@ +2008-11-04 Michael Wiegand + + * configure.in: Updated version requirements for -libraries and + -libnasl. + 2008-10-31 Felix Wolfsteller Steps to an implementation of Change Request #17 Modified: trunk/openvas-server/configure.in =================================================================== --- trunk/openvas-server/configure.in 2008-11-01 00:55:10 UTC (rev 1660) +++ trunk/openvas-server/configure.in 2008-11-04 10:50:18 UTC (rev 1661) @@ -43,8 +43,8 @@ AC_INIT(.root-dir) AC_REVISION($Revision$)dnl -NEED_OPENVASLIBS_VERSION=1.0.2 -NEED_OPENVASLIBNASL_VERSION=1.0.1 +NEED_OPENVASLIBS_VERSION=2.0.0 +NEED_OPENVASLIBNASL_VERSION=2.0.0 dnl version stuff -- jordan save_IFS="${IFS}" From scm-commit at wald.intevation.org Tue Nov 4 15:12:13 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Tue, 4 Nov 2008 15:12:13 +0100 (CET) Subject: [Openvas-commits] r1662 - in trunk/openvas-plugins: . scripts Message-ID: <20081104141213.504D540736@pyrosoma.intevation.org> Author: chandra Date: 2008-11-04 15:12:12 +0100 (Tue, 04 Nov 2008) New Revision: 1662 Added: trunk/openvas-plugins/scripts/gb_drupal_mult_vuln_oct08.nasl Modified: trunk/openvas-plugins/ChangeLog Log: Added new plugin Modified: trunk/openvas-plugins/ChangeLog =================================================================== --- trunk/openvas-plugins/ChangeLog 2008-11-04 10:50:18 UTC (rev 1661) +++ trunk/openvas-plugins/ChangeLog 2008-11-04 14:12:12 UTC (rev 1662) @@ -1,3 +1,7 @@ +2008-11-04 Chandrashekhar B + * scripts/gb_drupal_mult_vuln_oct08.nasl: + Added new plugin + 2008-10-31 Thomas Reinke * deb_1646_2.nasl deb_1649_1.nasl deb_1650_1.nasl deb_1651_1.nasl deb_1652_1.nasl deb_1653_1.nasl deb_1654_1.nasl deb_1655_1.nasl Added: trunk/openvas-plugins/scripts/gb_drupal_mult_vuln_oct08.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_drupal_mult_vuln_oct08.nasl 2008-11-04 10:50:18 UTC (rev 1661) +++ trunk/openvas-plugins/scripts/gb_drupal_mult_vuln_oct08.nasl 2008-11-04 14:12:12 UTC (rev 1662) @@ -0,0 +1,116 @@ +############################################################################### +# OpenVAS Vulnerability Test +# $Id: gb_drupal_mult_vuln_oct08.nasl 0351 2008-11-03 10:37:32Z oct $ +# +# Drupal Core Multiple Vulnerabilities +# +# Authors: +# Veerendra GG +# +# Copyright: +# Copyright (c) 2008 Intevation GmbH, http://www.intevation.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# (or any later version), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################### + +desc["english"] = " + Impact: Successful exploitation allows authenticated users to bypass + access restrictions and can even allows unauthorized users to obtain + sensitive information. + + Impact Level: Application + + Affected Software/OS: + Drupal Version 5.x prior to 5.11 and 6.x prior to 6.5 on all running platform. + + Fix: Upgrade Drupal Version 5.x to 5.11/6.x to Drupal 6.5 or later. + http://drupal.org/ + + References: + http://drupal.org/node/318706 + + CVSS Score: + CVSS Base Score : 6.0 (AV:N/AC:M/Au:SI/C:P/I:P/A:P) + CVSS Temporal Score : 4.4 + Risk factor: Medium"; + +if(description) +{ + script_id(800123); + script_version("$Revision: 1.0 $"); + script_cve_id("CVE-2008-4789", "CVE-2008-4790" , + "CVE-2008-4791", "CVE-2008-4793"); + script_name(english:"Drupal Core Multiple Vulnerabilities"); + script_description(english:desc["english"]); + script_summary(english:"Check for the Version of Drupal"); + script_category(ACT_MIXED_ATTACK); + script_copyright(english:"Copyright (C) 2008 Intevation GmbH"); + script_family(english:"Misc."); + script_dependencies("http_version.nasl"); + script_require_ports("Services/www", 80); + exit(0); +} + + +include("http_func.inc"); +include("version_func.inc"); +include("http_keepalive.inc"); + +report = string("\n Overview: This host is installed with Drupal and is prone to\n" + + " Multiple Vulnerabilities.\n" + + "\n Vulnerability Insight:" + + "\n Flaws are due to,\n"); +vuln1 = string(" - logic error in the core upload module validation, which allows\n" + + " unprivileged users to attach files.\n"); +vuln2 = string(" - ability to view attached file content which they don't have access.\n"); +vuln3 = string(" - deficiency in the user module allows users who had been blocked\n" + + " by access rules.\n"); +vuln4 = string(" - weakness in the node module API allows for node validation to\n" + + " be bypassed in certain circumstances.\n"); + +port = get_http_port(default:80); +if(!port){ + exit(0); +} + +dirs = make_list("/xampp/drupal", cgi_dirs()); +foreach dir (dirs) +{ + url = dir + "/CHANGELOG.txt"; + sndReq = http_get(item:url, port:port); + rcvRes = http_keepalive_send_recv(port:port, data:sndReq, bodyonly:1); + if(rcvRes == NULL){ + exit(0); + } + + if(rcvRes =~ "Drupal") + { + drupalVer = eregmatch(pattern:"Drupal ([0-9.]+)", string:rcvRes); + if(drupalVer[1] =~ "^6.*") + { + if(version_is_less(version:drupalVer[1], test_version:"6.5")){ + security_hole(data:string(report, vuln1, vuln3, desc["english"])); + exit(0); + } + } + else if(drupalVer[1] =~ "^5.*") + { + if(version_is_less(version:drupalVer[1], test_version:"5.11")){ + security_hole(data:string(report, vuln2, vuln3, vuln4, desc["english"])); + exit(0); + } + } + exit(0); + } +} Property changes on: trunk/openvas-plugins/scripts/gb_drupal_mult_vuln_oct08.nasl ___________________________________________________________________ Name: svn:executable + * From scm-commit at wald.intevation.org Tue Nov 4 15:21:12 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Tue, 4 Nov 2008 15:21:12 +0100 (CET) Subject: [Openvas-commits] r1663 - trunk/openvas-plugins/scripts Message-ID: <20081104142112.721C140736@pyrosoma.intevation.org> Author: chandra Date: 2008-11-04 15:21:10 +0100 (Tue, 04 Nov 2008) New Revision: 1663 Modified: trunk/openvas-plugins/scripts/gb_drupal_mult_vuln_oct08.nasl Log: removed xampp Modified: trunk/openvas-plugins/scripts/gb_drupal_mult_vuln_oct08.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_drupal_mult_vuln_oct08.nasl 2008-11-04 14:12:12 UTC (rev 1662) +++ trunk/openvas-plugins/scripts/gb_drupal_mult_vuln_oct08.nasl 2008-11-04 14:21:10 UTC (rev 1663) @@ -84,7 +84,7 @@ exit(0); } -dirs = make_list("/xampp/drupal", cgi_dirs()); +dirs = make_list("/drupal", cgi_dirs()); foreach dir (dirs) { url = dir + "/CHANGELOG.txt"; From scm-commit at wald.intevation.org Wed Nov 5 06:52:25 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 5 Nov 2008 06:52:25 +0100 (CET) Subject: [Openvas-commits] r1664 - in trunk/openvas-plugins: . scripts Message-ID: <20081105055225.DC25240734@pyrosoma.intevation.org> Author: chandra Date: 2008-11-05 06:52:23 +0100 (Wed, 05 Nov 2008) New Revision: 1664 Added: trunk/openvas-plugins/scripts/gb_wordpress_dir_trav_vuln.nasl trunk/openvas-plugins/scripts/gb_wordpressmu_mult_xss_vuln.nasl trunk/openvas-plugins/scripts/secpod_ibm_tsm_client_remote_bof_vuln_900169.nasl trunk/openvas-plugins/scripts/secpod_ms_iexplorer_uri_spoof_vuln_900170.nasl trunk/openvas-plugins/scripts/secpod_nms_dvd_sdk_actvex_vuln_900132.nasl Modified: trunk/openvas-plugins/ChangeLog Log: Added new plugins Modified: trunk/openvas-plugins/ChangeLog =================================================================== --- trunk/openvas-plugins/ChangeLog 2008-11-04 14:21:10 UTC (rev 1663) +++ trunk/openvas-plugins/ChangeLog 2008-11-05 05:52:23 UTC (rev 1664) @@ -1,3 +1,14 @@ +2008-11-05 Chandrashekhar B + * scripts/gb_wordpressmu_mult_xss_vuln.nasl, + scripts/gb_wordpress_dir_trav_vuln.nasl: + Added new plugins + +2008-11-05 Chandrashekhar B + * scripts/secpod_ibm_tsm_client_remote_bof_vuln_900169.nasl, + scripts/secpod_nms_dvd_sdk_actvex_vuln_900132.nasl, + scripts/secpod_ms_iexplorer_uri_spoof_vuln_900170.nasl: + Added new plugins + 2008-11-04 Chandrashekhar B * scripts/gb_drupal_mult_vuln_oct08.nasl: Added new plugin Added: trunk/openvas-plugins/scripts/gb_wordpress_dir_trav_vuln.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_wordpress_dir_trav_vuln.nasl 2008-11-04 14:21:10 UTC (rev 1663) +++ trunk/openvas-plugins/scripts/gb_wordpress_dir_trav_vuln.nasl 2008-11-05 05:52:23 UTC (rev 1664) @@ -0,0 +1,105 @@ +############################################################################### +# OpenVAS Vulnerability Test +# $Id: gb_wordpress_dir_trav_vuln.nasl 365 2008-11-4 10:10:24Z oct $ +# +# WordPress cat Parameter Directory Traversal Vulnerability +# +# Authors: +# Veerendra GG +# +# Copyright: +# Copyright (c) 2008 Intevation GmbH, http://www.intevation.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# (or any later version), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################### + +if(description) +{ + script_id(800124); + script_version("$Revision: 1.0 $"); + script_cve_id("CVE-2008-4769"); + script_bugtraq_id(28845); + script_name(english:"WordPress cat Parameter Directory Traversal Vulnerability"); + desc["english"] = " + + Overview: The host is installed with WordPress and is prone to Directory Traversal + Vulnerability. + + Vulnerability Insight: + The flaw is caused due to improper validation of input passed via cat parameter + to index.php which is not properly sanitized in the get_category_template() + function. + + Impact: Successful attack could lead to execution of arbitrary PHP code and + can even access sensitive information. + + Impact Level: Application + + Affected Software/OS: + WordPress 2.3.3 and earlier. + + Fix: Update to Version 2.5.1 or later. + http://wordpress.org/ + + References: + http://secunia.com/advisories/29949 + http://www.juniper.fi/security/auto/vulnerabilities/vuln28845.html + + CVSS Score: + CVSS Base Score : 6.8 (AV:N/AC:M/Au:NR/C:P/I:P/A:P) + CVSS Temporal Score : 5.0 + Risk factor: Medium"; + + script_description(english:desc["english"]); + script_summary(english:"Check for the Version of WordPress"); + script_category(ACT_GATHER_INFO); + script_copyright(english:"Copyright (C) 2008 Intevation GmbH"); + script_family(english:"CGI abuses"); + script_require_ports("Services/www", 80); + exit(0); +} + + +include("http_func.inc"); +include("version_func.inc"); +include("http_keepalive.inc"); + +port = get_http_port(default:80); +if(!port){ + exit(0); +} + +dirs = make_list("/wordpress", cgi_dirs()); +foreach dir (dirs) +{ + url = dir + "/index.php"; + sndReq = http_get(item:url, port:port); + rcvRes = http_keepalive_send_recv(port:port, data:sndReq); + if(rcvRes == NULL){ + exit(0); + } + + if(egrep(pattern:"Powered by WordPress", string:rcvRes) && + egrep(pattern:"^HTTP/.* 200 OK", string:rcvRes)) + { + wdPressVer = eregmatch(pattern:"WordPress ([0-9.]+)", string:rcvRes); + if(wdPressVer != NULL) + { + if(version_is_less_equal(version:wdPressVer[1], test_version:"2.3.3")){ + security_warning(port); + } + } + exit(0); + } +} Property changes on: trunk/openvas-plugins/scripts/gb_wordpress_dir_trav_vuln.nasl ___________________________________________________________________ Name: svn:executable + * Added: trunk/openvas-plugins/scripts/gb_wordpressmu_mult_xss_vuln.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_wordpressmu_mult_xss_vuln.nasl 2008-11-04 14:21:10 UTC (rev 1663) +++ trunk/openvas-plugins/scripts/gb_wordpressmu_mult_xss_vuln.nasl 2008-11-05 05:52:23 UTC (rev 1664) @@ -0,0 +1,106 @@ +############################################################################### +# OpenVAS Vulnerability Test +# $Id: gb_wordpressmu_mult_xss_vuln.nasl 365 2008-11-4 11:47:09Z oct $ +# +# WordPress MU Multiple XSS Vulnerabilities - Oct08 +# +# Authors: +# Veerendra GG +# +# Copyright: +# Copyright (c) 2008 Intevation GmbH, http://www.intevation.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# (or any later version), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################### + +if(description) +{ + script_id(800125); + script_version("$Revision: 1.0 $"); + script_cve_id("CVE-2008-4671"); + script_bugtraq_id(31482); + script_name(english:"WordPress MU Multiple XSS Vulnerabilities - Oct08"); + desc["english"] = " + + Overview: The host is running WordPress MU, which is prone to Multiple + XSS Vulnerabilities. + + Vulnerability Insight: + The flaws are caused due to the 's' and 'ip_address' parameters in + wp-admin/wp-blogs.php which is not properly sanitized before being returned + to the user. + + Impact: Successful attack could lead to execution of arbitrary HTML and + script code in the context of an affected site and attackers can steal + cookie-based authentication credentials. + + Impact Level: Application + + Affected Software/OS: + WordPress MU before 2.6 on all running platform. + + Fix: Update to Version 2.6 or later. + http://wordpress.org/ + + References: + http://secunia.com/advisories/32060 + http://www.juniper.fi/security/auto/vulnerabilities/vuln28845.html + + CVSS Score: + CVSS Base Score : 5.8 (AV:N/AC:M/Au:NR/C:P/I:P/A:N) + CVSS Temporal Score : 4.5 + Risk factor: Medium"; + + script_description(english:desc["english"]); + script_summary(english:"Check for the Version of WordPress MU"); + script_category(ACT_GATHER_INFO); + script_copyright(english:"Copyright (C) 2008 Intevation GmbH"); + script_family(english:"CGI abuses"); + script_require_ports("Services/www", 80); + exit(0); +} + + +include("http_func.inc"); +include("version_func.inc"); +include("http_keepalive.inc"); + +port = get_http_port(default:80); +if(!port){ + exit(0); +} + +dirs = make_list("/wordpress-mu", cgi_dirs()); +foreach dir (dirs) +{ + url = dir + "/index.php"; + sndReq = http_get(item:url, port:port); + rcvRes = http_keepalive_send_recv(port:port, data:sndReq); + if(rcvRes == NULL){ + exit(0); + } + + if(egrep(pattern:"WordPress Mu", string:rcvRes) && + egrep(pattern:"^HTTP/.* 200 OK", string:rcvRes)) + { + wdPressVer = eregmatch(pattern:"WordPress ([0-9.]+)", string:rcvRes); + if(wdPressVer != NULL) + { + if(version_is_less(version:wdPressVer[1], test_version:"2.6")){ + security_warning(port); + } + } + exit(0); + } +} Property changes on: trunk/openvas-plugins/scripts/gb_wordpressmu_mult_xss_vuln.nasl ___________________________________________________________________ Name: svn:executable + * Added: trunk/openvas-plugins/scripts/secpod_ibm_tsm_client_remote_bof_vuln_900169.nasl =================================================================== --- trunk/openvas-plugins/scripts/secpod_ibm_tsm_client_remote_bof_vuln_900169.nasl 2008-11-04 14:21:10 UTC (rev 1663) +++ trunk/openvas-plugins/scripts/secpod_ibm_tsm_client_remote_bof_vuln_900169.nasl 2008-11-05 05:52:23 UTC (rev 1664) @@ -0,0 +1,98 @@ +############################################################################## +# +# IBM TSM Client Remote Heap BOF Vulnerability +# +# Copyright: SecPod +# +# Date Written: 2008/10/31 +# +# Revision: 1.0 +# +# Log: ssharath +# Issue #0418 +# ------------------------------------------------------------------------ +# This program was written by SecPod and is licensed under the GNU GPL +# license. Please refer to the below link for details, +# http://www.gnu.org/licenses/gpl.html +# This header contains information regarding licensing terms under the GPL, +# and information regarding obtaining source code from the Author. +# Consequently, pursuant to section 3(c) of the GPL, you must accompany the +# information found in this header with any distribution you make of this +# Program. +# ------------------------------------------------------------------------ +############################################################################## + +if(description) +{ + script_id(900169); + script_bugtraq_id(31988); + script_copyright(english:"Copyright (C) 2008 SecPod"); + script_version("Revision: 1.0 "); + script_category(ACT_GATHER_INFO); + script_family(english:"Misc."); + script_name(english:"IBM TSM Client Remote Heap BOF Vulnerability"); + script_summary(english:"Check for vulnerable version of IBM TSM Client"); + desc["english"] = " + Overview: This host is installed with IBM TSM Client and is prone to heap + based buffer overflow vulnerability. + + Vulnerability exists due to an input validation error in TSM Backup-Archive + client, which affects the Client Acceptor Daemon (CAD) and the Backup-Archive + client scheduler and scheduler service when the option 'SCHEDMODE' is set + to 'PROMPTED'. + + Impact: + Successful exploitation could allow execution of arbitrary code or cause + denial of service. + + Impact Level: Application + + Affected Software/OS: + - IBM Tivoli Storage Manager (TSM) versions 5.5.0.0 through 5.5.0.7 + - IBM Tivoli Storage Manager (TSM) versions 5.4.0.0 through 5.4.2.2 + - IBM Tivoli Storage Manager (TSM) versions 5.3.0.0 through 5.3.6.1 + - IBM Tivoli Storage Manager (TSM) versions 5.2.0.0 through 5.2.5.2 + - IBM Tivoli Storage Manager (TSM) versions 5.1.0.0 through 5.1.8.1 + - IBM Tivoli Storage Manager (TSM) Express all levels + + Fix: Apply patch + http://www-01.ibm.com/support/docview.wss?uid=swg21322623 + + References: + http://secunia.com/advisories/32465/ + http://www.zerodayinitiative.com/advisories/ZDI-08-071/ + + CVSS Score: + CVSS Base Score : 9.3 (AV:N/AC:M/Au:NR/C:C/I:C/A:C) + CVSS Temporal Score : 6.9 + Risk factor : High"; + + script_description(english:desc["english"]); + script_dependencies("secpod_reg_enum.nasl"); + script_require_keys("SMB/WindowsVersion"); + exit(0); +} + + +include("smb_nt.inc"); + +if(!get_kb_item("SMB/WindowsVersion")){ + exit(0); +} + +key = "SOFTWARE\IBM\ADSM\CurrentVersion\Api"; +pkgName = registry_get_sz(key:key, item:"Path"); + +if("Tivoli\TSM" >!< pkgName){ + exit(0); +} + +tsmVer = registry_get_sz(key:key, item:"PtfLevel"); +if(tsmVer){ + # Grep the versions <= 5.1.8.1, <= 5.2.5.2, <= 5.3.6.1, <= 5.4.2.2, <= 5.5.0.7 + if(egrep(pattern:"^(5\.(1\.([0-7]\..*|8\.[01])|2\.([0-4]\..*|5\.[0-2])|3\." + + "([0-5]\..*|6\.[01])|4\.([01]\..*|2\.[0-2])|5\.(0\.[0-7])))$", + string:tsmVer)){ + security_hole(0); + } +} Added: trunk/openvas-plugins/scripts/secpod_ms_iexplorer_uri_spoof_vuln_900170.nasl =================================================================== --- trunk/openvas-plugins/scripts/secpod_ms_iexplorer_uri_spoof_vuln_900170.nasl 2008-11-04 14:21:10 UTC (rev 1663) +++ trunk/openvas-plugins/scripts/secpod_ms_iexplorer_uri_spoof_vuln_900170.nasl 2008-11-05 05:52:23 UTC (rev 1664) @@ -0,0 +1,87 @@ +############################################################################## +# +# Microsoft iExplorer '&NBSP;' Address Bar URI Spoofing Vulnerability +# +# Copyright: SecPod +# +# Date Written: 2008/10/31 +# +# Revision: 1.0 +# +# Log: ssharath +# Issue #0420 +# ------------------------------------------------------------------------ +# This program was written by SecPod and is licensed under the GNU GPL +# license. Please refer to the below link for details, +# http://www.gnu.org/licenses/gpl.html +# This header contains information regarding licensing terms under the GPL, +# and information regarding obtaining source code from the Author. +# Consequently, pursuant to section 3(c) of the GPL, you must accompany the +# information found in this header with any distribution you make of this +# Program. +# ------------------------------------------------------------------------ +############################################################################## + +if(description) +{ + script_id(900170); + script_bugtraq_id(31960); + script_cve_id("CVE-2008-4787"); + script_copyright(english:"Copyright (C) 2008 SecPod"); + script_version("Revision: 1.0 "); + script_category(ACT_GATHER_INFO); + script_family(english:"Misc."); + script_name(english:"Microsoft iExplorer '&NBSP;' Address Bar URI Spoofing Vulnerability"); + script_summary(english:"Check for vulnerable version of Microsoft Internet Explorer"); + desc["english"] = " + Overview: This host is installed with Microsoft Internet Explorer and is prone + to URI spoofing vulnerability. + + The flaw is exists due to failure to adequately handle specific combination + of the non-breaking space character like '&NBSP;'. + + Impact: + Attacker may leverage this issue to spoof the source URI of a site which leads + to false sense of trust. + + Impact Level: System + + Affected Software/OS: + Microsoft Internet Explorer versions 6.0 SP1 and prior + + Fix: No solution/patch is available as on 31st October, 2008. + + References: + http://web.nvd.nist.gov/view/vuln/detail?execution + + CVSS Score: + CVSS Base Score : 4.3 (AV:N/AC:M/Au:NR/C:P/I:N/A:N) + CVSS Temporal Score : 3.9 + Risk factor : Medium"; + + script_description(english:desc["english"]); + script_dependencies("secpod_reg_enum.nasl"); + script_require_keys("SMB/WindowsVersion"); + exit(0); +} + + +include("smb_nt.inc"); + +if(!get_kb_item("SMB/WindowsVersion")){ + exit(0); +} + +key = "SOFTWARE\Microsoft\Internet Explorer"; +iExpVer = registry_get_sz(key:key , item:"Version"); +if(!iExpVer){ + iExpVer = registry_get_sz(key:key, item:"W2kVersion"); + if(!iExpVer){ + exit(0); + } +} + +# Grep for version 6.0 x +if(ereg(pattern:"^6\.0", string:iExpVer)){ + security_warning(0); +} Added: trunk/openvas-plugins/scripts/secpod_nms_dvd_sdk_actvex_vuln_900132.nasl =================================================================== --- trunk/openvas-plugins/scripts/secpod_nms_dvd_sdk_actvex_vuln_900132.nasl 2008-11-04 14:21:10 UTC (rev 1663) +++ trunk/openvas-plugins/scripts/secpod_nms_dvd_sdk_actvex_vuln_900132.nasl 2008-11-05 05:52:23 UTC (rev 1664) @@ -0,0 +1,94 @@ +############################################################################## +# +# NuMedia Soft DVD Burning SDK Activex Control Remote Code Execution Vulnerability +# +# Copyright: SecPod +# +# Date Written: 2008/11/03 +# +# Revision: 1.2 +# +# Log : ssharath +# Issue #0394 +# ------------------------------------------------------------------------ +# This program was written by SecPod and is licensed under the GNU GPL +# license. Please refer to the below link for details, +# http://www.gnu.org/licenses/gpl.html +# This header contains information regarding licensing terms under the GPL, +# and information regarding obtaining source code from the Author. +# Consequently, pursuant to section 3(c) of the GPL, you must accompany the +# information found in this header with any distribution you make of this +# Program. +# ------------------------------------------------------------------------ +############################################################################## + +if(description) +{ + script_id(900132); + script_bugtraq_id(31374); + script_cve_id("CVE-2008-4342"); + script_copyright(english:"Copyright (C) 2008 SecPod"); + script_version("Revision: 1.2 "); + script_category(ACT_GATHER_INFO); + script_family(english:"Misc."); + script_name(english:"NuMedia Soft DVD Burning SDK Activex Control Remote Code Execution Vulnerability"); + script_summary(english:"Check for vulnerable version of CDBurnerXP"); + desc["english"] = " + + Overview : The host is installed CDBurnerXP, which is prone to ActiveX control + based remote code execution vulnerability. + + Vulnerability Insight : + The flaw is caused due to an error in validating/sanitizing the input data + sent to NMSDVDX.dll file. + + Impact : Exploitation will cause Internet Explorer to restrict the webpage + from running scripts and could overwrite files with arbitrary content. + + Impact Level : Application + + Affected Software/OS : + - CDBurnerXP versions 4.2.1.976 and prior on all platform + - Numedia NMS DVD Burning SDK ActiveX version 1.013C and prior + - Mystik Media Blaze Media Pro version 8.02.0009 Special Edition and prior + + Fix : Set the kill-bit for the affected ActiveX control. + No solution/patch is available as on 03rd November, 2008. + + References : + http://cdburnerxp.se/en/home + http://secunia.com/advisories/32455/ + http://secunia.com/advisories/31949/ + http://secunia.com/advisories/31936/ + http://www.milw0rm.com/exploits/6491 + + CVSS Score : + CVSS Base Score : 5.1 (AV:N/AC:H/Au:NR/C:P/I:P/A:P) + CVSS Temporal Score : 4.6 + Risk factor : Medium"; + + script_description(english:desc["english"]); + script_dependencies("secpod_reg_enum.nasl"); + script_require_keys("SMB/WindowsVersion"); + exit(0); +} + +include("secpod_smb_func.inc"); + +if(!get_kb_item("SMB/WindowsVersion")){ + exit(0); +} + +clsid = "{C2FBBB5F-6FF7-4F6B-93A3-7EDB509AA938}"; +regKey = "SOFTWARE\Classes\CLSID\"+ clsid; +if(registry_key_exists(key:regKey)) +{ + # Check for Kill-Bit set for ActiveX control + activeKey = "SOFTWARE\Microsoft\Internet Explorer\"+ + "ActiveX Compatibility\" + clsid; + killBit = registry_get_dword(key:activeKey, item:"Compatibility Flags"); + if(killBit && (int(killBit) == 1024)){ + exit(0); + } + security_warning(0); +} From scm-commit at wald.intevation.org Wed Nov 5 11:06:13 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 5 Nov 2008 11:06:13 +0100 (CET) Subject: [Openvas-commits] r1665 - in trunk/openvas-plugins: . plugins/3com_hub plugins/find_service plugins/ftp_write_dirs plugins/linux_tftp plugins/nmap_wrapper plugins/objectserver plugins/openvas_tcp_scanner plugins/smad plugins/ssl_ciphers plugins/synscan Message-ID: <20081105100613.312CD4073F@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-05 11:06:12 +0100 (Wed, 05 Nov 2008) New Revision: 1665 Modified: trunk/openvas-plugins/ChangeLog trunk/openvas-plugins/plugins/3com_hub/Makefile trunk/openvas-plugins/plugins/find_service/Makefile trunk/openvas-plugins/plugins/ftp_write_dirs/Makefile trunk/openvas-plugins/plugins/linux_tftp/Makefile trunk/openvas-plugins/plugins/nmap_wrapper/Makefile trunk/openvas-plugins/plugins/objectserver/Makefile trunk/openvas-plugins/plugins/openvas_tcp_scanner/Makefile trunk/openvas-plugins/plugins/smad/Makefile trunk/openvas-plugins/plugins/ssl_ciphers/Makefile trunk/openvas-plugins/plugins/synscan/Makefile Log: * plugins/3com_hub/Makefile, plugins/find_service/Makefile, plugins/ftp_write_dirs/Makefile, plugins/smad/Makefile, plugins/openvas_tcp_scanner/Makefile, plugins/nmap_wrapper/Makefile, plugins/linux_tftp/Makefile, plugins/objectserver/Makefile, plugins/ssl_ciphers/Makefile, plugins/synscan/Makefile: Honor LDFLAGS. Remaining part of the patch provided by Hanno Boeck on 2008-09-17. Modified: trunk/openvas-plugins/ChangeLog =================================================================== --- trunk/openvas-plugins/ChangeLog 2008-11-05 05:52:23 UTC (rev 1664) +++ trunk/openvas-plugins/ChangeLog 2008-11-05 10:06:12 UTC (rev 1665) @@ -1,3 +1,12 @@ +2008-11-05 Michael Wiegand + + * plugins/3com_hub/Makefile, plugins/find_service/Makefile, + plugins/ftp_write_dirs/Makefile, plugins/smad/Makefile, + plugins/openvas_tcp_scanner/Makefile, plugins/nmap_wrapper/Makefile, + plugins/linux_tftp/Makefile, plugins/objectserver/Makefile, + plugins/ssl_ciphers/Makefile, plugins/synscan/Makefile: Honor LDFLAGS. + Remaining part of the patch provided by Hanno Boeck on 2008-09-17. + 2008-11-05 Chandrashekhar B * scripts/gb_wordpressmu_mult_xss_vuln.nasl, scripts/gb_wordpress_dir_trav_vuln.nasl: Modified: trunk/openvas-plugins/plugins/3com_hub/Makefile =================================================================== --- trunk/openvas-plugins/plugins/3com_hub/Makefile 2008-11-05 05:52:23 UTC (rev 1664) +++ trunk/openvas-plugins/plugins/3com_hub/Makefile 2008-11-05 10:06:12 UTC (rev 1665) @@ -6,7 +6,7 @@ $(PLUGNAME).nes : $(PLUGNAME).c $(LIBTOOL) --mode=compile --tag CC $(CC) $(DEFS) $(include) -I/usr/local/include `libnet-config --defines --cflags` -c $(PLUGNAME).c - $(LIBTOOL) --mode=link --tag CC $(CC) $(DEFS) -o lib$(PLUGNAME).la $(PLUGNAME).lo `libnet-config --defines --libs` -L/usr/local/lib $(LIBS) \ + $(LIBTOOL) --mode=link --tag CC $(CC) $(DEFS) $(LDFLAGS) -o lib$(PLUGNAME).la $(PLUGNAME).lo `libnet-config --defines --libs` -L/usr/local/lib $(LIBS) \ -rpath $(rootdir)/bin/plugins ../install_plug $(PLUGNAME) $(rootdir) clean : Modified: trunk/openvas-plugins/plugins/find_service/Makefile =================================================================== --- trunk/openvas-plugins/plugins/find_service/Makefile 2008-11-05 05:52:23 UTC (rev 1664) +++ trunk/openvas-plugins/plugins/find_service/Makefile 2008-11-05 10:06:12 UTC (rev 1665) @@ -5,7 +5,7 @@ all : $(PLUGNAME).nes $(PLUGNAME).nes : $(PLUGNAME).c $(LIBTOOL) --mode=compile --tag CC $(CC) $(DEFS) $(include) -c $(PLUGNAME).c - $(LIBTOOL) --mode=link --tag CC $(CC) $(DEFS) -o lib$(PLUGNAME).la $(PLUGNAME).lo $(LIBS) \ + $(LIBTOOL) --mode=link --tag CC $(CC) $(DEFS) $(LDFLAGS) -o lib$(PLUGNAME).la $(PLUGNAME).lo $(LIBS) \ -rpath $(rootdir)/bin/plugins ../install_plug $(PLUGNAME) $(rootdir) clean : Modified: trunk/openvas-plugins/plugins/ftp_write_dirs/Makefile =================================================================== --- trunk/openvas-plugins/plugins/ftp_write_dirs/Makefile 2008-11-05 05:52:23 UTC (rev 1664) +++ trunk/openvas-plugins/plugins/ftp_write_dirs/Makefile 2008-11-05 10:06:12 UTC (rev 1665) @@ -5,7 +5,7 @@ all : $(PLUGNAME).nes $(PLUGNAME).nes : $(PLUGNAME).c $(LIBTOOL) --mode=compile --tag CC $(CC) $(DEFS) $(include) -c $(PLUGNAME).c - $(LIBTOOL) --mode=link --tag CC $(CC) -o lib$(PLUGNAME).la $(PLUGNAME).lo $(LIBS) \ + $(LIBTOOL) --mode=link --tag CC $(CC) $(LDFLAGS) -o lib$(PLUGNAME).la $(PLUGNAME).lo $(LIBS) \ -rpath $(rootdir)/bin/plugins ../install_plug $(PLUGNAME) $(rootdir) clean : Modified: trunk/openvas-plugins/plugins/linux_tftp/Makefile =================================================================== --- trunk/openvas-plugins/plugins/linux_tftp/Makefile 2008-11-05 05:52:23 UTC (rev 1664) +++ trunk/openvas-plugins/plugins/linux_tftp/Makefile 2008-11-05 10:06:12 UTC (rev 1665) @@ -5,7 +5,7 @@ all : $(PLUGNAME).nes $(PLUGNAME).nes : $(PLUGNAME).c $(LIBTOOL) --mode=compile --tag CC $(CC) $(DEFS) $(include) -c $(PLUGNAME).c - $(LIBTOOL) --mode=link --tag CC $(CC) -o lib$(PLUGNAME).la $(PLUGNAME).lo $(LIBS) \ + $(LIBTOOL) --mode=link --tag CC $(CC) $(LDFLAGS) -o lib$(PLUGNAME).la $(PLUGNAME).lo $(LIBS) \ -rpath $(rootdir)/bin/plugins ../install_plug $(PLUGNAME) $(rootdir) clean : Modified: trunk/openvas-plugins/plugins/nmap_wrapper/Makefile =================================================================== --- trunk/openvas-plugins/plugins/nmap_wrapper/Makefile 2008-11-05 05:52:23 UTC (rev 1664) +++ trunk/openvas-plugins/plugins/nmap_wrapper/Makefile 2008-11-05 10:06:12 UTC (rev 1665) @@ -5,7 +5,7 @@ all : $(PLUGNAME).nes $(PLUGNAME).nes : $(PLUGNAME).c $(LIBTOOL) --mode=compile --tag CC $(CC) $(DEFS) $(include) -c $(PLUGNAME).c - $(LIBTOOL) --mode=link --tag CC $(CC) $(DEFS) -o lib$(PLUGNAME).la $(PLUGNAME).lo $(LIBS) $(LIBUTIL) \ + $(LIBTOOL) --mode=link --tag CC $(CC) $(DEFS) $(LDFLAGS) -o lib$(PLUGNAME).la $(PLUGNAME).lo $(LIBS) $(LIBUTIL) \ -rpath $(rootdir)/bin/plugins ../install_plug $(PLUGNAME) $(rootdir) clean : Modified: trunk/openvas-plugins/plugins/objectserver/Makefile =================================================================== --- trunk/openvas-plugins/plugins/objectserver/Makefile 2008-11-05 05:52:23 UTC (rev 1664) +++ trunk/openvas-plugins/plugins/objectserver/Makefile 2008-11-05 10:06:12 UTC (rev 1665) @@ -5,7 +5,7 @@ all : $(PLUGNAME).nes $(PLUGNAME).nes : $(PLUGNAME).c $(LIBTOOL) --mode=compile --tag CC $(CC) $(DEFS) $(include) -c $(PLUGNAME).c - $(LIBTOOL) --mode=link --tag CC $(CC) -o lib$(PLUGNAME).la $(PLUGNAME).lo $(LIBS) \ + $(LIBTOOL) --mode=link --tag CC $(CC) $(LDFLAGS) -o lib$(PLUGNAME).la $(PLUGNAME).lo $(LIBS) \ -rpath $(rootdir)/bin/plugins ../install_plug $(PLUGNAME) $(rootdir) clean : Modified: trunk/openvas-plugins/plugins/openvas_tcp_scanner/Makefile =================================================================== --- trunk/openvas-plugins/plugins/openvas_tcp_scanner/Makefile 2008-11-05 05:52:23 UTC (rev 1664) +++ trunk/openvas-plugins/plugins/openvas_tcp_scanner/Makefile 2008-11-05 10:06:12 UTC (rev 1665) @@ -8,7 +8,7 @@ all : $(PLUGNAME).nes $(PLUGNAME).nes : $(PLUGNAME).c $(LIBTOOL) --mode=compile --tag CC $(CC) $(DEFS) $(include) -c $(PLUGNAME).c - $(LIBTOOL) --mode=link --tag CC $(CC) $(DEFS) -o lib$(PLUGNAME).la $(PLUGNAME).lo $(LIBS) -lm $(LIBUTIL) \ + $(LIBTOOL) --mode=link --tag CC $(CC) $(DEFS) $(LDFLAGS) -o lib$(PLUGNAME).la $(PLUGNAME).lo $(LIBS) -lm $(LIBUTIL) \ -rpath $(rootdir)/bin/plugins ../install_plug $(PLUGNAME) $(rootdir) clean : Modified: trunk/openvas-plugins/plugins/smad/Makefile =================================================================== --- trunk/openvas-plugins/plugins/smad/Makefile 2008-11-05 05:52:23 UTC (rev 1664) +++ trunk/openvas-plugins/plugins/smad/Makefile 2008-11-05 10:06:12 UTC (rev 1665) @@ -5,7 +5,7 @@ all : $(PLUGNAME).nes $(PLUGNAME).nes : $(PLUGNAME).c $(LIBTOOL) --mode=compile --tag CC $(CC) $(DEFS) $(include) -c $(PLUGNAME).c - $(LIBTOOL) --mode=link --tag CC $(CC) -o lib$(PLUGNAME).la $(PLUGNAME).lo $(LIBS) \ + $(LIBTOOL) --mode=link --tag CC $(CC) $(LDFLAGS) -o lib$(PLUGNAME).la $(PLUGNAME).lo $(LIBS) \ -rpath $(rootdir)/bin/plugins ../install_plug $(PLUGNAME) $(rootdir) clean : Modified: trunk/openvas-plugins/plugins/ssl_ciphers/Makefile =================================================================== --- trunk/openvas-plugins/plugins/ssl_ciphers/Makefile 2008-11-05 05:52:23 UTC (rev 1664) +++ trunk/openvas-plugins/plugins/ssl_ciphers/Makefile 2008-11-05 10:06:12 UTC (rev 1665) @@ -5,7 +5,7 @@ all : $(PLUGNAME).nes $(PLUGNAME).nes : $(PLUGNAME).c $(LIBTOOL) --mode=compile --tag CC $(CC) $(DEFS) $(include) -c $(PLUGNAME).c - $(LIBTOOL) --mode=link --tag CC $(CC) -o lib$(PLUGNAME).la $(PLUGNAME).lo $(LIBS) \ + $(LIBTOOL) --mode=link --tag CC $(CC) $(LDFLAGS) -o lib$(PLUGNAME).la $(PLUGNAME).lo $(LIBS) \ -rpath $(rootdir)/bin/plugins ../install_plug $(PLUGNAME) $(rootdir) clean : Modified: trunk/openvas-plugins/plugins/synscan/Makefile =================================================================== --- trunk/openvas-plugins/plugins/synscan/Makefile 2008-11-05 05:52:23 UTC (rev 1664) +++ trunk/openvas-plugins/plugins/synscan/Makefile 2008-11-05 10:06:12 UTC (rev 1665) @@ -5,7 +5,7 @@ all : $(PLUGNAME).nes $(PLUGNAME).nes : $(PLUGNAME).c $(LIBTOOL) --mode=compile --tag CC $(CC) $(DEFS) $(include) -c $(PLUGNAME).c - $(LIBTOOL) --mode=link --tag CC $(CC) $(DEFS) -o lib$(PLUGNAME).la $(PLUGNAME).lo $(LIBS) \ + $(LIBTOOL) --mode=link --tag CC $(CC) $(DEFS) $(LDFLAGS) -o lib$(PLUGNAME).la $(PLUGNAME).lo $(LIBS) \ -rpath $(rootdir)/bin/plugins ../install_plug $(PLUGNAME) $(rootdir) clean : From scm-commit at wald.intevation.org Wed Nov 5 13:21:04 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 5 Nov 2008 13:21:04 +0100 (CET) Subject: [Openvas-commits] r1666 - trunk/openvas-plugins/scripts Message-ID: <20081105122104.C931D40748@pyrosoma.intevation.org> Author: chandra Date: 2008-11-05 13:21:04 +0100 (Wed, 05 Nov 2008) New Revision: 1666 Added: trunk/openvas-plugins/scripts/gb_adobe_prdts_mult_vuln_nov08_lin.nasl trunk/openvas-plugins/scripts/gb_adobe_prdts_mult_vuln_nov08_win.nasl trunk/openvas-plugins/scripts/gb_sun_java_ws_code_exec_vuln_lin.nasl trunk/openvas-plugins/scripts/gb_sun_java_ws_code_exec_vuln_win.nasl Log: Added new plugins Added: trunk/openvas-plugins/scripts/gb_adobe_prdts_mult_vuln_nov08_lin.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_adobe_prdts_mult_vuln_nov08_lin.nasl 2008-11-05 10:06:12 UTC (rev 1665) +++ trunk/openvas-plugins/scripts/gb_adobe_prdts_mult_vuln_nov08_lin.nasl 2008-11-05 12:21:04 UTC (rev 1666) @@ -0,0 +1,89 @@ +############################################################################### +# OpenVAS Vulnerability Test +# $Id: gb_adobe_prdts_mult_vuln_nov08_lin.nasl 428 2008-11-05 11:22:46Z oct $ +# +# Adobe Reader/Acrobat Multiple Vulnerabilities - Nov08 (Linux) +# +# Authors: +# Chandan S +# +# Copyright: +# Copyright (c) 2008 Intevation GmbH, http://www.intevation.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# (or any later version), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################### + +if(description) +{ + script_id(800051); + script_version("$Revision: 1.0 $"); + script_cve_id("CVE-2008-2992", "CVE-2008-2549", "CVE-2008-4812", + "CVE-2008-4813", "CVE-2008-4817", "CVE-2008-4816", + "CVE-2008-4814", "CVE-2008-4815"); + script_bugtraq_id(30035, 32100); + script_name(english:"Adobe Reader/Acrobat Multiple Vulnerabilities - Nov08 (Linux)"); + desc["english"] = " + + Overview: This host has Adobe Reader/Acrobat installed, which is/are prone + to multiple vulnerabilities. + + Vulnerability Insight: + The flaws are due to, + - a boundary error when parsing format strings containing a floating point + specifier in the util.printf() Javascript function. + - improper parsing of type 1 fonts. + - bounds checking not being performed after allocating an area of memory. + + Impact: + Successful exploitation allows remote attackers to execute arbitrary code + to cause a stack based overflow via a specially crafted PDF, and could + also take complete control of the affected system and cause the application + to crash. + + Impact Level: System + + Affected Software/OS: + Adobe Reader/Acrobat versions 8.1.2 and prior - Linux(All) + + Fix: + Upgrade to 8.1.3 or higher versions, + http://www.adobe.com/products/ + + References: + http://www.adobe.com/support/security/bulletins/apsb08-19.html + http://www.coresecurity.com/content/adobe-reader-buffer-overflow + + CVSS Score: + CVSS Base Score : 9.3 (AV:N/AC:M/Au:NR/C:C/I:C/A:C) + CVSS Temporal Score : 7.3 + Risk factor: High"; + + script_description(english:desc["english"]); + script_summary(english:"Check for the version of Adobe Reader/Acrobat"); + script_category(ACT_GATHER_INFO); + script_copyright(english:"Copyright (C) 2008 Intevation GmbH"); + script_family(english:"Misc."); + script_dependencies("gb_adobe_prdts_detect_lin.nasl"); + exit(0); +} + + +adobeVer = get_kb_item("Adobe/Reader/Linux/Version"); +if(!adobeVer){ + exit(0); +} + +if(adobeVer =~ "^(7.*|8\.0(\..*)?|8\.1(\.[0-2](_.*)?)?)$"){ + security_hole(0); +} Property changes on: trunk/openvas-plugins/scripts/gb_adobe_prdts_mult_vuln_nov08_lin.nasl ___________________________________________________________________ Name: svn:executable + * Added: trunk/openvas-plugins/scripts/gb_adobe_prdts_mult_vuln_nov08_win.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_adobe_prdts_mult_vuln_nov08_win.nasl 2008-11-05 10:06:12 UTC (rev 1665) +++ trunk/openvas-plugins/scripts/gb_adobe_prdts_mult_vuln_nov08_win.nasl 2008-11-05 12:21:04 UTC (rev 1666) @@ -0,0 +1,113 @@ +############################################################################### +# OpenVAS Vulnerability Test +# $Id: gb_adobe_prdts_mult_vuln_nov08_win.nasl 428 2008-11-05 11:03:58Z nov $ +# +# Adobe Reader/Acrobat Multiple Vulnerabilities - Nov08 (Win) +# +# Authors: +# Chandan S +# +# Copyright: +# Copyright (c) 2008 Intevation GmbH, http://www.intevation.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# (or any later version), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################### + +if(description) +{ + script_id(800050); + script_version("$Revision: 1.0 $"); + script_cve_id("CVE-2008-2992", "CVE-2008-2549", "CVE-2008-4812", + "CVE-2008-4813", "CVE-2008-4817", "CVE-2008-4816", + "CVE-2008-4814", "CVE-2008-4815"); + script_bugtraq_id(30035, 32100); + script_name(english:"Adobe Reader/Acrobat Multiple Vulnerabilities - Nov08 (Win)"); + desc["english"] = " + + Overview: This host has Adobe Reader/Acrobat installed, which is/are prone + to multiple vulnerabilities. + + Vulnerability Insight: + The flaws are due to, + - a boundary error when parsing format strings containing a floating point + specifier in the util.printf() Javascript function. + - improper parsing of type 1 fonts. + - bounds checking not being performed after allocating an area of memory. + + Impact: + Successful exploitation allows remote attackers to execute arbitrary code + to cause a stack based overflow via a specially crafted PDF, and could + also take complete control of the affected system and cause the application + to crash. + + Impact Level: System + + Affected Software/OS: + Adobe Reader versions 8.1.2 and prior - Windows(All) + Adobe Acrobat Professional versions 8.1.2 and prior - Windows(All) + + Upgrade to 8.1.3 or higher versions, + http://www.adobe.com/products/ + + References: + http://www.adobe.com/support/security/bulletins/apsb08-19.html + http://www.coresecurity.com/content/adobe-reader-buffer-overflow + + CVSS Score: + CVSS Base Score : 9.3 (AV:N/AC:M/Au:NR/C:C/I:C/A:C) + CVSS Temporal Score : 7.3 + Risk factor: High"; + + script_description(english:desc["english"]); + script_summary(english:"Check for the version of Adobe Reader/Acrobat"); + script_category(ACT_GATHER_INFO); + script_copyright(english:"Copyright (C) 2008 Intevation GmbH"); + script_family(english:"Misc."); + script_dependencies("secpod_reg_enum.nasl"); + script_require_keys("SMB/WindowsVersion"); + exit(0); +} + + +include("smb_nt.inc"); +include("secpod_smb_func.inc"); + +if(!get_kb_item("SMB/WindowsVersion")){ + exit(0); +} + +if(!registry_key_exists(key:"SOFTWARE\Adobe")){ + exit(0); +} + +key = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"; +keys = registry_enum_keys(key:key); + +foreach item (keys) +{ + adobeName = registry_get_sz(item:"DisplayName", key:key +item); + + if("Adobe Reader" >< adobeName || "Adobe Acrobat" >< adobeName) + { + adobeVer = registry_get_sz(item:"DisplayVersion", key:key + item); + if(!adobeVer){ + exit(0); + } + + if(adobeVer =~ "^(7.*|8\.0(\..*)?|8\.1(\.[0-2])?)$"){ + security_hole(0); + } + exit(0); + } +} Property changes on: trunk/openvas-plugins/scripts/gb_adobe_prdts_mult_vuln_nov08_win.nasl ___________________________________________________________________ Name: svn:executable + * Added: trunk/openvas-plugins/scripts/gb_sun_java_ws_code_exec_vuln_lin.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_sun_java_ws_code_exec_vuln_lin.nasl 2008-11-05 10:06:12 UTC (rev 1665) +++ trunk/openvas-plugins/scripts/gb_sun_java_ws_code_exec_vuln_lin.nasl 2008-11-05 12:21:04 UTC (rev 1666) @@ -0,0 +1,91 @@ +############################################################################### +# OpenVAS Vulnerability Test +# $Id: gb_sun_java_ws_code_exec_vuln_lin.nasl 425 2008-11-04 17:50:20Z nov $ +# +# Sun Java Web Start Remote Command Execution Vulnerability (Linux) +# +# Authors: +# Veerendra GG +# +# Copyright: +# Copyright (c) 2008 Intevation GmbH, http://www.intevation.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# (or any later version), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################### + +if(description) +{ + script_id(800127); + script_version("$Revision: 1.0 $"); + script_cve_id("CVE-2008-4910"); + script_bugtraq_id(31916); + script_name(english:"Sun Java Web Start Remote Command Execution Vulnerability (Linux)"); + desc["english"] = " + Overview: This host is running Sun Java Web Start and is prone to Remote + Command Execution Vulnerability. + + Vulnerability Insight: + The flaw exist due to weakness in the BasicService showDocument method + which does not validate the inputs appropriately. This can be exploited + using a specially crafted Java Web Start application via file:\\ URL + argument to the showDocument method. + + Impact: Successful exploitation allows remote code execution on the + client machines. + + Impact Level: Application + + Affected Software/OS: + Sun J2SE 6.0 Update 10 and earlier. + + Fix: No solution/patch is available as on 5th November, 2008. Information + regarding this issue will updated once the solution details are available. + For updates refer, http://java.sun.com/javase/downloads/index.jsp + + References: + http://xforce.iss.net/xforce/xfdb/46119 + http://archives.neohapsis.com/archives/bugtraq/2008-10/0192.html + + CVSS Score: + CVSS Base Score : 5.8 (AV:N/AC:M/Au:NR/C:P/I:P/A:N) + CVSS Temporal Score : 5.2 + Risk factor: High"; + + script_description(english:desc["english"]); + script_summary(english:"Check for the Version of Sun Java Web Start"); + script_category(ACT_GATHER_INFO); + script_copyright(english:"Copyright (C) 2008 Intevation GmbH"); + script_family(english:"Misc."); + exit(0); +} + + +include("version_func.inc"); + +sock = ssh_login_or_reuse_connection(); +if(!sock){ + exit(0); +} + +jwsVer = get_bin_version(full_prog_name:"javaws", version_argv:"-version", + ver_pattern:"Java.* Web Start ([0-9._]+)", sock:sock); +jwsVer = ereg_replace(pattern:"_", string:jwsVer[1], replace: "."); + +if(jwsVer) +{ + if(version_is_less_equal(version:jwsVer, test_version:"1.6.0.10")){ + security_hole(0); + } +} +ssh_close_connection(); Added: trunk/openvas-plugins/scripts/gb_sun_java_ws_code_exec_vuln_win.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_sun_java_ws_code_exec_vuln_win.nasl 2008-11-05 10:06:12 UTC (rev 1665) +++ trunk/openvas-plugins/scripts/gb_sun_java_ws_code_exec_vuln_win.nasl 2008-11-05 12:21:04 UTC (rev 1666) @@ -0,0 +1,93 @@ +############################################################################### +# OpenVAS Vulnerability Test +# $Id: gb_sun_java_ws_code_exec_vuln_win.nasl 425 2008-11-04 17:50:20Z nov $ +# +# Sun Java Web Start Remote Command Execution Vulnerability (Win) +# +# Authors: +# Veerendra GG +# +# Copyright: +# Copyright (c) 2008 Intevation GmbH, http://www.intevation.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# (or any later version), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################### + +if(description) +{ + script_id(800126); + script_version("$Revision: 1.0 $"); + script_cve_id("CVE-2008-4910"); + script_bugtraq_id(31916); + script_name(english:"Sun Java Web Start Remote Command Execution Vulnerability (Win)"); + desc["english"] = " + Overview: This host is running Sun Java Web Start and is prone to Remote + Command Execution Vulnerability. + + Vulnerability Insight: + The flaw exist due to weakness in the BasicService showDocument method + which does not validate the inputs appropriately. This can be exploited + using a specially crafted Java Web Start application via file:\\ URL + argument to the showDocument method. + + Impact: Successful exploitation allows remote code execution on the + client machines. + + Impact Level: Application + + Affected Software/OS: + Sun J2SE 6.0 Update 10 and earlier. + + Fix: + No solution or patch is available as on 5th November, 2008. Information + regarding this issue will updated once the solution details are available. + For updates refer, http://java.sun.com/javase/downloads/index.jsp + + References: + http://xforce.iss.net/xforce/xfdb/46119 + http://archives.neohapsis.com/archives/bugtraq/2008-10/0192.html + + CVSS Score: + CVSS Base Score : 5.8 (AV:N/AC:M/Au:NR/C:P/I:P/A:N) + CVSS Temporal Score : 5.2 + Risk factor: High"; + + script_description(english:desc["english"]); + script_summary(english:"Check for the Version of Sun Java Web Start"); + script_category(ACT_GATHER_INFO); + script_copyright(english:"Copyright (C) 2008 Intevation GmbH"); + script_family(english:"Misc."); + script_dependencies("secpod_reg_enum.nasl"); + script_require_keys("SMB/WindowsVersion"); + exit(0); +} + + +include("smb_nt.inc"); +include("version_func.inc"); + +if(!get_kb_item("SMB/WindowsVersion")){ + exit(0); +} + +jwsVer = registry_get_sz(item:"CurrentVersion", + key:"SOFTWARE\JavaSoft\Java Web Start"); +jwsVer = ereg_replace(pattern:"_", string:jwsVer, replace: "."); + +if(jwsVer) +{ + if(version_is_less_equal(version:jwsVer, test_version:"1.6.0.10")){ + security_hole(0); + } +} From scm-commit at wald.intevation.org Wed Nov 5 15:58:20 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 5 Nov 2008 15:58:20 +0100 (CET) Subject: [Openvas-commits] r1667 - in trunk/openvas-libraries: . libopenvas Message-ID: <20081105145820.022B040774@pyrosoma.intevation.org> Author: felix Date: 2008-11-05 15:58:19 +0100 (Wed, 05 Nov 2008) New Revision: 1667 Modified: trunk/openvas-libraries/ChangeLog trunk/openvas-libraries/libopenvas/store.c Log: Work on Change Request #17 (http://www.openvas.org/openvas-cr-17.html - "OTP: Make NVT signatures available to OpenVAS-Client"). Replaced sending of dummy certificate key oids by "real" fingerprints. * libopenvas/store.c (store_load_plugin): Fixed tests about signature file, replaced obsolete ID check by OID check, removed dummy string.i M openvas-libraries/ChangeLog M openvas-libraries/libopenvas/store.c Modified: trunk/openvas-libraries/ChangeLog =================================================================== --- trunk/openvas-libraries/ChangeLog 2008-11-05 12:21:04 UTC (rev 1666) +++ trunk/openvas-libraries/ChangeLog 2008-11-05 14:58:19 UTC (rev 1667) @@ -1,3 +1,12 @@ +2008-11-5 Felix Wolfsteller + + Work on Change Request #17 (http://www.openvas.org/openvas-cr-17.html - + "OTP: Make NVT signatures available to OpenVAS-Client"). + Replaced sending of dummy certificate key oids by "real" fingerprints. + + * libopenvas/store.c (store_load_plugin): Fixed tests about signature + file, replaced obsolete ID check by OID check, removed dummy string. + 2008-10-31 Felix Wolfsteller Steps to an implementation of Change Request #17 Modified: trunk/openvas-libraries/libopenvas/store.c =================================================================== --- trunk/openvas-libraries/libopenvas/store.c 2008-11-05 12:21:04 UTC (rev 1666) +++ trunk/openvas-libraries/libopenvas/store.c 2008-11-05 14:58:19 UTC (rev 1667) @@ -326,39 +326,46 @@ snprintf(plug_file, sizeof(plug_file), "%s/%s", dir, file); - /* Plugin file, cache file and a signature have to exist */ - /* FIXME: felix. move the stat tests to plugin-class implementation - (nasl_plugin, oval_plugin) + do not reparse if no .asc was found and - preference no_signature_check is set. */ - if ( stat(plug_file, &stat_plug) < 0 || - stat(desc_file, &stat_desc) < 0 || - stat(asc_file , &stat_asc ) < 0 ) + /* Plugin and cache file have to exist */ + if ( stat(plug_file, &stat_plug) < 0 || stat(desc_file, &stat_desc) < 0) { return NULL; } /* - * Look if the plugin (.nasl/.oval etc) or the signature (.asc) is newer than, + * Look if the plugin (.nasl/.oval etc) or the signature (.asc) is newer than * the description (.desc). If that's the case also make sure that * the plugin and signatures mtime is not in the future... */ - if( stat_plug.st_mtime > stat_desc.st_mtime - && stat_asc.st_mtime > stat_desc.st_mtime - && stat_plug.st_mtime <= time(NULL) - && stat_asc.st_mtime <= time(NULL) - ){ + if( stat_plug.st_mtime > stat_desc.st_mtime + && stat_asc.st_mtime > stat_desc.st_mtime ) + { return NULL; } - + + /* + * Look if a signature file (.asc) exists. If so and it is newer than + * the description (.desc) (and the mtime is not in the future), return NULL. + */ + if( stat(asc_file, &stat_asc) + && stat_asc.st_mtime > stat_desc.st_mtime + && stat_asc.st_mtime <= time(NULL) ) + { + return NULL; + } + + snprintf(store_dir, sizeof(store_dir), "%s/.desc", dir); if(store_get_plugin_f(&p, pp, store_dir, file) < 0) return NULL; - + + if(p.magic != MAGIC) return NULL; - if(p.id <= 0) return NULL; - + if(p.oid == NULL) return NULL; + + ret = emalloc(sizeof(struct arglist)); plug_set_id(ret, p.id); plug_set_category(ret, p.category); @@ -547,9 +554,9 @@ efree(&str); if(e < 0)return NULL; - str = "dummy_key_id_string"; // will be plug_get_sign_key_ids(plugin); + str = plug_get_sign_key_ids(plugin); e = safe_copy(str, plug.sign_key_ids, sizeof(plug.sign_key_ids), path, "key ids of signatures"); - efree(&str); + //efree(&str); if(e < 0)return NULL; From scm-commit at wald.intevation.org Wed Nov 5 16:00:00 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 5 Nov 2008 16:00:00 +0100 (CET) Subject: [Openvas-commits] r1668 - in trunk/openvas-libnasl: . nasl Message-ID: <20081105150000.1124C40774@pyrosoma.intevation.org> Author: felix Date: 2008-11-05 15:59:58 +0100 (Wed, 05 Nov 2008) New Revision: 1668 Modified: trunk/openvas-libnasl/ChangeLog trunk/openvas-libnasl/nasl/exec.c trunk/openvas-libnasl/nasl/nasl_signature.c trunk/openvas-libnasl/nasl/nasl_signature.h trunk/openvas-libnasl/nasl/preparse.c Log: Further steps to an implementation of Change Request #17 (http://www.openvas.org/openvas-cr-17.html - "OTP: Make NVT signatures available to OpenVAS-Client"). Adds real values to the new field "sign_key_ids" to plugin-structures and the .desc store. * nasl/preparse.c (nasl_load_or_parse): Added comment. * nasl/exec.c (execute_nasl_script): Added comment. * nasl/nasl_signature.c (nasl_verify_signature, init_openvas_gpgme_ctx): extracted init_openvas_gpgme function, glib include added. * nasl/nasl_signature.c (nasl_extract_signature_fprs): Function to retrieve fingerprints from certificates added. * nasl/nasl_signature.h (nasl_extract_signature_fprs, init_openvas_gpgme_ctx): protos added. M openvas-libnasl/ChangeLog M openvas-libnasl/nasl/nasl_signature.c M openvas-libnasl/nasl/preparse.c M openvas-libnasl/nasl/nasl_signature.h M openvas-libnasl/nasl/exec.c Modified: trunk/openvas-libnasl/ChangeLog =================================================================== --- trunk/openvas-libnasl/ChangeLog 2008-11-05 14:58:19 UTC (rev 1667) +++ trunk/openvas-libnasl/ChangeLog 2008-11-05 14:59:58 UTC (rev 1668) @@ -1,3 +1,24 @@ +2008-10-5 Felix Wolfsteller + + Further steps to an implementation of Change Request #17 + (http://www.openvas.org/openvas-cr-17.html - "OTP: Make NVT signatures + available to OpenVAS-Client"). + Adds real values to the new field "sign_key_ids" to plugin-structures + and the .desc store. + + * nasl/preparse.c (nasl_load_or_parse): Added comment. + + * nasl/exec.c (execute_nasl_script): Added comment. + + * nasl/nasl_signature.c (nasl_verify_signature, init_openvas_gpgme_ctx): + extracted init_openvas_gpgme function, glib include added. + + * nasl/nasl_signature.c (nasl_extract_signature_fprs): Function to + retrieve fingerprints from certificates added. + + * nasl/nasl_signature.h (nasl_extract_signature_fprs, + init_openvas_gpgme_ctx): protos added. + 2008-10-22 Michael Wiegand Making new NASL functions available to NVT writers. Modified: trunk/openvas-libnasl/nasl/exec.c =================================================================== --- trunk/openvas-libnasl/nasl/exec.c 2008-11-05 14:58:19 UTC (rev 1667) +++ trunk/openvas-libnasl/nasl/exec.c 2008-11-05 14:59:58 UTC (rev 1668) @@ -1707,6 +1707,12 @@ */ extern tree_cell* nasl_lint(lex_ctxt*, tree_cell*); +/** + * @param script_infos The lpugin as arglist. Has to be allocated, and at least + * "preferences" sould be set. + * @param + * @return Values < 0 + */ int execute_nasl_script(struct arglist * script_infos, const char* name, const char * cache_dir, int mode) { @@ -1742,7 +1748,7 @@ { efree(&old); arg_set_value(script_infos, "script_name", strlen(name), estrdup(name)); - } + } newdir = strrchr(name, '/'); if(newdir != NULL) @@ -1817,7 +1823,7 @@ else if (! (mode & NASL_EXEC_PARSE_ONLY)) { - char *p; + char *p; bzero(&tc, sizeof(tc)); tc.type = CONST_INT; Modified: trunk/openvas-libnasl/nasl/nasl_signature.c =================================================================== --- trunk/openvas-libnasl/nasl/nasl_signature.c 2008-11-05 14:58:19 UTC (rev 1667) +++ trunk/openvas-libnasl/nasl/nasl_signature.c 2008-11-05 14:59:58 UTC (rev 1668) @@ -24,6 +24,7 @@ #include #include #include +#include #include #include "nasl_tree.h" @@ -110,6 +111,53 @@ return estrdup(envdir ? envdir : default_dir); } +/** + * Inits a gpgme context with the custom gpghome directory, protocol version + * etc. Returns the context or NULL if an error occurred. + * @return The gpgme_ctx_t to the context or NULL if an error occurred. + */ +gpgme_ctx_t +init_openvas_gpgme_ctx() +{ + gpgme_error_t err; + gpgme_ctx_t ctx = NULL; + char * gpghome = determine_gpghome(); + + err = gpgme_engine_check_version(GPGME_PROTOCOL_OpenPGP); + if (err) + { + print_gpgme_error("gpgme_engine_check_version", err); + gpgme_release(ctx); + ctx = NULL; + } + + if(!err) + { + err = gpgme_new(&ctx); + if (err) + { + print_gpgme_error("gpgme_new", err); + gpgme_release(ctx); + ctx = NULL; + } + } + + if(!err) + { + nasl_trace(NULL, "init_openvas_gpgme_ctx: setting homedir '%s'\n", gpghome); + err = gpgme_ctx_set_engine_info(ctx, GPGME_PROTOCOL_OpenPGP, NULL, + gpghome); + if (err) + { + print_gpgme_error("gpgme_ctx_set_engine_info", err); + gpgme_release(ctx); + ctx = NULL; + } + } + efree(&gpghome); + return ctx; +} + /* * Checks the detached OpenPGP signature of the file given by FILENAME. * The name of the signature file is derived from FILENAME by appending @@ -127,34 +175,17 @@ int retcode = -1; char * sigfilename = NULL; gpgme_error_t err; - gpgme_ctx_t ctx = NULL; + gpgme_ctx_t ctx = init_openvas_gpgme_ctx(); gpgme_data_t sig = NULL, text = NULL; - char * gpghome = determine_gpghome(); - err = gpgme_engine_check_version(GPGME_PROTOCOL_OpenPGP); - if (err) + if(ctx == NULL) { - print_gpgme_error("gpgme_engine_check_version", err); - goto fail; + goto fail; } - err = gpgme_new(&ctx); - if (err) - { - print_gpgme_error("gpgme_new", err); - goto fail; - } - - nasl_trace(NULL, "nasl_verify_signature: setting homedir '%s'\n", gpghome); - err = gpgme_ctx_set_engine_info(ctx, GPGME_PROTOCOL_OpenPGP, NULL, - gpghome); - if (err) - { - print_gpgme_error("gpgme_ctx_set_engine_info", err); - goto fail; - } - + nasl_trace(NULL, "nasl_verify_signature: loading scriptfile '%s'\n", filename); + err = gpgme_data_new_from_file(&text, filename, 1); if (err) { @@ -199,7 +230,131 @@ gpgme_data_release(text); gpgme_release(ctx); efree(&sigfilename); - efree(&gpghome); return retcode; } + + + +/** + * Extracts fingerprints of signing public keys in a given signature file. + * Works like nasl_verify_signature, but always returns a string with the + * fingerprints in it (NULL if error), even if the keys is not trusted. + * @param filename Path to the signed file (e.g. /../check_killerapp.nasl). + * @return A string with comma- separated fingerprints or NULL if error. + * @see nasl_verify_signature( const char* filename ) + */ +char* +nasl_extract_signature_fprs(char* filename){ + char * sigfilename = NULL; + gpgme_error_t err; + gpgme_ctx_t ctx = init_openvas_gpgme_ctx(); + gpgme_data_t sig = NULL; + gpgme_data_t text = NULL; + gpgme_signature_t signature; + // Only 128 chars will be stored anyway (store_internal.h). If changed, do not + // forget to change the 128-2 further down. + char* key_fprs = emalloc(128*sizeof(char)); + key_fprs[0] = '\0'; + gboolean failed = FALSE; + + if ( ctx == NULL) + { + err = 0; + failed = TRUE; + } + + if(!err) + { + nasl_trace(NULL, "nasl_extract_signature_fprs: loading scriptfile '%s'\n", + filename); + err = gpgme_data_new_from_file(&text, filename, 1); + if (err) + { + print_gpgme_error("gpgme_data_new_from_file", err); + failed = TRUE; + } + } + + if(!err) + { + sigfilename = emalloc(strlen(filename) + 4 + 1); + strcpy(sigfilename, filename); /* Flawfinder: ignore */ + strcat(sigfilename, ".asc"); + + nasl_trace(NULL, "nasl_extract_signature_fprs: loading signature file '%s'\n", + sigfilename); + err = gpgme_data_new_from_file(&sig, sigfilename, 1); + if (err) + { + /* If the file doesn't exist, fail without an error message + * because an unsigned file is a very common and expected + * condition */ + if (gpgme_err_code(err) != GPG_ERR_ENOENT) + print_gpgme_error("gpgme_data_new_from_file", err); + else + nasl_trace(NULL, "nasl_extract_signature_fprs: %s: %s\n", + sigfilename, gpgme_strerror(err)); + failed = TRUE; + } + } + + if(!err) + { + err = gpgme_op_verify(ctx, sig, text, NULL); + nasl_trace(NULL, "nasl_extract_signature_fprs: gpgme_op_verify -> '%d'\n", err); + if (err) + { + print_gpgme_error("gpgme_op_verify", err); + failed = TRUE; + } + } + + if(!err) + { + gpgme_verify_result_t result = gpgme_op_verify_result(ctx); + + signature = result->signatures; + // Concatenate the fingerprints of the signatures in the sig (.asc) file. + while (signature) + { + // Enough mem to store the new fingerprint (old + ',' + new + '\0')? + if(strlen(key_fprs) + strlen(signature->fpr) < 128-2) + { + // If already fingerprint(s) found, separate new one by ','. + if(key_fprs[0] != '\0') + { + strcat(key_fprs,","); /* RATS: ignore */ + strcat(key_fprs, signature->fpr); /* RATS: ignore */ + } + // Else it is the first key found, copy it. + else + { + strcpy(key_fprs, signature->fpr); + } + } + else + { + printf("Too much fingerprints for %s found." + " Clients will see only parts of them.",filename); + nasl_trace(NULL, "nasl_extract_signature_fprs: cropping fingerprints\n"); + } + + signature = signature->next; + } + } + + + gpgme_data_release(sig); + gpgme_data_release(text); + gpgme_release(ctx); + efree(&sigfilename); + + char* return_string = NULL; + + if(failed == FALSE) + return_string = estrdup ( key_fprs); + + efree(&key_fprs); + return return_string; +} Modified: trunk/openvas-libnasl/nasl/nasl_signature.h =================================================================== --- trunk/openvas-libnasl/nasl/nasl_signature.h 2008-11-05 14:58:19 UTC (rev 1667) +++ trunk/openvas-libnasl/nasl/nasl_signature.h 2008-11-05 14:59:58 UTC (rev 1668) @@ -24,7 +24,10 @@ #ifndef NASL_SIGNATURE_H #define NASL_SIGNATURE_H +#include + int nasl_verify_signature(const char* filename); +char* nasl_extract_signature_fprs(const char* filename); +gpgme_ctx_t init_openvas_gpgme_ctx(void); - #endif Modified: trunk/openvas-libnasl/nasl/preparse.c =================================================================== --- trunk/openvas-libnasl/nasl/preparse.c 2008-11-05 14:58:19 UTC (rev 1667) +++ trunk/openvas-libnasl/nasl/preparse.c 2008-11-05 14:59:58 UTC (rev 1668) @@ -625,6 +625,10 @@ #endif /* ENABLE_PLUGIN_SERVER */ +/** + * If ENABLE_PLUGIN_SERVER is not defined, parses a .nasl file. + * @return 0 on success, -1 on error + */ int nasl_load_or_parse(naslctxt* ctx, const char* name1, const char * basename, const char * cache_dir) { From scm-commit at wald.intevation.org Wed Nov 5 16:03:17 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 5 Nov 2008 16:03:17 +0100 (CET) Subject: [Openvas-commits] r1669 - in trunk/openvas-server: . openvasd Message-ID: <20081105150317.26D7540782@pyrosoma.intevation.org> Author: felix Date: 2008-11-05 16:03:16 +0100 (Wed, 05 Nov 2008) New Revision: 1669 Modified: trunk/openvas-server/ChangeLog trunk/openvas-server/openvasd/comm.c trunk/openvas-server/openvasd/nasl_plugins.c trunk/openvas-server/openvasd/otp_1_0.c Log: Work on Change Request #17 (http://www.openvas.org/openvas-cr-17.html - "OTP: Make NVT signatures available to OpenVAS-Client"). Replaced sending of dummy certificate key oids by "real" fingerprints. Sends dummy certificate information. * openvasd/nasl_plugins.c (nasl_plugin_add): Replaced the dummy string for certificate fingerprints by real value from store / certificate file, corrected behaviour for missing signature files. * openvasd/otp_1_0.c: Added gpgme dependency and a dummy strings for the cerrtificate sending. * openvasd/comm.d (send_plug_info): increased size of buffer to send pl. M openvas-server/openvasd/nasl_plugins.c M openvas-server/openvasd/otp_1_0.c M openvas-server/openvasd/comm.c M openvas-server/ChangeLog Modified: trunk/openvas-server/ChangeLog =================================================================== --- trunk/openvas-server/ChangeLog 2008-11-05 14:59:58 UTC (rev 1668) +++ trunk/openvas-server/ChangeLog 2008-11-05 15:03:16 UTC (rev 1669) @@ -1,3 +1,20 @@ +2008-11-5 Felix Wolfsteller + + Work on Change Request #17 (http://www.openvas.org/openvas-cr-17.html - + "OTP: Make NVT signatures available to OpenVAS-Client"). + Replaced sending of dummy certificate key oids by "real" fingerprints. + Sends dummy certificate information. + + * openvasd/nasl_plugins.c (nasl_plugin_add): Replaced the dummy string + for certificate fingerprints by real value from store / certificate + file, corrected behaviour for missing signature files. + + * openvasd/otp_1_0.c: Added gpgme dependency and a dummy strings for + the cerrtificate sending. + + * openvasd/comm.d (send_plug_info): increased size of buffer to send pl. + + 2008-11-04 Michael Wiegand * configure.in: Updated version requirements for -libraries and Modified: trunk/openvas-server/openvasd/comm.c =================================================================== --- trunk/openvas-server/openvasd/comm.c 2008-11-05 14:59:58 UTC (rev 1668) +++ trunk/openvas-server/openvasd/comm.c 2008-11-05 15:03:16 UTC (rev 1669) @@ -166,7 +166,7 @@ } str = emalloc(strlen(a) + strlen(b) + strlen(desc) + strlen(d) + - strlen(plug_get_family(args))+ 1024); + strlen(plug_get_family(args))+ 1024 + 128); sprintf(str, "%s <|> %s <|> %s <|> %s <|> %s <|> %s <|> %s", plug_get_oid(args), a, categories[j], @@ -204,7 +204,6 @@ strcat(str, sign_keys); } - //log_write("Server sends plug like this: %s\n",str); auth_printf(globals, "%s\n", str); efree(&str); } Modified: trunk/openvas-server/openvasd/nasl_plugins.c =================================================================== --- trunk/openvas-server/openvasd/nasl_plugins.c 2008-11-05 14:59:58 UTC (rev 1668) +++ trunk/openvas-server/openvasd/nasl_plugins.c 2008-11-05 15:03:16 UTC (rev 1669) @@ -67,44 +67,58 @@ char * lang = "english"; char cache_dir[PATH_MAX+1]; int nasl_mode; - - nasl_mode = NASL_EXEC_DESCR; - if ( preferences_nasl_no_signature_check(preferences) > 0 ) - nasl_mode |= NASL_ALWAYS_SIGNED; - snprintf(fullname, sizeof(fullname), "%s/%s", folder, name); snprintf(cache_dir, sizeof(fullname), "%s/.bin", folder); + if ( preferences_nasl_no_signature_check(preferences) > 0 ) + { + nasl_mode |= NASL_ALWAYS_SIGNED; + } + + if(arg_get_type(preferences, "language")>=0) lang = arg_get_value(preferences, "language"); - /* FIXME: felix Signature information and checks (no sig file, preferences, - renewed sig file) should be done and extracted here (atm done in - store_load_plugin). */ plugin_args = store_load_plugin(folder, name, preferences); if ( plugin_args == NULL ) { + char* sign_fprs = nasl_extract_signature_fprs( fullname ); + // If server accepts signed plugins only, discard if signature file missing. + if(preferences_nasl_no_signature_check(preferences) == 0 && sign_fprs == NULL) + { + printf("%s: nvt is not signed and thus ignored\n", fullname); + //efree(&sign_fprs); + return NULL; + } + else if(sign_fprs == NULL) + { + printf("%s seems to be not signed at all!\n", fullname); + sign_fprs = ""; + } + + printf("%s is signed by: %s!\n", fullname, sign_fprs); + plugin_args = emalloc(sizeof(struct arglist)); arg_add_value(plugin_args, "preferences", ARG_ARGLIST, -1, (void*)preferences); - + if(execute_nasl_script(plugin_args, fullname, cache_dir, nasl_mode) < 0) { - printf("%s could not be loaded\n", fullname); - arg_set_value(plugin_args, "preferences", -1, NULL); - arg_free_all(plugin_args); - return NULL; + printf("%s could not be loaded\n", fullname); + arg_set_value(plugin_args, "preferences", -1, NULL); + arg_free_all(plugin_args); + return NULL; } plug_set_path(plugin_args, fullname); - plug_set_sign_key_ids( plugin_args, "dummy_key_id_string"); + plug_set_sign_key_ids(plugin_args, sign_fprs); if(plug_get_oid(plugin_args) != NULL) { - store_plugin(plugin_args, name); - plugin_args = store_load_plugin(folder, name, preferences); + store_plugin(plugin_args, name); + plugin_args = store_load_plugin(folder, name, preferences); } } Modified: trunk/openvas-server/openvasd/otp_1_0.c =================================================================== --- trunk/openvas-server/openvasd/otp_1_0.c 2008-11-05 14:59:58 UTC (rev 1668) +++ trunk/openvas-server/openvasd/otp_1_0.c 2008-11-05 15:03:16 UTC (rev 1669) @@ -29,6 +29,7 @@ #include #include "otp_1_0.h" +#include /* Find the enum identifier for the client request which is given * as string. @@ -66,10 +67,42 @@ */ void otp_1_0_server_send_certificates(struct arglist* globals) { - auth_printf(globals, - "SERVER <|> CERTIFICATES\n"); - // while ... certificates -// TODO: felix CR#17 implement certificate sending here - auth_printf(globals, "%s\n","certificates"); + auth_printf(globals, "SERVER <|> CERTIFICATES\n"); + // TODO: felix CR#17 - implement certificate sending here + + // Certificate retrieval + // Send dummystrings, basically + gpgme_error_t err; + gpgme_ctx_t ctx = init_openvas_gpgme_ctx(); + + err = gpgme_op_keylist_ext_start(ctx, NULL, 0, 0); + if (err) + { + log_write("otp_1_0_send_certificates: trouble finding gpgme keys.\n"); + } + + while (!err) + { + gpgme_key_t key; + err = gpgme_op_keylist_next (ctx, &key); + if (err) + break; + log_write ("keyinfo %s, %d, %s fpr: %s sk %s, ot %c\n", key->issuer_name, key->secret, key->uids->name, key->subkeys->fpr, key->subkeys->keyid, key->owner_trust);//, key.name, key.email); + auth_printf(globals, "%s <|> %s <|> %s <|> %d \n", key->subkeys->fpr, + key->uids->name, "untrusted", 0); //+ asci armored key + gpgme_key_release (key); + } + + if (!err) + { + if (gpg_err_code (err) != GPG_ERR_EOF) + { + log_write("otp_1_0_send_certificates: gpgme can not list keys: %s\n", gpgme_strerror (err)); + } + } + + gpgme_release(&ctx); + // certificate retrieval end + auth_printf(globals, "<|> SERVER\n"); -} \ No newline at end of file +} From scm-commit at wald.intevation.org Wed Nov 5 16:04:19 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 5 Nov 2008 16:04:19 +0100 (CET) Subject: [Openvas-commits] r1670 - in trunk/openvas-client: . nessus Message-ID: <20081105150419.49A0540782@pyrosoma.intevation.org> Author: felix Date: 2008-11-05 16:04:18 +0100 (Wed, 05 Nov 2008) New Revision: 1670 Modified: trunk/openvas-client/ChangeLog trunk/openvas-client/nessus/auth.c trunk/openvas-client/nessus/comm.c trunk/openvas-client/nessus/nessus.c Log: Work on Change Request #17 (http://www.openvas.org/openvas-cr-17.html - "OTP: Make NVT signatures available to OpenVAS-Client"). Receives dummy certificate information. * nessus/auth.c: Added comment. * nessus/nessus.c (connect_to_nessus): Attemps fetching certificate information. * nessus/comm.c (comm_get_certificates): Reads in the OTP "certificates" element. M openvas-client/nessus/auth.c M openvas-client/nessus/nessus.c M openvas-client/nessus/comm.c M openvas-client/ChangeLog Modified: trunk/openvas-client/ChangeLog =================================================================== --- trunk/openvas-client/ChangeLog 2008-11-05 15:03:16 UTC (rev 1669) +++ trunk/openvas-client/ChangeLog 2008-11-05 15:04:18 UTC (rev 1670) @@ -1,3 +1,17 @@ +2008-11-05 Felix Wolfsteller + + Work on Change Request #17 (http://www.openvas.org/openvas-cr-17.html - + "OTP: Make NVT signatures available to OpenVAS-Client"). + Receives dummy certificate information. + + * nessus/auth.c: Added comment. + + * nessus/nessus.c (connect_to_nessus): Attemps fetching certificate + information. + + * nessus/comm.c (comm_get_certificates): Reads in the OTP "certificates" + element. + 2008-10-31 Felix Wolfsteller Steps to an implementation of Change Request #17 Modified: trunk/openvas-client/nessus/auth.c =================================================================== --- trunk/openvas-client/nessus/auth.c 2008-11-05 15:03:16 UTC (rev 1669) +++ trunk/openvas-client/nessus/auth.c 2008-11-05 15:04:18 UTC (rev 1670) @@ -164,6 +164,15 @@ } } +/** + * Reads maximal size bytes from the socket soc into s and returns it. + * Stops reading at '\0' and '\n' characters, and appends a + * terminating '\0' to s. + * @param soc The socket. + * @param s Pointer to the string (will not be set to NULL if NULL returned!). + * @param size Number of bytes to maximally read from socket. + * @return The '\0' terminated string s or NULL if an error occured. + */ char * network_gets_raw(soc, s, size) int soc; char * s; Modified: trunk/openvas-client/nessus/comm.c =================================================================== --- trunk/openvas-client/nessus/comm.c 2008-11-05 15:03:16 UTC (rev 1669) +++ trunk/openvas-client/nessus/comm.c 2008-11-05 15:04:18 UTC (rev 1670) @@ -1564,26 +1564,36 @@ int comm_get_certificates(struct context* context) { // TODO: Felix CR#17 (protocol not fully specified yet) - char buffer[1024]; - int response_length = 0; + char buffer[32768]; + int response_length = 25; /* expect: "SERVER <|> CERTIFICATES\n" */ network_printf(context->socket, "CLIENT <|> CERTIFICATES <|> CLIENT\n"); - response_length = 23; /* expect: "SERVER <|> CERTIFICATES\n" */ + + buffer[0] = '\0'; network_gets(context->socket, buffer, response_length); + //printf("BUFFER: %s BUFFEREND\n", buffer); - if( strcmp(buffer, "SERVER <|> CERTIFICATES") == 0) + // if certificate list starts + if( strcmp(buffer, "SERVER <|> CERTIFICATES\n") == 0) { - // continue parsing - if(context->signer_fp_public_keys == NULL) - ;//printf("No fingerprints found\n"); - else - ;//printf("Nice. figerprints found.\n"); - //Add them to the Hashtable - //context->signer_fp_public_keys = g_hash_table_new(g_str_hash, g_str_equal); - //g_hash_table_insert(context->signer_fp_public_keys, "a", "Y"); + gboolean finished = FALSE; + while( finished == FALSE) + { + buffer[0] = '\0'; + // fingerprint(max 48) <|> owner(max 120) <|> trusted|notrust(7) <|> + // key size in bytes to come + network_gets(context->socket, buffer, 48 + 5 + 120 + 5 + 7); + //Parse: + printf("Certificate information received: %s", buffer); + + //Add infos to context, e.g. + //context->signer_fp_public_keys = g_hash_table_new(g_str_hash, g_str_equal); + //g_hash_table_insert(context->signer_fp_public_keys, "a", "Y"); + finished = strcmp(buffer, "<|> SERVER\n"); + } } - else // Response is invalid + // else respond is invalid + else { - // Show error show_error(_("Invalid response from server to certificate request: %s"), buffer); return -1; Modified: trunk/openvas-client/nessus/nessus.c =================================================================== --- trunk/openvas-client/nessus/nessus.c 2008-11-05 15:03:16 UTC (rev 1669) +++ trunk/openvas-client/nessus/nessus.c 2008-11-05 15:04:18 UTC (rev 1670) @@ -606,6 +606,7 @@ comm_get_preferences(context); comm_get_rules(context); comm_get_dependencies(context); + comm_get_certificates(context); if(prefs_get_int(Global, "cache_plugin_information") > 0) { From scm-commit at wald.intevation.org Wed Nov 5 16:24:16 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 5 Nov 2008 16:24:16 +0100 (CET) Subject: [Openvas-commits] r1671 - in trunk/openvas-server: . openvasd Message-ID: <20081105152416.E7D0A4074D@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-05 16:24:16 +0100 (Wed, 05 Nov 2008) New Revision: 1671 Modified: trunk/openvas-server/ChangeLog trunk/openvas-server/openvasd/attack.c Log: * openvasd/attack.c (launch_plugin): Use OIDs instead of IDs when logging information about NVT execution to KB. Modified: trunk/openvas-server/ChangeLog =================================================================== --- trunk/openvas-server/ChangeLog 2008-11-05 15:04:18 UTC (rev 1670) +++ trunk/openvas-server/ChangeLog 2008-11-05 15:24:16 UTC (rev 1671) @@ -1,5 +1,10 @@ -2008-11-5 Felix Wolfsteller +2008-11-05 Michael Wiegand + * openvasd/attack.c (launch_plugin): Use OIDs instead of IDs when + logging information about NVT execution to KB. + +2008-11-05 Felix Wolfsteller + Work on Change Request #17 (http://www.openvas.org/openvas-cr-17.html - "OTP: Make NVT signatures available to OpenVAS-Client"). Replaced sending of dummy certificate key oids by "real" fingerprints. @@ -14,7 +19,6 @@ * openvasd/comm.d (send_plug_info): increased size of buffer to send pl. - 2008-11-04 Michael Wiegand * configure.in: Updated version requirements for -libraries and Modified: trunk/openvas-server/openvasd/attack.c =================================================================== --- trunk/openvas-server/openvasd/attack.c 2008-11-05 15:04:18 UTC (rev 1670) +++ trunk/openvas-server/openvasd/attack.c 2008-11-05 15:24:16 UTC (rev 1671) @@ -208,10 +208,10 @@ if(save_kb(globals)) { - int id = plug_get_id(args); - char asc_id[30]; + char * oid = plug_get_oid(args); + char asc_id[100]; - snprintf(asc_id, sizeof(asc_id), "Launched/%d", id); + snprintf(asc_id, sizeof(asc_id), "Launched/%s", oid); if(kb_item_get_int(kb, asc_id) > 0 && !save_kb_replay_check(globals, category)) { From scm-commit at wald.intevation.org Wed Nov 5 16:59:25 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 5 Nov 2008 16:59:25 +0100 (CET) Subject: [Openvas-commits] r1672 - in trunk/openvas-plugins: . scripts Message-ID: <20081105155925.0E3D540779@pyrosoma.intevation.org> Author: timb Date: 2008-11-05 16:59:22 +0100 (Wed, 05 Nov 2008) New Revision: 1672 Added: trunk/openvas-plugins/scripts/checkpoint-vpn1-pat-information-disclosure.nasl Modified: trunk/openvas-plugins/ChangeLog Log: Added check for Checkpoint VPN-1 PAT information disclosure Modified: trunk/openvas-plugins/ChangeLog =================================================================== --- trunk/openvas-plugins/ChangeLog 2008-11-05 15:24:16 UTC (rev 1671) +++ trunk/openvas-plugins/ChangeLog 2008-11-05 15:59:22 UTC (rev 1672) @@ -1,3 +1,8 @@ +2008-11-05 Tim Brown + + * scripts/checkpoint-vpn1-pat-information-disclosure.nasl: + Added check for Checkpoint VPN-1 PAT information disclosure. + 2008-11-05 Michael Wiegand * plugins/3com_hub/Makefile, plugins/find_service/Makefile, @@ -7,77 +12,87 @@ plugins/ssl_ciphers/Makefile, plugins/synscan/Makefile: Honor LDFLAGS. Remaining part of the patch provided by Hanno Boeck on 2008-09-17. -2008-11-05 Chandrashekhar B +2008-11-05 Chandrashekhar B + * scripts/gb_wordpressmu_mult_xss_vuln.nasl, - scripts/gb_wordpress_dir_trav_vuln.nasl: - Added new plugins + scripts/gb_wordpress_dir_trav_vuln.nasl: + Added new plugins. -2008-11-05 Chandrashekhar B +2008-11-05 Chandrashekhar B + * scripts/secpod_ibm_tsm_client_remote_bof_vuln_900169.nasl, - scripts/secpod_nms_dvd_sdk_actvex_vuln_900132.nasl, - scripts/secpod_ms_iexplorer_uri_spoof_vuln_900170.nasl: - Added new plugins + scripts/secpod_nms_dvd_sdk_actvex_vuln_900132.nasl, + scripts/secpod_ms_iexplorer_uri_spoof_vuln_900170.nasl: + Added new plugins. -2008-11-04 Chandrashekhar B +2008-11-04 Chandrashekhar B * scripts/gb_drupal_mult_vuln_oct08.nasl: - Added new plugin + Added new plugin. 2008-10-31 Thomas Reinke + * deb_1646_2.nasl deb_1649_1.nasl deb_1650_1.nasl deb_1651_1.nasl - deb_1652_1.nasl deb_1653_1.nasl deb_1654_1.nasl deb_1655_1.nasl - deb_1656_1.nasl deb_1657_1.nasl deb_1658_1.nasl deb_1659_1.nasl - deb_1660_1.nasl deb_1661_1.nasl freebsd_cups-base6.nasl - freebsd_drupal57.nasl freebsd_drupal58.nasl freebsd_flyspray1.nasl - freebsd_libspf2.nasl freebsd_libxine10.nasl freebsd_libxml20.nasl - freebsd_linux-flashplugin4.nasl freebsd_openx.nasl - freebsd_opera12.nasl freebsd_opera13.nasl freebsd_wordpress8.nasl - glsa_200810_02.nasl glsa_200810_03.nasl - Added new plugins. + deb_1652_1.nasl deb_1653_1.nasl deb_1654_1.nasl deb_1655_1.nasl + deb_1656_1.nasl deb_1657_1.nasl deb_1658_1.nasl deb_1659_1.nasl + deb_1660_1.nasl deb_1661_1.nasl freebsd_cups-base6.nasl + freebsd_drupal57.nasl freebsd_drupal58.nasl freebsd_flyspray1.nasl + freebsd_libspf2.nasl freebsd_libxine10.nasl freebsd_libxml20.nasl + freebsd_linux-flashplugin4.nasl freebsd_openx.nasl + freebsd_opera12.nasl freebsd_opera13.nasl freebsd_wordpress8.nasl + glsa_200810_02.nasl glsa_200810_03.nasl + Added new plugins. -2008-10-31 Chandrashekhar B +2008-10-31 Chandrashekhar B + * scripts/gb_phpmyadmin_pmd_pdf_xss_vuln.nasl, - scripts/gb_opera_cmd_exec_n_xss_vuln_lin.nasl, - scripts/gb_tugzip_file_bof_vuln.nasl, - scripts/gb_opera_cmd_exec_n_xss_vuln_win.nasl, - scripts/gb_google_chrome_ftp_clnt_xss_vuln.nasl, - scripts/gb_google_chrome_detect_win.nasl: - Added new plugins + scripts/gb_opera_cmd_exec_n_xss_vuln_lin.nasl, + scripts/gb_tugzip_file_bof_vuln.nasl, + scripts/gb_opera_cmd_exec_n_xss_vuln_win.nasl, + scripts/gb_google_chrome_ftp_clnt_xss_vuln.nasl, + scripts/gb_google_chrome_detect_win.nasl: + Added new plugins. -2008-10-31 Chandrashekhar B +2008-10-31 Chandrashekhar B + * scripts/secpod_freesshd_sftp_remote_dos_vuln_900165.nasl, - scripts/secpod_goodtech_ssh_sftp_mul_bof_vuln_900166.nasl, - scripts/secpod_adobe_pagemaker_mult_bof_vuln_900168.nasl: - Added new plugins + scripts/secpod_goodtech_ssh_sftp_mul_bof_vuln_900166.nasl, + scripts/secpod_adobe_pagemaker_mult_bof_vuln_900168.nasl: + Added new plugins. -2008-10-31 Chandrashekhar B +2008-10-31 Chandrashekhar B + * scripts/secpod_ms08-067_900056.nasl: - Added reference to Tim Brown's contribution + Added reference to Tim Brown's contribution. -2008-10-30 Chandrashekhar B +2008-10-30 Chandrashekhar B + * scripts/secpod_ms08-067_900056.nasl: - Exploit code for MS08-067 + Exploit code for MS08-067. -2008-10-30 Chandrashekhar B +2008-10-30 Chandrashekhar B + * scripts/gb_vlc_media_player_ty_bof_vuln_win.nasl, - scripts/gb_phpwebgallery_mult_vuln_oct08.nasl, - scripts/gb_vlc_media_player_ty_bof_vuln_lin.nasl: - Added new CVE's and updated description + scripts/gb_phpwebgallery_mult_vuln_oct08.nasl, + scripts/gb_vlc_media_player_ty_bof_vuln_lin.nasl: + Added new CVE's and updated description. -2008-10-30 Chandrashekhar B +2008-10-30 Chandrashekhar B + * scripts/gb_opera_info_disc_n_code_exec_lin.nasl, - scripts/gb_opera_info_disc_n_code_exec_win.nasl, - scripts/gb_opera_mult_vuln_oct08_lin.nasl, - scripts/gb_opera_mult_vuln_oct08_win.nasl: - Added new plugins + scripts/gb_opera_info_disc_n_code_exec_win.nasl, + scripts/gb_opera_mult_vuln_oct08_lin.nasl, + scripts/gb_opera_mult_vuln_oct08_win.nasl: + Added new plugins. * scripts/secpod_opera_detection_linux_900037.nasl: - Modified the detection logic + Modified the detection logic. -2008-10-29 Chandrashekhar B +2008-10-29 Chandrashekhar B + * scripts/secpod_realvnc_remote_code_exe_vuln_win_900162.nasl, - scripts/secpod_trendmicro_officescan_cgiparsing_bof_vuln_900164.nasl, - scripts/secpod_realvnc_remote_code_exe_vuln_lin_900163.nasl: - Added new plugins + scripts/secpod_trendmicro_officescan_cgiparsing_bof_vuln_900164.nasl, + scripts/secpod_realvnc_remote_code_exe_vuln_lin_900163.nasl: + Added new plugins. 2008-10-28 Jan-Oliver Wagner @@ -331,7 +346,7 @@ scripts/gb_dovecot_mult_sec_bypass_vuln.nasl, scripts/gb_vlc_media_player_mem_crptn_vuln_lin.nasl, scripts/gb_vlc_media_player_mem_crptn_vuln_win.nasl: - Added new plugins + Added new plugins. 2008-10-17 Vlatko Kosturjak @@ -340,7 +355,7 @@ 2008-10-16 Thomas Reinke * Fixed dependencies in subversion related scripts - (rely directly on find_service2.nasl) + (rely directly on find_service2.nasl). 2008-10-16 Chandrashekhar B @@ -350,10 +365,10 @@ scripts/gb_apache_tomcat_sec_bypass_vuln.nasl, scripts/gb_adobe_flash_player_sec_bypass_vuln_win.nasl, scripts/gb_sun_java_web_porxy_svr_vuln_win.nasl: - Added new plugins + Added new plugins. * scripts/version_func.inc: - Added a function to check for range of versions + Added a function to check for range of versions. 2008-10-15 Chandrashekhar B @@ -368,35 +383,35 @@ scripts/secpod_ms08-061_900051.nasl, scripts/secpod_ms08-058_900054.nasl, scripts/secpod_ms08-063_900053.nasl: - Added new plugins for MS bulletins - Oct 08 + Added new plugins for MS bulletins - Oct 08. * scripts/secpod_smb_func.inc: - Updated with new file version function + Updated with new file version function. * scripts/secpod_office_products_version_900032.nasl: - Set version info in the KB item for all Office products + Set version info in the KB item for all Office products. 2008-10-15 Chandrashekhar B * scripts/secpod_rhinosoft_serv-u_dir_trav_and_dos_vuln_900149.nasl: - Description cannot have double quote string, changed to signle quote + Description cannot have double quote string, changed to single quote. 2008-10-14 Chandrashekhar B * scripts/secpod_hp_smh_unspecified_xss_vuln_900150.nasl, scripts/secpod_rhinosoft_serv-u_dir_trav_and_dos_vuln_900149.nasl: - Added new plugins + Added new plugins. 2008-10-14 Chandrashekhar B * scripts/pkg-lib-rpm.inc: - Fixed an issue with regex to grep the RPM revision + Fixed an issue with regex to grep the RPM revision. 2008-10-14 Chandrashekhar B * scripts/gb_cups_mult_vuln_oct08.nasl, scripts/gb_ms08-040.nasl: - Added new plugins + Added new plugins. 2008-10-13 Carsten Koch-Mauthe @@ -409,7 +424,7 @@ scripts/gb_firefox_detect_lin.nasl, scripts/gb_thunderbird_detect_lin.nasl, scripts/gb_seamonkey_detect_lin.nasl: - Updated as per the modified version_func.inc + Updated as per the modified version_func.inc. 2008-10-12 Carsten Koch-Mauthe Added: trunk/openvas-plugins/scripts/checkpoint-vpn1-pat-information-disclosure.nasl =================================================================== --- trunk/openvas-plugins/scripts/checkpoint-vpn1-pat-information-disclosure.nasl 2008-11-05 15:24:16 UTC (rev 1671) +++ trunk/openvas-plugins/scripts/checkpoint-vpn1-pat-information-disclosure.nasl 2008-11-05 15:59:22 UTC (rev 1672) @@ -0,0 +1,102 @@ +# OpenVAS Vulnerability Test +# $Id$ +# Description: Checkpoint VPN-1 PAT information disclosure +# +# Authors: +# Tim Brown +# +# Copyright: +# Copyright (c) 2008 Tim Brown and Portcullis Computer Security Ltd +# Text descriptions are largerly excerpted from the referenced +# advisory, and are Copyright (c) the respective author(s) +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# + +if (description) +{ + script_id(80096); + name["english"] = "Checkpoint VPN-1 PAT information disclosure"; + script_name(english:name["english"]); + desc["english"] = "Checkpoint VPN-1 PAT information disclosure + +By sending crafted packets to ports on the firewall which are mapped by port address translation (PAT) to ports on internal devices, information about the internal network may be disclosed in the resulting ICMP error packets. Port 18264/tcp on the firewall is typically configured in such a manner, with packets to this port being rewritten to reach the firewall management server. For example, the firewall fails to correctly sanitise the encapsulated IP headers in ICMP time-to-live exceeded packets resulting in internal IP addresses being disclosed. + +On the following platforms, we recommend you mitigate in the described manner: +Checkpoint VPN-1 R55 +Checkpoint VPN-1 R65 + +We recommend you mitigate in the following manner: +Disable any implied rules and only open ports for required services +Filter outbound ICMP time-to-live exceeded packets + +Solution: +We are not aware of a vendor approved solution at the current time. + +See also: +http://www.portcullis-security.com/293.php + +Risk factor: Low"; + script_description(english:desc["english"]); + summary["english"] = "Determines whether Checkpoint VPN-1 is disclosing information about the internal network via PAT"; + script_summary(english:summary["english"]); + script_category(ACT_GATHER_INFO); + family["english"] = "Firewalls"; + script_family(english:family["english"]); + copyright = "(c) Tim Brown and Portcullis Computer Security Ltd, 2008"; + script_copyright(english:copyright); + script_require_ports(264); + exit(0); +} + +function packet_construct(_ip_src, _ip_ttl) +{ + _ip_id = rand() % 65535; + _th_sport = (rand() % 64000) + 1024; + _ip = forge_ip_packet(ip_v:4, ip_hl:5, ip_tos:0, ip_id:_ip_id, ip_len:20, ip_off:0, ip_p:IPPROTO_TCP, ip_src:_ip_src, ip_ttl:_ip_ttl); + _tcp = forge_tcp_packet(ip:_ip, th_sport:_th_sport, th_dport:18264, th_flags:TH_SYN, th_seq:_ip_ttl, th_ack:0, th_x2:0, th_off:5, th_win:2048, th_urp:0); + return _tcp; +} + +function packet_parse(_icmp, _ip_dst) +{ + _ip = get_icmp_element(icmp:_icmp, element:"data"); + _ip_p = get_ip_element(ip:_ip, element:"ip_p"); + _ip_dst2 = get_ip_element(ip:_ip, element:"ip_dst"); + _ip_hl = get_ip_element(ip:_ip, element:"ip_hl"); + _tcp = substr(_ip, (_ip_hl * 4), strlen(_ip)); + _ih_dport = (ord(_tcp[2]) * 256) + ord(_tcp[3]); + if ((_ip_p == IPPROTO_TCP) && (_ip_dst2 != _ip_dst) && (_ih_dport == 18264)) + { + _data = "Internal IP disclosed: " + _ip_dst2; + security_note(protocol:"tcp", port:18264, data:_data); + } +} + +if (islocalhost()) +{ + exit(0); +} +sourceipaddress = this_host(); +destinationipaddress = get_host_ip(); +packetfilter = "dst host " + sourceipaddress + " and icmp"; +for (ttl = 1; ttl <= 50; ttl ++) +{ + requestpacket = packet_construct(_ip_src:sourceipaddress, _ip_ttl:ttl); + responsepacket = send_packet(requestpacket, pcap_active:true, pcap_filter:packetfilter, pcap_timeout:1); + if (responsepacket) + { + packet_parse(_icmp:responsepacket, _ip_dst:destinationipaddress); + } +} From scm-commit at wald.intevation.org Thu Nov 6 10:12:01 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Thu, 6 Nov 2008 10:12:01 +0100 (CET) Subject: [Openvas-commits] r1673 - in trunk/openvas-server: . openvasd Message-ID: <20081106091201.DA55440732@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-06 10:12:01 +0100 (Thu, 06 Nov 2008) New Revision: 1673 Modified: trunk/openvas-server/ChangeLog trunk/openvas-server/openvasd/oval_plugins.c Log: * openvasd/oval_plugins.c (ovaldi_launch): Added G_SPAWN_SEARCH_PATH flag to g_spawn_sync call. Modified: trunk/openvas-server/ChangeLog =================================================================== --- trunk/openvas-server/ChangeLog 2008-11-05 15:59:22 UTC (rev 1672) +++ trunk/openvas-server/ChangeLog 2008-11-06 09:12:01 UTC (rev 1673) @@ -1,3 +1,8 @@ +2008-11-06 Michael Wiegand + + * openvasd/oval_plugins.c (ovaldi_launch): Added G_SPAWN_SEARCH_PATH + flag to g_spawn_sync call. + 2008-11-05 Michael Wiegand * openvasd/attack.c (launch_plugin): Use OIDs instead of IDs when Modified: trunk/openvas-server/openvasd/oval_plugins.c =================================================================== --- trunk/openvas-server/openvasd/oval_plugins.c 2008-11-05 15:59:22 UTC (rev 1672) +++ trunk/openvas-server/openvasd/oval_plugins.c 2008-11-06 09:12:01 UTC (rev 1673) @@ -421,7 +421,7 @@ argv[8] = NULL; // log_write("Launching ovaldi with: %s\n", g_strjoinv(" ", argv)); - if(g_spawn_sync(NULL, argv, NULL, 0, child_setup, NULL, NULL, NULL, NULL, NULL)) + if(g_spawn_sync(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, child_setup, NULL, NULL, NULL, NULL, NULL)) { GMarkupParser parser; GMarkupParseContext *context = NULL; From scm-commit at wald.intevation.org Thu Nov 6 13:02:26 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Thu, 6 Nov 2008 13:02:26 +0100 (CET) Subject: [Openvas-commits] r1674 - in trunk/openvas-server: . openvasd Message-ID: <20081106120226.B843E40740@pyrosoma.intevation.org> Author: felix Date: 2008-11-06 13:02:26 +0100 (Thu, 06 Nov 2008) New Revision: 1674 Modified: trunk/openvas-server/ChangeLog trunk/openvas-server/openvasd/otp_1_0.c Log: *openvasd/otp_1_0.c (otp_1_0_server_send_certificates): Fixed bug (wrong type released) that caused definite server crash. M ChangeLog M openvasd/otp_1_0.c Modified: trunk/openvas-server/ChangeLog =================================================================== --- trunk/openvas-server/ChangeLog 2008-11-06 09:12:01 UTC (rev 1673) +++ trunk/openvas-server/ChangeLog 2008-11-06 12:02:26 UTC (rev 1674) @@ -1,3 +1,9 @@ +2008-11-6 Felix Wolfsteller + + * openvasd/otp_1_0.c (otp_1_0_server_send_certificates): Fixed bug + (wrong type released) that caused definite server crash. + + 2008-11-06 Michael Wiegand * openvasd/oval_plugins.c (ovaldi_launch): Added G_SPAWN_SEARCH_PATH Modified: trunk/openvas-server/openvasd/otp_1_0.c =================================================================== --- trunk/openvas-server/openvasd/otp_1_0.c 2008-11-06 09:12:01 UTC (rev 1673) +++ trunk/openvas-server/openvasd/otp_1_0.c 2008-11-06 12:02:26 UTC (rev 1674) @@ -101,7 +101,7 @@ } } - gpgme_release(&ctx); + gpgme_release(ctx); // certificate retrieval end auth_printf(globals, "<|> SERVER\n"); From scm-commit at wald.intevation.org Thu Nov 6 14:45:45 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Thu, 6 Nov 2008 14:45:45 +0100 (CET) Subject: [Openvas-commits] r1675 - trunk/openvas-libraries Message-ID: <20081106134545.715F84074D@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-06 14:45:45 +0100 (Thu, 06 Nov 2008) New Revision: 1675 Modified: trunk/openvas-libraries/ChangeLog trunk/openvas-libraries/INSTALL_README Log: * INSTALL_README: Updated note regarding gnutls version requirements as pointed out by Toan Nguyen. Modified: trunk/openvas-libraries/ChangeLog =================================================================== --- trunk/openvas-libraries/ChangeLog 2008-11-06 12:02:26 UTC (rev 1674) +++ trunk/openvas-libraries/ChangeLog 2008-11-06 13:45:45 UTC (rev 1675) @@ -1,4 +1,9 @@ -2008-11-5 Felix Wolfsteller +2008-11-06 Michael Wiegand + + * INSTALL_README: Updated note regarding gnutls version requirements as + pointed out by Toan Nguyen. + +2008-11-05 Felix Wolfsteller Work on Change Request #17 (http://www.openvas.org/openvas-cr-17.html - "OTP: Make NVT signatures available to OpenVAS-Client"). Modified: trunk/openvas-libraries/INSTALL_README =================================================================== --- trunk/openvas-libraries/INSTALL_README 2008-11-06 12:02:26 UTC (rev 1674) +++ trunk/openvas-libraries/INSTALL_README 2008-11-06 13:45:45 UTC (rev 1675) @@ -18,7 +18,7 @@ to avoid conflicts. You should also make sure that you have the development packages for: - * libgnutls + * libgnutls 2.x * libpcap * libgpgme From scm-commit at wald.intevation.org Thu Nov 6 14:55:19 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Thu, 6 Nov 2008 14:55:19 +0100 (CET) Subject: [Openvas-commits] r1676 - branches/openvas-libraries-1-0 Message-ID: <20081106135519.9888B40767@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-06 14:55:19 +0100 (Thu, 06 Nov 2008) New Revision: 1676 Modified: branches/openvas-libraries-1-0/ChangeLog branches/openvas-libraries-1-0/INSTALL_README Log: * INSTALL_README: Updated note regarding gnutls version requirements as pointed out by Toan Nguyen (Backported from -trunk). Removed note regarding libgpgme requirement since openvas-libraries doesn't actually require it. Modified: branches/openvas-libraries-1-0/ChangeLog =================================================================== --- branches/openvas-libraries-1-0/ChangeLog 2008-11-06 13:45:45 UTC (rev 1675) +++ branches/openvas-libraries-1-0/ChangeLog 2008-11-06 13:55:19 UTC (rev 1676) @@ -1,3 +1,10 @@ +2008-11-06 Michael Wiegand + + * INSTALL_README: Updated note regarding gnutls version requirements as + pointed out by Toan Nguyen (Backported from -trunk). Removed note + regarding libgpgme requirement since openvas-libraries doesn't actually + require it. + 2008-10-09 Michael Wiegand * libopenvas/pcap.c: Added missing include for config.h; this fixes a Modified: branches/openvas-libraries-1-0/INSTALL_README =================================================================== --- branches/openvas-libraries-1-0/INSTALL_README 2008-11-06 13:45:45 UTC (rev 1675) +++ branches/openvas-libraries-1-0/INSTALL_README 2008-11-06 13:55:19 UTC (rev 1676) @@ -18,9 +18,8 @@ to avoid conflicts. You should also make sure that you have the development packages for: - * libgnutls + * libgnutls 2.x * libpcap - * libgpgme The basic way to install nessus-libraries is to do : From scm-commit at wald.intevation.org Thu Nov 6 15:49:48 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Thu, 6 Nov 2008 15:49:48 +0100 (CET) Subject: [Openvas-commits] r1677 - in trunk/openvas-plugins: . scripts Message-ID: <20081106144948.496C440740@pyrosoma.intevation.org> Author: kost Date: 2008-11-06 15:49:47 +0100 (Thu, 06 Nov 2008) New Revision: 1677 Modified: trunk/openvas-plugins/ChangeLog trunk/openvas-plugins/scripts/webserver_favicon.nasl Log: added MD5 fingerprints of popular software Modified: trunk/openvas-plugins/ChangeLog =================================================================== --- trunk/openvas-plugins/ChangeLog 2008-11-06 13:55:19 UTC (rev 1676) +++ trunk/openvas-plugins/ChangeLog 2008-11-06 14:49:47 UTC (rev 1677) @@ -1,3 +1,8 @@ +2008-11-06 Vlatko Kosturjak + + * scripts/webserver_favicon.nasl: added MD5 fingerprints of popular + software + 2008-11-05 Tim Brown * scripts/checkpoint-vpn1-pat-information-disclosure.nasl: Modified: trunk/openvas-plugins/scripts/webserver_favicon.nasl =================================================================== --- trunk/openvas-plugins/scripts/webserver_favicon.nasl 2008-11-06 13:55:19 UTC (rev 1676) +++ trunk/openvas-plugins/scripts/webserver_favicon.nasl 2008-11-06 14:49:47 UTC (rev 1677) @@ -89,6 +89,12 @@ # NetScreen server["f1876a80546b3986dbb79bad727b0374"] = "NetScreen WebUI"; +# Various popular CMS, Wikis, ... +server["d41d8cd98f00b204e9800998ecf8427e"] = "Drupal CMS"; +server["389a8816c5b87685de7d8d5fec96c85b"] = "XOOPS CMS"; +server["506190fc55ceaa132f1bc305ed8472ca"] = "SocialText"; +server["2cc15cfae55e2bb2d85b57e5b5bc3371"] = "PHPWiki"; + # Check the hash against what we know about. if (server[md5]) { if (report_verbosity > 0) { From scm-commit at wald.intevation.org Fri Nov 7 10:34:53 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Fri, 7 Nov 2008 10:34:53 +0100 (CET) Subject: [Openvas-commits] r1678 - in trunk/openvas-server: . openvasd Message-ID: <20081107093453.E541F40773@pyrosoma.intevation.org> Author: felix Date: 2008-11-07 10:34:52 +0100 (Fri, 07 Nov 2008) New Revision: 1678 Modified: trunk/openvas-server/ChangeLog trunk/openvas-server/openvasd/nasl_plugins.c trunk/openvas-server/openvasd/otp_1_0.c trunk/openvas-server/openvasd/oval_plugins.c Log: * openvasd/nasl_plugins: Removed printfs. * openvasd/otp_1_0.c (otp_1_0_server_send_certificates): Extended dummy string, slightly better error msg. * oopenvasd/oval_plugins.c (oval_plugin_add): Check certificates, add fingerprint string. * oopenvasd/oval_plugins.c (oval_plugin_launch): TODO added to avoid execution of unsigned plugins, if server preference is set. M openvas-server/openvasd/nasl_plugins.c M openvas-server/openvasd/otp_1_0.c M openvas-server/openvasd/oval_plugins.c M openvas-server/ChangeLog Modified: trunk/openvas-server/ChangeLog =================================================================== --- trunk/openvas-server/ChangeLog 2008-11-06 14:49:47 UTC (rev 1677) +++ trunk/openvas-server/ChangeLog 2008-11-07 09:34:52 UTC (rev 1678) @@ -1,4 +1,18 @@ -2008-11-6 Felix Wolfsteller +2008-11-07 Felix Wolfsteller + + * openvasd/nasl_plugins: Removed printfs. + + * openvasd/otp_1_0.c (otp_1_0_server_send_certificates): Extended dummy + string, slightly better error msg. + + * oopenvasd/oval_plugins.c (oval_plugin_add): Check certificates, add + fingerprint string. + + * oopenvasd/oval_plugins.c (oval_plugin_launch): TODO added to avoid + execution of unsigned plugins, if server preference is set. + + +2008-11-06 Felix Wolfsteller * openvasd/otp_1_0.c (otp_1_0_server_send_certificates): Fixed bug (wrong type released) that caused definite server crash. Modified: trunk/openvas-server/openvasd/nasl_plugins.c =================================================================== --- trunk/openvas-server/openvasd/nasl_plugins.c 2008-11-06 14:49:47 UTC (rev 1677) +++ trunk/openvas-server/openvasd/nasl_plugins.c 2008-11-07 09:34:52 UTC (rev 1678) @@ -89,16 +89,13 @@ if(preferences_nasl_no_signature_check(preferences) == 0 && sign_fprs == NULL) { printf("%s: nvt is not signed and thus ignored\n", fullname); - //efree(&sign_fprs); return NULL; } else if(sign_fprs == NULL) { - printf("%s seems to be not signed at all!\n", fullname); sign_fprs = ""; } - printf("%s is signed by: %s!\n", fullname, sign_fprs); plugin_args = emalloc(sizeof(struct arglist)); arg_add_value(plugin_args, "preferences", ARG_ARGLIST, -1, (void*)preferences); Modified: trunk/openvas-server/openvasd/otp_1_0.c =================================================================== --- trunk/openvas-server/openvasd/otp_1_0.c 2008-11-06 14:49:47 UTC (rev 1677) +++ trunk/openvas-server/openvasd/otp_1_0.c 2008-11-07 09:34:52 UTC (rev 1678) @@ -69,7 +69,7 @@ { auth_printf(globals, "SERVER <|> CERTIFICATES\n"); // TODO: felix CR#17 - implement certificate sending here - + // Need a -D_FILE_OFFSET_BITS=64 in order to read key files // Certificate retrieval // Send dummystrings, basically gpgme_error_t err; @@ -78,7 +78,7 @@ err = gpgme_op_keylist_ext_start(ctx, NULL, 0, 0); if (err) { - log_write("otp_1_0_send_certificates: trouble finding gpgme keys.\n"); + log_write("otp_1_0_send_certificates: gpgme key listing error: %s.\n", strerror(err)); } while (!err) @@ -87,9 +87,11 @@ err = gpgme_op_keylist_next (ctx, &key); if (err) break; - log_write ("keyinfo %s, %d, %s fpr: %s sk %s, ot %c\n", key->issuer_name, key->secret, key->uids->name, key->subkeys->fpr, key->subkeys->keyid, key->owner_trust);//, key.name, key.email); - auth_printf(globals, "%s <|> %s <|> %s <|> %d \n", key->subkeys->fpr, - key->uids->name, "untrusted", 0); //+ asci armored key + auth_printf(globals, "%s <|> %s <|> %s <|> %d <|> %s\n", + key->subkeys->fpr, + key->uids->name, "untrusted", + 8, // key size + "dummykey"); gpgme_key_release (key); } @@ -100,9 +102,8 @@ log_write("otp_1_0_send_certificates: gpgme can not list keys: %s\n", gpgme_strerror (err)); } } - + gpgme_release(ctx); - // certificate retrieval end - + // Certificate retrieval end auth_printf(globals, "<|> SERVER\n"); } Modified: trunk/openvas-server/openvasd/oval_plugins.c =================================================================== --- trunk/openvas-server/openvasd/oval_plugins.c 2008-11-06 14:49:47 UTC (rev 1677) +++ trunk/openvas-server/openvasd/oval_plugins.c 2008-11-07 09:34:52 UTC (rev 1678) @@ -163,10 +163,30 @@ guint length = 0; snprintf(fullname, sizeof(fullname), "%s/%s", folder, name); + + if ( preferences_nasl_no_signature_check(preferences) == 0 + && nasl_verify_signature( fullname) != 0) + { + log_write("%s: signature of nvt could not been verified/ is missing."); + return NULL; + } + args = store_load_plugin(folder, name, preferences); if(args == NULL) { + char* sign_fprs = nasl_extract_signature_fprs( fullname ); + // If server accepts signed plugins only, discard if signature file missing. + if(preferences_nasl_no_signature_check(preferences) == 0 && sign_fprs == NULL) + { + printf("%s: nvt is not signed and thus ignored\n", fullname); + return NULL; + } + else if(sign_fprs == NULL) + { + sign_fprs = ""; + } + // Parse plugin properties into arglist parser.start_element = start_element; parser.end_element = end_element; @@ -195,10 +215,10 @@ plug_set_category(args, ACT_END); plug_set_family(args, "OVAL definitions", NULL); + plug_set_sign_key_ids(args, sign_fprs); + store_plugin(args, name); args = store_load_plugin(folder, name, preferences); - - // FIXME: felix get the signers key ids here (analog to nasl_plugins) } if(args != NULL) @@ -229,6 +249,12 @@ arg_set_value(plugin, "preferences", -1, preferences); arg_add_value(plugin, "key", ARG_PTR, -1, kb); + // TODO felix get preferences from global context and check the signature. + // Otherwise a client can start unsigned oval plugins even if the server + // preference is set to "no"! + // if( nasl_verify_signature( arg_get_value(g_args, "name")) ) + // post_log( g_args, 0, "Attempt to start signed oval plugin."); + module = create_process((process_func_t)oval_thread, plugin); return module; } From scm-commit at wald.intevation.org Fri Nov 7 10:35:38 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Fri, 7 Nov 2008 10:35:38 +0100 (CET) Subject: [Openvas-commits] r1679 - in trunk/openvas-client: . nessus Message-ID: <20081107093538.C17B540773@pyrosoma.intevation.org> Author: felix Date: 2008-11-07 10:35:37 +0100 (Fri, 07 Nov 2008) New Revision: 1679 Modified: trunk/openvas-client/ChangeLog trunk/openvas-client/nessus/comm.c Log: * nessus/comm.c (comm_parse_certificate): (New) method stub. * nessus/comm.c (comm_get_certificates): Fixed and eased loop. M openvas-client/nessus/comm.c M openvas-client/ChangeLog Modified: trunk/openvas-client/ChangeLog =================================================================== --- trunk/openvas-client/ChangeLog 2008-11-07 09:34:52 UTC (rev 1678) +++ trunk/openvas-client/ChangeLog 2008-11-07 09:35:37 UTC (rev 1679) @@ -1,3 +1,9 @@ +2008-11-07 Felix Wolfsteller + + * nessus/comm.c (comm_parse_certificate): (New) method stub. + + * nessus/comm.c (comm_get_certificates): Fixed and eased loop. + 2008-11-05 Felix Wolfsteller Work on Change Request #17 (http://www.openvas.org/openvas-cr-17.html - Modified: trunk/openvas-client/nessus/comm.c =================================================================== --- trunk/openvas-client/nessus/comm.c 2008-11-07 09:34:52 UTC (rev 1678) +++ trunk/openvas-client/nessus/comm.c 2008-11-07 09:35:37 UTC (rev 1679) @@ -1558,38 +1558,54 @@ return 0; } -/* Request certificates used for NVTs signatures. + +/** + * Will parse a certificate string sent by the server and adds the respective + * fields to HashTables of the context. + * @param buffer The OTP "certificate" element sent by the server. + * @param context The local context to add the certificate information to. + * @return Always 0, as its a stub. + */ +int comm_parse_certificate(char* buffer, struct context* context) +{ + //Parse. + //Add infos to context, e.g. + //context->signer_fp_public_keys = g_hash_table_new(g_str_hash, g_str_equal); + //g_hash_table_insert(context->signer_fp_public_keys, "a", "Y"); + return 0; +} + + +/** + * Request certificates used for NVTs signatures. * Returns 0 on success, != 0 on error. */ int comm_get_certificates(struct context* context) { // TODO: Felix CR#17 (protocol not fully specified yet) char buffer[32768]; - int response_length = 25; /* expect: "SERVER <|> CERTIFICATES\n" */ + int response_length = 25; /* expected response: "SERVER <|> CERTIFICATES\n" */ network_printf(context->socket, "CLIENT <|> CERTIFICATES <|> CLIENT\n"); buffer[0] = '\0'; network_gets(context->socket, buffer, response_length); - //printf("BUFFER: %s BUFFEREND\n", buffer); - - // if certificate list starts + + // If certificate list starts if( strcmp(buffer, "SERVER <|> CERTIFICATES\n") == 0) { - gboolean finished = FALSE; - while( finished == FALSE) - { - buffer[0] = '\0'; - // fingerprint(max 48) <|> owner(max 120) <|> trusted|notrust(7) <|> - // key size in bytes to come - network_gets(context->socket, buffer, 48 + 5 + 120 + 5 + 7); - //Parse: - printf("Certificate information received: %s", buffer); - - //Add infos to context, e.g. - //context->signer_fp_public_keys = g_hash_table_new(g_str_hash, g_str_equal); - //g_hash_table_insert(context->signer_fp_public_keys, "a", "Y"); - finished = strcmp(buffer, "<|> SERVER\n"); - } + buffer[0] = '\0'; + // fingerprint(max 48) <|> owner(max 120) <|> trusted|notrust(7) <|> + // key size in bytes to come <|> key itself (ascii- armored) + network_gets(context->socket, buffer, 48 + 5 + 120 + 5 + 7); + + while ( strcmp(buffer, "<|> SERVER\n") != 0) + { + //printf("Certificate information received: -%s-", buffer); + buffer[0] = '\0'; + network_gets(context->socket, buffer, 48 + 5 + 120 + 5 + 7); + //Parse: + // if comm_parse_certificate(buffer) != 0 + } } // else respond is invalid else From scm-commit at wald.intevation.org Fri Nov 7 13:59:22 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Fri, 7 Nov 2008 13:59:22 +0100 (CET) Subject: [Openvas-commits] r1680 - trunk/openvas-plugins Message-ID: <20081107125922.26D1F4076B@pyrosoma.intevation.org> Author: jan Date: 2008-11-07 13:59:21 +0100 (Fri, 07 Nov 2008) New Revision: 1680 Modified: trunk/openvas-plugins/ChangeLog trunk/openvas-plugins/openvas-nvt-sync.in Log: * openvas-nvt-sync.in: Added as comment an alternative syntax of URL for FEED. Thanks to Toan Nguyen for pointing out. Modified: trunk/openvas-plugins/ChangeLog =================================================================== --- trunk/openvas-plugins/ChangeLog 2008-11-07 09:35:37 UTC (rev 1679) +++ trunk/openvas-plugins/ChangeLog 2008-11-07 12:59:21 UTC (rev 1680) @@ -1,3 +1,8 @@ +2008-11-07 Jan-Oliver Wagner + + * openvas-nvt-sync.in: Added as comment an alternative syntax + of URL for FEED. Thanks to Toan Nguyen for pointing out. + 2008-11-06 Vlatko Kosturjak * scripts/webserver_favicon.nasl: added MD5 fingerprints of popular Modified: trunk/openvas-plugins/openvas-nvt-sync.in =================================================================== --- trunk/openvas-plugins/openvas-nvt-sync.in 2008-11-07 09:35:37 UTC (rev 1679) +++ trunk/openvas-plugins/openvas-nvt-sync.in 2008-11-07 12:59:21 UTC (rev 1680) @@ -39,6 +39,8 @@ # The URL of the plugin feed FEED=rsync://rsync.openvas.org:/nvt-feed +# An alternative syntax which might work if the above doesn't: +#FEED=rsync at rsync.openvas.org::nvt-feed findcmd() { From scm-commit at wald.intevation.org Fri Nov 7 15:22:20 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Fri, 7 Nov 2008 15:22:20 +0100 (CET) Subject: [Openvas-commits] r1681 - in trunk/openvas-libraries: . libopenvas Message-ID: <20081107142220.893D640769@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-07 15:22:19 +0100 (Fri, 07 Nov 2008) New Revision: 1681 Modified: trunk/openvas-libraries/ChangeLog trunk/openvas-libraries/libopenvas/network.c trunk/openvas-libraries/libopenvas/network.h Log: * libopenvas/network.c, libopenvas/network.h: Added ovas_get_connection_data function provided by Matthew Mundell as support for the upcoming OpenVAS Management functionality. Modified: trunk/openvas-libraries/ChangeLog =================================================================== --- trunk/openvas-libraries/ChangeLog 2008-11-07 12:59:21 UTC (rev 1680) +++ trunk/openvas-libraries/ChangeLog 2008-11-07 14:22:19 UTC (rev 1681) @@ -1,3 +1,9 @@ +2008-11-07 Michael Wiegand + + * libopenvas/network.c, libopenvas/network.h: Added + ovas_get_connection_data function provided by Matthew Mundell as + support for the upcoming OpenVAS Management functionality. + 2008-11-06 Michael Wiegand * INSTALL_README: Updated note regarding gnutls version requirements as Modified: trunk/openvas-libraries/libopenvas/network.c =================================================================== --- trunk/openvas-libraries/libopenvas/network.c 2008-11-07 12:59:21 UTC (rev 1680) +++ trunk/openvas-libraries/libopenvas/network.c 2008-11-07 14:22:19 UTC (rev 1681) @@ -423,6 +423,15 @@ return fp->fd; } +void* +ovas_get_connection_data(fd) + int fd; +{ + if (NESSUS_STREAM(fd)) + return (void*) &(connections[fd - NESSUS_FD_OFF]); + return NULL; +} + static int set_gnutls_priorities(gnutls_session_t session, int * protocol_priority, Modified: trunk/openvas-libraries/libopenvas/network.h =================================================================== --- trunk/openvas-libraries/libopenvas/network.h 2008-11-07 12:59:21 UTC (rev 1680) +++ trunk/openvas-libraries/libopenvas/network.h 2008-11-07 14:22:19 UTC (rev 1681) @@ -87,6 +87,7 @@ int nessus_register_connection(int, void*); int nessus_deregister_connection(int); int nessus_get_socket_from_connection(int); +void* ovas_get_connection_data(int); int stream_zero(fd_set*); int stream_set(int, fd_set*); From scm-commit at wald.intevation.org Fri Nov 7 17:02:21 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Fri, 7 Nov 2008 17:02:21 +0100 (CET) Subject: [Openvas-commits] r1682 - in branches/openvas-plugins-solaris-local-security-checks: . extra Message-ID: <20081107160221.7F2254076E@pyrosoma.intevation.org> Author: timb Date: 2008-11-07 17:02:15 +0100 (Fri, 07 Nov 2008) New Revision: 1682 Added: branches/openvas-plugins-solaris-local-security-checks/extra/generate-solaris-plugins.pl Modified: branches/openvas-plugins-solaris-local-security-checks/ChangeLog Log: Code to actually generate scripts/solaris_* Modified: branches/openvas-plugins-solaris-local-security-checks/ChangeLog =================================================================== --- branches/openvas-plugins-solaris-local-security-checks/ChangeLog 2008-11-07 14:22:19 UTC (rev 1681) +++ branches/openvas-plugins-solaris-local-security-checks/ChangeLog 2008-11-07 16:02:15 UTC (rev 1682) @@ -1,3 +1,7 @@ +2008-11-07 Tim Brown + + * extra/generate-solaris-plugins.pl: Code to actually generate scripts/solaris_*. + 2008-10-31 Tim Brown * scripts/solaris_10_sparc_118833.nasl, @@ -4621,4 +4625,4 @@ scripts/* VERSION: Set back to 0.9.0. OpenVAS wasn't that far yet. - scripts/* ChangeLog: New. Started ChangeLog file. \ No newline at end of file + scripts/* ChangeLog: New. Started ChangeLog file. Added: branches/openvas-plugins-solaris-local-security-checks/extra/generate-solaris-plugins.pl =================================================================== --- branches/openvas-plugins-solaris-local-security-checks/extra/generate-solaris-plugins.pl 2008-11-07 14:22:19 UTC (rev 1681) +++ branches/openvas-plugins-solaris-local-security-checks/extra/generate-solaris-plugins.pl 2008-11-07 16:02:15 UTC (rev 1682) @@ -0,0 +1,316 @@ +#!/usr/bin/perl +# OpenVAS Vulnerability Test Generator +# $Id$ +# Description: Generates Solaris plugins +# +# Authors: +# Tim Brown +# +# Copyright: +# Copyright (C) 2008 Tim Brown +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# as published by the Free Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# To do: +# * Improve descriptions +# * Check whether package is installed + +use LWP; +use Digest::MD5; + +$datadirectoryname = "/home/tmb"; +$plugindirectoryname = "/home/tmb"; + +# Alternate metadata for patch lists (HTML), if TXT version ever goes +#@patchlists = (["5.5.1", "sparc", "http://sunsolve.sun.com/search/document.do?assetkey=1-34-2.5.1-1", "solaris_251_sparc"], +#["5.6", "sparc", "http://sunsolve.sun.com/search/document.do?assetkey=1-34-2.6-1", "solaris_26_sparc"], +#["5.6", "i.386", "http://sunsolve.sun.com/search/document.do?assetkey=1-34-2.6_x86-1", "solaris_26_x86"], +#["5.7", "sparc", "http://sunsolve.sun.com/search/document.do?assetkey=1-34-7-1", "solaris_7_sparc"], +#["5.7", "i.386", "http://sunsolve.sun.com/search/document.do?assetkey=1-34-7_x86-1", "solaris_7_x86"], +#["5.8", "sparc", "http://sunsolve.sun.com/search/document.do?assetkey=1-34-8-1", "solaris_8_sparc"], +#["5.8", "i.386", "http://sunsolve.sun.com/search/document.do?assetkey=1-34-8_x86-1", "solaris_8_x86"], +#["5.9", "sparc", "http://sunsolve.sun.com/search/document.do?assetkey=1-34-9-1", "solaris_9_sparc"], +#["5.9", "i.386", "http://sunsolve.sun.com/search/document.do?assetkey=1-34-9_x86-1", "solaris_9_x86"], +#["5.10", "sparc", "http://sunsolve.sun.com/search/document.do?assetkey=1-34-10-1", "solaris_10_sparc"], +#["5.10", "i.386", "http://sunsolve.sun.com/search/document.do?assetkey=1-34-10_x86-1", "solaris_10_x86"]); + +# Metadata for patch lists (TXT) + at patchlists = (["5.5.1", "sparc", "http://sunsolve.sun.com/patchRedirnew.do?type=report&item=2.5.1_patch_report", "solaris_251_sparc"], +["5.6", "sparc", "http://sunsolve.sun.com/patchRedirnew.do?type=report&item=2.6_patch_report", "solaris_26_sparc"], +["5.6", "i.386", "http://sunsolve.sun.com/patchRedirnew.do?type=report&item=2.6_x86_patch_report", "solaris_26_x86"], +["5.7", "sparc", "http://sunsolve.sun.com/patchRedirnew.do?type=report&item=7_patch_report", "solaris_7_sparc"], +["5.7", "i.386", "http://sunsolve.sun.com/patchRedirnew.do?type=report&item=7_x86_patch_report", "solaris_7_x86"], +["5.8", "sparc", "http://sunsolve.sun.com/patchRedirnew.do?type=report&item=8_patch_report", "solaris_8_sparc"], +["5.8", "i.386", "http://sunsolve.sun.com/patchRedirnew.do?type=report&item=8_x86_patch_report", "solaris_8_x86"], +["5.9", "sparc", "http://sunsolve.sun.com/patchRedirnew.do?type=report&item=9_patch_report", "solaris_9_sparc"], +["5.9", "i.386", "http://sunsolve.sun.com/patchRedirnew.do?type=report&item=9_x86_patch_report", "solaris_9_x86"], +["5.10", "sparc", "http://sunsolve.sun.com/patchRedirnew.do?type=report&item=10_patch_report", "solaris_10_sparc"], +["5.10", "i.386", "http://sunsolve.sun.com/patchRedirnew.do?type=report&item=10_x86_patch_report", "solaris_10_x86"]); + +# Numerics for OID construction +$osversions["5.5.1"] = 1; +$osversions["5.6"] = 2; +$osversions["5.7"] = 3; +$osversions["5.8"] = 4; +$osversions["5.9"] = 5; +$osversions["5.10"] = 6; +$hardwaretypes["sparc"] = 1; +$hardwaretypes["i.386"] = 2; + +# Process command line options +$overridepatchlistflag = 0; +$overridepluginflag = 0; +while ($ARGV[0] ne "") { + if ($ARGV[0] eq "--override") { + $overridepatchlistflag = 1; + $overridepluginflag = 1; + } elsif ($ARGV[0] eq "--override-patch-list") { + $overridepatchlistflag = 1; + } elsif ($ARGV[0] eq "--override-plugin") { + $overridepluginflag = 1; + } + shift @ARGV +} + +# Start generation of Solaris plugins +print "I: starting generation of Solaris plugins\n"; +foreach $patchlist (@patchlists) { + $httphandle = LWP::UserAgent->new(); + $httphandle->agent("generate-solaris-plugins.pl 0.1"); + # Get a valid JSESSIONID + $requesthandle = HTTP::Request->new(POST => "http://sunsolve.sun.com/validateSLA.do"); + $requesthandle->content_type("application/x-www-form-urlencoded"); + $requesthandle->content("accept=Y"); + $responsehandle = $httphandle->request($requesthandle); + $cookiestring = $responsehandle->header("Set-Cookie"); + $cookiestring =~ /.*JSESSIONID=(.*?);.*/; + $cookiestring = $1; + # Fetch the patch list + print "I: fetching patch list for " . ${$patchlist}[3] . "\n"; + $requesthandle = HTTP::Request->new(GET => ${$patchlist}[2]); + $requesthandle->header("Cookie", "JSESSIONID=" . $cookiestring . "; SunSolve_SLA=accept=Y"); + $responsehandle = $httphandle->request($requesthandle); + if ($responsehandle->is_success()) { + # Has the patch list changed + open($tmppatchesfilehandle, ">" . $datadirectoryname . "/" . ${$patchlist}[3] . ".txt.tmp"); + print $tmppatchesfilehandle $responsehandle->content(); + close($tmppatchesfilehandle); + if (-f $datadirectoryname . "/" . ${$patchlist}[3] . ".txt") { + open($tmppatchesfilehandle, "<" . $datadirectoryname . "/" . ${$patchlist}[3] . ".txt.tmp"); + $digesthandle = Digest::MD5->new(); + $digesthandle->addfile($tmppatchesfilehandle); + $tmppatchesdigest = $digesthandle->hexdigest(); + close($tmppatchesfilehandle); + open($patchesfilehandle, "<" . $datadirectoryname . "/" . ${$patchlist}[3] . ".txt"); + $digesthandle = Digest::MD5->new(); + $digesthandle->addfile($patchesfilehandle); + $patchesdigest = $digesthandle->hexdigest(); + close($patchesfilehandle); + if ($tmppatchesdigest eq $patchesdigest) { + if ($overridepatchlistflag == 1) { + print "W: " . ${$patchlist}[3] . " unchanged\n"; + } else { + print "I: " . ${$patchlist}[3] . " unchanged\n"; + unlink($datadirectoryname . "/" . ${$patchlist}[3] . ".txt.tmp"); + next; + } + } + } + print "I: new patch list for " . ${$patchlist}[3] . "\n"; + rename($datadirectoryname . "/" . ${$patchlist}[3] . ".txt.tmp", $datadirectoryname . "/" . ${$patchlist}[3] . ".txt"); + # Capture the current list of plugins + @plugins= (); + $pluginpattern = "^" . ${$patchlist}[3] . "_([0-9]{6}).nasl\$"; + opendir($plugindirectoryhandle, $plugindirectoryname); + foreach $filename (readdir($plugindirectoryhandle)) { + if ($filename =~ /$pluginpattern/) { + push(@plugins, $1); + } + } + closedir($plugindirectoryhandle); + print "I: regenerating plugins for " . ${$patchlist}[3] . "\n"; + @tmpplugins = (); + open($patchesfilehandle, "<" . $datadirectoryname . "/" . ${$patchlist}[3] . ".txt"); + while (<$patchesfilehandle>) { + # Patch lists mark the beginning of patches containing security fixes with the line "Solaris ... Patches Containing Security Fixes:" + if ($_ =~ /^Solaris .* Patches Containing Security Fixes:$/) { + # Then an ASCII underline and a blank line + <$patchesfilehandle>; + <$patchesfilehandle>; + while (<$patchesfilehandle>) { + # Patches take the form " : patch" + if ($_ =~ /^([0-9]{6})-([0-9]{2})...(.*): (.*?)( [Pp]atch|)$/) { + push(@tmpplugins, $1); + open($tmppluginfilehandle, ">" . $plugindirectoryname . "/" . ${$patchlist}[3] . "_" . $1 . ".nasl.tmp"); + print $tmppluginfilehandle header($1 . "-" . $2) . "\n"; + print $tmppluginfilehandle description(${$patchlist}[0], ${$patchlist}[1], $1 . "-" . $2, $4) . "\n"; + print $tmppluginfilehandle "include(\"solaris.inc\");\n"; + print $tmppluginfilehandle check(${$patchlist}[0], ${$patchlist}[1], $1 . "-" . $2) . "\n"; + close($tmppluginfilehandle); + # Has the plugin changed + if (-f $datadirectoryname . "/" . ${$patchlist}[3] . "_" . $1 . ".nasl") { + open($tmppluginfilehandle, "<" . $datadirectoryname . "/" . ${$patchlist}[3] . "_" . $1 . ".nasl.tmp"); + $digesthandle = Digest::MD5->new(); + $digesthandle->addfile($tmppluginfilehandle); + $tmpplugindigest = $digesthandle->hexdigest(); + close($tmppluginfilehandle); + open($pluginfilehandle, "<" . $datadirectoryname . "/" . ${$patchlist}[3] . "_" . $1 . ".nasl"); + $digesthandle = Digest::MD5->new(); + $digesthandle->addfile($pluginfilehandle); + $plugindigest = $digesthandle->hexdigest(); + close($pluginfilehandle); + if ($tmpplugindigest eq $plugindigest) { + if ($overridepluginflag == 1) { + print "W: " . ${$patchlist}[3] . "_" . $1 . " unchanged\n"; + } else { + print "I: " . ${$patchlist}[3] . "_" . $1 . " unchanged\n"; + unlink($datadirectoryname . "/" . ${$patchlist}[3] . "_" . $1 . ".nasl.tmp"); + next; + } + } + } + print "I: new plugin for " . ${$patchlist}[3] . "_" . $1 . "\n"; + rename($datadirectoryname . "/" . ${$patchlist}[3] . "_" . $1 . ".nasl.tmp", $datadirectoryname . "/" . ${$patchlist}[3] . "_" . $1 . ".nasl"); + } elsif ($_ =~ /^$/){ + last; + } + } + } + } + # Identify any deprecated plugins + foreach $plugin (@plugins) { + foreach $tmpplugin (@tmpplugins) { + if ($plugin eq $tmpplugin) { + goto pluginexists; + } + } + print "W: " . ${$patchlist}[3] . "_" . $plugin . " no longer needed\n"; + pluginexists: + } + } +} + +sub header { + my $patchid = shift; + my $result; + # Start generation of plugin header + $result = "# OpenVAS Vulnerability Test\n"; + $result = $result . "# \$Id\$\n"; + $result = $result . "# Description: Solaris plugin for " . $patchid . "\n"; + $result = $result . "#\n"; + $result = $result . "# Authors:\n"; + $result = $result . "# Tim Brown \n"; + $result = $result . "#\n"; + $result = $result . "# Copyright:\n"; + $result = $result . "# Copyright (c) 2008 Tim Brown and Portcullis Computer Security Ltd\n"; + $result = $result . "# Text descriptions are largerly excerpted from the referenced\n"; + $result = $result . "# advisory, and are Copyright (c) the respective author(s)\n"; + $result = $result . "#\n"; + $result = $result . "# This program is free software; you can redistribute it and/or modify\n"; + $result = $result . "# it under the terms of the GNU General Public License version 2,\n"; + $result = $result . "# as published by the Free Software Foundation\n"; + $result = $result . "#\n"; + $result = $result . "# This program is distributed in the hope that it will be useful,\n"; + $result = $result . "# but WITHOUT ANY WARRANTY; without even the implied warranty of\n"; + $result = $result . "# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n"; + $result = $result . "# GNU General Public License for more details.\n"; + $result = $result . "#\n"; + $result = $result . "# You should have received a copy of the GNU General Public License\n"; + $result = $result . "# along with this program; if not, write to the Free Software\n"; + $result = $result . "# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n"; + $result = $result . "#\n"; + return $result; +} + +sub description { + my $osversion = shift; + my $hardwaretype = shift; + my $patchid = shift; + my $description = shift; + # Start generation of plugin description + return "if (description)\n{\n\t" . expanddescription($osversion, $hardwaretype, $patchid, $description) . "\n}"; +} + +sub expanddescription { + my $osversion = shift; + my $hardwaretype = shift; + my $patchid = shift; + my $description = shift; + my $result; + my $oid; + # Expand plugin description + # Create an OID + if ($patchid =~ /([0-9]{6})-[0-9]{2}/) { + $oid = $osversions[$osversion] . "." . $hardwaretypes[$hardwaretype] . "." . $1; + } else { + $oid = $osversions[$osversion] . "." . $hardwaretypes[$hardwaretype] . ".WTF"; + } + $result = "script_oid(\"1.3.6.1.4.1.25623.1.0.99." . $oid . "\");\n"; + $result = $result . "\tname[\"english\"] = \"Sun Solaris " . $osversion . " " . $patchid . "\";\n"; + $result = $result . "\tscript_name(english:name[\"english\"]);\n"; + $result = $result . "\tdesc[\"english\"] = \"Sun Solaris " . $osversion . " missing patch " . $patchid . "\n"; + $result = $result . "\n"; + $result = $result . "The remote host is missing a patch containing a security fix for a bug\n"; + $result = $result . "which affects the following component(s):\n"; + # Deal with " in descriptions + $description =~ s/\"/\'/g; + $result = $result . $description . "\n"; + $result = $result . "\n"; + $result = $result . "On the following platforms, we recommend you upgrade and install the\n"; + $result = $result . "referenced patch:\n"; + $result = $result . "Sun Solaris " . $osversion . " " . ($hardwaretype eq "sparc" ? "(SPARC)" : "(x86)") . "\n"; + $result = $result . "\n"; + $result = $result . "We recommend you install the following patch:\n"; + $result = $result . $patchid . "\n"; + $result = $result . "\n"; + $result = $result . "Solution:\n"; + $result = $result . "http://sunsolve.sun.com/search/document.do?assetkey=1-21-$patchid-1\n"; + $result = $result . "\n"; + $result = $result . "Risk factor: \";\n"; + $result = $result . "\tscript_description(english:desc[\"english\"]);\n"; + $result = $result . "\tsummary[\"english\"] = \"" . $patchid . "\";\n"; + $result = $result . "\tscript_summary(english:summary[\"english\"]);\n"; + $result = $result . "\tfamily[\"english\"] = \"Solaris Local Security Checks\";\n"; + $result = $result . "\tscript_family(english:family[\"english\"]);\n"; + $result = $result . "\tscript_category(ACT_GATHER_INFO);\n"; + $result = $result . "\tscript_dependencie(\"gather-package-list.nasl\");\n"; + $result = $result . "\tscript_require_keys(\"ssh/login/solosversion\");\n"; + $result = $result . "\tscript_copyright(english:\"(c) Tim Brown and Portcullis Computer Security Ltd, 2008\");\n"; + $result = $result . "\texit(0);"; + return $result; +} + +sub check { + my $osversion = shift; + my $hardwaretype = shift; + my $patchid = shift; + # Start generation of plugin check + return "if " . expandchecks($osversion, $hardwaretype, $patchid) . "\n{\n\tsecurity_hole(0);\n}"; +} + +sub expandchecks { + my $osversion = shift; + my $hardwaretype = shift; + my $patchid = shift; + my $result; + # Expand plugin check + $result = "("; + $result = $result . "(solosversion_check(\"" . $osversion . "\") == TRUE)"; + $result = $result . " && "; + $result = $result . "(solhardwaretype_check(\"" . $hardwaretype . "\") == TRUE)"; + $result = $result . " && "; + $result = $result . "(solpatchid_check(\"" . $patchid . "\") == FALSE)"; + $result = $result . ")"; + return $result; +} Property changes on: branches/openvas-plugins-solaris-local-security-checks/extra/generate-solaris-plugins.pl ___________________________________________________________________ Name: svn:executable + * From scm-commit at wald.intevation.org Mon Nov 10 10:42:59 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Mon, 10 Nov 2008 10:42:59 +0100 (CET) Subject: [Openvas-commits] r1683 - in trunk/openvas-libraries: . include libopenvas Message-ID: <20081110094259.277F64076D@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-10 10:42:58 +0100 (Mon, 10 Nov 2008) New Revision: 1683 Removed: trunk/openvas-libraries/libopenvas/getopt.c trunk/openvas-libraries/libopenvas/getopt.h trunk/openvas-libraries/libopenvas/getopt1.c Modified: trunk/openvas-libraries/ChangeLog trunk/openvas-libraries/MANIFEST trunk/openvas-libraries/Makefile trunk/openvas-libraries/TODO trunk/openvas-libraries/configure trunk/openvas-libraries/configure.in trunk/openvas-libraries/include/config.h.in trunk/openvas-libraries/libopenvas/Makefile Log: Removed local copies of getopt; the functionality provided by getopt has been replaced with glib as explained in Change Request #9 (http://www.openvas.org/openvas-cr-9.html). * include/config.h.in: Removed obsolete defines for getopt. * configure.in: Removed obsolete checks for getopt. * configure: Regenerated. * libopenvas/getopt.c, libopenvas/getopt.h, libopenvas/getopt1.c: Removed obsolete local copies of getopt. * libopenvas/Makefile: Removed handling of getopt files. * TODO: Removed section regarding getopt copies. * MANIFEST: Updated. * Makefile: Removed handling of getopt files. Modified: trunk/openvas-libraries/ChangeLog =================================================================== --- trunk/openvas-libraries/ChangeLog 2008-11-07 16:02:15 UTC (rev 1682) +++ trunk/openvas-libraries/ChangeLog 2008-11-10 09:42:58 UTC (rev 1683) @@ -1,3 +1,26 @@ +2008-11-10 Michael Wiegand + + Removed local copies of getopt; the functionality provided by getopt has + been replaced with glib as explained in Change Request #9 + (http://www.openvas.org/openvas-cr-9.html). + + * include/config.h.in: Removed obsolete defines for getopt. + + * configure.in: Removed obsolete checks for getopt. + + * configure: Regenerated. + + * libopenvas/getopt.c, libopenvas/getopt.h, libopenvas/getopt1.c: + Removed obsolete local copies of getopt. + + * libopenvas/Makefile: Removed handling of getopt files. + + * TODO: Removed section regarding getopt copies. + + * MANIFEST: Updated. + + * Makefile: Removed handling of getopt files. + 2008-11-07 Michael Wiegand * libopenvas/network.c, libopenvas/network.h: Added Modified: trunk/openvas-libraries/MANIFEST =================================================================== --- trunk/openvas-libraries/MANIFEST 2008-11-07 16:02:15 UTC (rev 1682) +++ trunk/openvas-libraries/MANIFEST 2008-11-10 09:42:58 UTC (rev 1683) @@ -46,9 +46,6 @@ libopenvas/COPYING libopenvas/ftp_funcs.c libopenvas/ftp_funcs.h -libopenvas/getopt1.c -libopenvas/getopt.c -libopenvas/getopt.h libopenvas/harglists.c libopenvas/harglists.h libopenvas/hlst.c Modified: trunk/openvas-libraries/Makefile =================================================================== --- trunk/openvas-libraries/Makefile 2008-11-07 16:02:15 UTC (rev 1682) +++ trunk/openvas-libraries/Makefile 2008-11-10 09:42:58 UTC (rev 1683) @@ -46,7 +46,6 @@ $(INSTALL) -m 0444 include/libopenvas.h $(DESTDIR)${includedir}/openvas $(INSTALL) -m 0444 include/libvers.h $(DESTDIR)${includedir}/openvas - $(INSTALL) -m 0444 libopenvas/getopt.h $(DESTDIR)${includedir}/openvas $(INSTALL) -m 0444 libopenvas/arglists.h $(DESTDIR)${includedir}/openvas $(INSTALL) -m 0444 libopenvas/bpf_share.h $(DESTDIR)${includedir}/openvas $(INSTALL) -m 0444 libopenvas/ftp_funcs.h $(DESTDIR)${includedir}/openvas Modified: trunk/openvas-libraries/TODO =================================================================== --- trunk/openvas-libraries/TODO 2008-11-07 16:02:15 UTC (rev 1682) +++ trunk/openvas-libraries/TODO 2008-11-10 09:42:58 UTC (rev 1683) @@ -26,10 +26,6 @@ 2007-04-12 - * libopenvas/getopt*: Is it really necessary - to maintain copies? What are the differences - to the original getopt modules? - * AIX: Is this a platform that is really important to be supported? Special treatment for AIX occurs at various places. Modified: trunk/openvas-libraries/configure =================================================================== --- trunk/openvas-libraries/configure 2008-11-07 16:02:15 UTC (rev 1682) +++ trunk/openvas-libraries/configure 2008-11-10 09:42:58 UTC (rev 1683) @@ -1451,7 +1451,6 @@ --enable-debug-store Warn the user if a plugin has too many CVE/BID/XRefs --enable-debug-ssl produce verbose output regarding SSL --enable-debug set the compiler flags to -g - --enable-getoptlong force using/disbling the internal GNU getopt package --enable-ptmx force using/disabling the /dev/ptmx multiplexer --enable-openpty if present, use/disable openpty for creating ptys @@ -4720,7 +4719,7 @@ case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 4723 "configure"' > conftest.$ac_ext + echo '#line 4722 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -5272,7 +5271,7 @@ save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" compiler_c_o=no -if { (eval echo configure:5275: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then +if { (eval echo configure:5274: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings if test -s out/conftest.err; then @@ -7133,7 +7132,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5 -echo $ECHO_N "checking for getopt_long to assume by config argument... $ECHO_C" >&6; } -esac -if test x$USE_GETOPT = xyes ; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - cat >>confdefs.h <<\_ACEOF -#define ENABLE_GETOPT_LONG 1 -_ACEOF - -elif test x$USE_GETOPT = xno ; then - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -else -for ac_func in getopt_long -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - -fi - # disable openpty() upon request, only if test x$USE_OPENPTY != xno -a x$USE_PTMX != xyes ; then { echo "$as_me:$LINENO: checking for openpty in -lutil" >&5 Modified: trunk/openvas-libraries/configure.in =================================================================== --- trunk/openvas-libraries/configure.in 2008-11-07 16:02:15 UTC (rev 1682) +++ trunk/openvas-libraries/configure.in 2008-11-10 09:42:58 UTC (rev 1683) @@ -141,12 +141,6 @@ AC_C_BIGENDIAN -AC_ARG_ENABLE(getoptlong,[ --enable-getoptlong force using/disbling the internal GNU getopt package], - [case $enable_getoptlong in - n*|N*) USE_GETOPT=no ;; - *) USE_GETOPT=yes ;; - esac]) - AC_ARG_ENABLE(ptmx,[ --enable-ptmx force using/disabling the /dev/ptmx multiplexer], [case $enable_ptmx in n*|N*) USE_PTMX=no ;; @@ -169,7 +163,7 @@ AC_HEADER_TIME AC_HEADER_DIRENT AC_CHECK_HEADERS(linux/msg.h sys/msg.h sys/ipc.h) -AC_CHECK_HEADERS(unistd.h getopt.h string.h strings.h sys/sockio.h sys/socketio.h sys/uio.h) +AC_CHECK_HEADERS(unistd.h string.h strings.h sys/sockio.h sys/socketio.h sys/uio.h) AC_CHECK_HEADERS(sys/param.h netinet/in_systm.h) AC_CHECK_HEADERS(netinet/in.h,,,[#include ]) AC_CHECK_HEADERS(netinet/in_systm.h,,,[#include ]) @@ -227,19 +221,6 @@ AC_CHECK_FUNCS(bzero bcopy setsid) AC_CHECK_FUNCS(addr2ascii inet_neta lrand48 setitimer sendmsg recvmsg) - -dnl check for getopt, or assume it (not) present -case $USE_GETOPT in yes|no) - AC_MSG_CHECKING(for getopt_long to assume by config argument) -esac -if test x$USE_GETOPT = xyes ; then - AC_MSG_RESULT(yes) - AC_DEFINE(ENABLE_GETOPT_LONG) -elif test x$USE_GETOPT = xno ; then - AC_MSG_RESULT(no) -else AC_CHECK_FUNCS(getopt_long) -fi - # disable openpty() upon request, only if test x$USE_OPENPTY != xno -a x$USE_PTMX != xyes ; then AC_CHECK_LIB(util,openpty,LIBS="-lutil $LIBS") Modified: trunk/openvas-libraries/include/config.h.in =================================================================== --- trunk/openvas-libraries/include/config.h.in 2008-11-07 16:02:15 UTC (rev 1682) +++ trunk/openvas-libraries/include/config.h.in 2008-11-10 09:42:58 UTC (rev 1683) @@ -194,7 +194,6 @@ #undef HAVE_GETHRTIME #undef HAVE_GETRUSAGE #undef HAVE_LONG_FILE_NAMES -#undef HAVE_GETOPT_H #undef HAVE_STRING_H #undef HAVE_STRINGS_H #undef HAVE_SYS_POLL_H @@ -216,7 +215,6 @@ #undef HAVE_NETINET_IP_ICMP_H #undef HAVE_NETINET_IP_TCP_H #undef HAVE_NETINET_PROTOCOLS_H -#undef HAVE_GETOPT_LONG #undef HAVE_STRUCT_IP #undef HAVE_STRUCT_ICMP #undef HAVE_STRUCT_TCPHDR Modified: trunk/openvas-libraries/libopenvas/Makefile =================================================================== --- trunk/openvas-libraries/libopenvas/Makefile 2008-11-07 16:02:15 UTC (rev 1682) +++ trunk/openvas-libraries/libopenvas/Makefile 2008-11-10 09:42:58 UTC (rev 1683) @@ -26,13 +26,13 @@ OBJS = plugutils.o system.o network.o resolve.o arglists.o ftp_funcs.o \ scanners_utils.o pcap.o hlst.o harglists.o \ - getopt.o getopt1.o www_funcs.o ids_send.o rand.o popen.o \ + www_funcs.o ids_send.o rand.o popen.o \ bpf_share.o rand.o popen.o services.o services1.o \ proctitle.o store.o kb.o share_fd.o LO_OBJS = plugutils.lo system.lo network.lo resolve.lo arglists.lo \ ftp_funcs.lo scanners_utils.lo pcap.lo hlst.lo harglists.lo \ - getopt.lo getopt1.lo www_funcs.lo ids_send.lo \ + www_funcs.lo ids_send.lo \ rand.lo popen.lo bpf_share.lo services.lo services1.lo \ proctitle.lo store.lo kb.lo share_fd.lo @@ -45,12 +45,6 @@ all : libopenvas.la -getopt.o : getopt.c - $(LIBTOOL) $(CC) $(CIPHER) $(DEFS) $(INCLUDE) $(CFLAGS) -c getopt.c - -getopt1.o : getopt1.c - $(LIBTOOL) $(CC) $(CIPHER) $(DEFS) $(INCLUDE) $(CFLAGS) -c getopt1.c - plugutils.o: plugutils.c arglists.h comm.h harglists.h kb.h network.h \ rand.h plugutils.h services.h share_fd.h store_internal.h system.h \ scanners_utils.h Deleted: trunk/openvas-libraries/libopenvas/getopt.c =================================================================== --- trunk/openvas-libraries/libopenvas/getopt.c 2008-11-07 16:02:15 UTC (rev 1682) +++ trunk/openvas-libraries/libopenvas/getopt.c 2008-11-10 09:42:58 UTC (rev 1683) @@ -1,793 +0,0 @@ -/* Getopt for GNU. - NOTE: getopt is now part of the C library, so if you don't know what - "Keep this file name-space clean" means, talk to roland at gnu.ai.mit.edu - before changing it! - - Copyright (C) 1987, 88, 89, 90, 91, 92, 1993 - Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* Modified for use with Nessus by - $Id: getopt.c,v 1.10 2001/10/16 18:48:55 renaud Exp $ */ - -/* NOTE!!! AIX requires this to be the first thing in the file. - Do not put ANYTHING before it! */ - -#if !defined (__GNUC__) && defined (_AIX) -#pragma alloca -#endif - -#include -#include - - -/***********************/ -#ifndef HAVE_GETOPT_LONG -/***********************/ - -#ifdef __GNUC__ -#define alloca __builtin_alloca -#else /* not __GNUC__ */ -#if defined (HAVE_ALLOCA_H) || (defined(sparc) && (defined(sun) || (!defined(USG) && !defined(SVR4) && !defined(__svr4__)))) -#include -#else -#ifndef _AIX -char *alloca (); -#endif -#endif /* alloca.h */ -#endif /* not __GNUC__ */ - -#if !__STDC__ && !defined(const) && IN_GCC -#define const -#endif - -/* This tells Alpha OSF/1 not to define a getopt prototype in . */ -#ifndef _NO_PROTO -#define _NO_PROTO -#endif - -#include - -/* Comment out all this code if we are using the GNU C Library, and are not - actually compiling the library itself. This code is part of the GNU C - Library, but also included in many other GNU distributions. Compiling - and linking in this code is a waste when using the GNU C library - (especially if it is a shared library). Rather than having every GNU - program understand `configure --with-gnu-libc' and omit the object files, - it is simpler to just do this in the source for each such file. */ - -/************************************************/ -#if defined (_LIBC) || !defined (__GNU_LIBRARY__) -#endif /* disabe #ifdef */ -/************************************************/ - -#if 0 /* old stuff */ -/* This needs to come after some library #include - to get __GNU_LIBRARY__ defined. */ -#ifdef __GNU_LIBRARY__ -#undef alloca -/* Don't include stdlib.h for non-GNU C libraries because some of them - contain conflicting prototypes for getopt. */ -#include -#else /* Not GNU C library. */ -#define __alloca alloca -#endif /* GNU C library. */ -#endif /* old stuff */ - -#ifdef HAVE_ALLOCA -#define __alloca alloca -#endif -#ifdef HAVE__ALLOCA -#define __alloca _alloca -#endif -#ifndef __alloca -#error alloca() is needed to compile this source -#endif - -#if !defined (__STDC__) && !defined (const) -# define const -#endif - -/* If GETOPT_COMPAT is defined, `+' as well as `--' can introduce a - long-named option. Because this is not POSIX.2 compliant, it is - being phased out. */ -/* #define GETOPT_COMPAT */ - -/* This version of `getopt' appears to the caller like standard Unix `getopt' - but it behaves differently for the user, since it allows the user - to intersperse the options with the other arguments. - - As `getopt' works, it permutes the elements of ARGV so that, - when it is done, all the options precede everything else. Thus - all application programs are extended to handle flexible argument order. - - Setting the environment variable POSIXLY_CORRECT disables permutation. - Then the behavior is completely standard. - - GNU application programs can use a third alternative mode in which - they can distinguish the relative order of options and other arguments. */ - -#include "getopt.h" - -#undef optarg -#undef opterr -#undef optopt -#undef optind - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ -#ifdef HAVE_OPTIND -extern char* optarg; -#else -char *optarg = 0; -#endif - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns EOF, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -/* XXX 1003.2 says this must be 1 before any call. */ -#ifdef HAVE_OPTIND -extern int optind; -#else -int optind = 0; -#endif - -/* The next char to be scanned in the option-element - in which the last option character we returned was found. - This allows us to pick up the scan where we left off. - - If this is zero, or a null string, it means resume the scan - by advancing to the next ARGV-element. */ - -static char *nextchar; - -/* Callers store zero here to inhibit the error message - for unrecognized options. */ - -#ifdef HAVE_OPTIND -extern int opterr; -#else -int opterr = 1; -#endif - -/* Set to an option character which was unrecognized. - This must be initialized on some systems to avoid linking in the - system's own getopt implementation. */ - -#ifdef HAVE_OPTIND -extern int optint; -#else -int optopt = '?'; -#endif - - -/* Describe how to deal with options that follow non-option ARGV-elements. - - If the caller did not specify anything, - the default is REQUIRE_ORDER if the environment variable - POSIXLY_CORRECT is defined, PERMUTE otherwise. - - REQUIRE_ORDER means don't recognize them as options; - stop option processing when the first non-option is seen. - This is what Unix does. - This mode of operation is selected by either setting the environment - variable POSIXLY_CORRECT, or using `+' as the first character - of the list of option characters. - - PERMUTE is the default. We permute the contents of ARGV as we scan, - so that eventually all the non-options are at the end. This allows options - to be given in any order, even with programs that were not written to - expect this. - - RETURN_IN_ORDER is an option available to programs that were written - to expect options and other ARGV-elements in any order and that care about - the ordering of the two. We describe each non-option ARGV-element - as if it were the argument of an option with character code 1. - Using `-' as the first character of the list of option characters - selects this mode of operation. - - The special argument `--' forces an end of option-scanning regardless - of the value of `ordering'. In the case of RETURN_IN_ORDER, only - `--' can cause `getopt' to return EOF with `optind' != ARGC. */ - -static enum -{ - REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER -} ordering, default_ordering = PERMUTE; - -#ifdef __GNU_LIBRARY__ -/* We want to avoid inclusion of string.h with non-GNU libraries - because there are many ways it can cause trouble. - On some systems, it contains special magic macros that don't work - in GCC. */ -#include -#define my_index strchr -#define my_bcopy(src, dst, n) memcpy ((dst), (src), (n)) -#else - -/* Avoid depending on library functions or files - whose names are inconsistent. */ - -char *getenv (); - -static char * -my_index (str, chr) - const char *str; - int chr; -{ - while (*str) - { - if (*str == chr) - return (char *) str; - str++; - } - return 0; -} - -static void -my_bcopy (from, to, size) - const char *from; - char *to; - int size; -{ - int i; - for (i = 0; i < size; i++) - to[i] = from[i]; -} -#endif /* GNU C library. */ - -/* Handle permutation of arguments. */ - -/* Describe the part of ARGV that contains non-options that have - been skipped. `first_nonopt' is the index in ARGV of the first of them; - `last_nonopt' is the index after the last of them. */ - -static int first_nonopt; -static int last_nonopt; - -/* Exchange two adjacent subsequences of ARGV. - One subsequence is elements [first_nonopt,last_nonopt) - which contains all the non-options that have been skipped so far. - The other is elements [last_nonopt,optind), which contains all - the options processed since those non-options were skipped. - - `first_nonopt' and `last_nonopt' are relocated so that they describe - the new indices of the non-options in ARGV after they are moved. */ - -static void -exchange (argv) - char **argv; -{ - int nonopts_size = (last_nonopt - first_nonopt) * sizeof (char *); - char **temp = (char **) __alloca (nonopts_size); - - /* Interchange the two blocks of data in ARGV. */ - - my_bcopy ((char *) &argv[first_nonopt], (char *) temp, nonopts_size); - my_bcopy ((char *) &argv[last_nonopt], (char *) &argv[first_nonopt], - (optind - last_nonopt) * sizeof (char *)); - my_bcopy ((char *) temp, - (char *) &argv[first_nonopt + optind - last_nonopt], - nonopts_size); - - /* Update records for the slots the non-options now occupy. */ - - first_nonopt += (optind - last_nonopt); - last_nonopt = optind; -} - -/* Scan elements of ARGV (whose length is ARGC) for option characters - given in OPTSTRING. - - If an element of ARGV starts with '-', and is not exactly "-" or "--", - then it is an option element. The characters of this element - (aside from the initial '-') are option characters. If `getopt' - is called repeatedly, it returns successively each of the option characters - from each of the option elements. - - If `getopt' finds another option character, it returns that character, - updating `optind' and `nextchar' so that the next call to `getopt' can - resume the scan with the following option character or ARGV-element. - - If there are no more option characters, `getopt' returns `EOF'. - Then `optind' is the index in ARGV of the first ARGV-element - that is not an option. (The ARGV-elements have been permuted - so that those that are not options now come last.) - - OPTSTRING is a string containing the legitimate option characters. - If an option character is seen that is not listed in OPTSTRING, - return '?' after printing an error message. If you set `opterr' to - zero, the error message is suppressed but we still return '?'. - - If a char in OPTSTRING is followed by a colon, that means it wants an arg, - so the following text in the same ARGV-element, or the text of the following - ARGV-element, is returned in `optarg'. Two colons mean an option that - wants an optional arg; if there is text in the current ARGV-element, - it is returned in `optarg', otherwise `optarg' is set to zero. - - If OPTSTRING starts with `-' or `+', it requests different methods of - handling the non-option ARGV-elements. - See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. - - Long-named options begin with `--' instead of `-'. - Their names may be abbreviated as long as the abbreviation is unique - or is an exact match for some defined option. If they have an - argument, it follows the option name in the same ARGV-element, separated - from the option name by a `=', or else the in next ARGV-element. - When `getopt' finds a long-named option, it returns 0 if that option's - `flag' field is nonzero, the value of the option's `val' field - if the `flag' field is zero. - - The elements of ARGV aren't really const, because we permute them. - But we pretend they're const in the prototype to be compatible - with other systems. - - LONGOPTS is a vector of `struct option' terminated by an - element containing a name which is zero. - - LONGIND returns the index in LONGOPT of the long-named option found. - It is only valid when a long-named option has been found by the most - recent call. - - If LONG_ONLY is nonzero, '-' as well as '--' can introduce - long-named options. */ - -/* Call this function with an argument of 1 to set the default option - ordering to that required by Posix. The normal default is PERMUTE. */ -void -getopt_set_posix_option_order (on_or_off) - int on_or_off; -{ - if (on_or_off == 1) - default_ordering = REQUIRE_ORDER; - else - default_ordering = PERMUTE; -} - -int -_getopt_internal (argc, argv, optstring, longopts, longind, long_only) - int argc; - char *const *argv; - const char *optstring; - const struct option *longopts; - int *longind; - int long_only; -{ - int option_index; - - optarg = 0; - - if (optind > argc || optind < 0) - { - optind = argc; - return (EOF); - } - - /* Initialize the internal data when the first call is made. - Start processing options with ARGV-element 1 (since ARGV-element 0 - is the program name); the sequence of previously skipped - non-option ARGV-elements is empty. */ - - if (optind == 0) - { - first_nonopt = last_nonopt = optind = 1; - - nextchar = NULL; - - /* Determine how to handle the ordering of options and nonoptions. */ - - if (optstring[0] == '-') - { - ordering = RETURN_IN_ORDER; - ++optstring; - } - else if (optstring[0] == '+') - { - ordering = REQUIRE_ORDER; - ++optstring; - } - else if (getenv ("POSIXLY_CORRECT") != NULL) - ordering = REQUIRE_ORDER; - else - ordering = default_ordering; - } - - if (nextchar == NULL || *nextchar == '\0') - { - if (ordering == PERMUTE) - { - /* If we have just processed some options following some non-options, - exchange them so that the options come first. */ - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (last_nonopt != optind) - first_nonopt = optind; - - /* Now skip any additional non-options - and extend the range of non-options previously skipped. */ - - while (optind < argc - && (argv[optind][0] != '-' || argv[optind][1] == '\0') -#ifdef GETOPT_COMPAT - && (longopts == NULL - || argv[optind][0] != '+' || argv[optind][1] == '\0') -#endif /* GETOPT_COMPAT */ - ) - optind++; - last_nonopt = optind; - } - - /* Special ARGV-element `--' means premature end of options. - Skip it like a null option, - then exchange with previous non-options as if it were an option, - then skip everything else like a non-option. */ - - if (optind != argc && !strcmp (argv[optind], "--")) - { - optind++; - - if (first_nonopt != last_nonopt && last_nonopt != optind) - exchange ((char **) argv); - else if (first_nonopt == last_nonopt) - first_nonopt = optind; - last_nonopt = argc; - - optind = argc; - } - - /* If we have done all the ARGV-elements, stop the scan - and back over any non-options that we skipped and permuted. */ - - if (optind == argc) - { - /* Set the next-arg-index to point at the non-options - that we previously skipped, so the caller will digest them. */ - if (first_nonopt != last_nonopt) - optind = first_nonopt; - return EOF; - } - - /* If we have come to a non-option and did not permute it, - either stop the scan or describe it to the caller and pass it by. */ - - if ((argv[optind][0] != '-' || argv[optind][1] == '\0') -#ifdef GETOPT_COMPAT - && (longopts == NULL - || argv[optind][0] != '+' || argv[optind][1] == '\0') -#endif /* GETOPT_COMPAT */ - ) - { - if (ordering == REQUIRE_ORDER) - return EOF; - optarg = argv[optind++]; - return 1; - } - - /* We have found another option-ARGV-element. - Start decoding its characters. */ - - nextchar = (argv[optind] + 1 - + (longopts != NULL && argv[optind][1] == '-')); - } - - if (longopts != NULL - && ((argv[optind][0] == '-' - && (argv[optind][1] == '-' || long_only)) -#ifdef GETOPT_COMPAT - || argv[optind][0] == '+' -#endif /* GETOPT_COMPAT */ - )) - { - const struct option *p; - char *s = nextchar; - int exact = 0; - int ambig = 0; - const struct option *pfound = NULL; - int indfound; - - while (*s && *s != '=') - s++; - - /* Test all options for either exact match or abbreviated matches. */ - for (p = longopts, option_index = 0; p->name; - p++, option_index++) - if (!strncmp (p->name, nextchar, s - nextchar)) - { - if (s - nextchar == strlen (p->name)) - { - /* Exact match found. */ - pfound = p; - indfound = option_index; - exact = 1; - break; - } - else if (pfound == NULL) - { - /* First nonexact match found. */ - pfound = p; - indfound = option_index; - } - else - /* Second nonexact match found. */ - ambig = 1; - } - - if (ambig && !exact) - { - if (opterr) - fprintf (stderr, "%s: option `%s' is ambiguous\n", - argv[0], argv[optind]); - nextchar += strlen (nextchar); - optind++; - return '?'; - } - - if (pfound != NULL) - { - option_index = indfound; - optind++; - if (*s) - { - /* Don't test has_arg with >, because some C compilers don't - allow it to be used on enums. */ - if (pfound->has_arg) - optarg = s + 1; - else - { - if (opterr) - { - if (argv[optind - 1][1] == '-') - /* --option */ - fprintf (stderr, - "%s: option `--%s' doesn't allow an argument\n", - argv[0], pfound->name); - else - /* +option or -option */ - fprintf (stderr, - "%s: option `%c%s' doesn't allow an argument\n", - argv[0], argv[optind - 1][0], pfound->name); - } - nextchar += strlen (nextchar); - return '?'; - } - } - else if (pfound->has_arg == 1) - { - if (optind < argc) - optarg = argv[optind++]; - else - { - if (opterr) - fprintf (stderr, "%s: option `%s' requires an argument\n", - argv[0], argv[optind - 1]); - nextchar += strlen (nextchar); - return optstring[0] == ':' ? ':' : '?'; - } - } - nextchar += strlen (nextchar); - if (longind != NULL) - *longind = option_index; - if (pfound->flag) - { - *(pfound->flag) = pfound->val; - return 0; - } - return pfound->val; - } - /* Can't find it as a long option. If this is not getopt_long_only, - or the option starts with '--' or is not a valid short - option, then it's an error. - Otherwise interpret it as a short option. */ - if (!long_only || argv[optind][1] == '-' -#ifdef GETOPT_COMPAT - || argv[optind][0] == '+' -#endif /* GETOPT_COMPAT */ - || my_index (optstring, *nextchar) == NULL) - { - if (opterr) - { - if (argv[optind][1] == '-') - /* --option */ - fprintf (stderr, "%s: unrecognized option `--%s'\n", - argv[0], nextchar); - else - /* +option or -option */ - fprintf (stderr, "%s: unrecognized option `%c%s'\n", - argv[0], argv[optind][0], nextchar); - } - nextchar = (char *) ""; - optind++; - return '?'; - } - } - - /* Look at and handle the next option-character. */ - - { - char c = *nextchar++; - char *temp = my_index (optstring, c); - - /* Increment `optind' when we start to process its last character. */ - if (*nextchar == '\0') - ++optind; - - optopt = c; - - if (temp == NULL || c == ':') - { - if (opterr) - { -#if 0 - if (c < 040 || c >= 0177) - fprintf (stderr, "%s: unrecognized option, character code 0%o\n", - argv[0], c); - else - fprintf (stderr, "%s: unrecognized option `-%c'\n", argv[0], c); -#else - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c); -#endif - } - optopt = c; - return '?'; - } - if (temp[1] == ':') - { - if (temp[2] == ':') - { - /* This is an option that accepts an argument optionally. */ - if (*nextchar != '\0') - { - optarg = nextchar; - optind++; - } - else - optarg = 0; - nextchar = NULL; - } - else - { - /* This is an option that requires an argument. */ - if (*nextchar != '\0') - { - optarg = nextchar; - /* If we end this ARGV-element by taking the rest as an arg, - we must advance to the next element now. */ - optind++; - } - else if (optind == argc) - { - if (opterr) - { -#if 0 - fprintf (stderr, "%s: option `-%c' requires an argument\n", - argv[0], c); -#else - /* 1003.2 specifies the format of this message. */ - fprintf (stderr, "%s: option requires an argument -- %c\n", - argv[0], c); -#endif - } - optopt = c; - if (optstring[0] == ':') - c = ':'; - else - c = '?'; - } - else - /* We already incremented `optind' once; - increment it again when taking next ARGV-elt as argument. */ - optarg = argv[optind++]; - nextchar = NULL; - } - } - return c; - } -} - -/******************************************/ -#if 0 /* annihilate #endif */ -#endif /* _LIBC or not __GNU_LIBRARY__. */ -/******************************************/ - -#ifdef TEST - -/* Compile with -DTEST to make an executable for use in testing - the above definition of `getopt'. */ - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - - c = getopt (argc, argv, "abc:d:0123456789"); - if (c == EOF) - break; - - switch (c) - { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ - -/***************************/ -#endif /* HAVE_GETOPT_LONG */ -/***************************/ Deleted: trunk/openvas-libraries/libopenvas/getopt.h =================================================================== --- trunk/openvas-libraries/libopenvas/getopt.h 2008-11-07 16:02:15 UTC (rev 1682) +++ trunk/openvas-libraries/libopenvas/getopt.h 2008-11-10 09:42:58 UTC (rev 1683) @@ -1,169 +0,0 @@ -/* Declarations for getopt. - Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by the - Free Software Foundation; either version 2, or (at your option) any - later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* Modified for use with Nessus by - $Id: getopt.h,v 1.8 2001/10/15 17:57:50 renaud Exp $ */ - -#ifndef _GETOPT_H -#define _GETOPT_H 1 - -#ifdef _CYGWIN_ -#undef _WIN32 -#endif - -#ifdef _WIN32 -#define APPLY_OPTVAR_REPLACEMENTS 1 -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* For communication from `getopt' to the caller. - When `getopt' finds an option that takes an argument, - the argument value is returned here. - Also, when `ordering' is RETURN_IN_ORDER, - each non-option ARGV-element is returned here. */ - -extern char *optarg; - -/* Index in ARGV of the next element to be scanned. - This is used for communication to and from the caller - and for communication between successive calls to `getopt'. - - On entry to `getopt', zero means this is the first call; initialize. - - When `getopt' returns EOF, this is the index of the first of the - non-option elements that the caller should itself scan. - - Otherwise, `optind' communicates from one call to the next - how much of ARGV has been scanned so far. */ - -extern int optind; - -/* Callers store zero here to inhibit the error message `getopt' prints - for unrecognized options. */ - -extern int opterr; - -/* Set to an option character which was unrecognized. */ - -extern int optopt; - -/* Describe the long-named options requested by the application. - The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector - of `struct option' terminated by an element containing a name which is - zero. - - The field `has_arg' is: - no_argument (or 0) if the option does not take an argument, - required_argument (or 1) if the option requires an argument, - optional_argument (or 2) if the option takes an optional argument. - - If the field `flag' is not NULL, it points to a variable that is set - to the value given in the field `val' when the option is found, but - left unchanged if the option is not found. - - To have a long-named option do something other than set an `int' to - a compiled-in constant, such as set a value from `optarg', set the - option's `flag' field to zero and its `val' field to a nonzero - value (the equivalent single-letter option character, if there is - one). For long options that have a zero `flag' field, `getopt' - returns the contents of the `val' field. */ - -struct option -{ -#if __STDC__ - const char *name; -#else - char *name; -#endif - /* has_arg can't be an enum because some compilers complain about - type mismatches in all the code that assumes it is an int. */ - int has_arg; - int *flag; - int val; -}; - -/* Names for the values of the `has_arg' field of `struct option'. */ - -#define no_argument 0 -#define required_argument 1 -#define optional_argument 2 - -#if __STDC__ -#if 0 /* we do not use getopt, here with nessus */ -#if defined(__GNU_LIBRARY__) -/* Many other libraries have conflicting prototypes for getopt, with - differences in the consts, in stdlib.h. To avoid compilation - errors, only prototype getopt for the GNU C library. */ -extern int getopt (int argc, char *const *argv, const char *shortopts); -#else /* not __GNU_LIBRARY__ */ -extern int getopt (); -#endif /* not __GNU_LIBRARY__ */ -#endif /* we do not use getopt, here with nessus */ -#ifdef APPLY_OPTVAR_REPLACEMENTS -extern char *get_optarg (void); -extern int get_opterr (void); -extern int get_optind (void); -extern int get_optopt (void); -extern int inc_optind (void); -#endif /* APPLY_OPTVAR_REPLACEMENTS */ -extern int getopt_long (int argc, char *const *argv, const char *shortopts, - const struct option *longopts, int *longind); -extern int getopt_long_only (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind); - -/* Internal only. Users should not call this directly. */ -extern int _getopt_internal (int argc, char *const *argv, - const char *shortopts, - const struct option *longopts, int *longind, - int long_only); -#else /* not __STDC__ */ -#ifdef APPLY_OPTVAR_REPLACEMENTS -extern char *get_optarg (); -extern int get_opterr (); -extern int get_optind (); -extern int get_optopt (); -extern int inc_optind (); -#endif /* APPLY_OPTVAR_REPLACEMENTS */ -extern int getopt (); -extern int getopt_long (); -extern int getopt_long_only (); - -extern int _getopt_internal (); -#endif /* not __STDC__ */ - -#ifdef APPLY_OPTVAR_REPLACEMENTS -#define optind get_optind () -#define optarg get_optarg () -#define opterr get_opterr () -#define optopt get_optopt () -#else /* APPLY_OPTVAR_REPLACEMENTS */ -#define inc_optind() (optind ++) -#define get_optind() (optind) -#define get_optarg() (optarg) -#define get_opterr() (opterr) -#define get_optopt() (optopt) -#endif /* APPLY_OPTVAR_REPLACEMENTS */ - -#ifdef __cplusplus -} -#endif - -#endif /* _GETOPT_H */ Deleted: trunk/openvas-libraries/libopenvas/getopt1.c =================================================================== --- trunk/openvas-libraries/libopenvas/getopt1.c 2008-11-07 16:02:15 UTC (rev 1682) +++ trunk/openvas-libraries/libopenvas/getopt1.c 2008-11-10 09:42:58 UTC (rev 1683) @@ -1,192 +0,0 @@ -/* Getopt for GNU. - Copyright (C) 1987, 88, 89, 90, 91, 1992 Free Software Foundation, Inc. - -This file is part of the GNU C Library. - -The GNU C Library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public License as -published by the Free Software Foundation; either version 2 of the -License, or (at your option) any later version. - -The GNU C Library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with the GNU C Library; see the file COPYING.LIB. If -not, write to the Free Software Foundation, Inc., 675 Mass Ave, -Cambridge, MA 02139, USA. */ - -/* Modified for use with Nessus by - $Id: getopt1.c,v 1.6 2001/10/24 15:42:52 renaud Exp $ */ - - -#include "config.h" - -/***********************/ -#ifndef HAVE_GETOPT_LONG -/***********************/ - -#include "getopt.h" - -#undef optarg -#undef opterr -#undef optopt -#undef optind - -#ifndef __STDC__ -#define const -#endif - -#if defined(STDC_HEADERS) || defined(__GNU_LIBRARY__) || defined (LIBC) -#include -#else /* STDC_HEADERS or __GNU_LIBRARY__ */ -char *getenv (); -#endif /* STDC_HEADERS or __GNU_LIBRARY__ */ - -#ifndef NULL -#define NULL 0 -#endif - -#ifdef APPLY_OPTVAR_REPLACEMENTS -char *get_optarg (void) {return optarg;} -int get_opterr (void) {return opterr;} -int get_optopt (void) {return optopt;} -int get_optind (void) {return optind;} -int inc_optind (void) {return optind++;} -#endif /* APPLY_OPTVAR_REPLACEMENTS */ - -/***************************/ -#ifndef __GNU_LIBRARY__ -#endif /* disabe #ifdef */ -/***************************/ - -int -getopt_long (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 0); -} - -/* Like getopt_long, but '-' as well as '--' can indicate a long option. - If an option that starts with '-' (not '--') doesn't match a long option, - but does match a short option, it is parsed as a short option - instead. */ - -int -getopt_long_only (argc, argv, options, long_options, opt_index) - int argc; - char *const *argv; - const char *options; - const struct option *long_options; - int *opt_index; -{ - return _getopt_internal (argc, argv, options, long_options, opt_index, 1); -} -/*********************************/ -#if 0 /* disabe #endif */ -#endif /* not __GNU_LIBRARY__. */ -/*********************************/ - -#ifdef TEST - -#include - -int -main (argc, argv) - int argc; - char **argv; -{ - int c; - int digit_optind = 0; - - while (1) - { - int this_option_optind = optind ? optind : 1; - int option_index = 0; - static struct option long_options[] = - { - {"add", 1, 0, 0}, - {"append", 0, 0, 0}, - {"delete", 1, 0, 0}, - {"verbose", 0, 0, 0}, - {"create", 0, 0, 0}, - {"file", 1, 0, 0}, - {0, 0, 0, 0} - }; - - c = getopt_long (argc, argv, "abc:d:0123456789", - long_options, &option_index); - if (c == EOF) - break; - - switch (c) - { - case 0: - printf ("option %s", long_options[option_index].name); - if (optarg) - printf (" with arg %s", optarg); - printf ("\n"); - break; - - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - if (digit_optind != 0 && digit_optind != this_option_optind) - printf ("digits occur in two different argv-elements.\n"); - digit_optind = this_option_optind; - printf ("option %c\n", c); - break; - - case 'a': - printf ("option a\n"); - break; - - case 'b': - printf ("option b\n"); - break; - - case 'c': - printf ("option c with value `%s'\n", optarg); - break; - - case 'd': - printf ("option d with value `%s'\n", optarg); - break; - - case '?': - break; - - default: - printf ("?? getopt returned character code 0%o ??\n", c); - } - } - - if (optind < argc) - { - printf ("non-option ARGV-elements: "); - while (optind < argc) - printf ("%s ", argv[optind++]); - printf ("\n"); - } - - exit (0); -} - -#endif /* TEST */ - -/***************************/ -#endif /* HAVE_GETOPT_LONG */ -/***************************/ From scm-commit at wald.intevation.org Mon Nov 10 10:43:27 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Mon, 10 Nov 2008 10:43:27 +0100 (CET) Subject: [Openvas-commits] r1684 - in trunk/openvas-libnasl: . include Message-ID: <20081110094327.2606F4076D@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-10 10:43:26 +0100 (Mon, 10 Nov 2008) New Revision: 1684 Modified: trunk/openvas-libnasl/ChangeLog trunk/openvas-libnasl/include/config.h.in Log: * include/config.h.in: Removed obsolete getopt define. Modified: trunk/openvas-libnasl/ChangeLog =================================================================== --- trunk/openvas-libnasl/ChangeLog 2008-11-10 09:42:58 UTC (rev 1683) +++ trunk/openvas-libnasl/ChangeLog 2008-11-10 09:43:26 UTC (rev 1684) @@ -1,5 +1,9 @@ -2008-10-5 Felix Wolfsteller +2008-11-10 Michael Wiegand + * include/config.h.in: Removed obsolete getopt define. + +2008-10-05 Felix Wolfsteller + Further steps to an implementation of Change Request #17 (http://www.openvas.org/openvas-cr-17.html - "OTP: Make NVT signatures available to OpenVAS-Client"). Modified: trunk/openvas-libnasl/include/config.h.in =================================================================== --- trunk/openvas-libnasl/include/config.h.in 2008-11-10 09:42:58 UTC (rev 1683) +++ trunk/openvas-libnasl/include/config.h.in 2008-11-10 09:43:26 UTC (rev 1684) @@ -45,7 +45,6 @@ #undef HAVE_GETHRTIME #undef HAVE_GETRUSAGE #undef HAVE_LONG_FILE_NAMES -#undef HAVE_GETOPT_H #undef HAVE_STRING_H #undef HAVE_STRINGS_H #undef HAVE_SYS_POLL_H From scm-commit at wald.intevation.org Mon Nov 10 10:44:22 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Mon, 10 Nov 2008 10:44:22 +0100 (CET) Subject: [Openvas-commits] r1685 - in trunk/openvas-server: . doc include openvasd Message-ID: <20081110094422.8E85E4076D@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-10 10:44:21 +0100 (Mon, 10 Nov 2008) New Revision: 1685 Removed: trunk/openvas-server/doc/openvas-check-signature.1 trunk/openvas-server/openvasd/openvas-check-signature.c Modified: trunk/openvas-server/ChangeLog trunk/openvas-server/MANIFEST trunk/openvas-server/Makefile trunk/openvas-server/include/config.h.in trunk/openvas-server/openvasd/Makefile Log: Removed openvas-check-signature since signature verification can now be done with existing third-party tools like gnupg. Additionally, openvas-check-signature was the last executable to depend on the local copies of getopt which is no longer provided by openvas-libraries. * openvasd/openvas-check-signature.c: Removed. * openvasd/Makefile: Removed handling of openvas-check-signature. * include/config.h.in: Removed obsolete getopt defines. * doc/openvas-check-signature.1: Removed documentation of openvas-check-signature. * MANIFEST: Updated. * Makefile: Updated. Modified: trunk/openvas-server/ChangeLog =================================================================== --- trunk/openvas-server/ChangeLog 2008-11-10 09:43:26 UTC (rev 1684) +++ trunk/openvas-server/ChangeLog 2008-11-10 09:44:21 UTC (rev 1685) @@ -1,3 +1,23 @@ +2008-11-10 Michael Wiegand + + Removed openvas-check-signature since signature verification can now be + done with existing third-party tools like gnupg. Additionally, + openvas-check-signature was the last executable to depend on the local + copies of getopt which is no longer provided by openvas-libraries. + + * openvasd/openvas-check-signature.c: Removed. + + * openvasd/Makefile: Removed handling of openvas-check-signature. + + * include/config.h.in: Removed obsolete getopt defines. + + * doc/openvas-check-signature.1: Removed documentation of + openvas-check-signature. + + * MANIFEST: Updated. + + * Makefile: Updated. + 2008-11-07 Felix Wolfsteller * openvasd/nasl_plugins: Removed printfs. Modified: trunk/openvas-server/MANIFEST =================================================================== --- trunk/openvas-server/MANIFEST 2008-11-10 09:43:26 UTC (rev 1684) +++ trunk/openvas-server/MANIFEST 2008-11-10 09:44:21 UTC (rev 1685) @@ -11,7 +11,6 @@ doc/nbe_file_format.txt doc/nsr_file_format.txt doc/openvas-adduser.8 -doc/openvas-check-signature.1 doc/openvasd.8.in doc/openvas-mkcert.8 doc/openvas-mkcert-client.1 @@ -55,7 +54,6 @@ openvasd/nes_plugins.c openvasd/ntp_11.c openvasd/ntp_11.h -openvasd/openvas-check-signature.c openvasd/openvasd.c openvasd/otp_1_0.c openvasd/otp_1_0.h Modified: trunk/openvas-server/Makefile =================================================================== --- trunk/openvas-server/Makefile 2008-11-10 09:43:26 UTC (rev 1684) +++ trunk/openvas-server/Makefile 2008-11-10 09:44:21 UTC (rev 1685) @@ -72,7 +72,6 @@ $(INSTALL) -m 755 openvasd-config $(DESTDIR)${bindir}/openvasd-config $(INSTALL) -m 755 ssl/openvas-mkrand $(DESTDIR)${bindir}/openvas-mkrand $(INSTALL) -m $(SERVERMODE) openvasd/openvasd $(DESTDIR)${sbindir}/openvasd - $(INSTALL) -m $(SERVERMODE) openvasd/openvas-check-signature $(DESTDIR)${sbindir}/openvas-check-signature $(INSTALL) -m 755 openvas-adduser $(DESTDIR)${sbindir}/openvas-adduser $(INSTALL) -m 755 openvas-rmuser $(DESTDIR)${sbindir}/openvas-rmuser $(INSTALL) -m 755 openvas-mkcert $(DESTDIR)${sbindir}/openvas-mkcert @@ -93,7 +92,6 @@ @test -d $(DESTDIR)${mandir}/man1 || $(INSTALL_DIR) -m 755 $(DESTDIR)${mandir}/man1 @test -d $(DESTDIR)${mandir}/man8 || $(INSTALL_DIR) -m 755 $(DESTDIR)${mandir}/man8 $(INSTALL) -c -m 0444 doc/openvasd-config.1 $(DESTDIR)${mandir}/man1/openvasd-config.1 - $(INSTALL) -c -m 0444 doc/openvas-check-signature.1 $(DESTDIR)${mandir}/man1/openvas-check-signature.1 $(INSTALL) -c -m 0444 doc/openvas-mkrand.1 $(DESTDIR)${mandir}/man1/openvas-mkrand.1 $(INSTALL) -c -m 0444 doc/openvasd.8 $(DESTDIR)${mandir}/man8/openvasd.8 $(INSTALL) -c -m 0444 doc/openvas-adduser.8 $(DESTDIR)${mandir}/man8/openvas-adduser.8 Deleted: trunk/openvas-server/doc/openvas-check-signature.1 =================================================================== --- trunk/openvas-server/doc/openvas-check-signature.1 2008-11-10 09:43:26 UTC (rev 1684) +++ trunk/openvas-server/doc/openvas-check-signature.1 2008-11-10 09:44:21 UTC (rev 1685) @@ -1,64 +0,0 @@ -.TH OpenVAS 1 "February 2005" "The OpenVAS Project" "Users Manuals" -.SH NAME -openvas-check-signature \- A simple utility to check (or generate) the signature of plugins retrieved from www.openvas.org -.SH SYNOPSIS -.B openvas-check-signature [-S] filename [signaturefile] -.P - -.SH DESCRIPTION -.B openvas-check-signature -is a simple utility used by -.B openvas-update-plugins -to check the signatures of the OpenVAS plugins downloaded from -www.openvas.org. When executed and provided both an archive and a -signaturefile it will verify if the file matches the signature -and if the signature matches the -.B openvas_org.pem -certificate. - -It can also generate the signatures for the plugins distributed by -www.openvas.org but you will, obviously, need the private certificate -file to do so. You can, however, customise the code to use an -alternate certificate file and generate plugins distributions files for -third party servers. - - -.SH OPTIONS -.TP -.BI -S -Sign the archive instead of checking the signature. -.B openvas-check-signature -will check for the private certificate key -.B openvas_org.priv.pem -and will generate a \fB.sig\fR file with the file signature. - -.SH EXAMPLE -To check the signature for all the plugins downloaded from the OpenVAS -servers use: - -.B openvas-check-signature all-2.0.tar.gz all-2.0.sig - -.SH EXIT VALUES -.B openvas-check-signature -will return with a 0 value if the signature matches and will return -with an error value (1) if the signature does not match or if any -other error is found. - -.SH "SEE ALSO" -.BR openvas-update-plugins (1), openvas-fetch (1) - -.SH MORE INFORMATION ABOUT THE OpenVAS PROJECT -The canonical place where you will find more information -about the OpenVAS project is : - -.RS -.UR -http://www.openvas.org/ -.UE - -.SH AUTHORS -openvas-check-signature is (C) 2004 Tenable Network Security -.PP -This manpage was written by Javier Fernandez-Sanguino for the Debian -distribution, and is distributed under the GPL. - Modified: trunk/openvas-server/include/config.h.in =================================================================== --- trunk/openvas-server/include/config.h.in 2008-11-10 09:43:26 UTC (rev 1684) +++ trunk/openvas-server/include/config.h.in 2008-11-10 09:44:21 UTC (rev 1685) @@ -192,7 +192,6 @@ #undef HAVE_GETHRTIME #undef HAVE_GETRUSAGE #undef HAVE_LONG_FILE_NAMES -#undef HAVE_GETOPT_H #undef HAVE_STRING_H #undef HAVE_STRINGS_H #undef HAVE_SYS_POLL_H Modified: trunk/openvas-server/openvasd/Makefile =================================================================== --- trunk/openvas-server/openvasd/Makefile 2008-11-10 09:43:26 UTC (rev 1684) +++ trunk/openvas-server/openvasd/Makefile 2008-11-10 09:44:21 UTC (rev 1685) @@ -36,17 +36,11 @@ pluginscheduler.o \ shared_socket.o -all : openvasd openvas-check-signature +all : openvasd openvasd : $(OBJS) $(CC) $(LDFLAGS) $(OPENVAS_INCLUDE) $(OBJS) -o openvasd $(LIBS) -openvas-check-signature : openvas-check-signature.o - $(CC) $(LDFLAGS) $(OPENVAS_INCLUDE) openvas-check-signature.o -o openvas-check-signature $(LIBS) - -openvas-check-signature.o: openvas-check-signature.c - $(CC) $(OPENVAS_CFLAGS) $(OPENVAS_INCLUDE) -c openvas-check-signature.c - users.o : users.c users.h $(CC) $(OPENVAS_CFLAGS) $(OPENVAS_INCLUDE) -c users.c @@ -136,5 +130,5 @@ shared_socket.o : shared_socket.c $(CC) $(OPENVAS_CFLAGS) $(OPENVAS_INCLUDE) -c shared_socket.c clean : - rm -f *.o openvasd openvas-check-signature *~ + rm -f openvasd *.o *~ Deleted: trunk/openvas-server/openvasd/openvas-check-signature.c =================================================================== --- trunk/openvas-server/openvasd/openvas-check-signature.c 2008-11-10 09:43:26 UTC (rev 1684) +++ trunk/openvas-server/openvasd/openvas-check-signature.c 2008-11-10 09:44:21 UTC (rev 1685) @@ -1,375 +0,0 @@ -/* OpenVAS -* $Id$ -* Description: generates/checks a signature for a given file. -* -* Authors: - Renaud Deraison (Original pre-fork develoment) -* - Tim Brown (Initial fork) -* - Laban Mwangi (Renaming work) -* - Tarik El-Yassem (Headers section) -* -* Copyright: -* Portions Copyright (C) 2006 Software in the Public Interest, Inc. -* Based on work Copyright (C) 1998 - 2006 Tenable Network Security, Inc. -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License version 2, -* as published by the Free Software Foundation -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. -* -* -*/ - -/* FIXME: The code here is mostly a duplicate of code in - * openvas-libnasl/nasl/nasl_crypto2.c. The main difference is that the - * signatures dealt with here are detached, whereas the signatures - * handled by nasl_crypto2.c are part of the signed file. - * - * Also, the original OpenSSL code in this file was probably better at - * handling larger files. The new code read the file to sign or verify - * completely into memory which may be inefficient for large files. - * - * Before something is done about it, OpenVAS needs to decide how to - * deal with signed files in general. - */ - -#include -#include -#include - - -void -print_tls_error(char *txt, int err) -{ - fprintf(stderr, "%s: %s (%d)\n", txt, gnutls_strerror(err), err); -} - -gnutls_datum_t -map_file(const char * filename) -{ - FILE *f; - gnutls_datum loaded_file = { NULL, 0 }; - long filelen; - void *ptr; - - if (!(f = fopen(filename, "r")) - || fseek(f, 0, SEEK_END) != 0 - || (filelen = ftell(f)) < 0 - || fseek(f, 0, SEEK_SET) != 0 - || !(ptr = emalloc((size_t) filelen)) - || fread(ptr, 1, (size_t) filelen, f) < (size_t) filelen) - { - return loaded_file; - } - - loaded_file.data = ptr; - loaded_file.size = (unsigned int) filelen; - return loaded_file; -} - -static ptrdiff_t -hexdecode(unsigned char *binary, const unsigned char *hex, size_t fromlen) -{ - char temp[3] = {0, 0, 0}; - unsigned char * to = binary; - const unsigned char * from = hex; - - while ((from - hex) < fromlen - 1) - { - temp[0] = from[0]; - temp[1] = from[1]; - *to = strtoul(temp, NULL, 16); - to += 1; - from += 2; - } - - return to - binary; -} - - -/* - * Signs a given file - */ -static int -generate_signature(char * keyfilename, char * filename) -{ - int result = -1; - int i; - int be_len; - gnutls_datum_t pem = {NULL, 0}; - gnutls_datum_t script = {NULL, 0}; - gnutls_x509_privkey_t privkey = NULL; - unsigned char* signature = NULL; - size_t signature_size = 0; - int err; - - err = gnutls_x509_privkey_init(&privkey); - if (err) - { - print_tls_error("gnutls_x509_privkey_init", err); - goto fail; - } - - pem = map_file(keyfilename); - if (!pem.data) - goto fail; - - err = gnutls_x509_privkey_import(privkey, &pem, GNUTLS_X509_FMT_PEM); - if (err) - { - print_tls_error("gnutls_x509_privkey_import", err); - goto fail; - } - - script = map_file(filename); - if (!script.data) - { - goto fail; - } - - /* append the size of the file at the end of the script */ - script.data = erealloc(script.data, script.size + sizeof(be_len)); - be_len = htonl(script.size); - memcpy(script.data + script.size, &be_len, sizeof(be_len)); - script.size += sizeof(be_len); - - /* call gnutls_x509_privkey_sign_data twice: once to determine the - * size of the signature and then again to actually create the - * signature */ - err = gnutls_x509_privkey_sign_data(privkey, GNUTLS_DIG_SHA1, 0, &script, - signature, &signature_size); - if (err != GNUTLS_E_SHORT_MEMORY_BUFFER) - { - print_tls_error("gnutls_x509_privkey_sign_data", err); - goto fail; - } - - signature = emalloc(signature_size); - err = gnutls_x509_privkey_sign_data(privkey, GNUTLS_DIG_SHA1, 0, &script, - signature, &signature_size); - if (err) - { - print_tls_error("gnutls_x509_privkey_sign_data", err); - goto fail; - } - - /* print the signature to stdout in hexadecimal */ - for (i = 0; i < signature_size; i++) - { - printf("%.2x", signature[i]); - } - printf("\n"); - - result = 0; - - fail: - efree(&pem.data); - efree(&script.data); - efree(&signature); - gnutls_x509_privkey_deinit(privkey); - - return result; -} - - -/* - * Verify an archive signature - * - * Returns : - * -1 : if an error occured - * 0 : if the signature matches - * 1 : if the signature does NOT match - */ -static int -verify_signature(char * certfilename, char * filename, char * sigfilename) -{ - int be_len; - gnutls_x509_crt_t cert = NULL; - gnutls_datum_t pem = {NULL, 0}; - gnutls_datum_t script = {NULL, 0}; - gnutls_datum_t signature = {NULL, 0}; - int result = -1; - int err; - - pem = map_file(certfilename); - if (!pem.data) - goto fail; - - err = gnutls_x509_crt_init(&cert); - if (err) - { - print_tls_error("gnutls_x509_crt_init", err); - goto fail; - } - - err = gnutls_x509_crt_import(cert, &pem, GNUTLS_X509_FMT_PEM); - if (err) - { - print_tls_error("gnutls_x509_crt_import", err); - goto fail; - } - - script = map_file(filename); - if (!script.data) - { - goto fail; - } - - /* Make room for the size of the file at the end of the script and - * append the size */ - script.data = erealloc(script.data, script.size + sizeof(be_len)); - be_len = htonl(script.size); - memcpy(script.data + script.size, &be_len, sizeof(be_len)); - script.size += sizeof(be_len); - - /* read and decode the hex signature. Decoding can be done in place - * because the binary signature is always shorter than its hexadecimal - * representation. */ - signature = map_file(sigfilename); - if (!signature.data) - { - goto fail; - } - signature.size = hexdecode(signature.data, signature.data, signature.size); - - err = gnutls_x509_crt_verify_data(cert, 0, &script, &signature); - if (err < 0) - { - print_tls_error("gnutls_x509_crt_verify_data", err); - goto fail; - } - - result = err == 1 ? 0 : 1; - - fail: - gnutls_x509_crt_deinit(cert); - efree(&script.data); - efree(&signature.data); - efree(&pem); - - return result; - -} - - -int -main(int argc, char ** argv) -{ - int do_sign = 0; - int do_print_usage = 0; - char * keyfile = NULL; - char * certfile = NULL; - int opt; - int option_index = 0; - struct option long_options[] = - { - {"help", no_argument, 0, 'h'}, - {"certificate", required_argument, 0, 'c'}, - {"key", required_argument, 0, 'k'}, - {"sign", no_argument, 0, 's'}, - {0, 0, 0, 0} - }; - - while ((opt = getopt_long(argc, argv, "c:hk:s", long_options, &option_index)) - != -1) - { - switch (opt) - { - case 'c': - certfile = optarg; - break; - - case 'h': - do_print_usage = 1; - break; - - case 'k': - keyfile = optarg; - break; - - case 's': - do_sign = 1; - break; - - case '?': - fprintf(stderr, "unknown option or missing" - " parameter for option '%c'\n", opt); - return 1; - - default: - fprintf(stderr, "option '%c' not implemented\n", opt); - return 1; - } - } - - if (do_print_usage) - { - fprintf(stderr, - "Usage: openvas-check-signature [options]" - " filename [signaturefile]\n"); - fprintf(stderr, "Options:\n"); - fprintf(stderr, " -h Print this help message\n"); - fprintf(stderr, " -k keyfile File with private key for signature\n"); - fprintf(stderr, " -c certfile File with certificate for signature" - " verificationi\n"); - return 0; - } - - nessus_SSL_init(NULL); - - if (do_sign) - { - if (!keyfile) - { - fprintf(stderr, "Missing parameter -k required for" - " signature generation\n"); - return 1; - } - if (optind >= argc) - { - fprintf(stderr, "missing filename parameter\n"); - return 1; - } - - generate_signature(keyfile, argv[optind]); - } - else - { - if (!certfile) - { - fprintf(stderr, "Missing parameter -c required for" - " signature verification\n"); - return 1; - } - - if (optind + 1 >= argc) - { - fprintf(stderr, "for signature verification, a filename and the" - " signature filename must be given\n"); - return 1; - } - else - { - char * filename = argv[optind]; - char * signaturefile = argv[optind + 1]; - - if (verify_signature(certfile, filename, signaturefile) == 0) - return 0; - else - { - fprintf(stderr, "%s is not the valid signature for %s\n", - signaturefile, filename); - return 1; - } - } - } - - return 0; -} From scm-commit at wald.intevation.org Mon Nov 10 12:01:57 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Mon, 10 Nov 2008 12:01:57 +0100 (CET) Subject: [Openvas-commits] r1686 - trunk/openvas-server Message-ID: <20081110110157.2E46D40763@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-10 12:01:57 +0100 (Mon, 10 Nov 2008) New Revision: 1686 Modified: trunk/openvas-server/ChangeLog trunk/openvas-server/configure trunk/openvas-server/configure.in Log: * configure.in: Include version requirements in glib error string as pointed out by Jon Bebeau. * configure: Regenerated. Modified: trunk/openvas-server/ChangeLog =================================================================== --- trunk/openvas-server/ChangeLog 2008-11-10 09:44:21 UTC (rev 1685) +++ trunk/openvas-server/ChangeLog 2008-11-10 11:01:57 UTC (rev 1686) @@ -1,5 +1,12 @@ 2008-11-10 Michael Wiegand + * configure.in: Include version requirements in glib error string as + pointed out by Jon Bebeau. + + * configure: Regenerated. + +2008-11-10 Michael Wiegand + Removed openvas-check-signature since signature verification can now be done with existing third-party tools like gnupg. Additionally, openvas-check-signature was the last executable to depend on the local Modified: trunk/openvas-server/configure =================================================================== --- trunk/openvas-server/configure 2008-11-10 09:44:21 UTC (rev 1685) +++ trunk/openvas-server/configure 2008-11-10 11:01:57 UTC (rev 1686) @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 1213 . +# From configure.in Revision: 1661 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # @@ -1764,8 +1764,8 @@ -NEED_OPENVASLIBS_VERSION=1.0.2 -NEED_OPENVASLIBNASL_VERSION=1.0.1 +NEED_OPENVASLIBS_VERSION=2.0.0 +NEED_OPENVASLIBNASL_VERSION=2.0.0 save_IFS="${IFS}" IFS=. @@ -3268,8 +3268,8 @@ if test $succeeded = yes; then HAVE_GLIB="yes" else - { { echo "$as_me:$LINENO: error: \"glib not found\"" >&5 -echo "$as_me: error: \"glib not found\"" >&2;} + { { echo "$as_me:$LINENO: error: \"glib >= 2.2.0 not found\"" >&5 +echo "$as_me: error: \"glib >= 2.2.0 not found\"" >&2;} { (exit 1); exit 1; }; } fi Modified: trunk/openvas-server/configure.in =================================================================== --- trunk/openvas-server/configure.in 2008-11-10 09:44:21 UTC (rev 1685) +++ trunk/openvas-server/configure.in 2008-11-10 11:01:57 UTC (rev 1686) @@ -199,7 +199,7 @@ fi dnl GLIB needs to be quoted in the next line otherwise m4 tries to expand it# -PKG_CHECK_MODULES([GLIB], glib-2.0 >= 2.2.0, HAVE_GLIB="yes", AC_MSG_ERROR("glib not found")) +PKG_CHECK_MODULES([GLIB], glib-2.0 >= 2.2.0, HAVE_GLIB="yes", AC_MSG_ERROR("glib >= 2.2.0 not found")) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) From scm-commit at wald.intevation.org Mon Nov 10 12:58:02 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Mon, 10 Nov 2008 12:58:02 +0100 (CET) Subject: [Openvas-commits] r1688 - in trunk/openvas-client: . include libnessus nessus nessus/prefs_dialog Message-ID: <20081110115802.2CB4940766@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-10 12:58:01 +0100 (Mon, 10 Nov 2008) New Revision: 1688 Modified: trunk/openvas-client/ChangeLog trunk/openvas-client/include/harglists.h trunk/openvas-client/libnessus/Makefile trunk/openvas-client/libnessus/arglists.c trunk/openvas-client/libnessus/harglists.c trunk/openvas-client/libnessus/network.c trunk/openvas-client/nessus/cli.c trunk/openvas-client/nessus/comm.c trunk/openvas-client/nessus/context.c trunk/openvas-client/nessus/monitor_dialog.c trunk/openvas-client/nessus/plugin_infos.c trunk/openvas-client/nessus/preferences.c trunk/openvas-client/nessus/preferences.h trunk/openvas-client/nessus/prefs_dialog/prefs_context.c trunk/openvas-client/nessus/prefs_dialog/prefs_dialog.c trunk/openvas-client/nessus/prefs_dialog/prefs_dialog_auth.c trunk/openvas-client/nessus/prefs_dialog/prefs_kb.c trunk/openvas-client/nessus/prefs_dialog/prefs_report.c trunk/openvas-client/nessus/prefs_dialog/prefs_scope_tree.c trunk/openvas-client/nessus/report_save.c trunk/openvas-client/nessus/sslui.c Log: Patch provided by Stjepan Gros to improve 64-bit cleanliness. * nessus/preferences.c, nessus/preferences.h, nessus/plugin_infos.c, nessus/prefs_dialog/prefs_dialog.c, nessus/prefs_dialog/prefs_dialog_auth.c, nessus/prefs_dialog/prefs_context.c, nessus/prefs_dialog/prefs_report.c, nessus/prefs_dialog/prefs_scope_tree.c, nessus/prefs_dialog/prefs_kb.c, nessus/sslui.c, nessus/monitor_dialog.c, nessus/cli.c, nessus/report_save.c, nessus/context.c, nessus/comm.c, include/harglists.h, libnessus/harglists.c, libnessus/arglists.c, libnessus/network.c: 64/32-bit cleanups, minor reformatting. * libnessus/harglists.c, libnessus/arglists.c, libnessus/network.c, libnessus/Makefile:: added glib header Modified: trunk/openvas-client/ChangeLog =================================================================== --- trunk/openvas-client/ChangeLog 2008-11-10 11:07:20 UTC (rev 1687) +++ trunk/openvas-client/ChangeLog 2008-11-10 11:58:01 UTC (rev 1688) @@ -1,3 +1,22 @@ +2008-11-10 Michael Wiegand + + Patch provided by Stjepan Gros to improve + 64-bit cleanliness. + + * nessus/preferences.c, nessus/preferences.h, nessus/plugin_infos.c, + nessus/prefs_dialog/prefs_dialog.c, + nessus/prefs_dialog/prefs_dialog_auth.c, + nessus/prefs_dialog/prefs_context.c, + nessus/prefs_dialog/prefs_report.c, + nessus/prefs_dialog/prefs_scope_tree.c, nessus/prefs_dialog/prefs_kb.c, + nessus/sslui.c, nessus/monitor_dialog.c, nessus/cli.c, + nessus/report_save.c, nessus/context.c, nessus/comm.c, + include/harglists.h, libnessus/harglists.c, libnessus/arglists.c, + libnessus/network.c: 64/32-bit cleanups, minor reformatting. + + * libnessus/harglists.c, libnessus/arglists.c, + libnessus/network.c, libnessus/Makefile:: added glib header + 2008-11-07 Felix Wolfsteller * nessus/comm.c (comm_parse_certificate): (New) method stub. Modified: trunk/openvas-client/include/harglists.h =================================================================== --- trunk/openvas-client/include/harglists.h 2008-11-10 11:07:20 UTC (rev 1687) +++ trunk/openvas-client/include/harglists.h 2008-11-10 11:58:01 UTC (rev 1688) @@ -1189,7 +1189,7 @@ #define harg_set_ptr( d,k, q) harg_set_valuet ((d), (k),HARG_PTR, 0, (q)) #define harg_set_harg( d,k, t) harg_set_valuet ((d), (k),HARG_HARGLST, 0, (t)) #define harg_set_blob( d,k,l,q) harg_set_valuet ((d), (k),HARG_BLOB, (l), (q)) -#define harg_set_int( d,k, n) harg_set_valuet ((d), (k),HARG_INT, 0, (void*)(n)) +#define harg_set_int( d,k, n) harg_set_valuet ((d), (k),HARG_INT, 0, GSIZE_TO_POINTER(n)) #define harg_set_pstring( d,p, s) harg_set_valuet ((d),(hargkey_t*)&(p),HARG_PSTRING, 0, (s)) #define harg_set_pnstring( d,p,n,s) harg_set_valuet ((d),(hargkey_t*)&(p),HARG_PSTRING, (n), (s)) @@ -1230,7 +1230,8 @@ #define harg_get_ptr( d,k) ((void*)harg_get_valuet ((d), (k),HARG_PTR)) #define harg_get_harg( d,k) ((harglst*)harg_get_valuet ((d), (k),HARG_HARGLST)) #define harg_get_blob( d,k) ((void*)harg_get_valuet ((d), (k),HARG_BLOB)) -#define harg_get_int( d,k) ((int)harg_get_valuet ((d), (k),HARG_INT)) +#define harg_get_int( d,k) \ + (GPOINTER_TO_SIZE(harg_get_valuet ((d), (k),HARG_INT))) #define harg_get_any( d,k) harg_get_valuet ((d), (k),HARG_ANY) #define harg_get( d,k) harg_get_any (d,k) Modified: trunk/openvas-client/libnessus/Makefile =================================================================== --- trunk/openvas-client/libnessus/Makefile 2008-11-10 11:07:20 UTC (rev 1687) +++ trunk/openvas-client/libnessus/Makefile 2008-11-10 11:58:01 UTC (rev 1688) @@ -5,7 +5,8 @@ # += does not work with non-GNU make ... # CFLAGS+=-I../$(CIPHER_SUBDIR) -CFLAGS+=-g $(NESSUS_CFLAGS) +CFLAGS+=-g $(NESSUS_CFLAGS) $(GLIB_CFLAGS) +LIBS+=$(GLIB_LIBS) INCLUDE = ${include} CIPHER = -I../$(CIPHER_SUBDIR) Modified: trunk/openvas-client/libnessus/arglists.c =================================================================== --- trunk/openvas-client/libnessus/arglists.c 2008-11-10 11:07:20 UTC (rev 1687) +++ trunk/openvas-client/libnessus/arglists.c 2008-11-10 11:58:01 UTC (rev 1688) @@ -21,6 +21,8 @@ #define EXPORTING #include +#include + /* * We use a hash of the argument name to speed up the lookups * when calling arg_get_value() @@ -422,24 +424,24 @@ case ARG_STRING : fprintf(stderr, "%sargs->%s : %s\n",spaces+(20-level), - args->name, - (char *)args->value); + args->name, + (char *)args->value); break; case ARG_ARGLIST : fprintf(stderr, "%sargs->%s :\n", spaces+(20-level), - args->name); - arg_dump(args->value, level+1); + args->name); + arg_dump(args->value, level+1); break; case ARG_INT : fprintf(stderr, "%sargs->%s : %d\n",spaces+(20-level), - args->name, - (int)args->value); + args->name, + (int)GPOINTER_TO_SIZE(args->value)); break; default : fprintf(stderr, "%sargs->%s : %d\n",spaces+(20-level), - args->name, - (int)args->value); + args->name, + (int)GPOINTER_TO_SIZE(args->value)); break; } args = args->next; Modified: trunk/openvas-client/libnessus/harglists.c =================================================================== --- trunk/openvas-client/libnessus/harglists.c 2008-11-10 11:07:20 UTC (rev 1687) +++ trunk/openvas-client/libnessus/harglists.c 2008-11-10 11:58:01 UTC (rev 1688) @@ -24,6 +24,8 @@ * of the hash list manager */ +#include + #define __HARG_INTERNAL__ #ifdef HAVE_CONFIG_H #include "config.h" @@ -490,7 +492,7 @@ if (R != 0) { char *s = query_key_hlst ((void**)R) ; if (ptype) - fprintf (stderr, "<0x%04X/%d> = ", (void*)s,(int)(s)); + fprintf (stderr, "<%p/%d> = ", s, (int)GPOINTER_TO_SIZE(s)); else fprintf (stderr, "<%s> = ", s); } else { @@ -933,9 +935,9 @@ if (inc_op_creates_record (incop)) { if (R == 0 && (R = (harg**)make_hlst (a->x, key, klen)) == 0) return -1; - *R = create_harg (type, (void*)inc, sizeof (int)); + *R = create_harg (type, GSIZE_TO_POINTER(inc), sizeof (gpointer)); errno = 0; - return (int)(*R)->d.d.ptr [0]; + return GPOINTER_TO_SIZE((*R)->d.d.ptr [0]); } errno = ENOENT; return -1; @@ -953,26 +955,26 @@ errno = EEXIST; return -1; } - r->d.d.ptr [0] = (void*)((int)(r->d.d.ptr [0]) + inc) ; - return (int)r->d.d.ptr [0]; + r->d.d.ptr [0] = GSIZE_TO_POINTER(GPOINTER_TO_SIZE(r->d.d.ptr [0]) + inc) ; + return GPOINTER_TO_SIZE(r->d.d.ptr [0]); } /* decrement */ - if (inc_op_notnegtv_record (incop) && (int)r->d.d.ptr [0] < inc) { + if (inc_op_notnegtv_record (incop) && (GPOINTER_TO_SIZE(r->d.d.ptr [0]) < inc)) { errno = ERANGE; return -1; } - if (inc_op_notpostv_record (incop) && (int)r->d.d.ptr [0] > inc) { + if (inc_op_notpostv_record (incop) && (GPOINTER_TO_SIZE(r->d.d.ptr [0]) > inc)) { errno = ERANGE; return -1; } - if (inc_op_destroy0_record (incop) && (int)r->d.d.ptr [0] <= inc) { + if (inc_op_destroy0_record (incop) && (GPOINTER_TO_SIZE(r->d.d.ptr [0]) <= inc)) { delete_hlst (a->x, key, klen); return errno = 0; } - r->d.d.ptr [0] = (void*)((int)(r->d.d.ptr [0]) - inc) ; + r->d.d.ptr [0] = GSIZE_TO_POINTER(GPOINTER_TO_SIZE(r->d.d.ptr [0]) - inc) ; errno = 0 ; - return (int)r->d.d.ptr [0]; + return GPOINTER_TO_SIZE(r->d.d.ptr [0]); } void harg_sort(harglst *a) { Modified: trunk/openvas-client/libnessus/network.c =================================================================== --- trunk/openvas-client/libnessus/network.c 2008-11-10 11:07:20 UTC (rev 1687) +++ trunk/openvas-client/libnessus/network.c 2008-11-10 11:58:01 UTC (rev 1688) @@ -20,8 +20,12 @@ */ #define EXPORTING + #include #include + +#include + #include "libnessus.h" #include "network.h" #include "resolve.h" @@ -1209,8 +1213,8 @@ ExtFunc void auth_send(struct arglist * globals, char * data) { - int soc = (int)arg_get_value(globals, "global_socket"); - int confirm = (int)arg_get_value(globals, "confirm"); + int soc = GPOINTER_TO_SIZE(arg_get_value(globals, "global_socket")); + int confirm = GPOINTER_TO_SIZE(arg_get_value(globals, "confirm")); int n = 0; int length; int sent = 0; @@ -1272,7 +1276,7 @@ char * buf; size_t bufsiz; { - int soc = (int)arg_get_value(globals, "global_socket"); + int soc = GPOINTER_TO_SIZE(arg_get_value(globals, "global_socket")); int n; /* bzero(buf, bufsiz); */ n = recv_line(soc, buf, bufsiz); Modified: trunk/openvas-client/nessus/cli.c =================================================================== --- trunk/openvas-client/nessus/cli.c 2008-11-10 11:07:20 UTC (rev 1687) +++ trunk/openvas-client/nessus/cli.c 2008-11-10 11:58:01 UTC (rev 1688) @@ -384,7 +384,7 @@ if(!cli->backend_output_func) cli->output(backend_convert(cli->backend), cli->results); else - cli->output((struct arglist*)cli->backend, cli->results); + cli->output((struct arglist*)GSIZE_TO_POINTER(cli->backend), cli->results); } @@ -631,7 +631,7 @@ switch(p->type) { case ARG_INT : - printf("%s = %d\n", p->name, (int)p->value); + printf("%s = %d\n", p->name, (int)GPOINTER_TO_SIZE(p->value)); break; case ARG_STRING: printf("%s = %s\n", p->name, (char*)p->value); Modified: trunk/openvas-client/nessus/comm.c =================================================================== --- trunk/openvas-client/nessus/comm.c 2008-11-10 11:07:20 UTC (rev 1687) +++ trunk/openvas-client/nessus/comm.c 2008-11-10 11:58:01 UTC (rev 1688) @@ -459,7 +459,7 @@ if (arg_get_type(plugs_prefs, fullname) == ARG_INT) { - int d = (int)arg_get_value(plugs_prefs, fullname); + int d = GPOINTER_TO_SIZE(arg_get_value(plugs_prefs, fullname)); if (d == 0) value = "no"; else value = "yes"; } Modified: trunk/openvas-client/nessus/context.c =================================================================== --- trunk/openvas-client/nessus/context.c 2008-11-10 11:07:20 UTC (rev 1687) +++ trunk/openvas-client/nessus/context.c 2008-11-10 11:58:01 UTC (rev 1688) @@ -171,7 +171,7 @@ plugin->next = plugins; if (!in_pluginset) - arg_add_value(pluginset, oid, ARG_INT, sizeof(int), (void *)enabled); + arg_add_value(pluginset, oid, ARG_INT, sizeof(gpointer), GSIZE_TO_POINTER(enabled)); if (is_scanner) context->scanners = plugin; Modified: trunk/openvas-client/nessus/monitor_dialog.c =================================================================== --- trunk/openvas-client/nessus/monitor_dialog.c 2008-11-10 11:07:20 UTC (rev 1687) +++ trunk/openvas-client/nessus/monitor_dialog.c 2008-11-10 11:58:01 UTC (rev 1688) @@ -191,7 +191,7 @@ if( backend < 0 ) return; - arg_add_value(ctrls, "MONITOR_BACKEND", ARG_INT, -1, (void*)backend); + arg_add_value(ctrls, "MONITOR_BACKEND", ARG_INT, -1, GSIZE_TO_POINTER(backend)); arg_add_value(ctrls, "PARENT", ARG_PTR, -1, parent); arg_add_value(ctrls, "CONTEXT", ARG_PTR, -1, context); context->action = CONTEXT_SCANNING; @@ -304,7 +304,7 @@ tag = gtk_idle_add((GtkFunction)idle_socket, ctrls); - arg_add_value(ctrls, "TAG", ARG_INT, sizeof(int), (void*)tag); + arg_add_value(ctrls, "TAG", ARG_INT, sizeof(gpointer), GSIZE_TO_POINTER(tag)); w = gtk_button_new_with_label(_("Stop the whole test")); g_signal_connect(GTK_OBJECT(w), "clicked", (GtkSignalFunc)monitor_stop_whole_test,ctrls); @@ -681,7 +681,7 @@ context = arg_get_value(ctrls, "CONTEXT"); network_printf(context->socket, "CLIENT <|> STOP_WHOLE_TEST <|> CLIENT\n"); - gtk_idle_remove((int)arg_get_value(ctrls, "TAG")); + gtk_idle_remove(GPOINTER_TO_SIZE(arg_get_value(ctrls, "TAG"))); /* * Read the data remaining... @@ -695,14 +695,14 @@ } if ((n = strlen (buf)) && buf [n-1] == '\n') buf [n-1] = '\0'; msg = emalloc(strlen(buf)+1); - type = parse_server_message(context, buf, (int)arg_get_value(ctrls, "MONITOR_BACKEND"), msg); + type = parse_server_message(context, buf, GPOINTER_TO_SIZE(arg_get_value(ctrls, "MONITOR_BACKEND")), msg); efree(&msg); } context->action = CONTEXT_IDLE; prefs_context_update(context); gtk_widget_hide(arg_get_value(ctrls, "WINDOW")); - report_save(context, (int)arg_get_value(ctrls, "MONITOR_BACKEND"), NULL); + report_save(context, GPOINTER_TO_SIZE(arg_get_value(ctrls, "MONITOR_BACKEND")), NULL); return(FALSE); } @@ -745,7 +745,7 @@ else return; } - type = parse_server_message(context, buf, (int)arg_get_value(ctrls, "MONITOR_BACKEND"), msg); + type = parse_server_message(context, buf, GPOINTER_TO_SIZE(arg_get_value(ctrls, "MONITOR_BACKEND")), msg); switch(type) { @@ -770,9 +770,9 @@ { scan_finished : gtk_widget_hide(arg_get_value(ctrls, "WINDOW")); - gtk_idle_remove((int)arg_get_value(ctrls, "TAG")); + gtk_idle_remove(GPOINTER_TO_SIZE(arg_get_value(ctrls, "TAG"))); gtk_widget_destroy(arg_get_value(ctrls, "WINDOW")); - report_save(context, (int)arg_get_value(ctrls, "MONITOR_BACKEND"), NULL); + report_save(context, GPOINTER_TO_SIZE(arg_get_value(ctrls, "MONITOR_BACKEND")), NULL); context->action = CONTEXT_IDLE; prefs_context_update(context); } Modified: trunk/openvas-client/nessus/plugin_infos.c =================================================================== --- trunk/openvas-client/nessus/plugin_infos.c 2008-11-10 11:07:20 UTC (rev 1687) +++ trunk/openvas-client/nessus/plugin_infos.c 2008-11-10 11:58:01 UTC (rev 1688) @@ -142,7 +142,7 @@ char * pref; int type; - id = (int)arg_get_value(ctrls, "OID"); + id = GPOINTER_TO_SIZE(arg_get_value(ctrls, "OID")); to = (char*)gtk_entry_get_text(GTK_ENTRY(w)); pref = emalloc(40); Modified: trunk/openvas-client/nessus/preferences.c =================================================================== --- trunk/openvas-client/nessus/preferences.c 2008-11-10 11:07:20 UTC (rev 1687) +++ trunk/openvas-client/nessus/preferences.c 2008-11-10 11:58:01 UTC (rev 1688) @@ -346,7 +346,7 @@ if(!strcmp(opt, "paranoia_level") || !strcmp(opt, "nessusd_port") || !strcmp(opt, "sort_order") || !strcmp(opt, "protocol_version")) { - arg_add(arglist, opt, ARG_INT, sizeof(int), (void *)atoi(t)); + arg_add(arglist, opt, ARG_INT, sizeof(gpointer), GSIZE_TO_POINTER(atoi(t))); } else { @@ -358,7 +358,7 @@ arg_add(arglist, opt, ARG_STRING, strlen(value), value); } else - arg_add(arglist, opt, ARG_INT, sizeof(int), (void *)val); + arg_add(arglist, opt, ARG_INT, sizeof(gpointer), GSIZE_TO_POINTER(val)); } return (0); } @@ -377,7 +377,7 @@ char name[40]; snprintf(name, sizeof(name), "%s", plugins->oid); - arg_add_value(pluginset, name, ARG_INT, sizeof(int), (void*)(plugins->enabled != 0) ); + arg_add_value(pluginset, name, ARG_INT, sizeof(gpointer), GSIZE_TO_POINTER(plugins->enabled != 0) ); plugins = plugins->next; } } @@ -473,7 +473,7 @@ struct arglist *pluginset_entry = hash_get(hash, plugins->oid); if(pluginset_entry != NULL ) - pluginset_entry->value = (void *)(plugins->enabled != 0 ); + pluginset_entry->value = GSIZE_TO_POINTER(plugins->enabled != 0 ); plugins = plugins->next; } @@ -520,7 +520,7 @@ { if(!strcmp(t->name, "paranoia_level") || !strcmp(t->name, "nessusd_port") || !strcmp(t->name, "sort_order") || !strcmp(t->name, "protocol_version")) - fprintf(fd, "%s = %d\n", t->name, (int)t->value); + fprintf(fd, "%s = %d\n", t->name, (int)GPOINTER_TO_SIZE(t->value)); else fprintf(fd, "%s = %s\n", t->name, t->value ? "yes" : "no"); } @@ -772,7 +772,7 @@ const char *name; int value; { - prefs_set_value(context, name, (void *)value, ARG_INT); + prefs_set_value(context, name, GSIZE_TO_POINTER(value), ARG_INT); } void Modified: trunk/openvas-client/nessus/preferences.h =================================================================== --- trunk/openvas-client/nessus/preferences.h 2008-11-10 11:07:20 UTC (rev 1687) +++ trunk/openvas-client/nessus/preferences.h 2008-11-10 11:58:01 UTC (rev 1688) @@ -41,7 +41,7 @@ char * preferences_get_altname(struct context *, const char *); void * prefs_get_default(struct context *, const char *); void * prefs_get_value(struct context *, const char *); -#define prefs_get_int(context, name) ((int)prefs_get_value(context, name)) +#define prefs_get_int(context, name) (GPOINTER_TO_SIZE(prefs_get_value(context, name))) #define prefs_get_string(context, name) ((const char *)prefs_get_value(context, name)) void prefs_set_value(struct context *, const char *, void *, int); void prefs_set_int(struct context *, const char *, int); Modified: trunk/openvas-client/nessus/prefs_dialog/prefs_context.c =================================================================== --- trunk/openvas-client/nessus/prefs_dialog/prefs_context.c 2008-11-10 11:07:20 UTC (rev 1687) +++ trunk/openvas-client/nessus/prefs_dialog/prefs_context.c 2008-11-10 11:58:01 UTC (rev 1688) @@ -215,7 +215,7 @@ fname = report_get_filename(context); ctrls_report = arg_get_value(MainDialog, "REPORT"); /* but first discard the current one */ - be = (int)arg_get_value(ctrls_report, "BE"); + be = GPOINTER_TO_SIZE(arg_get_value(ctrls_report, "BE")); if (be >= 0) { backend_dispose(be); arg_set_value(ctrls_report, "BE", sizeof(int), (void *)-1); @@ -224,7 +224,7 @@ if (fname && check_is_file(fname)) { be = backend_import_report(fname); efree(&fname); - arg_set_value(ctrls_report, "BE", sizeof(int), (void *)be); + arg_set_value(ctrls_report, "BE", sizeof(gpointer), GSIZE_TO_POINTER(be)); arg_set_value(ctrls_report, "REPORT_CONTEXT", -1, (void *)context); scopetreeview_counters_update(context, be, fname); } @@ -275,7 +275,7 @@ if(context->socket >= 0) { - if (port == (int)prefs_get_default(context, "nessusd_port")) + if (port == GPOINTER_TO_SIZE(prefs_get_default(context, "nessusd_port"))) connect_status = g_strdup_printf(_("Connection: %s@%s"), username, hostname); else if (port >= 0) Modified: trunk/openvas-client/nessus/prefs_dialog/prefs_dialog.c =================================================================== --- trunk/openvas-client/nessus/prefs_dialog/prefs_dialog.c 2008-11-10 11:07:20 UTC (rev 1687) +++ trunk/openvas-client/nessus/prefs_dialog/prefs_dialog.c 2008-11-10 11:58:01 UTC (rev 1688) @@ -1015,7 +1015,7 @@ char *s; int v; - v = (int)arg_get_value(serv, "unscanned_closed"); + v = GPOINTER_TO_SIZE(arg_get_value(serv, "unscanned_closed")); if(v) s = strdup("yes"); else Modified: trunk/openvas-client/nessus/prefs_dialog/prefs_dialog_auth.c =================================================================== --- trunk/openvas-client/nessus/prefs_dialog/prefs_dialog_auth.c 2008-11-10 11:07:20 UTC (rev 1687) +++ trunk/openvas-client/nessus/prefs_dialog/prefs_dialog_auth.c 2008-11-10 11:58:01 UTC (rev 1688) @@ -89,7 +89,7 @@ struct auth_dialog *auth; { gtk_spin_button_set_value(GTK_SPIN_BUTTON(auth->port), - (int)prefs_get_default(auth->context, "nessusd_port")); + GPOINTER_TO_SIZE(prefs_get_default(auth->context, "nessusd_port"))); } void Modified: trunk/openvas-client/nessus/prefs_dialog/prefs_kb.c =================================================================== --- trunk/openvas-client/nessus/prefs_dialog/prefs_kb.c 2008-11-10 11:07:20 UTC (rev 1687) +++ trunk/openvas-client/nessus/prefs_dialog/prefs_kb.c 2008-11-10 11:58:01 UTC (rev 1688) @@ -127,7 +127,7 @@ if(type < 0) return 0; /* no set */ if(type == ARG_INT) - return (int)arg_get_value(arglist, name); + return GPOINTER_TO_SIZE(arg_get_value(arglist, name)); else { char * value = arg_get_value(arglist, name); if(!value) Modified: trunk/openvas-client/nessus/prefs_dialog/prefs_report.c =================================================================== --- trunk/openvas-client/nessus/prefs_dialog/prefs_report.c 2008-11-10 11:07:20 UTC (rev 1687) +++ trunk/openvas-client/nessus/prefs_dialog/prefs_report.c 2008-11-10 11:58:01 UTC (rev 1688) @@ -119,7 +119,7 @@ prefs_report_update_timestamp(struct arglist *ctrls) { GtkWidget *scan_timestamps = arg_get_value(ctrls, "SCAN_TIMESTAMPS"); - int be = (int)arg_get_value(ctrls, "BE"); + int be = GPOINTER_TO_SIZE(arg_get_value(ctrls, "BE")); char *str; if(be < 0) @@ -251,7 +251,7 @@ GtkTreeModel * tree_store; GtkWidget * order_combobox; int order_index; - int be = (int)arg_get_value(ctrls, "BE"); + int be = GPOINTER_TO_SIZE(arg_get_value(ctrls, "BE")); const char *restriction_keys[3]; const char *restriction_values[3]; @@ -335,7 +335,7 @@ GtkWidget * textview = arg_get_value((struct arglist*)user_data, "REPORT"); GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview)); - int be = (int)arg_get_value((struct arglist*)user_data, "BE"); + int be = GPOINTER_TO_SIZE(arg_get_value((struct arglist*)user_data, "BE")); GtkTextIter iter; if (be < 0) return; Modified: trunk/openvas-client/nessus/prefs_dialog/prefs_scope_tree.c =================================================================== --- trunk/openvas-client/nessus/prefs_dialog/prefs_scope_tree.c 2008-11-10 11:07:20 UTC (rev 1687) +++ trunk/openvas-client/nessus/prefs_dialog/prefs_scope_tree.c 2008-11-10 11:58:01 UTC (rev 1688) @@ -755,7 +755,7 @@ gchar *text; /* Get the int value from the model. */ - gtk_tree_model_get(tree_model, iter, (gint) data, &value, -1); + gtk_tree_model_get(tree_model, iter, GPOINTER_TO_SIZE(data), &value, -1); /* Now we can format the value ourselves. */ if(value < 0) text = g_strdup(""); Modified: trunk/openvas-client/nessus/report_save.c =================================================================== --- trunk/openvas-client/nessus/report_save.c 2008-11-10 11:07:20 UTC (rev 1687) +++ trunk/openvas-client/nessus/report_save.c 2008-11-10 11:58:01 UTC (rev 1688) @@ -82,12 +82,12 @@ struct arglist *hosts = NULL; GtkWidget *menu = gtk_object_get_data(GTK_OBJECT(filedialog), "menu"); GtkWidget *active = gtk_menu_get_active(GTK_MENU(menu)); - int type = (int)gtk_object_get_data(GTK_OBJECT(active), "type"); + int type = GPOINTER_TO_SIZE(gtk_object_get_data(GTK_OBJECT(active), "type")); char *suffixes[] = { ".nbe", ".html", ".txt", ".tex", "", ".pdf", ".xml"}; #define MAX_SUFFIX_LEN 5 /* .html */ char *suffix = suffixes[type]; - int be = (int)arg_get_value(arg_get_value(MainDialog, "REPORT"), "BE"); + int be = GPOINTER_TO_SIZE(arg_get_value(arg_get_value(MainDialog, "REPORT"), "BE")); struct context *report_context = arg_get_value(arg_get_value(MainDialog, "REPORT"), "REPORT_CONTEXT"); @@ -333,7 +333,7 @@ GtkWidget *menuitem; gpointer ctrls; { - int be = (int)arg_get_value(arg_get_value(ctrls, "REPORT"), "BE"); + int be = GPOINTER_TO_SIZE(arg_get_value(arg_get_value(ctrls, "REPORT"), "BE")); struct context *report_context = arg_get_value(arg_get_value(ctrls, "REPORT"), "REPORT_CONTEXT"); char *basename = g_path_get_basename(Context->dir); Modified: trunk/openvas-client/nessus/sslui.c =================================================================== --- trunk/openvas-client/nessus/sslui.c 2008-11-10 11:07:20 UTC (rev 1687) +++ trunk/openvas-client/nessus/sslui.c 2008-11-10 11:58:01 UTC (rev 1688) @@ -52,9 +52,9 @@ GtkWidget * button = list->data; if(GTK_TOGGLE_BUTTON(button)->active) { - value = (int)gtk_object_get_data(GTK_OBJECT(button), "level"); + value = GPOINTER_TO_SIZE(gtk_object_get_data(GTK_OBJECT(button), "level")); arg_add_value(ctrls, "LEVEL", ARG_INT, - sizeof(value), (void*)value); + sizeof(gpointer), GSIZE_TO_POINTER(value)); gtk_grab_remove(arg_get_value(ctrls, "WINDOW")); gtk_widget_destroy(arg_get_value(ctrls, "WINDOW")); gtk_main_quit(); @@ -201,9 +201,9 @@ struct arglist * ctrls = emalloc(sizeof(*ctrls)); build_dialog(ctrls, question); gtk_main(); - ret = (int)arg_get_value(ctrls, "LEVEL"); - arg_free(ctrls); - return ret; + ret = GPOINTER_TO_SIZE(arg_get_value(ctrls, "LEVEL")); + arg_free(ctrls); + return ret; } else #endif @@ -382,7 +382,7 @@ struct arglist * ctrls = sslui_showcert(ascii_cert); efree(&ascii_cert); gtk_main(); - ret = (int)arg_get_value(ctrls, "RESULT"); + ret = GPOINTER_TO_SIZE(arg_get_value(ctrls, "RESULT")); arg_free(ctrls); if(ret) return 0; From scm-commit at wald.intevation.org Mon Nov 10 12:07:21 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Mon, 10 Nov 2008 12:07:21 +0100 (CET) Subject: [Openvas-commits] r1687 - trunk/openvas-libnasl Message-ID: <20081110110721.BC1F14075F@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-10 12:07:20 +0100 (Mon, 10 Nov 2008) New Revision: 1687 Modified: trunk/openvas-libnasl/ChangeLog trunk/openvas-libnasl/configure Log: * configure: Regenerated to include updated version requirements. Modified: trunk/openvas-libnasl/ChangeLog =================================================================== --- trunk/openvas-libnasl/ChangeLog 2008-11-10 11:01:57 UTC (rev 1686) +++ trunk/openvas-libnasl/ChangeLog 2008-11-10 11:07:20 UTC (rev 1687) @@ -1,5 +1,9 @@ 2008-11-10 Michael Wiegand + * configure: Regenerated to include updated version requirements. + +2008-11-10 Michael Wiegand + * include/config.h.in: Removed obsolete getopt define. 2008-10-05 Felix Wolfsteller Modified: trunk/openvas-libnasl/configure =================================================================== --- trunk/openvas-libnasl/configure 2008-11-10 11:01:57 UTC (rev 1686) +++ trunk/openvas-libnasl/configure 2008-11-10 11:07:20 UTC (rev 1687) @@ -821,6 +821,7 @@ host_cpu host_vendor host_os +SED GREP EGREP LN_S @@ -828,6 +829,8 @@ AR RANLIB STRIP +DSYMUTIL +NMEDIT CPP CXX CXXFLAGS @@ -3080,12 +3083,13 @@ test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + if { test -f "$as_dir/$lt_ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$lt_ac_prog$ac_exec_ext"; }; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done +IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris @@ -3120,6 +3124,7 @@ fi SED=$lt_cv_path_SED + { echo "$as_me:$LINENO: result: $SED" >&5 echo "${ECHO_T}$SED" >&6; } @@ -3481,8 +3486,8 @@ echo "${ECHO_T}no, using $LN_S" >&6; } fi -{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 -echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 +echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3501,7 +3506,7 @@ # whether `pass_all' will *always* work, you probably want this one. case $host_os in -aix4* | aix5*) +aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; @@ -3523,9 +3528,15 @@ mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump'. - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' + # func_win32_libid shell function, so use a weaker test based on 'objdump', + # unless we find 'file', for example because we are cross-compiling. + if ( file / ) >/dev/null 2>&1; then + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + else + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi ;; darwin* | rhapsody*) @@ -3570,7 +3581,7 @@ esac ;; -interix3*) +interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; @@ -3620,6 +3631,10 @@ lt_cv_deplibs_check_method=pass_all ;; +rdos*) + lt_cv_deplibs_check_method=pass_all + ;; + solaris*) lt_cv_deplibs_check_method=pass_all ;; @@ -3707,7 +3722,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 3710 "configure"' > conftest.$ac_ext + echo '#line 3725 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -3742,7 +3757,8 @@ rm -rf conftest* ;; -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) +x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ +s390*-*linux*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 @@ -3753,6 +3769,9 @@ case `/usr/bin/file conftest.o` in *32-bit*) case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_i386_fbsd" + ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; @@ -3769,6 +3788,9 @@ ;; *64-bit*) case $host in + x86_64-*kfreebsd*-gnu) + LD="${LD-ld} -m elf_x86_64_fbsd" + ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; @@ -3872,7 +3894,11 @@ *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) LD="${LD-ld} -64" ;; + *) + if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then + LD="${LD-ld} -64" + fi + ;; esac ;; esac @@ -5361,7 +5387,6 @@ # Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! - # find the maximum length of command line arguments { echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } @@ -5448,24 +5473,27 @@ fi ;; *) - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ + lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` + if test -n "$lt_cv_sys_max_cmd_len"; then + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + else + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - teststring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + fi ;; esac @@ -5482,6 +5510,7 @@ + # Check for command to grab the raw symbol name followed by C symbol from nm. { echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } @@ -5672,7 +5701,7 @@ echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi - rm -f conftest* conftst* + rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then @@ -6070,7 +6099,7 @@ test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= @@ -6232,6 +6261,318 @@ ;; esac + + case $host_os in + rhapsody* | darwin*) + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. +set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_DSYMUTIL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$DSYMUTIL"; then + ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +DSYMUTIL=$ac_cv_prog_DSYMUTIL +if test -n "$DSYMUTIL"; then + { echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 +echo "${ECHO_T}$DSYMUTIL" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_DSYMUTIL"; then + ac_ct_DSYMUTIL=$DSYMUTIL + # Extract the first word of "dsymutil", so it can be a program name with args. +set dummy dsymutil; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_DSYMUTIL"; then + ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL +if test -n "$ac_ct_DSYMUTIL"; then + { echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5 +echo "${ECHO_T}$ac_ct_DSYMUTIL" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_DSYMUTIL" = x; then + DSYMUTIL=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + DSYMUTIL=$ac_ct_DSYMUTIL + fi +else + DSYMUTIL="$ac_cv_prog_DSYMUTIL" +fi + + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. +set dummy ${ac_tool_prefix}nmedit; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_NMEDIT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$NMEDIT"; then + ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +NMEDIT=$ac_cv_prog_NMEDIT +if test -n "$NMEDIT"; then + { echo "$as_me:$LINENO: result: $NMEDIT" >&5 +echo "${ECHO_T}$NMEDIT" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_NMEDIT"; then + ac_ct_NMEDIT=$NMEDIT + # Extract the first word of "nmedit", so it can be a program name with args. +set dummy nmedit; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_NMEDIT"; then + ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_NMEDIT="nmedit" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT +if test -n "$ac_ct_NMEDIT"; then + { echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5 +echo "${ECHO_T}$ac_ct_NMEDIT" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf at gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + NMEDIT=$ac_ct_NMEDIT + fi +else + NMEDIT="$ac_cv_prog_NMEDIT" +fi + + + { echo "$as_me:$LINENO: checking for -single_module linker flag" >&5 +echo $ECHO_N "checking for -single_module linker flag... $ECHO_C" >&6; } +if test "${lt_cv_apple_cc_single_mod+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_apple_cc_single_mod=no + if test -z "${LT_MULTI_MODULE}"; then + # By default we will add the -single_module flag. You can override + # by either setting the environment variable LT_MULTI_MODULE + # non-empty at configure time, or by adding -multi_module to the + # link flags. + echo "int foo(void){return 1;}" > conftest.c + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib ${wl}-single_module conftest.c + if test -f libconftest.dylib; then + lt_cv_apple_cc_single_mod=yes + rm -rf libconftest.dylib* + fi + rm conftest.c + fi +fi +{ echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 +echo "${ECHO_T}$lt_cv_apple_cc_single_mod" >&6; } + { echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 +echo $ECHO_N "checking for -exported_symbols_list linker flag... $ECHO_C" >&6; } +if test "${lt_cv_ld_exported_symbols_list+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + lt_cv_ld_exported_symbols_list=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + lt_cv_ld_exported_symbols_list=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 +echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&6; } + case $host_os in + rhapsody* | darwin1.[0123]) + _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; + darwin1.*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + darwin*) + # if running on 10.5 or later, the deployment target defaults + # to the OS version, if on x86, and 10.4, the deployment + # target defaults to 10.4. Don't you love it? + case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in + 10.0,*86*-darwin8*|10.0,*-darwin[91]*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + 10.[012]*) + _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; + 10.*) + _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; + esac + ;; + esac + if test "$lt_cv_apple_cc_single_mod" = "yes"; then + _lt_dar_single_mod='$single_module' + fi + if test "$lt_cv_ld_exported_symbols_list" = "yes"; then + _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' + else + _lt_dar_export_syms="~$NMEDIT -s \$output_objdir/\${libname}-symbols.expsym \${lib}" + fi + if test "$DSYMUTIL" != ":"; then + _lt_dsymutil="~$DSYMUTIL \$lib || :" + else + _lt_dsymutil= + fi + ;; + esac + + enable_dlopen=no enable_win32_dll=no @@ -6270,10 +6611,10 @@ objext=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" +lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' +lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. @@ -6288,16 +6629,16 @@ # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext +echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` -$rm conftest* +$rm -r conftest* @@ -6314,7 +6655,7 @@ else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. @@ -6325,11 +6666,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6328: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6669: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6332: \$? = $ac_status" >&5 + echo "$as_me:6673: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -6380,13 +6721,15 @@ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | pw32* | os2*) + mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; @@ -6396,7 +6739,7 @@ lt_prog_compiler_pic='-fno-common' ;; - interix3*) + interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; @@ -6454,7 +6797,7 @@ esac ;; - mingw* | pw32* | os2*) + mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' @@ -6506,6 +6849,22 @@ # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='' + ;; + esac + ;; esac ;; @@ -6515,6 +6874,10 @@ lt_prog_compiler_static='-non_shared' ;; + rdos*) + lt_prog_compiler_static='-non_shared' + ;; + solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' @@ -6577,12 +6940,12 @@ { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works+set}" = set; then +if test "${lt_cv_prog_compiler_pic_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_prog_compiler_pic_works=no + lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. @@ -6593,27 +6956,27 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6596: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6959: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6600: \$? = $ac_status" >&5 + echo "$as_me:6963: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works=yes + lt_cv_prog_compiler_pic_works=yes fi fi $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_pic_works" >&6; } -if test x"$lt_prog_compiler_pic_works" = xyes; then +if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; @@ -6640,13 +7003,13 @@ wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works+set}" = set; then +if test "${lt_cv_prog_compiler_static_works+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_prog_compiler_static_works=no + lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$lt_simple_link_test_code" > conftest.$ac_ext + echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings @@ -6656,20 +7019,20 @@ $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works=yes + lt_cv_prog_compiler_static_works=yes fi else - lt_prog_compiler_static_works=yes + lt_cv_prog_compiler_static_works=yes fi fi - $rm conftest* + $rm -r conftest* LDFLAGS="$save_LDFLAGS" fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_static_works" >&6; } -if test x"$lt_prog_compiler_static_works" = xyes; then +if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= @@ -6686,7 +7049,7 @@ mkdir conftest cd conftest mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or @@ -6697,11 +7060,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6700: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7063: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:6704: \$? = $ac_status" >&5 + echo "$as_me:7067: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -6781,12 +7144,13 @@ # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. - exclude_expsyms="_GLOBAL_OFFSET_TABLE_" + exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do @@ -6845,7 +7209,7 @@ # See if GNU ld supports shared libraries. case $host_os in - aix3* | aix4* | aix5*) + aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no @@ -6893,7 +7257,7 @@ allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -6911,7 +7275,7 @@ fi ;; - interix3*) + interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' @@ -6926,7 +7290,7 @@ archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - linux* | k*bsd*-gnu) + gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in @@ -6944,13 +7308,22 @@ ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac - archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + *) + tmp_sharedflag='-shared' ;; + esac + archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi link_all_deplibs=no else @@ -7056,7 +7429,7 @@ fi ;; - aix4* | aix5*) + aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. @@ -7076,7 +7449,7 @@ # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes @@ -7110,7 +7483,7 @@ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 - hardcode_direct=yes + : else # We have old collect2 hardcode_direct=unsupported @@ -7184,11 +7557,18 @@ } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -7243,11 +7623,18 @@ } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -7301,7 +7688,7 @@ # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds='true' # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; @@ -7334,19 +7721,18 @@ link_all_deplibs=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' - archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else case $cc_basename in xlc*) output_verbose_link_cmd='echo' - archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) @@ -7508,24 +7894,28 @@ ;; openbsd*) - hardcode_direct=yes - hardcode_shlibpath_var=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' + if test -f /usr/libexec/ld.so; then + hardcode_direct=yes + hardcode_shlibpath_var=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac + ld_shlibs=no fi ;; @@ -7584,17 +7974,16 @@ case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; + if test "$GCC" = yes; then + whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' + fi + ;; esac link_all_deplibs=yes ;; @@ -7651,7 +8040,7 @@ fi ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no @@ -7728,7 +8117,7 @@ { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 @@ -7786,17 +8175,55 @@ version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" + if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$lt_search_path_spec" | grep ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e 's/;/ /g'` else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + lt_search_path_spec=`echo "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi + # Ok, now we have the path, separated by spaces, we can step through it + # and add multilib dir if necessary. + lt_tmp_lt_search_path_spec= + lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` + for lt_sys_path in $lt_search_path_spec; do + if test -d "$lt_sys_path/$lt_multi_os_dir"; then + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" + else + test -d "$lt_sys_path" && \ + lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" + fi + done + lt_search_path_spec=`echo $lt_tmp_lt_search_path_spec | awk ' +BEGIN {RS=" "; FS="/|\n";} { + lt_foo=""; + lt_count=0; + for (lt_i = NF; lt_i > 0; lt_i--) { + if ($lt_i != "" && $lt_i != ".") { + if ($lt_i == "..") { + lt_count++; + } else { + if (lt_count == 0) { + lt_foo="/" $lt_i lt_foo; + } else { + lt_count--; + } + } + } + } + if (lt_foo != "") { lt_freq[lt_foo]++; } + if (lt_freq[lt_foo] == 1) { print lt_foo; } +}'` + sys_lib_search_path_spec=`echo $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi @@ -7817,7 +8244,7 @@ soname_spec='${libname}${release}${shared_ext}$major' ;; -aix4* | aix5*) +aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no @@ -7956,12 +8383,8 @@ shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi + + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; @@ -8015,7 +8438,7 @@ shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; - freebsd*) # from 4.6 on + *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; @@ -8078,7 +8501,7 @@ postinstall_cmds='chmod 555 $lib' ;; -interix3*) +interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no @@ -8149,7 +8572,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -8255,6 +8678,10 @@ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; +rdos*) + dynamic_linker=no + ;; + solaris*) version_type=linux need_lib_prefix=no @@ -8351,6 +8778,21 @@ echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" +fi + +sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" +fi + +sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" + variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" @@ -8408,6 +8850,7 @@ darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" + old_striplib="$STRIP -S" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else @@ -8669,7 +9112,7 @@ { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } if test $ac_cv_lib_dld_shl_load = yes; then - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else { echo "$as_me:$LINENO: checking for dlopen" >&5 echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } @@ -8945,7 +9388,7 @@ { echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6; } if test $ac_cv_lib_dld_dld_link = yes; then - lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld" + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi @@ -8994,7 +9437,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <conftest.$ac_ext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext +echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` -$rm conftest* +$rm -r conftest* # Allow CC to be a program name with arguments. @@ -10064,7 +10514,7 @@ # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; - aix4* | aix5*) + aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. @@ -10077,7 +10527,7 @@ # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) @@ -10113,7 +10563,7 @@ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 - hardcode_direct_CXX=yes + : else # We have old collect2 hardcode_direct_CXX=unsupported @@ -10187,11 +10637,18 @@ } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -10247,11 +10704,18 @@ } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -10321,59 +10785,31 @@ fi ;; darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes - - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no + allow_undefined_flag_CXX="$_lt_dar_allow_undefined" + if test "$GXX" = yes ; then output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes + archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" + if test "$lt_cv_apple_cc_single_mod" != "yes"; then + archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" + archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' else - archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else case $cc_basename in xlc*) output_verbose_link_cmd='echo' - archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) @@ -10456,9 +10892,7 @@ hardcode_libdir_separator_CXX=: case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_CXX='+b $libdir' - ;; + hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; @@ -10526,7 +10960,7 @@ ;; esac ;; - interix3*) + interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' @@ -10618,7 +11052,7 @@ export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; - pgCC*) + pgCC* | pgcpp*) # Portland Group C++ compiler archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' @@ -10646,6 +11080,29 @@ # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + hardcode_libdir_flag_spec_CXX='-R$libdir' + whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + + # Not sure whether something based on + # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 + # would be better. + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; esac ;; lynxos*) @@ -10684,16 +11141,20 @@ ld_shlibs_CXX=no ;; openbsd*) - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - export_dynamic_flag_spec_CXX='${wl}-E' - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + if test -f /usr/libexec/ld.so; then + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + else + ld_shlibs_CXX=no fi - output_verbose_link_cmd='echo' ;; osf3*) case $cc_basename in @@ -10855,15 +11316,10 @@ case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes @@ -10910,6 +11366,12 @@ fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac fi ;; esac @@ -10997,7 +11459,6 @@ GCC_CXX="$GXX" LD_CXX="$LD" - cat > conftest.$ac_ext <&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + # + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + if test "$solaris_use_stlport4" != yes; then + postdeps_CXX='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + solaris*) case $cc_basename in CC*) + # The more standards-conforming stlport4 library is + # incompatible with the Cstd library. Avoid specifying + # it if it's in CXXFLAGS. Ignore libCrun as + # -library=stlport4 depends on it. + case " $CXX $CXXFLAGS " in + *" -library=stlport4 "*) + solaris_use_stlport4=yes + ;; + esac + # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. - postdeps_CXX='-lCstd -lCrun' + if test "$solaris_use_stlport4" != yes; then + postdeps_CXX='-library=Cstd -library=Crun' + fi ;; esac ;; esac - case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac @@ -11152,12 +11650,14 @@ # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | os2* | pw32*) + mingw* | cygwin* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) @@ -11169,7 +11669,7 @@ # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; - interix3*) + interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; @@ -11195,7 +11695,7 @@ esac else case $host_os in - aix4* | aix5*) + aix[4-9]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor @@ -11291,7 +11791,7 @@ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; - pgCC*) + pgCC* | pgcpp*) # Portland Group C++ compiler. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' @@ -11305,6 +11805,14 @@ lt_prog_compiler_static_CXX='-non_shared' ;; *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + esac ;; esac ;; @@ -11414,12 +11922,12 @@ { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then +if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_prog_compiler_pic_works_CXX=no + lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. @@ -11430,27 +11938,27 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11433: $lt_compile\"" >&5) + (eval echo "\"\$as_me:11941: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:11437: \$? = $ac_status" >&5 + echo "$as_me:11945: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_CXX=yes + lt_cv_prog_compiler_pic_works_CXX=yes fi fi $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; } +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_CXX" >&6; } -if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then +if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; @@ -11477,13 +11985,13 @@ wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works_CXX+set}" = set; then +if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_prog_compiler_static_works_CXX=no + lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$lt_simple_link_test_code" > conftest.$ac_ext + echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings @@ -11493,20 +12001,20 @@ $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_CXX=yes + lt_cv_prog_compiler_static_works_CXX=yes fi else - lt_prog_compiler_static_works_CXX=yes + lt_cv_prog_compiler_static_works_CXX=yes fi fi - $rm conftest* + $rm -r conftest* LDFLAGS="$save_LDFLAGS" fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; } +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_static_works_CXX" >&6; } -if test x"$lt_prog_compiler_static_works_CXX" = xyes; then +if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= @@ -11523,7 +12031,7 @@ mkdir conftest cd conftest mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or @@ -11534,11 +12042,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:11537: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12045: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:11541: \$? = $ac_status" >&5 + echo "$as_me:12049: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -11591,7 +12099,7 @@ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in - aix4* | aix5*) + aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | grep 'GNU' > /dev/null; then @@ -11604,7 +12112,7 @@ export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw*) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' ;; linux* | k*bsd*-gnu) link_all_deplibs_CXX=no @@ -11613,6 +12121,7 @@ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' { echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 echo "${ECHO_T}$ld_shlibs_CXX" >&6; } @@ -11638,7 +12147,7 @@ { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 @@ -11696,20 +12205,7 @@ version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi + need_lib_prefix=unknown hardcode_into_libs=no @@ -11727,7 +12223,7 @@ soname_spec='${libname}${release}${shared_ext}$major' ;; -aix4* | aix5*) +aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no @@ -11866,12 +12362,7 @@ shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; @@ -11925,7 +12416,7 @@ shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; - freebsd*) # from 4.6 on + *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; @@ -11988,7 +12479,7 @@ postinstall_cmds='chmod 555 $lib' ;; -interix3*) +interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no @@ -12059,7 +12550,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -12165,6 +12656,10 @@ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; +rdos*) + dynamic_linker=no + ;; + solaris*) version_type=linux need_lib_prefix=no @@ -12261,6 +12756,21 @@ echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" +fi + +sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" +fi + +sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" + variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" @@ -12344,6 +12854,7 @@ predeps_CXX \ postdeps_CXX \ compiler_lib_search_path_CXX \ + compiler_lib_search_dirs_CXX \ archive_cmds_CXX \ archive_expsym_cmds_CXX \ postinstall_cmds_CXX \ @@ -12359,6 +12870,7 @@ module_cmds_CXX \ module_expsym_cmds_CXX \ lt_cv_prog_compiler_c_o_CXX \ + fix_srcfile_path_CXX \ exclude_expsyms_CXX \ include_expsyms_CXX; do @@ -12591,6 +13103,10 @@ # shared library. postdeps=$lt_postdeps_CXX +# The directories searched by this compiler when creating a shared +# library +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX + # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX @@ -12679,7 +13195,7 @@ sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_CXX" +fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_CXX @@ -12770,10 +13286,17 @@ objext_F77=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code=" subroutine t\n return\n end\n" +lt_simple_compile_test_code="\ + subroutine t + return + end +" # Code to be used in simple link tests -lt_simple_link_test_code=" program t\n end\n" +lt_simple_link_test_code="\ + program t + end +" # ltmain only uses $CC for tagged configurations so make sure $CC is set. @@ -12789,16 +13312,16 @@ # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext +echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` -$rm conftest* +$rm -r conftest* # Allow CC to be a program name with arguments. @@ -12836,7 +13359,7 @@ postinstall_cmds='$RANLIB $lib' fi ;; -aix4* | aix5*) +aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi @@ -12882,13 +13405,15 @@ lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | pw32* | os2*) + mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries lt_prog_compiler_pic_F77='-DDLL_EXPORT' ;; @@ -12898,7 +13423,7 @@ lt_prog_compiler_pic_F77='-fno-common' ;; - interix3*) + interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; @@ -12956,7 +13481,7 @@ esac ;; - mingw* | pw32* | os2*) + mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic_F77='-DDLL_EXPORT' @@ -13008,6 +13533,22 @@ # All Alpha code is PIC. lt_prog_compiler_static_F77='-non_shared' ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + lt_prog_compiler_wl_F77='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + lt_prog_compiler_wl_F77='' + ;; + esac + ;; esac ;; @@ -13017,6 +13558,10 @@ lt_prog_compiler_static_F77='-non_shared' ;; + rdos*) + lt_prog_compiler_static_F77='-non_shared' + ;; + solaris*) lt_prog_compiler_pic_F77='-KPIC' lt_prog_compiler_static_F77='-Bstatic' @@ -13079,12 +13624,12 @@ { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works_F77+set}" = set; then +if test "${lt_cv_prog_compiler_pic_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_prog_compiler_pic_works_F77=no + lt_cv_prog_compiler_pic_works_F77=no ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_F77" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. @@ -13095,27 +13640,27 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13098: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13643: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13102: \$? = $ac_status" >&5 + echo "$as_me:13647: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_F77=yes + lt_cv_prog_compiler_pic_works_F77=yes fi fi $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; } +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_F77" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_F77" >&6; } -if test x"$lt_prog_compiler_pic_works_F77" = xyes; then +if test x"$lt_cv_prog_compiler_pic_works_F77" = xyes; then case $lt_prog_compiler_pic_F77 in "" | " "*) ;; *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; @@ -13142,13 +13687,13 @@ wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works_F77+set}" = set; then +if test "${lt_cv_prog_compiler_static_works_F77+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_prog_compiler_static_works_F77=no + lt_cv_prog_compiler_static_works_F77=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$lt_simple_link_test_code" > conftest.$ac_ext + echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings @@ -13158,20 +13703,20 @@ $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_F77=yes + lt_cv_prog_compiler_static_works_F77=yes fi else - lt_prog_compiler_static_works_F77=yes + lt_cv_prog_compiler_static_works_F77=yes fi fi - $rm conftest* + $rm -r conftest* LDFLAGS="$save_LDFLAGS" fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; } +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_F77" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_static_works_F77" >&6; } -if test x"$lt_prog_compiler_static_works_F77" = xyes; then +if test x"$lt_cv_prog_compiler_static_works_F77" = xyes; then : else lt_prog_compiler_static_F77= @@ -13188,7 +13733,7 @@ mkdir conftest cd conftest mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or @@ -13199,11 +13744,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13202: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13747: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13206: \$? = $ac_status" >&5 + echo "$as_me:13751: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -13283,12 +13828,13 @@ # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. - exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" + exclude_expsyms_F77='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do @@ -13347,7 +13893,7 @@ # See if GNU ld supports shared libraries. case $host_os in - aix3* | aix4* | aix5*) + aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_F77=no @@ -13395,7 +13941,7 @@ allow_undefined_flag_F77=unsupported always_export_symbols_F77=no enable_shared_with_static_runtimes_F77=yes - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -13413,7 +13959,7 @@ fi ;; - interix3*) + interix[3-9]*) hardcode_direct_F77=no hardcode_shlibpath_var_F77=no hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' @@ -13428,7 +13974,7 @@ archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - linux* | k*bsd*-gnu) + gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in @@ -13446,13 +13992,22 @@ ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac - archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + *) + tmp_sharedflag='-shared' ;; + esac + archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi link_all_deplibs_F77=no else @@ -13558,7 +14113,7 @@ fi ;; - aix4* | aix5*) + aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. @@ -13578,7 +14133,7 @@ # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes @@ -13612,7 +14167,7 @@ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 - hardcode_direct_F77=yes + : else # We have old collect2 hardcode_direct_F77=unsupported @@ -13676,11 +14231,18 @@ } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -13725,11 +14287,18 @@ } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -13783,7 +14352,7 @@ # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_F77='true' # FIXME: Should let the user specify the lib program. - old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' + old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_F77='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_F77=yes ;; @@ -13816,19 +14385,18 @@ link_all_deplibs_F77=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' - archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_cmds_F77="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds_F77="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds_F77="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds_F77="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else case $cc_basename in xlc*) output_verbose_link_cmd='echo' - archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) @@ -13990,24 +14558,28 @@ ;; openbsd*) - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${wl}-E' + if test -f /usr/libexec/ld.so; then + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + ;; + *) + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + ;; + esac + fi else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - ;; - *) - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - ;; - esac + ld_shlibs_F77=no fi ;; @@ -14066,17 +14638,16 @@ case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; + if test "$GCC" = yes; then + whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' + fi + ;; esac link_all_deplibs_F77=yes ;; @@ -14133,7 +14704,7 @@ fi ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_F77='${wl}-z,text' archive_cmds_need_lc_F77=no hardcode_shlibpath_var_F77=no @@ -14210,7 +14781,7 @@ { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 @@ -14268,20 +14839,7 @@ version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi + need_lib_prefix=unknown hardcode_into_libs=no @@ -14299,7 +14857,7 @@ soname_spec='${libname}${release}${shared_ext}$major' ;; -aix4* | aix5*) +aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no @@ -14438,12 +14996,7 @@ shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; @@ -14497,7 +15050,7 @@ shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; - freebsd*) # from 4.6 on + *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; @@ -14560,7 +15113,7 @@ postinstall_cmds='chmod 555 $lib' ;; -interix3*) +interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no @@ -14631,7 +15184,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -14737,6 +15290,10 @@ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; +rdos*) + dynamic_linker=no + ;; + solaris*) version_type=linux need_lib_prefix=no @@ -14833,6 +15390,21 @@ echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" +fi + +sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" +fi + +sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" + variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" @@ -14916,6 +15488,7 @@ predeps_F77 \ postdeps_F77 \ compiler_lib_search_path_F77 \ + compiler_lib_search_dirs_F77 \ archive_cmds_F77 \ archive_expsym_cmds_F77 \ postinstall_cmds_F77 \ @@ -14931,6 +15504,7 @@ module_cmds_F77 \ module_expsym_cmds_F77 \ lt_cv_prog_compiler_c_o_F77 \ + fix_srcfile_path_F77 \ exclude_expsyms_F77 \ include_expsyms_F77; do @@ -15163,6 +15737,10 @@ # shared library. postdeps=$lt_postdeps_F77 +# The directories searched by this compiler when creating a shared +# library +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77 + # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_F77 @@ -15251,7 +15829,7 @@ sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_F77" +fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_F77 @@ -15309,10 +15887,10 @@ objext_GCJ=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}\n" +lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' +lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. @@ -15328,16 +15906,16 @@ # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext +echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` -$rm conftest* +$rm -r conftest* # Allow CC to be a program name with arguments. @@ -15375,7 +15953,7 @@ else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. @@ -15386,11 +15964,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15389: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15967: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15393: \$? = $ac_status" >&5 + echo "$as_me:15971: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -15441,14 +16019,16 @@ lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | pw32* | os2*) + mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + ;; darwin* | rhapsody*) @@ -15457,7 +16037,7 @@ lt_prog_compiler_pic_GCJ='-fno-common' ;; - interix3*) + interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; @@ -15515,10 +16095,10 @@ esac ;; - mingw* | pw32* | os2*) + mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; hpux9* | hpux10* | hpux11*) @@ -15567,6 +16147,22 @@ # All Alpha code is PIC. lt_prog_compiler_static_GCJ='-non_shared' ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + lt_prog_compiler_wl_GCJ='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + lt_prog_compiler_wl_GCJ='' + ;; + esac + ;; esac ;; @@ -15576,6 +16172,10 @@ lt_prog_compiler_static_GCJ='-non_shared' ;; + rdos*) + lt_prog_compiler_static_GCJ='-non_shared' + ;; + solaris*) lt_prog_compiler_pic_GCJ='-KPIC' lt_prog_compiler_static_GCJ='-Bstatic' @@ -15638,12 +16238,12 @@ { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then +if test "${lt_cv_prog_compiler_pic_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_prog_compiler_pic_works_GCJ=no + lt_cv_prog_compiler_pic_works_GCJ=no ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_GCJ" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. @@ -15654,27 +16254,27 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15657: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16257: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15661: \$? = $ac_status" >&5 + echo "$as_me:16261: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_GCJ=yes + lt_cv_prog_compiler_pic_works_GCJ=yes fi fi $rm conftest* fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; } +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_GCJ" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_pic_works_GCJ" >&6; } -if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then +if test x"$lt_cv_prog_compiler_pic_works_GCJ" = xyes; then case $lt_prog_compiler_pic_GCJ in "" | " "*) ;; *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; @@ -15701,13 +16301,13 @@ wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" { echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then +if test "${lt_cv_prog_compiler_static_works_GCJ+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_prog_compiler_static_works_GCJ=no + lt_cv_prog_compiler_static_works_GCJ=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$lt_simple_link_test_code" > conftest.$ac_ext + echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings @@ -15717,20 +16317,20 @@ $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_GCJ=yes + lt_cv_prog_compiler_static_works_GCJ=yes fi else - lt_prog_compiler_static_works_GCJ=yes + lt_cv_prog_compiler_static_works_GCJ=yes fi fi - $rm conftest* + $rm -r conftest* LDFLAGS="$save_LDFLAGS" fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; } +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_GCJ" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_static_works_GCJ" >&6; } -if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then +if test x"$lt_cv_prog_compiler_static_works_GCJ" = xyes; then : else lt_prog_compiler_static_GCJ= @@ -15747,7 +16347,7 @@ mkdir conftest cd conftest mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or @@ -15758,11 +16358,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15761: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16361: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:15765: \$? = $ac_status" >&5 + echo "$as_me:16365: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15842,12 +16442,13 @@ # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. - exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" + exclude_expsyms_GCJ='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. + # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= # Just being paranoid about ensuring that cc_basename is set. for cc_temp in $compiler""; do @@ -15906,7 +16507,7 @@ # See if GNU ld supports shared libraries. case $host_os in - aix3* | aix4* | aix5*) + aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs_GCJ=no @@ -15954,7 +16555,7 @@ allow_undefined_flag_GCJ=unsupported always_export_symbols_GCJ=no enable_shared_with_static_runtimes_GCJ=yes - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' @@ -15972,7 +16573,7 @@ fi ;; - interix3*) + interix[3-9]*) hardcode_direct_GCJ=no hardcode_shlibpath_var_GCJ=no hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' @@ -15987,7 +16588,7 @@ archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; - linux* | k*bsd*-gnu) + gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then tmp_addflag= case $cc_basename,$host_cpu in @@ -16005,13 +16606,22 @@ ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; esac - archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + whole_archive_flag_spec_GCJ='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + *) + tmp_sharedflag='-shared' ;; + esac + archive_cmds_GCJ='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test $supports_anon_versioning = yes; then archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi link_all_deplibs_GCJ=no else @@ -16117,7 +16727,7 @@ fi ;; - aix4* | aix5*) + aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. @@ -16137,7 +16747,7 @@ # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) + case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes @@ -16171,7 +16781,7 @@ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 - hardcode_direct_GCJ=yes + : else # We have old collect2 hardcode_direct_GCJ=unsupported @@ -16245,11 +16855,18 @@ } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -16304,11 +16921,18 @@ } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi +if test -z "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -16362,7 +16986,7 @@ # The linker will automatically build a .lib file if we build a DLL. old_archive_From_new_cmds_GCJ='true' # FIXME: Should let the user specify the lib program. - old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' + old_archive_cmds_GCJ='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes_GCJ=yes ;; @@ -16395,19 +17019,18 @@ link_all_deplibs_GCJ=yes if test "$GCC" = yes ; then output_verbose_link_cmd='echo' - archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_cmds_GCJ="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + module_cmds_GCJ="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + archive_expsym_cmds_GCJ="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" + module_expsym_cmds_GCJ="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else case $cc_basename in xlc*) output_verbose_link_cmd='echo' - archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $xlcverstring' module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $xlcverstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' ;; *) @@ -16569,24 +17192,28 @@ ;; openbsd*) - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${wl}-E' + if test -f /usr/libexec/ld.so; then + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + ;; + *) + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + ;; + esac + fi else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - ;; - *) - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - ;; - esac + ld_shlibs_GCJ=no fi ;; @@ -16645,17 +17272,16 @@ case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. + # The compiler driver will combine and reorder linker options, + # but understands `-z linker_flag'. GCC discards it without `$wl', + # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; + if test "$GCC" = yes; then + whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' + fi + ;; esac link_all_deplibs_GCJ=yes ;; @@ -16712,7 +17338,7 @@ fi ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_GCJ='${wl}-z,text' archive_cmds_need_lc_GCJ=no hardcode_shlibpath_var_GCJ=no @@ -16789,7 +17415,7 @@ { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 @@ -16847,20 +17473,7 @@ version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi + need_lib_prefix=unknown hardcode_into_libs=no @@ -16878,7 +17491,7 @@ soname_spec='${libname}${release}${shared_ext}$major' ;; -aix4* | aix5*) +aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no @@ -17017,12 +17630,7 @@ shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; @@ -17076,7 +17684,7 @@ shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; - freebsd*) # from 4.6 on + *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; @@ -17139,7 +17747,7 @@ postinstall_cmds='chmod 555 $lib' ;; -interix3*) +interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no @@ -17210,7 +17818,7 @@ # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi @@ -17316,6 +17924,10 @@ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; +rdos*) + dynamic_linker=no + ;; + solaris*) version_type=linux need_lib_prefix=no @@ -17412,6 +18024,21 @@ echo "${ECHO_T}$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no +if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_sys_lib_search_path_spec="$sys_lib_search_path_spec" +fi + +sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" +if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_sys_lib_dlsearch_path_spec="$sys_lib_dlsearch_path_spec" +fi + +sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" + variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" @@ -17495,6 +18122,7 @@ predeps_GCJ \ postdeps_GCJ \ compiler_lib_search_path_GCJ \ + compiler_lib_search_dirs_GCJ \ archive_cmds_GCJ \ archive_expsym_cmds_GCJ \ postinstall_cmds_GCJ \ @@ -17510,6 +18138,7 @@ module_cmds_GCJ \ module_expsym_cmds_GCJ \ lt_cv_prog_compiler_c_o_GCJ \ + fix_srcfile_path_GCJ \ exclude_expsyms_GCJ \ include_expsyms_GCJ; do @@ -17742,6 +18371,10 @@ # shared library. postdeps=$lt_postdeps_GCJ +# The directories searched by this compiler when creating a shared +# library +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_GCJ + # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ @@ -17830,7 +18463,7 @@ sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_GCJ" +fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_GCJ @@ -17887,7 +18520,7 @@ objext_RC=$objext # Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" @@ -17906,16 +18539,16 @@ # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext +echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $rm conftest* ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext +echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` -$rm conftest* +$rm -r conftest* # Allow CC to be a program name with arguments. @@ -17975,6 +18608,7 @@ predeps_RC \ postdeps_RC \ compiler_lib_search_path_RC \ + compiler_lib_search_dirs_RC \ archive_cmds_RC \ archive_expsym_cmds_RC \ postinstall_cmds_RC \ @@ -17990,6 +18624,7 @@ module_cmds_RC \ module_expsym_cmds_RC \ lt_cv_prog_compiler_c_o_RC \ + fix_srcfile_path_RC \ exclude_expsyms_RC \ include_expsyms_RC; do @@ -18222,6 +18857,10 @@ # shared library. postdeps=$lt_postdeps_RC +# The directories searched by this compiler when creating a shared +# library +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_RC + # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC @@ -18310,7 +18949,7 @@ sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_RC" +fix_srcfile_path=$lt_fix_srcfile_path # Set to yes if exported symbols are required. always_export_symbols=$always_export_symbols_RC @@ -18583,7 +19222,7 @@ -NEED_OPENVASLIBS_VERSION=1.0.2 +NEED_OPENVASLIBS_VERSION=2.0.0 NEED_GPGME_VERSION=1.1.2 @@ -26182,6 +26821,7 @@ host_cpu!$host_cpu$ac_delim host_vendor!$host_vendor$ac_delim host_os!$host_os$ac_delim +SED!$SED$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim LN_S!$LN_S$ac_delim @@ -26189,6 +26829,8 @@ AR!$AR$ac_delim RANLIB!$RANLIB$ac_delim STRIP!$STRIP$ac_delim +DSYMUTIL!$DSYMUTIL$ac_delim +NMEDIT!$NMEDIT$ac_delim CPP!$CPP$ac_delim CXX!$CXX$ac_delim CXXFLAGS!$CXXFLAGS$ac_delim @@ -26224,10 +26866,51 @@ VERSION!$VERSION$ac_delim have_ucbinclude!$have_ucbinclude$ac_delim LIBOBJS!$LIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 95; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 1; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 @@ -26245,7 +26928,7 @@ fi cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof /@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF sed ' @@ -26508,7 +27191,7 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && From scm-commit at wald.intevation.org Tue Nov 11 09:00:13 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Tue, 11 Nov 2008 09:00:13 +0100 (CET) Subject: [Openvas-commits] r1689 - in trunk/openvas-plugins: . scripts Message-ID: <20081111080013.35F0740769@pyrosoma.intevation.org> Author: chandra Date: 2008-11-11 09:00:11 +0100 (Tue, 11 Nov 2008) New Revision: 1689 Added: trunk/openvas-plugins/scripts/gb_aflog_cookie_auth_bypass_vuln.nasl trunk/openvas-plugins/scripts/gb_e107_alternate_profiles_remote_sql_inj_vuln.nasl trunk/openvas-plugins/scripts/gb_e107_easyshop_remote_sql_inj_vuln.nasl trunk/openvas-plugins/scripts/gb_openoffice_senddoc_tmp_file_creation_vuln_lin.nasl trunk/openvas-plugins/scripts/gb_openoffice_senddoc_tmp_file_creation_vuln_win.nasl trunk/openvas-plugins/scripts/gb_python_imageop_bof_vuln_win.nasl Modified: trunk/openvas-plugins/ChangeLog Log: Added new plugins Modified: trunk/openvas-plugins/ChangeLog =================================================================== --- trunk/openvas-plugins/ChangeLog 2008-11-10 11:58:01 UTC (rev 1688) +++ trunk/openvas-plugins/ChangeLog 2008-11-11 08:00:11 UTC (rev 1689) @@ -1,3 +1,12 @@ +2008-11-11 Chandrashekhar B + * scripts/gb_aflog_cookie_auth_bypass_vuln.nasl, + scripts/gb_e107_alternate_profiles_remote_sql_inj_vuln.nasl, + scripts/gb_e107_easyshop_remote_sql_inj_vuln.nasl, + scripts/gb_python_imageop_bof_vuln_win.nasl, + scripts/gb_openoffice_senddoc_tmp_file_creation_vuln_lin.nasl, + scripts/gb_openoffice_senddoc_tmp_file_creation_vuln_win.nasl: + Added new plugins + 2008-11-07 Jan-Oliver Wagner * openvas-nvt-sync.in: Added as comment an alternative syntax Added: trunk/openvas-plugins/scripts/gb_aflog_cookie_auth_bypass_vuln.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_aflog_cookie_auth_bypass_vuln.nasl 2008-11-10 11:58:01 UTC (rev 1688) +++ trunk/openvas-plugins/scripts/gb_aflog_cookie_auth_bypass_vuln.nasl 2008-11-11 08:00:11 UTC (rev 1689) @@ -0,0 +1,100 @@ +############################################################################### +# OpenVAS Vulnerability Test +# $Id: gb_aflog_cookie_auth_bypass_vuln.nasl 409 2008-11-10 10:20:11Z nov $ +# +# aflog Cookie-Based Authentication Bypass Vulnerability +# +# Authors: +# Sharath S +# +# Copyright: +# Copyright (c) 2008 Intevation GmbH, http://www.intevation.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# (or any later version), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################### + +if(description) +{ + script_id(800304); + script_version("$Revision: 1.0 $"); + script_cve_id("CVE-2008-4784"); + script_bugtraq_id(31894); + script_name(english:"aflog Cookie-Based Authentication Bypass Vulnerability"); + desc["english"] = " + + Overview: This host is running aflog and is prone to cookie-based authentication + bypass vulnerability. + + Vulnerability Insight: + The flaw is caused due to inadequacy in verifying user-supplied input used + for cookie-based authentication by setting the aflog_auth_a cookie to + 'A' or 'O' in edit_delete.php, edit_cat.php, edit_lock.php, + and edit_form.php. + + Impact: + Exploitation will allow an attacker to gain administrative access and bypass + authentication. + + Impact Level: System + + Affected Software/OS: + aflog versions 1.01 and prior on all running platform + + Fix: No solution/patch is available as on 10th November, 2008. Information + regarding this issue will updated once the solution details are available. + For updates refer, http://e107.org/edownload.php + + References: + http://www.milw0rm.com/exploits/6818 + http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2008-4784 + + CVSS Score: + CVSS Base Score : 6.4 (AV:N/AC:L/Au:NR/C:P/I:P/A:N) + CVSS Temporal Score : 5.8 + Risk factor: High"; + + script_description(english:desc["english"]); + script_summary(english:"Check for the Version of aflog"); + script_category(ACT_GATHER_INFO); + script_copyright(english:"Copyright (C) 2008 Intevation GmbH"); + script_family(english:"CGI abuses"); + script_dependencies("http_version.nasl"); + script_require_ports("Services/www", 80); + exit(0); +} + + +include("http_func.inc"); +include("http_keepalive.inc"); + +port = get_http_port(default:80); +if(!port){ + exit(0); +} + +foreach path (make_list("/aflog", cgi_dirs())) +{ + sndReq = http_get(item:string(path, "/Readme.txt"), port:port); + rcvRes = http_keepalive_send_recv(port:port, data:sndReq); + if(rcvRes == NULL){ + exit(0); + } + + if(egrep(pattern:"Aflog v1.01", string:rcvRes) && + egrep(pattern:"^HTTP/.* 200 OK", string:rcvRes)) + { + security_warning(port); + exit(0); + } +} Property changes on: trunk/openvas-plugins/scripts/gb_aflog_cookie_auth_bypass_vuln.nasl ___________________________________________________________________ Name: svn:executable + * Added: trunk/openvas-plugins/scripts/gb_e107_alternate_profiles_remote_sql_inj_vuln.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_e107_alternate_profiles_remote_sql_inj_vuln.nasl 2008-11-10 11:58:01 UTC (rev 1688) +++ trunk/openvas-plugins/scripts/gb_e107_alternate_profiles_remote_sql_inj_vuln.nasl 2008-11-11 08:00:11 UTC (rev 1689) @@ -0,0 +1,98 @@ +############################################################################### +# OpenVAS Vulnerability Test +# $Id: gb_e107_alternate_profiles_remote_sql_inj_vuln.nasl 414 2008-11-07 18:40:11Z nov $ +# +# e107 alternate_profiles plugin newuser.php SQL Injection Vulnerability +# +# Authors: +# Sharath S +# +# Copyright: +# Copyright (c) 2008 Intevation GmbH, http://www.intevation.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# (or any later version), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################### + +if(description) +{ + script_id(800303); + script_version("$Revision: 1.0 $"); + script_cve_id("CVE-2008-4785"); + script_bugtraq_id(31940); + script_name(english:"e107 alternate_profiles plugin newuser.php SQL Injection Vulnerability"); + desc["english"] = " + + Overview: This host is running e107 and is prone to remote SQL injection + vulnerability. + + Vulnerability Insight: + The flaw exists in newuser.php file, which does not validate user input data + in the alternate_profiles via the id parameter. + + Impact: + Successful exploitation could allow an attacker to compromise the application, + access or modify data in the underlying database. + + Impact Level: Application + + Affected Software/OS: + e107 version 0.7.13, alternate_profiles plugin on all running platform + + Fix: No solution/patch is available as on 10th November, 2008. Information + regarding this issue will updated once the solution details are available. + For updates refer, http://e107.org/edownload.php + + References: + http://www.milw0rm.com/exploits/6849 + http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2008-4785 + + CVSS Score: + CVSS Base Score : 7.5 (AV:N/AC:L/Au:NR/C:P/I:P/A:P) + CVSS Temporal Score : 6.7 + Risk factor: High"; + + script_description(english:desc["english"]); + script_summary(english:"Check for the Version of e107"); + script_category(ACT_GATHER_INFO); + script_copyright(english:"Copyright (C) 2008 Intevation GmbH"); + script_family(english:"CGI abuses"); + script_dependencies("http_version.nasl"); + script_require_ports("Services/www", 80); + exit(0); +} + + +include("http_func.inc"); +include("http_keepalive.inc"); + +port = get_http_port(default:80); +if(!port){ + exit(0); +} + +foreach path (make_list("/e107/e107_plugins/alternate_profiles", cgi_dirs())) +{ + sndReq = http_get(item:string(path, "/newuser.php"), port:port); + rcvRes = http_keepalive_send_recv(port:port, data:sndReq); + if(rcvRes == NULL){ + exit(0); + } + + if(egrep(pattern:"newuser", string:rcvRes) && + egrep(pattern:"^HTTP/.* 200 OK", string:rcvRes)) + { + security_warning(port); + exit(0); + } +} Property changes on: trunk/openvas-plugins/scripts/gb_e107_alternate_profiles_remote_sql_inj_vuln.nasl ___________________________________________________________________ Name: svn:executable + * Added: trunk/openvas-plugins/scripts/gb_e107_easyshop_remote_sql_inj_vuln.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_e107_easyshop_remote_sql_inj_vuln.nasl 2008-11-10 11:58:01 UTC (rev 1688) +++ trunk/openvas-plugins/scripts/gb_e107_easyshop_remote_sql_inj_vuln.nasl 2008-11-11 08:00:11 UTC (rev 1689) @@ -0,0 +1,97 @@ +############################################################################### +# OpenVAS Vulnerability Test +# $Id: gb_e107_easyshop_remote_sql_inj_vuln.nasl 415 2008-11-07 15:44:11Z nov $ +# +# e107 EasyShop plugin easyshop.php SQL Injection Vulnerability +# +# Authors: +# Sharath S +# +# Copyright: +# Copyright (c) 2008 Intevation GmbH, http://www.intevation.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# (or any later version), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################### + +if(description) +{ + script_id(800302); + script_version("$Revision: 1.0 $"); + script_cve_id("CVE-2008-4786"); + script_name(english:"e107 EasyShop plugin easyshop.php SQL Injection Vulnerability"); + desc["english"] = " + + Overview: This host is running e107 and is prone to SQL injection vulnerability. + + Vulnerability Insight: + The flaw exists due to easyshop.php file in the EasyShop plugin, which can be + exploited to conduct SQL injection by using execute commands via the + category_id parameter. + + Impact: + Successful exploitation could allow remote attackers to execute arbitrary + SQL commands. + + Impact Level: Application + + Affected Software/OS: + e107 version 0.7.13, EasyShop Plugin. + + Fix: No solution/patch is available as on 10th November, 2008. Information + regarding this issue will updated once the solution details are available. + For updates refer, http://e107.org/edownload.php + + References: + http://www.milw0rm.com/exploits/6852 + http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2008-4786 + + CVSS Score: + CVSS Base Score : 7.5 (AV:N/AC:L/Au:NR/C:P/I:P/A:P) + CVSS Temporal Score : 6.7 + Risk factor: High"; + + script_description(english:desc["english"]); + script_summary(english:"Check for the Version of e107"); + script_category(ACT_GATHER_INFO); + script_copyright(english:"Copyright (C) 2008 Intevation GmbH"); + script_family(english:"CGI abuses"); + script_dependencies("http_version.nasl"); + script_require_ports("Services/www", 80); + exit(0); +} + + +include("http_func.inc"); +include("http_keepalive.inc"); + +port = get_http_port(default:80); +if(!port){ + exit(0); +} + +foreach path (make_list("/e107/e107_plugins/easyshop", cgi_dirs())) +{ + sndReq = http_get(item:string(path, "/easyshop.php?allcat"), port:port); + rcvRes = http_keepalive_send_recv(port:port, data:sndReq); + if(rcvRes == NULL){ + exit(0); + } + + if(egrep(pattern:"e107 Powered Website: EasyShop", string:rcvRes) && + egrep(pattern:"^HTTP/.* 200 OK", string:rcvRes)) + { + security_warning(port); + exit(0); + } +} Property changes on: trunk/openvas-plugins/scripts/gb_e107_easyshop_remote_sql_inj_vuln.nasl ___________________________________________________________________ Name: svn:executable + * Added: trunk/openvas-plugins/scripts/gb_openoffice_senddoc_tmp_file_creation_vuln_lin.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_openoffice_senddoc_tmp_file_creation_vuln_lin.nasl 2008-11-10 11:58:01 UTC (rev 1688) +++ trunk/openvas-plugins/scripts/gb_openoffice_senddoc_tmp_file_creation_vuln_lin.nasl 2008-11-11 08:00:11 UTC (rev 1689) @@ -0,0 +1,99 @@ +############################################################################### +# OpenVAS Vulnerability Test +# $Id: gb_openoffice_senddoc_tmp_file_creation_vuln_lin.nasl 0438 2008-11-05 15:18:12Z nov $ +# +# OpenOffice senddoc Insecure Temporary File Creation Vulnerability (Linux) +# +# Authors: +# Veerendra GG +# +# Copyright: +# Copyright (c) 2008 Intevation GmbH, http://www.intevation.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# (or any later version), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################### + +if(description) +{ + script_id(800129); + script_version("$Revision: 1.0$"); + script_cve_id("CVE-2008-4937"); + script_bugtraq_id(30925); + script_name(english:"OpenOffice senddoc Insecure Temporary File Creation Vulnerability (Linux)"); + desc["english"] = " + + Overview: The host has OpenOffice installed and is prone to Insecure + Temporary File Creation Vulnerability. + + Vulnerability Insight: + The flaw exists due to OpenOffice 'senddoc' which creates temporary files + in an insecure manner, which allows users to overwrite files via a symlink + attack on a /tmp/log.obr.##### temporary file. + + Impact: Successful exploitation allows attackers to delete or corrupt + sensitive files, which may result in a denial of service condtion. + + Impact Level: Application + + Affected Software/OS: + OpenOffice.org 2.4.1 on Linux. + + Fix: Upgrade OpenOffice to higher version. + http://download.openoffice.org/index.html + + References: + http://www.openwall.com/lists/oss-security/2008/10/30/2 + http://dev.gentoo.org/~rbu/security/debiantemp/openoffice.org-common + + CVSS Score: + CVSS Base Score : 7.6 (AV:N/AC:H/Au:NR/C:C/I:C/A:C) + CVSS Temporal Score : 5.6 + Risk factor: High"; + + script_description(english:desc["english"]); + script_summary(english:"Check for the version of OpenOffice"); + script_category(ACT_GATHER_INFO); + script_copyright(english:"Copyright (C) 2008 Intevation GmbH"); + script_family(english:"Misc."); + exit(0); +} + + +include("version_func.inc"); + +sock = ssh_login_or_reuse_connection(); +if(!sock){ + exit(0); +} + +filePath = find_file(file_name:"versionrc", sock:sock); +foreach path (filePath) +{ + path = chomp(path); + if("openoffice" >!< path){ + continue; + } + + openoffVer = get_bin_version(full_prog_name:"cat", version_argv:path, + ver_pattern:"[0-9]\.[0-9](\.[0-9])?"); + if(openoffVer != NULL) + { + if(openoffVer[0] == "2.4.1"){ + security_hole(0); + } + ssh_close_connection(); + exit(0); + } +} +ssh_close_connection(); Property changes on: trunk/openvas-plugins/scripts/gb_openoffice_senddoc_tmp_file_creation_vuln_lin.nasl ___________________________________________________________________ Name: svn:executable + * Added: trunk/openvas-plugins/scripts/gb_openoffice_senddoc_tmp_file_creation_vuln_win.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_openoffice_senddoc_tmp_file_creation_vuln_win.nasl 2008-11-10 11:58:01 UTC (rev 1688) +++ trunk/openvas-plugins/scripts/gb_openoffice_senddoc_tmp_file_creation_vuln_win.nasl 2008-11-11 08:00:11 UTC (rev 1689) @@ -0,0 +1,95 @@ +############################################################################### +# OpenVAS Vulnerability Test +# $Id: gb_openoffice_senddoc_tmp_file_creation_vuln_win.nasl 0438 2008-11-05 12:33:52Z nov $ +# +# OpenOffice senddoc Insecure Temporary File Creation Vulnerability (Win) +# +# Authors: +# Veerendra GG +# +# Copyright: +# Copyright (c) 2008 Intevation GmbH, http://www.intevation.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# (or any later version), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################### + +if(description) +{ + script_id(800128); + script_version("$Revision: 1.0$"); + script_cve_id("CVE-2008-4937"); + script_bugtraq_id(30925); + script_name(english:"OpenOffice senddoc Insecure Temporary File Creation Vulnerability (Win)"); + desc["english"] = " + + Overview: The host has OpenOffice installed and is prone to Insecure + Temporary File Creation Vulnerability. + + Vulnerability Insight: + The flaw exists due to OpenOffice 'senddoc' which creates temporary files in an + insecure manner, that allows users to overwrite files via a symlink attack + on a /tmp/log.obr.##### temporary file. + + Impact: Successful exploitation allows attackers to delete or corrupt + sensitive files, which may result in a denial of service condition. + + Impact Level: Application + + Affected Software/OS: + OpenOffice.org 2.4.1 on Windows (Any). + + Fix: Upgrade OpenOffice higher version. + http://download.openoffice.org/index.html + + References: + http://www.openwall.com/lists/oss-security/2008/10/30/2 + + CVSS Score: + CVSS Base Score : 7.6 (AV:N/AC:H/Au:NR/C:C/I:C/A:C) + CVSS Temporal Score : 5.6 + Risk factor: High"; + + script_description(english:desc["english"]); + script_summary(english:"Check for the version of OpenOffice"); + script_category(ACT_GATHER_INFO); + script_copyright(english:"Copyright (C) 2008 Intevation GmbH"); + script_family(english:"Misc."); + script_dependencies("secpod_reg_enum.nasl"); + script_require_keys("SMB/WindowsVersion"); + exit(0); +} + + +include("smb_nt.inc"); +include("version_func.inc"); +include("secpod_smb_func.inc"); + +if(!get_kb_item("SMB/WindowsVersion")){ + exit(0); +} + +key = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"; +keys = registry_enum_keys(key); + +foreach item (keys) +{ + if("OpenOffice.org" >< registry_get_sz(key:key + item, item:"DisplayName")) + { + openOffVer = registry_get_sz(key:key + item, item:"DisplayVersion"); + if(openOffVer == "2.4.9310"){ + security_hole(0); + } + exit(0); + } +} Property changes on: trunk/openvas-plugins/scripts/gb_openoffice_senddoc_tmp_file_creation_vuln_win.nasl ___________________________________________________________________ Name: svn:executable + * Added: trunk/openvas-plugins/scripts/gb_python_imageop_bof_vuln_win.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_python_imageop_bof_vuln_win.nasl 2008-11-10 11:58:01 UTC (rev 1688) +++ trunk/openvas-plugins/scripts/gb_python_imageop_bof_vuln_win.nasl 2008-11-11 08:00:11 UTC (rev 1689) @@ -0,0 +1,96 @@ +############################################################################### +# OpenVAS Vulnerability Test +# $Id: gb_python_imageop_bof_vuln_win.nasl 421 2008-11-06 12:27:02Z nov $ +# +# Python Imageop Module imageop.crop() BOF Vulnerability (Win) +# +# Authors: +# Chandan S +# +# Copyright: +# Copyright (c) 2008 Intevation GmbH, http://www.intevation.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# (or any later version), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################### + +if(description) +{ + script_id(800052); + script_version("$Revision: 1.0 $"); + script_cve_id("CVE-2008-4864"); + script_bugtraq_id(31976); + script_name(english:"Python Imageop Module imageop.crop() BOF Vulnerability (Win)"); + desc["english"] = " + + Overview: This host has Python installed and is prone to buffer overflow + vulnerability. + + Vulnerability Insight: + The flaw exists due the the way module imageop.crop() handles the arguments + as input in imageop.c file. + + Impact: + Remote exploitation will allow execution of arbitrary code via large number + of integer values to crop module, which leads to a buffer overflow + (Segmentation fault). + + Impact Level: Application + + Affected Software/OS: + Python 1.5.2 to 2.5.1 on Windows + + Fix: Upgrade to Python 2.5.2 + http://www.python.org/ + + CVSS Score: + CVSS Base Score : 7.5 (AV:N/AC:L/Au:NR/C:P/I:P/A:P) + CVSS Temporal Score : 5.9 + Risk factor: High"; + + script_description(english:desc["english"]); + script_summary(english:"Check for the version of Python"); + script_category(ACT_GATHER_INFO); + script_copyright(english:"Copyright (C) 2008 Intevation GmbH"); + script_family(english:"Misc."); + script_dependencies("secpod_reg_enum.nasl"); + script_require_keys("SMB/WindowsVersion"); + exit(0); +} + + +include("smb_nt.inc"); +include("version_func.inc"); +include("secpod_smb_func.inc"); + +if(!(get_kb_item("SMB/WindowsVersion"))){ + exit(0); +} + +key = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"; +foreach entry (registry_enum_keys(key:key)) +{ + pyName = registry_get_sz(key:key + entry, item:"DisplayName"); + if("Python" >< pyName) + { + pyVer = eregmatch(pattern:"[0-9.]+", string:pyName); + if(pyVer != NULL) + { + if(version_in_range(version:pyVer[0], test_version:"1.5.2", + test_version2:"2.5.1")){ + security_hole(0); + } + } + exit(0); + } +} From scm-commit at wald.intevation.org Tue Nov 11 09:14:20 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Tue, 11 Nov 2008 09:14:20 +0100 (CET) Subject: [Openvas-commits] r1690 - in trunk/openvas-plugins: . scripts Message-ID: <20081111081420.0F9A740769@pyrosoma.intevation.org> Author: chandra Date: 2008-11-11 09:14:20 +0100 (Tue, 11 Nov 2008) New Revision: 1690 Added: trunk/openvas-plugins/scripts/gb_twiki_tmp_file_handling_vuln.nasl Modified: trunk/openvas-plugins/ChangeLog Log: Added new plugin Modified: trunk/openvas-plugins/ChangeLog =================================================================== --- trunk/openvas-plugins/ChangeLog 2008-11-11 08:00:11 UTC (rev 1689) +++ trunk/openvas-plugins/ChangeLog 2008-11-11 08:14:20 UTC (rev 1690) @@ -4,6 +4,7 @@ scripts/gb_e107_easyshop_remote_sql_inj_vuln.nasl, scripts/gb_python_imageop_bof_vuln_win.nasl, scripts/gb_openoffice_senddoc_tmp_file_creation_vuln_lin.nasl, + scripts/gb_twiki_tmp_file_handling_vuln.nasl, scripts/gb_openoffice_senddoc_tmp_file_creation_vuln_win.nasl: Added new plugins Added: trunk/openvas-plugins/scripts/gb_twiki_tmp_file_handling_vuln.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_twiki_tmp_file_handling_vuln.nasl 2008-11-11 08:00:11 UTC (rev 1689) +++ trunk/openvas-plugins/scripts/gb_twiki_tmp_file_handling_vuln.nasl 2008-11-11 08:14:20 UTC (rev 1690) @@ -0,0 +1,103 @@ +############################################################################### +# OpenVAS Vulnerability Test +# $Id: gb_twiki_tmp_file_handling_vuln.nasl 0456 2008-11-10 14:59:17Z nov $ +# +# Insecure tempfile handling Vulnerability in TWiki - Sep08 +# +# Authors: +# Veerendra GG +# +# Copyright: +# Copyright (c) 2008 Intevation GmbH, http://www.intevation.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# (or any later version), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################### + +if(description) +{ + script_id(800130); + script_version("$Revision: 1.0 $"); + script_cve_id("CVE-2008-4998"); + script_name(english:"Insecure tempfile handling Vulnerability in TWiki - Sep08"); + desc["english"] = " + + Overview: The host is running TWiki which is prone to Insecure temp file + handling Vulnerability. + + Vulnerability Insight: + Local users can overwrite arbitrary files via a symlink attack on the + /tmp/twiki temporary file. + + Impact: + Successful attack could lead to rewriting some system file. + + Impact Level: Application + + Affected Software/OS: + TWiki Version 4.1.2. + + Fix: Upgrade TWiki to higher version. + http://twiki.org/ + + References: + http://www.openwall.com/lists/oss-security/2008/10/30/2 + http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=494648 + + CVSS Score: + CVSS Base Score : 5.8 (AV:N/AC:M/Au:NR/C:P/I:P/A:N) + CVSS Temporal Score : 4.3 + Risk factor: Medium"; + + script_description(english:desc["english"]); + script_summary(english:"Check for the Version of TWiki"); + script_category(ACT_GATHER_INFO); + script_copyright(english:"Copyright (C) 2008 Intevation GmbH"); + script_family(english:"Misc."); + script_require_ports("Services/www", 80); + exit(0); +} + + +include("http_func.inc"); +include("version_func.inc"); + +port = get_http_port(default:80); +if(!port){ + exit(0); +} + +dirs = make_list("/twiki", cgi_dirs()); +foreach dir (dirs) +{ + soc = http_open_socket(port); + if(!soc){ + exit(0); + } + + sndReq = http_get(item:dir + "/bin/view/TWiki/WebHome", port:port); + send(socket:soc, data:sndReq); + rcvRes = http_recv(socket:soc); + + http_close_socket(soc); + + if(rcvRes =~ "Powered by TWiki") + { + twikiVer = eregmatch(pattern:"TWiki-([0-9.]+),", string:rcvRes); + + if(twikiVer[1] == "4.1.2"){ + security_warning(port); + } + exit(0); + } +} Property changes on: trunk/openvas-plugins/scripts/gb_twiki_tmp_file_handling_vuln.nasl ___________________________________________________________________ Name: svn:executable + * From scm-commit at wald.intevation.org Tue Nov 11 15:25:09 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Tue, 11 Nov 2008 15:25:09 +0100 (CET) Subject: [Openvas-commits] r1691 - in trunk/openvas-libraries: . libopenvas Message-ID: <20081111142509.011AA40741@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-11 15:25:08 +0100 (Tue, 11 Nov 2008) New Revision: 1691 Modified: trunk/openvas-libraries/ChangeLog trunk/openvas-libraries/libopenvas/store.c Log: * libopenvas/store.c (store_load_plugin): Fixed usage of legacy ID scheme that resulted in an incorrect OID being transmitted to the client when processing NVTs without any legacy ID. Modified: trunk/openvas-libraries/ChangeLog =================================================================== --- trunk/openvas-libraries/ChangeLog 2008-11-11 08:14:20 UTC (rev 1690) +++ trunk/openvas-libraries/ChangeLog 2008-11-11 14:25:08 UTC (rev 1691) @@ -1,3 +1,9 @@ +2008-11-11 Michael Wiegand + + * libopenvas/store.c (store_load_plugin): Fixed usage of legacy ID + scheme that resulted in an incorrect OID being transmitted to the client + when processing NVTs without any legacy ID. + 2008-11-10 Michael Wiegand Removed local copies of getopt; the functionality provided by getopt has Modified: trunk/openvas-libraries/libopenvas/store.c =================================================================== --- trunk/openvas-libraries/libopenvas/store.c 2008-11-11 08:14:20 UTC (rev 1690) +++ trunk/openvas-libraries/libopenvas/store.c 2008-11-11 14:25:08 UTC (rev 1691) @@ -367,7 +367,7 @@ ret = emalloc(sizeof(struct arglist)); - plug_set_id(ret, p.id); + plug_set_oid(ret, p.oid); plug_set_category(ret, p.category); plug_set_fname(ret, file); plug_set_path(ret, p.path); From scm-commit at wald.intevation.org Tue Nov 11 15:58:45 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Tue, 11 Nov 2008 15:58:45 +0100 (CET) Subject: [Openvas-commits] r1692 - in trunk/openvas-plugins: . scripts Message-ID: <20081111145845.A6845406C2@pyrosoma.intevation.org> Author: chandra Date: 2008-11-11 15:58:44 +0100 (Tue, 11 Nov 2008) New Revision: 1692 Added: trunk/openvas-plugins/scripts/secpod_chilkat_crypt_activex_cntl_vuln_900171.nasl trunk/openvas-plugins/scripts/secpod_ms_win_media_player_detect_900173.nasl trunk/openvas-plugins/scripts/secpod_ms_win_media_player_dos_vuln_900172.nasl Modified: trunk/openvas-plugins/ChangeLog Log: Added new plugins Modified: trunk/openvas-plugins/ChangeLog =================================================================== --- trunk/openvas-plugins/ChangeLog 2008-11-11 14:25:08 UTC (rev 1691) +++ trunk/openvas-plugins/ChangeLog 2008-11-11 14:58:44 UTC (rev 1692) @@ -1,4 +1,10 @@ 2008-11-11 Chandrashekhar B + * scripts/secpod_chilkat_crypt_activex_cntl_vuln_900171.nasl, + scripts/secpod_ms_win_media_player_detect_900173.nasl, + scripts/secpod_ms_win_media_player_dos_vuln_900172.nasl: + Added new plugins + +2008-11-11 Chandrashekhar B * scripts/gb_aflog_cookie_auth_bypass_vuln.nasl, scripts/gb_e107_alternate_profiles_remote_sql_inj_vuln.nasl, scripts/gb_e107_easyshop_remote_sql_inj_vuln.nasl, Added: trunk/openvas-plugins/scripts/secpod_chilkat_crypt_activex_cntl_vuln_900171.nasl =================================================================== --- trunk/openvas-plugins/scripts/secpod_chilkat_crypt_activex_cntl_vuln_900171.nasl 2008-11-11 14:25:08 UTC (rev 1691) +++ trunk/openvas-plugins/scripts/secpod_chilkat_crypt_activex_cntl_vuln_900171.nasl 2008-11-11 14:58:44 UTC (rev 1692) @@ -0,0 +1,109 @@ +############################################################################## +# +# Chilkat Crypt ActiveX Control 'ChilkatCrypt2.dll' File Overwrite Vulnerability +# +# Copyright: SecPod +# +# Date Written: 2008/11/05 +# +# Revision: 1.0 +# +# Log: ssharath +# Issue #0435 +# ------------------------------------------------------------------------ +# This program was written by SecPod and is licensed under the GNU GPL +# license. Please refer to the below link for details, +# http://www.gnu.org/licenses/gpl.html +# This header contains information regarding licensing terms under the GPL, +# and information regarding obtaining source code from the Author. +# Consequently, pursuant to section 3(c) of the GPL, you must accompany the +# information found in this header with any distribution you make of this +# Program. +# ------------------------------------------------------------------------ +############################################################################## + +if(description) +{ + script_id(900171); + script_bugtraq_id(32073); + script_copyright(english:"Copyright (C) 2008 SecPod"); + script_version("Revision: 1.0 "); + script_category(ACT_GATHER_INFO); + script_family(english:"Misc."); + script_name(english:"Chilkat Crypt ActiveX Control 'ChilkatCrypt2.dll' File Overwrite Vulnerability"); + script_summary(english:"Check for vulnerable version of Chilkat Crypt"); + desc["english"] = " + + Overview: The host is installed Chilkat Crypt, which is prone to ActiveX + Control based arbitrary file overwrite vulnerability. + + Vulnerability Insight: + The vulnerability is caused due to the error in the 'ChilkatCrypt2.dll' ActiveX + Control component that does not restrict access to the 'WriteFile()' method. + + Impact: + Successful exploitation will allow execution of arbitrary code. + + Impact Level: Application + + Affected Software/OS: + Chilkat Crypt ActiveX Component version 4.3.2.1 and prior + + Fix: Set the kill-bit for the CLSID {3352B5B9-82E8-4FFD-9EB1-1A3E60056904}. + No solution/patch is available as on 05th November, 2008. + + References: + http://milw0rm.com/exploits/6963 + http://secunia.com/advisories/32513/ + + CVSS Score: + CVSS Base Score : 8.8 (AV:N/AC:M/Au:NR/C:C/I:C/A:N) + CVSS Temporal Score : 7.9 + Risk factor : High"; + + script_description(english:desc["english"]); + script_dependencies("secpod_reg_enum.nasl"); + script_require_keys("SMB/WindowsVersion"); + exit(0); +} + + +include("secpod_smb_func.inc"); + +if(!get_kb_item("SMB/WindowsVersion")){ + exit(0); +} + +key = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"; +enumKeys = registry_enum_keys(key); + +if(!enumKeys){ + exit(0); +} + +foreach entry (enumKeys) +{ + if("Chilkat Crypt ActiveX" >< + registry_get_sz(key: key + entry, item:"DisplayName")) + { + # Grep for version 4.3.2.1 and prior + if(egrep(pattern:"^4\.([0-2](\..*)?|3(\.[0-2](\.[01])?)?)$", + string:registry_get_sz(key: key + entry, item:"DisplayVersion"))) + { + # Check if Kill-Bit is set for ActiveX control + clsid = "{3352B5B9-82E8-4FFD-9EB1-1A3E60056904}"; + regKey = "SOFTWARE\Classes\CLSID\" + clsid; + if(registry_key_exists(key:regKey)) + { + activeKey = "SOFTWARE\Microsoft\Internet Explorer\" + + "ActiveX Compatibility\" + clsid; + killBit = registry_get_dword(key:activeKey, item:"Compatibility Flags"); + if(killBit && (int(killBit) == 1024)){ + exit(0); + } + security_warning(0); + } + } + exit(0); + } +} Added: trunk/openvas-plugins/scripts/secpod_ms_win_media_player_detect_900173.nasl =================================================================== --- trunk/openvas-plugins/scripts/secpod_ms_win_media_player_detect_900173.nasl 2008-11-11 14:25:08 UTC (rev 1691) +++ trunk/openvas-plugins/scripts/secpod_ms_win_media_player_detect_900173.nasl 2008-11-11 14:58:44 UTC (rev 1692) @@ -0,0 +1,71 @@ +############################################################################## +# +# Microsoft Windows Media Player Version Detection +# +# Copyright: SecPod +# +# Date Written: 2008/11/06 +# +# Revision: 1.0 +# +# Log: ssharath +# Issue #0437 +# ------------------------------------------------------------------------ +# This program was written by SecPod and is licensed under the GNU GPL +# license. Please refer to the below link for details, +# http://www.gnu.org/licenses/gpl.html +# This header contains information regarding licensing terms under the GPL, +# and information regarding obtaining source code from the Author. +# Consequently, pursuant to section 3(c) of the GPL, you must accompany the +# information found in this header with any distribution you make of this +# Program. +# ------------------------------------------------------------------------ +############################################################################## + +if(description) +{ + script_id(900173); + script_copyright(english:"Copyright (C) 2008 SecPod"); + script_version("Revision: 1.0 "); + script_category(ACT_GATHER_INFO); + script_family(english:"General"); + script_name(english:"Microsoft Windows Media Player Version Detection"); + script_summary(english:"Set File Version of Windows Media Player in KB"); + desc["english"] = " + Overview : This script find the Windows Media Player installed version and + save the version in KB. + + Risk factor : Informational"; + + script_description(english:desc["english"]); + script_dependencies("secpod_reg_enum.nasl"); + script_require_keys("SMB/WindowsVersion"); + exit(0); +} + + +include("secpod_smb_func.inc"); + +if(!get_kb_item("SMB/WindowsVersion")){ + exit(0); +} + +keyX = "SOFTWARE\Microsoft\Active setup\Installed Components\"; + +# CLSID matchs with Win Media Player versions 7 or above +wmpVer = registry_get_sz(key:keyX + "{6BF52A52-394A-11d3-B153-00C04F79FAA6}", + item:"Version"); +if(!wmpVer) +{ + wmpVer = registry_get_sz(key:keyX + "{22d6f312-b0f6-11d0-94ab-0080c74c7e95}", + item:"Version"); + if(!wmpVer){ + exit(0); + } +} + +# For replacing comma (,) with dot (.) +wmpVer = ereg_replace(string:wmpVer, pattern:",", replace:"."); + +# Set the KB item for Windows Media Player. +set_kb_item(name:"Win/MediaPlayer/Ver", value:wmpVer); Added: trunk/openvas-plugins/scripts/secpod_ms_win_media_player_dos_vuln_900172.nasl =================================================================== --- trunk/openvas-plugins/scripts/secpod_ms_win_media_player_dos_vuln_900172.nasl 2008-11-11 14:25:08 UTC (rev 1691) +++ trunk/openvas-plugins/scripts/secpod_ms_win_media_player_dos_vuln_900172.nasl 2008-11-11 14:58:44 UTC (rev 1692) @@ -0,0 +1,79 @@ +############################################################################## +# +# Microsoft Windows Media Player 'MIDI' or 'DAT' File DoS Vulnerability +# +# Copyright: SecPod +# +# Date Written: 2008/11/05 +# +# Revision: 1.0 +# +# Log: ssharath +# Issue #0437 +# ------------------------------------------------------------------------ +# This program was written by SecPod and is licensed under the GNU GPL +# license. Please refer to the below link for details, +# http://www.gnu.org/licenses/gpl.html +# This header contains information regarding licensing terms under the GPL, +# and information regarding obtaining source code from the Author. +# Consequently, pursuant to section 3(c) of the GPL, you must accompany the +# information found in this header with any distribution you make of this +# Program. +# ------------------------------------------------------------------------ +############################################################################## + +if(description) +{ + script_id(900172); + script_bugtraq_id(32077); + script_cve_id("CVE-2008-4927"); + script_copyright(english:"Copyright (C) 2008 SecPod"); + script_version("Revision: 1.0 "); + script_category(ACT_GATHER_INFO); + script_family(english:"Denial of Service"); + script_name(english:"Microsoft Windows Media Player 'MIDI' or 'DAT' File DoS Vulnerability"); + script_summary(english:"Check for vulnerable version of Windows Media Player"); + desc["english"] = " + Overview: This host is installed with Windows Media Player and is prone to + denial of service vulnerability. + + The vulnerability is caused due to error in handling 'MIDI' or 'DAT' file, + related to 'MThd Header Parsing'. + + Impact: + Successful exploitation will cause denial of service. + + Impact Level: Application + + Affected Software/OS: + Microsoft Windows Media Player versions 9.x, 10.x and 11.x + + Fix: No solution/patch is available as on 05th November, 2008. + + References: + http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2008-4927 + http://www.securityfocus.com/data/vulnerabilities/exploits/32077.py + + CVSS Score: + CVSS Base Score : 7.1 (AV:N/AC:M/Au:NR/C:N/I:N/A:C) + CVSS Temporal Score : 6.1 + Risk factor : High"; + + script_description(english:desc["english"]); + script_dependencies("secpod_reg_enum.nasl", + "secpod_ms_win_media_player_detect_900173.nasl"); + script_require_keys("SMB/WindowsVersion"); + exit(0); +} + + +include("smb_nt.inc"); + +if(!get_kb_item("SMB/WindowsVersion")){ + exit(0); +} + +# Check the versions 9.x , 10.x and 11.x +if(get_kb_item("Win/MediaPlayer/Ver") =~ "^(9|1[01])\..*$"){ + security_warning(0); +} From scm-commit at wald.intevation.org Tue Nov 11 16:24:42 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Tue, 11 Nov 2008 16:24:42 +0100 (CET) Subject: [Openvas-commits] r1693 - in trunk/openvas-libraries: . libopenvas Message-ID: <20081111152442.C5DA440740@pyrosoma.intevation.org> Author: jan Date: 2008-11-11 16:24:42 +0100 (Tue, 11 Nov 2008) New Revision: 1693 Modified: trunk/openvas-libraries/ChangeLog trunk/openvas-libraries/libopenvas/network.c trunk/openvas-libraries/libopenvas/network.h Log: * libopenvas/network.c (ovas_get_connection_data): Renamed to ovas_get_tlssession_from_connection and made it return the tls session directly instead of connection data. This way it is avoided to expose the internal data structure "nessus_connection". It remains internal now. * libopenvas/network.h: Updated proto accordingly and added include for now-necessary gnutls.h. Modified: trunk/openvas-libraries/ChangeLog =================================================================== --- trunk/openvas-libraries/ChangeLog 2008-11-11 14:58:44 UTC (rev 1692) +++ trunk/openvas-libraries/ChangeLog 2008-11-11 15:24:42 UTC (rev 1693) @@ -1,3 +1,14 @@ +2008-11-11 Jan-Oliver Wagner + + * libopenvas/network.c (ovas_get_connection_data): Renamed to + ovas_get_tlssession_from_connection and made it return the + tls session directly instead of connection data. + This way it is avoided to expose the internal data + structure "nessus_connection". It remains internal now. + + * libopenvas/network.h: Updated proto accordingly and added + include for now-necessary gnutls.h. + 2008-11-11 Michael Wiegand * libopenvas/store.c (store_load_plugin): Fixed usage of legacy ID Modified: trunk/openvas-libraries/libopenvas/network.c =================================================================== --- trunk/openvas-libraries/libopenvas/network.c 2008-11-11 14:58:44 UTC (rev 1692) +++ trunk/openvas-libraries/libopenvas/network.c 2008-11-11 15:24:42 UTC (rev 1693) @@ -423,13 +423,16 @@ return fp->fd; } -void* -ovas_get_connection_data(fd) +gnutls_session_t * +ovas_get_tlssession_from_connection(fd) int fd; { - if (NESSUS_STREAM(fd)) - return (void*) &(connections[fd - NESSUS_FD_OFF]); - return NULL; + nessus_connection *fp; + + if (!NESSUS_STREAM(fd)) return NULL; + + fp = connections + (fd - NESSUS_FD_OFF); + return fp->tls_session; } static int Modified: trunk/openvas-libraries/libopenvas/network.h =================================================================== --- trunk/openvas-libraries/libopenvas/network.h 2008-11-11 14:58:44 UTC (rev 1692) +++ trunk/openvas-libraries/libopenvas/network.h 2008-11-11 15:24:42 UTC (rev 1693) @@ -27,6 +27,7 @@ #define OPENVAS_NETWORK_H #include /* at least for fd_set */ +#include #include "arglists.h" @@ -87,7 +88,7 @@ int nessus_register_connection(int, void*); int nessus_deregister_connection(int); int nessus_get_socket_from_connection(int); -void* ovas_get_connection_data(int); +gnutls_session_t* ovas_get_tlssession_from_connection(int); int stream_zero(fd_set*); int stream_set(int, fd_set*); From scm-commit at wald.intevation.org Tue Nov 11 16:57:28 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Tue, 11 Nov 2008 16:57:28 +0100 (CET) Subject: [Openvas-commits] r1694 - in trunk: . openvas-manager openvas-manager/src Message-ID: <20081111155728.54A3740722@pyrosoma.intevation.org> Author: jan Date: 2008-11-11 16:57:28 +0100 (Tue, 11 Nov 2008) New Revision: 1694 Added: trunk/openvas-manager/ trunk/openvas-manager/COPYING trunk/openvas-manager/ChangeLog trunk/openvas-manager/README trunk/openvas-manager/VERSION trunk/openvas-manager/src/ trunk/openvas-manager/src/Makefile trunk/openvas-manager/src/openvasmd.c Log: Starting module "openvas-manager". * COPYING, ChangeLog, README, src/Makefile, src/openvasmd.c: New. Added: trunk/openvas-manager/COPYING =================================================================== --- trunk/openvas-manager/COPYING 2008-11-11 15:24:42 UTC (rev 1693) +++ trunk/openvas-manager/COPYING 2008-11-11 15:57:28 UTC (rev 1694) @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. Added: trunk/openvas-manager/ChangeLog =================================================================== --- trunk/openvas-manager/ChangeLog 2008-11-11 15:24:42 UTC (rev 1693) +++ trunk/openvas-manager/ChangeLog 2008-11-11 15:57:28 UTC (rev 1694) @@ -0,0 +1,5 @@ +2008-11-11 Jan-Oliver Wagner + + Starting module "openvas-manager". + + * COPYING, ChangeLog, README, src/Makefile, src/openvasmd.c: New. Added: trunk/openvas-manager/README =================================================================== --- trunk/openvas-manager/README 2008-11-11 15:24:42 UTC (rev 1693) +++ trunk/openvas-manager/README 2008-11-11 15:57:28 UTC (rev 1694) @@ -0,0 +1,35 @@ +OpenVAS Manager +=============== + +The OpenVAS Manager aims to be a layer between OpenVAS-Client and +the actual OpenVAS Server. Basically it should be responsible for +any tasks where no high system privileges are required. + +This module is in an early development stage. +At the current state OpenVAS Manager is a protocol logger for OTP. + +It is not mandatory to have OpenVAS Manager for using OpenVAS 1.0 or 2.0. + + +Howto build +----------- + +Reference system of the developers is Debian GNU Linux 'Etch' 4.0. +The build might fail on any other systems. +Also it is necessary to install dependent development +packages - there is not automated configuration routine yet. + +Prerequisites: +* openvas-libraries 2.0.0 (newest version from trunk) +* gnutls + +First, read in src/Makefile about OPENVAS_LIB_INSTALL_DIR and OPENVAS_HEADER_INSTALL_DIR +Second, adjust SERCERCERT, SERVERKEY and CACERT in src/openvasmd.c if necessary. +$ cd src +$ make + + +Howto use +--------- + + Added: trunk/openvas-manager/VERSION =================================================================== --- trunk/openvas-manager/VERSION 2008-11-11 15:24:42 UTC (rev 1693) +++ trunk/openvas-manager/VERSION 2008-11-11 15:57:28 UTC (rev 1694) @@ -0,0 +1 @@ +0.0.1.SVN Added: trunk/openvas-manager/src/Makefile =================================================================== --- trunk/openvas-manager/src/Makefile 2008-11-11 15:24:42 UTC (rev 1693) +++ trunk/openvas-manager/src/Makefile 2008-11-11 15:57:28 UTC (rev 1694) @@ -0,0 +1,40 @@ +# OpenVAS +# $Id$ +# Description: Makefile for the OpenVAS Manager +# +# Authors: +# Jan-Oliver Wagner +# +# Copyright: +# Copyright (C) 2008 Intevation GmbH +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by the Free Software Foundation; either +# version 2 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Library General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + +# run "make" this way (if necessary): +# OPENVAS_LIB_INSTALL_DIR=/your/path/to/lib/ OPENVAS_HEADER_INSTALL_DIR=/your/path/to/include make + +LIBS = -L$(OPENVAS_LIB_INSTALL_DIR) -lgnutls -lopenvas +CFLAGS = -Wall -I$(OPENVAS_HEADER_INSTALL_DIR) + +all: openvasmd + +openvasmd.o: openvasmd.c + $(CC) $(CFLAGS) `libopenvas-config --cflags` -c openvasmd.c + +openvasmd: openvasmd.o + $(CC) $(LIBS) openvasmd.o -o openvasmd + +clean: + rm -f *.o openvasmd Added: trunk/openvas-manager/src/openvasmd.c =================================================================== --- trunk/openvas-manager/src/openvasmd.c 2008-11-11 15:24:42 UTC (rev 1693) +++ trunk/openvas-manager/src/openvasmd.c 2008-11-11 15:57:28 UTC (rev 1694) @@ -0,0 +1,848 @@ +/* OpenVAS Manager + * $Id$ + * Description: Main module for OpenVAS Manager: the system daemon. + * + * Authors: + * Matthew Mundell + * + * Copyright: + * Copyright (C) 2008 Intevation GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * or, at your option, any later version as published by the Free + * Software Foundation + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define OPENVASMD_SERVER_NAME "127.0.0.1" + +#define SERVERCERT "/var/lib/openvas/CA/servercert.pem" +#define SERVERKEY "/var/lib/openvas/private/CA/serverkey.pem" +#define CACERT "/var/lib/openvas/CA/cacert.pem" + +/* Enable to overide "omp" in /etc/services. */ +#if 0 +#define OPENVASMD_SERVER_PORT_OVERRIDE 25 +#endif + +/* Enable to overide "openvas" in /etc/services. */ +#if 0 +#define OPENVASD_PORT_OVERRIDE 7775 +#endif + +/* Used if "omp" and OPENVASMD_SERVER_PORT_OVERRIDE missing. */ +#define OPENVASMD_PORT 7776 + +/* Used if "openvas" and OPENVASD_PORT_OVERRIDE missing. */ +#define OPENVASD_PORT 1241 + +/* The size of the data buffers. When the client/server buffer is full + `select' stops watching for input from the client/server. */ +#define OPENVASMD_BUFFER_SIZE 2048 + +/* Second argument to listen. */ +#define OPENVASMD_MAX_CONNECTIONS 512 + +#define LOG 1 +/* Name of log file. */ +#define LOG_FILE "/tmp/openvasmd.log" + +/* 0 to turn off all tracing messages. */ +#define TRACE 1 + +/* 0 to turn off echoing of actual data transfered. */ +#define TRACE_TEXT 1 + +/* 0 to turn off security. */ +#define OVAS_SSL 1 + +#if OVAS_SSL +#include +#endif + +#if OPENVASMD_BUFFER_SIZE > SSIZE_MAX +#error OPENVASMD_BUFFER_SIZE too big for `read' +#endif + +#if TRACE +#define tracef(args...) \ + do { \ + fprintf (stderr, "%7i ", getpid()); \ + fprintf (stderr, args); \ + fflush (stderr); \ + } while (0); +#else +#define tracef(format, args...) +#endif + +#if LOG +#define logf(args...) \ + do { \ + fprintf (log_stream, "%7i ", getpid()); \ + fprintf (log_stream, args); \ + fflush (log_stream); \ + } while (0); +#else +#define logf(format, args...) +#endif + +/* The socket accepting OMP connections from clients. */ +int manager_socket = -1; +/* The address of this program, "the manager". */ +struct sockaddr_in manager_address; +/* The address of openvasd, "the server". */ +struct sockaddr_in server_address; +/* The log stream. */ +FILE* log_stream = NULL; +#if OVAS_SSL +/* The server context. */ +static ovas_server_context_t server_context = NULL; +#endif + +#define CLIENT_READ 1 +#define CLIENT_WRITE 2 +#define SERVER_READ 4 +#define SERVER_WRITE 8 + +int +serve_omp (int client_socket) +{ + int ret; + char from_client[OPENVASMD_BUFFER_SIZE]; + char from_server[OPENVASMD_BUFFER_SIZE]; + int from_client_end = 0, from_server_end = 0; + int from_client_start = 0, from_server_start = 0; + int server_socket; + + /* Make the server socket. */ + server_socket = socket (PF_INET, SOCK_STREAM, 0); + if (server_socket == -1) + { + perror ("Failed to create server socket"); + return EXIT_FAILURE; + } + +#if OVAS_SSL + /* Setup server session. */ + + gnutls_certificate_credentials_t server_credentials; + if (gnutls_certificate_allocate_credentials (&server_credentials)) + { + fprintf (stderr, "Failed to allocate server credentials.\n"); + goto close_fail; + } + + gnutls_session_t server_session; + if (gnutls_init (&server_session, GNUTLS_CLIENT)) + { + fprintf (stderr, "Failed to initialise server session.\n"); + goto server_free_fail; + } + + if (gnutls_set_default_priority (server_session)) + { + fprintf (stderr, "Failed to set server session priority.\n"); + goto server_fail; + } + + const int kx_priority[] = { GNUTLS_KX_DHE_RSA, + GNUTLS_KX_RSA, + GNUTLS_KX_DHE_DSS, + 0 }; + if (gnutls_kx_set_priority (server_session, kx_priority)) + { + fprintf (stderr, "Failed to set server key exchange priority.\n"); + goto server_fail; + } + + if (gnutls_credentials_set (server_session, + GNUTLS_CRD_CERTIFICATE, + server_credentials)) + { + fprintf (stderr, "Failed to set server key exchange priority.\n"); + goto server_fail; + } +#endif + + /* Connect to the server. */ + if (connect (server_socket, + (struct sockaddr *) &server_address, + sizeof (server_address)) + == -1) + { + perror ("Failed to connect to server"); + goto server_fail; + } + tracef ("Connected to server on socket %i.\n", server_socket); + +#if OVAS_SSL + /* Complete setup of server session. */ + + gnutls_transport_set_ptr (server_session, + (gnutls_transport_ptr_t) server_socket); + + retry: + ret = gnutls_handshake (server_session); + if (ret < 0) + { + if (ret == GNUTLS_E_AGAIN + || ret == GNUTLS_E_INTERRUPTED + || errno == EAGAIN + || errno == EINTR) + goto retry; + fprintf (stderr, "Failed to shake hands with server.\n"); + gnutls_perror (ret); + if (shutdown (server_socket, SHUT_RDWR) == -1) + perror ("Failed to shutdown server socket"); + goto server_fail; + } +#endif + + /* The socket must have O_NONBLOCK set, in case an "asynchronous network + * error" removes the data between `select' and `read'. */ + if (fcntl (server_socket, F_SETFL, O_NONBLOCK) == -1) + { + perror ("Failed to set server socket flag"); + goto fail; + } + +#if OVAS_SSL + /* Get client socket and session from libopenvas. */ + + int real_socket = nessus_get_socket_from_connection (client_socket); + if (real_socket == -1 || real_socket == client_socket) + { + perror ("Failed to get client socket from libopenvas"); + goto fail; + } + + gnutls_session_t* client_session = ovas_get_tlssession_from_connection(client_socket); + if (client_session == NULL) + { + perror ("Failed to get connection from client socket"); + goto fail; + } + client_socket = real_socket; + + /* The socket must have O_NONBLOCK set, in case an "asynchronous network + * error" removes the data between `select' and `read'. */ + if (fcntl (client_socket, F_SETFL, O_NONBLOCK) == -1) + { + perror ("Failed to set real client socket flag"); + goto fail; + } + gnutls_transport_set_lowat (*client_session, 0); +#endif + + /* Loop handling input from the sockets. */ + int nfds = 1 + (client_socket > server_socket + ? client_socket : server_socket); + fd_set readfds, exceptfds, writefds; + while (1) + { + /* Setup for select. */ + unsigned char fds = 0; /* What `select' is going to watch. */ + FD_ZERO (&exceptfds); + FD_ZERO (&readfds); + FD_ZERO (&writefds); + FD_SET (client_socket, &exceptfds); + FD_SET (server_socket, &exceptfds); + if (from_client_end < OPENVASMD_BUFFER_SIZE) + { + FD_SET (client_socket, &readfds); + fds |= CLIENT_READ; + } + if (from_server_end < OPENVASMD_BUFFER_SIZE) + { + FD_SET (server_socket, &readfds); + fds |= SERVER_READ; + } + if (from_server_start < from_server_end) + { + FD_SET (client_socket, &writefds); + fds |= CLIENT_WRITE; + } + if (from_client_start < from_client_end) + { + FD_SET (server_socket, &writefds); + fds |= SERVER_WRITE; + } + + /* Select, then handle result. */ + ret = select (nfds, &readfds, &writefds, &exceptfds, NULL); + if (ret < 0) + { + if (errno == EINTR) continue; + perror ("Child select failed"); + goto fail; + } + if (ret > 0) + { + if (FD_ISSET (client_socket, &exceptfds)) + { + fprintf (stderr, "Exception on client in child select.\n"); + goto fail; + } + + if (FD_ISSET (server_socket, &exceptfds)) + { + fprintf (stderr, "Exception on server in child select.\n"); + goto fail; + } + + if (fds & CLIENT_READ && FD_ISSET (client_socket, &readfds)) + { +#if TRACE || LOG + int initial_start = from_client_end; +#endif + /* Read as much as possible from the client. */ + while (from_client_end < OPENVASMD_BUFFER_SIZE) + { + ssize_t count; +#if OVAS_SSL + count = gnutls_record_recv (*client_session, + from_client + from_client_end, + OPENVASMD_BUFFER_SIZE + - from_client_end); +#else + count = read (client_socket, + from_client + from_client_end, + OPENVASMD_BUFFER_SIZE - from_client_end); +#endif + if (count < 0) + { +#if OVAS_SSL + if (count == GNUTLS_E_AGAIN || errno == EAGAIN) + /* Got everything available, return to `select'. */ + break; + if (count == GNUTLS_E_INTERRUPTED || errno == EINTR) + /* Interrupted, try read again. */ + continue; + if (errno == GNUTLS_E_REHANDSHAKE) + /* Return to select. TODO Rehandshake. */ + break; + fprintf (stderr, "Failed to read from client.\n"); + gnutls_perror (count); +#else + if (errno == EAGAIN) + /* Got everything available, return to `select'. */ + break; + if (errno == EINTR) + /* Interrupted, try read again. */ + continue; + perror ("Failed to read from client"); +#endif + goto fail; + } + if (count == 0) + /* End of file. */ + goto succeed; + from_client_end += count; + } +#if TRACE || LOG + /* This check prevents output in the "asynchronous network + error" case. */ + if (from_client_end > initial_start) + { + logf ("<= %.*s\n", + from_client_end - initial_start, + from_client + initial_start); +#if TRACE_TEXT + tracef ("<= client \"%.*s\"\n", + from_client_end - initial_start, + from_client + initial_start); +#else + tracef ("<= client %i bytes\n", + from_client_end - initial_start); +#endif + } +#endif /* TRACE || LOG */ + } + + if (fds & SERVER_WRITE && FD_ISSET (server_socket, &writefds)) + { + /* Write as much as possible to the server. */ + while (from_client_start < from_client_end) + { + ssize_t count; +#if OVAS_SSL + count = gnutls_record_send (server_session, + from_client + from_client_start, + from_client_end - from_client_start); +#else + count = write (server_socket, + from_client + from_client_start, + from_client_end - from_client_start); +#endif + if (count < 0) + { +#if OVAS_SSL + if (count == GNUTLS_E_AGAIN || errno == EAGAIN) + /* Wrote as much as possible, return to `select'. */ + goto end_server_write; + if (count == GNUTLS_E_INTERRUPTED || errno == EINTR) + /* Interrupted, try write again. */ + continue; + if (errno == GNUTLS_E_REHANDSHAKE) + /* Return to select. TODO Rehandshake. */ + break; + fprintf (stderr, "Failed to write to server.\n"); + gnutls_perror (count); +#else + if (errno == EAGAIN) + /* Wrote as much as possible, return to `select'. */ + goto end_server_write; + if (errno == EINTR) + /* Interrupted, try write again. */ + continue; + perror ("Failed to write to server"); +#endif + goto fail; + } + from_client_start += count; + tracef ("=> server %i bytes\n", count); + } + tracef ("=> server done\n"); + from_client_start = from_client_end = 0; + end_server_write: + ; + } + + if (fds & SERVER_READ && FD_ISSET (server_socket, &readfds)) + { +#if TRACE + int initial_start = from_server_end; +#endif + /* Read as much as possible from the server. */ + while (from_server_end < OPENVASMD_BUFFER_SIZE) + { + ssize_t count; +#if OVAS_SSL + count = gnutls_record_recv (server_session, + from_server + from_server_end, + OPENVASMD_BUFFER_SIZE + - from_server_end); +#else + count = read (server_socket, + from_server + from_server_end, + OPENVASMD_BUFFER_SIZE - from_server_end); +#endif + if (count < 0) + { +#if OVAS_SSL + if (count == GNUTLS_E_AGAIN || errno == EAGAIN) + /* Got everything available, return to `select'. */ + break; + if (count == GNUTLS_E_INTERRUPTED || errno == EINTR) + /* Interrupted, try read again. */ + continue; + if (errno == GNUTLS_E_REHANDSHAKE) + /* Return to select. TODO Rehandshake. */ + break; + fprintf (stderr, "Failed to read to server.\n"); + gnutls_perror (count); +#else + if (errno == EAGAIN) + /* Got everything available, return to `select'. */ + break; + if (errno == EINTR) + /* Interrupted, try read again. */ + continue; + perror ("Failed to read from server"); +#endif + goto fail; + } + if (count == 0) + /* End of file. */ + goto succeed; + from_server_end += count; + } +#if TRACE + /* This check prevents output in the "asynchronous network + error" case. */ + if (from_server_end > initial_start) + { +#if TRACE_TEXT + tracef ("<= server \"%.*s\"\n", + from_server_end - initial_start, + from_server + initial_start); +#else + tracef ("<= server %i bytes\n", + from_server_end - initial_start); +#endif + } +#endif /* TRACE */ + } + + if (fds & CLIENT_WRITE && FD_ISSET (client_socket, &writefds)) + { + /* Write as much as possible to the client. */ + while (from_server_start < from_server_end) + { + ssize_t count; +#if OVAS_SSL + count = gnutls_record_send (*client_session, + from_server + from_server_start, + from_server_end - from_server_start); +#else + count = write (client_socket, + from_server + from_server_start, + from_server_end - from_server_start); +#endif + if (count < 0) + { +#if OVAS_SSL + if (count == GNUTLS_E_AGAIN || errno == EAGAIN) + /* Wrote as much as possible, return to `select'. */ + goto end_client_write; + if (count == GNUTLS_E_INTERRUPTED || errno == EINTR) + /* Interrupted, try write again. */ + continue; + if (errno == GNUTLS_E_REHANDSHAKE) + /* Return to select. TODO Rehandshake. */ + break; + fprintf (stderr, "Failed to write to client.\n"); + gnutls_perror (count); +#else + if (errno == EAGAIN) + /* Wrote as much as possible, return to `select'. */ + goto end_client_write; + if (errno == EINTR) + /* Interrupted, try write again. */ + continue; + perror ("Failed to write to client"); +#endif + goto fail; + } + logf ("=> %.*s\n", + from_server_end - from_server_start, + from_server + from_server_start); + from_server_start += count; + tracef ("=> client %i bytes\n", count); + } + tracef ("=> client done\n"); + from_server_start = from_server_end = 0; + end_client_write: + ; + } + } + } + + succeed: +#if OVAS_SSL + gnutls_bye (server_session, GNUTLS_SHUT_RDWR); + gnutls_deinit (server_session); + gnutls_certificate_free_credentials (server_credentials); +#else + if (shutdown (server_socket, SHUT_RDWR) == -1) + perror ("Failed to shutdown server socket"); +#endif + close (server_socket); + return EXIT_SUCCESS; + + fail: +#if OVAS_SSL + gnutls_bye (server_session, GNUTLS_SHUT_RDWR); + server_fail: + gnutls_deinit (server_session); + + server_free_fail: + gnutls_certificate_free_credentials (server_credentials); + + close_fail: +#else + if (shutdown (server_socket, SHUT_RDWR) == -1) + perror ("Failed to shutdown server socket"); + server_fail: +#endif + + close (server_socket); + + return EXIT_FAILURE; +} + +#undef CLIENT_READ +#undef CLIENT_WRITE +#undef SERVER_READ +#undef SERVER_WRITE + +void +accept_and_maybe_fork () +{ + /* Accept the client connection. */ + struct sockaddr_in client_address; + client_address.sin_family = AF_INET; + socklen_t size = sizeof (client_address); + int client_socket; + while ((client_socket = accept (manager_socket, + (struct sockaddr *) &client_address, + &size)) + == -1) + { + if (errno == EINTR) + continue; + if (errno == EAGAIN || errno == EWOULDBLOCK) + /* The connection is gone, return to select. */ + return; + perror ("Failed to accept client connection"); + exit (EXIT_FAILURE); + } + + /* Fork a child to serve the client. */ + pid_t pid = fork (); + switch (pid) + { + case 0: + /* Child. */ + { + /* The socket must have O_NONBLOCK set, in case an "asynchronous + * network error" removes the data between `select' and `read'. + */ + if (fcntl (client_socket, F_SETFL, O_NONBLOCK) == -1) + { + perror ("Failed to set client socket flag"); + close (client_socket); + exit (EXIT_FAILURE); + } +#if OVAS_SSL + int secure_client_socket + = ovas_server_context_attach (server_context, client_socket); + if (secure_client_socket == -1) + { + fprintf (stderr, + "Failed to attach server context to socket %i.\n", + client_socket); + close (client_socket); + exit (EXIT_FAILURE); + } + tracef ("Server context attached.\n") + int ret = serve_omp (secure_client_socket); + close_stream_connection (secure_client_socket); +#else + int ret = serve_omp (client_socket); +#endif + close (client_socket); + exit (ret); + } + case -1: + /* Parent when error, return to select. */ + perror ("Failed to fork child"); + break; + default: + /* Parent. Return to select. */ + break; + } +} + +void +cleanup () +{ + tracef ("Cleaning up.\n"); + if (manager_socket > -1) close (manager_socket); +#if LOG + if (fclose (log_stream)) perror ("Failed to close log stream"); +#endif +#if OVAS_SSL + ovas_server_context_free (server_context); +#endif +} + +void +handle_signal (int signal) +{ + switch (signal) + { + case SIGTERM: + case SIGHUP: + exit (EXIT_SUCCESS); + } +} + +int +main (int argc, char** argv) +{ + tracef ("OpenVAS Manager\n"); + + /* Register the `cleanup' function. */ + if (atexit (&cleanup)) + { + fprintf (stderr, "Failed to register `atexit' cleanup function.\n"); + exit (EXIT_FAILURE); + } + + /* Create the manager socket. */ + manager_socket = socket (PF_INET, SOCK_STREAM, 0); + if (manager_socket == -1) + { + perror ("Failed to create manager socket"); + exit (EXIT_FAILURE); + } + +#if LOG + /* Open the log file. */ + log_stream = fopen (LOG_FILE, "w"); + if (log_stream == NULL) + { + perror ("Failed to open log file"); + exit (EXIT_FAILURE); + } +#endif + + /* Register the signal handler. */ + if (signal (SIGTERM, handle_signal) == SIG_ERR + || signal (SIGINT, handle_signal) == SIG_ERR + || signal (SIGHUP, handle_signal) == SIG_ERR + || signal (SIGCHLD, SIG_IGN) == SIG_ERR) + { + fprintf (stderr, "Failed to register signal handler.\n"); + exit (EXIT_FAILURE); + } + + /* Setup the server address. */ + server_address.sin_family = AF_INET; +#ifdef OPENVASMD_SERVER_PORT_OVERRIDE + server_address.sin_port = htons (OPENVASMD_SERVER_PORT_OVERRIDE); +#else + { + struct servent *servent = getservbyname ("omp", "tcp"); + if (servent) + // FIX free servent? + server_address.sin_port = servent->s_port; + else + server_address.sin_port = htons (OPENVASMD_PORT); + } +#endif + if (inet_aton(OPENVASMD_SERVER_NAME, &server_address.sin_addr) + == 0) + { + fprintf (stderr, "Failed to create server address %s.\n", + OPENVASMD_SERVER_NAME); + exit (EXIT_FAILURE); + } + +#if OVAS_SSL + /* Setup security. */ + if (nessus_SSL_init (NULL) < 0) + { + fprintf (stderr, "Failed to initialise security.\n"); + exit (EXIT_FAILURE); + } + server_context + = ovas_server_context_new (NESSUS_ENCAPS_TLSv1, + SERVERCERT, + SERVERKEY, + NULL, + CACERT, + 0); + if (server_context == NULL) + { + fprintf (stderr, "Failed to create server context.\n"); + exit (EXIT_FAILURE); + } +#endif + + /* The socket must have O_NONBLOCK set, in case an "asynchronous network + * error" removes the connection between `select' and `accept'. */ + if (fcntl (manager_socket, F_SETFL, O_NONBLOCK) == -1) + { + perror ("Failed to set manager socket flag"); + exit (EXIT_FAILURE); + } + + /* Bind the manager socket to a port. */ + manager_address.sin_family = AF_INET; +#ifdef OPENVASD_PORT_OVERRIDE + manager_address.sin_port = htons (OPENVASD_PORT_OVERRIDE); +#else + { + struct servent *servent = getservbyname ("openvas", "tcp"); + if (servent) + // FIX free servent? + manager_address.sin_port = servent->s_port; + else + manager_address.sin_port = htons (OPENVASD_PORT); + } +#endif + manager_address.sin_addr.s_addr = INADDR_ANY; + if (bind (manager_socket, + (struct sockaddr *) &manager_address, + sizeof (manager_address)) + == -1) + { + perror ("Failed to bind manager socket"); + close (manager_socket); + exit (EXIT_FAILURE); + } + tracef ("Manager bound to port %i\n", + htons (manager_address.sin_port)); + + /* Enable connections to the socket. */ + if (listen (manager_socket, OPENVASMD_MAX_CONNECTIONS) == -1) + { + perror ("Failed to listen on manager socket"); + close (manager_socket); + exit (EXIT_FAILURE); + } + + /* Loop waiting for connections and passing the work to + * `accept_and_maybe_fork'. + * + * FIX This could just loop accept_and_maybe_fork. Might the manager + * want to communicate with anything else, like the server? */ + int ret, nfds; + fd_set readfds, exceptfds; + while (1) + { + FD_ZERO (&readfds); + FD_SET (manager_socket, &readfds); + FD_ZERO (&exceptfds); + FD_SET (manager_socket, &exceptfds); + nfds = manager_socket + 1; + + ret = select (nfds, &readfds, NULL, &exceptfds, NULL); + + if (ret == -1) + { + perror ("Select failed"); + exit (EXIT_FAILURE); + } + if (ret > 0) + { + if (FD_ISSET (manager_socket, &exceptfds)) + { + fprintf (stderr, "Exception in select.\n"); + exit (EXIT_FAILURE); + } + if (FD_ISSET (manager_socket, &readfds)) + accept_and_maybe_fork(); + } + } + + return EXIT_SUCCESS; +} From scm-commit at wald.intevation.org Wed Nov 12 10:27:23 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 12 Nov 2008 10:27:23 +0100 (CET) Subject: [Openvas-commits] r1695 - in trunk/openvas-client: . nessus Message-ID: <20081112092723.84C3440720@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-12 10:27:23 +0100 (Wed, 12 Nov 2008) New Revision: 1695 Modified: trunk/openvas-client/ChangeLog trunk/openvas-client/nessus/attack.c Log: * nessus/attack.c (setup_plug_list): Increased maximum buffer size available for individual OIDs when constructing the plugin_set. This fixes a bug that caused long OIDs to be cut prematurely and damaging the plugin_set in the process. Modified: trunk/openvas-client/ChangeLog =================================================================== --- trunk/openvas-client/ChangeLog 2008-11-11 15:57:28 UTC (rev 1694) +++ trunk/openvas-client/ChangeLog 2008-11-12 09:27:23 UTC (rev 1695) @@ -1,3 +1,10 @@ +2008-11-12 Michael Wiegand + + * nessus/attack.c (setup_plug_list): Increased maximum buffer size + available for individual OIDs when constructing the plugin_set. This + fixes a bug that caused long OIDs to be cut prematurely and damaging + the plugin_set in the process. + 2008-11-10 Michael Wiegand Patch provided by Stjepan Gros to improve Modified: trunk/openvas-client/nessus/attack.c =================================================================== --- trunk/openvas-client/nessus/attack.c 2008-11-11 15:57:28 UTC (rev 1694) +++ trunk/openvas-client/nessus/attack.c 2008-11-12 09:27:23 UTC (rev 1695) @@ -203,7 +203,7 @@ { struct nessus_plugin * w = NULL; int i = 0; - char sp[32]; + char sp[100]; for(i=0;i<2;i++) { From scm-commit at wald.intevation.org Wed Nov 12 11:43:03 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 12 Nov 2008 11:43:03 +0100 (CET) Subject: [Openvas-commits] r1696 - in trunk/openvas-server: . openvasd Message-ID: <20081112104303.6578B40717@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-12 11:43:03 +0100 (Wed, 12 Nov 2008) New Revision: 1696 Modified: trunk/openvas-server/ChangeLog trunk/openvas-server/openvasd/oval_plugins.c Log: * openvasd/oval_plugins.c: (child_setup) Implemented privilege dropping before calling ovaldi. (ovaldi_launch) Improved parsing of RPM package list. Modified: trunk/openvas-server/ChangeLog =================================================================== --- trunk/openvas-server/ChangeLog 2008-11-12 09:27:23 UTC (rev 1695) +++ trunk/openvas-server/ChangeLog 2008-11-12 10:43:03 UTC (rev 1696) @@ -1,3 +1,9 @@ +2008-11-12 Michael Wiegand + + * openvasd/oval_plugins.c: (child_setup) Implemented privilege dropping + before calling ovaldi. (ovaldi_launch) Improved parsing of RPM package + list. + 2008-11-10 Michael Wiegand * configure.in: Include version requirements in glib error string as Modified: trunk/openvas-server/openvasd/oval_plugins.c =================================================================== --- trunk/openvas-server/openvasd/oval_plugins.c 2008-11-12 09:27:23 UTC (rev 1695) +++ trunk/openvas-server/openvasd/oval_plugins.c 2008-11-12 10:43:03 UTC (rev 1696) @@ -54,11 +54,45 @@ gchar * result; void child_setup (gpointer user_data) { - // TODO: ovaldi should run with as few privileges as possible. To do this, this - // setup function for the ovaldi child, which will be called between fork() - // and exec(), should setuid to a configurable, non-privileged user. This user - // has to be able to read the SC file and the selected definitions and to - // write to /tmp/. + // This function is called by the forked child just before it is executed. We + // try to drop our root privileges and setuid to nobody to minimize the + // risk of running an untrusted ovaldi. + // NB: The current implementation is somewhat linux-specific and may not work + // on other platforms. + + struct passwd * nobody_pw = NULL; + + if(getuid() == 0) + { + log_write("oval_plugins.c: Running as root, trying to drop privileges.\n"); + if((nobody_pw = getpwnam("nobody"))) + { + if(setgid(nobody_pw->pw_gid) == 0) + { + log_write("oval_plugins.c: Successfully dropped group privileges.\n"); + } + else + { + log_write("oval_plugins.c: WARNING: Could not drop group privileges!\n"); + } + if(setuid(nobody_pw->pw_uid) == 0) + { + log_write("oval_plugins.c: Successfully dropped user privileges.\n"); + } + else + { + log_write("oval_plugins.c: WARNING: Could not drop group privileges!\n"); + } + } + else + { + log_write("oval_plugins.c: WARNING: Could not drop privileges; unable to get uid and gid for user nobody!\n"); + } + } + else + { + log_write("oval_plugins.c: WARNING: Did not attempt to drop privileges since we do not seem to be running as root.\n"); + } } void start_element (GMarkupParseContext *context, const gchar *element_name, @@ -397,20 +431,22 @@ if(packages_str) { gchar ** package = g_strsplit(packages_str, ";", 0); - int j = 0; + int j = 1; char keyid[17]; keyid[16] = '\0'; - char * package_name; - char * package_version; - char * package_release; + gchar * package_name; + gchar * package_version; + gchar * package_release; while(package[j] != NULL) { gchar * pgpsig = strncpy(keyid, package[j] + strlen(package[j]) - 16, 16); - package_name = strtok(package[j], "~"); - package_version = strtok(NULL, "~"); - package_release = strtok(NULL, "~"); - if(package_name) + g_strchug(package[j]); + gchar ** package_data = g_strsplit(package[j], "~", 0); + if(package_data[0]) { + package_name = package_data[0]; + package_version = package_data[1]; + package_release = package_data[2]; fprintf(sc_file, "\t\t\n", i); fprintf(sc_file, "\t\t\t%s\n", package_name); fprintf(sc_file, "\t\t\t\n"); @@ -420,9 +456,10 @@ fprintf(sc_file, "\t\t\t\n"); fprintf(sc_file, "\t\t\t%s\n", pgpsig); fprintf(sc_file, "\t\t\n"); + i++; } - i++; j++; + g_strfreev(package_data); } g_strfreev(package); } From scm-commit at wald.intevation.org Wed Nov 12 12:29:28 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 12 Nov 2008 12:29:28 +0100 (CET) Subject: [Openvas-commits] r1697 - trunk/openvas-libraries Message-ID: <20081112112928.67399406F4@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-12 12:29:28 +0100 (Wed, 12 Nov 2008) New Revision: 1697 Modified: trunk/openvas-libraries/ChangeLog trunk/openvas-libraries/configure.in Log: * configure.in: Added AC_PREREQ directive to tell autoconf to generate a 2.50-style configure script. Modified: trunk/openvas-libraries/ChangeLog =================================================================== --- trunk/openvas-libraries/ChangeLog 2008-11-12 10:43:03 UTC (rev 1696) +++ trunk/openvas-libraries/ChangeLog 2008-11-12 11:29:28 UTC (rev 1697) @@ -1,3 +1,8 @@ +2008-11-12 Michael Wiegand + + * configure.in: Added AC_PREREQ directive to tell autoconf to generate + a 2.50-style configure script. + 2008-11-11 Jan-Oliver Wagner * libopenvas/network.c (ovas_get_connection_data): Renamed to Modified: trunk/openvas-libraries/configure.in =================================================================== --- trunk/openvas-libraries/configure.in 2008-11-12 10:43:03 UTC (rev 1696) +++ trunk/openvas-libraries/configure.in 2008-11-12 11:29:28 UTC (rev 1697) @@ -28,8 +28,8 @@ AC_INIT(.root-dir) AC_REVISION($Revision$)dnl +AC_PREREQ(2.50) - PWDD=`pwd` VERSION=`cat VERSION` save_IFS="${IFS}" From scm-commit at wald.intevation.org Wed Nov 12 12:29:59 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 12 Nov 2008 12:29:59 +0100 (CET) Subject: [Openvas-commits] r1698 - trunk/openvas-libnasl Message-ID: <20081112112959.78E5840715@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-12 12:29:59 +0100 (Wed, 12 Nov 2008) New Revision: 1698 Modified: trunk/openvas-libnasl/ChangeLog trunk/openvas-libnasl/configure.in Log: * configure.in: Added AC_PREREQ directive to tell autoconf to generate a 2.50-style configure script. Modified: trunk/openvas-libnasl/ChangeLog =================================================================== --- trunk/openvas-libnasl/ChangeLog 2008-11-12 11:29:28 UTC (rev 1697) +++ trunk/openvas-libnasl/ChangeLog 2008-11-12 11:29:59 UTC (rev 1698) @@ -1,3 +1,8 @@ +2008-11-12 Michael Wiegand + + * configure.in: Added AC_PREREQ directive to tell autoconf to generate + a 2.50-style configure script. + 2008-11-10 Michael Wiegand * configure: Regenerated to include updated version requirements. Modified: trunk/openvas-libnasl/configure.in =================================================================== --- trunk/openvas-libnasl/configure.in 2008-11-12 11:29:28 UTC (rev 1697) +++ trunk/openvas-libnasl/configure.in 2008-11-12 11:29:59 UTC (rev 1698) @@ -23,8 +23,8 @@ AC_INIT(.root-dir) AC_REVISION($Revision$)dnl +AC_PREREQ(2.50) - PWDD=`pwd` save_IFS="${IFS}" From scm-commit at wald.intevation.org Wed Nov 12 12:30:49 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 12 Nov 2008 12:30:49 +0100 (CET) Subject: [Openvas-commits] r1699 - trunk/openvas-server Message-ID: <20081112113049.0A67140711@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-12 12:30:49 +0100 (Wed, 12 Nov 2008) New Revision: 1699 Modified: trunk/openvas-server/ChangeLog trunk/openvas-server/configure trunk/openvas-server/configure.in Log: * configure.in: Added AC_PREREQ directive to tell autoconf to generate a 2.50-style configure script. * configure: Regenerated. Modified: trunk/openvas-server/ChangeLog =================================================================== --- trunk/openvas-server/ChangeLog 2008-11-12 11:29:59 UTC (rev 1698) +++ trunk/openvas-server/ChangeLog 2008-11-12 11:30:49 UTC (rev 1699) @@ -1,5 +1,12 @@ 2008-11-12 Michael Wiegand + * configure.in: Added AC_PREREQ directive to tell autoconf to generate + a 2.50-style configure script. + + * configure: Regenerated. + +2008-11-12 Michael Wiegand + * openvasd/oval_plugins.c: (child_setup) Implemented privilege dropping before calling ovaldi. (ovaldi_launch) Improved parsing of RPM package list. Modified: trunk/openvas-server/configure =================================================================== --- trunk/openvas-server/configure 2008-11-12 11:29:59 UTC (rev 1698) +++ trunk/openvas-server/configure 2008-11-12 11:30:49 UTC (rev 1699) @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 1661 . +# From configure.in Revision: 1686 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # @@ -1764,6 +1764,7 @@ + NEED_OPENVASLIBS_VERSION=2.0.0 NEED_OPENVASLIBNASL_VERSION=2.0.0 Modified: trunk/openvas-server/configure.in =================================================================== --- trunk/openvas-server/configure.in 2008-11-12 11:29:59 UTC (rev 1698) +++ trunk/openvas-server/configure.in 2008-11-12 11:30:49 UTC (rev 1699) @@ -42,6 +42,7 @@ AC_INIT(.root-dir) AC_REVISION($Revision$)dnl +AC_PREREQ(2.50) NEED_OPENVASLIBS_VERSION=2.0.0 NEED_OPENVASLIBNASL_VERSION=2.0.0 From scm-commit at wald.intevation.org Wed Nov 12 12:31:37 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 12 Nov 2008 12:31:37 +0100 (CET) Subject: [Openvas-commits] r1700 - trunk/openvas-plugins Message-ID: <20081112113137.153D240711@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-12 12:31:34 +0100 (Wed, 12 Nov 2008) New Revision: 1700 Modified: trunk/openvas-plugins/ChangeLog trunk/openvas-plugins/configure trunk/openvas-plugins/configure.in Log: * configure.in: Added AC_PREREQ directive to tell autoconf to generate a 2.50-style configure script. * configure: Regenerated. Modified: trunk/openvas-plugins/ChangeLog =================================================================== --- trunk/openvas-plugins/ChangeLog 2008-11-12 11:30:49 UTC (rev 1699) +++ trunk/openvas-plugins/ChangeLog 2008-11-12 11:31:34 UTC (rev 1700) @@ -1,3 +1,10 @@ +2008-11-12 Michael Wiegand + + * configure.in: Added AC_PREREQ directive to tell autoconf to generate + a 2.50-style configure script. + + * configure: Regenerated. + 2008-11-11 Chandrashekhar B * scripts/secpod_chilkat_crypt_activex_cntl_vuln_900171.nasl, scripts/secpod_ms_win_media_player_detect_900173.nasl, Modified: trunk/openvas-plugins/configure =================================================================== --- trunk/openvas-plugins/configure 2008-11-12 11:30:49 UTC (rev 1699) +++ trunk/openvas-plugins/configure 2008-11-12 11:31:34 UTC (rev 1700) @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 540 . +# From configure.in Revision: 699 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # @@ -1898,12 +1898,12 @@ + NEED_OPENVASLIBS_VERSION=1.0.0 NEED_OPENVASD_VERSION=0.9.2 - test "x$prefix" != "xNONE" || prefix=/usr/local ac_ext=c Modified: trunk/openvas-plugins/configure.in =================================================================== --- trunk/openvas-plugins/configure.in 2008-11-12 11:30:49 UTC (rev 1699) +++ trunk/openvas-plugins/configure.in 2008-11-12 11:31:34 UTC (rev 1700) @@ -23,6 +23,7 @@ AC_INIT(.root-dir) AC_REVISION($Revision$)dnl +AC_PREREQ(2.50) NEED_OPENVASLIBS_VERSION=1.0.0 NEED_OPENVASD_VERSION=0.9.2 @@ -30,7 +31,6 @@ dnl Set up the main lines of the config script AC_PREFIX_DEFAULT("/usr/local") - test "x$prefix" != "xNONE" || prefix=/usr/local AC_LANG_C From scm-commit at wald.intevation.org Wed Nov 12 12:32:15 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 12 Nov 2008 12:32:15 +0100 (CET) Subject: [Openvas-commits] r1701 - trunk/openvas-client Message-ID: <20081112113215.9A6C740711@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-12 12:32:14 +0100 (Wed, 12 Nov 2008) New Revision: 1701 Modified: trunk/openvas-client/ChangeLog trunk/openvas-client/configure trunk/openvas-client/configure.in Log: * configure.in: Added AC_PREREQ directive to tell autoconf to generate a 2.50-style configure script. * configure: Regenerated. Modified: trunk/openvas-client/ChangeLog =================================================================== --- trunk/openvas-client/ChangeLog 2008-11-12 11:31:34 UTC (rev 1700) +++ trunk/openvas-client/ChangeLog 2008-11-12 11:32:14 UTC (rev 1701) @@ -1,5 +1,12 @@ 2008-11-12 Michael Wiegand + * configure.in: Added AC_PREREQ directive to tell autoconf to generate + a 2.50-style configure script. + + * configure: Regenerated. + +2008-11-12 Michael Wiegand + * nessus/attack.c (setup_plug_list): Increased maximum buffer size available for individual OIDs when constructing the plugin_set. This fixes a bug that caused long OIDs to be cut prematurely and damaging Modified: trunk/openvas-client/configure =================================================================== --- trunk/openvas-client/configure 2008-11-12 11:31:34 UTC (rev 1700) +++ trunk/openvas-client/configure 2008-11-12 11:32:14 UTC (rev 1701) @@ -1751,6 +1751,7 @@ + save_IFS="${IFS}" IFS=. read NESSUS_MAJOR NESSUS_MINOR NESSUS_PATCH NESSUS_RC Author: felix Date: 2008-11-12 14:50:27 +0100 (Wed, 12 Nov 2008) New Revision: 1702 Modified: trunk/openvas-libnasl/ChangeLog trunk/openvas-libnasl/configure trunk/openvas-libnasl/configure.in trunk/openvas-libnasl/include/config.h.in trunk/openvas-libnasl/include/nasl.h trunk/openvas-libnasl/nasl/nasl_signature.c trunk/openvas-libnasl/nasl/nasl_signature.h Log: * configure.in : Macros for gpgme public key support added. * include/config.h.in : undef _FILE_OFFSET_BITS for AC_SYS_LARGEFILE * configure : regenerated. * include/nasl.h : Opened interface here (although nasl_signature should soon be moved to libraries). * nasl/nasl_signature.h : protos and struct openvas_signature definition * nasl/nasl_signature.c (openvas_certificate_new, openvas_certificate_free) : struct init and free methods added. * nasl/nasl_signature.c (nasl_get_pubkey, nasl_get_all_certificat M openvas-libnasl/configure M openvas-libnasl/include/config.h.in M openvas-libnasl/include/nasl.h M openvas-libnasl/configure.in M openvas-libnasl/ChangeLog M openvas-libnasl/nasl/nasl_signature.c M openvas-libnasl/nasl/nasl_signature.h Modified: trunk/openvas-libnasl/ChangeLog =================================================================== --- trunk/openvas-libnasl/ChangeLog 2008-11-12 11:32:14 UTC (rev 1701) +++ trunk/openvas-libnasl/ChangeLog 2008-11-12 13:50:27 UTC (rev 1702) @@ -1,3 +1,26 @@ +2008-11-12 Felix Wolfsteller + + Work on Change Request #17 (http://www.openvas.org/openvas-cr-17.html - + "OTP: Make NVT signatures available to OpenVAS-Client"). + Interface extension and certificate information functionality. + + * configure.in : Macros for gpgme public key support added. + + * include/config.h.in : undef _FILE_OFFSET_BITS for AC_SYS_LARGEFILE + + * configure : regenerated. + + * include/nasl.h : Opened interface here (although nasl_signature should + soon be moved to libraries). + + * nasl/nasl_signature.h : protos and struct openvas_signature definition + + * nasl/nasl_signature.c (openvas_certificate_new, + openvas_certificate_free) : struct init and free methods added. + + * nasl/nasl_signature.c (nasl_get_pubkey, nasl_get_all_certificates) : + Extraction of information about certificates added/improved. + 2008-11-12 Michael Wiegand * configure.in: Added AC_PREREQ directive to tell autoconf to generate @@ -11,7 +34,7 @@ * include/config.h.in: Removed obsolete getopt define. -2008-10-05 Felix Wolfsteller +2008-10-05 Felix Wolfsteller Further steps to an implementation of Change Request #17 (http://www.openvas.org/openvas-cr-17.html - "OTP: Make NVT signatures Modified: trunk/openvas-libnasl/configure =================================================================== --- trunk/openvas-libnasl/configure 2008-11-12 11:32:14 UTC (rev 1701) +++ trunk/openvas-libnasl/configure 2008-11-12 13:50:27 UTC (rev 1702) @@ -1464,6 +1464,7 @@ --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) + --disable-largefile omit support for large files Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -3722,7 +3723,7 @@ ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 3725 "configure"' > conftest.$ac_ext + echo '#line 3726 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -6666,11 +6667,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6669: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6670: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6673: \$? = $ac_status" >&5 + echo "$as_me:6674: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -6956,11 +6957,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6959: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6960: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6963: \$? = $ac_status" >&5 + echo "$as_me:6964: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -7060,11 +7061,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7063: $lt_compile\"" >&5) + (eval echo "\"\$as_me:7064: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7067: \$? = $ac_status" >&5 + echo "$as_me:7068: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -9437,7 +9438,7 @@ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext < conftest.$ac_ext <&5) + (eval echo "\"\$as_me:11942: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:11945: \$? = $ac_status" >&5 + echo "$as_me:11946: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -12042,11 +12043,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12045: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12046: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:12049: \$? = $ac_status" >&5 + echo "$as_me:12050: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -13640,11 +13641,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13643: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13644: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13647: \$? = $ac_status" >&5 + echo "$as_me:13648: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -13744,11 +13745,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13747: $lt_compile\"" >&5) + (eval echo "\"\$as_me:13748: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13751: \$? = $ac_status" >&5 + echo "$as_me:13752: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15964,11 +15965,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15967: $lt_compile\"" >&5) + (eval echo "\"\$as_me:15968: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:15971: \$? = $ac_status" >&5 + echo "$as_me:15972: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16254,11 +16255,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16257: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16258: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:16261: \$? = $ac_status" >&5 + echo "$as_me:16262: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -16358,11 +16359,11 @@ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:16361: $lt_compile\"" >&5) + (eval echo "\"\$as_me:16362: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:16365: \$? = $ac_status" >&5 + echo "$as_me:16366: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -19427,8 +19428,546 @@ GPGME_LIBS=`$GPGME_CONFIG --libs` LIBS="$GPGME_LIBS $LIBS" +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then + enableval=$enable_largefile; +fi +if test "$enable_largefile" != no; then + { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_largefile_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_largefile_CC=' -n32'; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_file_offset_bits+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_file_offset_bits=no; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_file_offset_bits=64; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac +rm -f conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_large_files+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=no; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=1; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF +;; +esac +rm -f conftest* + fi +fi + +{ echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5 +echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_largefile_source+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include /* for off_t */ + #include +int +main () +{ +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_sys_largefile_source=no; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGEFILE_SOURCE 1 +#include /* for off_t */ + #include +int +main () +{ +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_sys_largefile_source=1; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + ac_cv_sys_largefile_source=unknown + break +done +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6; } +case $ac_cv_sys_largefile_source in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source +_ACEOF +;; +esac +rm -f conftest* + +# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug +# in glibc 2.1.3, but that breaks too many other things. +# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. +if test $ac_cv_sys_largefile_source != unknown; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_FSEEKO 1 +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } +if test "${ac_cv_type_off_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef off_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_off_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_off_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6; } +if test $ac_cv_type_off_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF + +fi + + + + if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. Modified: trunk/openvas-libnasl/configure.in =================================================================== --- trunk/openvas-libnasl/configure.in 2008-11-12 11:32:14 UTC (rev 1701) +++ trunk/openvas-libnasl/configure.in 2008-11-12 13:50:27 UTC (rev 1702) @@ -206,6 +206,10 @@ GPGME_LIBS=`$GPGME_CONFIG --libs` LIBS="$GPGME_LIBS $LIBS" +AC_SYS_LARGEFILE +AC_FUNC_FSEEKO +AC_TYPE_OFF_T + PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.2.0, HAVE_GLIB="yes", AC_MSG_ERROR("glib not found")) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) Modified: trunk/openvas-libnasl/include/config.h.in =================================================================== --- trunk/openvas-libnasl/include/config.h.in 2008-11-12 11:32:14 UTC (rev 1701) +++ trunk/openvas-libnasl/include/config.h.in 2008-11-12 13:50:27 UTC (rev 1702) @@ -21,6 +21,10 @@ */ #undef BSD_BYTE_ORDERING +/* + * Set by AC_SYS_LARGEFILE, needed for gpgme key retrieval + */ +#undef _FILE_OFFSET_BITS #ifndef _CYGWIN_ Modified: trunk/openvas-libnasl/include/nasl.h =================================================================== --- trunk/openvas-libnasl/include/nasl.h 2008-11-12 11:32:14 UTC (rev 1701) +++ trunk/openvas-libnasl/include/nasl.h 2008-11-12 13:50:27 UTC (rev 1702) @@ -74,7 +74,21 @@ #define NASL_LEVEL 2205 #define OPENVAS_NASL_LEVEL 2300 +/* Signature information extraction and verification (not nasl- specific + anymore, thus likely to be moved to openvas-libraries): */ +#include +typedef struct { + char* fpr; + char* ownername; + int trusted; + char* full_public_key; +} openvas_certificate; +int nasl_verify_signature(const char* filename); +char* nasl_extract_signature_fprs(const char* filename); +GSList* nasl_get_all_certificates(); +/* End of Signature information extraction */ + int execute_nasl_script(struct arglist *, const char *, const char *, int); int execute_preparsed_nasl_script(struct arglist *, char *, char *, int, int); char * nasl_version(); Modified: trunk/openvas-libnasl/nasl/nasl_signature.c =================================================================== --- trunk/openvas-libnasl/nasl/nasl_signature.c 2008-11-12 11:32:14 UTC (rev 1701) +++ trunk/openvas-libnasl/nasl/nasl_signature.c 2008-11-12 13:50:27 UTC (rev 1702) @@ -21,19 +21,55 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. */ +#include + #include #include -#include -#include -#include +#include "nasl_signature.h" + #include "nasl_tree.h" #include "nasl_var.h" #include "nasl_func.h" #include "nasl_lex_ctxt.h" #include "nasl_debug.h" +/** + * Returns pointer to freshly allocated and initialized openvas_certificate. + * @param fingerpr ingerprint of certificate. + * @param owner Certificate owners name. + * @param istrusted Whether this certificate is trustworthy or not. + * @param pubkey Full public key. + * @return Pointer to fresh openvas_certificate. + */ +openvas_certificate* openvas_certificate_new(char* fingerpr, char* owner, + gboolean istrusted, char* pubkey) +{ + openvas_certificate* cert = emalloc(sizeof(openvas_certificate)); + cert->fpr = fingerpr; + cert->ownername = owner; + cert->trusted = istrusted; + cert->full_public_key = pubkey; + return cert; +} +/** + * Frees the openvas_certificate and all associated data. + * @param cert Certificate which holds pointers to the data. + */ +void openvas_certificate_free(openvas_certificate* cert) +{ + if(cert->fpr != NULL) + efree(& (cert->fpr) ); + if( cert->ownername != NULL) + efree(& (cert->ownername) ); + if(cert->trusted != NULL) + efree(& (cert->trusted) ); + if(cert->full_public_key != NULL) + efree(& (cert->full_public_key) ); + efree(&cert); +} + /* * Prints an error message for errors returned by gpgme. */ @@ -154,11 +190,11 @@ ctx = NULL; } } - efree(&gpghome); + return ctx; } -/* +/** * Checks the detached OpenPGP signature of the file given by FILENAME. * The name of the signature file is derived from FILENAME by appending * ".asc". @@ -168,6 +204,10 @@ * valid or was made by an unknown or untrusted key, the function * returns 1. If an error occurs or the file does not have a * corresponding detached signature the function returns -1. + * @param filename Filename (e.g. 1.txt ) for which to check signature (e.g. + 1.txt.asc). + * @return Zero, if files exists and all signatures are fully. 1 if at least one + signature from invalid or untrusted key. -1 on missing file or error. */ int nasl_verify_signature(const char* filename) @@ -245,7 +285,7 @@ * @see nasl_verify_signature( const char* filename ) */ char* -nasl_extract_signature_fprs(char* filename){ +nasl_extract_signature_fprs(const char* filename){ char * sigfilename = NULL; gpgme_error_t err; gpgme_ctx_t ctx = init_openvas_gpgme_ctx(); @@ -358,3 +398,152 @@ efree(&key_fprs); return return_string; } + + +/** + * Reads in a full public key. + * The returned string will be ascii- armored. + * @param ctx The gpgme context to work in. + * @param fingerprint Fingerprint of the key to return. + * @return The public key belonging to fingerprint in an emalloc'ed string + * or NULL if an error occurred. + */ +char* +nasl_get_pubkey(gpgme_ctx_t ctx, char* fingerprint) +{ + gpgme_set_armor(ctx,1); + + gpgme_error_t err; + gpgme_data_t pkey; + gpgme_data_new(&pkey); + char* key_string = NULL; + + err = gpgme_data_set_encoding(pkey, GPGME_DATA_ENCODING_ARMOR); + if(err) + { + print_gpgme_error("gpgme_data_set_encoding", err); + } + + err = gpgme_op_export(ctx, fingerprint, 0, pkey); + if(err) + { + print_gpgme_error("gpgme_op_export", err); + gpgme_data_release(pkey); + return NULL; + } + + // Determine length of public key + size_t key_length = gpgme_data_seek (pkey, 0, SEEK_END); + + // Public keys length must be >0 + if(key_length == -1) + { + nasl_trace(NULL, "gpgme couldn't find public key for %s.\n", fingerprint); + gpgme_data_release(pkey); + return NULL; + } + + key_string = emalloc( (key_length + 1) * sizeof(char)); + + // Rewind data + if( gpgme_data_seek (pkey, 0, SEEK_SET) != 0) + { + nasl_trace(NULL, "gpgme couldn't deal with public key data " + "for %s.\n", fingerprint); + gpgme_data_release(pkey); + efree(&key_string); + return NULL; + } + + // Copy certificate into buffer + size_t bytes_read = gpgme_data_read (pkey, key_string, key_length); + if(bytes_read != key_length) + { + nasl_trace(NULL, "gpgme couldn't read all public key data " + "for %s.\n", fingerprint); + gpgme_data_release(pkey); + efree(&key_string); + return NULL; + } + + gpgme_data_release(pkey); + + if(err) + { + if(key_string != NULL) + efree(&key_string); + } + + return key_string; +} + +/** + * Creates openvas_certificates for all certificates found in the (custom) gpg + * home directory and returns a pointer to a GSList containing (pointers to) + * them. + * Creation has to be done in two steps: First retrieve info like ownername and + * trust level and then read in the full public key. The two steps have to + * be done seperately because the two gpgme listing operations are exclusive. + * @return Pointer to a GSList containing pointers to openvas_certificate structs. + */ +GSList* +nasl_get_all_certificates() +{ + GSList* certificates = NULL; + // Certificate retrieval + gpgme_error_t err; + gpgme_ctx_t ctx = init_openvas_gpgme_ctx(); + + if ( ctx == NULL) + { + return NULL; + } + + err = gpgme_op_keylist_ext_start(ctx, NULL, 0, 0); + if (err) + { + nasl_trace(NULL, "otp_1_0_send_certificates: trouble finding gpgme keys %s.\n", strerror(err)); + } + + gpgme_key_t key; + + while (!err) + { + err = gpgme_op_keylist_next (ctx, &key); + + // No more keys + if(key == NULL) + break; + // Other error + if (err) + { + print_gpgme_error("gpgme_op_keylist_next", err); + break; + } + + openvas_certificate* cert = emalloc( sizeof(openvas_certificate) ); + cert->fpr = estrdup(key->subkeys->fpr); + cert->ownername = estrdup(key->uids->name); + if( key->owner_trust == GPGME_VALIDITY_FULL || key->owner_trust == GPGME_VALIDITY_ULTIMATE) + cert->trusted = TRUE; + else + cert->trusted = FALSE; + + certificates = g_slist_prepend(certificates, cert); + } + + gpgme_key_release (key); + + // Fetch the full keys + GSList* list = certificates; + while(list != NULL && list->data != NULL) + { + openvas_certificate* cert = list->data; + cert->full_public_key = nasl_get_pubkey(ctx, cert->fpr); + list = g_slist_next(list); + } + + gpgme_release(ctx); + + return certificates; +} Modified: trunk/openvas-libnasl/nasl/nasl_signature.h =================================================================== --- trunk/openvas-libnasl/nasl/nasl_signature.h 2008-11-12 11:32:14 UTC (rev 1701) +++ trunk/openvas-libnasl/nasl/nasl_signature.h 2008-11-12 13:50:27 UTC (rev 1702) @@ -25,9 +25,23 @@ #define NASL_SIGNATURE_H #include +#include +typedef struct { + char* fpr; + char* ownername; + gboolean trusted; + char* full_public_key; +} openvas_certificate; + +openvas_certificate* openvas_certificate_new(char*, char*, gboolean, + char*); +void openvas_certificate_free(openvas_certificate*); + int nasl_verify_signature(const char* filename); char* nasl_extract_signature_fprs(const char* filename); gpgme_ctx_t init_openvas_gpgme_ctx(void); +char* nasl_get_pubkey(gpgme_ctx_t ctx, char* fingerprint); +GSList* nasl_get_all_certificates(); #endif From scm-commit at wald.intevation.org Wed Nov 12 14:52:45 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 12 Nov 2008 14:52:45 +0100 (CET) Subject: [Openvas-commits] r1703 - in trunk/openvas-server: . include openvasd Message-ID: <20081112135245.E9A17406E0@pyrosoma.intevation.org> Author: felix Date: 2008-11-12 14:52:41 +0100 (Wed, 12 Nov 2008) New Revision: 1703 Modified: trunk/openvas-server/ChangeLog trunk/openvas-server/configure trunk/openvas-server/configure.in trunk/openvas-server/include/config.h.in trunk/openvas-server/openvasd/ntp_11.c trunk/openvas-server/openvasd/otp_1_0.c trunk/openvas-server/openvasd/otp_1_0.h trunk/openvas-server/openvasd/oval_plugins.c Log: * configure.in : Macros for gpgme public key support added. * include/config.h.in : undef _FILE_OFFSET_BITS for AC_SYS_LARGEFILE * configure : regenerated. * openvasd/otp_1_0.h : proto added. * openvasd/otp_1_0.c (otp_1_0_server_send_certificates) : nasl, glib includes. Does send real information, not dummystrings. * openvasd/ntp_11.c : removed interpretation of a void return. * openvasd/oval_plugins.c : Includes ordered and missing ones added. * ChangeLog : shamefully changed typos with my own email adress. M openvas-server/openvasd/otp_1_0.c M openvas-server/openvasd/ntp_11.c M openvas-server/openvasd/otp_1_0.h M openvas-server/openvasd/oval_plugins.c M openvas-server/configure M openvas-server/include/config.h.in M openvas-server/configure.in M openvas-server/ChangeLog Modified: trunk/openvas-server/ChangeLog =================================================================== --- trunk/openvas-server/ChangeLog 2008-11-12 13:50:27 UTC (rev 1702) +++ trunk/openvas-server/ChangeLog 2008-11-12 13:52:41 UTC (rev 1703) @@ -1,3 +1,29 @@ +2008-11-12 Felix Wolfsteller + + Work on Change Request #17 (http://www.openvas.org/openvas-cr-17.html - + "OTP: Make NVT signatures available to OpenVAS-Client"). + Certificate information sending functionality improved. Sends real + information, not dummystrings. + + ATTENTION: needs openvas-libnasl rev. 1702 to compile smoothly. + + * configure.in : Macros for gpgme public key support added. + + * include/config.h.in : undef _FILE_OFFSET_BITS for AC_SYS_LARGEFILE + + * configure : regenerated. + + * openvasd/otp_1_0.h : proto added. + + * openvasd/otp_1_0.c (otp_1_0_server_send_certificates) : nasl, glib + includes. Does send real information, not dummystrings. + + * openvasd/ntp_11.c : removed interpretation of a void return. + + * openvasd/oval_plugins.c : Includes ordered and missing ones added. + + * ChangeLog : shamefully changed typos with my own email adress. + 2008-11-12 Michael Wiegand * configure.in: Added AC_PREREQ directive to tell autoconf to generate @@ -38,7 +64,7 @@ * Makefile: Updated. -2008-11-07 Felix Wolfsteller +2008-11-07 Felix Wolfsteller * openvasd/nasl_plugins: Removed printfs. @@ -52,7 +78,7 @@ execution of unsigned plugins, if server preference is set. -2008-11-06 Felix Wolfsteller +2008-11-06 Felix Wolfsteller * openvasd/otp_1_0.c (otp_1_0_server_send_certificates): Fixed bug (wrong type released) that caused definite server crash. @@ -68,7 +94,7 @@ * openvasd/attack.c (launch_plugin): Use OIDs instead of IDs when logging information about NVT execution to KB. -2008-11-05 Felix Wolfsteller +2008-11-05 Felix Wolfsteller Work on Change Request #17 (http://www.openvas.org/openvas-cr-17.html - "OTP: Make NVT signatures available to OpenVAS-Client"). @@ -89,7 +115,7 @@ * configure.in: Updated version requirements for -libraries and -libnasl. -2008-10-31 Felix Wolfsteller +2008-10-31 Felix Wolfsteller Steps to an implementation of Change Request #17 (http://www.openvas.org/openvas-cr-17.html - "Make NVT signatures Modified: trunk/openvas-server/configure =================================================================== --- trunk/openvas-server/configure 2008-11-12 13:50:27 UTC (rev 1702) +++ trunk/openvas-server/configure 2008-11-12 13:52:41 UTC (rev 1703) @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 1686 . +# From configure.in Revision: 1699 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61. # @@ -1324,6 +1324,7 @@ --enable-install=user for debugging, install as non-root user --enable-syslog log messages via syslog() --enable-tcpwrappers use the libwrap.a library + --disable-largefile omit support for large files Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -8059,6 +8060,544 @@ fi +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_largefile_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_largefile_CC=' -n32'; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_file_offset_bits+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_file_offset_bits=no; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_file_offset_bits=64; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac +rm -f conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_large_files+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=no; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=1; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF +;; +esac +rm -f conftest* + fi +fi + +{ echo "$as_me:$LINENO: checking for _LARGEFILE_SOURCE value needed for large files" >&5 +echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_largefile_source+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include /* for off_t */ + #include +int +main () +{ +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_sys_largefile_source=no; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGEFILE_SOURCE 1 +#include /* for off_t */ + #include +int +main () +{ +int (*fp) (FILE *, off_t, int) = fseeko; + return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_sys_largefile_source=1; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + ac_cv_sys_largefile_source=unknown + break +done +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_source" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6; } +case $ac_cv_sys_largefile_source in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source +_ACEOF +;; +esac +rm -f conftest* + +# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug +# in glibc 2.1.3, but that breaks too many other things. +# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. +if test $ac_cv_sys_largefile_source != unknown; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_FSEEKO 1 +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking for off_t" >&5 +echo $ECHO_N "checking for off_t... $ECHO_C" >&6; } +if test "${ac_cv_type_off_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef off_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_off_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_off_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5 +echo "${ECHO_T}$ac_cv_type_off_t" >&6; } +if test $ac_cv_type_off_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF + +fi + + { echo "$as_me:$LINENO: checking for struct timeval" >&5 echo $ECHO_N "checking for struct timeval... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF Modified: trunk/openvas-server/configure.in =================================================================== --- trunk/openvas-server/configure.in 2008-11-12 13:50:27 UTC (rev 1702) +++ trunk/openvas-server/configure.in 2008-11-12 13:52:41 UTC (rev 1703) @@ -267,6 +267,10 @@ AC_TYPE_SIZE_T AC_TYPE_UID_T +AC_SYS_LARGEFILE +AC_FUNC_FSEEKO +AC_TYPE_OFF_T + dnl this routine has been adopted from the GNU emacs20 distrubution AC_MSG_CHECKING(for struct timeval) AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME Modified: trunk/openvas-server/include/config.h.in =================================================================== --- trunk/openvas-server/include/config.h.in 2008-11-12 13:50:27 UTC (rev 1702) +++ trunk/openvas-server/include/config.h.in 2008-11-12 13:52:41 UTC (rev 1703) @@ -159,7 +159,13 @@ */ #undef BSD_BYTE_ORDERING + /* + * Set by AC_SYS_LARGEFILE, needed for gpgme key retrieval + */ +#undef _FILE_OFFSET_BITS + +/* * STOP ! Don't edit anything after this line ! */ #ifndef _CYGWIN_ Modified: trunk/openvas-server/openvasd/ntp_11.c =================================================================== --- trunk/openvas-server/openvasd/ntp_11.c 2008-11-12 13:50:27 UTC (rev 1702) +++ trunk/openvas-server/openvasd/ntp_11.c 2008-11-12 13:52:41 UTC (rev 1703) @@ -88,6 +88,7 @@ } str[0] = '\0'; + if( strcmp(input, "CLIENT") == 0 ) { input = str + 5; @@ -108,7 +109,7 @@ break; case CREQ_CERTIFICATES: - result = otp_1_0_server_send_certificates(globals); + otp_1_0_server_send_certificates(globals); break; case CREQ_OPENVAS_VERSION: Modified: trunk/openvas-server/openvasd/otp_1_0.c =================================================================== --- trunk/openvas-server/openvasd/otp_1_0.c 2008-11-12 13:50:27 UTC (rev 1702) +++ trunk/openvas-server/openvasd/otp_1_0.c 2008-11-12 13:52:41 UTC (rev 1703) @@ -23,13 +23,19 @@ * */ +#include + #include #include #include +#include + #include "otp_1_0.h" + #include +#include /* Find the enum identifier for the client request which is given * as string. @@ -63,47 +69,38 @@ OPENVAS_VERSION); } -/* Send server response to certificate request by client. + +/** + * Send server response to certificate request by client. */ void otp_1_0_server_send_certificates(struct arglist* globals) { auth_printf(globals, "SERVER <|> CERTIFICATES\n"); - // TODO: felix CR#17 - implement certificate sending here - // Need a -D_FILE_OFFSET_BITS=64 in order to read key files - // Certificate retrieval - // Send dummystrings, basically - gpgme_error_t err; - gpgme_ctx_t ctx = init_openvas_gpgme_ctx(); - err = gpgme_op_keylist_ext_start(ctx, NULL, 0, 0); - if (err) - { - log_write("otp_1_0_send_certificates: gpgme key listing error: %s.\n", strerror(err)); - } + GSList* certificates = nasl_get_all_certificates(); + GSList* cert_list_elem = g_slist_nth(certificates, 0); - while (!err) + // Iterate over certificates + while(cert_list_elem != NULL) { - gpgme_key_t key; - err = gpgme_op_keylist_next (ctx, &key); - if (err) - break; - auth_printf(globals, "%s <|> %s <|> %s <|> %d <|> %s\n", - key->subkeys->fpr, - key->uids->name, "untrusted", - 8, // key size - "dummykey"); - gpgme_key_release (key); - } + openvas_certificate* cert = cert_list_elem->data; + + // Replace newlines by semicolons + char* pos = cert->full_public_key; + while(pos[0] != '\0') + { + if(pos[0] == '\n') pos[0] = ';'; + pos++; + } - if (!err) - { - if (gpg_err_code (err) != GPG_ERR_EOF) - { - log_write("otp_1_0_send_certificates: gpgme can not list keys: %s\n", gpgme_strerror (err)); - } + char* trustlevel = (cert->trusted == TRUE)? "trusted" : "notrust"; + cert_list_elem = g_slist_next(cert_list_elem); + auth_printf(globals, "%s <|> %s <|> %s <|> %d <|> %s\n", cert->fpr, + cert->ownername, trustlevel, + strlen(cert->full_public_key), + cert->full_public_key); } - - gpgme_release(ctx); - // Certificate retrieval end + // Releases + auth_printf(globals, "<|> SERVER\n"); } Modified: trunk/openvas-server/openvasd/otp_1_0.h =================================================================== --- trunk/openvas-server/openvasd/otp_1_0.h 2008-11-12 13:50:27 UTC (rev 1702) +++ trunk/openvas-server/openvasd/otp_1_0.h 2008-11-12 13:52:41 UTC (rev 1703) @@ -46,4 +46,6 @@ void otp_1_0_server_openvas_version(struct arglist *); +void otp_1_0_server_send_certificates(struct arglist* globals); + #endif Modified: trunk/openvas-server/openvasd/oval_plugins.c =================================================================== --- trunk/openvas-server/openvasd/oval_plugins.c 2008-11-12 13:50:27 UTC (rev 1702) +++ trunk/openvas-server/openvasd/oval_plugins.c 2008-11-12 13:52:41 UTC (rev 1703) @@ -30,12 +30,15 @@ */ #include +#include +#include +#include "corevers.h" +#include "log.h" #include "pluginload.h" -#include "log.h" -#include +#include "preferences.h" #include "processes.h" -#include "corevers.h" + static void oval_thread(struct arglist *); void ovaldi_launch(struct arglist * g_args); @@ -201,7 +204,7 @@ if ( preferences_nasl_no_signature_check(preferences) == 0 && nasl_verify_signature( fullname) != 0) { - log_write("%s: signature of nvt could not been verified/ is missing."); + log_write("%s: signature of nvt could not been verified/ is missing.", fullname); return NULL; } @@ -283,10 +286,8 @@ arg_set_value(plugin, "preferences", -1, preferences); arg_add_value(plugin, "key", ARG_PTR, -1, kb); - // TODO felix get preferences from global context and check the signature. - // Otherwise a client can start unsigned oval plugins even if the server - // preference is set to "no"! - // if( nasl_verify_signature( arg_get_value(g_args, "name")) ) + // TODO felix get Preferences from global context and check the signature + //if( nasl_verify_signature( arg_get_value(g_args, "name")) ) // post_log( g_args, 0, "Attempt to start signed oval plugin."); module = create_process((process_func_t)oval_thread, plugin); @@ -484,7 +485,7 @@ argv[8] = NULL; // log_write("Launching ovaldi with: %s\n", g_strjoinv(" ", argv)); - if(g_spawn_sync(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, child_setup, NULL, NULL, NULL, NULL, NULL)) + if(g_spawn_sync(NULL, argv, NULL, 0, child_setup, NULL, NULL, NULL, NULL, NULL)) { GMarkupParser parser; GMarkupParseContext *context = NULL; From scm-commit at wald.intevation.org Wed Nov 12 14:59:49 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 12 Nov 2008 14:59:49 +0100 (CET) Subject: [Openvas-commits] r1704 - in trunk/openvas-client: . nessus src src/openvas-lib Message-ID: <20081112135949.73A8F40728@pyrosoma.intevation.org> Author: felix Date: 2008-11-12 14:59:42 +0100 (Wed, 12 Nov 2008) New Revision: 1704 Added: trunk/openvas-client/src/openvas-lib/ trunk/openvas-client/src/openvas-lib/Makefile trunk/openvas-client/src/openvas-lib/openvas_certificates.c trunk/openvas-client/src/openvas-lib/openvas_certificates.h Modified: trunk/openvas-client/ChangeLog trunk/openvas-client/MANIFEST trunk/openvas-client/Makefile trunk/openvas-client/nessus/Makefile trunk/openvas-client/nessus/comm.c trunk/openvas-client/nessus/context.c trunk/openvas-client/nessus/context.h trunk/openvas-client/nessus/plugin_infos.c Log: * src/openvas-libraries : new folder for local copy of openvas_certificate struct added. * src/openvas-libraries/Makefile : added. * src/openvas-libraries/openvas_certificates.c : New file with openvas_certitificate struct, ~new and ~free added. * src/openvas-libraries/openvas_certificates.h : New file with protos added. * MANIFEST : updated * Makefile : added new dir to the clean target. * nessus/plugin_infos.c (plugin_info_window_setup) : include added, showing certificate information for a nvt with a button to show the full certificate. * nessus/plugin_infos.c (showcert): Added functionality to show a certificate. * nessus/Makefile : Changed to include the new files. * nessus/context.h : Removed hashtables from first implementation plan, added single signer_fp_certificates hashtable. * nessus/context.c (context_init, context_new) : Inits the hashtable signer_fp_certificates hashtable. * nessus/comm.c (parse_certificate, get_certificates) : corrected and updated. * ChangeLog : shamefully changed typos with my own email adress. Modified: trunk/openvas-client/ChangeLog =================================================================== --- trunk/openvas-client/ChangeLog 2008-11-12 13:52:41 UTC (rev 1703) +++ trunk/openvas-client/ChangeLog 2008-11-12 13:59:42 UTC (rev 1704) @@ -1,3 +1,44 @@ +2008-11-12 Felix Wolfsteller + + Work on Change Request #17 (http://www.openvas.org/openvas-cr-17.html - + "OTP: Make NVT signatures available to OpenVAS-Client"). + Now shows certificate information. + + * src/openvas-libraries : new folder for local copy of + openvas_certificate struct added. + + * src/openvas-libraries/Makefile : added. + + * src/openvas-libraries/openvas_certificates.c : New file with + openvas_certitificate struct, ~new and ~free added. + + * src/openvas-libraries/openvas_certificates.h : New file with + protos added. + + * MANIFEST : updated + + * Makefile : added new dir to the clean target. + + * nessus/plugin_infos.c (plugin_info_window_setup) : include added, + showing certificate information for a nvt with a button to show the + full certificate. + + * nessus/plugin_infos.c (showcert): Added functionality to show a + certificate. + + * nessus/Makefile : Changed to include the new files. + + * nessus/context.h : Removed hashtables from first implementation plan, + added single signer_fp_certificates hashtable. + + * nessus/context.c (context_init, context_new) : Inits the + hashtable signer_fp_certificates hashtable. + + * nessus/comm.c (parse_certificate, get_certificates) : corrected + and updated. + + * ChangeLog : shamefully changed typos with my own email adress. + 2008-11-12 Michael Wiegand * configure.in: Added AC_PREREQ directive to tell autoconf to generate @@ -31,13 +72,13 @@ * libnessus/harglists.c, libnessus/arglists.c, libnessus/network.c, libnessus/Makefile:: added glib header -2008-11-07 Felix Wolfsteller +2008-11-07 Felix Wolfsteller * nessus/comm.c (comm_parse_certificate): (New) method stub. * nessus/comm.c (comm_get_certificates): Fixed and eased loop. -2008-11-05 Felix Wolfsteller +2008-11-05 Felix Wolfsteller Work on Change Request #17 (http://www.openvas.org/openvas-cr-17.html - "OTP: Make NVT signatures available to OpenVAS-Client"). @@ -51,7 +92,7 @@ * nessus/comm.c (comm_get_certificates): Reads in the OTP "certificates" element. -2008-10-31 Felix Wolfsteller +2008-10-31 Felix Wolfsteller Steps to an implementation of Change Request #17 (http://www.openvas.org/openvas-cr-17.html - "Make NVT signatures Modified: trunk/openvas-client/MANIFEST =================================================================== --- trunk/openvas-client/MANIFEST 2008-11-12 13:52:41 UTC (rev 1703) +++ trunk/openvas-client/MANIFEST 2008-11-12 13:59:42 UTC (rev 1704) @@ -218,6 +218,9 @@ src/gui/treeview_support.h src/gui/treeview_support.c src/gui/Makefile +src/openvas-libraries/Makefile +src/openvas-libraries/openvas_certificates.c +src/openvas-libraries/openvas_certificates.h src/README src/xpm/logo_bsi_de.xpm src/xpm/logo_bsi.xpm Modified: trunk/openvas-client/Makefile =================================================================== --- trunk/openvas-client/Makefile 2008-11-12 13:52:41 UTC (rev 1703) +++ trunk/openvas-client/Makefile 2008-11-12 13:59:42 UTC (rev 1704) @@ -53,6 +53,7 @@ cd libnessus && $(MAKE) clean cd ssl && $(MAKE) clean cd src/gui && $(MAKE) clean + cd src/openvas-lib && $(MAKE) clean distclean: clean [ -z "${rootdir}" ] || rm -f ${rootdir}/include/config.h ${rootdir}/include/corevers.h Modified: trunk/openvas-client/nessus/Makefile =================================================================== --- trunk/openvas-client/nessus/Makefile 2008-11-12 13:52:41 UTC (rev 1703) +++ trunk/openvas-client/nessus/Makefile 2008-11-12 13:59:42 UTC (rev 1704) @@ -1,7 +1,7 @@ include ../nessus.tmpl GTKLIBS= $(GTKCONFIG_LIBS) -INCLUDE = ${include} $(GTKCONFIG_CFLAGS) $(GLIB_CFLAGS) -I../src/gui +INCLUDE = ${include} $(GTKCONFIG_CFLAGS) $(GLIB_CFLAGS) -I../src/gui -I../src/openvas-lib LIBS = $(X_LIBS) $(X_CFLAGS) $(GTKLIBS) $(GLIB_LIBS) $(GDC_LIB) \ $(RUN_LIBS) $(C_R_LIB) -lm -L../libnessus -lnessus-client -lssl -lcrypto $(DL_LIB) -lz $(SOCKET_LIB) @@ -60,6 +60,7 @@ regex.o \ filter.o \ dirutils.o \ + openvas_certificates.o \ sslui.o \ nessus.o @@ -143,6 +144,10 @@ plugin_infos.h families.h xpm/warning_small.xpm $(CC) $(CFLAGS) $(NESSUS_INCLUDE) -c prefs_dialog/prefs_plugins_tree.c +openvas_certificates.o : cflags ../src/openvas-lib/openvas_certificates.c \ + ../src/openvas-lib/openvas_certificates.c + $(CC) $(CFLAGS) $(NESSUS_INCLUDE) -c ../src/openvas-lib/openvas_certificates.c + error_dlg.o : cflags ../src/gui/error_dlg.c ../src/gui/error_dlg.h globals.h $(CC) $(CFLAGS) $(NESSUS_INCLUDE) -c ../src/gui/error_dlg.c Modified: trunk/openvas-client/nessus/comm.c =================================================================== --- trunk/openvas-client/nessus/comm.c 2008-11-12 13:52:41 UTC (rev 1703) +++ trunk/openvas-client/nessus/comm.c 2008-11-12 13:59:42 UTC (rev 1704) @@ -45,6 +45,7 @@ #include "parser.h" #include "globals.h" #include "error_dlg.h" +#include "openvas_certificates.h" #include "plugin_cache.h" #ifndef MIN @@ -1560,29 +1561,73 @@ /** - * Will parse a certificate string sent by the server and adds the respective - * fields to HashTables of the context. + * Parse a certificate command sent by the server and adds the respective + * pointers to the signer_fp_certificates hashtable of the context. + * Will return 0 on success, 1 when buffer is "<|> SERVER\n", -1 on errors. * @param buffer The OTP "certificate" element sent by the server. * @param context The local context to add the certificate information to. - * @return Always 0, as its a stub. + * @return 0 on success, 1 on the servers announcement of the end of certificate + * list, -1 on error. */ int comm_parse_certificate(char* buffer, struct context* context) { - //Parse. - //Add infos to context, e.g. - //context->signer_fp_public_keys = g_hash_table_new(g_str_hash, g_str_equal); - //g_hash_table_insert(context->signer_fp_public_keys, "a", "Y"); + if( strcmp(buffer, "<|> SERVER\n") == 0 ) + return 1; + + // Initialize the hashtable if not yet done. + if(context->signer_fp_certificates == NULL) + context->signer_fp_certificates = g_hash_table_new(g_str_hash, g_str_equal); + + char* sep = strstr(buffer, "<|>"); + if (sep == NULL) + return -1; + + // Read in tokens + char* fpr = strtok(buffer," <|>"); + char* name = strtok(NULL,"<|>"); + char* trust_level = strtok(NULL," <|>"); + gboolean trusted = ( strcmp(trust_level, "trusted") == 0 )? TRUE : FALSE; + char* nbytes = strtok(NULL,"<|>"); + long pkey_length = atol(nbytes); + if(pkey_length < 1) + return -1; + char* pubkey = strtok(NULL,"<|>"); + + // Not enough tokens + if(fpr == NULL || name == NULL || trust_level == NULL || pkey_length < 1 + || pubkey == NULL) + return -1; + + // Key incomplete + if( strlen(pubkey)-2 != pkey_length ) + return -1; + + // Replace semicolons by newlines + char* pos = pubkey; + while (pos[0] != '\0') + { + if (pos[0] == ';') pos[0] = '\n'; + pos++; + } + + // Create and index certificate + openvas_certificate* cert = openvas_certificate_new( estrdup(fpr), estrdup(name), trusted, estrdup(pubkey)); + g_hash_table_insert(context->signer_fp_certificates, cert->fpr , cert ); + return 0; } /** * Request certificates used for NVTs signatures. + * Certificates are then stored in the contexts hashtable signer_fp_certificates + * where a fingerprint points to a certificate structure. * Returns 0 on success, != 0 on error. + * @param context The Context to use (e.g. a specific scope). + * @return 0 on success; != 0 on error. */ int comm_get_certificates(struct context* context) { - // TODO: Felix CR#17 (protocol not fully specified yet) char buffer[32768]; int response_length = 25; /* expected response: "SERVER <|> CERTIFICATES\n" */ network_printf(context->socket, "CLIENT <|> CERTIFICATES <|> CLIENT\n"); @@ -1593,19 +1638,16 @@ // If certificate list starts if( strcmp(buffer, "SERVER <|> CERTIFICATES\n") == 0) { - buffer[0] = '\0'; - // fingerprint(max 48) <|> owner(max 120) <|> trusted|notrust(7) <|> - // key size in bytes to come <|> key itself (ascii- armored) - network_gets(context->socket, buffer, 48 + 5 + 120 + 5 + 7); - - while ( strcmp(buffer, "<|> SERVER\n") != 0) - { - //printf("Certificate information received: -%s-", buffer); - buffer[0] = '\0'; - network_gets(context->socket, buffer, 48 + 5 + 120 + 5 + 7); - //Parse: - // if comm_parse_certificate(buffer) != 0 - } + int parsing_status = 0; + do + { + buffer[0] = '\0'; + network_gets(context->socket, buffer, 16348); + parsing_status = comm_parse_certificate(buffer, context); + if(parsing_status == -1) + show_error(_("Could not parse certificate: %s"), buffer); + } + while ( parsing_status == 0); } // else respond is invalid else @@ -1614,6 +1656,7 @@ buffer); return -1; } + // Success return 0; } Modified: trunk/openvas-client/nessus/context.c =================================================================== --- trunk/openvas-client/nessus/context.c 2008-11-12 13:52:41 UTC (rev 1703) +++ trunk/openvas-client/nessus/context.c 2008-11-12 13:59:42 UTC (rev 1704) @@ -62,6 +62,7 @@ (*context)->plugin_tree_model = NULL; #endif (*context)->plugin_cache_loaded = 0; + (*context)->signer_fp_certificates = NULL; } struct context * @@ -504,6 +505,8 @@ preferences_generate_new_file(context, name); + context->signer_fp_certificates = g_hash_table_new(g_str_hash, g_str_equal); + return context; } @@ -555,6 +558,7 @@ arg_free_all(context->dependencies); context->dependencies = NULL; context_delete_directory(context->dir); + // FIXME: felix free signer_fp_certificates hashtable and entries context_remove_child(context->parent, context); if(context == Context) { Modified: trunk/openvas-client/nessus/context.h =================================================================== --- trunk/openvas-client/nessus/context.h 2008-11-12 13:52:41 UTC (rev 1703) +++ trunk/openvas-client/nessus/context.h 2008-11-12 13:59:42 UTC (rev 1704) @@ -74,8 +74,7 @@ GtkTreeStore *plugin_tree_store; GtkTreeModel *plugin_tree_model; #endif - GHashTable* signer_fp_public_keys; - GHashTable* signer_fp_trust_level; + GHashTable* signer_fp_certificates; /* reports may have plugin information too. They can be quite large, * so we avoid loading them. This flag indicates whether the plugin * information has been loaded. Modified: trunk/openvas-client/nessus/plugin_infos.c =================================================================== --- trunk/openvas-client/nessus/plugin_infos.c 2008-11-12 13:52:41 UTC (rev 1703) +++ trunk/openvas-client/nessus/plugin_infos.c 2008-11-12 13:59:42 UTC (rev 1704) @@ -39,6 +39,7 @@ #include "nessus_plugin.h" #include "nessus_i18n.h" #include "globals.h" +#include "openvas_certificates.h" static void show_deps(foo, name) @@ -243,8 +244,71 @@ +static void +showcert(GtkWidget* parent, char* fpr) +{ + openvas_certificate* cert = g_hash_table_lookup(Context->signer_fp_certificates, fpr); + // dummy, showing the pub key here + GtkWidget * win; + GtkWidget * vbox, *hbox; + GtkWidget * label, *text, *table, *vsb, *sep,*button; + GtkAdjustment * vadj; + win = gtk_window_new(GTK_WINDOW_TOPLEVEL); + gtk_window_set_default_size(GTK_WINDOW(win), 640, 480); + gtk_window_set_position(GTK_WINDOW(win), GTK_WIN_POS_CENTER); + gtk_widget_realize(win); + //arg_add_value(ctrls, "WINDOW", ARG_PTR, -1, w); + + vbox = gtk_vbox_new(FALSE, 5); + gtk_container_add(GTK_CONTAINER(win), vbox); + gtk_widget_show(vbox); + + label = gtk_label_new(_("Public key of:")); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); + gtk_widget_show(label); + label = gtk_label_new(cert->ownername); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); + gtk_widget_show(label); + label = gtk_label_new(_("Fingerprint:")); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); + gtk_widget_show(label); + + label = gtk_label_new(cert->fpr); + gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5); + gtk_widget_show(label); + + vadj = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)); + vsb = gtk_vscrollbar_new(vadj); + table = gtk_table_new(1,2,FALSE); + gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0); + gtk_widget_show(table); + + text = gtk_text_new(NULL, vadj); + gtk_table_attach(GTK_TABLE(table), vsb, 1, 2, 0, 1, 0, + GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); + gtk_table_attach(GTK_TABLE(table), text, 0,1,0,1, + GTK_EXPAND | GTK_SHRINK | GTK_FILL, + GTK_EXPAND | GTK_SHRINK | GTK_FILL, 0, 0); + + gtk_container_border_width(GTK_CONTAINER(table), 2); + gtk_widget_show(vsb); + gtk_widget_realize(text); + gtk_text_set_editable(GTK_TEXT(text), FALSE); + gtk_text_set_word_wrap(GTK_TEXT(text), TRUE); + gtk_text_insert(GTK_TEXT(text), NULL, NULL, NULL, cert->full_public_key, -1); + gtk_widget_show(text); + + sep = gtk_hseparator_new(); + gtk_box_pack_start(GTK_BOX(vbox), sep, FALSE, FALSE, 0); + gtk_widget_show(sep); + + gtk_widget_show(win); + gtk_window_set_modal(GTK_WINDOW(win), TRUE); +} + + /* * plugin_info_window_setup * @@ -408,13 +472,36 @@ gtk_widget_show(hbox); /* Server trust level information */ + + // TODO: felix handle multiple signatures txt = plugin->sign_key_ids; - snprintf(buf, sizeof(buf), _("Trust Information: %s"), txt); + openvas_certificate* cert = g_hash_table_lookup(Context->signer_fp_certificates, txt); + if(cert == NULL) + { + snprintf(buf, sizeof(buf), _("Trust: NVT is not signed")); + } + else + { + char* trusted = (cert->trusted == TRUE)?_("trusted"):_("untrusted"); + snprintf(buf, sizeof(buf), _("Trust: NVT is signed by %s (%s)"), + cert->ownername, trusted); + } + label = gtk_label_new(buf); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE,0); gtk_misc_set_alignment((GtkMisc *)label, 0, 1); gtk_widget_show(label); + // Button to show pubkey + if (cert != NULL ) + { + button = gtk_button_new_with_label(_("Show")); + g_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(showcert), + cert->fpr); + gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); + gtk_widget_show(button); + } + /* A hbox for the buttons */ hbox = gtk_hbox_new(FALSE,10); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE,FALSE,10); @@ -422,7 +509,7 @@ /* The button for setting the plugin timeout */ button = gtk_button_new_with_label(_("Set plugin timeout...")); - g_signal_connect(GTK_OBJECT(button), "clicked",GTK_SIGNAL_FUNC(set_timeout), + g_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(set_timeout), (void*)plugin->oid); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 5); gtk_widget_show(button); Added: trunk/openvas-client/src/openvas-lib/Makefile =================================================================== --- trunk/openvas-client/src/openvas-lib/Makefile 2008-11-12 13:52:41 UTC (rev 1703) +++ trunk/openvas-client/src/openvas-lib/Makefile 2008-11-12 13:59:42 UTC (rev 1704) @@ -0,0 +1,65 @@ +# OpenVAS-Client +# $Id$ +# Description: Makefile for clients local copy of openvas-librarie module +# +# Authors: +# Jan-Oliver Wagner +# +# Copyright: +# Copyright (C) 2008 Intevation GmbH +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2, +# or, at your option, any later version as published by the Free +# Software Foundation +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# In addition, as a special exception, you have +# permission to link the code of this program with the OpenSSL +# library (or with modified versions of OpenSSL that use the same +# license as OpenSSL), and distribute linked combinations including +# the two. You must obey the GNU General Public License in all +# respects for all of the code used other than OpenSSL. If you +# modify this file, you may extend this exception to your version +# of the file, but you are not obligated to do so. If you do not +# wish to do so, delete this exception statement from your version. +#/ + +include ../../nessus.tmpl + +GTKLIBS= $(GTKCONFIG_LIBS) +INCLUDE = ${include} $(GTKCONFIG_CFLAGS) -I../../nessus -I.. + +NESSUS_INCLUDE=`sh ./cflags` +CFLAGS+=-Wall + +# Add some specific Windows compile options for Cygwin +SYSTEM:=$(shell uname -o) +ifeq ($(SYSTEM), Cygwin) +CFLAGS+=-mms-bitfields +LDFLAGS+=-mwindows +endif + +OBJS=openvas_certificates.o + +all : cflags $(OBJS) + +cflags : Makefile + @echo "$(NESSUS_CFLAGS) $(NESSUS_DEFS) -DPACKAGE=\"OpenVAS-Client\" $(INCLUDE)" | sed 's/\"/\\\"/g' > cflags.tmp + @echo "echo \"`cat cflags.tmp`\"" > cflags + @rm cflags.tmp + @chmod +x cflags + +openvas_certificate.o : cflags openvas_certificates.h + $(CC) $(CFLAGS) $(NESSUS_INCLUDE) -c openvas_certificates.c + +clean : + rm -f *.o cflags Added: trunk/openvas-client/src/openvas-lib/openvas_certificates.c =================================================================== --- trunk/openvas-client/src/openvas-lib/openvas_certificates.c 2008-11-12 13:52:41 UTC (rev 1703) +++ trunk/openvas-client/src/openvas-lib/openvas_certificates.c 2008-11-12 13:59:42 UTC (rev 1704) @@ -0,0 +1,83 @@ +/* OpenVAS-Client + * $Id$ + * Description: Certificate structure holding information about certificates + * like trust level and a copy of the public key. + * + * Authors: + * Felix Wolfsteller + * + * Copyright: + * Copyright (C) 2008 Intevation GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * or, at your option, any later version as published by the Free + * Software Foundation + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * In addition, as a special exception, you have + * permission to link the code of this program with the OpenSSL + * library (or with modified versions of OpenSSL that use the same + * license as OpenSSL), and distribute linked combinations including + * the two. You must obey the GNU General Public License in all + * respects for all of the code used other than OpenSSL. If you + * modify this file, you may extend this exception to your version + * of the file, but you are not obligated to do so. If you do not + * wish to do so, delete this exception statement from your version. + */ + +/*!******************************************** + * This file is basically a copy of * + * openvas-libnasl/nasl/nasl_signature.h * + * (will in turn be moved to libraries after * + * cleanup ) * + * Once openvas-libraries and openvas-libnasl * + * are cleaned up and a dependency client->lib* + * is introduced, this local copy is obsolete.* + *******************************************!*/ + +#include "openvas_certificates.h" + +/** + * Returns pointer to freshly allocated and initialized openvas_certificate. + * @param fingerpr ingerprint of certificate. + * @param owner Certificate owners name. + * @param istrusted Whether this certificate is trustworthy or not. + * @param pubkey Full public key. + * @return Pointer to fresh openvas_certificate. + */ +openvas_certificate* openvas_certificate_new(char* fingerpr, char* owner, + gboolean istrusted, char* pubkey) +{ + openvas_certificate* cert = emalloc(sizeof(openvas_certificate)); + cert->fpr = fingerpr; + cert->ownername = owner; + cert->trusted = istrusted; + cert->full_public_key = pubkey; + return cert; +} + +/** + * Frees the openvas_certificate and all associated data. + * @param cert Certificate which holds pointers to the data. + */ +void openvas_certificate_free(openvas_certificate* cert) +{ + if(cert->fpr != NULL) + efree(& (cert->fpr) ); + if( cert->ownername != NULL) + efree(& (cert->ownername) ); + if(cert->trusted != NULL) + efree(& (cert->trusted) ); + if(cert->full_public_key != NULL) + efree(& (cert->full_public_key) ); + efree(&cert); +} \ No newline at end of file Added: trunk/openvas-client/src/openvas-lib/openvas_certificates.h =================================================================== --- trunk/openvas-client/src/openvas-lib/openvas_certificates.h 2008-11-12 13:52:41 UTC (rev 1703) +++ trunk/openvas-client/src/openvas-lib/openvas_certificates.h 2008-11-12 13:59:42 UTC (rev 1704) @@ -0,0 +1,65 @@ +/* OpenVAS-Client + * $Id$ + * Description: Certificate structure holding information about certificates + * like trust level and a copy of the public key. + * + * Authors: + * Felix Wolfsteller + * + * Copyright: + * Copyright (C) 2008 Intevation GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2, + * or, at your option, any later version as published by the Free + * Software Foundation + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * In addition, as a special exception, you have + * permission to link the code of this program with the OpenSSL + * library (or with modified versions of OpenSSL that use the same + * license as OpenSSL), and distribute linked combinations including + * the two. You must obey the GNU General Public License in all + * respects for all of the code used other than OpenSSL. If you + * modify this file, you may extend this exception to your version + * of the file, but you are not obligated to do so. If you do not + * wish to do so, delete this exception statement from your version. + */ + +/*!******************************************** + * This file is basically a copy of * + * openvas-libnasl/nasl/nasl_signature.h * + * (will in turn be moved to libraries after * + * cleanup ) * + * Once openvas-libraries and openvas-libnasl * + * are cleaned up and a dependency client->lib* + * is introduced, this local copy is obsolete.* + *******************************************!*/ + +#ifndef _OPENVAS_CERTIFICATES_H +#define _OPENVAS_CERTIFICATES_H + +#include + +#include + +typedef struct { + char* fpr; + char* ownername; + gboolean trusted; + char* full_public_key; +} openvas_certificate; + +openvas_certificate* openvas_certificate_new(char*, char*, gboolean, + char*); +void openvas_certificate_free(openvas_certificate*); + +#endif From scm-commit at wald.intevation.org Wed Nov 12 15:28:03 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 12 Nov 2008 15:28:03 +0100 (CET) Subject: [Openvas-commits] r1706 - in trunk/openvas-libnasl: . nasl Message-ID: <20081112142803.C93FA40719@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-12 15:28:03 +0100 (Wed, 12 Nov 2008) New Revision: 1706 Modified: trunk/openvas-libnasl/ChangeLog trunk/openvas-libnasl/nasl/nasl_misc_funcs.c trunk/openvas-libnasl/nasl/nasl_nessusd_glue.c trunk/openvas-libnasl/nasl/regex.c Log: Applying patch provided by Stjepan Gros to improve 64-bit cleanliness. * nasl/nasl_misc_funcs.c, nasl/nasl_nessusd_glue.c, nasl/regex.c: 64/32-bit cleanups. Modified: trunk/openvas-libnasl/ChangeLog =================================================================== --- trunk/openvas-libnasl/ChangeLog 2008-11-12 14:26:14 UTC (rev 1705) +++ trunk/openvas-libnasl/ChangeLog 2008-11-12 14:28:03 UTC (rev 1706) @@ -1,3 +1,10 @@ +2008-11-12 Michael Wiegand + + Applying patch provided by Stjepan Gros to improve 64-bit cleanliness. + + * nasl/nasl_misc_funcs.c, nasl/nasl_nessusd_glue.c, nasl/regex.c: + 64/32-bit cleanups. + 2008-11-12 Felix Wolfsteller Work on Change Request #17 (http://www.openvas.org/openvas-cr-17.html - Modified: trunk/openvas-libnasl/nasl/nasl_misc_funcs.c =================================================================== --- trunk/openvas-libnasl/nasl/nasl_misc_funcs.c 2008-11-12 14:26:14 UTC (rev 1705) +++ trunk/openvas-libnasl/nasl/nasl_misc_funcs.c 2008-11-12 14:28:03 UTC (rev 1706) @@ -19,6 +19,9 @@ /* * This file contains all the misc. functions found in NASL */ + +#include + #include "includes.h" #include "nasl_tree.h" @@ -193,9 +196,9 @@ if(soc>=0) { if(arg_get_value(script_infos, "denial_port") != 0) - arg_set_value(script_infos, "denial_port", sizeof(int), (void*)port); + arg_set_value(script_infos, "denial_port", sizeof(gpointer), GSIZE_TO_POINTER(port)); else - arg_add_value(script_infos, "denial_port", ARG_INT, sizeof(int), (void*)port); + arg_add_value(script_infos, "denial_port", ARG_INT, sizeof(gpointer), GSIZE_TO_POINTER(port)); close_stream_connection(soc); @@ -207,9 +210,9 @@ if (p != NULL) alive = p->x.i_val; if(arg_get_value(script_infos, "tcp_ping_result") != 0) - arg_set_value(script_infos, "tcp_ping_result", sizeof(int), (void*)alive); + arg_set_value(script_infos, "tcp_ping_result", sizeof(gpointer), GSIZE_TO_POINTER(alive)); else - arg_add_value(script_infos, "tcp_ping_result", ARG_INT, sizeof(int), (void*)alive); + arg_add_value(script_infos, "tcp_ping_result", ARG_INT, sizeof(gpointer), GSIZE_TO_POINTER(alive)); deref_cell(p); @@ -218,7 +221,7 @@ tree_cell * nasl_end_denial(lex_ctxt * lexic) { - int port = (int)arg_get_value(lexic->script_infos, "denial_port"); + int port = GPOINTER_TO_SIZE(arg_get_value(lexic->script_infos, "denial_port")); int soc; int to = lexic->recv_timeout; struct arglist * script_infos = lexic->script_infos; @@ -231,7 +234,7 @@ if(!port) { - int ping = (int)arg_get_value(script_infos, "tcp_ping_result"); + int ping = GPOINTER_TO_SIZE(arg_get_value(script_infos, "tcp_ping_result")); if(ping) return nasl_tcp_ping(lexic); else @@ -850,12 +853,12 @@ if ( ! hostname || type != KB_TYPE_STR ) return NULL; - port = (int)plug_get_key(script_infos, "Secret/kdc_port", &type); + port = GPOINTER_TO_SIZE(plug_get_key(script_infos, "Secret/kdc_port", &type)); if ( port <= 0 || type != KB_TYPE_INT ) return NULL; - tcp = (int)plug_get_key(script_infos, "Secret/kdc_use_tcp", &type); + tcp = GPOINTER_TO_SIZE(plug_get_key(script_infos, "Secret/kdc_use_tcp", &type)); if ( tcp < 0 || type != KB_TYPE_INT ) tcp = 0; Modified: trunk/openvas-libnasl/nasl/nasl_nessusd_glue.c =================================================================== --- trunk/openvas-libnasl/nasl/nasl_nessusd_glue.c 2008-11-12 14:26:14 UTC (rev 1705) +++ trunk/openvas-libnasl/nasl/nasl_nessusd_glue.c 2008-11-12 14:28:03 UTC (rev 1706) @@ -21,8 +21,10 @@ * as NASL script and nessusd. * (script_*(), *kb*(), scanner_*()) */ - #include + +#include + #include "strutils.h" #include "nasl_tree.h" @@ -665,7 +667,7 @@ if( type == KB_TYPE_INT ) { retc->type = CONST_INT; - retc->x.i_val = (int)val; + retc->x.i_val = GPOINTER_TO_SIZE(val); return retc; } else @@ -721,7 +723,7 @@ if( type == KB_TYPE_INT ) { retc->type = CONST_INT; - retc->x.i_val = (int)val; + retc->x.i_val = GPOINTER_TO_SIZE(val); return retc; } else @@ -763,7 +765,7 @@ if(type == VAR2_INT) { int value = get_int_local_var_by_name(lexic, "value", -1); - if ( value != -1 )plug_replace_key(script_infos, name, ARG_INT,(void*)value); + if ( value != -1 )plug_replace_key(script_infos, name, ARG_INT,GSIZE_TO_POINTER(value)); else nasl_perror(lexic, "Syntax error with replace_kb_item(%s) [value=-1]\n", name); } else { @@ -802,7 +804,7 @@ if(type == VAR2_INT) { int value = get_int_local_var_by_name(lexic, "value", -1); - if ( value != -1 )plug_set_key(script_infos, name, ARG_INT,(void*)value); + if ( value != -1 )plug_set_key(script_infos, name, ARG_INT,GSIZE_TO_POINTER(value)); else nasl_perror(lexic, "Syntax error with set_kb_item() [value=-1 for name '%s']\n", Modified: trunk/openvas-libnasl/nasl/regex.c =================================================================== --- trunk/openvas-libnasl/nasl/regex.c 2008-11-12 14:26:14 UTC (rev 1705) +++ trunk/openvas-libnasl/nasl/regex.c 2008-11-12 14:28:03 UTC (rev 1706) @@ -30,6 +30,8 @@ #include #include +#include + #ifndef HAVE_REGEX_SUPPORT /* The `emacs' switch turns on certain matching commands @@ -2331,7 +2333,7 @@ value. Assumes the variable `fail_stack'. Probably should only be called from within `PUSH_FAILURE_POINT'. */ #define PUSH_FAILURE_ITEM(item) \ - fail_stack.stack[fail_stack.avail++] = (fail_stack_elt_t) item + fail_stack.stack[fail_stack.avail++] = (fail_stack_elt_t) GSIZE_TO_POINTER(item) /* The complement operation. Assumes `fail_stack' is nonempty. */ #define POP_FAILURE_ITEM() fail_stack.stack[--fail_stack.avail] @@ -2498,10 +2500,10 @@ DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \ \ /* Restore register info. */ \ - high_reg = (unsigned) POP_FAILURE_ITEM (); \ + high_reg = GPOINTER_TO_SIZE(POP_FAILURE_ITEM ()); \ DEBUG_PRINT2 (" Popping high active reg: %d\n", high_reg); \ \ - low_reg = (unsigned) POP_FAILURE_ITEM (); \ + low_reg = GPOINTER_TO_SIZE(POP_FAILURE_ITEM ()); \ DEBUG_PRINT2 (" Popping low active reg: %d\n", low_reg); \ \ for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \ @@ -3768,7 +3770,7 @@ regstart[r] = old_regstart[r]; /* xx why this test? */ - if ((int) old_regend[r] >= (int) regstart[r]) + if (GPOINTER_TO_SIZE(old_regend[r]) >= GPOINTER_TO_SIZE(regstart[r])) regend[r] = old_regend[r]; } } From scm-commit at wald.intevation.org Wed Nov 12 15:30:20 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 12 Nov 2008 15:30:20 +0100 (CET) Subject: [Openvas-commits] r1707 - in trunk/openvas-server: . openvasd Message-ID: <20081112143020.BB8C740719@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-12 15:30:20 +0100 (Wed, 12 Nov 2008) New Revision: 1707 Modified: trunk/openvas-server/ChangeLog trunk/openvas-server/openvasd/attack.c trunk/openvas-server/openvasd/comm.c trunk/openvas-server/openvasd/nasl_plugins.c trunk/openvas-server/openvasd/nes_plugins.c trunk/openvas-server/openvasd/ntp_11.c trunk/openvas-server/openvasd/openvasd.c trunk/openvas-server/openvasd/oval_plugins.c trunk/openvas-server/openvasd/pluginload.c trunk/openvas-server/openvasd/pluginscheduler.c trunk/openvas-server/openvasd/save_kb.c trunk/openvas-server/openvasd/save_tests.c Log: Applying patch provided by Stjepan Gros to improve 64-bit cleanliness. * openvasd/nasl_plugins.c, openvasd/ntp_11.c, openvasd/attack.c, openvasd/save_kb.c, openvasd/openvasd.c, openvasd/nes_plugins.c, openvasd/pluginload.c, openvasd/save_tests.c, openvasd/comm.c, openvasd/pluginscheduler.c: 32/64-bit cleanups, introduced glib. Modified: trunk/openvas-server/ChangeLog =================================================================== --- trunk/openvas-server/ChangeLog 2008-11-12 14:28:03 UTC (rev 1706) +++ trunk/openvas-server/ChangeLog 2008-11-12 14:30:20 UTC (rev 1707) @@ -1,3 +1,12 @@ +2008-11-12 Michael Wiegand + + Applying patch provided by Stjepan Gros to improve 64-bit cleanliness. + + * openvasd/nasl_plugins.c, openvasd/ntp_11.c, openvasd/attack.c, + openvasd/save_kb.c, openvasd/openvasd.c, openvasd/nes_plugins.c, + openvasd/pluginload.c, openvasd/save_tests.c, openvasd/comm.c, + openvasd/pluginscheduler.c: 32/64-bit cleanups, introduced glib. + 2008-11-12 Felix Wolfsteller Work on Change Request #17 (http://www.openvas.org/openvas-cr-17.html - Modified: trunk/openvas-server/openvasd/attack.c =================================================================== --- trunk/openvas-server/openvasd/attack.c 2008-11-12 14:28:03 UTC (rev 1706) +++ trunk/openvas-server/openvasd/attack.c 2008-11-12 14:30:20 UTC (rev 1707) @@ -29,6 +29,9 @@ #include + +#include + #include #include @@ -456,8 +459,8 @@ /* * Options regarding the communication with our father */ - nessus_deregister_connection((int)arg_get_value(globals, "global_socket")); - arg_set_value(globals, "global_socket", -1, (void*)thread_socket); + nessus_deregister_connection(GPOINTER_TO_SIZE(arg_get_value(globals, "global_socket"))); + arg_set_value(globals, "global_socket", -1, GSIZE_TO_POINTER(thread_socket)); /* * Wait for the server to confirm it read our data @@ -539,14 +542,14 @@ num_tested = 0; - global_socket = (int)arg_get_value(globals, "global_socket"); + global_socket = GPOINTER_TO_SIZE(arg_get_value(globals, "global_socket")); plugins = arg_get_value(globals, "plugins"); rules = arg_get_value(globals, "rules"); rejected_hosts = emalloc(sizeof(struct arglist)); save_session = preferences_save_session(preferences); - restoring = ((int)arg_get_value(globals, "RESTORE-SESSION") == 1); + restoring = (GPOINTER_TO_SIZE(arg_get_value(globals, "RESTORE-SESSION")) == 1); if(restoring)tested = arg_get_value(globals, "TESTED_HOSTS"); if(save_session)save_tests_init(globals); Modified: trunk/openvas-server/openvasd/comm.c =================================================================== --- trunk/openvas-server/openvasd/comm.c 2008-11-12 14:28:03 UTC (rev 1706) +++ trunk/openvas-server/openvasd/comm.c 2008-11-12 14:30:20 UTC (rev 1707) @@ -26,11 +26,13 @@ * * */ - #include #include #include + +#include + #include "auth.h" #include "rules.h" #include "comm.h" @@ -351,7 +353,7 @@ comm_wait_order(globals) struct arglist * globals; { - int soc = (int)arg_get_value(globals, "global_socket"); + int soc = GPOINTER_TO_SIZE(arg_get_value(globals, "global_socket")); for (;;) { static char str [2048] ; Modified: trunk/openvas-server/openvasd/nasl_plugins.c =================================================================== --- trunk/openvas-server/openvasd/nasl_plugins.c 2008-11-12 14:28:03 UTC (rev 1706) +++ trunk/openvas-server/openvasd/nasl_plugins.c 2008-11-12 14:30:20 UTC (rev 1707) @@ -28,6 +28,9 @@ */ #include + +#include + #include #include "pluginload.h" #include "plugs_hash.h" @@ -201,7 +204,7 @@ struct arglist * globals = arg_get_value(args, "globals"); struct arglist * preferences = arg_get_value(g_args, "preferences"); char * name = arg_get_value(g_args, "name"); - int soc = (int)arg_get_value(args, "SOCKET"); + int soc = GPOINTER_TO_SIZE(arg_get_value(args, "SOCKET")); int i; char cache_dir[PATH_MAX + 1]; char * t; @@ -216,8 +219,8 @@ log_write("dup2() failed ! - can not launch the plugin\n"); return; } - arg_set_value(args, "SOCKET", sizeof(int), (void*)soc); - arg_set_value(globals, "global_socket", sizeof(int), (void*)soc); + arg_set_value(args, "SOCKET", sizeof(gpointer), GSIZE_TO_POINTER(soc)); + arg_set_value(globals, "global_socket", sizeof(gpointer), GSIZE_TO_POINTER(soc)); for(i=5;i + +#include + #include "pluginload.h" #include "plugs_hash.h" #include "processes.h" @@ -251,7 +254,7 @@ static int nes_thread(args) struct arglist * args; { - int soc = (int)arg_get_value(args, "SOCKET"); + int soc = GPOINTER_TO_SIZE(arg_get_value(args, "SOCKET")); struct arglist * globals = arg_get_value(args, "globals"); int i; plugin_run_t func; @@ -267,8 +270,8 @@ } /* XXX ugly hack */ - arg_set_value(globals, "global_socket", sizeof(int), (void*)soc); - arg_set_value(args, "SOCKET", sizeof(int), (void*)soc); + arg_set_value(globals, "global_socket", sizeof(gpointer), GSIZE_TO_POINTER(soc)); + arg_set_value(args, "SOCKET", sizeof(gpointer), GSIZE_TO_POINTER(soc)); for(i=5;i #include +#include + #include "ntp.h" #include "ntp_11.h" #include "otp_1_0.h" @@ -188,7 +190,7 @@ char * orig; { struct arglist * preferences = arg_get_value(globals, "preferences"); - int soc = (int)arg_get_value(globals, "global_socket"); + int soc = GPOINTER_TO_SIZE(arg_get_value(globals, "global_socket")); char input[16384]; int size; char * target; @@ -243,7 +245,7 @@ struct arglist * globals; { struct arglist * preferences = arg_get_value(globals, "preferences"); - int soc = (int)arg_get_value(globals, "global_socket"); + int soc = GPOINTER_TO_SIZE(arg_get_value(globals, "global_socket")); char * input; int input_sz = 1024*1024; int n; @@ -372,7 +374,7 @@ char * name; int internal; { - int soc = (int)arg_get_value( globals, "global_socket"); + int soc = GPOINTER_TO_SIZE(arg_get_value( globals, "global_socket")); char buf[1024]; snprintf(buf, sizeof(buf), "SERVER <|> FINISHED <|> %s <|> SERVER\n", name); if ( internal ) @@ -410,7 +412,7 @@ ntp_11_recv_file(globals) struct arglist * globals; { - int soc = (int)arg_get_value(globals, "global_socket"); + int soc = GPOINTER_TO_SIZE(arg_get_value(globals, "global_socket")); char input[4096]; char * origname, * localname = temp_file_name(); int n; @@ -631,7 +633,7 @@ if( timestr[len - 1 ] == '\n' ) timestr[len - 1 ] = '\0'; - soc = (int)arg_get_value(globals, "global_socket"); + soc = GPOINTER_TO_SIZE(arg_get_value(globals, "global_socket")); snprintf(buf, sizeof(buf), "SERVER <|> TIME <|> %s <|> %s <|> %s <|> SERVER\n", msg, host, timestr); Modified: trunk/openvas-server/openvasd/openvasd.c =================================================================== --- trunk/openvas-server/openvasd/openvasd.c 2008-11-12 14:28:03 UTC (rev 1706) +++ trunk/openvas-server/openvasd/openvasd.c 2008-11-12 14:30:20 UTC (rev 1707) @@ -319,7 +319,7 @@ struct sockaddr_in * address = arg_get_value(globals, "client_address"); struct arglist * plugins = arg_get_value(globals, "plugins"); struct arglist * prefs = arg_get_value (globals, "preferences") ; - int soc = (int)arg_get_value(globals, "global_socket"); + int soc = GPOINTER_TO_SIZE(arg_get_value(globals, "global_socket")); struct openvas_rules* perms; char * asciiaddr; struct openvas_rules * rules = arg_get_value(globals, "rules"); @@ -377,7 +377,7 @@ setsockopt(soc, SOL_SOCKET, SO_KEEPALIVE, &opt, sizeof(opt)); /* arg_set_value *replaces* an existing value, but it shouldn't fail here */ - (void) arg_set_value(globals, "global_socket", -1, (void *)soc2); + (void) arg_set_value(globals, "global_socket", -1, GSIZE_TO_POINTER(soc2)); #ifdef HAVE_ADDR2ASCII asciiaddr = emalloc(20); @@ -651,20 +651,15 @@ * The SSL connection shall be open _after_ the fork */ globals = emalloc(sizeof(struct arglist)); - arg_add_value(globals, "global_socket", ARG_INT, -1, (void *)soc); - + arg_add_value(globals, "global_socket", ARG_INT, -1, GSIZE_TO_POINTER(soc)); - - my_plugins = g_plugins; arg_add_value(globals, "plugins", ARG_ARGLIST, -1, my_plugins); - - + my_preferences = g_preferences; arg_add_value(globals, "preferences", ARG_ARGLIST, -1, my_preferences); - - my_rules = /*rules_dup*/(g_rules); + my_rules = /*rules_dup*/(g_rules); p_addr = emalloc(sizeof(struct sockaddr_in)); *p_addr = address; @@ -744,7 +739,7 @@ struct arglist * plugins = NULL; struct arglist * preferences = NULL; struct openvas_rules * rules = NULL; - int iana_port = (int)arg_get_value(options, "iana_port"); + int iana_port = GPOINTER_TO_SIZE(arg_get_value(options, "iana_port")); char * config_file = arg_get_value(options, "config_file"); struct in_addr * addr = arg_get_value(options, "addr"); char * str; @@ -801,8 +796,7 @@ nessus_signal(SIGPIPE, SIG_IGN); } - - arg_replace_value(options, "isck", ARG_INT, sizeof(int),(void *)isck); + arg_replace_value(options, "isck", ARG_INT, sizeof(gpointer), GSIZE_TO_POINTER(isck)); arg_replace_value(options, "plugins", ARG_ARGLIST, -1, plugins); arg_replace_value(options, "rules", ARG_PTR, -1, rules); arg_replace_value(options, "preferences", ARG_ARGLIST, -1, preferences); @@ -971,13 +965,13 @@ strncpy(config_file, OPENVASD_CONF, strlen(OPENVASD_CONF)); } - arg_add_value(options, "iana_port", ARG_INT, sizeof(int), (void *)iana_port); + arg_add_value(options, "iana_port", ARG_INT, sizeof(gpointer), GSIZE_TO_POINTER(iana_port)); arg_add_value(options, "config_file", ARG_STRING, strlen(config_file), config_file); arg_add_value(options, "addr", ARG_PTR, -1, &addr); init_openvasd (options, 1, exit_early, be_quiet); g_options = options; - g_iana_socket = (int)arg_get_value(options, "isck"); + g_iana_socket = GPOINTER_TO_SIZE(arg_get_value(options, "isck")); g_plugins = arg_get_value(options, "plugins"); g_preferences = arg_get_value(options, "preferences"); g_rules = arg_get_value(options, "rules"); Modified: trunk/openvas-server/openvasd/oval_plugins.c =================================================================== --- trunk/openvas-server/openvasd/oval_plugins.c 2008-11-12 14:28:03 UTC (rev 1706) +++ trunk/openvas-server/openvasd/oval_plugins.c 2008-11-12 14:30:20 UTC (rev 1707) @@ -300,7 +300,7 @@ static void oval_thread(struct arglist * g_args) { struct arglist * args = arg_get_value(g_args, "args"); - int soc = (int)arg_get_value(g_args, "SOCKET"); + int soc = GPOINTER_TO_SIZE(arg_get_value(g_args, "SOCKET")); struct arglist * globals = arg_get_value(args, "globals"); soc = dup2(soc, 4); @@ -309,8 +309,8 @@ log_write("oval_thread: dup2() failed ! - can not launch the plugin\n"); return; } - arg_set_value(args, "SOCKET", sizeof(int), (void*)soc); - arg_set_value(globals, "global_socket", sizeof(int), (void*)soc); + arg_set_value(args, "SOCKET", sizeof(gpointer), GSIZE_TO_POINTER(soc)); + arg_set_value(globals, "global_socket", sizeof(gpointer), GSIZE_TO_POINTER(soc)); setproctitle("testing %s (%s)", (char*)arg_get_value(arg_get_value(args, "HOSTNAME"), "NAME"), Modified: trunk/openvas-server/openvasd/pluginload.c =================================================================== --- trunk/openvas-server/openvasd/pluginload.c 2008-11-12 14:28:03 UTC (rev 1706) +++ trunk/openvas-server/openvasd/pluginload.c 2008-11-12 14:30:20 UTC (rev 1707) @@ -27,8 +27,10 @@ * */ +#include -#include +#include + #include "utils.h" #include "pluginload.h" #include "log.h" @@ -278,19 +280,18 @@ plugin_set_socket(struct arglist * plugin, int soc) { if(arg_get_value(plugin, "SOCKET") != NULL) - arg_set_value(plugin, "SOCKET", sizeof(int), (void*)soc); + arg_set_value(plugin, "SOCKET", sizeof(gpointer), GSIZE_TO_POINTER(soc)); else - arg_add_value(plugin, "SOCKET", ARG_INT, sizeof(int), (void *)soc); + arg_add_value(plugin, "SOCKET", ARG_INT, sizeof(gpointer), GSIZE_TO_POINTER(soc)); } int plugin_get_socket(struct arglist * plugin) { - return (int)arg_get_value(plugin, "SOCKET"); + return GPOINTER_TO_SIZE(arg_get_value(plugin, "SOCKET")); } - void plugin_unlink(plugin) struct arglist * plugin; { Modified: trunk/openvas-server/openvasd/pluginscheduler.c =================================================================== --- trunk/openvas-server/openvasd/pluginscheduler.c 2008-11-12 14:28:03 UTC (rev 1706) +++ trunk/openvas-server/openvasd/pluginscheduler.c 2008-11-12 14:30:20 UTC (rev 1707) @@ -29,6 +29,9 @@ #include + +#include + #define IN_SCHEDULER_CODE 1 #include "pluginscheduler.h" #include "pluginload.h" @@ -738,15 +741,15 @@ { struct scheduler_plugin * p = plugin_next_unrun_dependencie(h, deps_ptr, 0); - switch((int)p) + switch(GPOINTER_TO_SIZE(p)) { - case (int)NULL : + case GPOINTER_TO_SIZE(NULL) : scheduler_mark_running_ports(h, l->plugin); plugin_set_running_state(h, l->plugin, PLUGIN_STATUS_RUNNING); return l->plugin; break; - case (int)PLUG_RUNNING: + case GPOINTER_TO_SIZE(PLUG_RUNNING) : { /* One of the dependencie is still running - we write down its category */ if(l->plugin->category < running_category) Modified: trunk/openvas-server/openvasd/save_kb.c =================================================================== --- trunk/openvas-server/openvasd/save_kb.c 2008-11-12 14:28:03 UTC (rev 1706) +++ trunk/openvas-server/openvasd/save_kb.c 2008-11-12 14:30:20 UTC (rev 1707) @@ -27,8 +27,10 @@ * */ +#include -#include +#include + #include "log.h" #include "comm.h" #include "users.h" @@ -201,7 +203,7 @@ char* req; int ret; - fd = (int)arg_get_value(globals, "save_kb"); + fd = GPOINTER_TO_SIZE(arg_get_value(globals, "save_kb")); if(fd <= 0) return -1; @@ -234,7 +236,7 @@ char * req; - fd = (int)arg_get_value(globals, "save_kb"); + fd = GPOINTER_TO_SIZE(arg_get_value(globals, "save_kb")); if(fd <= 0) return -1; @@ -333,7 +335,7 @@ !value) return -1; - fd = (int)arg_get_value(globals, "save_kb"); + fd = GPOINTER_TO_SIZE(arg_get_value(globals, "save_kb")); if(fd <= 0) { log_write("user %s : Can not find KB fd for %s\n", (char*)arg_get_value(globals, "user"), hostname); @@ -439,9 +441,9 @@ file_lock(fname); log_write("user %s : new KB will be saved as %s", user, fname); if(arg_get_value(globals, "save_kb")) - arg_set_value(globals, "save_kb", sizeof(int), (void*)f); + arg_set_value(globals, "save_kb", sizeof(gpointer), GSIZE_TO_POINTER(f)); else - arg_add_value(globals, "save_kb", ARG_INT, sizeof(int),(void*)f); + arg_add_value(globals, "save_kb", ARG_INT, sizeof(gpointer),GSIZE_TO_POINTER(f)); } return 0; } @@ -452,7 +454,7 @@ struct arglist * globals; char * hostname; { - int fd = (int)arg_get_value(globals, "save_kb"); + int fd = GPOINTER_TO_SIZE(arg_get_value(globals, "save_kb")); char* fname = kb_fname(globals, hostname); if(fd > 0)close(fd); file_unlock(fname); @@ -724,9 +726,9 @@ { lseek(fd, 0, SEEK_END); if(arg_get_value(globals, "save_kb")) - arg_set_value(globals, "save_kb", ARG_INT, (void*)fd); + arg_set_value(globals, "save_kb", ARG_INT, GSIZE_TO_POINTER(fd)); else - arg_add_value(globals, "save_kb", ARG_INT, sizeof(int), (void*)fd); + arg_add_value(globals, "save_kb", ARG_INT, sizeof(gpointer), GSIZE_TO_POINTER(fd)); } else log_write("user %s : ERROR - %s\n", (char*)arg_get_value(globals, "user"), strerror(errno)); return kb; Modified: trunk/openvas-server/openvasd/save_tests.c =================================================================== --- trunk/openvas-server/openvasd/save_tests.c 2008-11-12 14:28:03 UTC (rev 1706) +++ trunk/openvas-server/openvasd/save_tests.c 2008-11-12 14:30:20 UTC (rev 1707) @@ -27,8 +27,10 @@ * */ +#include -#include +#include + #include "log.h" #include "comm.h" #include "users.h" @@ -221,10 +223,10 @@ log_write("user %s : session will be saved as %s", user, index_fname); if(arg_get_value(globals, "save_tests_index")) { - arg_set_value(globals, "save_tests_index", sizeof(int), (void*)index); + arg_set_value(globals, "save_tests_index", sizeof(gpointer), GSIZE_TO_POINTER(index)); } else - arg_add_value(globals, "save_tests_index", ARG_INT, sizeof(int), (void*)index); + arg_add_value(globals, "save_tests_index", ARG_INT, sizeof(gpointer), GSIZE_TO_POINTER(index)); if(arg_get_value(globals, "save_tests_index_fname")) { @@ -270,10 +272,10 @@ if(arg_get_value(globals, "save_tests_data")) { - arg_set_value(globals, "save_tests_data", sizeof(int), (void*)data); + arg_set_value(globals, "save_tests_data", sizeof(gpointer), GSIZE_TO_POINTER(data)); } else - arg_add_value(globals, "save_tests_data", ARG_INT, sizeof(int), (void*)data); + arg_add_value(globals, "save_tests_data", ARG_INT, sizeof(gpointer), GSIZE_TO_POINTER(data)); } bye : @@ -293,8 +295,8 @@ save_tests_close(globals) struct arglist* globals; { - int f1 = (int)arg_get_value(globals, "save_tests_index"); - int f2 = (int)arg_get_value(globals, "save_tests_data"); + int f1 = GPOINTER_TO_SIZE(arg_get_value(globals, "save_tests_index")); + int f2 = GPOINTER_TO_SIZE(arg_get_value(globals, "save_tests_data")); char * index_fname = arg_get_value(globals, "save_tests_index_fname"); char * data_fname = arg_get_value(globals, "save_tests_data_fname"); @@ -316,7 +318,7 @@ struct arglist * globals; char * data; { - int f = (int)arg_get_value(globals, "save_tests_data"); + int f = GPOINTER_TO_SIZE(arg_get_value(globals, "save_tests_data")); int e, len, n = 0; if(!f) @@ -351,7 +353,7 @@ struct arglist * globals; char * host; { - int f = (int)arg_get_value(globals, "save_tests_index"); + int f = GPOINTER_TO_SIZE(arg_get_value(globals, "save_tests_index")); char * d; int len, n = 0, e; From scm-commit at wald.intevation.org Wed Nov 12 15:35:58 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 12 Nov 2008 15:35:58 +0100 (CET) Subject: [Openvas-commits] r1709 - trunk/openvas-libnasl Message-ID: <20081112143558.670E140719@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-12 15:35:57 +0100 (Wed, 12 Nov 2008) New Revision: 1709 Modified: trunk/openvas-libnasl/ChangeLog trunk/openvas-libnasl/configure trunk/openvas-libnasl/configure.in Log: * configure.in: Include version requirements in glib error string as pointed out by Jon Bebeau. * configure: Regenerated. Modified: trunk/openvas-libnasl/ChangeLog =================================================================== --- trunk/openvas-libnasl/ChangeLog 2008-11-12 14:32:39 UTC (rev 1708) +++ trunk/openvas-libnasl/ChangeLog 2008-11-12 14:35:57 UTC (rev 1709) @@ -1,5 +1,12 @@ 2008-11-12 Michael Wiegand + * configure.in: Include version requirements in glib error string as + pointed out by Jon Bebeau. + + * configure: Regenerated. + +2008-11-12 Michael Wiegand + Applying patch provided by Stjepan Gros to improve 64-bit cleanliness. * nasl/nasl_misc_funcs.c, nasl/nasl_nessusd_glue.c, nasl/regex.c: Modified: trunk/openvas-libnasl/configure =================================================================== --- trunk/openvas-libnasl/configure 2008-11-12 14:32:39 UTC (rev 1708) +++ trunk/openvas-libnasl/configure 2008-11-12 14:35:57 UTC (rev 1709) @@ -20147,12 +20147,12 @@ { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } - { { echo "$as_me:$LINENO: error: \"glib not found\"" >&5 -echo "$as_me: error: \"glib not found\"" >&2;} + { { echo "$as_me:$LINENO: error: \"glib >= 2.2.0 not found\"" >&5 +echo "$as_me: error: \"glib >= 2.2.0 not found\"" >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then - { { echo "$as_me:$LINENO: error: \"glib not found\"" >&5 -echo "$as_me: error: \"glib not found\"" >&2;} + { { echo "$as_me:$LINENO: error: \"glib >= 2.2.0 not found\"" >&5 +echo "$as_me: error: \"glib >= 2.2.0 not found\"" >&2;} { (exit 1); exit 1; }; } else GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS Modified: trunk/openvas-libnasl/configure.in =================================================================== --- trunk/openvas-libnasl/configure.in 2008-11-12 14:32:39 UTC (rev 1708) +++ trunk/openvas-libnasl/configure.in 2008-11-12 14:35:57 UTC (rev 1709) @@ -210,7 +210,7 @@ AC_FUNC_FSEEKO AC_TYPE_OFF_T -PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.2.0, HAVE_GLIB="yes", AC_MSG_ERROR("glib not found")) +PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.2.0, HAVE_GLIB="yes", AC_MSG_ERROR("glib >= 2.2.0 not found")) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) From scm-commit at wald.intevation.org Wed Nov 12 16:32:07 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 12 Nov 2008 16:32:07 +0100 (CET) Subject: [Openvas-commits] r1710 - in trunk/openvas-plugins: . scripts Message-ID: <20081112153207.B954A4072A@pyrosoma.intevation.org> Author: chandra Date: 2008-11-12 16:32:06 +0100 (Wed, 12 Nov 2008) New Revision: 1710 Added: trunk/openvas-plugins/scripts/gb_adobe_flash_player_mult_vuln_nov08_lin.nasl trunk/openvas-plugins/scripts/gb_adobe_flash_player_mult_vuln_nov08_win.nasl trunk/openvas-plugins/scripts/secpod_ms08-068_900057.nasl trunk/openvas-plugins/scripts/secpod_ms08-069_900058.nasl Modified: trunk/openvas-plugins/ChangeLog Log: Added new plugins Modified: trunk/openvas-plugins/ChangeLog =================================================================== --- trunk/openvas-plugins/ChangeLog 2008-11-12 14:35:57 UTC (rev 1709) +++ trunk/openvas-plugins/ChangeLog 2008-11-12 15:32:06 UTC (rev 1710) @@ -1,3 +1,10 @@ +2008-11-12 Chandrashekhar B + * scripts/secpod_ms08-069_900058.nasl, + scripts/secpod_ms08-068_900057.nasl, + scripts/gb_adobe_flash_player_mult_vuln_nov08_lin.nasl, + scripts/gb_adobe_flash_player_mult_vuln_nov08_win.nasl: + Added new plugins + 2008-11-12 Michael Wiegand Applying patch provided by Stjepan Gros to improve 64-bit cleanliness. Added: trunk/openvas-plugins/scripts/gb_adobe_flash_player_mult_vuln_nov08_lin.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_adobe_flash_player_mult_vuln_nov08_lin.nasl 2008-11-12 14:35:57 UTC (rev 1709) +++ trunk/openvas-plugins/scripts/gb_adobe_flash_player_mult_vuln_nov08_lin.nasl 2008-11-12 15:32:06 UTC (rev 1710) @@ -0,0 +1,82 @@ +############################################################################### +# OpenVAS Vulnerability Test +# $Id: gb_adobe_flash_player_mult_vuln_nov08_lin.nasl 457 2008-11-11 13:41:13Z oct $ +# +# Adobe Flash Player Multiple Vulnerabilities - Nov08 (Linux) +# +# Authors: +# Chandan S +# +# Copyright: +# Copyright (c) 2008 Intevation GmbH, http://www.intevation.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# (or any later version), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################### + +if(description) +{ + script_id(800055); + script_version("$Revision: 1.0 $"); + script_cve_id("CVE-2008-4818", "CVE-2008-4819", "CVE-2008-4820", + "CVE-2008-4821", "CVE-2008-4822", "CVE-2008-4823"); + script_bugtraq_id(32129); + script_name(english:"Adobe Flash Player Multiple Vulnerabilities - Nov08 (Linux)"); + desc["english"] = " + Overview: This host has Adobe Flash Player installed and is prone to + multiple security bypass vulnerabilities. + + Vulnerability Insight: + Multiple flaws are reported in Adobe Flash Player, for more information + refer, http://www.adobe.com/support/security/bulletins/apsb08-20.html + + Impact: Successful attack could allow malicious people to bypass certain + security restrictions or manipulate certain data. + + Impact Level: Application + + Affected Software/OS: + Adobe Flash Player 9.0.124.0 and earlier on Linux. + + Fix: Upgrade to Adobe Flash Player 9.0.151.0 or 10.0.12.36, + http://www.adobe.com/downloads/ + + References: + http://www.adobe.com/support/security/bulletins/apsb08-20.html + + CVSS Score: + CVSS Base Score : 6.8 (AV:N/AC:M/Au:NR/C:P/I:P/A:P) + CVSS Temporal Score : 5.3 + Risk factor: High"; + + script_description(english:desc["english"]); + script_summary(english:"Check for the version of Adobe Flash Player"); + script_category(ACT_GATHER_INFO); + script_copyright(english:"Copyright (C) 2008 Intevation GmbH"); + script_family(english:"Misc."); + script_dependencies("gb_adobe_flash_player_detect_lin.nasl"); + exit(0); +} + + +include("version_func.inc"); + +adobeVer = get_kb_item("AdobeFlashPlayer/Linux/Ver"); +if(!adobeVer){ + exit(0); +} + +# Check for version 9.0.124.0 and prior +if(version_is_less_equal(version:adobeVer, test_version:"9.0.124.0")){ + security_hole(0); +} Added: trunk/openvas-plugins/scripts/gb_adobe_flash_player_mult_vuln_nov08_win.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_adobe_flash_player_mult_vuln_nov08_win.nasl 2008-11-12 14:35:57 UTC (rev 1709) +++ trunk/openvas-plugins/scripts/gb_adobe_flash_player_mult_vuln_nov08_win.nasl 2008-11-12 15:32:06 UTC (rev 1710) @@ -0,0 +1,83 @@ +############################################################################### +# OpenVAS Vulnerability Test +# $Id: gb_adobe_flash_player_mult_vuln_nov08_win.nasl 457 2008-11-11 10:53:34Z oct $ +# +# Adobe Flash Player Multiple Vulnerabilities - Nov08 (Win) +# +# Authors: +# Chandan S +# +# Copyright: +# Copyright (c) 2008 Intevation GmbH, http://www.intevation.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# (or any later version), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################### + +if(description) +{ + script_id(800054); + script_version("$Revision: 1.0 $"); + script_cve_id("CVE-2008-4818", "CVE-2008-4819", "CVE-2008-4820", + "CVE-2008-4821", "CVE-2008-4822", "CVE-2008-4823"); + script_bugtraq_id(32129); + script_name(english:"Adobe Flash Player Multiple Vulnerabilities - Nov08 (Win)"); + desc["english"] = " + + Overview: This host has Adobe Flash Player installed and is prone to + multiple security bypass vulnerabilities. + + Vulnerability Insight: + Multiple flaws are reported in Adobe Flash Player, for more information + refer, http://www.adobe.com/support/security/bulletins/apsb08-20.html + + Impact: Successful attack could allow malicious people to bypass certain + security restrictions or manipulate certain data. + + Impact Level: Application + + Affected Software/OS: + Adobe Flash Player 9.0.124.0 and earlier on Windows. + + Fix: Upgrade to Adobe Flash Player 9.0.151.0 or 10.0.12.36, + http://www.adobe.com/downloads/ + + References: + http://www.adobe.com/support/security/bulletins/apsb08-20.html + + CVSS Score: + CVSS Base Score : 6.8 (AV:N/AC:M/Au:NR/C:P/I:P/A:P) + CVSS Temporal Score : 5.3 + Risk factor: High"; + + script_description(english:desc["english"]); + script_summary(english:"Check for the version of Adobe Flash Player"); + script_category(ACT_GATHER_INFO); + script_copyright(english:"Copyright (C) 2008 Intevation GmbH"); + script_family(english:"Misc."); + script_dependencies("gb_adobe_flash_player_detect_win.nasl"); + exit(0); +} + + +include("version_func.inc"); + +adobeVer = get_kb_item("AdobeFlashPlayer/Win/Ver"); +if(!adobeVer){ + exit(0); +} + +# Check for version 9.0.124.0 and prior +if(version_is_less_equal(version:adobeVer, test_version:"9.0.124.0")){ + security_hole(0); +} Added: trunk/openvas-plugins/scripts/secpod_ms08-068_900057.nasl =================================================================== --- trunk/openvas-plugins/scripts/secpod_ms08-068_900057.nasl 2008-11-12 14:35:57 UTC (rev 1709) +++ trunk/openvas-plugins/scripts/secpod_ms08-068_900057.nasl 2008-11-12 15:32:06 UTC (rev 1710) @@ -0,0 +1,166 @@ +############################################################################## +# +# SMB Could Allow Remote Code Execution Vulnerability (957097) +# +# Copyright: SecPod +# +# Date Written: 2008/11/12 +# +# Revision: 1.1 +# +# Log: schandan +# Issue #0465 +# ------------------------------------------------------------------------ +# This program was written by SecPod and is licensed under the GNU GPL +# license. Please refer to the below link for details, +# http://www.gnu.org/licenses/gpl.html +# This header contains information regarding licensing terms under the GPL, +# and information regarding obtaining source code from the Author. +# Consequently, pursuant to section 3(c) of the GPL, you must accompany the +# information found in this header with any distribution you make of this +# Program. +# ------------------------------------------------------------------------ +############################################################################## + + +if(description) +{ + script_id(900057); + script_bugtraq_id(7385); + script_cve_id("CVE-2008-4037"); + script_copyright(english:"Copyright (C) 2008 SecPod"); + script_version("Revision: 1.1 "); + script_category(ACT_GATHER_INFO); + script_family(english:"Windows"); + script_name(english:"SMB Could Allow Remote Code Execution Vulnerability (957097)"); + script_summary(english:"Check for Hotfix and version of SMB"); + desc["english"] = " + MS08-068 + + Overview: This host has critical security update missing according to + Microsoft Bulletin MS08-068. + + Vulnerability Insight: + Issue exists due to the way that Server Message Block (SMB) Protocol handles + NTLM credentials when a user connects to an attacker's SMB server. + + Impact: Successful exploitation could allow attacker to replay the user's + credentials back to them and execute code in the context of the logged-on + user. They can get complete control of an affected system to view, change, + or delete data or creating new accounts with full user rights. + complete control of an affected system. + + Impact Level: System + + Affected Software/OS: + Microsoft Windows 2K Service Pack 4 and prior. + Microsoft Windows XP Service Pack 3 and prior. + Microsoft Windows 2003 Service Pack 2 and prior. + + Fix: Run Windows Update and update the listed hotfixes or download + and update mentioned hotfixes in the advisory from the below link, + http://www.microsoft.com/technet/security/bulletin/ms08-068.mspx + + References: + http://www.microsoft.com/technet/security/bulletin/ms08-068.mspx + + CVSS Score: + CVSS Base Score : 6.8 (AV:N/AC:M/Au:NR/C:P/I:P/A:P) + CVSS Temporal Score : 5.3 + Risk factor : High"; + + script_description(english:desc["english"]); + script_dependencies("secpod_reg_enum.nasl"); + exit(0); +} + + +include("smb_nt.inc"); +include("secpod_reg.inc"); +include("secpod_smb_func.inc"); + +if(hotfix_check_sp(win2k:5, xp:4, win2003:3) <= 0){ + exit(0); +} + +# Check Hotfix Missing 957097 (MS08-068) +if(hotfix_missing(name:"957097") == 0){ + exit(0); +} + +sysPath = registry_get_sz(key:"SOFTWARE\Microsoft\COM3\Setup", + item:"Install Path"); +if(!sysPath){ + exit(0); +} + +share = ereg_replace(pattern:"([A-Z]):.*", replace:"\1$", string:sysPath); +file = ereg_replace(pattern:"[A-Z]:(.*)", replace:"\1", + string:sysPath + "\drivers\Mrxsmb.sys"); + +sysVer = GetVer(file:file, share:share); +if(!sysVer){ + exit(0); +} + +# Windows 2K +if(hotfix_check_sp(win2k:5) > 0) +{ + # Grep for Srv.sys version < 5.0.2195.7174 + if(egrep(pattern:"^5\.0\.2195\.([0-6]?[0-9]?[0-9]?[0-9]|7([0][0-9][0-9]|" + + "16[0-9]|17[0-3]))$", string:sysVer)){ + security_hole(0); + } + exit(0); +} + +# Windows XP +if(hotfix_check_sp(xp:4) > 0) +{ + SP = get_kb_item("SMB/WinXP/ServicePack"); + if("Service Pack 2" >< SP) + { + # Grep for Srv.sys < 5.1.2600.3467 + if(egrep(pattern:"^5\.1\.2600\.([0-2]?[0-9]?[0-9]?[0-9]|3([0-3][0-9][0-9]|" + + "4([0-5][0-9]|6[0-6])))$", string:sysVer)){ + security_hole(0); + } + exit(0); + } + else if("Service Pack 3" >< SP) + { + # Grep for Srv.sys < 5.1.2600.5700 + if(egrep(pattern:"^5\.1\.2600\.([0-4]?[0-9]?[0-9]?[0-9]|5([0-5][0-9][0-9]|" + + "6([0-8][0-9]|9[0-9])))$", string:sysVer)){ + security_hole(0); + } + exit(0); + } + security_hole(0); +} + +# Windows 2003 +if(hotfix_check_sp(win2003:3) > 0) +{ + SP = get_kb_item("SMB/Win2003/ServicePack"); + if("Service Pack 1" >< SP) + { + # Grep for Srv.sys version < 5.2.3790.3206 + if(egrep(pattern:"^5\.2\.3790\.([0-2]?[0-9]?[0-9]?[0-9]|3[01][0-9][0-9]|" + + "32([0][0-5]))$", + string:sysVer)){ + security_hole(0); + } + exit(0); + } + else if("Service Pack 2" >< SP) + { + # Grep for Srv.sys version < 5.2.3790.4369 + if(egrep(pattern:"^5\.2\.3790\.([0-3]?[0-9]?[0-9]?[0-9]|4([0-2][0-9][0-9]|" + + "3([0-5][0-9]|6[0-8])))$", string:sysVer)){ + security_hole(0); + } + exit(0); + } + security_hole(0); +} Added: trunk/openvas-plugins/scripts/secpod_ms08-069_900058.nasl =================================================================== --- trunk/openvas-plugins/scripts/secpod_ms08-069_900058.nasl 2008-11-12 14:35:57 UTC (rev 1709) +++ trunk/openvas-plugins/scripts/secpod_ms08-069_900058.nasl 2008-11-12 15:32:06 UTC (rev 1710) @@ -0,0 +1,179 @@ +############################################################################## +# +# Microsoft XML Core Services Remote Code Execution Vulnerability (955218) +# +# Copyright: SecPod +# +# Date Written: 2008/11/12 +# +# Revision: 1.1 +# +# Log: schandan +# Issue #0467 +# ------------------------------------------------------------------------ +# This program was written by SecPod and is licensed under the GNU GPL +# license. Please refer to the below link for details, +# http://www.gnu.org/licenses/gpl.html +# This header contains information regarding licensing terms under the GPL, +# and information regarding obtaining source code from the Author. +# Consequently, pursuant to section 3(c) of the GPL, you must accompany the +# information found in this header with any distribution you make of this +# Program. +# ------------------------------------------------------------------------ +############################################################################## + + +if(description) +{ + script_id(900058); + script_bugtraq_id(21872, 32204); + script_cve_id("CVE-2007-0099", "CVE-2008-4029", "CVE-2008-4033"); + script_copyright(english:"Copyright (C) 2008 SecPod"); + script_version("Revision: 1.0 "); + script_category(ACT_GATHER_INFO); + script_family(english:"Windows"); + script_name(english:"Microsoft XML Core Services Remote Code Execution Vulnerability (955218)"); + script_summary(english:"Check for Hotfix and version of XML File"); + desc["english"] = " + MS08-069 + + Overview: This host has critical security update missing according to + Microsoft Bulletin MS08-069. + + Vulnerability Insight: + The flaws are due to, + - a memory corruption error when parsing malformed XML content. + - the way MSXML handles error checks for external document type definitions + (DTDs). + - an error in the way MSXML handles transfer-encoding headers. + + Impact: Successful exploitation could allow attacker to conduct cross domain + scripting attacks and read data from another domain in IE and also execute + arbitrary code by tricking a user into visiting a malicious web page. + + Impact Level: System + + Affected Software/OS: + Microsoft XML Core Services 3.0/4.0/5.0/6.0 + Microsoft Windows 2K Service Pack 4 and prior. + Microsoft Windows XP Service Pack 3 and prior. + Microsoft Windows 2003 Service Pack 2 and prior. + Microsoft Office 2003 & 2007. + Microsoft Office Compatibility Pack for Word/Excel/PowerPoint 2007 File Formats. + + Fix: Run Windows Update and update the listed hotfixes or download + and update mentioned hotfixes in the advisory from the below link, + http://www.microsoft.com/technet/security/bulletin/ms08-069.mspx + + References: + http://www.microsoft.com/technet/security/bulletin/ms08-069.mspx + + CVSS Score: + CVSS Base Score : 9.3 (AV:N/AC:M/Au:NR/C:C/I:C/A:C) + CVSS Temporal Score : 7.3 + Risk factor : High"; + + script_description(english:desc["english"]); + script_dependencies("secpod_reg_enum.nasl", "secpod_ms_office_detection_900025.nasl"); + script_require_keys("SMB/WindowsVersion"); + exit(0); +} + + +include("smb_nt.inc"); +include("secpod_reg.inc"); +include("secpod_smb_func.inc"); + +if(!get_kb_item("SMB/WindowsVersion")){ + exit(0); +} + +sysPath = registry_get_sz(key:"SOFTWARE\Microsoft\COM3\Setup", + item:"Install Path"); +if(!sysPath){ + exit(0); +} + +share = ereg_replace(pattern:"([A-Z]):.*", replace:"\1$", string:sysPath); +file6 = ereg_replace(pattern:"[A-Z]:(.*)", replace:"\1", string:sysPath + "\msxml6.dll"); +file6r = ereg_replace(pattern:"[A-Z]:(.*)", replace:"\1", string:sysPath + "\msxml6r.dll"); +file4 = ereg_replace(pattern:"[A-Z]:(.*)", replace:"\1", string:sysPath + "\msxml4.dll"); +file4a = ereg_replace(pattern:"[A-Z]:(.*)", replace:"\1", string:sysPath + "\msxml4a.dll"); +file4r = ereg_replace(pattern:"[A-Z]:(.*)", replace:"\1", string:sysPath + "\msxml4r.dll"); +file3 = ereg_replace(pattern:"[A-Z]:(.*)", replace:"\1", string:sysPath + "\msxml3.dll"); + +# Microsoft Office 2003 & 2007 +if((get_kb_item("MS/Office/Ver") =~ "11\..*|12\..*")|| + registry_key_exists(key:"SOFTWARE\Microsoft\Office")) +{ + sharedPath = registry_get_sz(key:"SOFTWARE\Microsoft\Shared Tools", + item:"SharedFilesDir"); + if(sharedPath) + { + share2 = ereg_replace(pattern:"([A-Z]):.*", replace:"\1$", string:sharedPath); + file5 = ereg_replace(pattern:"[A-Z]:(.*)", replace:"\1", + string:sharedPath + "OFFICE11\msxml5.dll"); + } +} + +# MSXML6.dll < 6.20.1099.0 +if(egrep(pattern:"^([0-5]\..*|6\.([01]?[0-9]|20\.(0?[0-9]?[0-9]?[0-9]|10([0-8]" + + "[0-9]|9[0-8])))\..*)$", + string:GetVer(file:file6, share:share))) +{ + security_hole(0); + exit(0); +} + +# MSXML6r.dll < 6.0.3883.0 +if(egrep(pattern:"^([0-5]\..*|6\.(0\.([0-2]?[0-9]?[0-9]?[0-9]|3([0-7]" + + "[0-9][0-9]|8[0-7][0-9]|88[0-2])))\..*)$", + string:GetVer(file:file6r, share:share))) +{ + security_hole(0); + exit(0); +} + +# MSXML5.dll < 5.20.1087.0 +if(egrep(pattern:"^([0-4]\..*|5\.([01]?[0-9]\..*|20\.([0-9]?[0-9]?[0-9]|10" + + "([0-7][0-9]|8[0-6]))\..*))$", + string:GetVer(file:file5, share:share2))) +{ + security_hole(0); + exit(0); +} + +# MSXML4.dll < 4.20.9870.0 +if(egrep(pattern:"^([0-3]\..*|4\.([01]?[0-9]\..*|20\.([0-8]?[0-9]?[0-9]?[0-9]" + + "\..*|9([0-7][0-9][0-9]|8[0-6][0-9])\..*)))$", + string:GetVer(file:file4, share:share))) +{ + security_hole(0); + exit(0); +} + +# MSXML4A.dll < 4.10.9404.0 +if(egrep(pattern:"^([0-3]\..*|4\.([0-9]\..*|10\.([0-8]?[0-9]?[0-9]?[0-9]" + + "\..*|9([0-3][0-9][0-9]|40[0-3])\..*)))$", + string:GetVer(file:file4a, share:share))) +{ + security_hole(0); + exit(0); +} + +# MSXML4R.dll < 4.10.9404.0 +if(egrep(pattern:"^([0-3]\..*|4\.([0-9]\..*|10\.([0-8]?[0-9]?[0-9]?[0-9]" + + "\..*|9([0-3][0-9][0-9]|40[0-3])\..*)))$", + string:GetVer(file:file4r, share:share))) +{ + security_hole(0); + exit(0); +} + +# MSXML3.dll < 8.100.1048.0 +if(egrep(pattern:"^([0-7]\..*|8\.([0-9]?[0-9]\..*|100\.([0-9]?[0-9]?[0-9]" + + "\..*|1(0[0-3][0-9]|04[0-7])\..*)))$", + string:GetVer(file:file3, share:share))){ + security_hole(0); +} +exit(0); From scm-commit at wald.intevation.org Thu Nov 13 10:30:23 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Thu, 13 Nov 2008 10:30:23 +0100 (CET) Subject: [Openvas-commits] r1711 - trunk/doc/website Message-ID: <20081113093023.B156340717@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-13 10:30:22 +0100 (Thu, 13 Nov 2008) New Revision: 1711 Added: trunk/doc/website/openvas-cr-18.htm4 Modified: trunk/doc/website/openvas-crs.htm4 Log: Added CR #18. Added: trunk/doc/website/openvas-cr-18.htm4 =================================================================== --- trunk/doc/website/openvas-cr-18.htm4 2008-11-12 15:32:06 UTC (rev 1710) +++ trunk/doc/website/openvas-cr-18.htm4 2008-11-13 09:30:22 UTC (rev 1711) @@ -0,0 +1,115 @@ +m4_dnl -*-html-*- +m4_include(`template.m4') + +m4_dnl OpenVAS +m4_dnl $Id$ +m4_dnl Description: OpenVAS Change Request #18 +m4_dnl +m4_dnl Authors: +m4_dnl Joey Schulze +m4_dnl +m4_dnl Copyright: +m4_dnl Copyright (C) 2008 Intevation GmbH +m4_dnl +m4_dnl This program is free software; you can redistribute it and/or modify +m4_dnl it under the terms of the GNU General Public License version 2, +m4_dnl as published by the Free Software Foundation. +m4_dnl +m4_dnl This program is distributed in the hope that it will be useful, +m4_dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +m4_dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +m4_dnl GNU General Public License for more details. +m4_dnl +m4_dnl You should have received a copy of the GNU General Public License +m4_dnl along with this program; if not, write to the Free Software +m4_dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + + +PAGE_START +

OpenVAS Change Request #18: OpenVAS-Client: Improve Handling of False-Positives

+ +Status: In discussion. + +

Purpose

+ +

+ To improve usability and usefulness of the OpenVAS client with + regards to permanent false-positives and differently observed + priorities. +

+ +

References

+ +

Rationale

+ +

+ The current implementation does not treat false-positives at all. + After a full scan of a target host the user is presented a report + that contains server-defined priorities for each vulnerabilities. + If there are false positives (e.g. anonymous FTP or CIFS directories + may exist on intention and not accidentally) the user needs to + reconsider each such finding in the report manually. This is + subject to eat maintenance time unneccessarily for the user for each + generated report. +

+ +

+ It would be helpful if the user would be given a way to alter the + priority of certain scripts locally on a per-host basis. Ultimately + this would offer the user a means to treat certain test results as + false-positives and to be able to downgrade the priority of other + tests within the OpenVAS client. +

+ +

+ This feature affects the OpenVAS client only. No library or server + needs to be modified. +

+ +

Effects

+ +

+ This feature would help users recognise false-positives in generated + reports and provide a means to re-prioritise certain tests up to + considering them false-positives. It would enhance the client GUI to + display false-positives differently than real vulnerabilities and + offer a way to alter priorities of certain tests. +

+ +

Design and Implementation

+ +
    + +
  • + Alter the internal handling of priorities in test results on a + per-test and per-target basis. +
  • + +
  • + Develop a set of functions to read altered priorities from + configuration files in order to override their internal priority. +
  • + +
  • + Adjust the OpenVAS client so that it will display false-positives + properly in the summary and in the report. +
  • + +
  • + Develop a graphical interface for the user to alter the priority of + a test individually on a per-host basis. +
  • + +
  • + Develop a set of functions so that altered priorities can be stored + in the file already read for a given target. +
  • + +
+ +

History

+ +
    +
  • 2008-11-13 Joey Schulze <joey at infodrom.org>:
    + Initial text.
  • +
Modified: trunk/doc/website/openvas-crs.htm4 =================================================================== --- trunk/doc/website/openvas-crs.htm4 2008-11-12 15:32:06 UTC (rev 1710) +++ trunk/doc/website/openvas-crs.htm4 2008-11-13 09:30:22 UTC (rev 1711) @@ -59,8 +59,9 @@
  • OpenVAS Change Request #13: Integrating the OVAL interpreter ovaldi into OpenVAS Server (in progress)
  • OpenVAS Change Request #14: OpenVAS-Client: Remove source code copy of gdchart and gd (done)
  • OpenVAS Change Request #15: OpenVAS Server: Remove features for detached scans (in progress) -
  • OpenVAS Change Request #16: OpenVAS-Client: Do not automatically enable new NVTs (in progress) -
  • OpenVAS Change Request #17: OTP: Make NVT signatures available to OpenVAS-Client (in discussion) +
  • OpenVAS Change Request #16: OpenVAS-Client: Do not automatically enable new NVTs (done) +
  • OpenVAS Change Request #17: OTP: Make NVT signatures available to OpenVAS-Client (in progress) +
  • OpenVAS Change Request #18: OpenVAS-Client: Improve Handling of False-Positives (in discussion)

    How to write a change request

    From scm-commit at wald.intevation.org Thu Nov 13 10:41:32 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Thu, 13 Nov 2008 10:41:32 +0100 (CET) Subject: [Openvas-commits] r1712 - in trunk/openvas-libraries: . libopenvas Message-ID: <20081113094132.D9C8440719@pyrosoma.intevation.org> Author: felix Date: 2008-11-13 10:41:31 +0100 (Thu, 13 Nov 2008) New Revision: 1712 Modified: trunk/openvas-libraries/ChangeLog trunk/openvas-libraries/libopenvas/store_internal.h Log: Narrowed down space for fingerprints in servers cache. Attention: Server cache has to be rebuilt! (remove .desc in plugin directory) * libopenvas/store_internal.h : Decreased fingerprint array size. * ChangeLog : Email typo fixed. M openvas-libraries/ChangeLog M openvas-libraries/libopenvas/store_internal.h Modified: trunk/openvas-libraries/ChangeLog =================================================================== --- trunk/openvas-libraries/ChangeLog 2008-11-13 09:30:22 UTC (rev 1711) +++ trunk/openvas-libraries/ChangeLog 2008-11-13 09:41:31 UTC (rev 1712) @@ -1,3 +1,14 @@ +2008-11-13 Felix Wolfsteller + + Narrowed down space for fingerprints in servers cache. + + Attention: Server cache has to be rebuilt! + (remove .desc in plugin directory) + + * libopenvas/store_internal.h : Decreased fingerprint array size. + + * ChangeLog : Email typo fixed. + 2008-11-12 Michael Wiegand Applying patch provided by Stjepan Gros to improve 64-bit cleanliness. @@ -77,7 +88,7 @@ * INSTALL_README: Updated note regarding gnutls version requirements as pointed out by Toan Nguyen. -2008-11-05 Felix Wolfsteller +2008-11-05 Felix Wolfsteller Work on Change Request #17 (http://www.openvas.org/openvas-cr-17.html - "OTP: Make NVT signatures available to OpenVAS-Client"). @@ -86,7 +97,7 @@ * libopenvas/store.c (store_load_plugin): Fixed tests about signature file, replaced obsolete ID check by OID check, removed dummy string. -2008-10-31 Felix Wolfsteller +2008-10-31 Felix Wolfsteller Steps to an implementation of Change Request #17 (http://www.openvas.org/openvas-cr-17.html - "Make NVT signatures Modified: trunk/openvas-libraries/libopenvas/store_internal.h =================================================================== --- trunk/openvas-libraries/libopenvas/store_internal.h 2008-11-13 09:30:22 UTC (rev 1711) +++ trunk/openvas-libraries/libopenvas/store_internal.h 2008-11-13 09:41:31 UTC (rev 1712) @@ -39,7 +39,9 @@ char excluded_keys [128]; char required_ports [64]; char required_udp_ports [64]; - char sign_key_ids [128]; + char sign_key_ids [3*48+2]; // Store up to 3 fingerprints. Change + // nasl_signature.c if you effectively + // want to increase max nr. of fprs. int has_prefs:1; }; From scm-commit at wald.intevation.org Thu Nov 13 10:49:48 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Thu, 13 Nov 2008 10:49:48 +0100 (CET) Subject: [Openvas-commits] r1713 - in trunk/openvas-libnasl: . nasl Message-ID: <20081113094948.C94AA40719@pyrosoma.intevation.org> Author: felix Date: 2008-11-13 10:49:47 +0100 (Thu, 13 Nov 2008) New Revision: 1713 Modified: trunk/openvas-libnasl/ChangeLog trunk/openvas-libnasl/nasl/nasl_signature.c Log: Changed max fingerprint size, work on bug 825 ( http://bugs.openvas.org/825 ) * nasl/nasl_signature.c : Decreased max fingerprint size, attacked bug 825 by manual check against NULL. M openvas-libnasl/ChangeLog M openvas-libnasl/nasl/nasl_signature.c Modified: trunk/openvas-libnasl/ChangeLog =================================================================== --- trunk/openvas-libnasl/ChangeLog 2008-11-13 09:41:31 UTC (rev 1712) +++ trunk/openvas-libnasl/ChangeLog 2008-11-13 09:49:47 UTC (rev 1713) @@ -1,3 +1,11 @@ +2008-11-13 Felix Wolfsteller + + Changed max fingerprint size, work on bug 825 + ( http://bugs.openvas.org/825 ) + + * nasl/nasl_signature.c : Decreased max fingerprint size, attacked + bug 825 by manual check against NULL. + 2008-11-12 Michael Wiegand * configure.in: Include version requirements in glib error string as Modified: trunk/openvas-libnasl/nasl/nasl_signature.c =================================================================== --- trunk/openvas-libnasl/nasl/nasl_signature.c 2008-11-13 09:41:31 UTC (rev 1712) +++ trunk/openvas-libnasl/nasl/nasl_signature.c 2008-11-13 09:49:47 UTC (rev 1713) @@ -220,6 +220,7 @@ if(ctx == NULL) { + nasl_trace(NULL, "gpgme context could not be initialized.\n"); goto fail; } @@ -294,7 +295,7 @@ gpgme_signature_t signature; // Only 128 chars will be stored anyway (store_internal.h). If changed, do not // forget to change the 128-2 further down. - char* key_fprs = emalloc(128*sizeof(char)); + char* key_fprs = emalloc( (3*48 + 3) *sizeof(char)); key_fprs[0] = '\0'; gboolean failed = FALSE; @@ -359,7 +360,7 @@ while (signature) { // Enough mem to store the new fingerprint (old + ',' + new + '\0')? - if(strlen(key_fprs) + strlen(signature->fpr) < 128-2) + if(strlen(key_fprs) + strlen(signature->fpr) < (3*48+1) ) { // If already fingerprint(s) found, separate new one by ','. if(key_fprs[0] != '\0') @@ -387,7 +388,8 @@ gpgme_data_release(sig); gpgme_data_release(text); - gpgme_release(ctx); + if(ctx != NULL) + gpgme_release(ctx); efree(&sigfilename); char* return_string = NULL; From scm-commit at wald.intevation.org Thu Nov 13 11:05:43 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Thu, 13 Nov 2008 11:05:43 +0100 (CET) Subject: [Openvas-commits] r1714 - in trunk/openvas-libnasl: . nasl Message-ID: <20081113100543.E7AAF40717@pyrosoma.intevation.org> Author: felix Date: 2008-11-13 11:05:42 +0100 (Thu, 13 Nov 2008) New Revision: 1714 Modified: trunk/openvas-libnasl/ChangeLog trunk/openvas-libnasl/nasl/nasl_signature.c Log: * nasl/nasl_signature.c : More NULLness- guards (bug 825). M openvas-libnasl/ChangeLog M openvas-libnasl/nasl/nasl_signature.c Modified: trunk/openvas-libnasl/ChangeLog =================================================================== --- trunk/openvas-libnasl/ChangeLog 2008-11-13 09:49:47 UTC (rev 1713) +++ trunk/openvas-libnasl/ChangeLog 2008-11-13 10:05:42 UTC (rev 1714) @@ -1,5 +1,9 @@ 2008-11-13 Felix Wolfsteller + * nasl/nasl_signature.c : More NULLness- guards (bug 825). + +2008-11-13 Felix Wolfsteller + Changed max fingerprint size, work on bug 825 ( http://bugs.openvas.org/825 ) Modified: trunk/openvas-libnasl/nasl/nasl_signature.c =================================================================== --- trunk/openvas-libnasl/nasl/nasl_signature.c 2008-11-13 09:49:47 UTC (rev 1713) +++ trunk/openvas-libnasl/nasl/nasl_signature.c 2008-11-13 10:05:42 UTC (rev 1714) @@ -163,8 +163,6 @@ if (err) { print_gpgme_error("gpgme_engine_check_version", err); - gpgme_release(ctx); - ctx = NULL; } if(!err) @@ -173,7 +171,8 @@ if (err) { print_gpgme_error("gpgme_new", err); - gpgme_release(ctx); + if(ctx != NULL) + gpgme_release(ctx); ctx = NULL; } } @@ -186,7 +185,8 @@ if (err) { print_gpgme_error("gpgme_ctx_set_engine_info", err); - gpgme_release(ctx); + if(ctx != NULL) + gpgme_release(ctx); ctx = NULL; } } @@ -206,8 +206,9 @@ * corresponding detached signature the function returns -1. * @param filename Filename (e.g. 1.txt ) for which to check signature (e.g. 1.txt.asc). - * @return Zero, if files exists and all signatures are fully. 1 if at least one - signature from invalid or untrusted key. -1 on missing file or error. + * @return Zero, if files exists and all signatures are fully trusted. 1 if at + * least one signature from invalid or untrusted key. -1 on missing file + * or error. */ int nasl_verify_signature(const char* filename) @@ -269,7 +270,8 @@ fail: gpgme_data_release(sig); gpgme_data_release(text); - gpgme_release(ctx); + if(ctx != NULL) + gpgme_release(ctx); efree(&sigfilename); return retcode; @@ -293,8 +295,8 @@ gpgme_data_t sig = NULL; gpgme_data_t text = NULL; gpgme_signature_t signature; - // Only 128 chars will be stored anyway (store_internal.h). If changed, do not - // forget to change the 128-2 further down. + // Only 3*48+2 chars will be stored anyway (store_internal.h). If changed, do + // not forget to change the 3*48 further down and increase cache Magic number. char* key_fprs = emalloc( (3*48 + 3) *sizeof(char)); key_fprs[0] = '\0'; gboolean failed = FALSE; From scm-commit at wald.intevation.org Thu Nov 13 11:07:29 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Thu, 13 Nov 2008 11:07:29 +0100 (CET) Subject: [Openvas-commits] r1715 - in trunk/openvas-libnasl: . nasl Message-ID: <20081113100729.E687740717@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-13 11:07:28 +0100 (Thu, 13 Nov 2008) New Revision: 1715 Modified: trunk/openvas-libnasl/ChangeLog trunk/openvas-libnasl/nasl.tmpl.in trunk/openvas-libnasl/nasl/Makefile Log: Updated libtool usage to remove warnings about inferring the mode of operation. * nasl/Makefile: Use libtool in link mode when needed, otherwise use compile mode. * nasl.tmpl.in: Create LIBTOOL_LINK shortcut for using libtool in link mode, changed LIBTOOL to compile mode. Modified: trunk/openvas-libnasl/ChangeLog =================================================================== --- trunk/openvas-libnasl/ChangeLog 2008-11-13 10:05:42 UTC (rev 1714) +++ trunk/openvas-libnasl/ChangeLog 2008-11-13 10:07:28 UTC (rev 1715) @@ -1,3 +1,14 @@ +2008-11-13 Michael Wiegand + + Updated libtool usage to remove warnings about inferring the mode of + operation. + + * nasl/Makefile: Use libtool in link mode when needed, otherwise use + compile mode. + + * nasl.tmpl.in: Create LIBTOOL_LINK shortcut for using libtool in link + mode, changed LIBTOOL to compile mode. + 2008-11-13 Felix Wolfsteller * nasl/nasl_signature.c : More NULLness- guards (bug 825). Modified: trunk/openvas-libnasl/nasl/Makefile =================================================================== --- trunk/openvas-libnasl/nasl/Makefile 2008-11-13 10:05:42 UTC (rev 1714) +++ trunk/openvas-libnasl/nasl/Makefile 2008-11-13 10:07:28 UTC (rev 1715) @@ -88,6 +88,7 @@ nasl_debug.lo COMPILE = $(LIBTOOL) $(CC) $(CFLAGS) $(NESSUS_INCLUDE) +LINK = $(LIBTOOL_LINK) $(CC) $(CFLAGS) $(NESSUS_INCLUDE) all : libopenvasnasl.la openvas-nasl .c.o: @@ -97,7 +98,7 @@ $(CC) $(CFLAGS) $(NESSUS_INCLUDE) $(include) -o openvas-nasl -DVERSION=\"$(VERSION)\" nasl.c $(OBJS) $(NESSUS_LIBS) libopenvasnasl.la : $(OBJS) - $(COMPILE) $(NESSUS_LIBS) -o libopenvasnasl.la $(LO_OBJS) -rpath ${libdir} \ + $(LINK) $(NESSUS_LIBS) -o libopenvasnasl.la $(LO_OBJS) -rpath ${libdir} \ -version-info ${PACKAGE_VERSION} install : libopenvasnasl.la openvas-nasl Modified: trunk/openvas-libnasl/nasl.tmpl.in =================================================================== --- trunk/openvas-libnasl/nasl.tmpl.in 2008-11-13 10:05:42 UTC (rev 1714) +++ trunk/openvas-libnasl/nasl.tmpl.in 2008-11-13 10:07:28 UTC (rev 1715) @@ -76,7 +76,8 @@ # Your C compiler CC=@CC@ LIBS=@LIBS@ $(RPCSVC) $(COMPAT) -LIBTOOL=@LIBTOOL@ --silent +LIBTOOL=@LIBTOOL@ --silent --mode=compile +LIBTOOL_LINK=@LIBTOOL@ --silent --mode=link RANLIB=@RANLIB@ PACKAGE_VERSION=@OPENVASNASL_SUPER@:@OPENVASNASL_PATCH@:@OPENVASNASL_MINOR@ VERSION=@VERSION@ From scm-commit at wald.intevation.org Thu Nov 13 12:49:26 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Thu, 13 Nov 2008 12:49:26 +0100 (CET) Subject: [Openvas-commits] r1716 - in trunk/openvas-client: . nessus Message-ID: <20081113114926.ED74940722@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-13 12:49:26 +0100 (Thu, 13 Nov 2008) New Revision: 1716 Modified: trunk/openvas-client/ChangeLog trunk/openvas-client/nessus/sslui.c Log: * nessus/sslui.c (sslui_showcert): Catch signal sent when user closes the certificate window. The uncaught signal caused the client to hang indefinitely when the window was closed. This solves bug #826 (http://bugs.openvas.org/826). Modified: trunk/openvas-client/ChangeLog =================================================================== --- trunk/openvas-client/ChangeLog 2008-11-13 10:07:28 UTC (rev 1715) +++ trunk/openvas-client/ChangeLog 2008-11-13 11:49:26 UTC (rev 1716) @@ -1,3 +1,10 @@ +2008-11-13 Michael Wiegand + + * nessus/sslui.c (sslui_showcert): Catch signal sent when user closes + the certificate window. The uncaught signal caused the client to hang + indefinitely when the window was closed. This solves bug #826 + (http://bugs.openvas.org/826). + 2008-11-12 Felix Wolfsteller Work on Change Request #17 (http://www.openvas.org/openvas-cr-17.html - Modified: trunk/openvas-client/nessus/sslui.c =================================================================== --- trunk/openvas-client/nessus/sslui.c 2008-11-13 10:07:28 UTC (rev 1715) +++ trunk/openvas-client/nessus/sslui.c 2008-11-13 11:49:26 UTC (rev 1716) @@ -329,6 +329,9 @@ GTK_SIGNAL_FUNC(showcert_refuse_cb), ctrls); gtk_widget_show(button); + g_signal_connect (G_OBJECT (w), "destroy", + GTK_SIGNAL_FUNC(showcert_refuse_cb), ctrls); + gtk_widget_show(w); gtk_window_set_modal(GTK_WINDOW(w), TRUE); From scm-commit at wald.intevation.org Thu Nov 13 14:07:20 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Thu, 13 Nov 2008 14:07:20 +0100 (CET) Subject: [Openvas-commits] r1717 - in trunk/openvas-server: . openvasd Message-ID: <20081113130720.E43A24070A@pyrosoma.intevation.org> Author: felix Date: 2008-11-13 14:07:20 +0100 (Thu, 13 Nov 2008) New Revision: 1717 Modified: trunk/openvas-server/ChangeLog trunk/openvas-server/openvasd/otp_1_0.c Log: * openvasd/otp_1_0.c (otp_1_0_server_send_certificates) : closed mem leak. Modified: trunk/openvas-server/ChangeLog =================================================================== --- trunk/openvas-server/ChangeLog 2008-11-13 11:49:26 UTC (rev 1716) +++ trunk/openvas-server/ChangeLog 2008-11-13 13:07:20 UTC (rev 1717) @@ -1,3 +1,8 @@ +2008-11-13 Felix Wolfsteller + + * openvasd/otp_1_0.c (otp_1_0_server_send_certificates) : closed mem + leak. + 2008-11-12 Michael Wiegand Applying patch provided by Stjepan Gros to improve 64-bit cleanliness. Modified: trunk/openvas-server/openvasd/otp_1_0.c =================================================================== --- trunk/openvas-server/openvasd/otp_1_0.c 2008-11-13 11:49:26 UTC (rev 1716) +++ trunk/openvas-server/openvasd/otp_1_0.c 2008-11-13 13:07:20 UTC (rev 1717) @@ -99,8 +99,12 @@ cert->ownername, trustlevel, strlen(cert->full_public_key), cert->full_public_key); + // Release each element + openvas_certificate_free(cert); } - // Releases - + + // Release list + g_slist_free(certificates); + auth_printf(globals, "<|> SERVER\n"); } From scm-commit at wald.intevation.org Thu Nov 13 14:11:55 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Thu, 13 Nov 2008 14:11:55 +0100 (CET) Subject: [Openvas-commits] r1718 - in trunk/openvas-libnasl: . nasl Message-ID: <20081113131155.5DDD840727@pyrosoma.intevation.org> Author: felix Date: 2008-11-13 14:11:52 +0100 (Thu, 13 Nov 2008) New Revision: 1718 Modified: trunk/openvas-libnasl/ChangeLog trunk/openvas-libnasl/nasl/nasl_signature.c Log: * nasl/nasl_signature.c (openvas_certificate_free) : corrected and NULL guarded. Modified: trunk/openvas-libnasl/ChangeLog =================================================================== --- trunk/openvas-libnasl/ChangeLog 2008-11-13 13:07:20 UTC (rev 1717) +++ trunk/openvas-libnasl/ChangeLog 2008-11-13 13:11:52 UTC (rev 1718) @@ -1,3 +1,8 @@ +2008-11-13 Felix Wolfsteller + + * nasl/nasl_signature.c (openvas_certificate_free) : corrected and NULL + guarded. + 2008-11-13 Michael Wiegand Updated libtool usage to remove warnings about inferring the mode of Modified: trunk/openvas-libnasl/nasl/nasl_signature.c =================================================================== --- trunk/openvas-libnasl/nasl/nasl_signature.c 2008-11-13 13:07:20 UTC (rev 1717) +++ trunk/openvas-libnasl/nasl/nasl_signature.c 2008-11-13 13:11:52 UTC (rev 1718) @@ -59,12 +59,12 @@ */ void openvas_certificate_free(openvas_certificate* cert) { + if(cert == NULL) + return; if(cert->fpr != NULL) efree(& (cert->fpr) ); if( cert->ownername != NULL) efree(& (cert->ownername) ); - if(cert->trusted != NULL) - efree(& (cert->trusted) ); if(cert->full_public_key != NULL) efree(& (cert->full_public_key) ); efree(&cert); From scm-commit at wald.intevation.org Fri Nov 14 09:31:38 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Fri, 14 Nov 2008 09:31:38 +0100 (CET) Subject: [Openvas-commits] r1719 - in trunk/openvas-libnasl: . nasl Message-ID: <20081114083138.75E0C40728@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-14 09:31:38 +0100 (Fri, 14 Nov 2008) New Revision: 1719 Modified: trunk/openvas-libnasl/ChangeLog trunk/openvas-libnasl/nasl.tmpl.in trunk/openvas-libnasl/nasl/Makefile Log: Updated libtool usage again to make it more consistent and to avoid duplicate mode parameters. * nasl/Makefile: Changed COMPILE and LINK to directly set the appropriate libtool mode; made mode parameters for install and finish consistent with COMPILE and LINK. * nasl.tmpl.in: Removed LIBTOOL_LINK shortcut, changed LIBTOOL back. Mode handling is now done directly in the Makefile. Modified: trunk/openvas-libnasl/ChangeLog =================================================================== --- trunk/openvas-libnasl/ChangeLog 2008-11-13 13:11:52 UTC (rev 1718) +++ trunk/openvas-libnasl/ChangeLog 2008-11-14 08:31:38 UTC (rev 1719) @@ -1,3 +1,15 @@ +2008-11-14 Michael Wiegand + + Updated libtool usage again to make it more consistent and to avoid + duplicate mode parameters. + + * nasl/Makefile: Changed COMPILE and LINK to directly set the + appropriate libtool mode; made mode parameters for install and finish + consistent with COMPILE and LINK. + + * nasl.tmpl.in: Removed LIBTOOL_LINK shortcut, changed LIBTOOL back. + Mode handling is now done directly in the Makefile. + 2008-11-13 Felix Wolfsteller * nasl/nasl_signature.c (openvas_certificate_free) : corrected and NULL Modified: trunk/openvas-libnasl/nasl/Makefile =================================================================== --- trunk/openvas-libnasl/nasl/Makefile 2008-11-13 13:11:52 UTC (rev 1718) +++ trunk/openvas-libnasl/nasl/Makefile 2008-11-14 08:31:38 UTC (rev 1719) @@ -87,8 +87,8 @@ nasl_signature.lo \ nasl_debug.lo -COMPILE = $(LIBTOOL) $(CC) $(CFLAGS) $(NESSUS_INCLUDE) -LINK = $(LIBTOOL_LINK) $(CC) $(CFLAGS) $(NESSUS_INCLUDE) +COMPILE = $(LIBTOOL) --mode=compile $(CC) $(CFLAGS) $(NESSUS_INCLUDE) +LINK = $(LIBTOOL) --mode=link $(CC) $(CFLAGS) $(NESSUS_INCLUDE) all : libopenvasnasl.la openvas-nasl .c.o: @@ -104,8 +104,8 @@ install : libopenvasnasl.la openvas-nasl test -d ${DESTDIR}${libdir} || $(INSTALL_DIR) -m 755 ${DESTDIR}${libdir} test -d ${DESTDIR}${bindir} || $(INSTALL_DIR) -m 755 ${DESTDIR}${bindir} - $(LIBTOOL) --mode install $(INSTALL) libopenvasnasl.la ${DESTDIR}${libdir}/libopenvasnasl.la - $(LIBTOOL) --finish ${DESTDIR}${libdir} + $(LIBTOOL) --mode=install $(INSTALL) libopenvasnasl.la ${DESTDIR}${libdir}/libopenvasnasl.la + $(LIBTOOL) --mode=finish ${DESTDIR}${libdir} test -d ${DESTDIR}${bindir} || $(INSTALL_DIR) -m 755 ${DESTDIR}${bindir} $(INSTALL) openvas-nasl ${DESTDIR}${bindir}/ Modified: trunk/openvas-libnasl/nasl.tmpl.in =================================================================== --- trunk/openvas-libnasl/nasl.tmpl.in 2008-11-13 13:11:52 UTC (rev 1718) +++ trunk/openvas-libnasl/nasl.tmpl.in 2008-11-14 08:31:38 UTC (rev 1719) @@ -76,8 +76,7 @@ # Your C compiler CC=@CC@ LIBS=@LIBS@ $(RPCSVC) $(COMPAT) -LIBTOOL=@LIBTOOL@ --silent --mode=compile -LIBTOOL_LINK=@LIBTOOL@ --silent --mode=link +LIBTOOL=@LIBTOOL@ --silent RANLIB=@RANLIB@ PACKAGE_VERSION=@OPENVASNASL_SUPER@:@OPENVASNASL_PATCH@:@OPENVASNASL_MINOR@ VERSION=@VERSION@ From scm-commit at wald.intevation.org Fri Nov 14 09:35:36 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Fri, 14 Nov 2008 09:35:36 +0100 (CET) Subject: [Openvas-commits] r1720 - in trunk/openvas-libraries: . libopenvas Message-ID: <20081114083536.4A22440711@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-14 09:35:36 +0100 (Fri, 14 Nov 2008) New Revision: 1720 Modified: trunk/openvas-libraries/ChangeLog trunk/openvas-libraries/libopenvas/arglists.c Log: Applying patch provided by Stjepan Gros. * libopenvas/arglists.c (arg_dump): Minor reformattings, added cast to avoid fprintf format string warning. Modified: trunk/openvas-libraries/ChangeLog =================================================================== --- trunk/openvas-libraries/ChangeLog 2008-11-14 08:31:38 UTC (rev 1719) +++ trunk/openvas-libraries/ChangeLog 2008-11-14 08:35:36 UTC (rev 1720) @@ -1,3 +1,10 @@ +2008-11-14 Michael Wiegand + + Applying patch provided by Stjepan Gros. + + * libopenvas/arglists.c (arg_dump): Minor reformattings, added cast to + avoid fprintf format string warning. + 2008-11-13 Felix Wolfsteller Narrowed down space for fingerprints in servers cache. Modified: trunk/openvas-libraries/libopenvas/arglists.c =================================================================== --- trunk/openvas-libraries/libopenvas/arglists.c 2008-11-14 08:31:38 UTC (rev 1719) +++ trunk/openvas-libraries/libopenvas/arglists.c 2008-11-14 08:35:36 UTC (rev 1720) @@ -380,24 +380,24 @@ case ARG_STRING : fprintf(stderr, "%sargs->%s : %s\n",spaces+(20-level), - args->name, - (char *)args->value); + args->name, + (char *)args->value); break; case ARG_ARGLIST : fprintf(stderr, "%sargs->%s :\n", spaces+(20-level), - args->name); - arg_dump(args->value, level+1); + args->name); + arg_dump(args->value, level+1); break; case ARG_INT : fprintf(stderr, "%sargs->%s : %d\n",spaces+(20-level), - args->name, - GPOINTER_TO_SIZE(args->value)); + args->name, + (int)GPOINTER_TO_SIZE(args->value)); break; default : fprintf(stderr, "%sargs->%s : %d\n",spaces+(20-level), - args->name, - GPOINTER_TO_SIZE(args->value)); + args->name, + (int)GPOINTER_TO_SIZE(args->value)); break; } args = args->next; From scm-commit at wald.intevation.org Fri Nov 14 09:49:06 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Fri, 14 Nov 2008 09:49:06 +0100 (CET) Subject: [Openvas-commits] r1721 - trunk/openvas-compendium Message-ID: <20081114084906.502EA4071E@pyrosoma.intevation.org> Author: felix Date: 2008-11-14 09:49:05 +0100 (Fri, 14 Nov 2008) New Revision: 1721 Modified: trunk/openvas-compendium/ChangeLog trunk/openvas-compendium/openvas-compendium.de.tex trunk/openvas-compendium/openvas-compendium.tex Log: * openvas-compendium.tex, openvas-compendium.de.tex : description of show-certificate in plugin-info-dialog in client, otp changes. Modified: trunk/openvas-compendium/ChangeLog =================================================================== --- trunk/openvas-compendium/ChangeLog 2008-11-14 08:35:36 UTC (rev 1720) +++ trunk/openvas-compendium/ChangeLog 2008-11-14 08:49:05 UTC (rev 1721) @@ -1,3 +1,11 @@ +2008-11-14 Felix Wolfsteller + + Added description of the 2.0.0beta2 feature to show certificates and + the changes in OTP. + + * openvas-compendium.tex, openvas-compendium.de.tex : description of + show-certificate in plugin-info-dialog in client, otp changes. + 2008-10-28 Michael Wiegand Applied patch for numerous typos found by Matthew Mundell. Modified: trunk/openvas-compendium/openvas-compendium.de.tex =================================================================== --- trunk/openvas-compendium/openvas-compendium.de.tex 2008-11-14 08:35:36 UTC (rev 1720) +++ trunk/openvas-compendium/openvas-compendium.de.tex 2008-11-14 08:49:05 UTC (rev 1721) @@ -1826,6 +1826,17 @@ Beachten Sie, dass Sie die vorherige Plugin-Auswahl komplett löschen sobald Sie einen Filter aktivieren. +\subparagraph{Neue Plugins automatisch aktivieren} + +Ab Version 2.0 des OpenVAS-Clients gibt es für den Nutzer die Möglichkeit +auszuwählen, ob neue Plugins automatisch aktiviert werden sollen oder nicht. +Direkt nach dem Verbindungsaufbau und dem Laden der neuen Plugins wird +dem Nutzer ein Nachrichtenfenster angezeigt, das darüber informiert wieviele +neue Plugins gefunden wurden und ob diese aktiviert wurden. +Ältere Versionen des OpenVAS-Clients verhalten sich als ob diese Option +angeschaltet wäre (aktivieren neue Plugins also automatisch), aber +informieren den Nutzer nicht darüber, wieviele neue Plugins gefunden wurden. + \paragraph{Plugin Info-Dialog} Wenn Sie auf einen Plugintitel einen Doppelklick ausführen, öffnet sich ein @@ -1844,17 +1855,18 @@ der Status (eingeschaltet/ausgeschaltet) der Plugins angegeben, von denen das aktuelle Plugin abhängt. -\subparagraph{Neue Plugins automatisch aktivieren} +\subparagraph{Informationen über Zertifikate} -Ab Version 2.0 des OpenVAS-Clients gibt es für den Nutzer die Möglichkeit -auszuwählen, ob neue Plugins automatisch aktiviert werden sollen oder nicht. -Direkt nach dem Verbindungsaufbau und dem Laden der neuen Plugins wird -dem Nutzer ein Nachrichtenfenster angezeigt, das darüber informiert wieviele -neue Plugins gefunden wurden und ob diese aktiviert wurden. -Ältere Versionen des OpenVAS-Clients verhalten sich als ob diese Option -angeschaltet wäre (aktivieren neue Plugins also automatisch), aber -informieren den Nutzer nicht darüber, wieviele neue Plugins gefunden wurden. +Ab der OpenVAS-Client Version 2.0.0beta (welche auch eine entsprechende oder +neuere Version des Servers benötigt) können die dem Server bekannten Zertifikate +direkt vom Client aus angezeigt werden. +Wenn das gerade im Plugin Info-Dialog angezeigte Plugin einfach oder mehrfach +signiert wurde, werden hier Name und Vertrauensgrad der zu den Signaturen +gehörenden Zertifikate aufgelistet. +Daneben befinden sich Schaltflächen, um eine Ansicht des Zertifikats zu +ermöglichen. + \xname{scan-optionen-zugangdaten} \subsection{Zugangsdaten} @@ -4552,6 +4564,37 @@ CLIENT <|> BYE <|> ACK \end{verbatim} +\xname{otp-certificates} +\subsection{CERTIFICATES} + +\paragraph{Beschreibung:} +Dieses Kommando wird vom Client benutzt um Zertifikate anzufragen. Der Server +verwendet es, um eben diese zu versenden. +Enthalten sind der Fingerabdruck, der Name des Zertifikatbesitzers, der +Vertrauensgrad, und der öffentliche Schlüssel selbst. + +\paragraph{Syntax:} + +\begin{verbatim} +CLIENT <|> CERTIFICATES <|> CLIENT +SERVER <|> CERTIFICATES +fingerabdruck <|> besitzer_name <|> vertrauensgrad <|> laenge_in_bytes <|> pubkey +<|> SERVER +\end{verbatim} + +wobei +\begin{description} + \item[fingerabdruck] ein 48 Bytes großes Feld ist, in dem der Fingerabdruck des + Zertifikates steht. + \item[besitzer\_name] den Besitzernamen angibt. + \item[vertrauensgrad] entweder "trusted" (vertraut) oder "notrust" (kein + vertrauen) ist. + \item[laenge\_in\_bytes] die Anzahl kommender bytes angibt (Schlüssellänge). + \item[pubkey] der ASCII-enkodierte öffentliche Schlüssel selber ist, wobei + Zeilenumbuchzeichen durch Semikola ersetzt wurden. +\end{description} + + \xname{otp-complete_list} \subsection{COMPLETE\_LIST} @@ -4880,9 +4923,12 @@ \begin{verbatim} oid <|> name <|> kategorie <|> copyright <|> beschreibung <|> zusammenfassung -<|> familie <|> plugin_version <|> cve_id <|> bugtraq_id <|> xrefs +<|> familie <|> plugin_version <|> cve_id <|> bugtraq_id <|> xrefs <|> fprs \end{verbatim} +Das letzte Feld (fprs) ist eine Komma- separierte Liste von Fingerabdrücken der +Signaturen, falls vorhanden. + Falls kein NVT mit der OID=oid gefunden werde sollte, wird der Server nicht antworten. @@ -4905,13 +4951,16 @@ \begin{verbatim} SERVER <|> PLUGIN_LIST <|> oid <|> name <|> kategorie <|> copyright <|> beschreibung <|> zusammenfassung -<|> familie <|> plugin_version <|> cve_id <|> bugtraq_id <|> xrefs +<|> familie <|> plugin_version <|> cve_id <|> bugtraq_id <|> xrefs <|> fprs oid <|> name <|> kategorie <|> copyright <|> beschreibung <|> zusammenfassung -<|> familie <|> plugin_version <|> cve_id <|> bugtraq_id <|> xrefs +<|> familie <|> plugin_version <|> cve_id <|> bugtraq_id <|> xrefs <|> fprs ... <|> SERVER \end{verbatim} +Das letzte Feld (fprs) ist eine Komma- separierte Liste von Fingerabdrücken der +Signaturen, falls vorhanden. + \xname{otp-port} \subsection{PORT} Modified: trunk/openvas-compendium/openvas-compendium.tex =================================================================== --- trunk/openvas-compendium/openvas-compendium.tex 2008-11-14 08:35:36 UTC (rev 1720) +++ trunk/openvas-compendium/openvas-compendium.tex 2008-11-14 08:49:05 UTC (rev 1721) @@ -1773,7 +1773,16 @@ you want. \textbf{Note} that you will erase your previous selection by applying a filter. +\subparagraph{Automatically enable new plugins} +Since version 2.0 of OpenVAS-Client the user may choose whether new +plugins should be enabled by default. +Directly after fetching any new plugins, a notification will be +displayed, showing how many new plugins were found and whether they +have been en- or disabled. +Earlier versions {\em do} automatically enable new plugins and do not +show this notification. + \paragraph{Plugin information dialog} Double-clicking on a specific plugin title will raise an information @@ -1781,33 +1790,30 @@ % FIX The values shown...? The information shown are the ones specified within the corresponding -plugin. +plugin, like its description, copyright information. The following actions are possible in this dialog: - \subparagraph{Set plugin timeout} Allows you to specify a timeout for the plugin. - \subparagraph{Show dependencies} This lists the dependencies for the selected plugin. It also provides information on whether the dependencies are currently enabled or disabled. -\subparagraph{Automatically enable new plugins} +\subparagraph{Certificate information} -Since version 2.0 of OpenVAS-Client the user may choose whether new -plugins should be enabled by default. -Directly after fetching any new plugins, a notification will be -displayed, showing how many new plugins were found and whether they -have been en- or disabled. -Earlier versions {\em do} automatically enable new plugins and do not -show this notification. +Since OpenVAS-Client 2.0.0beta2 (which needs a server version 2.0.0beta2 or +newer) the servers certificates can be viewed from within the client. +If the plugin that is currently displayed in the plugin information dialog has +one or more signatures, the names of and trust relation the signer(s) will be +displayed. +Next to name and trust level is a button that allows to see the signers +certificate. - \xname{scan-options-credentials} \subsection{Credentials} @@ -4380,6 +4386,33 @@ CLIENT <|> BYE <|> ACK \end{verbatim} +\xname{otp-certificates} +\subsection{CERTIFICATES} + +\paragraph{Description:} +This command is used by the client to request certificate information and by the +server to send those. +Included are the certificate owners name, the trust level and the public key. + +\paragraph{Syntax:} + +\begin{verbatim} +CLIENT <|> CERTIFICATES <|> CLIENT +SERVER <|> CERTIFICATES +fingerprint <|> owner_name <|> trust_level <|> length_in_bytes <|> pubkey +<|> SERVER +\end{verbatim} +where +\begin{description} + \item[fingerprint] is a 48 bytes field containing the fingerprint of the + certificate. + \item[owner\_name] denotes the owner name. + \item[trust\_level] is either "trusted" or "notrust". + \item[length\_in\_bytes] contains the length of the public key in bytes. + \item[pubkey] is the ascii-armored public key itself, where newlines have been + replaced by semicolons. +\end{description} + \xname{otp-complete_list} \subsection{COMPLETE\_LIST} @@ -4678,9 +4711,12 @@ \begin{verbatim} oid <|> name <|> category <|> copyright <|> description <|> summary <|> -family <|> plugin_version <|> cve_id <|> bugtraq_id <|> xrefs +family <|> plugin_version <|> cve_id <|> bugtraq_id <|> xrefs <|> fprs \end{verbatim} +The last field, fprs is a comma-separated list of fingerprints of signatures, if +any. + In case no plugin with OID=oid is found, the server will not answer at all. @@ -4702,13 +4738,16 @@ \begin{verbatim} SERVER <|> PLUGIN_LIST <|> oid <|> name <|> category <|> copyright <|> description <|> summary <|> family -<|> plugin_version <|> cve_id <|> bugtraq_id <|> xrefs +<|> plugin_version <|> cve_id <|> bugtraq_id <|> xrefs <|> fprs oid <|> name <|> category <|> copyright <|> description <|> summary <|> family -<|> plugin_version <|> cve_id <|> bugtraq_id <|> xrefs +<|> plugin_version <|> cve_id <|> bugtraq_id <|> xrefs <|> fprs ... <|> SERVER \end{verbatim} +In this case, fprs is a comma-separated list of fingerprints of signatures, if +any. + \xname{otp-port} \subsection{PORT} From scm-commit at wald.intevation.org Fri Nov 14 09:59:19 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Fri, 14 Nov 2008 09:59:19 +0100 (CET) Subject: [Openvas-commits] r1722 - in trunk/openvas-server: . openvasd Message-ID: <20081114085919.B93904071E@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-14 09:59:19 +0100 (Fri, 14 Nov 2008) New Revision: 1722 Modified: trunk/openvas-server/ChangeLog trunk/openvas-server/openvasd/oval_plugins.c Log: * openvasd/oval_plugins.c (ovaldi_launch): Re-added G_SPAWN_SEARCH_PATH flag to g_spawn_sync call since it was lost in rev 1703. Modified: trunk/openvas-server/ChangeLog =================================================================== --- trunk/openvas-server/ChangeLog 2008-11-14 08:49:05 UTC (rev 1721) +++ trunk/openvas-server/ChangeLog 2008-11-14 08:59:19 UTC (rev 1722) @@ -1,3 +1,8 @@ +2008-11-14 Michael Wiegand + + * openvasd/oval_plugins.c (ovaldi_launch): Re-added G_SPAWN_SEARCH_PATH + flag to g_spawn_sync call since it was lost in rev 1703. + 2008-11-13 Felix Wolfsteller * openvasd/otp_1_0.c (otp_1_0_server_send_certificates) : closed mem Modified: trunk/openvas-server/openvasd/oval_plugins.c =================================================================== --- trunk/openvas-server/openvasd/oval_plugins.c 2008-11-14 08:49:05 UTC (rev 1721) +++ trunk/openvas-server/openvasd/oval_plugins.c 2008-11-14 08:59:19 UTC (rev 1722) @@ -485,7 +485,7 @@ argv[8] = NULL; // log_write("Launching ovaldi with: %s\n", g_strjoinv(" ", argv)); - if(g_spawn_sync(NULL, argv, NULL, 0, child_setup, NULL, NULL, NULL, NULL, NULL)) + if(g_spawn_sync(NULL, argv, NULL, G_SPAWN_SEARCH_PATH, child_setup, NULL, NULL, NULL, NULL, NULL)) { GMarkupParser parser; GMarkupParseContext *context = NULL; From scm-commit at wald.intevation.org Fri Nov 14 10:09:25 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Fri, 14 Nov 2008 10:09:25 +0100 (CET) Subject: [Openvas-commits] r1723 - in trunk/openvas-server: . openvasd Message-ID: <20081114090925.714DA40727@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-14 10:09:24 +0100 (Fri, 14 Nov 2008) New Revision: 1723 Modified: trunk/openvas-server/ChangeLog trunk/openvas-server/openvasd/otp_1_0.c trunk/openvas-server/openvasd/oval_plugins.c Log: Applying patch provided by Stjepan Gros to eliminate compiler warnings. * openvasd/oval_plugins.c (oval_plugin_add, ovaldi_launch): Minor reformattings, changes to eliminate compiler warnings. * openvasd/otp_1_0.c (otp_1_0_server_send_certificates): Casting to eliminate compiler warning. Modified: trunk/openvas-server/ChangeLog =================================================================== --- trunk/openvas-server/ChangeLog 2008-11-14 08:59:19 UTC (rev 1722) +++ trunk/openvas-server/ChangeLog 2008-11-14 09:09:24 UTC (rev 1723) @@ -1,5 +1,15 @@ 2008-11-14 Michael Wiegand + Applying patch provided by Stjepan Gros to eliminate compiler warnings. + + * openvasd/oval_plugins.c (oval_plugin_add, ovaldi_launch): Minor + reformattings, changes to eliminate compiler warnings. + + * openvasd/otp_1_0.c (otp_1_0_server_send_certificates): Casting to + eliminate compiler warning. + +2008-11-14 Michael Wiegand + * openvasd/oval_plugins.c (ovaldi_launch): Re-added G_SPAWN_SEARCH_PATH flag to g_spawn_sync call since it was lost in rev 1703. Modified: trunk/openvas-server/openvasd/otp_1_0.c =================================================================== --- trunk/openvas-server/openvasd/otp_1_0.c 2008-11-14 08:59:19 UTC (rev 1722) +++ trunk/openvas-server/openvasd/otp_1_0.c 2008-11-14 09:09:24 UTC (rev 1723) @@ -97,7 +97,7 @@ cert_list_elem = g_slist_next(cert_list_elem); auth_printf(globals, "%s <|> %s <|> %s <|> %d <|> %s\n", cert->fpr, cert->ownername, trustlevel, - strlen(cert->full_public_key), + (int)strlen(cert->full_public_key), cert->full_public_key); // Release each element openvas_certificate_free(cert); Modified: trunk/openvas-server/openvasd/oval_plugins.c =================================================================== --- trunk/openvas-server/openvasd/oval_plugins.c 2008-11-14 08:59:19 UTC (rev 1722) +++ trunk/openvas-server/openvasd/oval_plugins.c 2008-11-14 09:09:24 UTC (rev 1723) @@ -197,7 +197,7 @@ GMarkupParser parser; GMarkupParseContext *context = NULL; gchar *filebuffer = NULL; - guint length = 0; + gsize length = 0; snprintf(fullname, sizeof(fullname), "%s/%s", folder, name); @@ -335,7 +335,7 @@ struct tm *tmp; char timestr[20]; struct arglist * args = arg_get_value(g_args, "args"); - struct kbitem ** kb = arg_get_value(g_args, "key"); + struct kb_item ** kb = arg_get_value(g_args, "key"); gchar * basename = g_strrstr(g_strdup((char*)arg_get_value(g_args, "name")), "/") + 1; gchar * result_string = emalloc(256); gchar * folder = g_strndup((char*)arg_get_value(g_args, "name"), strlen((char*)arg_get_value(g_args, "name")) - strlen(basename)); @@ -490,7 +490,7 @@ GMarkupParser parser; GMarkupParseContext *context = NULL; gchar *filebuffer = NULL; - guint length = 0; + gsize length = 0; parser.start_element = start_element; parser.end_element = end_element; From scm-commit at wald.intevation.org Fri Nov 14 10:12:18 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Fri, 14 Nov 2008 10:12:18 +0100 (CET) Subject: [Openvas-commits] r1724 - in trunk/openvas-server: . openvasd Message-ID: <20081114091218.7DDE940727@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-14 10:12:17 +0100 (Fri, 14 Nov 2008) New Revision: 1724 Modified: trunk/openvas-server/ChangeLog trunk/openvas-server/Makefile trunk/openvas-server/openvasd/openvasd.c Log: Applying patch provided by Stjepan Gros to update Makefile target and to improve code readability. * openvasd/openvasd.c (init_openvasd): Minor reformattings. * openvasd/Makefile: Remove openvasd-config when distclean target is invoked. Modified: trunk/openvas-server/ChangeLog =================================================================== --- trunk/openvas-server/ChangeLog 2008-11-14 09:09:24 UTC (rev 1723) +++ trunk/openvas-server/ChangeLog 2008-11-14 09:12:17 UTC (rev 1724) @@ -1,5 +1,15 @@ 2008-11-14 Michael Wiegand + Applying patch provided by Stjepan Gros to update Makefile target and + to improve code readability. + + * openvasd/openvasd.c (init_openvasd): Minor reformattings. + + * openvasd/Makefile: Remove openvasd-config when distclean target + is invoked. + +2008-11-14 Michael Wiegand + Applying patch provided by Stjepan Gros to eliminate compiler warnings. * openvasd/oval_plugins.c (oval_plugin_add, ovaldi_launch): Minor Modified: trunk/openvas-server/Makefile =================================================================== --- trunk/openvas-server/Makefile 2008-11-14 09:09:24 UTC (rev 1723) +++ trunk/openvas-server/Makefile 2008-11-14 09:12:17 UTC (rev 1724) @@ -127,6 +127,7 @@ rm -f openvas-mkcert rm -f openvas-mkcert-client rm -f openvas-install-cert + rm -f openvasd-config [ -z "${MAN_OPENVASD_8}" ] || rm -f ${MAN_OPENVASD_8} dist: Modified: trunk/openvas-server/openvasd/openvasd.c =================================================================== --- trunk/openvas-server/openvasd/openvasd.c 2008-11-14 09:09:24 UTC (rev 1723) +++ trunk/openvas-server/openvasd/openvasd.c 2008-11-14 09:12:17 UTC (rev 1724) @@ -747,15 +747,15 @@ preferences_init(config_file, &preferences); if((str = arg_get_value(preferences, "max_hosts")) != NULL) - { + { g_max_hosts = atoi(str); if( g_max_hosts <= 0 ) g_max_hosts = 15; - } + } if((str = arg_get_value(preferences, "max_checks")) != NULL) { - g_max_checks = atoi(str); - if( g_max_checks <= 0 )g_max_checks = 10; + g_max_checks = atoi(str); + if( g_max_checks <= 0 )g_max_checks = 10; } @@ -770,38 +770,40 @@ if ( stop_early == 0 ) { - char * dir; + char * dir; - dir = arg_get_value(preferences, "plugins_folder"); + dir = arg_get_value(preferences, "plugins_folder"); store_init_sys(arg_get_value(preferences, "plugins_folder")); plugins = plugins_init(preferences, be_quiet); #ifdef ENABLE_PLUGIN_SERVER - if ( recompile_all != 0 ) exit(0); /* Done */ + if ( recompile_all != 0 ) + exit(0); /* Done */ #endif - if( first_pass != 0 )init_network(iana_port, &isck, *addr); + if ( first_pass != 0 ) + init_network(iana_port, &isck, *addr); } if(first_pass && !stop_early) { - nessus_signal(SIGSEGV, sighandler); - nessus_signal(SIGCHLD, sighand_chld); - nessus_signal(SIGTERM, sighandler); - nessus_signal(SIGINT, sighandler); - nessus_signal(SIGHUP, sighup); - nessus_signal(SIGUSR1, sighandler); /* openvasd dies, not its sons */ - nessus_signal(SIGPIPE, SIG_IGN); + nessus_signal(SIGSEGV, sighandler); + nessus_signal(SIGCHLD, sighand_chld); + nessus_signal(SIGTERM, sighandler); + nessus_signal(SIGINT, sighandler); + nessus_signal(SIGHUP, sighup); + nessus_signal(SIGUSR1, sighandler); /* openvasd dies, not its sons */ + nessus_signal(SIGPIPE, SIG_IGN); } - arg_replace_value(options, "isck", ARG_INT, sizeof(gpointer), GSIZE_TO_POINTER(isck)); - arg_replace_value(options, "plugins", ARG_ARGLIST, -1, plugins); - arg_replace_value(options, "rules", ARG_PTR, -1, rules); - arg_replace_value(options, "preferences", ARG_ARGLIST, -1, preferences); + arg_replace_value(options, "isck", ARG_INT, sizeof(gpointer), GSIZE_TO_POINTER(isck)); + arg_replace_value(options, "plugins", ARG_ARGLIST, -1, plugins); + arg_replace_value(options, "rules", ARG_PTR, -1, rules); + arg_replace_value(options, "preferences", ARG_ARGLIST, -1, preferences); - return(0); + return(0); } int From scm-commit at wald.intevation.org Fri Nov 14 10:43:17 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Fri, 14 Nov 2008 10:43:17 +0100 (CET) Subject: [Openvas-commits] r1725 - in trunk/openvas-plugins: . scripts Message-ID: <20081114094317.CEC044071E@pyrosoma.intevation.org> Author: chandra Date: 2008-11-14 10:43:16 +0100 (Fri, 14 Nov 2008) New Revision: 1725 Added: trunk/openvas-plugins/scripts/gb_phpx_sql_inj_vuln_nov08.nasl trunk/openvas-plugins/scripts/gb_python_intgr_overflow_vuln_win.nasl trunk/openvas-plugins/scripts/gb_ultravnc_cpp_file_mult_bof_vuln.nasl trunk/openvas-plugins/scripts/gb_vlc_media_player_mult_bof_vuln_nov08_lin.nasl trunk/openvas-plugins/scripts/gb_vlc_media_player_mult_bof_vuln_nov08_win.nasl Modified: trunk/openvas-plugins/ChangeLog trunk/openvas-plugins/scripts/gb_adobe_flash_player_sec_bypass_vuln_lin.nasl trunk/openvas-plugins/scripts/gb_adobe_flash_player_sec_bypass_vuln_win.nasl Log: Added new plugins Modified: trunk/openvas-plugins/ChangeLog =================================================================== --- trunk/openvas-plugins/ChangeLog 2008-11-14 09:12:17 UTC (rev 1724) +++ trunk/openvas-plugins/ChangeLog 2008-11-14 09:43:16 UTC (rev 1725) @@ -1,3 +1,15 @@ +2008-11-14 Chandrashekhar B + * scripts/gb_vlc_media_player_mult_bof_vuln_nov08_win.nasl, + scripts/gb_vlc_media_player_mult_bof_vuln_nov08_lin.nasl, + scripts/gb_ultravnc_cpp_file_mult_bof_vuln.nasl, + scripts/gb_phpx_sql_inj_vuln_nov08.nasl, + scripts/gb_python_intgr_overflow_vuln_win.nasl: + Added new plugins + + * scripts/gb_adobe_flash_player_sec_bypass_vuln_lin.nasl, + scripts/gb_adobe_flash_player_sec_bypass_vuln_win.nasl: + Input validation + 2008-11-12 Chandrashekhar B * scripts/secpod_ms08-069_900058.nasl, scripts/secpod_ms08-068_900057.nasl, Modified: trunk/openvas-plugins/scripts/gb_adobe_flash_player_sec_bypass_vuln_lin.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_adobe_flash_player_sec_bypass_vuln_lin.nasl 2008-11-14 09:12:17 UTC (rev 1724) +++ trunk/openvas-plugins/scripts/gb_adobe_flash_player_sec_bypass_vuln_lin.nasl 2008-11-14 09:43:16 UTC (rev 1725) @@ -78,8 +78,13 @@ include("version_func.inc"); +adobeVer = get_kb_item("AdobeFlashPlayer/Linux/Ver"); +if(!adobeVer){ + exit(0); +} + # Grep for versions 9.0.124.0 and prior -if(version_in_range(version:get_kb_item("AdobeFlashPlayer/Linux/Ver"), - test_version:"9.0", test_version2:"9.0.124.0")){ +if(version_in_range(version:adobeVer, test_version:"9.0", + test_version2:"9.0.124.0")){ security_warning(0); } Modified: trunk/openvas-plugins/scripts/gb_adobe_flash_player_sec_bypass_vuln_win.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_adobe_flash_player_sec_bypass_vuln_win.nasl 2008-11-14 09:12:17 UTC (rev 1724) +++ trunk/openvas-plugins/scripts/gb_adobe_flash_player_sec_bypass_vuln_win.nasl 2008-11-14 09:43:16 UTC (rev 1725) @@ -78,8 +78,13 @@ include("version_func.inc"); +adobeVer = get_kb_item("AdobeFlashPlayer/Win/Ver"); +if(!adobeVer){ + exit(0); +} + # Grep for versions 9.0.124.0 and prior -if(version_in_range(version:get_kb_item("AdobeFlashPlayer/Win/Ver"), - test_version:"9.0", test_version2:"9.0.124.0")){ +if(version_in_range(version:adobeVer, test_version:"9.0", + test_version2:"9.0.124.0")){ security_warning(0); } Added: trunk/openvas-plugins/scripts/gb_phpx_sql_inj_vuln_nov08.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_phpx_sql_inj_vuln_nov08.nasl 2008-11-14 09:12:17 UTC (rev 1724) +++ trunk/openvas-plugins/scripts/gb_phpx_sql_inj_vuln_nov08.nasl 2008-11-14 09:43:16 UTC (rev 1725) @@ -0,0 +1,107 @@ +############################################################################### +# OpenVAS Vulnerability Test +# $Id: gb_phpx_sql_inj_vuln_nov08.nasl 0459 2008-11-13 15:11:27Z nov $ +# +# PHPX news_id SQL Injection Vulnerability - Nov08 +# +# Authors: +# Veerendra GG +# +# Copyright: +# Copyright (c) 2008 Intevation GmbH, http://www.intevation.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# (or any later version), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################### + +if(description) +{ + script_id(800134); + script_version("$Revision: 1.0 $"); + script_cve_id("CVE-2008-5000"); + script_bugtraq_id(23033); + script_name(english:"PHPX news_id SQL Injection Vulnerability - Nov08"); + desc["english"] = " + + Overview: The host is running PHPX, which is prone to SQL Injection + Vulnerability. + + Vulnerability Insight: + The flaw is caused due to sql commands with uppercase characters passed + with the news_id parameter to includes/news.inc.php which is not properly + sanitised before being used. + + Impact: + Successful attack could lead to execution of arbitrary sql commands. + + NOTE: Vulnerability exists only when magic_quotes_gpc is disabled. + + Impact Level: Application + + Affected Software/OS: + PHPX Version 3.5.16 and prior on all running platform. + + Fix: No solution/patch is available as on 13th November, 2008. Information + regarding this issue will updated once the solution details are available. + For updates refer, http://phpx.thisrand.com/project.php + + References: + http://secunia.com/advisories/32564 + http://www.milw0rm.com/exploits/6996 + + CVSS Score: + CVSS Base Score : 6.8 (AV:N/AC:M/Au:NR/C:P/I:P/A:P) + CVSS Temporal Score : 6.1 + Risk factor: High"; + + script_description(english:desc["english"]); + script_summary(english:"Check for the Version of PHPX"); + script_category(ACT_MIXED_ATTACK); + script_copyright(english:"Copyright (C) 2008 Intevation GmbH"); + script_family(english:"CGI abuses"); + script_require_ports("Services/www", 80); + exit(0); +} + + +include("http_func.inc"); +include("version_func.inc"); +include("http_keepalive.inc"); + +port = get_http_port(default:80); +if(!port){ + exit(0); +} + +dirs = make_list("/phpx", cgi_dirs()); +foreach dir (dirs) +{ + sndReq = http_get(item:string(dir + "/index.php"), port:port); + rcvRes = http_keepalive_send_recv(port:port,data:sndReq,bodyonly:1); + if(rcvRes == NULL){ + exit(0); + } + + if(rcvRes =~ "Powered by.+PHPX") + { + phpxVer = eregmatch(pattern:"PHPX ([0-9.]+)", string:rcvRes); + if(phpxVer != NULL) + { + # Check for PXPX Version <= 3.5.16 + if(version_is_less_equal(version:phpxVer[1], test_version:"3.5.16")){ + security_hole(0); + } + } + exit(0); + } +} Property changes on: trunk/openvas-plugins/scripts/gb_phpx_sql_inj_vuln_nov08.nasl ___________________________________________________________________ Name: svn:executable + * Added: trunk/openvas-plugins/scripts/gb_python_intgr_overflow_vuln_win.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_python_intgr_overflow_vuln_win.nasl 2008-11-14 09:12:17 UTC (rev 1724) +++ trunk/openvas-plugins/scripts/gb_python_intgr_overflow_vuln_win.nasl 2008-11-14 09:43:16 UTC (rev 1725) @@ -0,0 +1,95 @@ +############################################################################### +# OpenVAS Vulnerability Test +# $Id: gb_python_intr_overflow_vuln_win.nasl 0463 2008-11-13 09:41:19Z nov $ +# +# Python Multiple Integer Overflow Vulnerabilities (Win) +# +# Authors: +# Chandan S +# +# Copyright: +# Copyright (c) 2008 Intevation GmbH, http://www.intevation.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# (or any later version), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################### + +if(description) +{ + script_id(800056); + script_version("$Revision: 1.0 $"); + script_cve_id("CVE-2008-5031"); + script_name(english:"Python Multiple Integer Overflow Vulnerabilities (Win)"); + desc["english"] = " + + Overview: This host has Python installed and is prone to integer overflow + vulnerability. + + Vulnerability Insight: + The flaw exists due the the way it handles large integer values in the + tabsize arguments as input to expandtabs methods (string_expandtabs and + nicode_expandtabs) in stringobject.c and unicodeobject.c. + + Impact: + Remote exploitation will allow execution of arbitrary code via large number + of integer values to modules. + + Impact Level: Application + + Affected Software/OS: + Python 2.5.2 on Windows. + + Fix: No solution/patch is avilable as on 13th November, 2008. Information + Regarding this issue will updated once the solution details are available. + For updates refer, http://www.python.org/ + + CVSS Score: + CVSS Base Score : 10.0 (AV:N/AC:L/Au:NR/C:C/I:C/A:C) + CVSS Temporal Score : 8.5 + Risk factor: High"; + + script_description(english:desc["english"]); + script_summary(english:"Check for the version of Python"); + script_category(ACT_GATHER_INFO); + script_copyright(english:"Copyright (C) 2008 Intevation GmbH"); + script_family(english:"Misc."); + script_dependencies("secpod_reg_enum.nasl"); + script_require_keys("SMB/WindowsVersion"); + exit(0); +} + + +include("smb_nt.inc"); +include("version_func.inc"); +include("secpod_smb_func.inc"); + +if(!(get_kb_item("SMB/WindowsVersion"))){ + exit(0); +} + +key = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"; +foreach entry (registry_enum_keys(key:key)) +{ + pyName = registry_get_sz(key:key + entry, item:"DisplayName"); + if("Python" >< pyName) + { + pyVer = eregmatch(pattern:"[0-9.]+", string:pyName); + if(pyVer != NULL) + { + if(version_is_equal(version:pyVer[0], test_version:"2.5.2")){ + security_hole(0); + } + } + exit(0); + } +} Added: trunk/openvas-plugins/scripts/gb_ultravnc_cpp_file_mult_bof_vuln.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_ultravnc_cpp_file_mult_bof_vuln.nasl 2008-11-14 09:12:17 UTC (rev 1724) +++ trunk/openvas-plugins/scripts/gb_ultravnc_cpp_file_mult_bof_vuln.nasl 2008-11-14 09:43:16 UTC (rev 1725) @@ -0,0 +1,122 @@ +############################################################################### +# OpenVAS Vulnerability Test +# $Id: gb_ultravnc_cpp_file_mult_bof_vuln.nasl 460 2008-11-11 11:54:08Z nov $ +# +# UltraVNC VNCViewer Multiple Buffer Overflow Vulnerabilities - Nov08 +# +# Authors: +# Veerendra GG +# +# Copyright: +# Copyright (c) 2008 Intevation GmbH, http://www.intevation.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# (or any later version), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################### + +desc["english"] = " + Overview: This host is installed with UltraVNC VNCViewer and is prone to + Buffer Overflow Vulnerability. + + Vulnerability Insight: + The flaw is caused due to multiple boundary errors within the + vncviewer/FileTransfer.cpp file, while processing malformed data. + + Impact: Successful exploitation allows attackers to execute arbitrary code + by tricking a user into connecting to a malicious VNC server or by sending + specially crafted data to a vncviewer in LISTENING mode and can even cause + denial of service condition. + + Impact Level: Application + + Affected Software/OS: + UltraVNC VNCViewer Version 1.0.2 and 1.0.4 before RC11 on Windows (Any). + + Fix: Upgrade to latest Version or + Apply the available patch from below link, + http://downloads.sourceforge.net/ultravnc/UltraVNC-Viewer-104-Security-Update-2---Feb-8-2008.zip + + References: + http://secunia.com/advisories/28804 + http://forum.ultravnc.info/viewtopic.php?p=45150 + http://www.frsirt.com/english/advisories/2008/0486/products + http://sourceforge.net/project/shownotes.php?release_id=571174;group_id=63887 + + CVSS Score: + CVSS Base Score : 9.3 (AV:N/AC:M/Au:NR/C:C/I:C/A:C) + CVSS Temporal Score : 6.9 + Risk factor: High"; + +if(description) +{ + script_id(800131); + script_version("$Revision: 1.0 $"); + script_cve_id("CVE-2008-5001"); + script_bugtraq_id(27687); + script_name(english:"UltraVNC VNCViewer Multiple Buffer Overflow Vulnerabilities - Nov08"); + script_description(english:desc["english"]); + script_summary(english:"Check for the Version of UltraVNC VNCViewer"); + script_category(ACT_GATHER_INFO); + script_copyright(english:"Copyright (C) 2008 Intevation GmbH"); + script_family(english:"Denial of Service"); + script_dependencies("secpod_reg_enum.nasl"); + script_require_keys("SMB/WindowsVersion"); + exit(0); +} + + +include("smb_nt.inc"); +include("secpod_smb_func.inc"); + +if(!get_kb_item("SMB/WindowsVersion")){ + exit(0); +} + +key = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"; +foreach item (registry_enum_keys(key:key)) +{ + vncName = registry_get_sz(item:"DisplayName", key:key +item); + if("UltraVNC" >!< vncName){ + continue; + } + + vncComp = registry_get_sz(item:"Inno Setup: Selected Components", + key:key + item); + if("viewer" >< vncComp) + { + vncPath = registry_get_sz(item:"InstallLocation", key:key +item); + if(!vncPath){ + exit(0); + } + + vncPath += "vncviewer.exe"; + share = ereg_replace(pattern:"([A-Z]):.*", replace:"\1$", string:vncPath); + file = ereg_replace(pattern:"[A-Z]:(.*)", replace:"\1", string:vncPath); + + vncVer = GetVer(file:file, share:share); + if(!vncVer){ + exit(0); + } + + if(vncVer == "1.1.0.2"){ + security_hole(data:desc["english"]); + } + else if ("1.0.4" >< vncVer) + { + report = string("\n\n ***** \n NOTE: Ignore this report if above " + + "mentioned patch is already applied.\n ***** \n"); + security_hole(data:string(desc["english"], report)); + } + exit(0); + } +} Property changes on: trunk/openvas-plugins/scripts/gb_ultravnc_cpp_file_mult_bof_vuln.nasl ___________________________________________________________________ Name: svn:executable + * Added: trunk/openvas-plugins/scripts/gb_vlc_media_player_mult_bof_vuln_nov08_lin.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_vlc_media_player_mult_bof_vuln_nov08_lin.nasl 2008-11-14 09:12:17 UTC (rev 1724) +++ trunk/openvas-plugins/scripts/gb_vlc_media_player_mult_bof_vuln_nov08_lin.nasl 2008-11-14 09:43:16 UTC (rev 1725) @@ -0,0 +1,103 @@ +############################################################################### +# OpenVAS Vulnerability Test +# $Id: gb_vlc_media_player_mult_bof_vuln_nov08_lin.nasl 464 2008-11-12 12:52:23Z oct $ +# +# VLC Media Player Multiple Stack-Based BOF Vulnerabilities - Nov08 (Linux) +# +# Authors: +# Veerendra GG +# +# Copyright: +# Copyright (c) 2008 Intevation GmbH, http://www.intevation.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# (or any later version), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################### + +if(description) +{ + script_id(800133); + script_version("$Revision: 1.0 $"); + script_cve_id("CVE-2008-5032", "CVE-2008-5036"); + script_bugtraq_id(32125); + script_name(english:"VLC Media Player Multiple Stack-Based BOF Vulnerabilities - Nov08 (Linux)"); + desc["english"] = " + + Overview: This host is installed with VLC Media Player and is prone to + Multiple Stack-Based Buffer Overflow Vulnerabilities. + + Vulnerability Insight: + The flaws are caused while parsing, + - header of an invalid CUE image file related to modules/access/vcd/cdrom.c. + - an invalid RealText(rt) subtitle file related to the ParseRealText function + in modules/demux/subtitle.c. + + Impact: Successful exploitation allows attackers to execute arbitrary code + within the context of the VLC media player by tricking a user into opening + a specially crafted file or can even crash an affected application. + + Impact Level: Application + + Affected Software/OS: + VLC media player 0.5.0 through 0.9.5 on Windows (Any). + + Fix: Upgrade to 0.9.6, or + Apply the available patch from below link, + http://git.videolan.org/?p=vlc.git;a=commitdiff;h=e3cef651125701a2e33a8d75b815b3e39681a447 + http://git.videolan.org/?p=vlc.git;a=commitdiff;h=5f63f1562d43f32331006c2c1a61742de031b84d + + ***** + NOTE: Ignore this warning if above mentioned patch is already applied. + ***** + + References: + http://www.videolan.org/security/sa0810.html + http://www.trapkit.de/advisories/TKADV2008-011.txt + http://www.trapkit.de/advisories/TKADV2008-012.txt + + CVSS Score: + CVSS Base Score : 9.3 (AV:N/AC:M/Au:NR/C:C/I:C/A:C) + CVSS Temporal Score : 6.9 + Risk factor: High"; + + script_description(english:desc["english"]); + script_summary(english:"Check for the Version of VLC Media Player"); + script_category(ACT_GATHER_INFO); + script_copyright(english:"Copyright (C) 2008 Intevation GmbH"); + script_family(english:"Denial of Service"); + exit(0); +} + + +include("version_func.inc"); + +sock = ssh_login_or_reuse_connection(); +if(!sock){ + exit(0); +} + +vlcBinPath = find_bin(prog_name:"vlc", sock:sock); +foreach binPath (vlcBinPath) +{ + vlcVer = get_bin_version(full_prog_name:chomp(binPath), version_argv:"--version", + ver_pattern:"ersion ([0-9.]+[a-z]?)", sock:sock); + { + # Check for VLC Media Player Version 0.5.0 - 0.9.5 + if(version_in_range(version:vlcVer[1], test_version:"0.5.0", test_version2:"0.9.5")){ + security_hole(0); + } + ssh_close_connection(); + exit(0); + } +} +ssh_close_connection(); Property changes on: trunk/openvas-plugins/scripts/gb_vlc_media_player_mult_bof_vuln_nov08_lin.nasl ___________________________________________________________________ Name: svn:executable + * Added: trunk/openvas-plugins/scripts/gb_vlc_media_player_mult_bof_vuln_nov08_win.nasl =================================================================== --- trunk/openvas-plugins/scripts/gb_vlc_media_player_mult_bof_vuln_nov08_win.nasl 2008-11-14 09:12:17 UTC (rev 1724) +++ trunk/openvas-plugins/scripts/gb_vlc_media_player_mult_bof_vuln_nov08_win.nasl 2008-11-14 09:43:16 UTC (rev 1725) @@ -0,0 +1,99 @@ +############################################################################### +# OpenVAS Vulnerability Test +# $Id: gb_vlc_media_player_mult_bof_vuln_nov08_win.nasl 464 2008-11-12 12:52:23Z nov $ +# +# VLC Media Player Multiple Stack-Based BOF Vulnerabilities - Nov08 (Win) +# +# Authors: +# Veerendra GG +# +# Copyright: +# Copyright (c) 2008 Intevation GmbH, http://www.intevation.net +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 +# (or any later version), as published by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +############################################################################### + +if(description) +{ + script_id(800132); + script_version("$Revision: 1.0 $"); + script_cve_id("CVE-2008-5032", "CVE-2008-5036"); + script_bugtraq_id(32125); + script_name(english:"VLC Media Player Multiple Stack-Based BOF Vulnerabilities - Nov08 (Win)"); + desc["english"] = " + + Overview: This host is installed with VLC Media Player and is prone to + Multiple Stack-Based Buffer Overflow Vulnerabilities. + + Vulnerability Insight: + The flaws are caused while parsing, + - header of an invalid CUE image file related to modules/access/vcd/cdrom.c. + - an invalid RealText(rt) subtitle file related to the ParseRealText function + in modules/demux/subtitle.c. + + Impact: Successful exploitation allows attackers to execute arbitrary code + within the context of the VLC media player by tricking a user into opening + a specially crafted file or can even crash an affected application. + + Impact Level: Application + + Affected Software/OS: + VLC media player 0.5.0 through 0.9.5 on Windows (Any). + + Fix: Upgrade to 0.9.6, or + Apply the available patch from below link, + http://git.videolan.org/?p=vlc.git;a=commitdiff;h=e3cef651125701a2e33a8d75b815b3e39681a447 + http://git.videolan.org/?p=vlc.git;a=commitdiff;h=5f63f1562d43f32331006c2c1a61742de031b84d + + ***** + NOTE: Ignore this warning if above mentioned patch is already applied. + ***** + + References: + http://www.videolan.org/security/sa0810.html + http://www.trapkit.de/advisories/TKADV2008-011.txt + http://www.trapkit.de/advisories/TKADV2008-012.txt + + CVSS Score: + CVSS Base Score : 9.3 (AV:N/AC:M/Au:NR/C:C/I:C/A:C) + CVSS Temporal Score : 6.9 + Risk factor: High"; + + script_description(english:desc["english"]); + script_summary(english:"Check for the Version of VLC Media Player"); + script_category(ACT_GATHER_INFO); + script_copyright(english:"Copyright (C) 2008 Intevation GmbH"); + script_family(english:"Denial of Service"); + script_dependencies("secpod_reg_enum.nasl"); + script_require_keys("SMB/WindowsVersion"); + exit(0); +} + + +include("smb_nt.inc"); +include("version_func.inc"); + +if(!get_kb_item("SMB/WindowsVersion")){ + exit(0); +} + +vlcVer = registry_get_sz(item:"Version", key:"SOFTWARE\VideoLAN\VLC"); +if(!vlcVer){ + exit(0); +} + +# Check for VLC Media Player Version 0.5.0 to 0.9.5 +if(version_in_range(version:vlcVer, test_version:"0.5.0", test_version2:"0.9.5")){ + security_hole(0); +} Property changes on: trunk/openvas-plugins/scripts/gb_vlc_media_player_mult_bof_vuln_nov08_win.nasl ___________________________________________________________________ Name: svn:executable + * From scm-commit at wald.intevation.org Fri Nov 14 10:47:32 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Fri, 14 Nov 2008 10:47:32 +0100 (CET) Subject: [Openvas-commits] r1726 - trunk/openvas-libraries Message-ID: <20081114094732.E2F5440727@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-14 10:47:32 +0100 (Fri, 14 Nov 2008) New Revision: 1726 Modified: trunk/openvas-libraries/ChangeLog trunk/openvas-libraries/openvas-libraries.tmpl.in Log: * openvas-libraries.tmpl.in: Added datarootdir to remove configure warning and to be compatible with autoconf 2.60 (see http://www.gnu.org/software/libtool/manual/autoconf/Changed-Directory-Variables.html). Modified: trunk/openvas-libraries/ChangeLog =================================================================== --- trunk/openvas-libraries/ChangeLog 2008-11-14 09:43:16 UTC (rev 1725) +++ trunk/openvas-libraries/ChangeLog 2008-11-14 09:47:32 UTC (rev 1726) @@ -1,5 +1,11 @@ 2008-11-14 Michael Wiegand + * openvas-libraries.tmpl.in: Added datarootdir to remove configure + warning and to be compatible with autoconf 2.60 (see + http://www.gnu.org/software/libtool/manual/autoconf/Changed-Directory-Variables.html). + +2008-11-14 Michael Wiegand + Applying patch provided by Stjepan Gros. * libopenvas/arglists.c (arg_dump): Minor reformattings, added cast to Modified: trunk/openvas-libraries/openvas-libraries.tmpl.in =================================================================== --- trunk/openvas-libraries/openvas-libraries.tmpl.in 2008-11-14 09:43:16 UTC (rev 1725) +++ trunk/openvas-libraries/openvas-libraries.tmpl.in 2008-11-14 09:47:32 UTC (rev 1726) @@ -33,6 +33,7 @@ bindir=@bindir@ sbindir=@sbindir@ libexecdir=@libexecdir@ +datarootdir=@datarootdir@ datadir=@datadir@ sysconfdir=@sysconfdir@ sharedstatedir=@sharedstatedir@ From scm-commit at wald.intevation.org Fri Nov 14 10:52:47 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Fri, 14 Nov 2008 10:52:47 +0100 (CET) Subject: [Openvas-commits] r1727 - trunk/openvas-libnasl Message-ID: <20081114095247.D805540728@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-14 10:52:47 +0100 (Fri, 14 Nov 2008) New Revision: 1727 Modified: trunk/openvas-libnasl/ChangeLog trunk/openvas-libnasl/nasl.tmpl.in Log: * nasl.tmpl.in: Added datarootdir to remove configure warning and to be compatible with autoconf 2.60 (see http://www.gnu.org/software/libtool/manual/autoconf/Changed-Directory-Variables.html). Modified: trunk/openvas-libnasl/ChangeLog =================================================================== --- trunk/openvas-libnasl/ChangeLog 2008-11-14 09:47:32 UTC (rev 1726) +++ trunk/openvas-libnasl/ChangeLog 2008-11-14 09:52:47 UTC (rev 1727) @@ -1,5 +1,11 @@ 2008-11-14 Michael Wiegand + * nasl.tmpl.in: Added datarootdir to remove configure warning and to be + compatible with autoconf 2.60 (see + http://www.gnu.org/software/libtool/manual/autoconf/Changed-Directory-Variables.html). + +2008-11-14 Michael Wiegand + Updated libtool usage again to make it more consistent and to avoid duplicate mode parameters. Modified: trunk/openvas-libnasl/nasl.tmpl.in =================================================================== --- trunk/openvas-libnasl/nasl.tmpl.in 2008-11-14 09:47:32 UTC (rev 1726) +++ trunk/openvas-libnasl/nasl.tmpl.in 2008-11-14 09:52:47 UTC (rev 1727) @@ -36,6 +36,7 @@ bindir=@bindir@ sbindir=@sbindir@ libexecdir=@libexecdir@ +datarootdir=@datarootdir@ datadir=@datadir@ sysconfdir=@sysconfdir@ sharedstatedir=@sharedstatedir@ From scm-commit at wald.intevation.org Fri Nov 14 11:03:28 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Fri, 14 Nov 2008 11:03:28 +0100 (CET) Subject: [Openvas-commits] r1728 - trunk/openvas-server Message-ID: <20081114100328.153B24073C@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-14 11:03:22 +0100 (Fri, 14 Nov 2008) New Revision: 1728 Modified: trunk/openvas-server/ChangeLog trunk/openvas-server/openvas-adduser.in trunk/openvas-server/openvas-mkcert-client.in trunk/openvas-server/openvas-mkcert.in trunk/openvas-server/openvas-rmuser.in trunk/openvas-server/openvas.tmpl.in Log: * openvas.tmpl.in, openvas-adduser.in, openvas-mkcert-client.in, openvas-rmuser.in: Added datarootdir to remove configure warning and to be compatible with autoconf 2.60 (see http://www.gnu.org/software/libtool/manual/autoconf/Changed-Directory-Variables.html). Modified: trunk/openvas-server/ChangeLog =================================================================== --- trunk/openvas-server/ChangeLog 2008-11-14 09:52:47 UTC (rev 1727) +++ trunk/openvas-server/ChangeLog 2008-11-14 10:03:22 UTC (rev 1728) @@ -1,5 +1,12 @@ 2008-11-14 Michael Wiegand + * openvas.tmpl.in, openvas-adduser.in, openvas-mkcert-client.in, + openvas-rmuser.in: Added datarootdir to remove configure warning and to + be compatible with autoconf 2.60 (see + http://www.gnu.org/software/libtool/manual/autoconf/Changed-Directory-Variables.html). + +2008-11-14 Michael Wiegand + Applying patch provided by Stjepan Gros to update Makefile target and to improve code readability. Modified: trunk/openvas-server/openvas-adduser.in =================================================================== --- trunk/openvas-server/openvas-adduser.in 2008-11-14 09:52:47 UTC (rev 1727) +++ trunk/openvas-server/openvas-adduser.in 2008-11-14 10:03:22 UTC (rev 1728) @@ -91,6 +91,7 @@ bindir=@bindir@ sbindir=@sbindir@ +datarootdir=@datarootdir@ datadir=@datadir@ localstatedir=@localstatedir@ Modified: trunk/openvas-server/openvas-mkcert-client.in =================================================================== --- trunk/openvas-server/openvas-mkcert-client.in 2008-11-14 09:52:47 UTC (rev 1727) +++ trunk/openvas-server/openvas-mkcert-client.in 2008-11-14 10:03:22 UTC (rev 1728) @@ -38,6 +38,7 @@ umask 022 prefix=@prefix@ +datarootdir=@datarootdir@ datadir=@datadir@ sysconfdir=@sysconfdir@ localstatedir=@localstatedir@ Modified: trunk/openvas-server/openvas-mkcert.in =================================================================== --- trunk/openvas-server/openvas-mkcert.in 2008-11-14 09:52:47 UTC (rev 1727) +++ trunk/openvas-server/openvas-mkcert.in 2008-11-14 10:03:22 UTC (rev 1728) @@ -39,6 +39,7 @@ umask 022 prefix=@prefix@ +datarootdir=@datarootdir@ datadir=@datadir@ sysconfdir=@sysconfdir@ localstatedir=@localstatedir@ Modified: trunk/openvas-server/openvas-rmuser.in =================================================================== --- trunk/openvas-server/openvas-rmuser.in 2008-11-14 09:52:47 UTC (rev 1727) +++ trunk/openvas-server/openvas-rmuser.in 2008-11-14 10:03:22 UTC (rev 1728) @@ -35,6 +35,7 @@ bindir=@bindir@ sbindir=@sbindir@ libexecdir=@libexecdir@ +datarootdir=@datarootdir@ datadir=@datadir@ sysconfdir=@sysconfdir@ sharedstatedir=@sharedstatedir@ Modified: trunk/openvas-server/openvas.tmpl.in =================================================================== --- trunk/openvas-server/openvas.tmpl.in 2008-11-14 09:52:47 UTC (rev 1727) +++ trunk/openvas-server/openvas.tmpl.in 2008-11-14 10:03:22 UTC (rev 1728) @@ -23,6 +23,7 @@ bindir=@bindir@ sbindir=@sbindir@ libexecdir=@libexecdir@ +datarootdir=@datarootdir@ datadir=@datadir@ sysconfdir=@sysconfdir@ sharedstatedir=@sharedstatedir@ From scm-commit at wald.intevation.org Fri Nov 14 11:06:37 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Fri, 14 Nov 2008 11:06:37 +0100 (CET) Subject: [Openvas-commits] r1729 - trunk/openvas-plugins Message-ID: <20081114100637.BFCCF4073C@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-14 11:06:37 +0100 (Fri, 14 Nov 2008) New Revision: 1729 Modified: trunk/openvas-plugins/ChangeLog trunk/openvas-plugins/openvas.tmpl.in Log: * openvas.tmpl.in: Added datarootdir to remove configure warning and to be compatible with autoconf 2.60 (see http://www.gnu.org/software/libtool/manual/autoconf/Changed-Directory-Variables.html). Modified: trunk/openvas-plugins/ChangeLog =================================================================== --- trunk/openvas-plugins/ChangeLog 2008-11-14 10:03:22 UTC (rev 1728) +++ trunk/openvas-plugins/ChangeLog 2008-11-14 10:06:37 UTC (rev 1729) @@ -1,3 +1,9 @@ +2008-11-14 Michael Wiegand + + * openvas.tmpl.in: Added datarootdir to remove configure warning and to + be compatible with autoconf 2.60 (see + http://www.gnu.org/software/libtool/manual/autoconf/Changed-Directory-Variables.html). + 2008-11-14 Chandrashekhar B * scripts/gb_vlc_media_player_mult_bof_vuln_nov08_win.nasl, scripts/gb_vlc_media_player_mult_bof_vuln_nov08_lin.nasl, Modified: trunk/openvas-plugins/openvas.tmpl.in =================================================================== --- trunk/openvas-plugins/openvas.tmpl.in 2008-11-14 10:03:22 UTC (rev 1728) +++ trunk/openvas-plugins/openvas.tmpl.in 2008-11-14 10:06:37 UTC (rev 1729) @@ -10,6 +10,7 @@ bindir=@bindir@ sbindir=@sbindir@ libexecdir=@libexecdir@ +datarootdir=@datarootdir@ datadir=@datadir@ sysconfdir=@sysconfdir@ sharedstatedir=@sharedstatedir@ From scm-commit at wald.intevation.org Fri Nov 14 11:15:23 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Fri, 14 Nov 2008 11:15:23 +0100 (CET) Subject: [Openvas-commits] r1730 - in trunk/openvas-client: . libnessus nessus src/openvas-lib Message-ID: <20081114101523.2405E40727@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-14 11:15:22 +0100 (Fri, 14 Nov 2008) New Revision: 1730 Modified: trunk/openvas-client/ChangeLog trunk/openvas-client/libnessus/harglists.c trunk/openvas-client/nessus/comm.c trunk/openvas-client/src/openvas-lib/openvas_certificates.c Log: Applying patch provided by Stjepan Gros to eliminate compiler warnings. * nessus/comm.c (comm_parse_preference): Added parentheses around expression to remove compiler warning. * src/openvas-lib/openvas_certificates.c (openvas_certificate_free): Changed comparison of integer variable to zero instead of NULL, silencing the compiler warning. * libnessus/harglists.c (harg_addt, harg_set_valuet, harg_renamet): Added parentheses around if expressions to silence compiler warnings. Modified: trunk/openvas-client/ChangeLog =================================================================== --- trunk/openvas-client/ChangeLog 2008-11-14 10:06:37 UTC (rev 1729) +++ trunk/openvas-client/ChangeLog 2008-11-14 10:15:22 UTC (rev 1730) @@ -1,3 +1,17 @@ +2008-11-14 Michael Wiegand + + Applying patch provided by Stjepan Gros to eliminate compiler warnings. + + * nessus/comm.c (comm_parse_preference): Added parentheses around + expression to remove compiler warning. + + * src/openvas-lib/openvas_certificates.c (openvas_certificate_free): + Changed comparison of integer variable to zero instead of NULL, + silencing the compiler warning. + + * libnessus/harglists.c (harg_addt, harg_set_valuet, harg_renamet): + Added parentheses around if expressions to silence compiler warnings. + 2008-11-13 Michael Wiegand * nessus/sslui.c (sslui_showcert): Catch signal sent when user closes Modified: trunk/openvas-client/libnessus/harglists.c =================================================================== --- trunk/openvas-client/libnessus/harglists.c 2008-11-14 10:06:37 UTC (rev 1729) +++ trunk/openvas-client/libnessus/harglists.c 2008-11-14 10:15:22 UTC (rev 1730) @@ -676,8 +676,8 @@ /* sanity check */ if (a == 0 || key == 0 || - size == 0 && ((value == 0) && is_blob_type (type) || - verify_simple_type (type, HARG_BLOB))) { + (size == 0 && (((value == 0) && is_blob_type (type)) || + verify_simple_type (type, HARG_BLOB)))) { errno = EINVAL; return 0; } @@ -740,8 +740,8 @@ /* sanity check */ if (a == 0 || key == 0 || - size == 0 && (value == 0 && is_blob_type (type) || - verify_simple_type (type, HARG_BLOB))) { + (size == 0 && (((value == 0) && is_blob_type (type)) || + verify_simple_type (type, HARG_BLOB)))) { errno = EINVAL; return -1; } @@ -830,8 +830,8 @@ return 0 ; /* nothing to do */ /* check target type groups */ - if (is_blob_type (ntype) && is_blob_type (r->type) || - is_scalar_type (ntype) && is_scalar_type (r->type) || + if ((is_blob_type (ntype) && is_blob_type (r->type)) || + (is_scalar_type (ntype) && is_scalar_type (r->type)) || is_specific_type (ntype) == 0) { if (same_keys == 0) { /* make new index */ Modified: trunk/openvas-client/nessus/comm.c =================================================================== --- trunk/openvas-client/nessus/comm.c 2008-11-14 10:06:37 UTC (rev 1729) +++ trunk/openvas-client/nessus/comm.c 2008-11-14 10:15:22 UTC (rev 1730) @@ -502,7 +502,7 @@ * it also to value */ v = strstr(s, ";"); if (v) { - *v ++; + (*v) ++; value = (char *) erealloc(value, strlen(value) + strlen(v) + 1); value = strcat(value, v); } else { Modified: trunk/openvas-client/src/openvas-lib/openvas_certificates.c =================================================================== --- trunk/openvas-client/src/openvas-lib/openvas_certificates.c 2008-11-14 10:06:37 UTC (rev 1729) +++ trunk/openvas-client/src/openvas-lib/openvas_certificates.c 2008-11-14 10:15:22 UTC (rev 1730) @@ -75,9 +75,9 @@ efree(& (cert->fpr) ); if( cert->ownername != NULL) efree(& (cert->ownername) ); - if(cert->trusted != NULL) + if(cert->trusted != 0) efree(& (cert->trusted) ); if(cert->full_public_key != NULL) efree(& (cert->full_public_key) ); efree(&cert); -} \ No newline at end of file +} From scm-commit at wald.intevation.org Fri Nov 14 11:16:06 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Fri, 14 Nov 2008 11:16:06 +0100 (CET) Subject: [Openvas-commits] r1731 - trunk/openvas-client Message-ID: <20081114101606.E79A640727@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-14 11:16:06 +0100 (Fri, 14 Nov 2008) New Revision: 1731 Modified: trunk/openvas-client/ChangeLog trunk/openvas-client/nessus.tmpl.in trunk/openvas-client/openvasclient-mkcert.in Log: * nessus.tmpl.in, openvasclient-mkcert.in: Added datarootdir to remove configure warning and to be compatible with autoconf 2.60 (see http://www.gnu.org/software/libtool/manual/autoconf/Changed-Directory-Variables.html). Modified: trunk/openvas-client/ChangeLog =================================================================== --- trunk/openvas-client/ChangeLog 2008-11-14 10:15:22 UTC (rev 1730) +++ trunk/openvas-client/ChangeLog 2008-11-14 10:16:06 UTC (rev 1731) @@ -1,5 +1,11 @@ 2008-11-14 Michael Wiegand + * nessus.tmpl.in, openvasclient-mkcert.in: Added datarootdir to remove + configure warning and to be compatible with autoconf 2.60 (see + http://www.gnu.org/software/libtool/manual/autoconf/Changed-Directory-Variables.html). + +2008-11-14 Michael Wiegand + Applying patch provided by Stjepan Gros to eliminate compiler warnings. * nessus/comm.c (comm_parse_preference): Added parentheses around Modified: trunk/openvas-client/nessus.tmpl.in =================================================================== --- trunk/openvas-client/nessus.tmpl.in 2008-11-14 10:15:22 UTC (rev 1730) +++ trunk/openvas-client/nessus.tmpl.in 2008-11-14 10:16:06 UTC (rev 1731) @@ -23,6 +23,7 @@ bindir=@bindir@ sbindir=@sbindir@ libexecdir=@libexecdir@ +datarootdir=@datarootdir@ datadir=@datadir@ sysconfdir=@sysconfdir@ sharedstatedir=@sharedstatedir@ Modified: trunk/openvas-client/openvasclient-mkcert.in =================================================================== --- trunk/openvas-client/openvasclient-mkcert.in 2008-11-14 10:15:22 UTC (rev 1730) +++ trunk/openvas-client/openvasclient-mkcert.in 2008-11-14 10:16:06 UTC (rev 1731) @@ -15,6 +15,7 @@ umask 022 prefix=@prefix@ +datarootdir=@datarootdir@ datadir=@datadir@ sysconfdir=@sysconfdir@ localstatedir=@localstatedir@ From scm-commit at wald.intevation.org Wed Nov 12 15:26:18 2008 From: scm-commit at wald.intevation.org (scm-commit@wald.intevation.org) Date: Wed, 12 Nov 2008 15:26:18 +0100 (CET) Subject: [Openvas-commits] r1705 - in trunk/openvas-libraries: . libopenvas Message-ID: <20081112142618.0A59440719@pyrosoma.intevation.org> Author: mwiegand Date: 2008-11-12 15:26:14 +0100 (Wed, 12 Nov 2008) New Revision: 1705 Modified: trunk/openvas-libraries/ChangeLog trunk/openvas-libraries/aclocal.m4 trunk/openvas-libraries/configure trunk/openvas-libraries/configure.in trunk/openvas-libraries/libopenvas/Makefile trunk/openvas-libraries/libopenvas/arglists.c trunk/openvas-libraries/libopenvas/harglists.c trunk/openvas-libraries/libopenvas/harglists.h trunk/openvas-libraries/libopenvas/kb.c trunk/openvas-libraries/libopenvas/network.c trunk/openvas-libraries/libopenvas/plugutils.c trunk/openvas-libraries/libopenvas/scanners_utils.c trunk/openvas-libraries/libopenvas/store.c trunk/openvas-libraries/openvas-libraries.tmpl.in Log: Applying patch provided by Stjepan Gros to improve 64-bit cleanliness. * configure.in: Added check for the glib2 library. * configure: Regenerated. * aclocal.m4: Regenerated. * libopenvas/harglists.c, libopenvas/arglists.c, libopenvas/plugutils.c, libopenvas/network.c, libopenvas/Makefile, libopenvas/store.c, libopenvas/scanners_utils.c, libopenvas/kb.c, openvas-libraries.tmpl.in: Introduced glib library. * libopenvas/harglists.c, libopenvas/harglists.h, libopenvas/arglists.c, libopenvas/plugutils.c, libopenvas/network.c, libopenvas/scanners_utils.c, libopenvas/kb.c, libopenvas/store.c: 32/64-bit cleanup. * libopenvas/plugutils.c: Minor reformatings. Modified: trunk/openvas-libraries/ChangeLog =================================================================== --- trunk/openvas-libraries/ChangeLog 2008-11-12 13:59:42 UTC (rev 1704) +++ trunk/openvas-libraries/ChangeLog 2008-11-12 14:26:14 UTC (rev 1705) @@ -1,5 +1,28 @@ 2008-11-12 Michael Wiegand + Applying patch provided by Stjepan Gros to improve 64-bit cleanliness. + + * configure.in: Added check for the glib2 library. + + * configure: Regenerated. + + * aclocal.m4: Regenerated. + + * libopenvas/harglists.c, libopenvas/arglists.c, + libopenvas/plugutils.c, libopenvas/network.c, + libopenvas/Makefile, libopenvas/store.c, + libopenvas/scanners_utils.c, libopenvas/kb.c, + openvas-libraries.tmpl.in: Introduced glib library. + + * libopenvas/harglists.c, libopenvas/harglists.h, + libopenvas/arglists.c, libopenvas/plugutils.c, + libopenvas/network.c, libopenvas/scanners_utils.c, + libopenvas/kb.c, libopenvas/store.c: 32/64-bit cleanup. + + * libopenvas/plugutils.c: Minor reformatings. + +2008-11-12 Michael Wiegand + * configure.in: Added AC_PREREQ directive to tell autoconf to generate a 2.50-style configure script. Modified: trunk/openvas-libraries/aclocal.m4 =================================================================== --- trunk/openvas-libraries/aclocal.m4 2008-11-12 13:59:42 UTC (rev 1704) +++ trunk/openvas-libraries/aclocal.m4 2008-11-12 14:26:14 UTC (rev 1705) @@ -1,21 +1,73 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4-p5a +# generated automatically by aclocal 1.9.6 -*- Autoconf -*- -dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. -dnl This program is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without -dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A -dnl PARTICULAR PURPOSE. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. -# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*- +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- -# serial 46 AC_PROG_LIBTOOL +# serial 48 Debian 1.5.22-4 AC_PROG_LIBTOOL + +# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) +# ----------------------------------------------------------- +# If this macro is not defined by Autoconf, define it here. +m4_ifdef([AC_PROVIDE_IFELSE], + [], + [m4_define([AC_PROVIDE_IFELSE], + [m4_ifdef([AC_PROVIDE_$1], + [$2], [$3])])]) + + +# AC_PROG_LIBTOOL +# --------------- AC_DEFUN([AC_PROG_LIBTOOL], +[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl +dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX +dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. + AC_PROVIDE_IFELSE([AC_PROG_CXX], + [AC_LIBTOOL_CXX], + [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX + ])]) +dnl And a similar setup for Fortran 77 support + AC_PROVIDE_IFELSE([AC_PROG_F77], + [AC_LIBTOOL_F77], + [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 +])]) + +dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. +dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run +dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. + AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], + [AC_LIBTOOL_GCJ], + [ifdef([AC_PROG_GCJ], + [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([A][M_PROG_GCJ], + [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) + ifdef([LT_AC_PROG_GCJ], + [define([LT_AC_PROG_GCJ], + defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) +])])# AC_PROG_LIBTOOL + + +# _AC_PROG_LIBTOOL +# ---------------- +AC_DEFUN([_AC_PROG_LIBTOOL], [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl +AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl +AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl +AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" @@ -26,10 +78,13 @@ # Prevent multiple expansion define([AC_PROG_LIBTOOL], []) -]) +])# _AC_PROG_LIBTOOL + +# AC_LIBTOOL_SETUP +# ---------------- AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.13)dnl +[AC_PREREQ(2.50)dnl AC_REQUIRE([AC_ENABLE_SHARED])dnl AC_REQUIRE([AC_ENABLE_STATIC])dnl AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl @@ -39,340 +94,232 @@ AC_REQUIRE([AC_PROG_LD])dnl AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl AC_REQUIRE([AC_PROG_NM])dnl + AC_REQUIRE([AC_PROG_LN_S])dnl AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! AC_REQUIRE([AC_OBJEXT])dnl AC_REQUIRE([AC_EXEEXT])dnl dnl +AC_LIBTOOL_SYS_MAX_CMD_LEN +AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +AC_LIBTOOL_OBJDIR + +AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl _LT_AC_PROG_ECHO_BACKSLASH -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES fi ;; esac -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] -ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -enable_win32_dll=yes, enable_win32_dll=no) +# Same as above, but do not quote variable references. +[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] -AC_ARG_ENABLE(libtool-lock, - [ --disable-libtool-lock avoid locking (might break parallel builds)]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' -# Some flags need to be propagated to the compiler or linker for good -# libtool support. -case $host in -*-*-irix6*) - # Find out which ABI we are using. - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - rm -rf conftest* - ;; +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_SAVE - AC_LANG_C - AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_RESTORE]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; +# Constants: +rm="rm -f" -ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) +# Global variables: +default_ofile=libtool +can_build_shared=yes - # recent cygwin and mingw systems supply a stub DllMain which the user - # can override, but on older systems we have to supply one - AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain, - [AC_TRY_LINK([], - [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*); - DllMain (0, 0, 0);], - [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])]) +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" - case $host/$CC in - *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*) - # old mingw systems require "-dll" to link a DLL, while more recent ones - # require "-mdll" - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -mdll" - AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch, - [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])]) - CFLAGS="$SAVE_CFLAGS" ;; - *-*-cygwin* | *-*-pw32*) - # cygwin systems need to pass --dll to the linker, and not link - # crt.o which will require a WinMain at 16 definition. - lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;; - esac - ;; - ]) -esac +AC_CHECK_TOOL(AR, ar, false) +AC_CHECK_TOOL(RANLIB, ranlib, :) +AC_CHECK_TOOL(STRIP, strip, :) -_LT_AC_LTCONFIG_HACK +old_CC="$CC" +old_CFLAGS="$CFLAGS" -]) +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o -# AC_LIBTOOL_HEADER_ASSERT -# ------------------------ -AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT], -[AC_CACHE_CHECK([whether $CC supports assert without backlinking], - [lt_cv_func_assert_works], - [case $host in - *-*-solaris*) - if test "$GCC" = yes && test "$with_gnu_ld" != yes; then - case `$CC --version 2>/dev/null` in - [[12]].*) lt_cv_func_assert_works=no ;; - *) lt_cv_func_assert_works=yes ;; - esac - fi - ;; - esac]) +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= -if test "x$lt_cv_func_assert_works" = xyes; then - AC_CHECK_HEADERS(assert.h) +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi -])# AC_LIBTOOL_HEADER_ASSERT -# _LT_AC_CHECK_DLFCN -# -------------------- -AC_DEFUN([_LT_AC_CHECK_DLFCN], -[AC_CHECK_HEADERS(dlfcn.h) -])# _LT_AC_CHECK_DLFCN +_LT_CC_BASENAME([$compiler]) -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -[AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_NM]) -AC_REQUIRE([AC_OBJEXT]) -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [dnl +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + AC_PATH_MAGIC + fi + ;; +esac -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] +AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +enable_win32_dll=yes, enable_win32_dll=no) -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' +AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' +AC_ARG_WITH([pic], + [AC_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) +test -z "$pic_mode" && pic_mode=default -# Transform the above into a raw symbol and a C symbol. -symxfrm='\1 \2\3 \3' +# Use C for the default configuration in the libtool script +tagname= +AC_LIBTOOL_LANG_C_CONFIG +_LT_AC_TAGCONFIG +])# AC_LIBTOOL_SETUP -# Transform an extracted symbol line into a proper C declaration -lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" +# _LT_AC_SYS_COMPILER +# ------------------- +AC_DEFUN([_LT_AC_SYS_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) # Its linker distinguishes data from code symbols - lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -irix*) - symcode='[[BCDEGRST]]' - ;; -solaris* | sysv5*) - symcode='[[BDT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} -# Handle CRLF in mingw tool chain -opt_cr= -case $host_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} -# If we're using GNU nm, then use its standard symbol codes. -if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then - symcode='[[ABCDGISTW]]' -fi +# Allow CC to be a program name with arguments. +compiler=$CC +])# _LT_AC_SYS_COMPILER -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - # Write the raw and C identifiers. -lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'" +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +AC_DEFUN([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) - # Check to see that the pipe works correctly. - pipe_works=no - rm -f conftest* - cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +AC_DEFUN([_LT_COMPILER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_COMPILER_BOILERPLATE - # Make sure that we snagged all the symbols we need. - if egrep ' nm_test_var$' "$nlist" >/dev/null; then - if egrep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif -EOF - # Now generate the symbol file. - eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext' +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +AC_DEFUN([_LT_LINKER_BOILERPLATE], +[ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* +])# _LT_LINKER_BOILERPLATE - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr void * -#else -# define lt_ptr char * -# define const -#endif -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr address; -} -lt_preloaded_symbols[[]] = -{ -EOF - sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr) 0} -}; +# _LT_AC_SYS_LIBPATH_AIX +# ---------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], +[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_AC_SYS_LIBPATH_AIX -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$no_builtin_flag" - if AC_TRY_EVAL(ac_link) && test -s conftest; then - pipe_works=yes - fi - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&AC_FD_CC - fi - else - echo "cannot find nm_test_var in $nlist" >&AC_FD_CC - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC - fi - else - echo "$progname: failed program was:" >&AC_FD_CC - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -global_symbol_pipe="$lt_cv_sys_global_symbol_pipe" -if test -z "$lt_cv_sys_global_symbol_pipe"; then - global_symbol_to_cdecl= - global_symbol_to_c_name_address= -else - global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl" - global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address" -fi -if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address"; -then - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +# _LT_AC_SHELL_INIT(ARG) +# ---------------------- +AC_DEFUN([_LT_AC_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_AC_SHELL_INIT -# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR -# --------------------------------- -AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR], -[# Find the correct PATH separator. Usually this is `:', but -# DJGPP uses `;' like DOS. -if test "X${PATH_SEPARATOR+set}" != Xset; then - UNAME=${UNAME-`uname 2>/dev/null`} - case X$UNAME in - *-DOS) lt_cv_sys_path_separator=';' ;; - *) lt_cv_sys_path_separator=':' ;; - esac - PATH_SEPARATOR=$lt_cv_sys_path_separator -fi -])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR # _LT_AC_PROG_ECHO_BACKSLASH # -------------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR - +[_LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} @@ -390,7 +337,7 @@ elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then # Yippee, $echo works! : else @@ -402,22 +349,22 @@ # used as fallback echo shift cat </dev/null 2>&1 && unset CDPATH if test -z "$ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string="`eval $cmd`") 2>/dev/null && - echo_test_string="`eval $cmd`" && + if (echo_test_string=`eval $cmd`) 2>/dev/null && + echo_test_string=`eval $cmd` && (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null then break @@ -436,8 +383,9 @@ # # So, first we look for a working echo in the user's PATH. - IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && @@ -446,7 +394,7 @@ break fi done - IFS="$save_ifs" + IFS="$lt_save_ifs" if test "X$echo" = Xecho; then # We didn't find a better echo, so look for alternatives. @@ -519,17 +467,365 @@ fi AC_SUBST(ECHO) -AC_DIVERT_POP -])# _LT_AC_PROG_ECHO_BACKSLASH +])])# _LT_AC_PROG_ECHO_BACKSLASH + +# _LT_AC_LOCK +# ----------- +AC_DEFUN([_LT_AC_LOCK], +[AC_ARG_ENABLE([libtool-lock], + [AC_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case $host in +ia64-*-hpux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *ELF-32*) + HPUX_IA64_MODE="32" + ;; + *ELF-64*) + HPUX_IA64_MODE="64" + ;; + esac + fi + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; + +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; + +AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; + ]) +esac + +need_locks="$enable_libtool_lock" + +])# _LT_AC_LOCK + + +# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], +[AC_REQUIRE([LT_AC_PROG_SED]) +AC_CACHE_CHECK([$1], [$2], + [$2=no + ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$3" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $rm conftest* +]) + +if test x"[$]$2" = xyes; then + ifelse([$5], , :, [$5]) +else + ifelse([$6], , :, [$6]) +fi +])# AC_LIBTOOL_COMPILER_OPTION + + +# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ------------------------------------------------------------ +# Check whether the given compiler option works +AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], +[AC_CACHE_CHECK([$1], [$2], + [$2=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $3" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&AS_MESSAGE_LOG_FD + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + else + $2=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" +]) + +if test x"[$]$2" = xyes; then + ifelse([$4], , :, [$4]) +else + ifelse([$5], , :, [$5]) +fi +])# AC_LIBTOOL_LINKER_OPTION + + +# AC_LIBTOOL_SYS_MAX_CMD_LEN +# -------------------------- +AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], +[# find the maximum length of command line arguments +AC_MSG_CHECKING([the maximum length of command line arguments]) +AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl + i=0 + teststring="ABCD" + + case $build_os in + msdosdjgpp*) + # On DJGPP, this test can blow up pretty badly due to problems in libc + # (any single argument exceeding 2000 bytes causes a buffer overrun + # during glob expansion). Even if it were fixed, the result of this + # check would be larger than it should be. + lt_cv_sys_max_cmd_len=12288; # 12K is about right + ;; + + gnu*) + # Under GNU Hurd, this test is not required because there is + # no limit to the length of command line arguments. + # Libtool will interpret -1 as no limit whatsoever + lt_cv_sys_max_cmd_len=-1; + ;; + + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac +]) +if test -n $lt_cv_sys_max_cmd_len ; then + AC_MSG_RESULT($lt_cv_sys_max_cmd_len) +else + AC_MSG_RESULT(none) +fi +])# AC_LIBTOOL_SYS_MAX_CMD_LEN + + +# _LT_AC_CHECK_DLFCN +# ------------------ +AC_DEFUN([_LT_AC_CHECK_DLFCN], +[AC_CHECK_HEADERS(dlfcn.h)dnl +])# _LT_AC_CHECK_DLFCN + + # _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# ------------------------------------------------------------------ +# --------------------------------------------------------------------- AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], -[if test "$cross_compiling" = yes; then : +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "$cross_compiling" = yes; then : [$4] else - AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext </dev/null; then - (./conftest; exit; ) 2>/dev/null + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; - x$lt_unknown|x*) $3 ;; + x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed @@ -610,10 +908,12 @@ rm -fr conftest* ])# _LT_AC_TRY_DLOPEN_SELF + # AC_LIBTOOL_DLOPEN_SELF -# ------------------- +# ---------------------- AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], -[if test "x$enable_dlopen" != xyes; then +[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl +if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown @@ -628,24 +928,39 @@ lt_cv_dlopen_self=yes ;; - cygwin* | mingw* | pw32*) + mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; + + darwin*) + # if libdl is installed we need to link against it + AC_CHECK_LIB([dl], [dlopen], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ]) + ;; + *) AC_CHECK_FUNC([shl_load], - [lt_cv_dlopen="shl_load"], + [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], - [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], + [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], - [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], + [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], - [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) + [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"]) ]) ]) ]) @@ -663,11 +978,10 @@ case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" - AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" - eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" @@ -680,7 +994,7 @@ ]) if test "x$lt_cv_dlopen_self" = xyes; then - LDFLAGS="$LDFLAGS $link_static_flag" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_AC_TRY_DLOPEN_SELF( @@ -707,404 +1021,66 @@ fi ])# AC_LIBTOOL_DLOPEN_SELF -AC_DEFUN([_LT_AC_LTCONFIG_HACK], -[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e s/^X//' -sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g' -# Same as above, but do not quote variable references. -double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g' +# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) +# --------------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler +AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], +[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except M$VC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" -need_locks="$enable_libtool_lock" - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -if test x"$host" != x"$build"; then - ac_tool_prefix=${host_alias}- -else - ac_tool_prefix= -fi - -# Transform linux* to *-*-linux-gnu*, to support old configure scripts. -case $host_os in -linux-gnu*) ;; -linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` -esac - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds" - ;; - *) - old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -# Allow CC to be a program name with arguments. -set dummy $CC -compiler="[$]2" - -AC_MSG_CHECKING([for objdir]) -rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - objdir=_libs -fi -rmdir .libs 2>/dev/null -AC_MSG_RESULT($objdir) - - -AC_ARG_WITH(pic, -[ --with-pic try to use only PIC/non-PIC objects [default=use both]], -pic_mode="$withval", pic_mode=default) -test -z "$pic_mode" && pic_mode=default - -# We assume here that the value for lt_cv_prog_cc_pic will not be cached -# in isolation, and that seeing it set (from the cache) indicates that -# the associated values are set (in the cache) correctly too. -AC_MSG_CHECKING([for $compiler option to produce PIC]) -AC_CACHE_VAL(lt_cv_prog_cc_pic, -[ lt_cv_prog_cc_pic= - lt_cv_prog_cc_shlib= - lt_cv_prog_cc_wl= - lt_cv_prog_cc_static= - lt_cv_prog_cc_no_builtin= - lt_cv_prog_cc_can_build_shared=$can_build_shared - - if test "$GCC" = yes; then - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static='-static' - - case $host_os in - aix*) - # Below there is a dirty hack to force normal static linking with -ldl - # The problem is because libdl dynamically linked with both libc and - # libC (AIX C++ library), which obviously doesn't included in libraries - # list by gcc. This cause undefined symbols with -static flags. - # This hack allows C programs to be linked with "-static -ldl", but - # not sure about C++ programs. - lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC" - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | irix5* | irix6* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_cv_prog_cc_pic='-fno-common' - ;; - cygwin* | mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_cv_prog_cc_pic='-DDLL_EXPORT' - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_cv_prog_cc_pic=-Kconform_pic - fi - ;; - *) - lt_cv_prog_cc_pic='-fPIC' - ;; - esac - else - # PORTME Check for PIC flags for the system compiler. - case $host_os in - aix3* | aix4* | aix5*) - lt_cv_prog_cc_wl='-Wl,' - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_cv_prog_cc_static='-Bstatic' - else - lt_cv_prog_cc_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - - hpux9* | hpux10* | hpux11*) - # Is there a better lt_cv_prog_cc_static that works with the bundled CC? - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive" - lt_cv_prog_cc_pic='+Z' - ;; - - irix5* | irix6*) - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static='-non_shared' - # PIC (with -KPIC) is the default. - ;; - - cygwin* | mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_cv_prog_cc_pic='-DDLL_EXPORT' - ;; - - newsos6) - lt_cv_prog_cc_pic='-KPIC' - lt_cv_prog_cc_static='-Bstatic' - ;; - - osf3* | osf4* | osf5*) - # All OSF/1 code is PIC. - lt_cv_prog_cc_wl='-Wl,' - lt_cv_prog_cc_static='-non_shared' - ;; - - sco3.2v5*) - lt_cv_prog_cc_pic='-Kpic' - lt_cv_prog_cc_static='-dn' - lt_cv_prog_cc_shlib='-belf' - ;; - - solaris*) - lt_cv_prog_cc_pic='-KPIC' - lt_cv_prog_cc_static='-Bstatic' - lt_cv_prog_cc_wl='-Wl,' - ;; - - sunos4*) - lt_cv_prog_cc_pic='-PIC' - lt_cv_prog_cc_static='-Bstatic' - lt_cv_prog_cc_wl='-Qoption ld ' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) - lt_cv_prog_cc_pic='-KPIC' - lt_cv_prog_cc_static='-Bstatic' - if test "x$host_vendor" = xsni; then - lt_cv_prog_cc_wl='-LD' - else - lt_cv_prog_cc_wl='-Wl,' - fi - ;; - - uts4*) - lt_cv_prog_cc_pic='-pic' - lt_cv_prog_cc_static='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_cv_prog_cc_pic='-Kconform_pic' - lt_cv_prog_cc_static='-Bstatic' - fi - ;; - - *) - lt_cv_prog_cc_can_build_shared=no - ;; - esac - fi + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* ]) -if test -z "$lt_cv_prog_cc_pic"; then - AC_MSG_RESULT([none]) -else - AC_MSG_RESULT([$lt_cv_prog_cc_pic]) +])# AC_LIBTOOL_PROG_CC_C_O - # Check to make sure the pic_flag actually works. - AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works]) - AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC" - AC_TRY_COMPILE([], [], [dnl - case $host_os in - hpux9* | hpux10* | hpux11*) - # On HP-UX, both CC and GCC only warn that PIC is supported... then - # they create non-PIC objects. So, if there were any warnings, we - # assume that PIC is not supported. - if test -s conftest.err; then - lt_cv_prog_cc_pic_works=no - else - lt_cv_prog_cc_pic_works=yes - fi - ;; - *) - lt_cv_prog_cc_pic_works=yes - ;; - esac - ], [dnl - lt_cv_prog_cc_pic_works=no - ]) - CFLAGS="$save_CFLAGS" - ]) - if test "X$lt_cv_prog_cc_pic_works" = Xno; then - lt_cv_prog_cc_pic= - lt_cv_prog_cc_can_build_shared=no - else - lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic" - fi +# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) +# ----------------------------------------- +# Check to see if we can do hard links to lock some files if needed +AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], +[AC_REQUIRE([_LT_AC_LOCK])dnl - AC_MSG_RESULT([$lt_cv_prog_cc_pic_works]) -fi - -# Check for any special shared library compilation flags. -if test -n "$lt_cv_prog_cc_shlib"; then - AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries]) - if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$lt_cv_prog_cc_shlib[[ ]]" >/dev/null; then : - else - AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure]) - lt_cv_prog_cc_can_build_shared=no - fi -fi - -AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works]) -AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl - lt_cv_prog_cc_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static" - AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes]) - LDFLAGS="$save_LDFLAGS" -]) - -# Belt *and* braces to stop my trousers falling down: -test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static= -AC_MSG_RESULT([$lt_cv_prog_cc_static_works]) - -pic_flag="$lt_cv_prog_cc_pic" -special_shlib_compile_flags="$lt_cv_prog_cc_shlib" -wl="$lt_cv_prog_cc_wl" -link_static_flag="$lt_cv_prog_cc_static" -no_builtin_flag="$lt_cv_prog_cc_no_builtin" -can_build_shared="$lt_cv_prog_cc_can_build_shared" - - -# Check to see if options -o and -c are simultaneously supported by compiler -AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext]) -AC_CACHE_VAL([lt_cv_compiler_c_o], [ -$rm -r conftest 2>/dev/null -mkdir conftest -cd conftest -echo "int some_variable = 0;" > conftest.$ac_ext -mkdir out -# According to Tom Tromey, Ian Lance Taylor reported there are C compilers -# that will create temporary files in the current directory regardless of -# the output directory. Thus, making CWD read-only will cause this test -# to fail, enabling locking or at least warning the user not to do parallel -# builds. -chmod -w . -save_CFLAGS="$CFLAGS" -CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" -compiler_c_o=no -if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s out/conftest.err; then - lt_cv_compiler_c_o=no - else - lt_cv_compiler_c_o=yes - fi -else - # Append any errors to the config.log. - cat out/conftest.err 1>&AC_FD_CC - lt_cv_compiler_c_o=no -fi -CFLAGS="$save_CFLAGS" -chmod u+w . -$rm conftest* out/* -rmdir out -cd .. -rmdir conftest -$rm -r conftest 2>/dev/null -]) -compiler_c_o=$lt_cv_compiler_c_o -AC_MSG_RESULT([$compiler_c_o]) - -if test x"$compiler_c_o" = x"yes"; then - # Check to see if we can write to a .lo - AC_MSG_CHECKING([if $compiler supports -c -o file.lo]) - AC_CACHE_VAL([lt_cv_compiler_o_lo], [ - lt_cv_compiler_o_lo=no - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -c -o conftest.lo" - save_objext="$ac_objext" - ac_objext=lo - AC_TRY_COMPILE([], [int some_variable = 0;], [dnl - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - lt_cv_compiler_o_lo=no - else - lt_cv_compiler_o_lo=yes - fi - ]) - ac_objext="$save_objext" - CFLAGS="$save_CFLAGS" - ]) - compiler_o_lo=$lt_cv_compiler_o_lo - AC_MSG_RESULT([$compiler_o_lo]) -else - compiler_o_lo=no -fi - -# Check to see if we can do hard links to lock some files if needed hard_links="nottested" -if test "$compiler_c_o" = no && test "$need_locks" != no; then +if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes @@ -1115,749 +1091,77 @@ ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then - AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe]) + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi +])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS -if test "$GCC" = yes; then - # Check to see if options -fno-rtti -fno-exceptions are supported by compiler - AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions]) - echo "int some_variable = 0;" > conftest.$ac_ext - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext" - compiler_rtti_exceptions=no - AC_TRY_COMPILE([], [int some_variable = 0;], [dnl - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - compiler_rtti_exceptions=no - else - compiler_rtti_exceptions=yes - fi - ]) - CFLAGS="$save_CFLAGS" - AC_MSG_RESULT([$compiler_rtti_exceptions]) - if test "$compiler_rtti_exceptions" = "yes"; then - no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' - else - no_builtin_flag=' -fno-builtin' - fi +# AC_LIBTOOL_OBJDIR +# ----------------- +AC_DEFUN([AC_LIBTOOL_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + lt_cv_objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + lt_cv_objdir=_libs fi +rmdir .libs 2>/dev/null]) +objdir=$lt_cv_objdir +])# AC_LIBTOOL_OBJDIR -# See if the linker supports building shared libraries. -AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries]) -allow_undefined_flag= -no_undefined_flag= -need_lib_prefix=unknown -need_version=unknown -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -archive_cmds= -archive_expsym_cmds= -old_archive_from_new_cmds= -old_archive_from_expsyms_cmds= -export_dynamic_flag_spec= -whole_archive_flag_spec= -thread_safe_flag_spec= -hardcode_into_libs=no -hardcode_libdir_flag_spec= -hardcode_libdir_separator= -hardcode_direct=no -hardcode_minus_L=no -hardcode_shlibpath_var=unsupported -runpath_var= -link_all_deplibs=unknown -always_export_symbols=no -export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' -# include_expsyms should be a list of space-separated symbols to be *always* -# included in the symbol list -include_expsyms= -# exclude_expsyms can be an egrep regular expression of symbols to exclude -# it will be wrapped by ` (' and `)$', so one must not match beginning or -# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', -# as well as any symbol that contains `d'. -exclude_expsyms="_GLOBAL_OFFSET_TABLE_" -# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out -# platforms (ab)use it in PIC code, but their linkers get confused if -# the symbol is explicitly referenced. Since portable code cannot -# rely on this symbol name, it's probably fine to never include it in -# preloaded symbol tables. -extract_expsyms_cmds= - -case $host_os in -cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; -openbsd*) - with_gnu_ld=no - ;; -esac - -ld_shlibs=yes -if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX, the GNU linker is very broken - # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available. - ld_shlibs=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - ;; - - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can use - # them. - ld_shlibs=no - ;; - - beos*) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - - cygwin* | mingw* | pw32*) - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - allow_undefined_flag=unsupported - always_export_symbols=yes - - extract_expsyms_cmds='test -f $output_objdir/impgen.c || \ - sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~ - test -f $output_objdir/impgen.exe || (cd $output_objdir && \ - if test "x$HOST_CC" != "x" ; then $HOST_CC -o impgen impgen.c ; \ - else $CC -o impgen impgen.c ; fi)~ - $output_objdir/impgen $dir/$soroot > $output_objdir/$soname-def' - - old_archive_from_expsyms_cmds='$DLLTOOL --as=$AS --dllname $soname --def $output_objdir/$soname-def --output-lib $output_objdir/$newlib' - - # cygwin and mingw dlls have different entry points and sets of symbols - # to exclude. - # FIXME: what about values for MSVC? - dll_entry=__cygwin_dll_entry at 12 - dll_exclude_symbols=DllMain at 12,_cygwin_dll_entry at 12,_cygwin_noncygwin_dll_entry at 12~ - case $host_os in - mingw*) - # mingw values - dll_entry=_DllMainCRTStartup at 12 - dll_exclude_symbols=DllMain at 12,DllMainCRTStartup at 12,DllEntryPoint at 12~ - ;; - esac - - # mingw and cygwin differ, and it's simplest to just exclude the union - # of the two symbol sets. - dll_exclude_symbols=DllMain at 12,_cygwin_dll_entry at 12,_cygwin_noncygwin_dll_entry at 12,DllMainCRTStartup at 12,DllEntryPoint at 12 - - # recent cygwin and mingw systems supply a stub DllMain which the user - # can override, but on older systems we have to supply one (in ltdll.c) - if test "x$lt_cv_need_dllmain" = "xyes"; then - ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext " - ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~ - test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~' - else - ltdll_obj= - ltdll_cmds= - fi - - # Extract the symbol export list from an `--export-all' def file, - # then regenerate the def file from the symbol export list, so that - # the compiled dll only exports the symbol export list. - # Be careful not to strip the DATA tag left be newer dlltools. - export_symbols_cmds="$ltdll_cmds"' - $DLLTOOL --export-all --exclude-symbols '$dll_exclude_symbols' --output-def $output_objdir/$soname-def '$ltdll_obj'$libobjs $convenience~ - sed -e "1,/EXPORTS/d" -e "s/ @ [[0-9]]*//" -e "s/ *;.*$//" < $output_objdir/$soname-def > $export_symbols' - - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is. - # If DATA tags from a recent dlltool are present, honour them! - archive_expsym_cmds='if test "x`head -1 $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname-def; - else - echo EXPORTS > $output_objdir/$soname-def; - _lt_hint=1; - cat $export_symbols | while read symbol; do - set dummy \$symbol; - case \[$]# in - 2) echo " \[$]2 @ \$_lt_hint ; " >> $output_objdir/$soname-def;; - *) echo " \[$]2 @ \$_lt_hint \[$]3 ; " >> $output_objdir/$soname-def;; - esac; - _lt_hint=`expr 1 + \$_lt_hint`; - done; - fi~ - '"$ltdll_cmds"' - $CC -Wl,--base-file,$output_objdir/$soname-base '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp~ - $CC -Wl,--base-file,$output_objdir/$soname-base $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags~ - $DLLTOOL --as=$AS --dllname $soname --exclude-symbols '$dll_exclude_symbols' --def $output_objdir/$soname-def --base-file $output_objdir/$soname-base --output-exp $output_objdir/$soname-exp --output-lib $output_objdir/$libname.dll.a~ - $CC $output_objdir/$soname-exp '$lt_cv_cc_dll_switch' -Wl,-e,'$dll_entry' -o $output_objdir/$soname '$ltdll_obj'$libobjs $deplibs $compiler_flags' - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared -nodefaultlibs $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris* | sysv5*) - if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = yes; then - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - case $host_os in - cygwin* | mingw* | pw32*) - # dlltool doesn't understand --whole-archive et. al. - whole_archive_flag_spec= - ;; - *) - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - ;; - esac - fi -else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$link_static_flag"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - hardcode_direct=yes - archive_cmds='' - hardcode_libdir_separator=':' - if test "$GCC" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - esac - - shared_flag='-shared' - else - # not using gcc - if test "$host_cpu" = ia64; then - shared_flag='${wl}-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall can do strange things, so it is better to - # generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib' - archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols" - else - hardcode_libdir_flag_spec='${wl}-bnolibpath ${wl}-blibpath:$libdir:/usr/lib:/lib' - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='${wl}-berok' - # This is a bit strange, but is similar to how AIX traditionally builds - # it's shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $objdir/$soname' - fi - fi - ;; - - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_from_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - ;; - - darwin* | rhapsody*) - case "$host_os" in - rhapsody* | darwin1.[[012]]) - allow_undefined_flag='-undefined suppress' - ;; - *) # Darwin 1.3 on - allow_undefined_flag='-flat_namespace -undefined suppress' - ;; - esac - # FIXME: Relying on posixy $() will cause problems for - # cross-compilation, but unfortunately the echo tests do not - # yet detect zsh echo's removal of \ escapes. - archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring' - # We need to add '_' to the symbols in $export_symbols first - #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' - hardcode_direct=yes - hardcode_shlibpath_var=no - whole_archive_flag_spec='-all_load $convenience' - ;; - - freebsd1*) - ld_shlibs=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9* | hpux10* | hpux11*) - case $host_os in - hpux9*) archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' ;; - *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' ;; - esac - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - hardcode_minus_L=yes # Not in the search PATH, but as the default - # location of the library. - export_dynamic_flag_spec='${wl}-E' - ;; - - irix5* | irix6*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - link_all_deplibs=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - - openbsd*) - hardcode_direct=yes - hardcode_shlibpath_var=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case "$host_os" in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "-exported_symbol " >> $lib.exp; echo "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib~$rm $lib.exp' - - #Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - hardcode_libdir_separator=: - ;; - - sco3.2v5*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - export_dynamic_flag_spec='${wl}-Bexport' - ;; - - solaris*) - # gcc --version < 3.0 without binutils cannot create self contained - # shared libraries reliably, requiring libgcc.a to resolve some of - # the object symbols generated in some cases. Libraries that use - # assert need libgcc.a to resolve __eprintf, for example. Linking - # a copy of libgcc.a into every shared library to guarantee resolving - # such symbols causes other problems: According to Tim Van Holder - # , C++ libraries end up with a separate - # (to the application) exception stack for one thing. - no_undefined_flag=' -z defs' - if test "$GCC" = yes; then - case `$CC --version 2>/dev/null` in - [[12]].*) - cat <&2 - -*** Warning: Releases of GCC earlier than version 3.0 cannot reliably -*** create self contained shared libraries on Solaris systems, without -*** introducing a dependency on libgcc.a. Therefore, libtool is disabling -*** -no-undefined support, which will at least allow you to build shared -*** libraries. However, you may find that when you link such libraries -*** into an application without using GCC, you have to manually add -*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to -*** upgrade to a newer version of GCC. Another option is to rebuild your -*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer. - -EOF - no_undefined_flag= - ;; - esac - fi - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - if test "x$host_vendor" = xsno; then - archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - else - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; - - sysv5*) - no_undefined_flag=' -z text' - # $CC -shared without GNU ld will not create a library from C++ - # object files and a static libstdc++, better avoid it by now - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - hardcode_libdir_flag_spec= - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - ;; - - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs=yes - fi - ;; - - sysv4.2uw2*) - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=no - hardcode_shlibpath_var=no - hardcode_runpath_var=yes - runpath_var=LD_RUN_PATH - ;; - - sysv5uw7* | unixware7*) - no_undefined_flag='${wl}-z ${wl}text' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - *) - ld_shlibs=no - ;; - esac -fi -AC_MSG_RESULT([$ld_shlibs]) -test "$ld_shlibs" = no && can_build_shared=no - +# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) +# ---------------------------------------------- # Check hardcoding attributes. -AC_MSG_CHECKING([how to hardcode library paths into programs]) -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var"; then +AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_AC_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ + test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ + test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existant directories. - if test "$hardcode_direct" != no && + if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one - ## test "$hardcode_shlibpath_var" != no && - test "$hardcode_minus_L" != no; then + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && + test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. - hardcode_action=relink + _LT_AC_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate + _LT_AC_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. - hardcode_action=unsupported + _LT_AC_TAGVAR(hardcode_action, $1)=unsupported fi -AC_MSG_RESULT([$hardcode_action]) +AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) -striplib= +if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi +])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH + + +# AC_LIBTOOL_SYS_LIB_STRIP +# ------------------------ +AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], +[striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then @@ -1865,17 +1169,33 @@ test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + AC_MSG_RESULT([yes]) + else AC_MSG_RESULT([no]) fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +])# AC_LIBTOOL_SYS_LIB_STRIP -reload_cmds='$LD$reload_flag -o $output$reload_objs' -test -z "$deplibs_check_method" && deplibs_check_method=unknown +# AC_LIBTOOL_SYS_DYNAMIC_LINKER +# ----------------------------- # PORTME Fill in your ld.so characteristics -AC_MSG_CHECKING([dynamic linker characteristics]) +AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], +[AC_MSG_CHECKING([dynamic linker characteristics]) library_names_spec= libname_spec='lib$name' soname_spec= +shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= @@ -1885,23 +1205,45 @@ version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" -sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + case $host_os in aix3*) version_type=linux - library_names_spec='${libname}${release}.so$versuffix $libname.a' + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH - # AIX has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}.so$major' + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' ;; aix4* | aix5*) version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 - library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so' + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file @@ -1911,29 +1253,28 @@ # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; esac - # AIX (on Power*) has no versioning support, so currently we can - # not hardcode correct soname into executable. Probably we can - # add versioning support to collect2, so additional links can - # be useful in future. + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}.so$major' + soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi @@ -1942,25 +1283,24 @@ amigaos*) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; beos*) - library_names_spec='${libname}.so' + library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; -bsdi4*) +bsdi[[45]]*) version_type=linux need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - export_dynamic_flag_spec=-rdynamic # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs @@ -1968,29 +1308,56 @@ cygwin* | mingw* | pw32*) version_type=windows + shrext_cmds=".dll" need_version=no need_lib_prefix=no + case $GCC,$host_os in - yes,cygwin*) + yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' - postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~ + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ - $install_prog .libs/$dlname \$dldir/$dlname' - postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac ;; - yes,mingw*) - library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | sed -e "s/^libraries://" -e "s/;/ /g"` - ;; - yes,pw32*) - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll' - ;; + *) - library_names_spec='${libname}`echo ${release} | sed -e 's/[[.]]/-/g'`${versuffix}.dll $libname.lib' + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' @@ -2003,30 +1370,53 @@ version_type=darwin need_lib_prefix=no need_version=no - # FIXME: Relying on posixy $() will cause problems for - # cross-compilation, but unfortunately the echo tests do not - # yet detect zsh echo's removal of \ escapes. - library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)' - soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)' + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + freebsd1*) dynamic_linker=no ;; -freebsd*) - objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) - library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac @@ -2035,10 +1425,19 @@ freebsd2*) shlibpath_overrides_runpath=yes ;; - *) + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; esac ;; @@ -2046,8 +1445,8 @@ version_type=linux need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' - soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; @@ -2055,33 +1454,87 @@ hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. - dynamic_linker="$host_os dld.sl" version_type=sunos need_lib_prefix=no need_version=no - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' - soname_spec='${libname}${release}.sl$major' + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; -irix5* | irix6*) - version_type=irix +interix3*) + version_type=linux need_lib_prefix=no need_version=no - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so $libname.so' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) case $host_os in - irix5*) + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; @@ -2090,20 +1543,21 @@ shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. -linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) +linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. -linux-gnu*) +linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no @@ -2112,6 +1566,12 @@ # before this can be enabled. hardcode_into_libs=yes + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi + # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, @@ -2121,17 +1581,29 @@ dynamic_linker='GNU/Linux ld.so' ;; +netbsdelf*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='NetBSD ld.elf_so' + ;; + netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' - soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH @@ -2141,63 +1613,73 @@ newsos6) version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + openbsd*) version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no - need_version=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case "$host_os" in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac + case $host_os in + openbsd2.[[89]] | openbsd2.[[89]].*) + shlibpath_overrides_runpath=no + ;; + *) + shlibpath_overrides_runpath=yes + ;; + esac else shlibpath_overrides_runpath=yes fi - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH ;; os2*) libname_spec='$name' + shrext_cmds=".dll" need_lib_prefix=no - library_names_spec='$libname.dll $libname.a' + library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf + need_lib_prefix=no need_version=no - soname_spec='${libname}${release}.so' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; -sco3.2v5*) - version_type=osf - soname_spec='${libname}${release}.so$major' - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - shlibpath_var=LD_LIBRARY_PATH - ;; - solaris*) version_type=linux need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes @@ -2207,7 +1689,7 @@ sunos4*) version_type=sunos - library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes @@ -2217,15 +1699,21 @@ need_version=yes ;; -sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) +sysv4 | sysv4.3*) version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH ;; + siemens) + need_lib_prefix=no + ;; motorola) need_lib_prefix=no need_version=no @@ -2235,29 +1723,43 @@ esac ;; -uts4*) - version_type=linux - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' - shlibpath_var=LD_LIBRARY_PATH +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi ;; -dgux*) - version_type=linux +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' - soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' ;; -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' - soname_spec='$libname.so.$major' - shlibpath_var=LD_LIBRARY_PATH - fi +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH ;; *) @@ -2267,7 +1769,913 @@ AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no -# Report the final consequences. +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi +])# AC_LIBTOOL_SYS_DYNAMIC_LINKER + + +# _LT_AC_TAGCONFIG +# ---------------- +AC_DEFUN([_LT_AC_TAGCONFIG], +[AC_ARG_WITH([tags], + [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], + [include additional configurations @<:@automatic@:>@])], + [tagnames="$withval"]) + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + AC_MSG_WARN([output file `$ofile' does not exist]) + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) + else + AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in + "") ;; + *) AC_MSG_ERROR([invalid tag name: $tagname]) + ;; + esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + AC_MSG_ERROR([tag name \"$tagname\" already exists]) + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_LIBTOOL_LANG_CXX_CONFIG + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + AC_LIBTOOL_LANG_F77_CONFIG + else + tagname="" + fi + ;; + + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + AC_LIBTOOL_LANG_GCJ_CONFIG + else + tagname="" + fi + ;; + + RC) + AC_LIBTOOL_LANG_RC_CONFIG + ;; + + *) + AC_MSG_ERROR([Unsupported tag name: $tagname]) + ;; + esac + + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" + + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + AC_MSG_ERROR([unable to update list of available tagged configurations.]) + fi +fi +])# _LT_AC_TAGCONFIG + + +# AC_LIBTOOL_DLOPEN +# ----------------- +# enable checks for dlopen support +AC_DEFUN([AC_LIBTOOL_DLOPEN], + [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_DLOPEN + + +# AC_LIBTOOL_WIN32_DLL +# -------------------- +# declare package support for building win32 DLLs +AC_DEFUN([AC_LIBTOOL_WIN32_DLL], +[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) +])# AC_LIBTOOL_WIN32_DLL + + +# AC_ENABLE_SHARED([DEFAULT]) +# --------------------------- +# implement the --enable-shared flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_SHARED], +[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([shared], + [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_shared=yes ;; + no) enable_shared=no ;; + *) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_shared=]AC_ENABLE_SHARED_DEFAULT) +])# AC_ENABLE_SHARED + + +# AC_DISABLE_SHARED +# ----------------- +# set the default shared flag to --disable-shared +AC_DEFUN([AC_DISABLE_SHARED], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no) +])# AC_DISABLE_SHARED + + +# AC_ENABLE_STATIC([DEFAULT]) +# --------------------------- +# implement the --enable-static flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_STATIC], +[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([static], + [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_static=yes ;; + no) enable_static=no ;; + *) + enable_static=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_static=]AC_ENABLE_STATIC_DEFAULT) +])# AC_ENABLE_STATIC + + +# AC_DISABLE_STATIC +# ----------------- +# set the default static flag to --disable-static +AC_DEFUN([AC_DISABLE_STATIC], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no) +])# AC_DISABLE_STATIC + + +# AC_ENABLE_FAST_INSTALL([DEFAULT]) +# --------------------------------- +# implement the --enable-fast-install flag +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +AC_DEFUN([AC_ENABLE_FAST_INSTALL], +[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE([fast-install], + [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [p=${PACKAGE-default} + case $enableval in + yes) enable_fast_install=yes ;; + no) enable_fast_install=no ;; + *) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for pkg in $enableval; do + IFS="$lt_save_ifs" + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$lt_save_ifs" + ;; + esac], + [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) +])# AC_ENABLE_FAST_INSTALL + + +# AC_DISABLE_FAST_INSTALL +# ----------------------- +# set the default to --disable-fast-install +AC_DEFUN([AC_DISABLE_FAST_INSTALL], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no) +])# AC_DISABLE_FAST_INSTALL + + +# AC_LIBTOOL_PICMODE([MODE]) +# -------------------------- +# implement the --with-pic flag +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +AC_DEFUN([AC_LIBTOOL_PICMODE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +pic_mode=ifelse($#,1,$1,default) +])# AC_LIBTOOL_PICMODE + + +# AC_PROG_EGREP +# ------------- +# This is predefined starting with Autoconf 2.54, so this conditional +# definition can be removed once we require Autoconf 2.54 or later. +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], +[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], + [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi]) + EGREP=$ac_cv_prog_egrep + AC_SUBST([EGREP]) +])]) + + +# AC_PATH_TOOL_PREFIX +# ------------------- +# find a file program which can recognise shared library +AC_DEFUN([AC_PATH_TOOL_PREFIX], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_MSG_CHECKING([for $1]) +AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, +[case $MAGIC_CMD in +[[\\/*] | ?:[\\/]*]) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR +dnl $ac_dummy forces splitting on constant user-supplied paths. +dnl POSIX.2 word splitting is done only on the output of word expansions, +dnl not every word. This closes a longstanding sh security hole. + ac_dummy="ifelse([$2], , $PATH, [$2])" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$1; then + lt_cv_path_MAGIC_CMD="$ac_dir/$1" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool at gnu.org + +EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac]) +MAGIC_CMD="$lt_cv_path_MAGIC_CMD" +if test -n "$MAGIC_CMD"; then + AC_MSG_RESULT($MAGIC_CMD) +else + AC_MSG_RESULT(no) +fi +])# AC_PATH_TOOL_PREFIX + + +# AC_PATH_MAGIC +# ------------- +# find a file program which can recognise a shared library +AC_DEFUN([AC_PATH_MAGIC], +[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# AC_PATH_MAGIC + + +# AC_PROG_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +AC_DEFUN([AC_PROG_LD], +[AC_ARG_WITH([gnu-ld], + [AC_HELP_STRING([--with-gnu-ld], + [assume the C compiler uses GNU ld @<:@default=no@:>@])], + [test "$withval" = no || with_gnu_ld=yes], + [with_gnu_ld=no]) +AC_REQUIRE([LT_AC_PROG_SED])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by $CC]) + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [[\\/]]* | ?:[[\\/]]*) + re_direlt='/[[^/]][[^/]]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(lt_cv_path_LD, +[if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac + else + lt_cv_deplibs_check_method=pass_all + fi + ;; + +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +interix3*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' + ;; + +irix5* | irix6* | nonstopux*) + case $LD in + *-32|*"-32 ") libmagic=32-bit;; + *-n32|*"-n32 ") libmagic=N32;; + *-64|*"-64 ") libmagic=64-bit;; + *) libmagic=never-match;; + esac + lt_cv_deplibs_check_method=pass_all + ;; + +# This must be Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd* | netbsdelf*-gnu) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; + +openbsd*) + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + fi + ;; + +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; + +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; + +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac +]) +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown +])# AC_DEPLIBS_CHECK_METHOD + + +# AC_PROG_NM +# ---------- +# find the pathname to a BSD-compatible name lister +AC_DEFUN([AC_PROG_NM], +[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" +else + lt_nm_to_check="${ac_tool_prefix}nm" + if test -n "$ac_tool_prefix" && test "$build" = "$host"; then + lt_nm_to_check="$lt_nm_to_check nm" + fi + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +fi]) +NM="$lt_cv_path_NM" +])# AC_PROG_NM + + +# AC_CHECK_LIBM +# ------------- +# check for math library +AC_DEFUN([AC_CHECK_LIBM], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) + # These system don't have libm, or don't need it + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, cos, LIBM="-lm") + ;; +esac +])# AC_CHECK_LIBM + + +# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl convenience library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-convenience to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# it is assumed to be `libltdl'. LIBLTDL will be prefixed with +# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' +# (note the single quotes!). If your package is not flat and you're not +# using automake, define top_builddir and top_srcdir appropriately in +# the Makefiles. +AC_DEFUN([AC_LIBLTDL_CONVENIENCE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case $enable_ltdl_convenience in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_CONVENIENCE + + +# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) +# ----------------------------------- +# sets LIBLTDL to the link flags for the libltdl installable library and +# LTDLINCL to the include flags for the libltdl header and adds +# --enable-ltdl-install to the configure arguments. Note that +# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, +# and an installed libltdl is not found, it is assumed to be `libltdl'. +# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and top_srcdir +# appropriately in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN([AC_LIBLTDL_INSTALLABLE], +[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, lt_dlinit, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + LTDLINCL= + fi + # For backwards non-gettext consistent compatibility... + INCLTDL="$LTDLINCL" +])# AC_LIBLTDL_INSTALLABLE + + +# AC_LIBTOOL_CXX +# -------------- +# enable support for C++ libraries +AC_DEFUN([AC_LIBTOOL_CXX], +[AC_REQUIRE([_LT_AC_LANG_CXX]) +])# AC_LIBTOOL_CXX + + +# _LT_AC_LANG_CXX +# --------------- +AC_DEFUN([_LT_AC_LANG_CXX], +[AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +])# _LT_AC_LANG_CXX + +# _LT_AC_PROG_CXXCPP +# ------------------ +AC_DEFUN([_LT_AC_PROG_CXXCPP], +[ +AC_REQUIRE([AC_PROG_CXX]) +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +fi +])# _LT_AC_PROG_CXXCPP + +# AC_LIBTOOL_F77 +# -------------- +# enable support for Fortran 77 libraries +AC_DEFUN([AC_LIBTOOL_F77], +[AC_REQUIRE([_LT_AC_LANG_F77]) +])# AC_LIBTOOL_F77 + + +# _LT_AC_LANG_F77 +# --------------- +AC_DEFUN([_LT_AC_LANG_F77], +[AC_REQUIRE([AC_PROG_F77]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +])# _LT_AC_LANG_F77 + + +# AC_LIBTOOL_GCJ +# -------------- +# enable support for GCJ libraries +AC_DEFUN([AC_LIBTOOL_GCJ], +[AC_REQUIRE([_LT_AC_LANG_GCJ]) +])# AC_LIBTOOL_GCJ + + +# _LT_AC_LANG_GCJ +# --------------- +AC_DEFUN([_LT_AC_LANG_GCJ], +[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], + [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], + [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], + [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], + [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) +])# _LT_AC_LANG_GCJ + + +# AC_LIBTOOL_RC +# ------------- +# enable support for Windows resource files +AC_DEFUN([AC_LIBTOOL_RC], +[AC_REQUIRE([LT_AC_PROG_RC]) +_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) +])# AC_LIBTOOL_RC + + +# AC_LIBTOOL_LANG_C_CONFIG +# ------------------------ +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) +AC_DEFUN([_LT_AC_LANG_C_CONFIG], +[lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) +AC_LIBTOOL_PROG_COMPILER_PIC($1) +AC_LIBTOOL_PROG_CC_C_O($1) +AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) +AC_LIBTOOL_PROG_LD_SHLIBS($1) +AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) +AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) +AC_LIBTOOL_SYS_LIB_STRIP +AC_LIBTOOL_DLOPEN_SELF + +# Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) @@ -2276,7 +2684,7 @@ # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. -case "$host_os" in +case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then @@ -2285,11 +2693,11 @@ fi ;; -aix4*) +aix4* | aix5*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi - ;; + ;; esac AC_MSG_RESULT([$enable_shared]) @@ -2298,111 +2706,1456 @@ test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) -if test "$hardcode_action" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless +AC_LIBTOOL_CONFIG($1) + +AC_LANG_POP +CC="$lt_save_CC" +])# AC_LIBTOOL_LANG_C_CONFIG + + +# AC_LIBTOOL_LANG_CXX_CONFIG +# -------------------------- +# Ensure that the configuration vars for the C compiler are +# suitably defined. Those variables are subsequently used by +# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. +AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) +AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], +[AC_LANG_PUSH(C++) +AC_REQUIRE([AC_PROG_CXX]) +AC_REQUIRE([_LT_AC_PROG_CXXCPP]) + +_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_AC_TAGVAR(allow_undefined_flag, $1)= +_LT_AC_TAGVAR(always_export_symbols, $1)=no +_LT_AC_TAGVAR(archive_expsym_cmds, $1)= +_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_direct, $1)=no +_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= +_LT_AC_TAGVAR(hardcode_minus_L, $1)=no +_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_AC_TAGVAR(hardcode_automatic, $1)=no +_LT_AC_TAGVAR(module_cmds, $1)= +_LT_AC_TAGVAR(module_expsym_cmds, $1)= +_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown +_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_AC_TAGVAR(no_undefined_flag, $1)= +_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= +_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Dependencies to place before and after the object being linked: +_LT_AC_TAGVAR(predep_objects, $1)= +_LT_AC_TAGVAR(postdep_objects, $1)= +_LT_AC_TAGVAR(predeps, $1)= +_LT_AC_TAGVAR(postdeps, $1)= +_LT_AC_TAGVAR(compiler_lib_search_path, $1)= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_AC_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_AC_SYS_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + $as_unset lt_cv_prog_gnu_ld fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + $as_unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +_LT_AC_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' +else + _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi -AC_LIBTOOL_DLOPEN_SELF +if test "$GXX" = yes; then + # Set up default GNU C++ configuration -if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. + AC_PROG_LD + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +_LT_AC_TAGVAR(ld_shlibs, $1)=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - AC_CACHE_VAL([lt_cv_archive_cmds_need_lc], - [$rm conftest* - echo 'static int dummy;' > conftest.$ac_ext + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no - if AC_TRY_EVAL(ac_compile); then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_cv_prog_cc_wl - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - lt_cv_archive_cmds_need_lc=no + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break + ;; + esac + done + ;; + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + _LT_AC_TAGVAR(archive_cmds, $1)='' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[[012]]|aix4.[[012]].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + else + # We have old collect2 + _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' else - lt_cv_archive_cmds_need_lc=yes + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi fi - allow_undefined_flag=$save_allow_undefined_flag + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_AC_TAGVAR(always_export_symbols, $1)=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + _LT_AC_SYS_LIBPATH_AIX + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else - cat conftest.err 1>&5 - fi]) - AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc]) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi ;; - esac + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_AC_TAGVAR(always_export_symbols, $1)=no + _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[[012]]) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_automatic, $1)=yes + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + freebsd-elf*) + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_AC_TAGVAR(ld_shlibs, $1)=yes + ;; + gnu*) + ;; + hpux9*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + ;; + *) + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_AC_TAGVAR(hardcode_direct, $1)=yes + _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_AC_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + interix3*) + _LT_AC_TAGVAR(hardcode_direct, $1)=no + _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + _LT_AC_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + linux* | k*bsd*-gnu) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC*) + # Portland Group C++ compiler + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib