From dmichelsen at users.sourceforge.net Sun Mar 1 11:31:47 2015 From: dmichelsen at users.sourceforge.net (dmichelsen at users.sourceforge.net) Date: Sun, 1 Mar 2015 10:31:47 +0000 Subject: SF.net SVN: gar:[24693] csw/mgar/pkg/wget/trunk Message-ID: <3kw1B600WJz1Bk@mail.opencsw.org> Revision: 24693 http://sourceforge.net/p/gar/code/24693 Author: dmichelsen Date: 2015-03-01 10:31:46 +0000 (Sun, 01 Mar 2015) Log Message: ----------- wget/trunk: Update to 1.16.2, add support for libpsl Modified Paths: -------------- csw/mgar/pkg/wget/trunk/Makefile csw/mgar/pkg/wget/trunk/checksums Added Paths: ----------- csw/mgar/pkg/wget/trunk/files/map.wget Modified: csw/mgar/pkg/wget/trunk/Makefile =================================================================== --- csw/mgar/pkg/wget/trunk/Makefile 2015-02-27 12:14:16 UTC (rev 24692) +++ csw/mgar/pkg/wget/trunk/Makefile 2015-03-01 10:31:46 UTC (rev 24693) @@ -4,7 +4,7 @@ # https://lists.gnu.org/archive/html/bug-wget/2011-09/msg00001.html NAME = wget -VERSION = 1.15 +VERSION = 1.16.2 DESCRIPTION = A network utility to retrieve files from the Web define BLURB @@ -18,15 +18,24 @@ endef MASTER_SITES = $(GNU_MIRROR) -MASTER_SITES += ftp://alpha.gnu.org/gnu/wget/ -DISTFILES = $(NAME)-$(VERSION).tar.xz +MASTER_SITES += ftp://ftp.gnu.org/gnu/wget/ +DISTFILES += $(DISTNAME).tar.xz +DISTFILES += map.wget +LINKER_MAPS ?= -M "$(abspath $(WORKDIR)/map.wget)" + VENDOR_URL = http://www.gnu.org/software/wget/ # We need wget for pkgutil downlaod and GAR PACKAGING_PLATFORMS += solaris9-sparc solaris9-i386 PACKAGING_PLATFORMS += solaris10-sparc solaris10-i386 +BUILD_DEP_PKGS += CSWlibz-dev +BUILD_DEP_PKGS += CSWlibidn-dev +BUILD_DEP_PKGS += CSWlibpcre-dev +BUILD_DEP_PKGS += CSWlibuuid-dev +BUILD_DEP_PKGS += CSWlibpsl-dev + PACKAGES += CSWwget SPKG_DESC_CSWwget = A network utility to retrieve files from the web RUNTIME_DEP_PKGS_CSWwget += CSWlibintl8 @@ -36,6 +45,7 @@ RUNTIME_DEP_PKGS_CSWwget += CSWlibidn11 RUNTIME_DEP_PKGS_CSWwget += CSWlibpcre1 RUNTIME_DEP_PKGS_CSWwget += CSWlibuuid1 +RUNTIME_DEP_PKGS_CSWwget += CSWlibpsl0 EXTRA_MODULATORS = STATIC MODULATIONS_STATIC = disable enable Modified: csw/mgar/pkg/wget/trunk/checksums =================================================================== --- csw/mgar/pkg/wget/trunk/checksums 2015-02-27 12:14:16 UTC (rev 24692) +++ csw/mgar/pkg/wget/trunk/checksums 2015-03-01 10:31:46 UTC (rev 24693) @@ -1 +1 @@ -7a279d5ac5594919124d5526e7143e28 wget-1.15.tar.xz +50b67a11971ecc6d142e634e8436fc0f wget-1.16.2.tar.xz Copied: csw/mgar/pkg/wget/trunk/files/map.wget (from rev 24362, csw/mgar/pkg/ghostscript/trunk/files/map.ghostscript) =================================================================== --- csw/mgar/pkg/wget/trunk/files/map.wget (rev 0) +++ csw/mgar/pkg/wget/trunk/files/map.wget 2015-03-01 10:31:46 UTC (rev 24693) @@ -0,0 +1 @@ +libc.so - SUNW_1.22.5 SUNWprivate_1.1 $ADDVERS=SUNW_1.22.5; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bdwalton at users.sourceforge.net Sun Mar 1 11:59:45 2015 From: bdwalton at users.sourceforge.net (bdwalton at users.sourceforge.net) Date: Sun, 1 Mar 2015 10:59:45 +0000 Subject: SF.net SVN: gar:[24694] csw/mgar/pkg/git/trunk Message-ID: <3kw1pK6Tg2z1F9@mail.opencsw.org> Revision: 24694 http://sourceforge.net/p/gar/code/24694 Author: bdwalton Date: 2015-03-01 10:59:44 +0000 (Sun, 01 Mar 2015) Log Message: ----------- git/trunk: version bump Modified Paths: -------------- csw/mgar/pkg/git/trunk/Makefile csw/mgar/pkg/git/trunk/checksums Modified: csw/mgar/pkg/git/trunk/Makefile =================================================================== --- csw/mgar/pkg/git/trunk/Makefile 2015-03-01 10:31:46 UTC (rev 24693) +++ csw/mgar/pkg/git/trunk/Makefile 2015-03-01 10:59:44 UTC (rev 24694) @@ -1,5 +1,5 @@ NAME = git -VERSION = 2.2.1 +VERSION = 2.3.1 #PATCHLEVEL = rc4 DISTNAME = $(NAME)-$(VERSION) GARTYPE = v2 Modified: csw/mgar/pkg/git/trunk/checksums =================================================================== --- csw/mgar/pkg/git/trunk/checksums 2015-03-01 10:31:46 UTC (rev 24693) +++ csw/mgar/pkg/git/trunk/checksums 2015-03-01 10:59:44 UTC (rev 24694) @@ -1 +1 @@ -ff41fdb094eed1ec430aed8ee9b9849c git-2.2.1.tar.gz +a6673b9c297ff16cd573c4ff0bba34af git-2.3.1.tar.gz This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bdwalton at users.sourceforge.net Sun Mar 1 12:06:55 2015 From: bdwalton at users.sourceforge.net (bdwalton at users.sourceforge.net) Date: Sun, 1 Mar 2015 11:06:55 +0000 Subject: SF.net SVN: gar:[24695] csw/mgar/pkg/git/trunk Message-ID: <3kw1yd5fTWz1HZ@mail.opencsw.org> Revision: 24695 http://sourceforge.net/p/gar/code/24695 Author: bdwalton Date: 2015-03-01 11:06:55 +0000 (Sun, 01 Mar 2015) Log Message: ----------- git/trunk: drop a patch that is now upstream Modified Paths: -------------- csw/mgar/pkg/git/trunk/Makefile Removed Paths: ------------- csw/mgar/pkg/git/trunk/files/0005-use-wc-w-instead-of-awk-in-test-suite.patch Modified: csw/mgar/pkg/git/trunk/Makefile =================================================================== --- csw/mgar/pkg/git/trunk/Makefile 2015-03-01 10:59:44 UTC (rev 24694) +++ csw/mgar/pkg/git/trunk/Makefile 2015-03-01 11:06:55 UTC (rev 24695) @@ -98,7 +98,6 @@ PATCHFILES += 0002-Alter-the-value-of-_PATH_DEFPATH-when-paths.h-not-pr.patch PATCHFILES += 0003-Use-bash-and-set-PATH-in-contributed-hook-file.patch PATCHFILES += 0004-Add-OpenCSW-apache2-path-to-instaweb-search-path.patch -PATCHFILES += 0005-use-wc-w-instead-of-awk-in-test-suite.patch # this patch is required on current9s (not necessarily all sparc boxes) due # to the selection of available utf8 locales. Deleted: csw/mgar/pkg/git/trunk/files/0005-use-wc-w-instead-of-awk-in-test-suite.patch =================================================================== --- csw/mgar/pkg/git/trunk/files/0005-use-wc-w-instead-of-awk-in-test-suite.patch 2015-03-01 10:59:44 UTC (rev 24694) +++ csw/mgar/pkg/git/trunk/files/0005-use-wc-w-instead-of-awk-in-test-suite.patch 2015-03-01 11:06:55 UTC (rev 24695) @@ -1,34 +0,0 @@ -From f0b7563d0a327d23fe8e6915e3d21059a0fb0d60 Mon Sep 17 00:00:00 2001 -From: Ben Walton -Date: Mon, 22 Dec 2014 17:13:19 +0000 -Subject: [PATCH] use wc -w instead of awk in test suite - -Signed-off-by: Ben Walton ---- - t/t0090-cache-tree.sh | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/t/t0090-cache-tree.sh b/t/t0090-cache-tree.sh -index 158cf4f..508cce6 100755 ---- a/t/t0090-cache-tree.sh -+++ b/t/t0090-cache-tree.sh -@@ -1,5 +1,7 @@ - #!/bin/sh - -+set -x -+ - test_description="Test whether cache-tree is properly updated - - Tests whether various commands properly update and/or rewrite the -@@ -22,7 +24,7 @@ generate_expected_cache_tree_rec () { - # ls-files might have foo/bar, foo/bar/baz, and foo/bar/quux - # We want to count only foo because it's the only direct child - subtrees=$(git ls-files|grep /|cut -d / -f 1|uniq) && -- subtree_count=$(echo "$subtrees"|awk -v c=0 '$1 {++c} END {print c}') && -+ subtree_count=$(echo "$subtrees"| wc -w) && - entries=$(git ls-files|wc -l) && - printf "SHA $dir (%d entries, %d subtrees)\n" "$entries" "$subtree_count" && - for subtree in $subtrees --- -2.1.3 - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From dmichelsen at users.sourceforge.net Sun Mar 1 12:36:04 2015 From: dmichelsen at users.sourceforge.net (dmichelsen at users.sourceforge.net) Date: Sun, 1 Mar 2015 11:36:04 +0000 Subject: SF.net SVN: gar:[24696] csw/mgar/pkg/libpsl/trunk Message-ID: <3kw2cD0v6Mz1L4@mail.opencsw.org> Revision: 24696 http://sourceforge.net/p/gar/code/24696 Author: dmichelsen Date: 2015-03-01 11:36:03 +0000 (Sun, 01 Mar 2015) Log Message: ----------- libpsl/trunk: Update to 0.7.1 Modified Paths: -------------- csw/mgar/pkg/libpsl/trunk/Makefile csw/mgar/pkg/libpsl/trunk/checksums Modified: csw/mgar/pkg/libpsl/trunk/Makefile =================================================================== --- csw/mgar/pkg/libpsl/trunk/Makefile 2015-03-01 11:06:55 UTC (rev 24695) +++ csw/mgar/pkg/libpsl/trunk/Makefile 2015-03-01 11:36:03 UTC (rev 24696) @@ -2,7 +2,7 @@ # TODO (release-critical prefixed with !, non release-critical with *) # NAME = libpsl -VERSION = 0.7.0 +VERSION = 0.7.1 GARTYPE = v2 DESCRIPTION = Provides functions to check domains against the Mozilla Public Suffix List Modified: csw/mgar/pkg/libpsl/trunk/checksums =================================================================== --- csw/mgar/pkg/libpsl/trunk/checksums 2015-03-01 11:06:55 UTC (rev 24695) +++ csw/mgar/pkg/libpsl/trunk/checksums 2015-03-01 11:36:03 UTC (rev 24696) @@ -1 +1 @@ -18e0b5481c68ede3aba71e7de4d6a4a8 libpsl-0.7.0.tar.gz +775d12ff0a3e8684200c2149be74d58e libpsl-0.7.1.tar.gz This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From guillomovitch at users.sourceforge.net Sun Mar 1 17:44:46 2015 From: guillomovitch at users.sourceforge.net (guillomovitch at users.sourceforge.net) Date: Sun, 1 Mar 2015 16:44:46 +0000 Subject: SF.net SVN: gar:[24698] csw/mgar/pkg/fusioninventory-agent/trunk Message-ID: <3kw9SR6B4Sz3v@mail.opencsw.org> Revision: 24698 http://sourceforge.net/p/gar/code/24698 Author: guillomovitch Date: 2015-03-01 16:44:46 +0000 (Sun, 01 Mar 2015) Log Message: ----------- fusioninventory-agent/trunk: new version 2.3.16 Modified Paths: -------------- csw/mgar/pkg/fusioninventory-agent/trunk/Makefile csw/mgar/pkg/fusioninventory-agent/trunk/checksums Modified: csw/mgar/pkg/fusioninventory-agent/trunk/Makefile =================================================================== --- csw/mgar/pkg/fusioninventory-agent/trunk/Makefile 2015-03-01 11:36:17 UTC (rev 24697) +++ csw/mgar/pkg/fusioninventory-agent/trunk/Makefile 2015-03-01 16:44:46 UTC (rev 24698) @@ -2,7 +2,7 @@ # TODO (release-critical prefixed with !, non release-critical with *) # NAME = fusioninventory-agent -VERSION = 2.3.15 +VERSION = 2.3.16 GARTYPE = v2 CATEGORIES = cpan Modified: csw/mgar/pkg/fusioninventory-agent/trunk/checksums =================================================================== --- csw/mgar/pkg/fusioninventory-agent/trunk/checksums 2015-03-01 11:36:17 UTC (rev 24697) +++ csw/mgar/pkg/fusioninventory-agent/trunk/checksums 2015-03-01 16:44:46 UTC (rev 24698) @@ -1 +1 @@ -9c34fefcb70076f860677eea056077ed FusionInventory-Agent-2.3.15.tar.gz +89467ae101a89544a6fbade2e7a879fe FusionInventory-Agent-2.3.16.tar.gz This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From dmichelsen at users.sourceforge.net Mon Mar 2 13:33:23 2015 From: dmichelsen at users.sourceforge.net (dmichelsen at users.sourceforge.net) Date: Mon, 2 Mar 2015 12:33:23 +0000 Subject: SF.net SVN: gar:[24701] csw/mgar/pkg/tcpdump/trunk Message-ID: <3kwgr21zn5zSY@mail.opencsw.org> Revision: 24701 http://sourceforge.net/p/gar/code/24701 Author: dmichelsen Date: 2015-03-02 12:33:23 +0000 (Mon, 02 Mar 2015) Log Message: ----------- tcpdump/trunk: Update to 4.6.2 Modified Paths: -------------- csw/mgar/pkg/tcpdump/trunk/Makefile csw/mgar/pkg/tcpdump/trunk/checksums Modified: csw/mgar/pkg/tcpdump/trunk/Makefile =================================================================== --- csw/mgar/pkg/tcpdump/trunk/Makefile 2015-03-02 11:43:13 UTC (rev 24700) +++ csw/mgar/pkg/tcpdump/trunk/Makefile 2015-03-02 12:33:23 UTC (rev 24701) @@ -1,5 +1,5 @@ NAME = tcpdump -VERSION = 4.5.1 +VERSION = 4.6.2 GARTYPE = v2 DESCRIPTION = Dump network traffic @@ -33,6 +33,6 @@ # There is a failing test: # https://github.com/the-tcpdump-group/tcpdump/issues/351 -SKIPTEST ?= 1 +# SKIPTEST ?= 1 include gar/category.mk Modified: csw/mgar/pkg/tcpdump/trunk/checksums =================================================================== --- csw/mgar/pkg/tcpdump/trunk/checksums 2015-03-02 11:43:13 UTC (rev 24700) +++ csw/mgar/pkg/tcpdump/trunk/checksums 2015-03-02 12:33:23 UTC (rev 24701) @@ -1 +1 @@ -973a2513d0076e34aa9da7e15ed98e1b tcpdump-4.5.1.tar.gz +74d0d3728b3cdc60db872d842e7f1598 tcpdump-4.6.2.tar.gz This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bdwalton at users.sourceforge.net Mon Mar 2 20:24:13 2015 From: bdwalton at users.sourceforge.net (bdwalton at users.sourceforge.net) Date: Mon, 2 Mar 2015 19:24:13 +0000 Subject: SF.net SVN: gar:[24702] csw/mgar/pkg/git/trunk Message-ID: <3kwry117jPzdt@mail.opencsw.org> Revision: 24702 http://sourceforge.net/p/gar/code/24702 Author: bdwalton Date: 2015-03-02 19:24:13 +0000 (Mon, 02 Mar 2015) Log Message: ----------- git/trunk: add a patch to suppress compiler warnings Modified Paths: -------------- csw/mgar/pkg/git/trunk/Makefile Added Paths: ----------- csw/mgar/pkg/git/trunk/files/0005-Use-unsigned-char-instead-of-char-to-ensure-squash-c.patch Modified: csw/mgar/pkg/git/trunk/Makefile =================================================================== --- csw/mgar/pkg/git/trunk/Makefile 2015-03-02 12:33:23 UTC (rev 24701) +++ csw/mgar/pkg/git/trunk/Makefile 2015-03-02 19:24:13 UTC (rev 24702) @@ -98,6 +98,7 @@ PATCHFILES += 0002-Alter-the-value-of-_PATH_DEFPATH-when-paths.h-not-pr.patch PATCHFILES += 0003-Use-bash-and-set-PATH-in-contributed-hook-file.patch PATCHFILES += 0004-Add-OpenCSW-apache2-path-to-instaweb-search-path.patch +PATCHFILES += 0005-Use-unsigned-char-instead-of-char-to-ensure-squash-c.patch # this patch is required on current9s (not necessarily all sparc boxes) due # to the selection of available utf8 locales. Added: csw/mgar/pkg/git/trunk/files/0005-Use-unsigned-char-instead-of-char-to-ensure-squash-c.patch =================================================================== --- csw/mgar/pkg/git/trunk/files/0005-Use-unsigned-char-instead-of-char-to-ensure-squash-c.patch (rev 0) +++ csw/mgar/pkg/git/trunk/files/0005-Use-unsigned-char-instead-of-char-to-ensure-squash-c.patch 2015-03-02 19:24:13 UTC (rev 24702) @@ -0,0 +1,98 @@ +From bbc1db515ef27a477072d6b0be5dbec50108706e Mon Sep 17 00:00:00 2001 +From: Ben Walton +Date: Sun, 1 Mar 2015 11:39:44 +0000 +Subject: [PATCH] Use unsigned char to squash compiler warnings + +Sun Studio CC issues warnings that GCC doesn't about improper +initializers being used when defining tolower_trans_tbl in ctype.c. To +resolve this, declare tolower_trans_tbl explicitly as unsigned char. +Update all appropriate references to the new type. + +Signed-off-by: Ben Walton +--- + ctype.c | 2 +- + git-compat-util.h | 2 +- + kwset.c | 8 ++++---- + kwset.h | 2 +- + 4 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/ctype.c b/ctype.c +index 0bfebb4..fc0225c 100644 +--- a/ctype.c ++++ b/ctype.c +@@ -30,7 +30,7 @@ const unsigned char sane_ctype[256] = { + }; + + /* For case-insensitive kwset */ +-const char tolower_trans_tbl[256] = { ++const unsigned char tolower_trans_tbl[256] = { + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, + 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, +diff --git a/git-compat-util.h b/git-compat-util.h +index a51c144..fc1d142 100644 +--- a/git-compat-util.h ++++ b/git-compat-util.h +@@ -691,7 +691,7 @@ static inline size_t xsize_t(off_t len) + } + + /* in ctype.c, for kwset users */ +-extern const char tolower_trans_tbl[256]; ++extern const unsigned char tolower_trans_tbl[256]; + + /* Sane ctype - no locale, and works with signed chars */ + #undef isascii +diff --git a/kwset.c b/kwset.c +index a0f49b3..4ebaa34 100644 +--- a/kwset.c ++++ b/kwset.c +@@ -80,13 +80,13 @@ struct kwset + struct trie *next[NCHAR]; /* Table of children of the root. */ + char *target; /* Target string if there's only one. */ + int mind2; /* Used in Boyer-Moore search for one string. */ +- char const *trans; /* Character translation table. */ ++ unsigned char const *trans; /* Character translation table. */ + }; + + /* Allocate and initialize a keyword set object, returning an opaque + pointer to it. Return NULL if memory is not available. */ + kwset_t +-kwsalloc (char const *trans) ++kwsalloc (unsigned char const *trans) + { + struct kwset *kwset; + +@@ -381,7 +381,7 @@ kwsprep (kwset_t kws) + register struct kwset *kwset; + register int i; + register struct trie *curr; +- register char const *trans; ++ register unsigned char const *trans; + unsigned char delta[NCHAR]; + + kwset = (struct kwset *) kws; +@@ -590,7 +590,7 @@ cwexec (kwset_t kws, char const *text, size_t len, struct kwsmatch *kwsmatch) + register int d; + register char const *end, *qlim; + register struct tree const *tree; +- register char const *trans; ++ register unsigned char const *trans; + + accept = NULL; + +diff --git a/kwset.h b/kwset.h +index a21b2ea..61a134f 100644 +--- a/kwset.h ++++ b/kwset.h +@@ -39,7 +39,7 @@ typedef struct kwset_t* kwset_t; + if enough memory cannot be obtained. The argument if non-NULL + specifies a table of character translations to be applied to all + pattern and search text. */ +-extern kwset_t kwsalloc(char const *); ++extern kwset_t kwsalloc(unsigned char const *); + + /* Incrementally extend the keyword set to include the given string. + Return NULL for success, or an error message. Remember an index +-- +2.2.1 + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From hjb001 at users.sourceforge.net Tue Mar 3 11:06:23 2015 From: hjb001 at users.sourceforge.net (hjb001 at users.sourceforge.net) Date: Tue, 3 Mar 2015 10:06:23 +0000 Subject: SF.net SVN: gar:[24703] csw/mgar/pkg/netsnmp/trunk Message-ID: <3kxDXC4Xfjz10l@mail.opencsw.org> Revision: 24703 http://sourceforge.net/p/gar/code/24703 Author: hjb001 Date: 2015-03-03 10:06:22 +0000 (Tue, 03 Mar 2015) Log Message: ----------- Upgraded for upstream version 5.7.3 (LTS) Modified Paths: -------------- csw/mgar/pkg/netsnmp/trunk/Makefile csw/mgar/pkg/netsnmp/trunk/checksums csw/mgar/pkg/netsnmp/trunk/files/0004-enable-python-version-select.patch csw/mgar/pkg/netsnmp/trunk/files/0015+0016-vmstat_solaris2.patch csw/mgar/pkg/netsnmp/trunk/files/0024-kernel_sunos5.5.10.patch csw/mgar/pkg/netsnmp/trunk/files/0024-kernel_sunos5.5.11.patch csw/mgar/pkg/netsnmp/trunk/files/0052-dyn-cpu-cpu_kstat.patch csw/mgar/pkg/netsnmp/trunk/files/Makefile.in.diff Modified: csw/mgar/pkg/netsnmp/trunk/Makefile =================================================================== --- csw/mgar/pkg/netsnmp/trunk/Makefile 2015-03-02 19:24:13 UTC (rev 24702) +++ csw/mgar/pkg/netsnmp/trunk/Makefile 2015-03-03 10:06:22 UTC (rev 24703) @@ -5,7 +5,7 @@ # NAME = netsnmp -VERSION = 5.7.2 +VERSION = 5.7.3 GARTYPE = v2 DESCRIPTION = A suite of applications used to implement SNMP @@ -43,10 +43,12 @@ PATCHFILES += 0012-Makefile.PL.patch PATCHFILES += 0015+0016-vmstat_solaris2.patch PATCHFILES += 0024-kernel_sunos5.$(GAROSREL).patch -PATCHFILES += 0034-manpage-snmptrapd.conf.5.def.patch +# this manpage patch is suspect - upstream has changed the same section in 5.7.3 in a different way +# PATCHFILES += 0034-manpage-snmptrapd.conf.5.def.patch PATCHFILES += 0035-bug-1849903.patch PATCHFILES += 0048+0027-mnt-cache-hr_filesys.patch -PATCHFILES += 0051-CVE-2014-2285.patch +# this CVE is already fixed in 5.7.3 +# PATCHFILES += 0051-CVE-2014-2285.patch PATCHFILES += 0052-dyn-cpu-cpu_kstat.patch VENDOR_URL = http://www.net-snmp.org/ Modified: csw/mgar/pkg/netsnmp/trunk/checksums =================================================================== --- csw/mgar/pkg/netsnmp/trunk/checksums 2015-03-02 19:24:13 UTC (rev 24702) +++ csw/mgar/pkg/netsnmp/trunk/checksums 2015-03-03 10:06:22 UTC (rev 24703) @@ -1 +1 @@ -5bddd02e2f82b62daa79f82717737a14 net-snmp-5.7.2.tar.gz +d4a3459e1577d0efa8d96ca70a885e53 net-snmp-5.7.3.tar.gz Modified: csw/mgar/pkg/netsnmp/trunk/files/0004-enable-python-version-select.patch =================================================================== --- csw/mgar/pkg/netsnmp/trunk/files/0004-enable-python-version-select.patch 2015-03-02 19:24:13 UTC (rev 24702) +++ csw/mgar/pkg/netsnmp/trunk/files/0004-enable-python-version-select.patch 2015-03-03 10:06:22 UTC (rev 24703) @@ -7,5 +7,5 @@ -PYTHON = @PYTHONPROG@ +PYTHON ?= @PYTHONPROG@ FIND = @FIND@ + EGREP = @EGREP@ - # Modified: csw/mgar/pkg/netsnmp/trunk/files/0015+0016-vmstat_solaris2.patch =================================================================== --- csw/mgar/pkg/netsnmp/trunk/files/0015+0016-vmstat_solaris2.patch 2015-03-02 19:24:13 UTC (rev 24702) +++ csw/mgar/pkg/netsnmp/trunk/files/0015+0016-vmstat_solaris2.patch 2015-03-03 10:06:22 UTC (rev 24703) @@ -8,8 +8,6 @@ /* * Now calculate the absolute percentage values * Looks somewhat complicated sometimes but tries to get around using floats to increase speed ---- a/agent/mibgroup/ucd-snmp/vmstat_solaris2.c -+++ b/agent/mibgroup/ucd-snmp/vmstat_solaris2.c @@ -703,7 +704,12 @@ var_extensible_vmstat(struct variable *vp, case CPUIDLE: return ((u_char *) (&cpu_perc[CPU_IDLE])); Modified: csw/mgar/pkg/netsnmp/trunk/files/0024-kernel_sunos5.5.10.patch =================================================================== --- csw/mgar/pkg/netsnmp/trunk/files/0024-kernel_sunos5.5.10.patch 2015-03-02 19:24:13 UTC (rev 24702) +++ csw/mgar/pkg/netsnmp/trunk/files/0024-kernel_sunos5.5.10.patch 2015-03-03 10:06:22 UTC (rev 24703) @@ -20,7 +20,7 @@ 300, 0, 0}, {MIB_ICMP, sizeof(mib2_icmp_t), (void *) -1, 0, 60, 0, 0}, {MIB_TCP, sizeof(mib2_tcp_t), (void *) -1, 0, 60, 0, 0}, -@@ -105,13 +105,13 @@ mibcache Mibcache[MIBCACHE_SIZE+1] = { +@@ -105,13 +105,13 @@ mibcache Mibcache[MIBCACHE_SIZE+1 {MIB_SNMP, 0, (void *) -1, 0, 0, 0, 0}, #ifdef SOLARIS_HAVE_IPV6_MIB_SUPPORT #ifdef SOLARIS_HAVE_RFC4293_SUPPORT @@ -35,10 +35,10 @@ #endif - {MIB_IP6_ADDR, 20 * sizeof(mib2_ipv6AddrEntry_t), (void *)-1, 0, 30, 0, 0}, + {MIB_IP6_ADDR, 128 * sizeof(mib2_ipv6AddrEntry_t), (void *)-1, 0, 30, 0, 0}, + {MIB_IP6_ROUTE, 200 * sizeof(mib2_ipv6AddrEntry_t), (void *)-1, 0, 30, 0, 0}, + {MIB_ICMP6, 20 * sizeof(mib2_ipv6IfIcmpEntry_t), (void *)-1, 0, 30, 0, 0}, {MIB_TCP6_CONN, 1000 * sizeof(mib2_tcp6ConnEntry_t), (void *) -1, 0, 30, - 0, 0}, - {MIB_UDP6_ENDPOINT, 1000 * sizeof(mib2_udp6Entry_t), (void *) -1, 0, 30, -@@ -184,7 +184,7 @@ getif(mib2_ifEntry_t *ifbuf, size_t size, req_e req_type, mib2_ifEntry_t *resp, +@@ -188,7 +188,7 @@ getif(mib2_ifEntry_t *ifbuf, size_t size size_t *length, int (*comp)(void *, void *), void *arg); static void set_if_info(mib2_ifEntry_t *ifp, unsigned index, char *name, uint64_t flags, @@ -47,7 +47,7 @@ static int get_if_stats(mib2_ifEntry_t *ifp); #if defined(HAVE_IF_NAMEINDEX) && defined(NETSNMP_INCLUDE_IFTABLE_REWRITES) -@@ -294,7 +294,9 @@ getKstatInt(const char *classname, const char *statname, +@@ -298,7 +298,9 @@ getKstatInt(const char *classname, const kstat_t *ks; kid_t kid; kstat_named_t *named; @@ -57,7 +57,7 @@ if (kstat_fd == 0) { kstat_fd = kstat_open(); -@@ -305,27 +307,88 @@ getKstatInt(const char *classname, const char *statname, +@@ -309,27 +311,88 @@ getKstatInt(const char *classname, const if ((ksc = kstat_fd) == NULL) { goto Return; } @@ -166,7 +166,7 @@ ret = 0; /* maybe successful */ switch (named->data_type) { #ifdef KSTAT_DATA_INT32 /* Solaris 2.6 and up */ -@@ -442,11 +505,20 @@ getKstat(const char *statname, const char *varname, void *value) +@@ -446,11 +509,20 @@ getKstat(const char *statname, const cha /* * Get the named statistics */ @@ -191,7 +191,7 @@ if (kstat_read(ksc, ks, NULL) <= 0) { ret = -10; goto Return; /* kstat errors */ -@@ -1080,18 +1152,21 @@ getmib(int groupname, int subgroupname, void **statbuf, size_t *size, +@@ -1088,18 +1160,21 @@ getmib(int groupname, int subgroupname, static int _dlpi_open(const char *devname) { @@ -218,7 +218,7 @@ DEBUGMSGTL(("kernel_sunos5:dlpi", "devstr(%s)\n", devstr)); /* * First try opening the device using style 1, if the device does not -@@ -1102,13 +1177,49 @@ _dlpi_open(const char *devname) +@@ -1110,13 +1185,49 @@ _dlpi_open(const char *devname) DEBUGMSGTL(("kernel_sunos5:dlpi", "style1 open(%s)\n", devstr)); if ((fd = open(devstr, O_RDWR | O_NONBLOCK)) < 0) { DEBUGMSGTL(("kernel_sunos5:dlpi", "style1 open failed\n")); @@ -236,7 +236,8 @@ + * is required + */ + ret = strlcpy(devstrcpy, devstr, sizeof(devstrcpy)); -+ + +- if ((fd = open(devstr, O_RDWR | O_NONBLOCK)) != -1) { + if(ret > sizeof(devstrcpy) - 1) + return -1; + @@ -252,8 +253,7 @@ + DEBUGMSGTL(("kernel_sunos5:dlpi", "devstr(%s)\n", devstr)); + + /* try style 2 */ - -- if ((fd = open(devstr, O_RDWR | O_NONBLOCK)) != -1) { ++ + if ((fd = open(devstr, O_RDWR | O_NONBLOCK)) < 0) { + DEBUGMSGTL(("kernel_sunos5:dlpi", "style2 open failed\n")); + fd = -1; @@ -274,7 +274,7 @@ if (_dlpi_attach(fd, ppa) == 0) { DEBUGMSGTL(("kernel_sunos5:dlpi", "attached\n")); } else { -@@ -1117,16 +1228,11 @@ _dlpi_open(const char *devname) +@@ -1125,16 +1236,11 @@ _dlpi_open(const char *devname) fd = -1; } } else { @@ -292,7 +292,7 @@ return (fd); } -@@ -1141,7 +1247,9 @@ _dlpi_get_phys_address(int fd, char *addr, int maxlen, int *addrlen) +@@ -1149,7 +1255,9 @@ _dlpi_get_phys_address(int fd, char *add struct strbuf ctlbuf; char buf[MAX(DL_PHYS_ADDR_ACK_SIZE+64, DL_ERROR_ACK_SIZE)]; int flag = 0; @@ -303,7 +303,7 @@ DEBUGMSGTL(("kernel_sunos5:dlpi", "_dlpi_get_phys_address\n")); paddr_req.dl_primitive = DL_PHYS_ADDR_REQ; -@@ -1154,7 +1262,22 @@ _dlpi_get_phys_address(int fd, char *addr, int maxlen, int *addrlen) +@@ -1162,7 +1270,22 @@ _dlpi_get_phys_address(int fd, char *add ctlbuf.maxlen = sizeof(buf); ctlbuf.len = 0; ctlbuf.buf = buf; @@ -327,7 +327,7 @@ return (-1); if (ctlbuf.len < sizeof(uint32_t)) -@@ -1196,6 +1319,8 @@ _dlpi_get_iftype(int fd, unsigned int *iftype) +@@ -1204,6 +1327,8 @@ _dlpi_get_iftype(int fd, unsigned int *i struct strbuf ctlbuf; char buf[MAX(DL_INFO_ACK_SIZE, DL_ERROR_ACK_SIZE)]; int flag = 0; @@ -336,7 +336,7 @@ DEBUGMSGTL(("kernel_sunos5:dlpi", "_dlpi_get_iftype\n")); -@@ -1210,7 +1335,22 @@ _dlpi_get_iftype(int fd, unsigned int *iftype) +@@ -1218,7 +1343,22 @@ _dlpi_get_iftype(int fd, unsigned int *i ctlbuf.maxlen = sizeof(buf); ctlbuf.len = 0; ctlbuf.buf = buf; @@ -360,7 +360,7 @@ DEBUGMSGTL(("kernel_sunos5:dlpi", "getmsg failed: %d\n", errno)); return (-1); } -@@ -1367,8 +1507,9 @@ getif(mib2_ifEntry_t *ifbuf, size_t size, req_e req_type, +@@ -1375,8 +1515,9 @@ getif(mib2_ifEntry_t *ifbuf, size_t size mib2_ifEntry_t *ifp; int nentries = size / sizeof(mib2_ifEntry_t); found_e result = NOT_FOUND; @@ -371,7 +371,7 @@ struct if_nameindex *ifname, *ifnp; lifrp = &lifreq; -@@ -1400,6 +1541,7 @@ getif(mib2_ifEntry_t *ifbuf, size_t size, req_e req_type, +@@ -1408,6 +1549,7 @@ getif(mib2_ifEntry_t *ifbuf, size_t size memcpy(lifrp->lifr_name, ifnp->if_name, LIFNAMSIZ); if_isv6 = B_FALSE; @@ -379,7 +379,7 @@ if (ioctl(ifsd, SIOCGLIFFLAGS, lifrp) < 0) { if (ifsd6 == -1) { if ((ifsd6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { -@@ -1408,17 +1550,19 @@ getif(mib2_ifEntry_t *ifbuf, size_t size, req_e req_type, +@@ -1416,17 +1558,19 @@ getif(mib2_ifEntry_t *ifbuf, size_t size } } if (ioctl(ifsd6, SIOCGLIFFLAGS, lifrp) < 0) { @@ -403,7 +403,7 @@ } memset(ifp, 0, sizeof(mib2_ifEntry_t)); -@@ -1433,11 +1577,12 @@ getif(mib2_ifEntry_t *ifbuf, size_t size, req_e req_type, +@@ -1441,11 +1585,12 @@ getif(mib2_ifEntry_t *ifbuf, size_t size } set_if_info(ifp, ifnp->if_index, ifnp->if_name, if_flags, @@ -418,7 +418,7 @@ } /* -@@ -1614,11 +1759,109 @@ getif(mib2_ifEntry_t *ifbuf, size_t size, req_e req_type, +@@ -1622,11 +1767,109 @@ getif(mib2_ifEntry_t *ifbuf, size_t size } #endif /*defined(HAVE_IF_NAMEINDEX)&&defined(NETSNMP_INCLUDE_IFTABLE_REWRITES)*/ @@ -529,7 +529,7 @@ /* * Set basic information -@@ -1627,7 +1870,10 @@ set_if_info(mib2_ifEntry_t *ifp, unsigned index, char *name, uint64_t flags, +@@ -1635,7 +1878,10 @@ set_if_info(mib2_ifEntry_t *ifp, unsigne ifp->ifDescr.o_length = strlen(name); strcpy(ifp->ifDescr.o_bytes, name); ifp->ifAdminStatus = (flags & IFF_UP) ? 1 : 2; @@ -541,7 +541,7 @@ ifp->ifLastChange = 0; /* Who knows ... */ ifp->flags = flags; ifp->ifMtu = mtu; -@@ -1644,7 +1890,8 @@ set_if_info(mib2_ifEntry_t *ifp, unsigned index, char *name, uint64_t flags, +@@ -1652,7 +1898,8 @@ set_if_info(mib2_ifEntry_t *ifp, unsigne ifp->ifSpeed *= 1000000; } havespeed = B_TRUE; Modified: csw/mgar/pkg/netsnmp/trunk/files/0024-kernel_sunos5.5.11.patch =================================================================== --- csw/mgar/pkg/netsnmp/trunk/files/0024-kernel_sunos5.5.11.patch 2015-03-02 19:24:13 UTC (rev 24702) +++ csw/mgar/pkg/netsnmp/trunk/files/0024-kernel_sunos5.5.11.patch 2015-03-03 10:06:22 UTC (rev 24703) @@ -29,7 +29,7 @@ 300, 0, 0}, {MIB_ICMP, sizeof(mib2_icmp_t), (void *) -1, 0, 60, 0, 0}, {MIB_TCP, sizeof(mib2_tcp_t), (void *) -1, 0, 60, 0, 0}, -@@ -105,13 +107,13 @@ mibcache Mibcache[MIBCACHE_SIZE+1] = { +@@ -105,13 +107,13 @@ mibcache Mibcache[MIBCACHE_SIZE+1 {MIB_SNMP, 0, (void *) -1, 0, 0, 0, 0}, #ifdef SOLARIS_HAVE_IPV6_MIB_SUPPORT #ifdef SOLARIS_HAVE_RFC4293_SUPPORT @@ -44,10 +44,10 @@ #endif - {MIB_IP6_ADDR, 20 * sizeof(mib2_ipv6AddrEntry_t), (void *)-1, 0, 30, 0, 0}, + {MIB_IP6_ADDR, 128 * sizeof(mib2_ipv6AddrEntry_t), (void *)-1, 0, 30, 0, 0}, + {MIB_IP6_ROUTE, 200 * sizeof(mib2_ipv6AddrEntry_t), (void *)-1, 0, 30, 0, 0}, + {MIB_ICMP6, 20 * sizeof(mib2_ipv6IfIcmpEntry_t), (void *)-1, 0, 30, 0, 0}, {MIB_TCP6_CONN, 1000 * sizeof(mib2_tcp6ConnEntry_t), (void *) -1, 0, 30, - 0, 0}, - {MIB_UDP6_ENDPOINT, 1000 * sizeof(mib2_udp6Entry_t), (void *) -1, 0, 30, -@@ -184,9 +186,9 @@ getif(mib2_ifEntry_t *ifbuf, size_t size, req_e req_type, mib2_ifEntry_t *resp, +@@ -188,9 +190,9 @@ getif(mib2_ifEntry_t *ifbuf, size_t size size_t *length, int (*comp)(void *, void *), void *arg); static void set_if_info(mib2_ifEntry_t *ifp, unsigned index, char *name, uint64_t flags, @@ -59,7 +59,7 @@ #if defined(HAVE_IF_NAMEINDEX) && defined(NETSNMP_INCLUDE_IFTABLE_REWRITES) static int _dlpi_open(const char *devname); static int _dlpi_get_phys_address(int fd, char *paddr, int maxlen, -@@ -294,7 +296,9 @@ getKstatInt(const char *classname, const char *statname, +@@ -298,7 +300,9 @@ getKstatInt(const char *classname, const kstat_t *ks; kid_t kid; kstat_named_t *named; @@ -69,7 +69,7 @@ if (kstat_fd == 0) { kstat_fd = kstat_open(); -@@ -305,27 +309,88 @@ getKstatInt(const char *classname, const char *statname, +@@ -309,27 +313,88 @@ getKstatInt(const char *classname, const if ((ksc = kstat_fd) == NULL) { goto Return; } @@ -178,7 +178,7 @@ ret = 0; /* maybe successful */ switch (named->data_type) { #ifdef KSTAT_DATA_INT32 /* Solaris 2.6 and up */ -@@ -442,11 +507,20 @@ getKstat(const char *statname, const char *varname, void *value) +@@ -446,11 +511,20 @@ getKstat(const char *statname, const cha /* * Get the named statistics */ @@ -203,7 +203,7 @@ if (kstat_read(ksc, ks, NULL) <= 0) { ret = -10; goto Return; /* kstat errors */ -@@ -1080,18 +1154,21 @@ getmib(int groupname, int subgroupname, void **statbuf, size_t *size, +@@ -1088,18 +1162,21 @@ getmib(int groupname, int subgroupname, static int _dlpi_open(const char *devname) { @@ -230,7 +230,7 @@ DEBUGMSGTL(("kernel_sunos5:dlpi", "devstr(%s)\n", devstr)); /* * First try opening the device using style 1, if the device does not -@@ -1102,13 +1179,49 @@ _dlpi_open(const char *devname) +@@ -1110,13 +1187,49 @@ _dlpi_open(const char *devname) DEBUGMSGTL(("kernel_sunos5:dlpi", "style1 open(%s)\n", devstr)); if ((fd = open(devstr, O_RDWR | O_NONBLOCK)) < 0) { DEBUGMSGTL(("kernel_sunos5:dlpi", "style1 open failed\n")); @@ -286,7 +286,7 @@ if (_dlpi_attach(fd, ppa) == 0) { DEBUGMSGTL(("kernel_sunos5:dlpi", "attached\n")); } else { -@@ -1117,16 +1230,11 @@ _dlpi_open(const char *devname) +@@ -1125,16 +1238,11 @@ _dlpi_open(const char *devname) fd = -1; } } else { @@ -304,7 +304,7 @@ return (fd); } -@@ -1141,7 +1249,9 @@ _dlpi_get_phys_address(int fd, char *addr, int maxlen, int *addrlen) +@@ -1149,7 +1257,9 @@ _dlpi_get_phys_address(int fd, char *add struct strbuf ctlbuf; char buf[MAX(DL_PHYS_ADDR_ACK_SIZE+64, DL_ERROR_ACK_SIZE)]; int flag = 0; @@ -315,7 +315,7 @@ DEBUGMSGTL(("kernel_sunos5:dlpi", "_dlpi_get_phys_address\n")); paddr_req.dl_primitive = DL_PHYS_ADDR_REQ; -@@ -1154,7 +1264,22 @@ _dlpi_get_phys_address(int fd, char *addr, int maxlen, int *addrlen) +@@ -1162,7 +1272,22 @@ _dlpi_get_phys_address(int fd, char *add ctlbuf.maxlen = sizeof(buf); ctlbuf.len = 0; ctlbuf.buf = buf; @@ -339,7 +339,7 @@ return (-1); if (ctlbuf.len < sizeof(uint32_t)) -@@ -1196,6 +1321,8 @@ _dlpi_get_iftype(int fd, unsigned int *iftype) +@@ -1204,6 +1329,8 @@ _dlpi_get_iftype(int fd, unsigned int *i struct strbuf ctlbuf; char buf[MAX(DL_INFO_ACK_SIZE, DL_ERROR_ACK_SIZE)]; int flag = 0; @@ -348,7 +348,7 @@ DEBUGMSGTL(("kernel_sunos5:dlpi", "_dlpi_get_iftype\n")); -@@ -1210,7 +1337,22 @@ _dlpi_get_iftype(int fd, unsigned int *iftype) +@@ -1218,7 +1345,22 @@ _dlpi_get_iftype(int fd, unsigned int *i ctlbuf.maxlen = sizeof(buf); ctlbuf.len = 0; ctlbuf.buf = buf; @@ -372,7 +372,7 @@ DEBUGMSGTL(("kernel_sunos5:dlpi", "getmsg failed: %d\n", errno)); return (-1); } -@@ -1367,8 +1509,9 @@ getif(mib2_ifEntry_t *ifbuf, size_t size, req_e req_type, +@@ -1375,8 +1517,9 @@ getif(mib2_ifEntry_t *ifbuf, size_t size mib2_ifEntry_t *ifp; int nentries = size / sizeof(mib2_ifEntry_t); found_e result = NOT_FOUND; @@ -383,7 +383,7 @@ struct if_nameindex *ifname, *ifnp; lifrp = &lifreq; -@@ -1400,6 +1543,7 @@ getif(mib2_ifEntry_t *ifbuf, size_t size, req_e req_type, +@@ -1408,6 +1551,7 @@ getif(mib2_ifEntry_t *ifbuf, size_t size memcpy(lifrp->lifr_name, ifnp->if_name, LIFNAMSIZ); if_isv6 = B_FALSE; @@ -391,7 +391,7 @@ if (ioctl(ifsd, SIOCGLIFFLAGS, lifrp) < 0) { if (ifsd6 == -1) { if ((ifsd6 = socket(AF_INET6, SOCK_DGRAM, 0)) < 0) { -@@ -1408,17 +1552,19 @@ getif(mib2_ifEntry_t *ifbuf, size_t size, req_e req_type, +@@ -1416,17 +1560,19 @@ getif(mib2_ifEntry_t *ifbuf, size_t size } } if (ioctl(ifsd6, SIOCGLIFFLAGS, lifrp) < 0) { @@ -415,7 +415,7 @@ } memset(ifp, 0, sizeof(mib2_ifEntry_t)); -@@ -1433,11 +1579,12 @@ getif(mib2_ifEntry_t *ifbuf, size_t size, req_e req_type, +@@ -1441,11 +1587,12 @@ getif(mib2_ifEntry_t *ifbuf, size_t size } set_if_info(ifp, ifnp->if_index, ifnp->if_name, if_flags, @@ -430,7 +430,7 @@ } /* -@@ -1614,11 +1761,155 @@ getif(mib2_ifEntry_t *ifbuf, size_t size, req_e req_type, +@@ -1622,11 +1769,155 @@ getif(mib2_ifEntry_t *ifbuf, size_t size } #endif /*defined(HAVE_IF_NAMEINDEX)&&defined(NETSNMP_INCLUDE_IFTABLE_REWRITES)*/ @@ -587,7 +587,7 @@ /* * Set basic information -@@ -1627,7 +1918,10 @@ set_if_info(mib2_ifEntry_t *ifp, unsigned index, char *name, uint64_t flags, +@@ -1635,7 +1926,10 @@ set_if_info(mib2_ifEntry_t *ifp, unsigne ifp->ifDescr.o_length = strlen(name); strcpy(ifp->ifDescr.o_bytes, name); ifp->ifAdminStatus = (flags & IFF_UP) ? 1 : 2; @@ -599,18 +599,19 @@ ifp->ifLastChange = 0; /* Who knows ... */ ifp->flags = flags; ifp->ifMtu = mtu; -@@ -1649,14 +1943,26 @@ set_if_info(mib2_ifEntry_t *ifp, unsigned index, char *name, uint64_t flags, +@@ -1657,8 +1951,9 @@ set_if_info(mib2_ifEntry_t *ifp, unsigne * this is good */ havespeed = B_TRUE; +- } else if (getKstatInt("link", name, "ifspeed", &ifp->ifSpeed) == 0) { +- havespeed = B_TRUE; + } else if ((getKstatInt("link", name, "ifspeed", &ifp->ifSpeed) == 0) || + (getKstatInt("link", name, "ifSpeed", &ifp->ifSpeed) == 0)) { + havespeed = B_TRUE; } -- + /* make ifOperStatus depend on link status if available */ - if (ifp->ifAdminStatus == 1) { - int i_tmp; +@@ -1667,6 +1962,16 @@ set_if_info(mib2_ifEntry_t *ifp, unsigne /* only UPed interfaces get correct link status - if any */ if (getKstatInt(NULL, name,"link_up",&i_tmp) == 0) { ifp->ifOperStatus = i_tmp ? 1 : 2; Modified: csw/mgar/pkg/netsnmp/trunk/files/0052-dyn-cpu-cpu_kstat.patch =================================================================== --- csw/mgar/pkg/netsnmp/trunk/files/0052-dyn-cpu-cpu_kstat.patch 2015-03-02 19:24:13 UTC (rev 24702) +++ csw/mgar/pkg/netsnmp/trunk/files/0052-dyn-cpu-cpu_kstat.patch 2015-03-03 10:06:22 UTC (rev 24703) @@ -1,12 +1,13 @@ --- a/agent/mibgroup/hardware/cpu/cpu_kstat.c +++ b/agent/mibgroup/hardware/cpu/cpu_kstat.c -@@ -17,16 +17,16 @@ +@@ -17,16 +17,18 @@ extern kstat_ctl_t *kstat_fd; extern int cpu_num; int _cpu_status(char *state); -- +static void add_new_kstat_cpu_entry(kstat_t *ksp); + +static struct cpu_idx * add_cpu_idx(struct cpu_idx * head, int idx); ++int netsnmp_update_cpu_list( struct cpu_idx * ); /* returns the number of deleted cpus */ + /* * Initialise the list of CPUs on the system @@ -21,7 +22,7 @@ netsnmp_cpu_info *cpu = netsnmp_cpu_get_byIdx( -1, 1 ); strcpy(cpu->name, "Overall CPU statistics"); -@@ -41,45 +41,61 @@ void init_cpu_kstat( void ) { +@@ -41,45 +43,61 @@ void init_cpu_kstat( void ) { if ((strcmp(ksp->ks_module, "cpu_info") == 0) && (strcmp(ksp->ks_class, "misc" ) == 0)) { kstat_read(kstat_fd, ksp, NULL ); @@ -57,7 +58,7 @@ } + /* -+ * adds the new cpu entry to the exisitng list ++ * adds the new cpu entry to the existing list + */ +static void +add_new_kstat_cpu_entry( kstat_t *ksp ) { @@ -108,7 +109,7 @@ /* Clear overall stats, ready for summing individual CPUs */ cpu->user_ticks = 0; -@@ -94,6 +110,32 @@ int netsnmp_cpu_arch_load( netsnmp_cache *cache, void *magic ) { +@@ -94,6 +112,32 @@ int netsnmp_cpu_arch_load( netsnmp_cache kstat_chain_update( kstat_fd ); DEBUGMSGTL(("cpu", "cpu_kstat load\n ")); @@ -141,7 +142,7 @@ for (ksp = kstat_fd->kc_chain; ksp != NULL; ksp = ksp->ks_next) { if (ksp->ks_flags & KSTAT_FLAG_INVALID) continue; -@@ -135,9 +177,43 @@ int netsnmp_cpu_arch_load( netsnmp_cache *cache, void *magic ) { +@@ -137,9 +181,44 @@ int netsnmp_cpu_arch_load( netsnmp_cache cpu->nCtxSwitches += (unsigned long long)cs.cpu_sysinfo.pswitch; } } @@ -179,7 +180,8 @@ + return head; + } + } -+ ++ DEBUGMSG(("cpu", "(cpu_idx creation failed)\n")); ++ return head; +} + int @@ -187,7 +189,7 @@ { --- a/agent/mibgroup/hardware/cpu/cpu.c +++ b/agent/mibgroup/hardware/cpu/cpu.c -@@ -271,4 +271,60 @@ void _cpu_copy_stats( netsnmp_cpu_info *cpu ) +@@ -271,4 +271,60 @@ void _cpu_copy_stats( netsnmp_cpu_info * cpu2->pageIn = cpu->pageIn; cpu2->pageOut = cpu->pageOut; } @@ -248,40 +250,9 @@ +} + #endif /* NETSNMP_FEATURE_REMOVE_HARDWARE_CPU_COPY_STATS */ ---- a/agent/mibgroup/hardware/cpu/cpu_kstat.c -+++ b/agent/mibgroup/hardware/cpu/cpu_kstat.c -@@ -18,7 +18,9 @@ extern kstat_ctl_t *kstat_fd; - extern int cpu_num; - int _cpu_status(char *state); - static void add_new_kstat_cpu_entry(kstat_t *ksp); -+ - static struct cpu_idx * add_cpu_idx(struct cpu_idx * head, int idx); -+int netsnmp_update_cpu_list( struct cpu_idx * ); /* returns the number of deleted cpus */ - - /* - * Initialise the list of CPUs on the system -@@ -49,7 +51,7 @@ void init_cpu_kstat( void ) { - } - - /* -- * adds the new cpu entry to the exisitng list -+ * adds the new cpu entry to the existing list - */ - static void - add_new_kstat_cpu_entry( kstat_t *ksp ) { -@@ -211,7 +213,8 @@ add_cpu_idx(struct cpu_idx * head, int idx) - return head; - } - } -- -+ DEBUGMSG(("cpu", "(cpu_idx creation failed)\n")); -+ return head; - } - - int --- a/include/net-snmp/agent/hardware/cpu.h +++ b/include/net-snmp/agent/hardware/cpu.h -@@ -66,3 +66,11 @@ netsnmp_cpu_info *netsnmp_cpu_get_byName( char*, int ); +@@ -66,3 +66,11 @@ netsnmp_cpu_info *netsnmp_cpu_get_byName netsnmp_cache *netsnmp_cpu_get_cache( void ); int netsnmp_cpu_load( void ); Modified: csw/mgar/pkg/netsnmp/trunk/files/Makefile.in.diff =================================================================== --- csw/mgar/pkg/netsnmp/trunk/files/Makefile.in.diff 2015-03-02 19:24:13 UTC (rev 24702) +++ csw/mgar/pkg/netsnmp/trunk/files/Makefile.in.diff 2015-03-03 10:06:22 UTC (rev 24703) @@ -1,6 +1,6 @@ --- a/Makefile.in +++ b/Makefile.in -@@ -198,13 +198,13 @@ perlrealclean: +@@ -224,13 +224,13 @@ perlcleanfeatures: # PYMAKE=$(PYTHON) setup.py $(PYTHONARGS) pythonmodules: subdirs This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From bonivart at users.sourceforge.net Tue Mar 3 11:21:59 2015 From: bonivart at users.sourceforge.net (bonivart at users.sourceforge.net) Date: Tue, 3 Mar 2015 10:21:59 +0000 Subject: SF.net SVN: gar:[24704] csw/mgar/pkg/memconf/trunk Message-ID: <3kxDsr5XxZz13G@mail.opencsw.org> Revision: 24704 http://sourceforge.net/p/gar/code/24704 Author: bonivart Date: 2015-03-03 10:21:59 +0000 (Tue, 03 Mar 2015) Log Message: ----------- memconf/trunk: update to 3.06 Modified Paths: -------------- csw/mgar/pkg/memconf/trunk/Makefile csw/mgar/pkg/memconf/trunk/checksums Modified: csw/mgar/pkg/memconf/trunk/Makefile =================================================================== --- csw/mgar/pkg/memconf/trunk/Makefile 2015-03-03 10:06:22 UTC (rev 24703) +++ csw/mgar/pkg/memconf/trunk/Makefile 2015-03-03 10:21:59 UTC (rev 24704) @@ -2,7 +2,7 @@ # rm /home/src/memconf* NAME = memconf -VERSION = 3.04 +VERSION = 3.06 GARTYPE = v2 DESCRIPTION = Perl script that displays memory modules installed Modified: csw/mgar/pkg/memconf/trunk/checksums =================================================================== --- csw/mgar/pkg/memconf/trunk/checksums 2015-03-03 10:06:22 UTC (rev 24703) +++ csw/mgar/pkg/memconf/trunk/checksums 2015-03-03 10:21:59 UTC (rev 24704) @@ -1,2 +1,2 @@ -849f366f3fa4064e498ddfaea86516e5 memconf.gz -4a8ea01482cd757fb63a3dd45b85d4e9 memconf.man +16cd25ca85bb60fbba8453bde85f622d memconf.gz +a8c2af9a6bfe85a1832802ee67ee3c8e memconf.man This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From hjb001 at users.sourceforge.net Tue Mar 3 15:41:10 2015 From: hjb001 at users.sourceforge.net (hjb001 at users.sourceforge.net) Date: Tue, 3 Mar 2015 14:41:10 +0000 Subject: SF.net SVN: gar:[24706] csw/mgar/pkg/netsnmp/trunk/Makefile Message-ID: <3kxLd54335z1CD@mail.opencsw.org> Revision: 24706 http://sourceforge.net/p/gar/code/24706 Author: hjb001 Date: 2015-03-03 14:41:09 +0000 (Tue, 03 Mar 2015) Log Message: ----------- netsnmp/trunk: added preserve of snmpd.conf Modified Paths: -------------- csw/mgar/pkg/netsnmp/trunk/Makefile Modified: csw/mgar/pkg/netsnmp/trunk/Makefile =================================================================== --- csw/mgar/pkg/netsnmp/trunk/Makefile 2015-03-03 12:15:30 UTC (rev 24705) +++ csw/mgar/pkg/netsnmp/trunk/Makefile 2015-03-03 14:41:09 UTC (rev 24706) @@ -69,6 +69,7 @@ INITSMF = $(sysconfdir)/init.d/netsnmpd INITSMF += $(sysconfdir)/init.d/netsnmptrapd +PRESERVECONF = $(sysconfdir)/snmp/snmpd.conf EXTRA_MODULATORS += PYTHON_VERSION MODULATIONS_PYTHON_VERSION = 2.6 2.7 @@ -253,5 +254,5 @@ ginstall -d $(DESTDIR)/$(localstatedir)/log ginstall -m 755 $(WORKSRC)/dist/snmpd-init.d $(DESTDIR)/$(sysconfdir)/init.d/netsnmpd ginstall -m 755 $(WORKSRC)/dist/snmptrapd-init.d $(DESTDIR)/$(sysconfdir)/init.d/netsnmptrapd - ginstall -m 755 $(WORKSRC)/EXAMPLE.conf $(DESTDIR)/$(sysconfdir)/snmp/snmpd.conf + ginstall -m 755 $(WORKSRC)/EXAMPLE.conf $(DESTDIR)/$(sysconfdir)/snmp/snmpd.conf.CSW @$(MAKECOOKIE) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From rmottola at users.sourceforge.net Fri Mar 6 23:33:54 2015 From: rmottola at users.sourceforge.net (rmottola at users.sourceforge.net) Date: Fri, 6 Mar 2015 22:33:54 +0000 Subject: SF.net SVN: gar:[24709] csw/mgar/pkg/libffi/trunk Message-ID: <3kzNz82FWnzCw@mail.opencsw.org> Revision: 24709 http://sourceforge.net/p/gar/code/24709 Author: rmottola Date: 2015-03-06 22:33:54 +0000 (Fri, 06 Mar 2015) Log Message: ----------- updated to 3.2.1 and switched compilation to gcc. Builds and appears to work, package is not yet 100% right though Modified Paths: -------------- csw/mgar/pkg/libffi/trunk/Makefile csw/mgar/pkg/libffi/trunk/checksums Modified: csw/mgar/pkg/libffi/trunk/Makefile =================================================================== --- csw/mgar/pkg/libffi/trunk/Makefile 2015-03-06 14:34:05 UTC (rev 24708) +++ csw/mgar/pkg/libffi/trunk/Makefile 2015-03-06 22:33:54 UTC (rev 24709) @@ -1,7 +1,7 @@ # $Id$ NAME = libffi -VERSION = 3.0.9 +VERSION = 3.2.1 GARTYPE = v2 DESCRIPTION = A portable foreign function interface library @@ -18,38 +18,39 @@ MASTER_SITES = ftp://sourceware.org/pub/libffi/ SPKG_SOURCEURL = http://sourceware.org/libffi/ DISTFILES = $(NAME)-$(VERSION).tar.gz + # Not needed unless using SOS compiler -PATCHFILES += Makefile.in.patch -# Not really needed for build, but for SOS compiler using libffi -PATCHFILES += ffi_common.h.patch -PATCHFILES += ffi_target.h.patch +#PATCHFILES += Makefile.in.patch +# Not really needed for build, but for SOS compiler using libffi (not neeeded for recent libffi) +#PATCHFILES += ffi_common.h.patch + +#PATCHFILES += ffi_target.h.patch + # Fix needed for amd64 using SOS compiler # found at http://software.intel.com/en-us/forums/showthread.php?t=56652 # originally for icc, but at least get the stuff to compile -PATCHFILES += ffi64.c.patch -PATCHFILES += 0005-libffi.pc-should-point-at-opt-csw-include.patch -PATCHFILES += 0006-Set-libdir-to-opt-csw-lib-ffi.patch +# PATCHFILES += ffi64.c.patch +#PATCHFILES += 0005-libffi.pc-should-point-at-opt-csw-include.patch +#PATCHFILES += 0006-Set-libdir-to-opt-csw-lib-ffi.patch -OBSOLETED_BY_CSWlibffi5 = CSWlibffi -OBSOLETED_BY_CSWlibffi5-dev = CSWlibffi -INCOMPATIBLE_PKGS_CSWlibffi5 = CSWlibffi -PACKAGES += CSWlibffi5 -PKGFILES_CSWlibffi5 += $(call baseisadirs,$(libdir),libffi\.so\.5(\.\d+)*) -SPKG_DESC_CSWlibffi5 += $(DESCRIPTION), libffi.so.5 +PACKAGES += CSWlibffi6 +PKGFILES_CSWlibffi6 += $(call baseisadirs,$(libdir),libffi\.so\.6(\.\d+)*) +SPKG_DESC_CSWlibffi6 += $(DESCRIPTION), libffi.so.6 +RUNTIME_DEP_PKGS_CSWlibffi6 += CSWlibgcc-s1 + PACKAGES += CSWlibffi-dev SPKG_DESC_CSWlibffi-dev = $(DESCRIPTION) - developer package -RUNTIME_DEP_PKGS_CSWlibffi-dev += CSWlibffi5 +RUNTIME_DEP_PKGS_CSWlibffi-dev += CSWlibffi6 + LICENSE = LICENSE -BUILD64_LIBS_ONLY = 1 - +GARCOMPILER = GNU CONFIGURE_ARGS = $(DIRPATHS) -# Tests fail since they are written for gcc only -# But they also fails on 64-bit even when using gcc +# disabled because they need DejaGNU #TEST_TARGET = check TEST_TARGET = @@ -72,7 +73,7 @@ post-install-modulated: rm $(DESTDIR)$(libdir)/libffi.so ginstall -m 755 -d $(DESTDIR)$(libdir)/ffi - ln -s ../libffi.so.5.0.10 $(DESTDIR)$(libdir)/ffi/libffi.so + ln -s ../libffi.so.6.0.4 $(DESTDIR)$(libdir)/ffi/libffi.so ginstall -d -m 755 $(DESTDIR)$(includedir) # By default, libffi installer puts include files into a subdirectory under # /opt/csw/lib, which makes the header files hard to find. We're moving Modified: csw/mgar/pkg/libffi/trunk/checksums =================================================================== --- csw/mgar/pkg/libffi/trunk/checksums 2015-03-06 14:34:05 UTC (rev 24708) +++ csw/mgar/pkg/libffi/trunk/checksums 2015-03-06 22:33:54 UTC (rev 24709) @@ -1,5 +1 @@ -08153de5eadceb2e22ee24083d13dc4d Makefile.in.patch -76eebb10e449d11374c09661d448ca99 ffi64.c.patch -c280f263ff0eab3248ea8abd9d0be21c ffi_common.h.patch -0e72bc1c6b8f797377f502e36b8df294 ffi_target.h.patch -1f300a7a7f975d4046f51c3022fa5ff1 libffi-3.0.9.tar.gz +83b89587607e3eb65c70d361f13bab43 libffi-3.2.1.tar.gz This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From rmottola at users.sourceforge.net Sun Mar 8 20:45:19 2015 From: rmottola at users.sourceforge.net (rmottola at users.sourceforge.net) Date: Sun, 8 Mar 2015 19:45:19 +0000 Subject: SF.net SVN: gar:[24711] csw/mgar/pkg/libffi/trunk/Makefile Message-ID: <3l0Y7h6Cfxzkq@mail.opencsw.org> Revision: 24711 http://sourceforge.net/p/gar/code/24711 Author: rmottola Date: 2015-03-08 19:45:18 +0000 (Sun, 08 Mar 2015) Log Message: ----------- enable 64bit Modified Paths: -------------- csw/mgar/pkg/libffi/trunk/Makefile Modified: csw/mgar/pkg/libffi/trunk/Makefile =================================================================== --- csw/mgar/pkg/libffi/trunk/Makefile 2015-03-07 18:12:02 UTC (rev 24710) +++ csw/mgar/pkg/libffi/trunk/Makefile 2015-03-08 19:45:18 UTC (rev 24711) @@ -23,6 +23,9 @@ PACKAGING_PLATFORMS += solaris9-sparc solaris9-i386 PACKAGING_PLATFORMS += solaris10-sparc solaris10-i386 +BUILD64 = 1 + + # Not needed unless using SOS compiler #PATCHFILES += Makefile.in.patch # Not really needed for build, but for SOS compiler using libffi (not neeeded for recent libffi) @@ -51,6 +54,7 @@ LICENSE = LICENSE +BUILD64 = 1 GARCOMPILER = GNU CONFIGURE_ARGS = $(DIRPATHS) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From janholzh at users.sourceforge.net Mon Mar 9 12:58:40 2015 From: janholzh at users.sourceforge.net (janholzh at users.sourceforge.net) Date: Mon, 9 Mar 2015 11:58:40 +0000 Subject: SF.net SVN: gar:[24713] csw/mgar/pkg/tlsinterposer/trunk Message-ID: <3l0ykg2l4qz1Jn@mail.opencsw.org> Revision: 24713 http://sourceforge.net/p/gar/code/24713 Author: janholzh Date: 2015-03-09 11:58:40 +0000 (Mon, 09 Mar 2015) Log Message: ----------- tlsinterposer/trunk: update to 1.3.0 Modified Paths: -------------- csw/mgar/pkg/tlsinterposer/trunk/Makefile csw/mgar/pkg/tlsinterposer/trunk/checksums Added Paths: ----------- csw/mgar/pkg/tlsinterposer/trunk/files/0001-create_ssl_version.patch Modified: csw/mgar/pkg/tlsinterposer/trunk/Makefile =================================================================== --- csw/mgar/pkg/tlsinterposer/trunk/Makefile 2015-03-09 10:53:08 UTC (rev 24712) +++ csw/mgar/pkg/tlsinterposer/trunk/Makefile 2015-03-09 11:58:40 UTC (rev 24713) @@ -2,13 +2,14 @@ # TODO (release-critical prefixed with !, non release-critical with *) # NAME = tlsinterposer -VERSION = 1.1.0 +VERSION = 1.3.0 GARTYPE = v2 DESCRIPTION = OpenSSL library interposer to make existing binary software use more secure TLS protocol variants MASTER_SITES = https://github.com/Netfuture/tlsinterposer/archive/ DISTFILES = v$(VERSION).tar.gz +PATCHFILES += 0001-create_ssl_version.patch LICENSE = LICENSE.txt Modified: csw/mgar/pkg/tlsinterposer/trunk/checksums =================================================================== --- csw/mgar/pkg/tlsinterposer/trunk/checksums 2015-03-09 10:53:08 UTC (rev 24712) +++ csw/mgar/pkg/tlsinterposer/trunk/checksums 2015-03-09 11:58:40 UTC (rev 24713) @@ -1 +1 @@ -c20a72167ab9dc6a273101167b85df7a v1.1.0.tar.gz +eb6a25af76fdd8fc033834016b053f19 v1.3.0.tar.gz Added: csw/mgar/pkg/tlsinterposer/trunk/files/0001-create_ssl_version.patch =================================================================== --- csw/mgar/pkg/tlsinterposer/trunk/files/0001-create_ssl_version.patch (rev 0) +++ csw/mgar/pkg/tlsinterposer/trunk/files/0001-create_ssl_version.patch 2015-03-09 11:58:40 UTC (rev 24713) @@ -0,0 +1,20 @@ +From 246b9216d53e6327b96591f493c3196b3384e836 Mon Sep 17 00:00:00 2001 +From: Jan Holzhueter +Date: Mon, 9 Mar 2015 12:53:49 +0100 +Subject: [PATCH] create_ssl_version + +--- + ssl-version.h | 1 + + 1 file changed, 1 insertion(+) + create mode 100644 ssl-version.h + +diff --git a/ssl-version.h b/ssl-version.h +new file mode 100644 +index 0000000..6adb966 +--- /dev/null ++++ b/ssl-version.h +@@ -0,0 +1 @@ ++#define DEFAULT_SSLLIB "libssl.so.1.0.0" +-- +2.3.1 + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From wahwah at users.sourceforge.net Wed Mar 11 01:15:15 2015 From: wahwah at users.sourceforge.net (wahwah at users.sourceforge.net) Date: Wed, 11 Mar 2015 00:15:15 +0000 Subject: SF.net SVN: gar:[24715] csw/mgar/pkg/opencsw-manual/trunk/files/ for-developers/index.rst Message-ID: <3l1v266pRtzQg@mail.opencsw.org> Revision: 24715 http://sourceforge.net/p/gar/code/24715 Author: wahwah Date: 2015-03-11 00:15:14 +0000 (Wed, 11 Mar 2015) Log Message: ----------- opencsw-manual/trunk: Updates to the developer docs Modified Paths: -------------- csw/mgar/pkg/opencsw-manual/trunk/files/for-developers/index.rst Modified: csw/mgar/pkg/opencsw-manual/trunk/files/for-developers/index.rst =================================================================== --- csw/mgar/pkg/opencsw-manual/trunk/files/for-developers/index.rst 2015-03-10 09:55:08 UTC (rev 24714) +++ csw/mgar/pkg/opencsw-manual/trunk/files/for-developers/index.rst 2015-03-11 00:15:14 UTC (rev 24715) @@ -14,15 +14,30 @@ relevant ``*_dev`` packages. They contain the header files, and ``*.so`` symlinks necessary during linking. -When building againt OpenCSW software, aside from setting the ``PATH`` -correctly, these flags will typically make it work:: +Typical file layout of libraries:: + CSWfoo_dev: /opt/csw/include/foo.h + /opt/csw/lib/libfoo.so -> libfoo.so.1 + CSWlibfoo1: /opt/csw/lib/libfoo.so.1 -> libfoo.so.1.0.0 + /opt/csw/lib/libfoo.so.1.0.0 (regular file) + +Autotools and GCC +----------------- + +Set ``PATH`` to include the path to the compiler you wish to use. If you're +using GCC from OpenCSW, you set it to ``/opt/csw/bin``. + +Autotools-based projects by default accept a standard set of environment +variables. Here are values for a 32-bit build:: + + CFLAGS="-m32" # if you're using GCC CPPFLAGS="-I/opt/csw/include" LDFLAGS="-L/opt/csw/lib -R/opt/csw/lib" PKG_CONFIG_PATH="/opt/csw/lib/pkgconfig" If you're building a 64-bit binary, use these:: + CFLAGS="-m64" # if you're using GCC CPPFLAGS="-I/opt/csw/include" LDFLAGS="-L/opt/csw/lib/64 -R/opt/csw/lib/64" PKG_CONFIG_PATH="/opt/csw/lib/64/pkgconfig" @@ -40,3 +55,27 @@ that path and find their corresponding sparcv9 or amd64 libraries. This way you can use the same ``-R`` flag for both sparc and intel 64-bit builds. +We recommend the `Autotools Mythbuster`_ as a reference to Autotools. + +A non-autotools project +----------------------- + +If you're building a project which does not use autotools, you need to +tell the compiler to do the following: + +1. Look into ``/opt/csw/include`` for the ``.h`` files. In GCC, it's achieved + with ``-I/opt/csw/include``. Without it, compilation will fail. +2. Look into ``/opt/csw/lib`` for the ``.so`` files. In GCC, it's achieved + with ``-L/opt/csw/lib``. Without it, linking will fail. +3. Put ``/opt/csw/lib`` into the ``RPATH`` field in the ELF header. In GCC, + this is achieved with ``-R/otp/csw/lib/``. Without it, binaries will build, + but won't run. + +For 64-bit builds, use ``/opt/csw/lib/64``. + +If your compiler is not GCC, you might need to pass different flags. + +How to add flags to the compiler invocations, depends on the build system of +the software you're building. + +.. _Autotools Mythbuster: https://autotools.io/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From hjb001 at users.sourceforge.net Thu Mar 12 08:59:15 2015 From: hjb001 at users.sourceforge.net (hjb001 at users.sourceforge.net) Date: Thu, 12 Mar 2015 07:59:15 +0000 Subject: SF.net SVN: gar:[24717] csw/mgar/pkg/netsnmp/trunk Message-ID: <3l2jH24FSlzvd@mail.opencsw.org> Revision: 24717 http://sourceforge.net/p/gar/code/24717 Author: hjb001 Date: 2015-03-12 07:59:14 +0000 (Thu, 12 Mar 2015) Log Message: ----------- netsnmp/trunk: patch added: reduced cache aging period to three seconds - used for IF-MIB 3s cache ttl Modified Paths: -------------- csw/mgar/pkg/netsnmp/trunk/Makefile Added Paths: ----------- csw/mgar/pkg/netsnmp/trunk/files/0053-three-seconds.patch Modified: csw/mgar/pkg/netsnmp/trunk/Makefile =================================================================== --- csw/mgar/pkg/netsnmp/trunk/Makefile 2015-03-11 19:05:35 UTC (rev 24716) +++ csw/mgar/pkg/netsnmp/trunk/Makefile 2015-03-12 07:59:14 UTC (rev 24717) @@ -50,6 +50,9 @@ # this CVE is already fixed in 5.7.3 # PATCHFILES += 0051-CVE-2014-2285.patch PATCHFILES += 0052-dyn-cpu-cpu_kstat.patch +# upstream patch https://sourceforge.net/p/net-snmp/patches/1297/ +# has been included upstream and can be removed when moving to next higher version +PATCHFILES += 0053-three-seconds.patch VENDOR_URL = http://www.net-snmp.org/ Added: csw/mgar/pkg/netsnmp/trunk/files/0053-three-seconds.patch =================================================================== --- csw/mgar/pkg/netsnmp/trunk/files/0053-three-seconds.patch (rev 0) +++ csw/mgar/pkg/netsnmp/trunk/files/0053-three-seconds.patch 2015-03-12 07:59:14 UTC (rev 24717) @@ -0,0 +1,27 @@ +--- a/agent/mibgroup/kernel_sunos5.c ++++ b/agent/mibgroup/kernel_sunos5.c +@@ -82,7 +82,7 @@ kstat_ctl_t *kstat_fd = 0; + static + mibcache Mibcache[MIBCACHE_SIZE+1] = { + {MIB_SYSTEM, 0, (void *) -1, 0, 0, 0, 0}, +- {MIB_INTERFACES, 128 * sizeof(mib2_ifEntry_t), (void *) -1, 0, 30, 0, ++ {MIB_INTERFACES, 128 * sizeof(mib2_ifEntry_t), (void *) -1, 0, 3, 0, + 0}, + {MIB_AT, 0, (void *) -1, 0, 0, 0, 0}, + {MIB_IP, sizeof(mib2_ip_t), (void *) -1, 0, 60, 0, 0}, +@@ -257,14 +257,10 @@ void + init_kernel_sunos5(void) + { + static int creg = 0; +- const int period = 30; ++ const int period = 3; + int alarm_id = 0; + + if (creg == 0) { +- alarm_id = snmp_alarm_register(5, NULL, kernel_sunos5_cache_age, +- NULL); +- DEBUGMSGTL(("kernel_sunos5", "registered alarm %d with period 5s\n", +- alarm_id)); + alarm_id = snmp_alarm_register(period, SA_REPEAT, + kernel_sunos5_cache_age, + (void *)period); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From hjb001 at users.sourceforge.net Thu Mar 12 13:43:30 2015 From: hjb001 at users.sourceforge.net (hjb001 at users.sourceforge.net) Date: Thu, 12 Mar 2015 12:43:30 +0000 Subject: SF.net SVN: gar:[24718] csw/mgar/pkg/netsnmp/trunk/files Message-ID: <3l2qb31g5tz11W@mail.opencsw.org> Revision: 24718 http://sourceforge.net/p/gar/code/24718 Author: hjb001 Date: 2015-03-12 12:43:30 +0000 (Thu, 12 Mar 2015) Log Message: ----------- netsnmp/trunk: removed obsolete old_libs_* Removed Paths: ------------- csw/mgar/pkg/netsnmp/trunk/files/old_libs_i.tar.gz csw/mgar/pkg/netsnmp/trunk/files/old_libs_s.tar.gz Deleted: csw/mgar/pkg/netsnmp/trunk/files/old_libs_i.tar.gz =================================================================== (Binary files differ) Deleted: csw/mgar/pkg/netsnmp/trunk/files/old_libs_s.tar.gz =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From jake_goerzen at users.sourceforge.net Fri Mar 13 00:52:23 2015 From: jake_goerzen at users.sourceforge.net (jake_goerzen at users.sourceforge.net) Date: Thu, 12 Mar 2015 23:52:23 +0000 Subject: SF.net SVN: gar:[24720] csw/mgar/pkg/dovecot/trunk Message-ID: <3l36Qv1dlsz1Hy@mail.opencsw.org> Revision: 24720 http://sourceforge.net/p/gar/code/24720 Author: jake_goerzen Date: 2015-03-12 23:52:23 +0000 (Thu, 12 Mar 2015) Log Message: ----------- dovecot: update to 2.2.16 Modified Paths: -------------- csw/mgar/pkg/dovecot/trunk/Makefile csw/mgar/pkg/dovecot/trunk/checksums Modified: csw/mgar/pkg/dovecot/trunk/Makefile =================================================================== --- csw/mgar/pkg/dovecot/trunk/Makefile 2015-03-12 13:59:41 UTC (rev 24719) +++ csw/mgar/pkg/dovecot/trunk/Makefile 2015-03-12 23:52:23 UTC (rev 24720) @@ -2,7 +2,7 @@ # - SSL certs to /etc/opt/csw/ssl? # - /var/run/dovecot instead of /var/opt/csw/run? NAME = dovecot -VERSION = 2.2.15 +VERSION = 2.2.16 GARTYPE = v2 DESCRIPTION = Secure IMAP server Modified: csw/mgar/pkg/dovecot/trunk/checksums =================================================================== --- csw/mgar/pkg/dovecot/trunk/checksums 2015-03-12 13:59:41 UTC (rev 24719) +++ csw/mgar/pkg/dovecot/trunk/checksums 2015-03-12 23:52:23 UTC (rev 24720) @@ -1 +1 @@ -c6c176943bd832c780fbb5d2f8850952 dovecot-2.2.15.tar.gz +8dba21e817b4239e462d98a925233418 dovecot-2.2.16.tar.gz This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From hjb001 at users.sourceforge.net Sun Mar 15 19:50:21 2015 From: hjb001 at users.sourceforge.net (hjb001 at users.sourceforge.net) Date: Sun, 15 Mar 2015 18:50:21 +0000 Subject: SF.net SVN: gar:[24722] csw/mgar/pkg/netsnmp/trunk/Makefile Message-ID: <3l4qb15R6VzfB@mail.opencsw.org> Revision: 24722 http://sourceforge.net/p/gar/code/24722 Author: hjb001 Date: 2015-03-15 18:50:20 +0000 (Sun, 15 Mar 2015) Log Message: ----------- netsnmp/trunk: PACKAGING_PLATFORM commented out - Sol 11 doesn't build remarks about special mapfile Modified Paths: -------------- csw/mgar/pkg/netsnmp/trunk/Makefile Modified: csw/mgar/pkg/netsnmp/trunk/Makefile =================================================================== --- csw/mgar/pkg/netsnmp/trunk/Makefile 2015-03-13 16:05:33 UTC (rev 24721) +++ csw/mgar/pkg/netsnmp/trunk/Makefile 2015-03-15 18:50:20 UTC (rev 24722) @@ -69,7 +69,8 @@ BUILD_DEP_PKGS += CSWpython-dev BUILD_DEP_PKGS += CSWpython27-dev -PACKAGING_PLATFORMS += solaris10-sparc solaris10-i386 solaris11-sparc solaris11-i386 +### 20150312/hjb - solaris 11 doesn't build +#PACKAGING_PLATFORMS += solaris10-sparc solaris10-i386 solaris11-sparc solaris11-i386 INITSMF = $(sysconfdir)/init.d/netsnmpd INITSMF += $(sysconfdir)/init.d/netsnmptrapd @@ -187,6 +188,14 @@ # EXTRA_LINKER_FLAGS = $(RUNPATH_LINKER_FLAGS) -xnorunpath # EXTRA_LDFLAGS = $(LD_OPTIONS) #map file broken somehow user special on +# 20150316/hjb this is due to a "bug" in ld which fails if a mapfile +# is specified twice to -M. That happens here because LD_OPTIONS is set +# during build of python modules - the compiler/linker flags are inherited +# from pythons' build itself - so we end up with -M set twice. +# ld then complains about ADDVERS beeing specified but not used, even if +# it should just ignore that. Note this only happens with libs that are +# explicitely linked via -l, -lnsl in this case. +# The special mapfile contains no libnsl.so specification to "solve" this. LINKER_MAPS ?= -M "$(abspath $(WORKDIR)/map.special)" CONFIGURE_ARGS_mm-32 = --disable-embedded-perl This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From rmottola at users.sourceforge.net Sun Mar 15 22:35:43 2015 From: rmottola at users.sourceforge.net (rmottola at users.sourceforge.net) Date: Sun, 15 Mar 2015 21:35:43 +0000 Subject: SF.net SVN: gar:[24723] csw/mgar/pkg/libffi/trunk Message-ID: <3l4vFh3tskzjq@mail.opencsw.org> Revision: 24723 http://sourceforge.net/p/gar/code/24723 Author: rmottola Date: 2015-03-15 21:35:43 +0000 (Sun, 15 Mar 2015) Log Message: ----------- patch unwind test Modified Paths: -------------- csw/mgar/pkg/libffi/trunk/Makefile Added Paths: ----------- csw/mgar/pkg/libffi/trunk/files/configure.patch Modified: csw/mgar/pkg/libffi/trunk/Makefile =================================================================== --- csw/mgar/pkg/libffi/trunk/Makefile 2015-03-15 18:50:20 UTC (rev 24722) +++ csw/mgar/pkg/libffi/trunk/Makefile 2015-03-15 21:35:43 UTC (rev 24723) @@ -26,6 +26,8 @@ BUILD64 = 1 +#fix unwind test +PATCHFILES += configure.patch # Not needed unless using SOS compiler #PATCHFILES += Makefile.in.patch # Not really needed for build, but for SOS compiler using libffi (not neeeded for recent libffi) Added: csw/mgar/pkg/libffi/trunk/files/configure.patch =================================================================== --- csw/mgar/pkg/libffi/trunk/files/configure.patch (rev 0) +++ csw/mgar/pkg/libffi/trunk/files/configure.patch 2015-03-15 21:35:43 UTC (rev 24723) @@ -0,0 +1,11 @@ +--- a/configure.orig Sun Mar 15 22:01:08 2015 ++++ b/configure Sun Mar 15 22:01:40 2015 +@@ -18571,7 +18571,7 @@ + # we ensure that we can compile _and_ link an assembly file containing an @unwind section + # since the compiler can support it and not the linker (ie old binutils) + if $CC -Wa,--fatal-warnings $CFLAGS -c conftest1.s > /dev/null 2>&1 && \ +- $CC conftest2.c conftest1.o > /dev/null 2>&1 ; then ++ $CC $CFLAGS conftest2.c conftest1.o > /dev/null 2>&1 ; then + libffi_cv_as_x86_64_unwind_section_type=yes + fi + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From cgrzemba at users.sourceforge.net Mon Mar 16 12:25:29 2015 From: cgrzemba at users.sourceforge.net (cgrzemba at users.sourceforge.net) Date: Mon, 16 Mar 2015 11:25:29 +0000 Subject: SF.net SVN: gar:[24724] csw/mgar/pkg/lang-java/389-ds-console/trunk Message-ID: <3l5Fg80yJ7z17h@mail.opencsw.org> Revision: 24724 http://sourceforge.net/p/gar/code/24724 Author: cgrzemba Date: 2015-03-16 11:25:29 +0000 (Mon, 16 Mar 2015) Log Message: ----------- lang-java/389-ds-console/trunk: update version 1.2.10 Modified Paths: -------------- csw/mgar/pkg/lang-java/389-ds-console/trunk/Makefile csw/mgar/pkg/lang-java/389-ds-console/trunk/checksums Modified: csw/mgar/pkg/lang-java/389-ds-console/trunk/Makefile =================================================================== --- csw/mgar/pkg/lang-java/389-ds-console/trunk/Makefile 2015-03-15 21:35:43 UTC (rev 24723) +++ csw/mgar/pkg/lang-java/389-ds-console/trunk/Makefile 2015-03-16 11:25:29 UTC (rev 24724) @@ -3,7 +3,7 @@ # NAME = 389-ds-console SHORTNAME = 389-ds -VERSION = 1.2.6 +VERSION = 1.2.10 MAJOR_VERSION = 1.2 GARTYPE = v2 CATEGORIES = java @@ -14,9 +14,11 @@ Administration Server and 389 Directory Server. endef -MASTER_SITES = http://port389.org/sources -DISTFILES = $(NAME)-$(VERSION).tar.bz2 +MASTER_SITES = https://git.fedorahosted.org/cgit/389/ds-console.git/snapshot/ +DISTNAME = ds-console-$(NAME)-$(VERSION) +DISTFILES = $(DISTNAME).tar.xz + BUNDLE = 389-ds PACKAGES = CSW389-ds-console Modified: csw/mgar/pkg/lang-java/389-ds-console/trunk/checksums =================================================================== --- csw/mgar/pkg/lang-java/389-ds-console/trunk/checksums 2015-03-15 21:35:43 UTC (rev 24723) +++ csw/mgar/pkg/lang-java/389-ds-console/trunk/checksums 2015-03-16 11:25:29 UTC (rev 24724) @@ -1 +1 @@ -c53161badabc0715f78bdcefee810c40 389-ds-console-1.2.6.tar.bz2 +a08154bbeec28274d98034bd4cce7425 ds-console-389-ds-console-1.2.10.tar.xz This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From wahwah at users.sourceforge.net Mon Mar 16 16:55:01 2015 From: wahwah at users.sourceforge.net (wahwah at users.sourceforge.net) Date: Mon, 16 Mar 2015 15:55:01 +0000 Subject: SF.net SVN: gar:[24726] csw/mgar/pkg/opencsw-manual/trunk/files/ for-maintainers/automated-release-process.rst Message-ID: <3l5MfL1nhGz1SQ@mail.opencsw.org> Revision: 24726 http://sourceforge.net/p/gar/code/24726 Author: wahwah Date: 2015-03-16 15:55:01 +0000 (Mon, 16 Mar 2015) Log Message: ----------- opencsw-manual/trunk: Update the automated release process page to ReText syntax Modified Paths: -------------- csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/automated-release-process.rst Modified: csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/automated-release-process.rst =================================================================== --- csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/automated-release-process.rst 2015-03-16 15:54:07 UTC (rev 24725) +++ csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/automated-release-process.rst 2015-03-16 15:55:01 UTC (rev 24726) @@ -1,220 +1,94 @@ -[[toc]] +.. $Id$ -+ Usage +------------------------- +Automated release process +------------------------- -The csw-upload-pkg utility is used to upload packages to OpenCSW catalogs. By default, it uploads your packages to the unstable catalog. The utility must be run on the login host. +The ``csw-upload-pkg`` utility is used to upload packages to OpenCSW catalogs. +By default, it uploads your packages to the unstable catalog. The utility must +be run on the login host. -[[code]] -maciej at login [login]:~ > csw-upload-pkg -Usage: csw-upload-pkg [ options ] [ [ ... ] ] +:: -Uploads a set of packages to the unstable catalog in opencsw-future. + maciej at login [login]:~ > csw-upload-pkg + Usage: csw-upload-pkg [ options ] [ [ ... ] ] -- When an architecture-independent package is uploaded, it gets added to both - sparc and i386 catalogs + (..help message...) -- When a SunOS5.x package is sent, it's added to catalogs SunOS5.x, - SunOS5.(x+1), up to SunOS5.11, but only if there are no packages specific to - 5.10 (and/or 5.11). +Make sure you upload both Intel and SPARC packages in a single call to +``csw-upload-pkg``. -- If a package update is sent, the tool uses both the catalogname and the - pkgname to identify the package it's updating. For example, you might upload - foo_stub/CSWfoo and mean to replace foo/CSWfoo with it. +Once your packages are sent, you can verify the state of the checkpkg database +by visiting the web frontend of the checkpkg database [#catalog-list]_ and +inspecting the catalogs you expect your package to be. -The --os-release flag makes csw-upload-pkg only insert the package to catalog with the -given OS release. +The opencsw-future tree [#opencsw-future]_ on the mirror host is updated +a couple times per day. Your uploaded packages will appear there eventually. -The --catalog-release flag allows to insert a package into a specific catalog, -instead of the default 'unstable'. +In case of problems with the tool, please re-run the tool in debug mode +(``--debug``) and send full output to maintainers at . -= General considerations = +Infrastructure +-------------- -This tool operates on a database of packages and a package file store. It -modifies a number of package catalogs, e.g.: +* Buildfarm - a collection of Solaris zones and hardware hosting them +* Buildfarm database is a MySQL database on the buildfarm, on the mysql + zone (mysql.bo.opencsw.org) +* Web interface for the buildfarm database http://buildfarm.opencsw.org/pkgdb/ +* External REST interface at http://buildfarm.opencsw.org/pkgdb/rest/ +* Internal REST interface at http://buildfarm.opencsw.org/releases/ +* Master mirror at http://mirror.opencsw.org +* unstable catalog at http://mirror.opencsw.org/opencsw/unstable/ +* Source code at https://sourceforge.net/p/gar/code/HEAD/tree/csw/mgar/gar/v2/lib/python/ - {{dublin,unstable,kiel,bratislava}}x{{sparc,i386}}x{{5.8,5.9.5.10,5.11}} +Uploading a package +------------------- -For more information, see: -http://wiki.opencsw.org/automated-release-process#toc0 -[[/code]] +What happens when you upload a package using csw-upload-pkg, these things +happen: -Once your packages are sent, you can verify the state of the checkpkg database by visiting the web frontend of the checkpkg database[[footnote]][http://buildfarm.opencsw.org/pkgdb/catalogs/ Catalog list in the checkpkg database frontend][[/footnote]] and inspecting the catalogs you expect your package to be. +#. csw-upload-pkg examines the given file name set for correctness -The opencsw-future tree[[footnote]][http://mirror.opencsw.org/opencsw-future/ opencsw-future catalog tree][[/footnote]] on the mirror host is updated a couple times per day. Your uploaded packages will appear there eventually. + * It alerts in certain conditions, e.g. a present i386 file but missing sparc file, or an UNCOMMITTED tag -In case of any problems with the tool, please re-run the tool in debug mode (--debug) and send full output to Maciej. +#. csw-upload-pkg runs 'pkgdb importpkg' to make sure that your package's metadata are imported to the buildfarm database +#. csw-upload-pkg queries the external rest interface for package metadata; it verifies that metadata have been uploaded successfully +#. csw-upload-pkg queries the internal rest interface to know whether package data (as opposed to metadata) are uploaded to the master mirror -+ Infrastructure + * if not yet there, csw-upload-pkg sends a POST request with package data -* **Buildfarm** - a collection of Solaris zones and hardware hosting them -* **Buildfarm database** is a MySQL database on the buildfarm, on the mysql zone (mysql.bo.opencsw.org) -* **Web interface for the buildfarm database** http://buildfarm.opencsw.org/pkgdb/ -* **External REST interface** at http://buildfarm.opencsw.org/pkgdb/rest/ -* **Internal REST interface** at http://buildfarm.opencsw.org/releases/ -* **Master mirror** at http://mirror.opencsw.org -* **unstable catalog** at http://mirror.opencsw.org/opencsw-future/unstable/ -* **[http://sourceforge.net/apps/trac/gar/browser/csw/mgar/gar/v2/lib/python Source code]** of those applications is available from SourceForge. +#. csw-upload-pkg queries the external rest interface for contents of catalogs +#. csw-upload-pkg calculates which packages to insert to which catalogs -++ Uploading a package + * Depending on the given file set and catalog contents, 5.9 packages may or may not be inserted into 5.10 and 5.11 catalogs -Here's a rough description of what happens when you upload a package using csw-upload-pkg. +#. csw-upload-pkg sends a sequence of DELETE and PUT queries to the internal rest interface to modify catalogs -# csw-upload-pkg examines the given file name set for correctness - * It alerts in certain conditions, e.g. a present i386 file but missing sparc file, or an UNCOMMITTED tag -# csw-upload-pkg runs 'pkgdb importpkg' to make sure that your package's metadata are imported to the buildfarm database -# csw-upload-pkg queries the external rest interface for package metadata; it verifies that metadata have been uploaded successfully -# csw-upload-pkg queries the internal rest interface to know whether package data (as opposed to metadata) are uploaded to the master mirror - * if not yet there, csw-upload-pkg sends a POST request with package data -# csw-upload-pkg queries the external rest interface for contents of catalogs -# csw-upload-pkg calculates which packages to insert to which catalogs - * Depending on the given file set and catalog contents, 5.9 packages may or may not be inserted into 5.10 and 5.11 catalogs -# csw-upload-pkg sends a sequence of DELETE and PUT queries to the internal rest interface to modify catalogs +Catalog generation +------------------ -++ Catalog generation +web zone runs a cron job which wakes up every 3h and performs a set of tasks. +It generates a new unstable catalog from the database, and pushes it to the +master mirror. -web zone runs a cron job which wakes up every 3h and performs a set of tasks. It generates a new unstable catalog from the database, and pushes it to the master mirror. - * pkgdb is invoked, and it generates a catalog at the given location - * pkgdb uses a direct MySQL connection -* catalog notifier is run, and sends e-mails to the maintainers of modified packages -* A cron job on unstable9x generates atom feeds for each catalog every hour. For the time being, they can be found in [http://buildfarm.opencsw.org/~bwalton Ben's directory]. -++ Promoting / copying packages between releases + * pkgdb uses a direct MySQL connection -//([http://lists.opencsw.org/pipermail/maintainers/2013-July/018220.html mailing list discussion])// +* catalog notifier is run, and sends e-mails to the maintainers of modified packages +* A cron job on unstable9x generates atom feeds for each catalog every hour. -The integrate_catalogs.py script is used. For example: +Promoting / copying packages between releases +--------------------------------------------- -[[code]] -lib/python/integrate_catalogs.py \ - --from-catalog=unstable \ - --to-catalog=kiel \ - -o to_kiel_17.sh +http://lists.opencsw.org/pipermail/maintainers/2013-July/018220.html mailing list discussion -vim to_kiel_17.sh +Automated, runs once a day. Reports are at +http://buildfarm.opencsw.org/package-promotions/promote-packages.html -# Looks good? -bash to_kiel_17.sh -[[/code]] +.. [#catalog-list] `Catalog list in the checkpkg database. + `_ +.. [#opencsw-future] `opencsw-future catalog tree + `_ -The number 17 is just there for tracking; I'm keeping the previous generated integration scripts to keep track of what I've done in the past. -The task requires manual/mental tracking of the state of unstable, e.g. you need to know if unstable is in a good enough shape to be integrated/copied to testing. - -The integrate_catalogs.py script itself does not perform any operations. It queries the database and generates a shell script. You then review the shell script, make modifications as needed, and execute it. The operations in the shell script are low level: removing and creating associations between catalogs and svr4 package files, identified by md5 sums. For example it's "add to 5.9/unstable/i386". In practice, you mostly edit the shell script to delete some lines in order to prevent some packages from being promoted, e.g. if you know that certain package is currently buggy in unstable. - -The script defines the basic operations, using curl and the REST interface: - -[[code]] -function _add_to_cat { - ${CURL} -X PUT ${REST_URL}catalogs/$1/$2/$3/$4/ ; echo -} - -function _del_from_cat { - ${CURL} -X DELETE ${REST_URL}catalogs/$1/$2/$3/$4/ ; echo -} -[[/code]] - -Then it defines a function to push a specific package: - -[[code]] -function upgrade_apache2 { - # apache2 upgrade from 2.2.22,REV=2012.06.01 to 2.2.24,REV=2013.06.17 - _del_from_cat kiel sparc SunOS5.10 697eb40b67ffcb1da7bd36d4dcf28102 - _add_to_cat kiel sparc SunOS5.10 2ed8346d32734206398497e1ff1798e3 - # apache2 upgrade from 2.2.22,REV=2012.06.01 to 2.2.24,REV=2013.06.17 - _del_from_cat kiel sparc SunOS5.11 697eb40b67ffcb1da7bd36d4dcf28102 - _add_to_cat kiel sparc SunOS5.11 2ed8346d32734206398497e1ff1798e3 - # apache2 upgrade from 2.2.22,REV=2012.06.01 to 2.2.24,REV=2013.06.17 - _del_from_cat kiel i386 SunOS5.10 4faee5142d978e27bee8372275327ed6 - _add_to_cat kiel i386 SunOS5.10 145bd67387314ad5028178f6df27b96d - # apache2 upgrade from 2.2.22,REV=2012.06.01 to 2.2.24,REV=2013.06.17 - _del_from_cat kiel i386 SunOS5.11 4faee5142d978e27bee8372275327ed6 - _add_to_cat kiel i386 SunOS5.11 145bd67387314ad5028178f6df27b96d -} -[[/code]] - -Additionally, there are the undo functions in the shell script. After -executing the script you save it, and if anything needs to be rolled -back, there are functions in the shell script to reverse the -operation. - -[[code]] -function undo_upgrade_apache2 { - # UNDO of apache2 upgrade from 2.2.22,REV=2012.06.01 to 2.2.24,REV=2013.06.17 - _del_from_cat kiel sparc SunOS5.10 2ed8346d32734206398497e1ff1798e3 - _add_to_cat kiel sparc SunOS5.10 697eb40b67ffcb1da7bd36d4dcf28102 - # UNDO of apache2 upgrade from 2.2.22,REV=2012.06.01 to 2.2.24,REV=2013.06.17 - _del_from_cat kiel sparc SunOS5.11 2ed8346d32734206398497e1ff1798e3 - _add_to_cat kiel sparc SunOS5.11 697eb40b67ffcb1da7bd36d4dcf28102 - # UNDO of apache2 upgrade from 2.2.22,REV=2012.06.01 to 2.2.24,REV=2013.06.17 - _del_from_cat kiel i386 SunOS5.10 145bd67387314ad5028178f6df27b96d - _add_to_cat kiel i386 SunOS5.10 4faee5142d978e27bee8372275327ed6 - # UNDO of apache2 upgrade from 2.2.22,REV=2012.06.01 to 2.2.24,REV=2013.06.17 - _del_from_cat kiel i386 SunOS5.11 145bd67387314ad5028178f6df27b96d - _add_to_cat kiel i386 SunOS5.11 4faee5142d978e27bee8372275327ed6 -} -[[/code]] - -In the final section of the script, the upgrade functions are called: - -[[code]] -upgrade_apache2 # version 2.2.22,REV=2012.06.01 to 2.2.24,REV=2013.06.17 # bundles:httpd -[[/code]] - -All these operations need to be performed on the login host. - -++ Connections - -This image is generated from a [http://sourceforge.net/apps/trac/gar/browser/csw/mgar/gar/v2/doc/connections.dot graphviz file] available from gar source code repository. It describes connections made by various infrastructure components. - -[[=image connections.png size="medium"]] - -+ Discussion - -Pains with the current process: -* --Released packages are sometimes still in testing/ (fixed by Dago)-- -* --The whole process includes too many manual steps, which could be automated-- -* --Mixed usage of testing/ for developer testing and user testing-- - -Comparison of new catalog layout with Debian: - -||~ Debian ||~ OpenCSW ||~ Who puts stuff there ||~ an example command || -|| Experimental || {{experimental/}} || by the maintainer || {{cp /home/experimental/}} || -|| Unstable || {{unstable/}} || by the maintainer || {{csw-upload-pkg}} || -|| Testing / Named release || {{testing/}} | {{kiel/}} || by an automated job || //not implemented// || -|| Stable / Named release || {{stable/}} | {{dublin/}} || by release manager || {{rm stable; ln -s dublin stable}} || - -For each catalog there is a set of machines equipped with the packages from the catalog. The catalog is always an overlay over the more stable version. That means the catalog for testing contains all packages from current, where the packages from testing supersede the ones from current. - -||~ {{experimental/}} ||~ {{unstable/}} ||~ {{testing/}} ||~ {{stable/}} || -|| e8s / e8x || u8s / u8x || t8s / t8x || s8s / s8x || -|| e9s / e9x || u9s / u9x || t9s / t9x || s9s / s9x || -|| e10s / e10x || u10s / u10x || t10s / t10x || s10s / s10x || -|| eosols / eosolx || uosols / uosolx || tosols / tosolx || sosols / sosolx || - -Experimental has the notion of "projects", which allows a grouping of packages for release (like for XML Toolchain, X11, Gnome, etc.) -Package releases are directly made out of GAR: -[[code]] -gmake submitpkg[-] -[[/code]] -This checks if everything has been committed (like now when CSW is put in instead of UNCOMMITTED) and makes a server-side copy in SVN to tags as tags/[_]-,REV=... (implemented in gar/v2-pbuild). - -TBD: This triggers the automated buildbot which puts the packages automatically in experimental after building. - -The same procedure is triggered by the upstream watch: -# Check out -# Copy trunk to {{tags/-_REV=...}} with the new version -# Update Revision -# gmake makesum -# gmake garchive -# Commit changes -# (Trigger automatic buildbot build) -# Mail maintainer after build has finished - -In Oslo we talked about additional commands like csw-build and csw-release initiated by Trygve, maybe he can write something about the usage? - -++ See also - -* [[[Releases and staging]]] -* [[[Release process]]] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From cgrzemba at users.sourceforge.net Tue Mar 17 12:20:15 2015 From: cgrzemba at users.sourceforge.net (cgrzemba at users.sourceforge.net) Date: Tue, 17 Mar 2015 11:20:15 +0000 Subject: SF.net SVN: gar:[24730] csw/mgar/pkg/389-ds-base/branches/vers1.3.2 Message-ID: <3l5sVr6w2czsH@mail.opencsw.org> Revision: 24730 http://sourceforge.net/p/gar/code/24730 Author: cgrzemba Date: 2015-03-17 11:20:14 +0000 (Tue, 17 Mar 2015) Log Message: ----------- 389-ds-base/branches/vers1.3.2: update version 1.3.24 Modified Paths: -------------- csw/mgar/pkg/389-ds-base/branches/vers1.3.2/Makefile csw/mgar/pkg/389-ds-base/branches/vers1.3.2/checksums Modified: csw/mgar/pkg/389-ds-base/branches/vers1.3.2/Makefile =================================================================== --- csw/mgar/pkg/389-ds-base/branches/vers1.3.2/Makefile 2015-03-16 21:52:23 UTC (rev 24729) +++ csw/mgar/pkg/389-ds-base/branches/vers1.3.2/Makefile 2015-03-17 11:20:14 UTC (rev 24730) @@ -2,7 +2,7 @@ # TODO (release-critical prefixed with !, non release-critical with *) # NAME = 389-ds-base -VERSION = 1.3.2.17 +VERSION = 1.3.2.24 GARTYPE = v2 DESCRIPTION = The enterprise-class Open Source LDAP server @@ -27,9 +27,13 @@ GARCOMPILER = SOS12U3 # builds but was not able to debug # GARCOMPILER = GCC4 -LDAPAPI=mozldap -# LDAPAPI=openldap +GARFLAVOR = DBG +BUILD64_ONLY = 1 +# mozldap or openldap +# but openldap hasn't work on Sparc until Dec 2014 +LDAPAPI = mozldap + PATCHFILES += 0005-add-standard-path.patch PATCHFILES += 0006-replace-SV-sh-with-Posix-sh.patch PATCHFILES += 0005-smf-autoenable-no.patch @@ -54,11 +58,12 @@ PATCHFILES += 0015-use-PL_strcasestr-acllas.c.patch PATCHFILES_GCC4 += 0010-no-Crun-Cstd-lib-config.ac.patch # PATCHFILES += 0016-fix-bigendian-utf8compare.c -# PATCHFILES += 0017-disable-asm-for-Sparc.patch -# probably only with openLDAP +PATCHFILES += 0017-disable-asm-for-Sparc.patch +# probably only with openLDAP should not be necessary since version 1.3.3.9 PATCHFILES += 0018-correct-64bit-ptr-bind.c -PATCHFILES += 0021-include-lber.h-slapi-plugin.h.patch -PATCHFILES += 0022-adjust-mozldap-version-sasl_io.c.patch +PATCHFILES_mozldap += 0021-include-lber.h-slapi-plugin.h.patch +PATCHFILES_mozldap += 0022-adjust-mozldap-version-sasl_io.c.patch +PATCHFILES += $(PATCHFILES_$(LDAPAPI)) PATCHFILES += 0024-strndup.patch # PATCHFILES += 0025-posix-winsync.rawentry.patch # PATCHFILES += 0030-reconstruct-memberuid-generation-task.patch @@ -83,9 +88,8 @@ RUNTIME_DEP_PKGS_CSW389-ds-base += CSWpython RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibsvrcore0 RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibnspr4 -# RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibnetsnmpmibs25 -RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibnetsnmp25 -RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibnetsnmpagent25 +RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibnetsnmp30 +RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibnetsnmpagent30 RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibplds4 RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibnss3 RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibplc4 @@ -95,13 +99,12 @@ RUNTIME_DEP_PKGS_CSW389-ds-base += CSWpm-mozldap RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibssl3 RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibsasl2-2 -RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibfreebl3 RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibnssdbm3 RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibpcre1 RUNTIME_DEP_PKGS_CSW389-ds-base += CSWpm-netaddr-ip -RUNTIME_DEP_PKGS_CSW389-ds-base_openldap += CSWliblber2-4-2 RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibicui18n52 RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibicuuc52 +RUNTIME_DEP_PKGS_CSW389-ds-base_openldap += CSWliblber2-4-2 RUNTIME_DEP_PKGS_CSW389-ds-base_openldap += CSWlibldap-r2-4-2 RUNTIME_DEP_PKGS_CSW389-ds-base_openldap += CSWlibldap2-4-2 @@ -110,9 +113,6 @@ RUNTIME_DEP_PKGS_CSW389-ds-base_mozldap += CSWlibldap60 RUNTIME_DEP_PKGS_CSW389-ds-base_mozldap += CSWlibssldap60 -RUNTIME_DEP_PKGS_CSW389-ds-base_sparc += CSWlibk5crypto3 -RUNTIME_DEP_PKGS_CSW389-ds-base_sparc += CSWlibintl8 -RUNTIME_DEP_PKGS_CSW389-ds-base_sparc += CSWlibicudata52 RUNTIME_DEP_PKGS_CSW389-ds-base_sparc_GCC4 += CSWlibgcc-s1 RUNTIME_DEP_PKGS_CSW389-ds-base_sparc_GCC4 += CSWlibstdc++6 RUNTIME_DEP_PKGS_CSW389-ds-base += $(RUNTIME_DEP_PKGS_CSW389-ds-base_$(GARCH)) @@ -145,8 +145,6 @@ EXTRA_CFLAGS += $(EXTRA_CFLAGS_$(GARCOMPILER)) STRIP_LIBTOOL = 1 -# GARFLAVOR = DBG - CONFIGURE_ARGS = $(DIRPATHS) CONFIGURE_ARGS += --with-ldapsdk-inc=$(includedir)/dirsrv CONFIGURE_ARGS += --with-ldapsdk-lib=$(libdir) Modified: csw/mgar/pkg/389-ds-base/branches/vers1.3.2/checksums =================================================================== --- csw/mgar/pkg/389-ds-base/branches/vers1.3.2/checksums 2015-03-16 21:52:23 UTC (rev 24729) +++ csw/mgar/pkg/389-ds-base/branches/vers1.3.2/checksums 2015-03-17 11:20:14 UTC (rev 24730) @@ -1 +1 @@ -dc8bcbfb823dc8829947382e60b7a508 389-ds-base-1.3.2.17.tar.bz2 +cd0ca9e6bd7981863f7df63ef15bb3e4 389-ds-base-1.3.2.24.tar.bz2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From cgrzemba at users.sourceforge.net Tue Mar 17 12:21:54 2015 From: cgrzemba at users.sourceforge.net (cgrzemba at users.sourceforge.net) Date: Tue, 17 Mar 2015 11:21:54 +0000 Subject: SF.net SVN: gar:[24731] csw/mgar/pkg/389-ds-base/branches/vers1.3.2/ Makefile Message-ID: <3l5sXX2J1Rzy8@mail.opencsw.org> Revision: 24731 http://sourceforge.net/p/gar/code/24731 Author: cgrzemba Date: 2015-03-17 11:21:54 +0000 (Tue, 17 Mar 2015) Log Message: ----------- 389-ds-base/branches/vers1.3.2: readd dlopen'ed library Modified Paths: -------------- csw/mgar/pkg/389-ds-base/branches/vers1.3.2/Makefile Modified: csw/mgar/pkg/389-ds-base/branches/vers1.3.2/Makefile =================================================================== --- csw/mgar/pkg/389-ds-base/branches/vers1.3.2/Makefile 2015-03-17 11:20:14 UTC (rev 24730) +++ csw/mgar/pkg/389-ds-base/branches/vers1.3.2/Makefile 2015-03-17 11:21:54 UTC (rev 24731) @@ -93,6 +93,7 @@ RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibplds4 RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibnss3 RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibplc4 +RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibfreebl3 RUNTIME_DEP_PKGS_CSW389-ds-base += CSWbdb48 RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibcom-err3 RUNTIME_DEP_PKGS_CSW389-ds-base += CSWlibkrb5-3 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From hjb001 at users.sourceforge.net Tue Mar 17 15:27:14 2015 From: hjb001 at users.sourceforge.net (hjb001 at users.sourceforge.net) Date: Tue, 17 Mar 2015 14:27:14 +0000 Subject: SF.net SVN: gar:[24732] csw/mgar/pkg/netsnmp/trunk/Makefile Message-ID: <3l5xfQ63rTz1Cv@mail.opencsw.org> Revision: 24732 http://sourceforge.net/p/gar/code/24732 Author: hjb001 Date: 2015-03-17 14:27:14 +0000 (Tue, 17 Mar 2015) Log Message: ----------- netsnmp/trunk: renamed init scripts to csw convention Modified Paths: -------------- csw/mgar/pkg/netsnmp/trunk/Makefile Modified: csw/mgar/pkg/netsnmp/trunk/Makefile =================================================================== --- csw/mgar/pkg/netsnmp/trunk/Makefile 2015-03-17 11:21:54 UTC (rev 24731) +++ csw/mgar/pkg/netsnmp/trunk/Makefile 2015-03-17 14:27:14 UTC (rev 24732) @@ -72,8 +72,8 @@ ### 20150312/hjb - solaris 11 doesn't build #PACKAGING_PLATFORMS += solaris10-sparc solaris10-i386 solaris11-sparc solaris11-i386 -INITSMF = $(sysconfdir)/init.d/netsnmpd -INITSMF += $(sysconfdir)/init.d/netsnmptrapd +INITSMF = $(sysconfdir)/init.d/cswnetsnmpd +INITSMF += $(sysconfdir)/init.d/cswnetsnmptrapd PRESERVECONF = $(sysconfdir)/snmp/snmpd.conf @@ -268,7 +268,7 @@ ginstall -d $(DESTDIR)/$(sysconfdir)/init.d ginstall -d $(DESTDIR)/$(sysconfdir)/snmp ginstall -d $(DESTDIR)/$(localstatedir)/log - ginstall -m 755 $(WORKSRC)/dist/snmpd-init.d $(DESTDIR)/$(sysconfdir)/init.d/netsnmpd - ginstall -m 755 $(WORKSRC)/dist/snmptrapd-init.d $(DESTDIR)/$(sysconfdir)/init.d/netsnmptrapd + ginstall -m 755 $(WORKSRC)/dist/snmpd-init.d $(DESTDIR)/$(sysconfdir)/init.d/cswnetsnmpd + ginstall -m 755 $(WORKSRC)/dist/snmptrapd-init.d $(DESTDIR)/$(sysconfdir)/init.d/cswnetsnmptrapd ginstall -m 755 $(WORKSRC)/EXAMPLE.conf $(DESTDIR)/$(sysconfdir)/snmp/snmpd.conf.CSW @$(MAKECOOKIE) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From rmottola at users.sourceforge.net Fri Mar 20 12:48:33 2015 From: rmottola at users.sourceforge.net (rmottola at users.sourceforge.net) Date: Fri, 20 Mar 2015 11:48:33 +0000 Subject: SF.net SVN: gar:[24733] csw/mgar/pkg/libicu54/trunk Message-ID: <3l7k024gSCzpK@mail.opencsw.org> Revision: 24733 http://sourceforge.net/p/gar/code/24733 Author: rmottola Date: 2015-03-20 11:48:33 +0000 (Fri, 20 Mar 2015) Log Message: ----------- libicu54/trunk: add solaris9 specific patch Modified Paths: -------------- csw/mgar/pkg/libicu54/trunk/Makefile Added Paths: ----------- csw/mgar/pkg/libicu54/trunk/files/LETypes_ptr_sol9.patch Modified: csw/mgar/pkg/libicu54/trunk/Makefile =================================================================== --- csw/mgar/pkg/libicu54/trunk/Makefile 2015-03-17 14:27:14 UTC (rev 24732) +++ csw/mgar/pkg/libicu54/trunk/Makefile 2015-03-20 11:48:33 UTC (rev 24733) @@ -15,6 +15,11 @@ LICENSE = license.html +#solaris 9 specific patch for missing PTR_MAX +PATCHFILES_5.9 += LETypes_ptr_sol9.patch + +PATCHFILES += $(PATCHFILES_$(GAROSREL)) + PACKAGES += CSWlibicudata54 SPKG_DESC_CSWlibicudata54 = International Components for Unicode, libicudata.so.54 PKGFILES_CSWlibicudata54 += $(call pkgfiles_lib,libicudata.so.54) Added: csw/mgar/pkg/libicu54/trunk/files/LETypes_ptr_sol9.patch =================================================================== --- csw/mgar/pkg/libicu54/trunk/files/LETypes_ptr_sol9.patch (rev 0) +++ csw/mgar/pkg/libicu54/trunk/files/LETypes_ptr_sol9.patch 2015-03-20 11:48:33 UTC (rev 24733) @@ -0,0 +1,20 @@ +--- a/source/layout/LETypes.h.orig Fri Mar 20 09:23:20 2015 ++++ b/source/layout/LETypes.h Fri Mar 20 09:43:47 2015 +@@ -296,17 +296,9 @@ + * Max value representable by a uintptr + */ + +-#ifndef UINT32_MAX + #define LE_UINT32_MAX 0xFFFFFFFFU +-#else +-#define LE_UINT32_MAX UINT32_MAX +-#endif + +-#ifndef UINTPTR_MAX + #define LE_UINTPTR_MAX LE_UINT32_MAX +-#else +-#define LE_UINTPTR_MAX UINTPTR_MAX +-#endif + + /** + * Range check for overflow This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From rmottola at users.sourceforge.net Fri Mar 20 23:06:28 2015 From: rmottola at users.sourceforge.net (rmottola at users.sourceforge.net) Date: Fri, 20 Mar 2015 22:06:28 +0000 Subject: SF.net SVN: gar:[24735] csw/mgar/pkg/libicu54/trunk/Makefile Message-ID: <3l7zht1Gscz1Fd@mail.opencsw.org> Revision: 24735 http://sourceforge.net/p/gar/code/24735 Author: rmottola Date: 2015-03-20 22:06:28 +0000 (Fri, 20 Mar 2015) Log Message: ----------- libicu54/trunk: re-enable solaris 9 Modified Paths: -------------- csw/mgar/pkg/libicu54/trunk/Makefile Modified: csw/mgar/pkg/libicu54/trunk/Makefile =================================================================== --- csw/mgar/pkg/libicu54/trunk/Makefile 2015-03-20 21:01:42 UTC (rev 24734) +++ csw/mgar/pkg/libicu54/trunk/Makefile 2015-03-20 22:06:28 UTC (rev 24735) @@ -15,6 +15,10 @@ LICENSE = license.html +#where can we build? +PACKAGING_PLATFORMS += solaris9-sparc solaris9-i386 +PACKAGING_PLATFORMS += solaris10-sparc solaris10-i386 + #solaris 9 specific patch for missing PTR_MAX PATCHFILES_5.9 += LETypes_ptr_sol9.patch This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From cgrzemba at users.sourceforge.net Sat Mar 21 14:23:56 2015 From: cgrzemba at users.sourceforge.net (cgrzemba at users.sourceforge.net) Date: Sat, 21 Mar 2015 13:23:56 +0000 Subject: SF.net SVN: gar:[24738] csw/mgar/pkg/lang-python/python/branches Message-ID: <3l8N4M30qcz1Sc@mail.opencsw.org> Revision: 24738 http://sourceforge.net/p/gar/code/24738 Author: cgrzemba Date: 2015-03-21 13:23:55 +0000 (Sat, 21 Mar 2015) Log Message: ----------- lang-python/python/branches/python-2.7-dtrace: attempt to build Python with dtrace probes Modified Paths: -------------- csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/Makefile Added Paths: ----------- csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/ csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/00-bits.patch csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/04-solaris-64-bit.patch csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/05-dtrace.patch csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/11-closerange.patch csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/13-pic-compile.patch csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/14-py_db.patch csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/15-get_wch.patch csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/16-ossaudiodev.patch csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/18-osconf-long.patch Modified: csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/Makefile =================================================================== --- csw/mgar/pkg/lang-python/python/branches/python-2.7/Makefile 2014-11-07 06:45:34 UTC (rev 24291) +++ csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/Makefile 2015-03-21 13:23:55 UTC (rev 24738) @@ -34,7 +34,7 @@ UPSTREAM_MASTER_SITES = http://python.org/ftp/python/ UFILES_REGEX = $(VER)\.\d+ -PACKAGING_PLATFORMS = solaris9-i386 solaris9-sparc +# PACKAGING_PLATFORMS = solaris9-i386 solaris9-sparc PACKAGING_PLATFORMS += solaris10-i386 solaris10-sparc DISTFILES = $(DISTNAME).tar.xz @@ -42,7 +42,7 @@ # The test for sunaudiodev fails. Not that it's a good practice to skip # tests. -SKIPTEST_5.9 = 1 +# SKIPTEST_5.9 = 1 SKIPTEST = $(SKIPTEST_$(GAROSREL)) TEST_SCRIPTS = custom @@ -52,8 +52,40 @@ # A possible fix is to rename plat-linux to plat- # BUILD64 = 1 -GARCOMPILER = GNU +# GARCOMPILER = GNU +# if change this take note of CONFIGURE_ARGS += --without-gcc +GARCOMPILER = SOS12U3 # GARFLAVOR = DBG +# remove fPIC for Studio compiler +PATCHFILES += 00-bits.patch +PATCHFILES += 04-solaris-64-bit.patch +# This patch adds Python dtrace support. Note it is necessary to modify +# test_sys.py to add an integer to the frameobject structure size since this +# patch adds "int f_calllineno" to the structure, so this test does not fail. +# The patch comes from upstream: +# http://www.jcea.es/artic/python_dtrace-2_7_7_af8ecf2352e1.txt +# http://www.jcea.es/artic/python_dtrace.htm +# Follow http://bugs.python.org/issue13405 for plans to get it +# integrated into the main tree. +PATCHFILES += 05-dtrace.patch +# This patch uses fdwalk(3c) to close file descriptors; as that function is not +# widely implemented, this is unsuitable for upstream. +PATCHFILES += 11-closerange.patch +PATCHFILES += 13-pic-compile.patch +# This patch adds Python debugger support. It may be contributed upstream at +# some point, but the suitability (or lack thereof) has not yet been determined. +PATCHFILES += 14-py_db.patch +# This patch adds wget_wch support to the curses module. It may be contributed +# upstream at some point, but the suitability (or lack thereof) has not yet +# been determined. +PATCHFILES += 15-get_wch.patch +# This patch is needed to make Python understand it can build the OSS plugin. +# Some OSS ioctls are not supported on Solaris, so they are ifdef'f out. As +# the patch is Solaris-specific, it is not suitable for upstream. +PATCHFILES += 16-ossaudiodev.patch +# http://bugs.python.org/issue17964 was fixed in 3.4 but not back-ported so we +# need this patch for 2.7 . +PATCHFILES += 18-osconf-long.patch EXTRA_INC += $(prefix)/bdb48/include EXTRA_LIB += $(prefix)/bdb48/lib @@ -73,6 +105,7 @@ LINKER_IGNORE = NOISALIST = 1 CONFIGURE_ARGS = $(DIRPATHS) +CONFIGURE_ARGS += --without-gcc CONFIGURE_ARGS += --enable-shared CONFIGURE_ARGS += --enable-ipv6 CONFIGURE_ARGS += --enable-unicode=ucs4 Added: csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/00-bits.patch =================================================================== --- csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/00-bits.patch (rev 0) +++ csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/00-bits.patch 2015-03-21 13:23:55 UTC (rev 24738) @@ -0,0 +1,28 @@ +# +# This patch makes the pyconfig.h header file 32/64 bit friendly. +# As it is Solaris-specific, it is not suitable for upstream. +# +--- Python-2.7.8/configure.ac.~1~ 2014-06-29 19:05:48.000000000 -0700 ++++ Python-2.7.8/configure.ac 2014-07-17 20:31:45.866247571 -0700 +@@ -5,7 +5,7 @@ + # Set VERSION so we only need to edit in one place (i.e., here) + m4_define(PYTHON_VERSION, 2.7) + +-AC_PREREQ(2.65) ++AC_PREREQ(2.68) + + AC_REVISION($Revision$) + AC_INIT(python, PYTHON_VERSION, http://bugs.python.org/) +@@ -2092,12 +2092,6 @@ + if test -z "$CCSHARED" + then + case $ac_sys_system/$ac_sys_release in +- SunOS*) if test "$GCC" = yes; +- then CCSHARED="-fPIC"; +- elif test `uname -p` = sparc; +- then CCSHARED="-xcode=pic32"; +- else CCSHARED="-Kpic"; +- fi;; + hp*|HP*) if test "$GCC" = yes; + then CCSHARED="-fPIC"; + else CCSHARED="+z"; Added: csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/04-solaris-64-bit.patch =================================================================== --- csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/04-solaris-64-bit.patch (rev 0) +++ csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/04-solaris-64-bit.patch 2015-03-21 13:23:55 UTC (rev 24738) @@ -0,0 +1,166 @@ +This patch ensures that 64-bit shared objects are in a subdirectory named +"64". Note that changes to the Lib/distutils/tests/test_build.py and +Lib/distutils/tests/test_install.py avoid running tests that fail due to +this patch. As this is Solaris-specific, it is not suitable for upstream. + +--- Python-2.7.6/Lib/distutils/command/build_ext.py.~1~ 2013-11-09 23:36:40.000000000 -0800 ++++ Python-2.7.6/Lib/distutils/command/build_ext.py 2014-05-14 12:47:04.342901439 -0700 +@@ -634,6 +634,10 @@ + filename = self.get_ext_filename(ext_name) + filename = os.path.split(filename)[-1] + ++ # on Solaris we put 64-bit python objects under .../64 ++ if sys.maxint != 2147483647L: ++ filename = os.path.join("64", filename) ++ + if not self.inplace: + # no further work needed + # returning : +@@ -674,7 +678,14 @@ + so_ext = get_config_var('SO') + if os.name == 'nt' and self.debug: + return os.path.join(*ext_path) + '_d' + so_ext +- return os.path.join(*ext_path) + so_ext ++ #return os.path.join(*ext_path) + so_ext ++ # .so extensions are word-size specific ++ path = apply(os.path.join, ext_path) ++ if sys.maxint == 2147483647L: ++ return path + so_ext ++ dirname = os.path.dirname(path); ++ basename = os.path.basename(path); ++ return os.path.join(dirname, "64", basename + so_ext) + + def get_export_symbols (self, ext): + """Return the list of symbols that a shared extension has to +--- Python-2.7.6/Python/import.c.~1~ 2013-11-09 23:36:41.000000000 -0800 ++++ Python-2.7.6/Python/import.c 2014-05-14 12:53:34.233016586 -0700 +@@ -1288,6 +1288,57 @@ + static int find_init_module(char *); /* Forward */ + static struct filedescr importhookdescr = {"", "", IMP_HOOK}; + ++#ifdef HAVE_STAT ++static char * ++insert_64dir(char *buf, size_t buflen) ++{ ++ char *base; ++ char *cp; ++ size_t blen; ++ ++ if ((blen = strlen(buf)) == 0) ++ return (NULL); ++ ++ cp = &buf[blen - 1]; ++ while (cp != buf && *cp != SEP) ++ cp--; ++ ++ if (cp != buf) ++ cp++; ++ ++ if (blen + strlen("64/") + 1 >= buflen) ++ return NULL; ++ ++ base = strdup(cp); ++ sprintf(cp, "64%c%s", SEP, base); ++ free(base); ++ ++ return buf; ++} ++ ++/* ++ * If we're on a 64-bit platform, modify lookups for shared object files. ++ */ ++static size_t modify_path(struct filedescr *fdp, char *buf, size_t buflen) ++{ ++ struct stat statbuf; ++ ++ if (sizeof(void *) != 8) ++ return 0; ++ ++ if (stat(buf, &statbuf) == 0 && S_ISDIR(statbuf.st_mode)) ++ return 0; ++ ++ if (fdp->type != C_EXTENSION) ++ return 0; ++ ++ if (insert_64dir(buf, buflen) == NULL) ++ return 0; ++ ++ return strlen("64/"); ++} ++#endif ++ + static struct filedescr * + find_module(char *fullname, char *subname, PyObject *path, char *buf, + size_t buflen, FILE **p_fp, PyObject **p_loader) +@@ -1302,11 +1353,10 @@ + static struct filedescr fd_builtin = {"", "", C_BUILTIN}; + static struct filedescr fd_package = {"", "", PKG_DIRECTORY}; + char *name; +-#if defined(PYOS_OS2) + size_t saved_len; + size_t saved_namelen; + char *saved_buf = NULL; +-#endif ++ + if (p_loader != NULL) + *p_loader = NULL; + +@@ -1513,15 +1563,17 @@ + } + } + } +-#if defined(PYOS_OS2) + /* take a snapshot of the module spec for restoration + * after the 8 character DLL hackery + */ + saved_buf = strdup(buf); + saved_len = len; + saved_namelen = namelen; +-#endif /* PYOS_OS2 */ ++ + for (fdp = _PyImport_Filetab; fdp->suffix != NULL; fdp++) { ++#ifdef HAVE_STAT ++ len += modify_path(fdp, buf, buflen); ++#endif + #if defined(PYOS_OS2) && defined(HAVE_DYNAMIC_LOADING) + /* OS/2 limits DLLs to 8 character names (w/o + extension) +@@ -1562,21 +1614,20 @@ + fp = NULL; + } + } +-#if defined(PYOS_OS2) ++ + /* restore the saved snapshot */ + strcpy(buf, saved_buf); + len = saved_len; + namelen = saved_namelen; +-#endif + } +-#if defined(PYOS_OS2) ++ + /* don't need/want the module name snapshot anymore */ + if (saved_buf) + { + free(saved_buf); + saved_buf = NULL; + } +-#endif ++ + Py_XDECREF(copy); + if (fp != NULL) + break; +--- Python-2.7.1/Python/importdl.h.orig Fri Jul 15 15:48:16 2011 ++++ Python-2.7.1/Python/importdl.h Fri Jul 15 15:49:10 2011 +@@ -31,8 +31,9 @@ + extern PyObject *_PyImport_LoadDynamicModule(char *name, char *pathname, + FILE *); + +-/* Max length of module suffix searched for -- accommodates "module.slb" */ +-#define MAXSUFFIXSIZE 12 ++/* Max length of module suffix searched for -- accommodates "module.slb" ++ and '64/' */ ++#define MAXSUFFIXSIZE 15 + + #ifdef MS_WINDOWS + #include Added: csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/05-dtrace.patch =================================================================== --- csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/05-dtrace.patch (rev 0) +++ csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/05-dtrace.patch 2015-03-21 13:23:55 UTC (rev 24738) @@ -0,0 +1,421 @@ +--- Python-2.7.6/Makefile.pre.in.~1~ 2013-11-09 23:36:41.000000000 -0800 ++++ Python-2.7.6/Makefile.pre.in 2014-05-14 12:54:43.824219677 -0700 +@@ -218,6 +218,7 @@ + # Used of signalmodule.o is not available + SIGNAL_OBJS= @SIGNAL_OBJS@ + ++DTRACE_OBJS=Python/dtrace.o Python/phelper.o + + ########################################################################## + # Grammar +@@ -341,6 +342,7 @@ + Python/formatter_unicode.o \ + Python/formatter_string.o \ + Python/$(DYNLOADFILE) \ ++ $(DTRACE_OBJS) \ + $(LIBOBJS) \ + $(MACHDEP_OBJS) \ + $(THREADOBJ) +@@ -664,6 +666,18 @@ + Python/formatter_string.o: $(srcdir)/Python/formatter_string.c \ + $(STRINGLIB_HEADERS) + ++Python/phelper.o: $(srcdir)/Python/phelper.d ++ dtrace -o $@ -DPHELPER $(DFLAGS) $(CPPFLAGS) -C -G -s $(srcdir)/Python/phelper.d ++ ++Python/python.h: $(srcdir)/Python/python.d ++ dtrace -o $@ $(DFLAGS) -C -h -s $(srcdir)/Python/python.d ++ ++Python/ceval.o: Python/ceval.c Python/python.h ++ $(CC) -c -I. -IPython $(BASECFLAGS) $(EXTRA_CFLAGS) $(CPPFLAGS) $(CFLAGSFORSHARED) $(CFLAGS) -DPy_BUILD_CORE -o $@ $< ++ ++Python/dtrace.o: $(srcdir)/Python/python.d Python/ceval.o ++ dtrace -o $@ $(DFLAGS) -C -G -s $(srcdir)/Python/python.d Python/ceval.o ++ + ############################################################################ + # Header files + +--- Python-2.7.6/Include/frameobject.h.~1~ 2013-11-09 23:36:39.000000000 -0800 ++++ Python-2.7.6/Include/frameobject.h 2014-05-14 13:03:19.938777249 -0700 +@@ -44,6 +44,7 @@ + PyCode_Addr2Line to calculate the line from the current + bytecode index. */ + int f_lineno; /* Current line number */ ++ int f_calllineno; /* line number of call site */ + int f_iblock; /* index in f_blockstack */ + PyTryBlock f_blockstack[CO_MAXBLOCKS]; /* for try and loop blocks */ + PyObject *f_localsplus[1]; /* locals+stack, dynamically sized */ +--- Python-2.7.6/Objects/frameobject.c.~1~ 2013-11-09 23:36:41.000000000 -0800 ++++ Python-2.7.6/Objects/frameobject.c 2014-05-14 12:56:06.970076859 -0700 +@@ -738,6 +738,7 @@ + f->f_tstate = tstate; + + f->f_lasti = -1; ++ f->f_calllineno = code->co_firstlineno; + f->f_lineno = code->co_firstlineno; + f->f_iblock = 0; + +--- Python-2.7.8/Python/ceval.c.~1~ 2014-06-29 19:05:46.000000000 -0700 ++++ Python-2.7.8/Python/ceval.c 2014-07-17 20:39:49.843868592 -0700 +@@ -19,6 +19,11 @@ + + #include + ++#define HAVE_DTRACE ++#ifdef HAVE_DTRACE ++#include "python.h" ++#endif ++ + #ifndef WITH_TSC + + #define READ_TIMESTAMP(var) +@@ -678,6 +683,55 @@ + NULL); + } + ++#ifdef HAVE_DTRACE ++static void ++dtrace_entry(PyFrameObject *f) ++{ ++ const char *filename; ++ const char *fname; ++ int lineno; ++ ++ filename = PyString_AsString(f->f_code->co_filename); ++ fname = PyString_AsString(f->f_code->co_name); ++ lineno = PyCode_Addr2Line(f->f_code, f->f_lasti); ++ ++ PYTHON_FUNCTION_ENTRY((char *)filename, (char *)fname, lineno); ++ ++ /* ++ * Currently a USDT tail-call will not receive the correct arguments. ++ * Disable the tail call here. ++ */ ++#if defined(__sparc) ++ asm("nop"); ++#endif ++} ++ ++static void ++dtrace_return(PyFrameObject *f) ++{ ++ const char *filename; ++ const char *fname; ++ int lineno; ++ ++ filename = PyString_AsString(f->f_code->co_filename); ++ fname = PyString_AsString(f->f_code->co_name); ++ lineno = PyCode_Addr2Line(f->f_code, f->f_lasti); ++ PYTHON_FUNCTION_RETURN((char *)filename, (char *)fname, lineno); ++ ++ /* ++ * Currently a USDT tail-call will not receive the correct arguments. ++ * Disable the tail call here. ++ */ ++#if defined(__sparc) ++ asm("nop"); ++#endif ++} ++#else ++#define PYTHON_FUNCTION_ENTRY_ENABLED 0 ++#define PYTHON_FUNCTION_RETURN_ENABLED 0 ++#define dtrace_entry() ++#define dtrace_return() ++#endif + + /* Interpreter main loop */ + +@@ -689,9 +743,84 @@ + return PyEval_EvalFrameEx(f, 0); + } + ++/* ++ * These shenanigans look like utter madness, but what we're actually doing is ++ * making sure that the ustack helper will see the PyFrameObject pointer on the ++ * stack. We have two tricky cases: ++ * ++ * amd64 ++ * ++ * We use up the six registers for passing arguments, meaning the call can't ++ * use a register for passing 'f', and has to push it onto the stack in a known ++ * location. ++ * ++ * And how does "throwflag" figure in to this? -PN ++ * ++ * SPARC ++ * ++ * Here the problem is that (on 32-bit) the compiler is re-using %i0 before ++ * some calls inside PyEval_EvalFrameReal(), which means that when it's saved, ++ * it's just some junk value rather than the real first argument. So, instead, ++ * we trace our proxy PyEval_EvalFrame(), where we 'know' the compiler won't ++ * decide to re-use %i0. We also need to defeat optimization of our proxy. ++ */ ++ ++#if defined(HAVE_DTRACE) ++ ++#if defined(__amd64) ++PyObject *PyEval_EvalFrameExReal(long, long, long, long, long, long, ++ PyFrameObject *, int throwflag); ++ ++ ++ ++PyObject * ++PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) ++{ ++ volatile PyObject *f2; ++ f2 = PyEval_EvalFrameExReal(0, 0, 0, 0, 0, 0, f, throwflag); ++ return (PyObject *)f2; ++} ++ ++PyObject * ++PyEval_EvalFrameExReal(long a1, long a2, long a3, long a4, long a5, long a6, ++ PyFrameObject *f, int throwflag) ++{ ++ ++#elif defined(__sparc) ++ ++PyObject *PyEval_EvalFrameExReal(PyFrameObject *f, int throwflag); ++ ++volatile int dummy; ++ ++PyObject * ++PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) ++{ ++ volatile PyObject *f2; ++ f2 = PyEval_EvalFrameExReal(f, throwflag); ++ dummy = f->ob_refcnt; ++ return (PyObject *)f2; ++} ++ ++PyObject * ++PyEval_EvalFrameExReal(PyFrameObject *f, int throwflag) ++{ ++ ++#else /* __amd64 || __sparc */ ++ + PyObject * + PyEval_EvalFrameEx(PyFrameObject *f, int throwflag) + { ++ ++#endif /* __amd64 || __sparc */ ++ ++#else /* don't HAVE_DTRACE */ ++ ++PyObject * ++PyEval_EvalFrameexEx(PyFrameObject *f, int throwflag)) ++{ ++ ++#endif /* HAVE_DTRACE */ ++ + #ifdef DXPAIRS + int lastopcode = 0; + #endif +@@ -916,6 +1045,11 @@ + } + } + ++#ifdef HAVE_DTRACE ++ if (PYTHON_FUNCTION_ENTRY_ENABLED()) ++ dtrace_entry(f); ++#endif ++ + co = f->f_code; + names = co->co_names; + consts = co->co_consts; +@@ -2673,6 +2807,9 @@ + PyObject **sp; + PCALL(PCALL_ALL); + sp = stack_pointer; ++#ifdef HAVE_DTRACE ++ f->f_calllineno = PyCode_Addr2Line(f->f_code, f->f_lasti); ++#endif + #ifdef WITH_TSC + x = call_function(&sp, oparg, &intr0, &intr1); + #else +@@ -2714,6 +2851,9 @@ + } else + Py_INCREF(func); + sp = stack_pointer; ++#ifdef HAVE_DTRACE ++ f->f_calllineno = PyCode_Addr2Line(f->f_code, f->f_lasti); ++#endif + READ_TIMESTAMP(intr0); + x = ext_do_call(func, &sp, flags, na, nk); + READ_TIMESTAMP(intr1); +@@ -3014,6 +3154,10 @@ + + /* pop frame */ + exit_eval_frame: ++#ifdef HAVE_DTRACE ++ if (PYTHON_FUNCTION_RETURN_ENABLED()) ++ dtrace_return(f); ++#endif + Py_LeaveRecursiveCall(); + tstate->frame = f->f_back; + +--- /dev/null ++++ Python-2.6.4/Python/phelper.d +@@ -0,0 +1,139 @@ ++ ++/* ++ * Python ustack helper. This relies on the first argument (PyFrame *) being ++ * on the stack; see Python/ceval.c for the contortions we go through to ensure ++ * this is the case. ++ * ++ * On x86, the PyFrame * is two slots up from the frame pointer; on SPARC, it's ++ * eight. ++ */ ++ ++/* ++ * Yes, this is as gross as it looks. DTrace cannot handle static functions, ++ * and our stat_impl.h has them in ILP32. ++ */ ++#define _SYS_STAT_H ++ ++#include ++#include ++ ++#include "pyport.h" ++#include "object.h" ++#include "pystate.h" ++#include "pyarena.h" ++#include "pythonrun.h" ++#include "compile.h" ++#include "frameobject.h" ++#include "stringobject.h" ++ ++#if defined(__i386) ++#define startframe PyEval_EvalFrameEx ++#define endframe PyEval_EvalCodeEx ++#elif defined(__amd64) ++#define PyEval_EvalFrameEx PyEval_EvalFrameExReal ++#define startframe PyEval_EvalFrameExReal ++#define endframe PyEval_EvalCodeEx ++#elif defined(__sparc) ++#define PyEval_EvalFrameEx PyEval_EvalFrameExReal ++#define startframe PyEval_EvalFrameEx ++#define endframe PyEval_EvalFrameExReal ++#endif ++ ++#ifdef __sparcv9 ++#define STACK_BIAS (2048-1) ++#else ++#define STACK_BIAS 0 ++#endif ++ ++/* ++ * Not defining PHELPER lets us test this code as a normal D script. ++ */ ++#ifdef PHELPER ++ ++#define at_evalframe(addr) \ ++ ((uintptr_t)addr >= ((uintptr_t)&``startframe) && \ ++ (uintptr_t)addr < ((uintptr_t)&``endframe)) ++#define probe dtrace:helper:ustack: ++#define print_result(r) (r) ++ ++#if defined(__i386) || defined(__amd64) ++#define frame_ptr_addr ((uintptr_t)arg1 + sizeof(uintptr_t) * 2) ++#elif defined(__sparc) ++#define frame_ptr_addr ((uintptr_t)arg1 + STACK_BIAS + sizeof(uintptr_t) * 8) ++#else ++#error unknown architecture ++#endif ++ ++#else /* PHELPER */ ++ ++#define at_evalframe(addr) (1) ++#define probe pid$target::PyEval_EvalFrame:entry ++#define print_result(r) (trace(r)) ++ ++#if defined(__i386) || defined(__amd64) ++#define frame_ptr_addr ((uintptr_t)uregs[R_SP] + sizeof(uintptr_t)) ++#elif defined(__sparc) ++/* ++ * Not implemented: we could just use R_I0, but what's the point? ++ */ ++#else ++#error unknown architecture ++#endif ++ ++#endif /* PHELPER */ ++ ++extern uintptr_t PyEval_EvalFrameEx; ++extern uintptr_t PyEval_EvalCodeEx; ++ ++#define copyin_obj(addr, obj) ((obj *)copyin((uintptr_t)addr, sizeof(obj))) ++#define pystr_addr(addr) ((char *)addr + offsetof(PyStringObject, ob_sval)) ++#define copyin_str(dest, addr, obj) \ ++ (copyinto((uintptr_t)pystr_addr(addr), obj->ob_size, (dest))) ++#define add_str(addr, obj) \ ++ copyin_str(this->result + this->pos, addr, obj); \ ++ this->pos += obj->ob_size; \ ++ this->result[this->pos] = '\0'; ++#define add_digit(nr, div) ((nr / div) ? \ ++ (this->result[this->pos++] = '0' + ((nr / div) % 10)) : \ ++ (this->result[this->pos] = '\0')) ++#define add_char(c) (this->result[this->pos++] = c) ++ ++probe /at_evalframe(arg0)/ ++{ ++ this->framep = *(uintptr_t *)copyin(frame_ptr_addr, sizeof(uintptr_t)); ++ this->frameo = copyin_obj(this->framep, PyFrameObject); ++ this->codep = this->frameo->f_code; ++ this->lineno = this->frameo->f_calllineno; ++ this->codeo = copyin_obj(this->codep, PyCodeObject); ++ this->filenamep = this->codeo->co_filename; ++ this->fnamep = this->codeo->co_name; ++ this->filenameo = copyin_obj(this->filenamep, PyStringObject); ++ this->fnameo = copyin_obj(this->fnamep, PyStringObject); ++ ++ this->len = 1 + this->filenameo->ob_size + 1 + 5 + 2 + ++ this->fnameo->ob_size + 1 + 1; ++ ++ this->result = (char *)alloca(this->len); ++ this->pos = 0; ++ ++ add_char('@'); ++ add_str(this->filenamep, this->filenameo); ++ add_char(':'); ++ add_digit(this->lineno, 10000); ++ add_digit(this->lineno, 1000); ++ add_digit(this->lineno, 100); ++ add_digit(this->lineno, 10); ++ add_digit(this->lineno, 1); ++ add_char(' '); ++ add_char('('); ++ add_str(this->fnamep, this->fnameo); ++ add_char(')'); ++ this->result[this->pos] = '\0'; ++ ++ print_result(stringof(this->result)); ++} ++ ++probe /!at_evalframe(arg0)/ ++{ ++ NULL; ++} +--- /dev/null ++++ Python-2.6.4/Python/python.d +@@ -0,0 +1,10 @@ ++provider python { ++ probe function__entry(const char *, const char *, int); ++ probe function__return(const char *, const char *, int); ++}; ++ ++#pragma D attributes Evolving/Evolving/Common provider python provider ++#pragma D attributes Private/Private/Common provider python module ++#pragma D attributes Private/Private/Common provider python function ++#pragma D attributes Evolving/Evolving/Common provider python name ++#pragma D attributes Evolving/Evolving/Common provider python args +--- Python-2.7.7/Lib/test/test_sys.py.~1~ 2014-05-31 11:58:39.000000000 -0700 ++++ Python-2.7.7/Lib/test/test_sys.py 2014-06-02 10:44:39.318709539 -0700 +@@ -594,7 +594,7 @@ + nfrees = len(x.f_code.co_freevars) + extras = x.f_code.co_stacksize + x.f_code.co_nlocals +\ + ncells + nfrees - 1 +- check(x, vsize('12P3i' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P')) ++ check(x, vsize('12P4i' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P')) + # function + def func(): pass + check(func, size('9P')) Added: csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/11-closerange.patch =================================================================== --- csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/11-closerange.patch (rev 0) +++ csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/11-closerange.patch 2015-03-21 13:23:55 UTC (rev 24738) @@ -0,0 +1,40 @@ +--- Python-2.7.7/Modules/posixmodule.c.~1~ 2014-05-31 11:58:40.000000000 -0700 ++++ Python-2.7.7/Modules/posixmodule.c 2014-06-02 10:49:30.052826955 -0700 +@@ -6607,16 +6607,34 @@ + "closerange(fd_low, fd_high)\n\n\ + Closes all file descriptors in [fd_low, fd_high), ignoring errors."); + ++static int ++close_func(void *lohi, int fd) ++{ ++ int lo = ((int *)lohi)[0]; ++ int hi = ((int *)lohi)[1]; ++ ++ if (fd >= hi) ++ return (1); ++ else if (fd >= lo) ++ close(fd); ++ ++ return (0); ++} ++ + static PyObject * + posix_closerange(PyObject *self, PyObject *args) + { + int fd_from, fd_to, i; ++ int lohi[2]; ++ + if (!PyArg_ParseTuple(args, "ii:closerange", &fd_from, &fd_to)) + return NULL; + Py_BEGIN_ALLOW_THREADS +- for (i = fd_from; i < fd_to; i++) +- if (_PyVerify_fd(i)) +- close(i); ++ ++ lohi[0] = fd_from; ++ lohi[1] = fd_to; ++ fdwalk(close_func, lohi); ++ + Py_END_ALLOW_THREADS + Py_RETURN_NONE; + } Added: csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/13-pic-compile.patch =================================================================== --- csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/13-pic-compile.patch (rev 0) +++ csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/13-pic-compile.patch 2015-03-21 13:23:55 UTC (rev 24738) @@ -0,0 +1,18 @@ +--- Python-2.7.6/Lib/distutils/sysconfig.py.~1~ 2013-11-09 23:36:40.000000000 -0800 ++++ Python-2.7.6/Lib/distutils/sysconfig.py 2014-05-14 13:33:21.453593946 -0700 +@@ -208,6 +208,15 @@ + else: + archiver = ar + ' ' + ar_flags + ++ # Force PIC compilation. Determine if GNU compiler or otherwise ++ # and set the PIC flag(s) accordingly. Defaults to Studio compiler. ++ out = os.popen(cc + ' --version 2>/dev/null', 'r') ++ out_string = out.read() ++ out.close() ++ result = re.search(' (\d+\.\d+(\.\d+)*)', out_string) ++ kpic_flags = "-fPIC -DPIC" if result else "-KPIC -DPIC" ++ cflags += ' ' + kpic_flags ++ + cc_cmd = cc + ' ' + cflags + compiler.set_executables( + preprocessor=cpp, Added: csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/14-py_db.patch =================================================================== --- csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/14-py_db.patch (rev 0) +++ csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/14-py_db.patch 2015-03-21 13:23:55 UTC (rev 24738) @@ -0,0 +1,1029 @@ +--- Python-2.7.7/Makefile.pre.in.~3~ 2014-06-02 10:54:32.421086337 -0700 ++++ Python-2.7.7/Makefile.pre.in 2014-06-02 10:54:32.438134113 -0700 +@@ -407,7 +407,7 @@ + + # Default target + all: build_all +-build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks ++build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks build-py_db + + # Compile a binary with gcc profile guided optimization. + profile-opt: +@@ -778,6 +778,19 @@ + + $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS) + ++SHLIB_FLAGS = -shared -fpic ++ ++libpython2.7_db.so.1.0: $(srcdir)/py_db/libpython27_db.c ++ $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $(SHLIB_FLAGS) $< ++ ++check_offset: $(srcdir)/py_db/check_offsets.c ++ $(CC) -o $@ $(CFLAGS) $(CPPFLAGS) $< ++ ++build-py_db: libpython2.7_db.so.1.0 check_offset ++ ++install-py_db: libpython2.7_db.so.1.0 check_offset ++ $(INSTALL_SHARED) libpython2.7_db.so.1.0 $(DESTDIR)$(LIBDIR) ++ $(INSTALL_PROGRAM) check_offset $(DESTDIR)$(BINDIR) + + ###################################################################### + +@@ -842,7 +855,7 @@ + $(TESTPYTHON) $(TESTPROG) $(MEMTESTOPTS) + + # Install everything +-install: @FRAMEWORKINSTALLFIRST@ altinstall bininstall maninstall @FRAMEWORKINSTALLLAST@ ++install: @FRAMEWORKINSTALLFIRST@ altinstall bininstall maninstall @FRAMEWORKINSTALLLAST@ install-py_db + + # Install almost everything without disturbing previous versions + altinstall: @FRAMEWORKALTINSTALLFIRST@ altbininstall libinstall inclinstall \ +--- /dev/null ++++ Python-2.7.1/py_db/check_offsets.c +@@ -0,0 +1,87 @@ ++/* ++ * CDDL HEADER START ++ * ++ * The contents of this file are subject to the terms of the ++ * Common Development and Distribution License (the "License"). ++ * You may not use this file except in compliance with the License. ++ * ++ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE ++ * or http://www.opensolaris.org/os/licensing. ++ * See the License for the specific language governing permissions ++ * and limitations under the License. ++ * ++ * When distributing Covered Code, include this CDDL HEADER in each ++ * file and include the License file at usr/src/OPENSOLARIS.LICENSE. ++ * If applicable, add the following below this CDDL HEADER, with the ++ * fields enclosed by brackets "[]" replaced with your own identifying ++ * information: Portions Copyright [yyyy] [name of copyright owner] ++ * ++ * CDDL HEADER END ++ */ ++/* ++ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. ++ */ ++ ++#include ++ ++#include ++#include ++ ++#include "libpython27_db_32.h" ++ ++#if 0 ++#define offsetof(s, m) ((size_t)(&(((s *)0)->m))) ++#endif ++ ++int ++main(void) ++{ ++/* ++ * PyCodeObject co_name ++ * PyCodeObject co_filename ++ * PyCodeObject co_lnotab ++ * PyFrameObject f_back ++ * PyFrameObject f_code ++ * PyFrameObject f_lasti ++ * PyInterpreterState next ++ * PyInterpreterState tstate_head ++ * PyStringObject ob_sval ++ * PyStringObject ob_size ++ * PyThreadState frame ++ * PyThreadState next ++ */ ++ ++ printf("struct member: native 32\n"); ++ printf("PyCodeObject co_name: %d %d\n", offsetof(PyCodeObject, co_name), ++ offsetof(PyCodeObject32, co_name)); ++ printf("PyCodeObject co_filename: %d %d\n", offsetof(PyCodeObject, ++ co_filename), offsetof(PyCodeObject32, co_filename)); ++ printf("PyCodeObject co_lnotab: %d %d\n", offsetof(PyCodeObject, ++ co_lnotab), offsetof(PyCodeObject32, co_lnotab)); ++ printf("PyFrameObject f_back: %d %d\n", offsetof(PyFrameObject, f_back), ++ offsetof(PyFrameObject32, f_back)); ++ printf("PyFrameObject f_code: %d %d\n", offsetof(PyFrameObject, f_code), ++ offsetof(PyFrameObject32, f_code)); ++ printf("PyFrameObject f_lasti: %d %d\n", offsetof(PyFrameObject, ++ f_lasti), offsetof(PyFrameObject32, f_lasti)); ++ printf("PyInterpreterState next: %d %d\n", offsetof(PyInterpreterState, ++ next), offsetof(PyInterpreterState32, next)); ++ printf("PyInterpreterState tstate_head: %d %d\n", ++ offsetof(PyInterpreterState, tstate_head), ++ offsetof(PyInterpreterState32, tstate_head)); ++ printf("PyStringObject ob_sval: %d %d\n", offsetof(PyStringObject, ++ ob_sval), offsetof(PyStringObject32, ob_sval)); ++ printf("PyStringObject ob_size: %d %d\n", offsetof(PyStringObject, ++ ob_size), offsetof(PyStringObject32, ob_size)); ++ printf("PyThreadState frame: %d %d\n", offsetof(PyThreadState, frame), ++ offsetof(PyThreadState32, frame)); ++ printf("PyThreadState next: %d %d\n", offsetof(PyThreadState, next), ++ offsetof(PyThreadState32, next)); ++ ++ printf("\nObject sizes\n"); ++ printf("PyObject: %d %d\n", sizeof (PyObject), sizeof (PyObject32)); ++ printf("PyVarObject: %d %d\n", sizeof (PyVarObject), ++ sizeof (PyVarObject32)); ++ ++ return (0); ++} +--- /dev/null ++++ Python-2.7.1/py_db/libpython27_db.c +@@ -0,0 +1,654 @@ ++/* ++ * CDDL HEADER START ++ * ++ * The contents of this file are subject to the terms of the ++ * Common Development and Distribution License (the "License"). ++ * You may not use this file except in compliance with the License. ++ * ++ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE ++ * or http://www.opensolaris.org/os/licensing. ++ * See the License for the specific language governing permissions ++ * and limitations under the License. ++ * ++ * When distributing Covered Code, include this CDDL HEADER in each ++ * file and include the License file at usr/src/OPENSOLARIS.LICENSE. ++ * If applicable, add the following below this CDDL HEADER, with the ++ * fields enclosed by brackets "[]" replaced with your own identifying ++ * information: Portions Copyright [yyyy] [name of copyright owner] ++ * ++ * CDDL HEADER END ++ */ ++/* ++ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include "libpython27_db.h" ++#if defined(_LP64) ++#include "libpython27_db_32.h" ++#endif /* _LP64 */ ++ ++/* ++ * Because MDB always runs the debugger in the same datamodel as the target, ++ * only functions that are used by the procfs part of this interface (or shared ++ * between the two) are written as 64->32 aware. ++ */ ++typedef struct pydb_arch_ops { ++ ssize_t (*strobj_readdata)(pydb_agent_t *, uintptr_t, unsigned char *, ++ size_t); ++ int (*frameinfo)(pydb_agent_t *, uintptr_t, char *, ++ size_t, char *, size_t, int *); ++} pydb_arch_ops_t; ++ ++struct pydb_agent { ++ struct ps_prochandle *pdb_ph; ++ int pdb_vers; ++ int pdb_is_64bit; ++ int pdb_datamodel; ++ const pydb_arch_ops_t *pdb_ops; ++}; ++ ++typedef uintptr_t (*pdi_next_cb_t)(pydb_iter_t *); ++ ++struct pydb_iter { ++ struct ps_prochandle *pdi_ph; ++ uintptr_t pdi_current; ++ pdi_next_cb_t pdi_nextf; ++}; ++ ++#define LIBPYTHON "libpython2.7.so" ++ ++#define MIN(x, y) (((x) < (y)) ? (x) : (y)) ++ ++/* Generic interface to helper functions */ ++static ssize_t pydb_strobj_readdata(pydb_agent_t *py, uintptr_t addr, ++ unsigned char *buf, size_t buf_len); ++static int pydb_getlno(pydb_agent_t *py, uintptr_t lnotab_addr, int firstline, ++ int lastinst); ++static int pydb_frameinfo(pydb_agent_t *py, uintptr_t addr, char *funcnm, ++ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno); ++ ++/* datamodel specific implementation of helper functions */ ++static ssize_t pydb_strobj_readdata_native(pydb_agent_t *py, uintptr_t addr, ++ unsigned char *buf, size_t buf_len); ++static int pydb_frameinfo_native(pydb_agent_t *py, uintptr_t addr, char *funcnm, ++ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno); ++ ++#if defined (_LP64) ++static ssize_t pydb_strobj_readdata_32(pydb_agent_t *py, uintptr_t addr, ++ unsigned char *buf, size_t buf_len); ++static int pydb_frameinfo_32(pydb_agent_t *py, uintptr_t addr, char *funcnm, ++ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno); ++#endif /* _LP64 */ ++ ++static ssize_t pydb_strobj_readstr(pydb_agent_t *py, uintptr_t addr, char *buf, ++ size_t len); ++ ++/* Iterator function next routines. Plugable, configured by iterator init */ ++static uintptr_t pydb_frame_iter_next(pydb_iter_t *iter); ++static uintptr_t pydb_interp_iter_next(pydb_iter_t *iter); ++static uintptr_t pydb_thread_iter_next(pydb_iter_t *iter); ++ ++static const char *strbasename(const char *s); ++ ++static const pydb_arch_ops_t arch_ops_native = { ++ .frameinfo = pydb_frameinfo_native, ++ .strobj_readdata = pydb_strobj_readdata_native, ++}; ++ ++#if defined (_LP64) ++static const pydb_arch_ops_t arch_ops_32 = { ++ .frameinfo = pydb_frameinfo_32, ++ .strobj_readdata = pydb_strobj_readdata_32, ++}; ++#endif /* _LP64 */ ++ ++static const char * ++strbasename(const char *s) ++{ ++ const char *p = strrchr(s, '/'); ++ ++ if (p == NULL) ++ return (s); ++ ++ return (++p); ++} ++ ++/* Agent creation / destruction routines */ ++ ++pydb_agent_t * ++pydb_agent_create(struct ps_prochandle *P, int vers) ++{ ++ pydb_agent_t *py; ++ int datamodel; ++ ++ if (vers != PYDB_VERSION) { ++ errno = ENOTSUP; ++ return (NULL); ++ } ++ ++ if (ps_pdmodel(P, &datamodel) != PS_OK) { ++ return (NULL); ++ } ++ ++ py = (pydb_agent_t *)malloc(sizeof (pydb_agent_t)); ++ if (py == NULL) { ++ return (NULL); ++ } ++ ++ py->pdb_ph = P; ++ py->pdb_vers = vers; ++ py->pdb_datamodel = datamodel; ++ py->pdb_is_64bit = 0; ++ py->pdb_ops = &arch_ops_native; ++ ++#if defined (_LP64) ++ py->pdb_is_64bit = (datamodel == PR_MODEL_LP64); ++ if (!py->pdb_is_64bit) { ++ py->pdb_ops = &arch_ops_32; ++ } ++#endif /* _LP64 */ ++ ++ return (py); ++} ++ ++void ++pydb_agent_destroy(pydb_agent_t *py) ++{ ++ if (py == NULL) { ++ return; ++ } ++ ++ free(py); ++} ++ ++/* Helper functions */ ++static int ++pydb_getlno(pydb_agent_t *py, uintptr_t lnotab_addr, int firstline, ++ int lastinst) ++{ ++ unsigned char lnotab[4096]; ++ ssize_t lnotab_len; ++ int addr, line; ++ int i; ++ ++ lnotab_len = pydb_strobj_readdata(py, lnotab_addr, lnotab, ++ sizeof (lnotab)); ++ if (lnotab_len < 0) { ++ return (-1); ++ } ++ ++ /* ++ * Python's line number algorithm is arcane. See here for details: ++ * http://svn.python.org/projects/python/trunk/Objects/lnotab_notes.txt ++ */ ++ ++ line = firstline; ++ for (addr = i = 0; i < lnotab_len; i += 2) { ++ if (addr + lnotab[i] > lastinst) { ++ break; ++ } ++ addr += lnotab[i]; ++ line += lnotab[i + 1]; ++ } ++ ++ return (line); ++} ++ ++static ssize_t ++pydb_strobj_readdata(pydb_agent_t *py, uintptr_t addr, unsigned char *buf, ++ size_t buf_len) ++{ ++ return (py->pdb_ops->strobj_readdata(py, addr, buf, buf_len)); ++} ++ ++static ssize_t ++pydb_strobj_readdata_native(pydb_agent_t *py, uintptr_t addr, ++ unsigned char *buf, size_t buf_len) ++{ ++ PyStringObject sobj; ++ ssize_t obj_sz; ++ ssize_t read_sz; ++ psaddr_t straddr; ++ ++ /* ++ * PyStringObjects are variable size. The size of the PyStringObject ++ * struct is fixed, and known at compile time; however, the size of the ++ * associated buffer is variable. The char[1] element at the end of the ++ * structure contains the string, and the ob_size of the PyStringObject ++ * indicates how much extra space was allocated to contain the string ++ * buffer at the object's tail. Read in the fixed size portion of the ++ * object first, and then read the contents of the data buffer into the ++ * buffer passed by the caller. ++ */ ++ ++ if (ps_pread(py->pdb_ph, addr, &sobj, sizeof (PyStringObject)) ++ != PS_OK) { ++ return (-1); ++ } ++ ++ obj_sz = (ssize_t)PyString_GET_SIZE(&sobj); ++ ++ read_sz = MIN(obj_sz, (ssize_t)buf_len); ++ straddr = (psaddr_t)(addr + offsetof(PyStringObject, ob_sval)); ++ ++ if (ps_pread(py->pdb_ph, straddr, buf, (size_t)read_sz) != PS_OK) { ++ return (-1); ++ } ++ ++ return (read_sz); ++} ++ ++#if defined(_LP64) ++static ssize_t ++pydb_strobj_readdata_32(pydb_agent_t *py, uintptr_t addr, ++ unsigned char *buf, size_t buf_len) ++{ ++ PyStringObject32 sobj; ++ ssize_t obj_sz; ++ ssize_t read_sz; ++ psaddr_t straddr; ++ ++ /* ++ * PyStringObjects are variable size. The size of the PyStringObject ++ * struct is fixed, and known at compile time; however, the size of the ++ * associated buffer is variable. The char[1] element at the end of the ++ * structure contains the string, and the ob_size of the PyStringObject ++ * indicates how much extra space was allocated to contain the string ++ * buffer at the object's tail. Read in the fixed size portion of the ++ * object first, and then read the contents of the data buffer into the ++ * buffer passed by the caller. ++ */ ++ ++ if (ps_pread(py->pdb_ph, addr, &sobj, sizeof (PyStringObject32)) ++ != PS_OK) { ++ return (-1); ++ } ++ ++ obj_sz = (ssize_t)PyString_GET_SIZE32(&sobj); ++ ++ read_sz = MIN(obj_sz, (ssize_t)buf_len); ++ straddr = (psaddr_t)(addr + offsetof(PyStringObject32, ob_sval)); ++ ++ if (ps_pread(py->pdb_ph, straddr, buf, (size_t)read_sz) != PS_OK) { ++ return (-1); ++ } ++ ++ return (read_sz); ++} ++#endif /* _LP64 */ ++ ++/* ++ * Most Python PyStringObjects contain strings, as one would expect. However, ++ * due to some sleazy hackery in parts of the Python code, some string objects ++ * are used as buffers for binary data. In the general case, ++ * pydb_strobj_readstr() should be used to read strings out of string objects. ++ * It wraps pydb_strobj_readdata(), which should be used by callers only when ++ * trying to retrieve binary data. (This routine does some string cleanup). ++ */ ++static ssize_t ++pydb_strobj_readstr(pydb_agent_t *py, uintptr_t addr, char *buf, ++ size_t buf_len) ++{ ++ ssize_t read_sz; ++ ++ read_sz = pydb_strobj_readdata(py, addr, (unsigned char *)buf, buf_len); ++ ++ if (read_sz >= 0) { ++ if (read_sz >= buf_len) { ++ read_sz = buf_len - 1; ++ } ++ ++ buf[read_sz] = '\0'; ++ } ++ ++ return (read_sz); ++} ++ ++ ++static int ++pydb_frameinfo(pydb_agent_t *py, uintptr_t addr, char *funcnm, ++ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno) ++{ ++ return (py->pdb_ops->frameinfo(py, addr, funcnm, funcnm_sz, ++ filenm, filenm_sz, lineno)); ++} ++ ++static int ++pydb_frameinfo_native(pydb_agent_t *py, uintptr_t addr, char *funcnm, ++ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno) ++{ ++ PyFrameObject fo; ++ PyCodeObject co; ++ ssize_t rc; ++ ++ if (ps_pread(py->pdb_ph, addr, &fo, sizeof (PyFrameObject)) ++ != PS_OK) { ++ return (-1); ++ } ++ ++ if (ps_pread(py->pdb_ph, (uintptr_t)fo.f_code, &co, ++ sizeof (PyCodeObject)) != PS_OK) { ++ return (-1); ++ } ++ ++ rc = pydb_strobj_readstr(py, (uintptr_t)co.co_name, funcnm, funcnm_sz); ++ if (rc < 0) { ++ return (-1); ++ } ++ ++ rc = pydb_strobj_readstr(py, (uintptr_t)co.co_filename, filenm, ++ filenm_sz); ++ if (rc < 0) { ++ return (-1); ++ } ++ ++ *lineno = pydb_getlno(py, (uintptr_t)co.co_lnotab, co.co_firstlineno, ++ fo.f_lasti); ++ if (*lineno < 0) { ++ return (-1); ++ } ++ ++ return (0); ++} ++ ++#if defined (_LP64) ++static int ++pydb_frameinfo_32(pydb_agent_t *py, uintptr_t addr, char *funcnm, ++ size_t funcnm_sz, char *filenm, size_t filenm_sz, int *lineno) ++{ ++ PyFrameObject32 fo; ++ PyCodeObject32 co; ++ ssize_t rc; ++ ++ if (ps_pread(py->pdb_ph, addr, &fo, sizeof (PyFrameObject32)) ++ != PS_OK) { ++ return (-1); ++ } ++ ++ if (ps_pread(py->pdb_ph, (uintptr_t)fo.f_code, &co, ++ sizeof (PyCodeObject32)) != PS_OK) { ++ return (-1); ++ } ++ ++ rc = pydb_strobj_readstr(py, (uintptr_t)co.co_name, funcnm, funcnm_sz); ++ if (rc < 0) { ++ return (-1); ++ } ++ ++ rc = pydb_strobj_readstr(py, (uintptr_t)co.co_filename, filenm, ++ filenm_sz); ++ if (rc < 0) { ++ return (-1); ++ } ++ ++ *lineno = pydb_getlno(py, (uintptr_t)co.co_lnotab, co.co_firstlineno, ++ fo.f_lasti); ++ if (*lineno < 0) { ++ return (-1); ++ } ++ ++ return (0); ++} ++ ++#endif /* _LP64 */ ++ ++/* Functions that are part of the library's interface */ ++ ++/* ++ * Given the address of a PyFrameObject, and a buffer of a known size, ++ * fill the buffer with a description of the frame. ++ */ ++int ++pydb_get_frameinfo(pydb_agent_t *py, uintptr_t frame_addr, char *fbuf, ++ size_t bufsz, int verbose) ++{ ++ char funcname[1024]; ++ char filename[1024]; ++ char *fn; ++ int lineno; ++ int length = (py->pdb_is_64bit ? 16 : 8); ++ int rc; ++ ++ rc = pydb_frameinfo(py, frame_addr, funcname, sizeof (funcname), ++ filename, sizeof (filename), &lineno); ++ if (rc < 0) { ++ return (-1); ++ } ++ ++ if (!verbose) { ++ fn = (char *)strbasename(filename); ++ } else { ++ fn = filename; ++ } ++ ++ (void) snprintf(fbuf, bufsz, "%0.*lx %s:%d %s()\n", length, ++ frame_addr, fn, lineno, funcname); ++ ++ return (0); ++} ++ ++/* ++ * Return a description about a PyFrameObject, if the object is ++ * actually a PyFrameObject. In this case, the pc argument is checked ++ * to make sure that it came from a function that takes a PyFrameObject ++ * as its first (argv[0]) argument. ++ */ ++int ++pydb_pc_frameinfo(pydb_agent_t *py, uintptr_t pc, uintptr_t frame_addr, ++ char *fbuf, size_t bufsz) ++{ ++ char funcname[1024]; ++ char filename[1024]; ++ int lineno; ++ int rc; ++ ps_sym_t psym; ++ ++ /* ++ * If PC doesn't match PyEval_EvalFrameEx in either libpython ++ * or the executable, don't decode it. ++ */ ++ if (ps_pglobal_sym(py->pdb_ph, LIBPYTHON, "PyEval_EvalFrameEx", &psym) ++ != PS_OK) { ++ return (-1); ++ } ++ ++ /* If symbol found, ensure that PC falls within PyEval_EvalFrameEx. */ ++ if (pc < psym.st_value || pc > psym.st_value + psym.st_size) { ++ return (-1); ++ } ++ ++ rc = pydb_frameinfo(py, frame_addr, funcname, sizeof (funcname), ++ filename, sizeof (filename), &lineno); ++ if (rc < 0) { ++ return (-1); ++ } ++ ++ (void) snprintf(fbuf, bufsz, "[ %s:%d (%s) ]\n", filename, lineno, ++ funcname); ++ ++ return (0); ++} ++ ++/* ++ * Walks the list of PyInterpreterState objects. If caller doesn't ++ * supply address of list, this method will look it up. ++ */ ++pydb_iter_t * ++pydb_interp_iter_init(pydb_agent_t *py, uintptr_t addr) ++{ ++ pydb_iter_t *itr; ++ uintptr_t i_addr; ++ int rc; ++ ++ if (addr == 0) { ++ rc = ps_pglobal_lookup(py->pdb_ph, LIBPYTHON, "interp_head", ++ (psaddr_t *)&addr); ++ if (rc != PS_OK) { ++ return (NULL); ++ } ++ } ++ ++ if (ps_pread(py->pdb_ph, (uintptr_t)addr, &i_addr, sizeof (uintptr_t)) ++ != PS_OK) { ++ return (NULL); ++ } ++ ++ itr = malloc(sizeof (pydb_iter_t)); ++ if (itr == NULL) { ++ return (NULL); ++ } ++ ++ itr->pdi_ph = py->pdb_ph; ++ itr->pdi_current = i_addr; ++ itr->pdi_nextf = pydb_interp_iter_next; ++ ++ return (itr); ++} ++ ++static uintptr_t ++pydb_interp_iter_next(pydb_iter_t *iter) ++{ ++ PyInterpreterState st; ++ uintptr_t cur; ++ ++ cur = iter->pdi_current; ++ ++ if (cur == 0) { ++ return (cur); ++ } ++ ++ if (ps_pread(iter->pdi_ph, cur, &st, sizeof (PyInterpreterState)) ++ != PS_OK) { ++ iter->pdi_current = 0; ++ return (0); ++ } ++ ++ iter->pdi_current = (uintptr_t)st.next; ++ ++ return (cur); ++} ++ ++/* ++ * Walk a list of Python PyFrameObjects. The addr argument must be ++ * the address of a valid PyThreadState object. ++ */ ++pydb_iter_t * ++pydb_frame_iter_init(pydb_agent_t *py, uintptr_t addr) ++{ ++ pydb_iter_t *itr; ++ PyThreadState ts; ++ ++ if (ps_pread(py->pdb_ph, (uintptr_t)addr, &ts, sizeof (PyThreadState)) ++ != PS_OK) { ++ return (NULL); ++ } ++ ++ itr = malloc(sizeof (pydb_iter_t)); ++ if (itr == NULL) { ++ return (NULL); ++ } ++ ++ itr->pdi_ph = py->pdb_ph; ++ itr->pdi_current = (uintptr_t)ts.frame; ++ itr->pdi_nextf = pydb_frame_iter_next; ++ ++ return (itr); ++} ++ ++static uintptr_t ++pydb_frame_iter_next(pydb_iter_t *iter) ++{ ++ PyFrameObject fo; ++ uintptr_t cur; ++ ++ cur = iter->pdi_current; ++ ++ if (cur == 0) { ++ return (cur); ++ } ++ ++ if (ps_pread(iter->pdi_ph, cur, &fo, sizeof (PyFrameObject)) ++ != PS_OK) { ++ iter->pdi_current = 0; ++ return (0); ++ } ++ ++ iter->pdi_current = (uintptr_t)fo.f_back; ++ ++ return (cur); ++} ++ ++/* ++ * Walk a list of Python PyThreadState objects. The addr argument must be ++ * the address of a valid PyInterpreterState object. ++ */ ++pydb_iter_t * ++pydb_thread_iter_init(pydb_agent_t *py, uintptr_t addr) ++{ ++ pydb_iter_t *itr; ++ PyInterpreterState is; ++ ++ if (ps_pread(py->pdb_ph, (uintptr_t)addr, &is, ++ sizeof (PyInterpreterState)) != PS_OK) { ++ return (NULL); ++ } ++ ++ itr = malloc(sizeof (pydb_iter_t)); ++ if (itr == NULL) { ++ return (NULL); ++ } ++ ++ itr->pdi_ph = py->pdb_ph; ++ itr->pdi_current = (uintptr_t)is.tstate_head; ++ itr->pdi_nextf = pydb_thread_iter_next; ++ ++ return (itr); ++} ++ ++static uintptr_t ++pydb_thread_iter_next(pydb_iter_t *iter) ++{ ++ PyThreadState ts; ++ uintptr_t cur; ++ ++ cur = iter->pdi_current; ++ ++ if (cur == 0) { ++ return (cur); ++ } ++ ++ if (ps_pread(iter->pdi_ph, cur, &ts, sizeof (PyThreadState)) != PS_OK) { ++ iter->pdi_current = 0; ++ return (0); ++ } ++ ++ iter->pdi_current = (uintptr_t)ts.next; ++ ++ return (cur); ++} ++ ++ ++uintptr_t ++pydb_iter_next(pydb_iter_t *iter) ++{ ++ return (iter->pdi_nextf(iter)); ++} ++ ++void ++pydb_iter_fini(pydb_iter_t *iter) ++{ ++ if (iter == NULL) { ++ return; ++ } ++ ++ free(iter); ++} +--- /dev/null ++++ Python-2.7.1/py_db/libpython27_db.h +@@ -0,0 +1,73 @@ ++/* ++ * CDDL HEADER START ++ * ++ * The contents of this file are subject to the terms of the ++ * Common Development and Distribution License (the "License"). ++ * You may not use this file except in compliance with the License. ++ * ++ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE ++ * or http://www.opensolaris.org/os/licensing. ++ * See the License for the specific language governing permissions ++ * and limitations under the License. ++ * ++ * When distributing Covered Code, include this CDDL HEADER in each ++ * file and include the License file at usr/src/OPENSOLARIS.LICENSE. ++ * If applicable, add the following below this CDDL HEADER, with the ++ * fields enclosed by brackets "[]" replaced with your own identifying ++ * information: Portions Copyright [yyyy] [name of copyright owner] ++ * ++ * CDDL HEADER END ++ */ ++/* ++ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. ++ */ ++ ++#ifndef _LIBPYTHON27_DB_H ++#define _LIBPYTHON27_DB_H ++ ++#include ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++/* Agent is opaque to library's consumers. */ ++typedef struct pydb_agent pydb_agent_t; ++ ++/* ++ * Library's debug version is 1. Changes to interface should increase this ++ * number. ++ */ ++#define PYDB_VERSION 1 ++ ++/* Agent creation/destruction routines */ ++extern pydb_agent_t *pydb_agent_create(struct ps_prochandle *P, int vers); ++extern void pydb_agent_destroy(pydb_agent_t *py); ++ ++/* Used by callers that know they are looking at a PyFrameObject */ ++extern int pydb_get_frameinfo(pydb_agent_t *py, uintptr_t frame_addr, ++ char *fbuf, size_t bufsz, int verbose); ++ ++/* ++ * Used by callers that don't know if they're looking at PyFrameObject. ++ * Checks PC for traceable functions. ++ */ ++extern int pydb_pc_frameinfo(pydb_agent_t *py, uintptr_t pc, ++ uintptr_t frame_addr, char *fbuf, size_t bufsz); ++ ++/* Iterator functions */ ++typedef struct pydb_iter pydb_iter_t; ++ ++extern pydb_iter_t *pydb_frame_iter_init(pydb_agent_t *py, uintptr_t addr); ++extern pydb_iter_t *pydb_interp_iter_init(pydb_agent_t *py, ++ uintptr_t addr); ++extern pydb_iter_t *pydb_thread_iter_init(pydb_agent_t *py, ++ uintptr_t addr); ++extern void pydb_iter_fini(pydb_iter_t *iter); ++extern uintptr_t pydb_iter_next(pydb_iter_t *iter); ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* _LIBPYTHON27_DB_H */ +--- /dev/null ++++ Python-2.7.1/py_db/libpython27_db_32.h +@@ -0,0 +1,121 @@ ++/* ++ * CDDL HEADER START ++ * ++ * The contents of this file are subject to the terms of the ++ * Common Development and Distribution License (the "License"). ++ * You may not use this file except in compliance with the License. ++ * ++ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE ++ * or http://www.opensolaris.org/os/licensing. ++ * See the License for the specific language governing permissions ++ * and limitations under the License. ++ * ++ * When distributing Covered Code, include this CDDL HEADER in each ++ * file and include the License file at usr/src/OPENSOLARIS.LICENSE. ++ * If applicable, add the following below this CDDL HEADER, with the ++ * fields enclosed by brackets "[]" replaced with your own identifying ++ * information: Portions Copyright [yyyy] [name of copyright owner] ++ * ++ * CDDL HEADER END ++ */ ++/* ++ * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. ++ */ ++ ++#ifndef _LIBPYTHON27_DB_32_H ++#define _LIBPYTHON27_DB_32_H ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#include ++ ++/* ++ * Define 32-bit Python data structures for use by the 64-bit debugger. This ++ * is so that a 64-bit debugger may properly examine a 32-bit process. ++ * ++ * In many cases, the debug library is only concerned with a few fields in the ++ * Python structure. In that case, the other ancillary fields are elided. ++ */ ++ ++typedef uint32_t uintptr32_t; ++typedef int32_t Py_ssize32_t; ++ ++typedef struct _is32 { ++ uintptr32_t next; ++ uintptr32_t tstate_head; ++} PyInterpreterState32; ++ ++typedef struct _ts32 { ++ uintptr32_t next; ++ uintptr32_t interp; ++ uintptr32_t frame; ++} PyThreadState32; ++ ++#define PyObject_HEAD32 \ ++ Py_ssize32_t ob_refcnt; \ ++ uintptr32_t ob_type; ++ ++#define PyObject_VAR_HEAD32 \ ++ PyObject_HEAD32 \ ++ Py_ssize32_t ob_size; ++ ++typedef struct { ++ PyObject_HEAD32 ++} PyObject32; ++ ++typedef struct { ++ PyObject_VAR_HEAD32 ++} PyVarObject32; ++ ++typedef struct { ++ PyObject_VAR_HEAD32 ++ int32_t ob_shash; ++ int ob_sstate; ++ char ob_sval[1]; ++} PyStringObject32; ++ ++#define Py_SIZE32(ob) (((PyVarObject32*)(ob))->ob_size) ++#define PyString_GET_SIZE32(op) Py_SIZE32(op) ++#define PyString_AS_STRING32(op) (((PyStringObject32 *)(op))->ob_sval) ++ ++typedef struct { ++ PyObject_VAR_HEAD32 ++ uintptr32_t f_back; ++ uintptr32_t f_code; ++ uintptr32_t f_builtins; ++ uintptr32_t f_globals; ++ uintptr32_t f_locals; ++ uintptr32_t f_valuestack; ++ uintptr32_t f_stacktop; ++ uintptr32_t f_trace; ++ uintptr32_t f_exc_typpe, f_exc_value, f_exc_traceback; ++ uintptr32_t f_tstate; ++ int f_lasti; ++ int f_lineno; ++} PyFrameObject32; ++ ++typedef struct { ++ PyObject_HEAD32 ++ int co_argcount; ++ int co_nlocals; ++ int co_stacksize; ++ int co_flags; ++ uintptr32_t co_code; ++ uintptr32_t co_consts; ++ uintptr32_t co_names; ++ uintptr32_t co_varnames; ++ uintptr32_t co_freevars; ++ uintptr32_t co_cellvars; ++ uintptr32_t co_filename; ++ uintptr32_t co_name; ++ int co_firstlineno; ++ uintptr32_t co_lnotab; ++} PyCodeObject32; ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* _LIBPYTHON27_DB_32_H */ +--- /dev/null ++++ Python-2.7.1/py_db/mapfile-vers +@@ -0,0 +1,39 @@ ++# ++# CDDL HEADER START ++# ++# The contents of this file are subject to the terms of the ++# Common Development and Distribution License (the "License"). ++# You may not use this file except in compliance with the License. ++# ++# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE ++# or http://www.opensolaris.org/os/licensing. ++# See the License for the specific language governing permissions ++# and limitations under the License. ++# ++# When distributing Covered Code, include this CDDL HEADER in each ++# file and include the License file at usr/src/OPENSOLARIS.LICENSE. ++# If applicable, add the following below this CDDL HEADER, with the ++# fields enclosed by brackets "[]" replaced with your own identifying ++# information: Portions Copyright [yyyy] [name of copyright owner] ++# ++# CDDL HEADER END ++# ++ ++# ++# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. ++# ++ ++SUNWprivate_1.1 { ++ global: ++ pydb_agent_create; ++ pydb_agent_destroy; ++ pydb_frame_iter_init; ++ pydb_get_frameinfo; ++ pydb_pc_frameinfo; ++ pydb_interp_iter_init; ++ pydb_thread_iter_init; ++ pydb_iter_fini; ++ pydb_iter_next; ++ local: ++ *; ++}; Added: csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/15-get_wch.patch =================================================================== --- csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/15-get_wch.patch (rev 0) +++ csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/15-get_wch.patch 2015-03-21 13:23:55 UTC (rev 24738) @@ -0,0 +1,48 @@ +--- Python-2.7.6/Modules/_cursesmodule.c.~1~ 2013-11-09 23:36:41.000000000 -0800 ++++ Python-2.7.6/Modules/_cursesmodule.c 2014-05-14 13:36:59.388642793 -0700 +@@ -861,6 +861,37 @@ + } + + static PyObject * ++PyCursesWindow_Get_WCh(PyCursesWindowObject *self, PyObject *args) ++{ ++ int x, y; ++ int ct; ++ wint_t rtn; ++ ++ switch (PyTuple_Size(args)) { ++ case 0: ++ Py_BEGIN_ALLOW_THREADS ++ ct = wget_wch(self->win,&rtn); ++ Py_END_ALLOW_THREADS ++ break; ++ case 2: ++ if (!PyArg_ParseTuple(args,"ii;y,x",&y,&x)) ++ return NULL; ++ Py_BEGIN_ALLOW_THREADS ++ ct = mvwget_wch(self->win,y,x,&rtn); ++ Py_END_ALLOW_THREADS ++ break; ++ default: ++ PyErr_SetString(PyExc_TypeError, "get_wch requires 0 or 2 arguments"); ++ return NULL; ++ } ++ if (ct == ERR) { ++ PyErr_SetString(PyCursesError, "get_wch failed"); ++ return NULL; ++ } ++ return PyInt_FromLong((long)rtn); ++} ++ ++static PyObject * + PyCursesWindow_GetKey(PyCursesWindowObject *self, PyObject *args) + { + int x, y; +@@ -1572,6 +1603,7 @@ + {"getbegyx", (PyCFunction)PyCursesWindow_getbegyx, METH_NOARGS}, + {"getbkgd", (PyCFunction)PyCursesWindow_GetBkgd, METH_NOARGS}, + {"getch", (PyCFunction)PyCursesWindow_GetCh, METH_VARARGS}, ++ {"get_wch", (PyCFunction)PyCursesWindow_Get_WCh, METH_VARARGS}, + {"getkey", (PyCFunction)PyCursesWindow_GetKey, METH_VARARGS}, + {"getmaxyx", (PyCFunction)PyCursesWindow_getmaxyx, METH_NOARGS}, + {"getparyx", (PyCFunction)PyCursesWindow_getparyx, METH_NOARGS}, Added: csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/16-ossaudiodev.patch =================================================================== --- csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/16-ossaudiodev.patch (rev 0) +++ csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/16-ossaudiodev.patch 2015-03-21 13:23:55 UTC (rev 24738) @@ -0,0 +1,58 @@ +--- Python-2.7.7/Modules/ossaudiodev.c.~1~ 2014-05-31 11:58:40.000000000 -0700 ++++ Python-2.7.7/Modules/ossaudiodev.c 2014-06-02 10:58:12.132478970 -0700 +@@ -1037,6 +1037,7 @@ + _EXPORT_INT(m, SOUND_MIXER_MONITOR); + #endif + ++#ifndef __sun + /* Expose all the ioctl numbers for masochists who like to do this + stuff directly. */ + _EXPORT_INT(m, SNDCTL_COPR_HALT); +@@ -1049,6 +1050,7 @@ + _EXPORT_INT(m, SNDCTL_COPR_SENDMSG); + _EXPORT_INT(m, SNDCTL_COPR_WCODE); + _EXPORT_INT(m, SNDCTL_COPR_WDATA); ++#endif + #ifdef SNDCTL_DSP_BIND_CHANNEL + _EXPORT_INT(m, SNDCTL_DSP_BIND_CHANNEL); + #endif +@@ -1070,8 +1072,12 @@ + _EXPORT_INT(m, SNDCTL_DSP_GETSPDIF); + #endif + _EXPORT_INT(m, SNDCTL_DSP_GETTRIGGER); ++#ifdef SNDCTL_DSP_MAPINBUF + _EXPORT_INT(m, SNDCTL_DSP_MAPINBUF); ++#endif ++#ifdef SNDCTL_DSP_MAPOUTBUF + _EXPORT_INT(m, SNDCTL_DSP_MAPOUTBUF); ++#endif + _EXPORT_INT(m, SNDCTL_DSP_NONBLOCK); + _EXPORT_INT(m, SNDCTL_DSP_POST); + #ifdef SNDCTL_DSP_PROFILE +@@ -1091,6 +1097,7 @@ + _EXPORT_INT(m, SNDCTL_DSP_STEREO); + _EXPORT_INT(m, SNDCTL_DSP_SUBDIVIDE); + _EXPORT_INT(m, SNDCTL_DSP_SYNC); ++#ifndef __sun + _EXPORT_INT(m, SNDCTL_FM_4OP_ENABLE); + _EXPORT_INT(m, SNDCTL_FM_LOAD_INSTR); + _EXPORT_INT(m, SNDCTL_MIDI_INFO); +@@ -1132,4 +1139,5 @@ + _EXPORT_INT(m, SNDCTL_TMR_STOP); + _EXPORT_INT(m, SNDCTL_TMR_TEMPO); + _EXPORT_INT(m, SNDCTL_TMR_TIMEBASE); ++#endif + } +--- Python-2.7.8/setup.py.~5~ 2014-07-17 20:47:50.251398063 -0700 ++++ Python-2.7.8/setup.py 2014-07-17 20:47:50.359537973 -0700 +@@ -1638,8 +1638,8 @@ + else: + missing.append('linuxaudiodev') + +- if (host_platform in ('linux2', 'freebsd4', 'freebsd5', 'freebsd6', +- 'freebsd7', 'freebsd8') ++ if (host_platform in ('sunos5', 'linux2', 'freebsd4', 'freebsd5', ++ 'freebsd6', 'freebsd7', 'freebsd8') + or host_platform.startswith("gnukfreebsd")): + exts.append( Extension('ossaudiodev', ['ossaudiodev.c']) ) + else: Added: csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/18-osconf-long.patch =================================================================== --- csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/18-osconf-long.patch (rev 0) +++ csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/18-osconf-long.patch 2015-03-21 13:23:55 UTC (rev 24738) @@ -0,0 +1,11 @@ +--- Python-2.7.7/Modules/posixmodule.c.~2~ 2014-06-02 11:01:10.919544709 -0700 ++++ Python-2.7.7/Modules/posixmodule.c 2014-06-02 11:01:11.009553336 -0700 +@@ -8499,7 +8499,7 @@ + int name; + + if (PyArg_ParseTuple(args, "O&:sysconf", conv_sysconf_confname, &name)) { +- int value; ++ long value; + + errno = 0; + value = sysconf(name); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From chninkel at users.sourceforge.net Sat Mar 21 16:10:16 2015 From: chninkel at users.sourceforge.net (chninkel at users.sourceforge.net) Date: Sat, 21 Mar 2015 15:10:16 +0000 Subject: SF.net SVN: gar:[24739] csw/mgar/pkg/openssl1/trunk/files/ more_configure_targets.patch.SunOS5.9 Message-ID: <3l8QQC4ZYsz1XK@mail.opencsw.org> Revision: 24739 http://sourceforge.net/p/gar/code/24739 Author: chninkel Date: 2015-03-21 15:10:16 +0000 (Sat, 21 Mar 2015) Log Message: ----------- openssl1/trunk: update sol9 patch for openssl 1.0.1m Modified Paths: -------------- csw/mgar/pkg/openssl1/trunk/files/more_configure_targets.patch.SunOS5.9 Modified: csw/mgar/pkg/openssl1/trunk/files/more_configure_targets.patch.SunOS5.9 =================================================================== --- csw/mgar/pkg/openssl1/trunk/files/more_configure_targets.patch.SunOS5.9 2015-03-21 13:23:55 UTC (rev 24738) +++ csw/mgar/pkg/openssl1/trunk/files/more_configure_targets.patch.SunOS5.9 2015-03-21 15:10:16 UTC (rev 24739) @@ -1,19 +1,9 @@ -From a693531b40e1f8d707cea5f984d935358c12f14d Mon Sep 17 00:00:00 2001 -From: Yann Rouillard -Date: Sun, 10 Mar 2013 12:14:09 +0100 -Subject: [PATCH] More configure targets - ---- - Configure | 8 ++++++++ - 1 file changed, 8 insertions(+) - -diff --git a/Configure b/Configure -index a84e9d7..6f93ad3 100755 ---- a/Configure -+++ b/Configure -@@ -267,6 +267,14 @@ my %table=( +diff --speed-large-files --minimal -Nru ./Configure.old ./Configure +--- ./Configure.old 2015-03-20 22:50:04.861332664 +0100 ++++ ./Configure 2015-03-20 22:50:09.224641344 +0100 +@@ -267,6 +267,14 @@ # to discard unused sections and files when linking wanboot-openssl.o - "solaris64-sparcv9-cc-sunw-wanboot","cc:-xtarget=ultra -m64 -xregs=no%appl -xO5 -xstrconst -xdepend -xspace -xF=%all -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl:BN_LLONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-m64 -G -dy -z text -zdefs -Bdirect -zignore:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs::/64", + "solaris64-sparcv9-cc-sunw-wanboot","cc:-xtarget=ultra -m64 -Qoption cg -xregs=no%appl -xO5 -xstrconst -xdepend -xspace -xF=%all -Xa -DB_ENDIAN::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl:BN_LLONG RC4_CHUNK DES_INT DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-m64 -G -dy -z text -zdefs -Bdirect -zignore -M/usr/lib/ld/map.pagealign:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR):/usr/ccs/bin/ar rs::/64", +#### More configure targets for Opencsw build +"solaris-x86-pentium_pro-cc-sunw","cc:-m32 -xarch=pentium_pro -xO3 -xspace -Xa::-D_REENTRANT::-lsocket -lnsl -lc:BN_LLONG RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${x86_elf_asm}:dlfcn:solaris-shared:-KPIC:-m32 -G -dy -z text -zdefs -Bdirect -zignore:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", @@ -25,7 +15,4 @@ + #### IRIX 5.x configs # -mips2 flag is added by ./config when appropriate. - "irix-gcc","gcc:-O3 -DTERMIOS -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR:${mips32_asm}:o32:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", --- -1.8.1.4 - + "irix-gcc","gcc:-O3 -DB_ENDIAN::(unknown):::BN_LLONG MD2_CHAR RC4_INDEX RC4_CHAR RC4_CHUNK DES_UNROLL DES_RISC2 DES_PTR BF_PTR:${mips32_asm}:o32:dlfcn:irix-shared:::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From chninkel at users.sourceforge.net Sat Mar 21 17:22:22 2015 From: chninkel at users.sourceforge.net (chninkel at users.sourceforge.net) Date: Sat, 21 Mar 2015 16:22:22 +0000 Subject: SF.net SVN: gar:[24741] csw/mgar/pkg/openssl1/trunk Message-ID: <3l8S2b0wkxz2q@mail.opencsw.org> Revision: 24741 http://sourceforge.net/p/gar/code/24741 Author: chninkel Date: 2015-03-21 16:22:22 +0000 (Sat, 21 Mar 2015) Log Message: ----------- openssl1/trunk: update oracle upstream patches Modified Paths: -------------- csw/mgar/pkg/openssl1/trunk/Makefile csw/mgar/pkg/openssl1/trunk/files/more_configure_targets.patch Added Paths: ----------- csw/mgar/pkg/openssl1/trunk/files/openssl-1.0.1m-fork_safe.patch csw/mgar/pkg/openssl1/trunk/files/openssl-1.0.1m-pkcs11-engine.patch csw/mgar/pkg/openssl1/trunk/files/openssl-1.0.1m-t4-engine.sparc.5.11.patch csw/mgar/pkg/openssl1/trunk/files/openssl-1.0.1m-wanboot.patch Removed Paths: ------------- csw/mgar/pkg/openssl1/trunk/files/openssl-1.0.1f-pkcs11-engine.patch csw/mgar/pkg/openssl1/trunk/files/openssl-1.0.1f-wanboot.patch Modified: csw/mgar/pkg/openssl1/trunk/Makefile =================================================================== --- csw/mgar/pkg/openssl1/trunk/Makefile 2015-03-21 15:33:42 UTC (rev 24740) +++ csw/mgar/pkg/openssl1/trunk/Makefile 2015-03-21 16:22:22 UTC (rev 24741) @@ -134,9 +134,15 @@ # Bug opened upstream: http://rt.openssl.org/Ticket/Display.html?id=3153 PATCHFILES += make_issetugid_support_configurable.patch +# Patch taken from Oracle upstream (PSARC/2014/077 OpenSSL Thread and Fork Safety 17822462) +# from https://hg.openindiana.org/upstream/oracle/userland-gate/ +# This patch solves a bug with thread and fork safety and is also needed so that +# upstream wanboot patch can be applied out of the box +PATCHFILES += openssl-1.0.1m-fork_safe.patch + # support for pkcs11 engine http://blogs.sun.com/chichang1/entry/how_to_integrate_pkcs11_engine ifneq ($(shell /usr/bin/uname -r),5.9) - PATCHFILES += openssl-1.0.1f-pkcs11-engine.patch + PATCHFILES += openssl-1.0.1m-pkcs11-engine.patch ENGINES += pk11 endif @@ -149,8 +155,8 @@ # The upstream t4 engine patch depends on the wanboot one # so we will apply the wanboot patch even if we will not enable wanboot -PATCHFILES.sparc.5.11 += openssl-1.0.1f-wanboot.patch -PATCHFILES.sparc.5.11 += openssl-1.0.1f-t4-engine.sparc.5.11.patch +PATCHFILES.sparc.5.11 += openssl-1.0.1m-wanboot.patch +PATCHFILES.sparc.5.11 += openssl-1.0.1m-t4-engine.sparc.5.11.patch PATCHFILES.sparc.5.11 += openssl-1.0.1e-t4-engine-sparcv9+vis.sparc.5.11.patch PATCHFILES += $(PATCHFILES.$(GARCH).$(GAROSREL)) Modified: csw/mgar/pkg/openssl1/trunk/files/more_configure_targets.patch =================================================================== --- csw/mgar/pkg/openssl1/trunk/files/more_configure_targets.patch 2015-03-21 15:33:42 UTC (rev 24740) +++ csw/mgar/pkg/openssl1/trunk/files/more_configure_targets.patch 2015-03-21 16:22:22 UTC (rev 24741) @@ -8,7 +8,7 @@ +#### More configure targets for Opencsw build +"solaris-x86-pentium_pro-cc-sunw","cc:-m32 -xarch=pentium_pro -xO3 -xspace -Xa::-D_REENTRANT::-lsocket -lnsl -lc:BN_LLONG RC4_CHUNK DES_PTR DES_UNROLL BF_PTR:${x86_elf_asm}:dlfcn:solaris-shared:-KPIC:-m32 -G -dy -z text -zdefs -Bdirect -zignore -M/usr/lib/ld/map.pagealign -M/usr/lib/ld/map.noexdata:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +# -++"solaris-sparcv8-cc-sunw","cc:-xtarget=v8 -m32 -Qoption cg -xregs=no%appl -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -lc:BN_LLONG RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-m32 -G -dy -z text -zdefs -Bdirect -zignore -M/usr/lib/ld/map.pagealign:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", ++"solaris-sparcv8-cc-sunw","cc:-xtarget=v8 -m32 -Qoption cg -xregs=no%appl -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -lc:BN_LLONG RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-m32 -G -dy -z text -zdefs -Bdirect -zignore -M/usr/lib/ld/map.pagealign:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", +# +"solaris-sparcv9+vis-cc-sunw","cc:-xtarget=ultra -m32 -xarch=sparcvis -Qoption cg -xregs=no%appl -xO5 -xstrconst -xdepend -Xa -DB_ENDIAN -DBN_DIV2W::-D_REENTRANT:ULTRASPARC:-lsocket -lnsl -lc:BN_LLONG RC4_CHUNK_LL DES_PTR DES_RISC1 DES_UNROLL BF_PTR:${sparcv9_asm}:dlfcn:solaris-shared:-KPIC:-m32 -G -dy -z text -zdefs -Bdirect -zignore -M/usr/lib/ld/map.pagealign:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)", + Deleted: csw/mgar/pkg/openssl1/trunk/files/openssl-1.0.1f-pkcs11-engine.patch =================================================================== --- csw/mgar/pkg/openssl1/trunk/files/openssl-1.0.1f-pkcs11-engine.patch 2015-03-21 15:33:42 UTC (rev 24740) +++ csw/mgar/pkg/openssl1/trunk/files/openssl-1.0.1f-pkcs11-engine.patch 2015-03-21 16:22:22 UTC (rev 24741) @@ -1,9010 +0,0 @@ ---- /tmp/Configure Fri Feb 11 14:40:39 2011 -+++ openssl-1.0.0d/Configure Fri Feb 11 14:41:36 2011 -@@ -10,7 +10,7 @@ - - # see INSTALL for instructions. - --my $usage="Usage: Configure [no- ...] [enable- ...] [experimental- ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n"; -+my $usage="Usage: Configure --pk11-libname=PK11_LIB_LOCATION [no- ...] [enable- ...] [experimental- ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]\n"; - - # Options: - # -@@ -19,6 +19,9 @@ - # --prefix prefix for the OpenSSL include, lib and bin directories - # (Default: the OPENSSLDIR directory) - # -+# --pk11-libname PKCS#11 library name. -+# (Default: none) -+# - # --install_prefix Additional prefix for package builders (empty by - # default). This needn't be set in advance, you can - # just as well use "make INSTALL_PREFIX=/whatever install". -@@ -657,6 +661,9 @@ - my $idx_arflags = $idx++; - my $idx_multilib = $idx++; - -+# PKCS#11 engine patch -+my $pk11_libname=""; -+ - my $prefix=""; - my $libdir=""; - my $openssldir=""; -@@ -876,6 +879,10 @@ - $_ =~ s/%([0-9a-f]{1,2})/chr(hex($1))/gei; - $flags.=$_." "; - } -+ elsif (/^--pk11-libname=(.*)$/) -+ { -+ $pk11_libname=$1; -+ } - elsif (/^--prefix=(.*)$/) - { - $prefix=$1; -@@ -1043,6 +1054,13 @@ - exit 0; - } - -+if (! $pk11_libname) -+ { -+ print STDERR "You must set --pk11-libname for PKCS#11 library.\n"; -+ print STDERR "See README.pkcs11 for more information.\n"; -+ exit 1; -+ } -+ - if ($target =~ m/^CygWin32(-.*)$/) { - $target = "Cygwin".$1; - } -@@ -1209,6 +1226,8 @@ - if ($flags ne "") { $cflags="$flags$cflags"; } - else { $no_user_cflags=1; } - -+$cflags="-DPK11_LIB_LOCATION=\"$pk11_libname\" $cflags"; -+ - # Kerberos settings. The flavor must be provided from outside, either through - # the script "config" or manually. - if (!$no_krb5) -@@ -1598,6 +1617,7 @@ - s/^VERSION=.*/VERSION=$version/; - s/^MAJOR=.*/MAJOR=$major/; - s/^MINOR=.*/MINOR=$minor/; -+ s/^PK11_LIB_LOCATION=.*/PK11_LIB_LOCATION=$pk11_libname/; - s/^SHLIB_VERSION_NUMBER=.*/SHLIB_VERSION_NUMBER=$shlib_version_number/; - s/^SHLIB_VERSION_HISTORY=.*/SHLIB_VERSION_HISTORY=$shlib_version_history/; - s/^SHLIB_MAJOR=.*/SHLIB_MAJOR=$shlib_major/; ---- /tmp/Makefile.org Fri Feb 11 14:41:54 2011 -+++ openssl-1.0.0d/Makefile.org Fri Feb 11 14:38:01 2011 -@@ -26,6 +26,9 @@ - INSTALL_PREFIX= - INSTALLTOP=/usr/local/ssl - -+# You must set this through --pk11-libname configure option. -+PK11_LIB_LOCATION= -+ - # Do not edit this manually. Use Configure --openssldir=DIR do change this! - OPENSSLDIR=/usr/local/ssl - ---- /tmp/Makefile Mon Feb 14 14:59:22 2011 -+++ openssl-1.0.0d/engines/Makefile Mon Feb 14 15:00:35 2011 -@@ -26,7 +26,8 @@ - APPS= - - LIB=$(TOP)/libcrypto.a --LIBNAMES= 4758cca aep atalla cswift gmp chil nuron sureware ubsec padlock capi -+LIBNAMES= 4758cca aep atalla cswift gmp chil nuron sureware ubsec padlock capi \ -+ pk11 - - LIBSRC= e_4758cca.c \ - e_aep.c \ -@@ -38,7 +39,8 @@ - e_sureware.c \ - e_ubsec.c \ - e_padlock.c \ -- e_capi.c -+ e_capi.c \ -+ e_pk11.c - LIBOBJ= e_4758cca.o \ - e_aep.o \ - e_atalla.o \ -@@ -49,7 +51,8 @@ - e_sureware.o \ - e_ubsec.o \ - e_padlock.o \ -- e_capi.o -+ e_capi.o \ -+ e_pk11.o - - SRC= $(LIBSRC) - -@@ -63,7 +66,8 @@ - e_nuron_err.c e_nuron_err.h \ - e_sureware_err.c e_sureware_err.h \ - e_ubsec_err.c e_ubsec_err.h \ -- e_capi_err.c e_capi_err.h -+ e_capi_err.c e_capi_err.h \ -+ e_pk11.h e_pk11_uri.h e_pk11_err.h e_pk11_pub.c e_pk11_uri.c e_pk11_err.c - - ALL= $(GENERAL) $(SRC) $(HEADER) - -@@ -78,7 +82,7 @@ - for l in $(LIBNAMES); do \ - $(MAKE) -f ../Makefile.shared -e \ - LIBNAME=$$l LIBEXTRAS=e_$$l.o \ -- LIBDEPS='-L.. -lcrypto $(EX_LIBS)' \ -+ LIBDEPS='-L.. -lcrypto -lcryptoutil $(EX_LIBS)' \ - link_o.$(SHLIB_TARGET); \ - done; \ - else \ ---- crypto/engine/eng_all.c Thu Sep 5 12:59:50 2013 -+++ openssl-1.0.1e/crypto/engine/eng_all.c Thu Sep 5 12:59:50 2013 -@@ -59,6 +59,16 @@ - #include "cryptlib.h" - #include "eng_int.h" - -+/* -+ * pkcs11 engine no longer is a built-in engine, and ENGINE_load_pk11() needs to be -+ * defined in libcrypto.so for ssh. Instead of load pkcs11 engine, it load dynamic -+ * engines. -+ */ -+void ENGINE_load_pk11(void) -+ { -+ ENGINE_load_dynamic(); -+ } -+ - void ENGINE_load_builtin_engines(void) - { - /* Some ENGINEs need this */ ---- crypto/dso/dso_lib.c Thu Sep 5 12:59:50 2013 -+++ openssl-1.0.1e/crypto/dso/dso_lib.c Thu Sep 5 12:59:50 2013 -@@ -426,6 +426,26 @@ - DSOerr(DSO_F_DSO_CONVERT_FILENAME, DSO_R_NO_FILENAME); - return (NULL); - } -+ /* -+ * For pkcs11 engine, use libpk11.so (instead of libpkcs11.so) to -+ * avoid the name collision with PKCS#11 library. -+ */ -+ if (strcmp(filename, "pkcs11") == 0) -+ { -+#ifdef _LP64 -+ char *fullpath = "/opt/csw/lib/64/openssl-1.0.0/engines/libpk11.so"; -+#else -+ char *fullpath = "/opt/csw/lib/openssl-1.0.0/engines/libpk11.so"; -+#endif -+ result = OPENSSL_malloc(strlen(fullpath) + 1); -+ if(result == NULL) -+ { -+ DSOerr(DSO_F_DSO_CONVERT_FILENAME, ERR_R_MALLOC_FAILURE); -+ return(NULL); -+ } -+ BUF_strlcpy(result, fullpath, strlen(fullpath) + 1); -+ return (result); -+ } - if ((dso->flags & DSO_FLAG_NO_NAME_TRANSLATION) == 0) { - if (dso->name_converter != NULL) - result = dso->name_converter(dso, filename); ---- /tmp/engine.h Fri Feb 11 14:46:24 2011 -+++ openssl-1.0.0d/crypto/engine/engine.h Fri Feb 11 14:47:32 2011 -@@ -351,6 +351,7 @@ - #endif - #endif - void ENGINE_load_cryptodev(void); -+void ENGINE_load_pk11(void); - void ENGINE_load_rsax(void); - void ENGINE_load_rdrand(void); - void ENGINE_load_builtin_engines(void); -Index: crypto//e_pk11.c -=================================================================== -diff -uNr openssl-1.0.1f/engines/e_pk11.c openssl-1.0.1f/engines/e_pk11.c ---- openssl-1.0.1f/engines/e_pk11.c 1970-01-01 01:00:00.000000000 +0100 -+++ openssl-1.0.1f/engines/e_pk11.c 2014-02-07 21:35:52.%N +0100 -@@ -0,0 +1,3713 @@ -+/* -+ * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. -+ */ -+ -+/* crypto/engine/e_pk11.c */ -+/* -+ * This product includes software developed by the OpenSSL Project for -+ * use in the OpenSSL Toolkit (http://www.openssl.org/). -+ * -+ * This project also referenced hw_pkcs11-0.9.7b.patch written by -+ * Afchine Madjlessi. -+ */ -+/* -+ * ==================================================================== -+ * Copyright (c) 2000-2001 The OpenSSL Project. All rights reserved. -+ * -+ * Redistribution and use in source and binary forms, with or without -+ * modification, are permitted provided that the following conditions -+ * are met: -+ * -+ * 1. Redistributions of source code must retain the above copyright -+ * notice, this list of conditions and the following disclaimer. -+ * -+ * 2. Redistributions in binary form must reproduce the above copyright -+ * notice, this list of conditions and the following disclaimer in -+ * the documentation and/or other materials provided with the -+ * distribution. -+ * -+ * 3. All advertising materials mentioning features or use of this -+ * software must display the following acknowledgment: -+ * "This product includes software developed by the OpenSSL Project -+ * for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)" -+ * -+ * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to -+ * endorse or promote products derived from this software without -+ * prior written permission. For written permission, please contact -+ * licensing at OpenSSL.org. -+ * -+ * 5. Products derived from this software may not be called "OpenSSL" -+ * nor may "OpenSSL" appear in their names without prior written -+ * permission of the OpenSSL Project. -+ * -+ * 6. Redistributions of any form whatsoever must retain the following -+ * acknowledgment: -+ * "This product includes software developed by the OpenSSL Project -+ * for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)" -+ * -+ * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY -+ * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR -+ * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) -+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED -+ * OF THE POSSIBILITY OF SUCH DAMAGE. -+ * ==================================================================== -+ * -+ * This product includes cryptographic software written by Eric Young -+ * (eay at cryptsoft.com). This product includes software written by Tim -+ * Hudson (tjh at cryptsoft.com). -+ * -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#ifndef OPENSSL_NO_RSA -+#include -+#endif -+#ifndef OPENSSL_NO_DSA -+#include -+#endif -+#ifndef OPENSSL_NO_DH -+#include -+#endif -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#ifndef OPENSSL_NO_HW -+#ifndef OPENSSL_NO_HW_PK11 -+ -+/* label for debug messages printed on stderr */ -+#define PK11_DBG "PKCS#11 ENGINE DEBUG" -+/* prints a lot of debug messages on stderr about slot selection process */ -+#undef DEBUG_SLOT_SELECTION -+/* -+ * Solaris specific code. See comment at check_hw_mechanisms() for more -+ * information. -+ */ -+#if defined(__SVR4) && defined(__sun) -+#define SOLARIS_HW_SLOT_SELECTION -+#endif -+ -+#ifdef SOLARIS_HW_SLOT_SELECTION -+#include -+#endif -+ -+#ifdef DEBUG_SLOT_SELECTION -+#define DEBUG_SLOT_SEL(...) fprintf(stderr, __VA_ARGS__) -+#else -+#define DEBUG_SLOT_SEL(...) -+#endif -+ -+#include -+#include -+#include "e_pk11.h" -+#include "e_pk11_uri.h" -+ -+static CK_BBOOL pk11_true = CK_TRUE; -+static CK_BBOOL pk11_false = CK_FALSE; -+#define PK11_ENGINE_LIB_NAME "PKCS#11 engine" -+#include "e_pk11_err.c" -+#include "e_pk11_uri.c" -+#include "e_pk11_pub.c" -+ -+/* -+ * We use this lock to prevent multiple C_Login()s, guard getpassphrase(), -+ * uri_struct manipulation, and static token info. All of that is used by the -+ * RSA keys by reference feature. -+ */ -+pthread_mutex_t *uri_lock = NULL; -+ -+#ifdef SOLARIS_HW_SLOT_SELECTION -+/* -+ * Tables for symmetric ciphers and digest mechs found in the pkcs11_kernel -+ * library. See comment at check_hw_mechanisms() for more information. -+ */ -+int *hw_cnids; -+int *hw_dnids; -+#endif /* SOLARIS_HW_SLOT_SELECTION */ -+ -+/* PKCS#11 session caches and their locks for all operation types */ -+static PK11_CACHE session_cache[OP_MAX]; -+ -+/* -+ * We cache the flags so that we do not have to run C_GetTokenInfo() again when -+ * logging into the token. -+ */ -+CK_FLAGS pubkey_token_flags; -+ -+/* -+ * As stated in v2.20, 11.7 Object Management Function, in section for -+ * C_FindObjectsInit(), at most one search operation may be active at a given -+ * time in a given session. Therefore, C_Find{,Init,Final}Objects() should be -+ * grouped together to form one atomic search operation. This is already -+ * ensured by the property of unique PKCS#11 session handle used for each -+ * PK11_SESSION object. -+ * -+ * This is however not the biggest concern - maintaining consistency of the -+ * underlying object store is more important. The same section of the spec also -+ * says that one thread can be in the middle of a search operation while another -+ * thread destroys the object matching the search template which would result in -+ * invalid handle returned from the search operation. -+ * -+ * Hence, the following locks are used for both protection of the object stores. -+ * They are also used for active list protection. -+ */ -+pthread_mutex_t *find_lock[OP_MAX] = { NULL }; -+ -+/* -+ * lists of asymmetric key handles which are active (referenced by at least one -+ * PK11_SESSION structure, either held by a thread or present in free_session -+ * list) for given algorithm type -+ */ -+PK11_active *active_list[OP_MAX] = { NULL }; -+ -+/* -+ * Create all secret key objects in a global session so that they are available -+ * to use for other sessions. These other sessions may be opened or closed -+ * without losing the secret key objects. -+ */ -+static CK_SESSION_HANDLE global_session = CK_INVALID_HANDLE; -+ -+/* Index for the supported ciphers */ -+enum pk11_cipher_id -+ { -+ PK11_DES_CBC, -+ PK11_DES3_CBC, -+ PK11_DES_ECB, -+ PK11_DES3_ECB, -+ PK11_RC4, -+ PK11_AES_128_CBC, -+ PK11_AES_192_CBC, -+ PK11_AES_256_CBC, -+ PK11_AES_128_ECB, -+ PK11_AES_192_ECB, -+ PK11_AES_256_ECB, -+ PK11_BLOWFISH_CBC, -+ PK11_AES_128_CTR, -+ PK11_AES_192_CTR, -+ PK11_AES_256_CTR, -+ PK11_CIPHER_MAX -+ }; -+ -+/* Index for the supported digests */ -+enum pk11_digest_id -+ { -+ PK11_MD5, -+ PK11_SHA1, -+ PK11_SHA224, -+ PK11_SHA256, -+ PK11_SHA384, -+ PK11_SHA512, -+ PK11_DIGEST_MAX -+ }; -+ -+typedef struct PK11_CIPHER_st -+ { -+ enum pk11_cipher_id id; -+ int nid; -+ int iv_len; -+ int min_key_len; -+ int max_key_len; -+ CK_KEY_TYPE key_type; -+ CK_MECHANISM_TYPE mech_type; -+ } PK11_CIPHER; -+ -+typedef struct PK11_DIGEST_st -+ { -+ enum pk11_digest_id id; -+ int nid; -+ CK_MECHANISM_TYPE mech_type; -+ } PK11_DIGEST; -+ -+/* ENGINE level stuff */ -+static int pk11_init(ENGINE *e); -+static int pk11_library_init(ENGINE *e); -+static int pk11_finish(ENGINE *e); -+static int pk11_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)()); -+static int pk11_destroy(ENGINE *e); -+ -+/* RAND stuff */ -+static void pk11_rand_seed(const void *buf, int num); -+static void pk11_rand_add(const void *buf, int num, double add_entropy); -+static void pk11_rand_cleanup(void); -+static int pk11_rand_bytes(unsigned char *buf, int num); -+static int pk11_rand_status(void); -+ -+/* These functions are also used in other files */ -+PK11_SESSION *pk11_get_session(PK11_OPTYPE optype); -+void pk11_return_session(PK11_SESSION *sp, PK11_OPTYPE optype); -+ -+/* active list manipulation functions used in this file */ -+extern int pk11_active_delete(CK_OBJECT_HANDLE h, PK11_OPTYPE type); -+extern void pk11_free_active_list(PK11_OPTYPE type); -+ -+#ifndef OPENSSL_NO_RSA -+int pk11_destroy_rsa_key_objects(PK11_SESSION *session); -+int pk11_destroy_rsa_object_pub(PK11_SESSION *sp, CK_BBOOL uselock); -+int pk11_destroy_rsa_object_priv(PK11_SESSION *sp, CK_BBOOL uselock); -+#endif -+#ifndef OPENSSL_NO_DSA -+int pk11_destroy_dsa_key_objects(PK11_SESSION *session); -+int pk11_destroy_dsa_object_pub(PK11_SESSION *sp, CK_BBOOL uselock); -+int pk11_destroy_dsa_object_priv(PK11_SESSION *sp, CK_BBOOL uselock); -+#endif -+#ifndef OPENSSL_NO_DH -+int pk11_destroy_dh_key_objects(PK11_SESSION *session); -+int pk11_destroy_dh_object(PK11_SESSION *session, CK_BBOOL uselock); -+#endif -+ -+/* Local helper functions */ -+static int pk11_free_all_sessions(void); -+static int pk11_free_session_list(PK11_OPTYPE optype); -+static int pk11_setup_session(PK11_SESSION *sp, PK11_OPTYPE optype); -+static int pk11_destroy_cipher_key_objects(PK11_SESSION *session); -+static int pk11_destroy_object(CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE oh, -+ CK_BBOOL persistent); -+static const char *get_PK11_LIBNAME(void); -+static void free_PK11_LIBNAME(void); -+static long set_PK11_LIBNAME(const char *name); -+ -+/* Symmetric cipher and digest support functions */ -+static int cipher_nid_to_pk11(int nid); -+static int pk11_usable_ciphers(const int **nids); -+static int pk11_usable_digests(const int **nids); -+static int pk11_cipher_init(EVP_CIPHER_CTX *ctx, const unsigned char *key, -+ const unsigned char *iv, int enc); -+static int pk11_cipher_final(PK11_SESSION *sp); -+static int pk11_cipher_do_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, -+ const unsigned char *in, size_t inl); -+static int pk11_cipher_cleanup(EVP_CIPHER_CTX *ctx); -+static int pk11_engine_ciphers(ENGINE *e, const EVP_CIPHER **cipher, -+ const int **nids, int nid); -+static int pk11_engine_digests(ENGINE *e, const EVP_MD **digest, -+ const int **nids, int nid); -+static CK_OBJECT_HANDLE pk11_get_cipher_key(EVP_CIPHER_CTX *ctx, -+ const unsigned char *key, CK_KEY_TYPE key_type, PK11_SESSION *sp); -+static int check_new_cipher_key(PK11_SESSION *sp, const unsigned char *key, -+ int key_len); -+static int md_nid_to_pk11(int nid); -+static int pk11_digest_init(EVP_MD_CTX *ctx); -+static int pk11_digest_update(EVP_MD_CTX *ctx, const void *data, -+ size_t count); -+static int pk11_digest_final(EVP_MD_CTX *ctx, unsigned char *md); -+static int pk11_digest_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from); -+static int pk11_digest_cleanup(EVP_MD_CTX *ctx); -+ -+static int pk11_choose_slots(int *any_slot_found); -+static void pk11_choose_rand_slot(CK_TOKEN_INFO token_info, -+ CK_SLOT_ID current_slot); -+static void pk11_choose_pubkey_slot(CK_MECHANISM_INFO mech_info, -+ CK_TOKEN_INFO token_info, CK_SLOT_ID current_slot, CK_RV rv, -+ int best_number_of_mechs, CK_SLOT_ID best_pubkey_slot_sofar); -+static void pk11_choose_cipher_digest(int *local_cipher_nids, -+ int *local_digest_nids, CK_FUNCTION_LIST_PTR pflist, -+ CK_SLOT_ID current_slot); -+static void pk11_find_symmetric_ciphers(CK_FUNCTION_LIST_PTR pflist, -+ CK_SLOT_ID current_slot, int *current_slot_n_cipher, -+ int *local_cipher_nids); -+static void pk11_find_digests(CK_FUNCTION_LIST_PTR pflist, -+ CK_SLOT_ID current_slot, int *current_slot_n_digest, -+ int *local_digest_nids); -+static void pk11_get_symmetric_cipher(CK_FUNCTION_LIST_PTR, int slot_id, -+ int *current_slot_n_cipher, int *local_cipher_nids, -+ PK11_CIPHER *cipher); -+static void pk11_get_digest(CK_FUNCTION_LIST_PTR pflist, int slot_id, -+ int *current_slot_n_digest, int *local_digest_nids, -+ PK11_DIGEST *digest); -+ -+static int pk11_init_all_locks(void); -+static void pk11_free_all_locks(void); -+ -+#ifdef SOLARIS_HW_SLOT_SELECTION -+static int check_hw_mechanisms(void); -+static int nid_in_table(int nid, int *nid_table); -+static int hw_aes_instruction_set_present(void); -+#endif /* SOLARIS_HW_SLOT_SELECTION */ -+ -+#define TRY_OBJ_DESTROY(sp, obj_hdl, retval, uselock, alg_type) \ -+ { \ -+ if (uselock) \ -+ LOCK_OBJSTORE(alg_type); \ -+ if (pk11_active_delete(obj_hdl, alg_type) == 1) \ -+ { \ -+ retval = pk11_destroy_object(sp->session, obj_hdl, \ -+ sp->persistent); \ -+ } \ -+ if (uselock) \ -+ UNLOCK_OBJSTORE(alg_type); \ -+ } -+ -+static int cipher_nids[PK11_CIPHER_MAX]; -+static int digest_nids[PK11_DIGEST_MAX]; -+static int cipher_count = 0; -+static int digest_count = 0; -+static CK_BBOOL pk11_have_rsa = CK_FALSE; -+static CK_BBOOL pk11_have_dsa = CK_FALSE; -+static CK_BBOOL pk11_have_dh = CK_FALSE; -+static CK_BBOOL pk11_have_random = CK_FALSE; -+ -+/* -+ * Static list of ciphers. -+ * Note, that ciphers array is indexed by member PK11_CIPHER.id, -+ * thus ciphers[i].id == i -+ * Rows must be kept in sync with enum pk11_cipher_id. -+ */ -+static PK11_CIPHER ciphers[] = -+ { -+ { PK11_DES_CBC, NID_des_cbc, 8, 8, 8, -+ CKK_DES, CKM_DES_CBC, }, -+ { PK11_DES3_CBC, NID_des_ede3_cbc, 8, 24, 24, -+ CKK_DES3, CKM_DES3_CBC, }, -+ { PK11_DES_ECB, NID_des_ecb, 0, 8, 8, -+ CKK_DES, CKM_DES_ECB, }, -+ { PK11_DES3_ECB, NID_des_ede3_ecb, 0, 24, 24, -+ CKK_DES3, CKM_DES3_ECB, }, -+ { PK11_RC4, NID_rc4, 0, 16, 256, -+ CKK_RC4, CKM_RC4, }, -+ { PK11_AES_128_CBC, NID_aes_128_cbc, 16, 16, 16, -+ CKK_AES, CKM_AES_CBC, }, -+ { PK11_AES_192_CBC, NID_aes_192_cbc, 16, 24, 24, -+ CKK_AES, CKM_AES_CBC, }, -+ { PK11_AES_256_CBC, NID_aes_256_cbc, 16, 32, 32, -+ CKK_AES, CKM_AES_CBC, }, -+ { PK11_AES_128_ECB, NID_aes_128_ecb, 0, 16, 16, -+ CKK_AES, CKM_AES_ECB, }, -+ { PK11_AES_192_ECB, NID_aes_192_ecb, 0, 24, 24, -+ CKK_AES, CKM_AES_ECB, }, -+ { PK11_AES_256_ECB, NID_aes_256_ecb, 0, 32, 32, -+ CKK_AES, CKM_AES_ECB, }, -+ { PK11_BLOWFISH_CBC, NID_bf_cbc, 8, 16, 16, -+ CKK_BLOWFISH, CKM_BLOWFISH_CBC, }, -+ { PK11_AES_128_CTR, NID_aes_128_ctr, 16, 16, 16, -+ CKK_AES, CKM_AES_CTR, }, -+ { PK11_AES_192_CTR, NID_aes_192_ctr, 16, 24, 24, -+ CKK_AES, CKM_AES_CTR, }, -+ { PK11_AES_256_CTR, NID_aes_256_ctr, 16, 32, 32, -+ CKK_AES, CKM_AES_CTR, }, -+ }; -+ -+/* -+ * Static list of digests. -+ * Note, that digests array is indexed by member PK11_DIGEST.id, -+ * thus digests[i].id == i -+ * Rows must be kept in sync with enum pk11_digest_id. -+ */ -+static PK11_DIGEST digests[] = -+ { -+ {PK11_MD5, NID_md5, CKM_MD5, }, -+ {PK11_SHA1, NID_sha1, CKM_SHA_1, }, -+ {PK11_SHA224, NID_sha224, CKM_SHA224, }, -+ {PK11_SHA256, NID_sha256, CKM_SHA256, }, -+ {PK11_SHA384, NID_sha384, CKM_SHA384, }, -+ {PK11_SHA512, NID_sha512, CKM_SHA512, }, -+ {0, NID_undef, 0xFFFF, }, -+ }; -+ -+/* -+ * Structure to be used for the cipher_data/md_data in -+ * EVP_CIPHER_CTX/EVP_MD_CTX structures in order to use the same pk11 -+ * session in multiple cipher_update calls -+ */ -+typedef struct PK11_CIPHER_STATE_st -+ { -+ PK11_SESSION *sp; -+ } PK11_CIPHER_STATE; -+ -+ -+/* -+ * libcrypto EVP stuff - this is how we get wired to EVP so the engine gets -+ * called when libcrypto requests a cipher NID. -+ * -+ * Note how the PK11_CIPHER_STATE is used here. -+ */ -+ -+/* DES CBC EVP */ -+static const EVP_CIPHER pk11_des_cbc = -+ { -+ NID_des_cbc, -+ 8, 8, 8, -+ EVP_CIPH_CBC_MODE, -+ pk11_cipher_init, -+ pk11_cipher_do_cipher, -+ pk11_cipher_cleanup, -+ sizeof (PK11_CIPHER_STATE), -+ EVP_CIPHER_set_asn1_iv, -+ EVP_CIPHER_get_asn1_iv, -+ NULL -+ }; -+ -+/* 3DES CBC EVP */ -+static const EVP_CIPHER pk11_3des_cbc = -+ { -+ NID_des_ede3_cbc, -+ 8, 24, 8, -+ EVP_CIPH_CBC_MODE, -+ pk11_cipher_init, -+ pk11_cipher_do_cipher, -+ pk11_cipher_cleanup, -+ sizeof (PK11_CIPHER_STATE), -+ EVP_CIPHER_set_asn1_iv, -+ EVP_CIPHER_get_asn1_iv, -+ NULL -+ }; -+ -+/* -+ * ECB modes don't use an Initial Vector so that's why set_asn1_parameters and -+ * get_asn1_parameters fields are set to NULL. -+ */ -+static const EVP_CIPHER pk11_des_ecb = -+ { -+ NID_des_ecb, -+ 8, 8, 8, -+ EVP_CIPH_ECB_MODE, -+ pk11_cipher_init, -+ pk11_cipher_do_cipher, -+ pk11_cipher_cleanup, -+ sizeof (PK11_CIPHER_STATE), -+ NULL, -+ NULL, -+ NULL -+ }; -+ -+static const EVP_CIPHER pk11_3des_ecb = -+ { -+ NID_des_ede3_ecb, -+ 8, 24, 8, -+ EVP_CIPH_ECB_MODE, -+ pk11_cipher_init, -+ pk11_cipher_do_cipher, -+ pk11_cipher_cleanup, -+ sizeof (PK11_CIPHER_STATE), -+ NULL, -+ NULL, -+ NULL -+ }; -+ -+ -+static const EVP_CIPHER pk11_aes_128_cbc = -+ { -+ NID_aes_128_cbc, -+ 16, 16, 16, -+ EVP_CIPH_CBC_MODE, -+ pk11_cipher_init, -+ pk11_cipher_do_cipher, -+ pk11_cipher_cleanup, -+ sizeof (PK11_CIPHER_STATE), -+ EVP_CIPHER_set_asn1_iv, -+ EVP_CIPHER_get_asn1_iv, -+ NULL -+ }; -+ -+static const EVP_CIPHER pk11_aes_192_cbc = -+ { -+ NID_aes_192_cbc, -+ 16, 24, 16, -+ EVP_CIPH_CBC_MODE, -+ pk11_cipher_init, -+ pk11_cipher_do_cipher, -+ pk11_cipher_cleanup, -+ sizeof (PK11_CIPHER_STATE), -+ EVP_CIPHER_set_asn1_iv, -+ EVP_CIPHER_get_asn1_iv, -+ NULL -+ }; -+ -+static const EVP_CIPHER pk11_aes_256_cbc = -+ { -+ NID_aes_256_cbc, -+ 16, 32, 16, -+ EVP_CIPH_CBC_MODE, -+ pk11_cipher_init, -+ pk11_cipher_do_cipher, -+ pk11_cipher_cleanup, -+ sizeof (PK11_CIPHER_STATE), -+ EVP_CIPHER_set_asn1_iv, -+ EVP_CIPHER_get_asn1_iv, -+ NULL -+ }; -+ -+/* -+ * ECB modes don't use IV so that's why set_asn1_parameters and -+ * get_asn1_parameters are set to NULL. -+ */ -+static const EVP_CIPHER pk11_aes_128_ecb = -+ { -+ NID_aes_128_ecb, -+ 16, 16, 0, -+ EVP_CIPH_ECB_MODE, -+ pk11_cipher_init, -+ pk11_cipher_do_cipher, -+ pk11_cipher_cleanup, -+ sizeof (PK11_CIPHER_STATE), -+ NULL, -+ NULL, -+ NULL -+ }; -+ -+static const EVP_CIPHER pk11_aes_192_ecb = -+ { -+ NID_aes_192_ecb, -+ 16, 24, 0, -+ EVP_CIPH_ECB_MODE, -+ pk11_cipher_init, -+ pk11_cipher_do_cipher, -+ pk11_cipher_cleanup, -+ sizeof (PK11_CIPHER_STATE), -+ NULL, -+ NULL, -+ NULL -+ }; -+ -+static const EVP_CIPHER pk11_aes_256_ecb = -+ { -+ NID_aes_256_ecb, -+ 16, 32, 0, -+ EVP_CIPH_ECB_MODE, -+ pk11_cipher_init, -+ pk11_cipher_do_cipher, -+ pk11_cipher_cleanup, -+ sizeof (PK11_CIPHER_STATE), -+ NULL, -+ NULL, -+ NULL -+ }; -+ -+static EVP_CIPHER pk11_aes_128_ctr = -+ { -+ NID_aes_128_ctr, -+ 16, 16, 16, -+ EVP_CIPH_CTR_MODE, -+ pk11_cipher_init, -+ pk11_cipher_do_cipher, -+ pk11_cipher_cleanup, -+ sizeof (PK11_CIPHER_STATE), -+ EVP_CIPHER_set_asn1_iv, -+ EVP_CIPHER_get_asn1_iv, -+ NULL -+ }; -+ -+static EVP_CIPHER pk11_aes_192_ctr = -+ { -+ NID_aes_192_ctr, -+ 16, 24, 16, -+ EVP_CIPH_CTR_MODE, -+ pk11_cipher_init, -+ pk11_cipher_do_cipher, -+ pk11_cipher_cleanup, -+ sizeof (PK11_CIPHER_STATE), -+ EVP_CIPHER_set_asn1_iv, -+ EVP_CIPHER_get_asn1_iv, -+ NULL -+ }; -+ -+static EVP_CIPHER pk11_aes_256_ctr = -+ { -+ NID_aes_256_ctr, -+ 16, 32, 16, -+ EVP_CIPH_CTR_MODE, -+ pk11_cipher_init, -+ pk11_cipher_do_cipher, -+ pk11_cipher_cleanup, -+ sizeof (PK11_CIPHER_STATE), -+ EVP_CIPHER_set_asn1_iv, -+ EVP_CIPHER_get_asn1_iv, -+ NULL -+ }; -+ -+static const EVP_CIPHER pk11_bf_cbc = -+ { -+ NID_bf_cbc, -+ 8, 16, 8, -+ EVP_CIPH_VARIABLE_LENGTH | EVP_CIPH_CBC_MODE, -+ pk11_cipher_init, -+ pk11_cipher_do_cipher, -+ pk11_cipher_cleanup, -+ sizeof (PK11_CIPHER_STATE), -+ EVP_CIPHER_set_asn1_iv, -+ EVP_CIPHER_get_asn1_iv, -+ NULL -+ }; -+ -+static const EVP_CIPHER pk11_rc4 = -+ { -+ NID_rc4, -+ 1, 16, 0, -+ EVP_CIPH_VARIABLE_LENGTH, -+ pk11_cipher_init, -+ pk11_cipher_do_cipher, -+ pk11_cipher_cleanup, -+ sizeof (PK11_CIPHER_STATE), -+ NULL, -+ NULL, -+ NULL -+ }; -+ -+static const EVP_MD pk11_md5 = -+ { -+ NID_md5, -+ NID_md5WithRSAEncryption, -+ MD5_DIGEST_LENGTH, -+ 0, -+ pk11_digest_init, -+ pk11_digest_update, -+ pk11_digest_final, -+ pk11_digest_copy, -+ pk11_digest_cleanup, -+ EVP_PKEY_RSA_method, -+ MD5_CBLOCK, -+ sizeof (PK11_CIPHER_STATE), -+ }; -+ -+static const EVP_MD pk11_sha1 = -+ { -+ NID_sha1, -+ NID_sha1WithRSAEncryption, -+ SHA_DIGEST_LENGTH, -+ EVP_MD_FLAG_PKEY_METHOD_SIGNATURE|EVP_MD_FLAG_DIGALGID_ABSENT, -+ pk11_digest_init, -+ pk11_digest_update, -+ pk11_digest_final, -+ pk11_digest_copy, -+ pk11_digest_cleanup, -+ EVP_PKEY_RSA_method, -+ SHA_CBLOCK, -+ sizeof (PK11_CIPHER_STATE), -+ }; -+ -+static const EVP_MD pk11_sha224 = -+ { -+ NID_sha224, -+ NID_sha224WithRSAEncryption, -+ SHA224_DIGEST_LENGTH, -+ EVP_MD_FLAG_PKEY_METHOD_SIGNATURE|EVP_MD_FLAG_DIGALGID_ABSENT, -+ pk11_digest_init, -+ pk11_digest_update, -+ pk11_digest_final, -+ pk11_digest_copy, -+ pk11_digest_cleanup, -+ EVP_PKEY_RSA_method, -+ /* SHA-224 uses the same cblock size as SHA-256 */ -+ SHA256_CBLOCK, -+ sizeof (PK11_CIPHER_STATE), -+ }; -+ -+static const EVP_MD pk11_sha256 = -+ { -+ NID_sha256, -+ NID_sha256WithRSAEncryption, -+ SHA256_DIGEST_LENGTH, -+ EVP_MD_FLAG_PKEY_METHOD_SIGNATURE|EVP_MD_FLAG_DIGALGID_ABSENT, -+ pk11_digest_init, -+ pk11_digest_update, -+ pk11_digest_final, -+ pk11_digest_copy, -+ pk11_digest_cleanup, -+ EVP_PKEY_RSA_method, -+ SHA256_CBLOCK, -+ sizeof (PK11_CIPHER_STATE), -+ }; -+ -+static const EVP_MD pk11_sha384 = -+ { -+ NID_sha384, -+ NID_sha384WithRSAEncryption, -+ SHA384_DIGEST_LENGTH, -+ EVP_MD_FLAG_PKEY_METHOD_SIGNATURE|EVP_MD_FLAG_DIGALGID_ABSENT, -+ pk11_digest_init, -+ pk11_digest_update, -+ pk11_digest_final, -+ pk11_digest_copy, -+ pk11_digest_cleanup, -+ EVP_PKEY_RSA_method, -+ /* SHA-384 uses the same cblock size as SHA-512 */ -+ SHA512_CBLOCK, -+ sizeof (PK11_CIPHER_STATE), -+ }; -+ -+static const EVP_MD pk11_sha512 = -+ { -+ NID_sha512, -+ NID_sha512WithRSAEncryption, -+ SHA512_DIGEST_LENGTH, -+ EVP_MD_FLAG_PKEY_METHOD_SIGNATURE|EVP_MD_FLAG_DIGALGID_ABSENT, -+ pk11_digest_init, -+ pk11_digest_update, -+ pk11_digest_final, -+ pk11_digest_copy, -+ pk11_digest_cleanup, -+ EVP_PKEY_RSA_method, -+ SHA512_CBLOCK, -+ sizeof (PK11_CIPHER_STATE), -+ }; -+ -+/* -+ * Initialization function. Sets up various PKCS#11 library components. -+ * The definitions for control commands specific to this engine -+ */ -+#define PK11_CMD_SO_PATH ENGINE_CMD_BASE -+static const ENGINE_CMD_DEFN pk11_cmd_defns[] = -+ { -+ { -+ PK11_CMD_SO_PATH, -+ "SO_PATH", -+ "Specifies the path to the 'pkcs#11' shared library", -+ ENGINE_CMD_FLAG_STRING -+ }, -+ {0, NULL, NULL, 0} -+ }; -+ -+ -+static RAND_METHOD pk11_random = -+ { -+ pk11_rand_seed, -+ pk11_rand_bytes, -+ pk11_rand_cleanup, -+ pk11_rand_add, -+ pk11_rand_bytes, -+ pk11_rand_status -+ }; -+ -+ -+/* Constants used when creating the ENGINE */ -+static const char *engine_pk11_id = "pkcs11"; -+static const char *engine_pk11_name = "PKCS #11 engine support"; -+ -+CK_FUNCTION_LIST_PTR pFuncList = NULL; -+static const char PK11_GET_FUNCTION_LIST[] = "C_GetFunctionList"; -+ -+/* -+ * This is a static string constant for the DSO file name and the function -+ * symbol names to bind to. We set it in the Configure script based on whether -+ * this is 32 or 64 bit build. -+ */ -+static const char def_PK11_LIBNAME[] = PK11_LIB_LOCATION; -+ -+/* Needed in e_pk11_pub.c as well so that's why it is not static. */ -+CK_SLOT_ID pubkey_SLOTID = 0; -+static CK_SLOT_ID rand_SLOTID = 0; -+static CK_SLOT_ID SLOTID = 0; -+static CK_BBOOL pk11_library_initialized = CK_FALSE; -+static CK_BBOOL pk11_atfork_initialized = CK_FALSE; -+static int pk11_pid = 0; -+static ENGINE* pk11_engine = NULL; -+ -+static DSO *pk11_dso = NULL; -+ -+/* allocate and initialize all locks used by the engine itself */ -+static int pk11_init_all_locks(void) -+ { -+ int type; -+ -+#ifndef OPENSSL_NO_RSA -+ find_lock[OP_RSA] = OPENSSL_malloc(sizeof (pthread_mutex_t)); -+ if (find_lock[OP_RSA] == NULL) -+ goto malloc_err; -+ (void) pthread_mutex_init(find_lock[OP_RSA], NULL); -+#endif /* OPENSSL_NO_RSA */ -+ -+ if ((uri_lock = OPENSSL_malloc(sizeof (pthread_mutex_t))) == NULL) -+ goto malloc_err; -+ (void) pthread_mutex_init(uri_lock, NULL); -+ -+#ifndef OPENSSL_NO_DSA -+ find_lock[OP_DSA] = OPENSSL_malloc(sizeof (pthread_mutex_t)); -+ if (find_lock[OP_DSA] == NULL) -+ goto malloc_err; -+ (void) pthread_mutex_init(find_lock[OP_DSA], NULL); -+#endif /* OPENSSL_NO_DSA */ -+ -+#ifndef OPENSSL_NO_DH -+ find_lock[OP_DH] = OPENSSL_malloc(sizeof (pthread_mutex_t)); -+ if (find_lock[OP_DH] == NULL) -+ goto malloc_err; -+ (void) pthread_mutex_init(find_lock[OP_DH], NULL); -+#endif /* OPENSSL_NO_DH */ -+ -+ for (type = 0; type < OP_MAX; type++) -+ { -+ session_cache[type].lock = -+ OPENSSL_malloc(sizeof (pthread_mutex_t)); -+ if (session_cache[type].lock == NULL) -+ goto malloc_err; -+ (void) pthread_mutex_init(session_cache[type].lock, NULL); -+ } -+ -+ return (1); -+ -+malloc_err: -+ pk11_free_all_locks(); -+ PK11err(PK11_F_INIT_ALL_LOCKS, PK11_R_MALLOC_FAILURE); -+ return (0); -+ } -+ -+static void pk11_free_all_locks(void) -+ { -+ int type; -+ -+#ifndef OPENSSL_NO_RSA -+ if (find_lock[OP_RSA] != NULL) -+ { -+ (void) pthread_mutex_destroy(find_lock[OP_RSA]); -+ OPENSSL_free(find_lock[OP_RSA]); -+ find_lock[OP_RSA] = NULL; -+ } -+#endif /* OPENSSL_NO_RSA */ -+#ifndef OPENSSL_NO_DSA -+ if (find_lock[OP_DSA] != NULL) -+ { -+ (void) pthread_mutex_destroy(find_lock[OP_DSA]); -+ OPENSSL_free(find_lock[OP_DSA]); -+ find_lock[OP_DSA] = NULL; -+ } -+#endif /* OPENSSL_NO_DSA */ -+#ifndef OPENSSL_NO_DH -+ if (find_lock[OP_DH] != NULL) -+ { -+ (void) pthread_mutex_destroy(find_lock[OP_DH]); -+ OPENSSL_free(find_lock[OP_DH]); -+ find_lock[OP_DH] = NULL; -+ } -+#endif /* OPENSSL_NO_DH */ -+ -+ for (type = 0; type < OP_MAX; type++) -+ { -+ if (session_cache[type].lock != NULL) -+ { -+ (void) pthread_mutex_destroy(session_cache[type].lock); -+ OPENSSL_free(session_cache[type].lock); -+ session_cache[type].lock = NULL; -+ } -+ } -+ /* Free uri_lock */ -+ (void) pthread_mutex_destroy(uri_lock); -+ OPENSSL_free(uri_lock); -+ uri_lock = NULL; -+ } -+ -+/* -+ * This internal function is used by ENGINE_pk11() and "dynamic" ENGINE support. -+ */ -+static int bind_pk11(ENGINE *e) -+ { -+#ifndef OPENSSL_NO_RSA -+ const RSA_METHOD *rsa = NULL; -+ RSA_METHOD *pk11_rsa = PK11_RSA(); -+#endif /* OPENSSL_NO_RSA */ -+ if (!pk11_library_initialized) -+ if (!pk11_library_init(e)) -+ return (0); -+ -+ if (!ENGINE_set_id(e, engine_pk11_id) || -+ !ENGINE_set_name(e, engine_pk11_name) || -+ !ENGINE_set_ciphers(e, pk11_engine_ciphers) || -+ !ENGINE_set_digests(e, pk11_engine_digests)) -+ return (0); -+ -+ if (!ENGINE_set_pkey_meths(e, pk11_engine_pkey_methods)) -+ return (0); -+ -+#ifndef OPENSSL_NO_RSA -+ if (pk11_have_rsa == CK_TRUE) -+ { -+ if (!ENGINE_set_RSA(e, PK11_RSA()) || -+ !ENGINE_set_load_privkey_function(e, pk11_load_privkey) || -+ !ENGINE_set_load_pubkey_function(e, pk11_load_pubkey)) -+ return (0); -+ DEBUG_SLOT_SEL("%s: registered RSA\n", PK11_DBG); -+ } -+#endif /* OPENSSL_NO_RSA */ -+#ifndef OPENSSL_NO_DSA -+ if (pk11_have_dsa == CK_TRUE) -+ { -+ if (!ENGINE_set_DSA(e, PK11_DSA())) -+ return (0); -+ DEBUG_SLOT_SEL("%s: registered DSA\n", PK11_DBG); -+ } -+#endif /* OPENSSL_NO_DSA */ -+#ifndef OPENSSL_NO_DH -+ if (pk11_have_dh == CK_TRUE) -+ { -+ if (!ENGINE_set_DH(e, PK11_DH())) -+ return (0); -+ DEBUG_SLOT_SEL("%s: registered DH\n", PK11_DBG); -+ } -+#endif /* OPENSSL_NO_DH */ -+ if (pk11_have_random) -+ { -+ if (!ENGINE_set_RAND(e, &pk11_random)) -+ return (0); -+ DEBUG_SLOT_SEL("%s: registered random\n", PK11_DBG); -+ } -+ if (!ENGINE_set_init_function(e, pk11_init) || -+ !ENGINE_set_destroy_function(e, pk11_destroy) || -+ !ENGINE_set_finish_function(e, pk11_finish) || -+ !ENGINE_set_ctrl_function(e, pk11_ctrl) || -+ !ENGINE_set_cmd_defns(e, pk11_cmd_defns)) -+ return (0); -+ -+/* -+ * Apache calls OpenSSL function RSA_blinding_on() once during startup -+ * which in turn calls bn_mod_exp. Since we do not implement bn_mod_exp -+ * here, we wire it back to the OpenSSL software implementation. -+ * Since it is used only once, performance is not a concern. -+ */ -+#ifndef OPENSSL_NO_RSA -+ rsa = RSA_PKCS1_SSLeay(); -+ pk11_rsa->rsa_mod_exp = rsa->rsa_mod_exp; -+ pk11_rsa->bn_mod_exp = rsa->bn_mod_exp; -+#endif /* OPENSSL_NO_RSA */ -+ -+ /* Ensure the pk11 error handling is set up */ -+ ERR_load_pk11_strings(); -+ -+ return (1); -+ } -+ -+static int bind_helper(ENGINE *e, const char *id) -+ { -+ if (id && (strcmp(id, engine_pk11_id) != 0)) -+ return (0); -+ -+ if (!bind_pk11(e)) -+ return (0); -+ -+ return (1); -+ } -+ -+IMPLEMENT_DYNAMIC_CHECK_FN() -+IMPLEMENT_DYNAMIC_BIND_FN(bind_helper) -+ -+/* -+ * These are the static string constants for the DSO file name and -+ * the function symbol names to bind to. -+ */ -+static const char *PK11_LIBNAME = NULL; -+ -+static const char *get_PK11_LIBNAME(void) -+ { -+ if (PK11_LIBNAME) -+ return (PK11_LIBNAME); -+ -+ return (def_PK11_LIBNAME); -+ } -+ -+static void free_PK11_LIBNAME(void) -+ { -+ if (PK11_LIBNAME) -+ OPENSSL_free((void*)PK11_LIBNAME); -+ -+ PK11_LIBNAME = NULL; -+ } -+ -+static long set_PK11_LIBNAME(const char *name) -+ { -+ free_PK11_LIBNAME(); -+ -+ return ((PK11_LIBNAME = BUF_strdup(name)) != NULL ? 1 : 0); -+ } -+ -+/* acquire all engine specific mutexes before fork */ -+static void pk11_fork_prepare(void) -+ { -+ int i; -+ -+ if (!pk11_library_initialized) -+ return; -+ -+ LOCK_OBJSTORE(OP_RSA); -+ LOCK_OBJSTORE(OP_DSA); -+ LOCK_OBJSTORE(OP_DH); -+ (void) pthread_mutex_lock(uri_lock); -+ for (i = 0; i < OP_MAX; i++) -+ { -+ (void) pthread_mutex_lock(session_cache[i].lock); -+ } -+ } -+ -+/* release all engine specific mutexes */ -+static void pk11_fork_parent(void) -+ { -+ int i; -+ -+ if (!pk11_library_initialized) -+ return; -+ -+ for (i = OP_MAX - 1; i >= 0; i--) -+ { -+ (void) pthread_mutex_unlock(session_cache[i].lock); -+ } -+ UNLOCK_OBJSTORE(OP_DH); -+ UNLOCK_OBJSTORE(OP_DSA); -+ UNLOCK_OBJSTORE(OP_RSA); -+ (void) pthread_mutex_unlock(uri_lock); -+ } -+ -+/* -+ * same situation as in parent - we need to unlock all locks to make them -+ * accessible to all threads. -+ */ -+static void pk11_fork_child(void) -+ { -+ int i; -+ -+ if (!pk11_library_initialized) -+ return; -+ -+ for (i = OP_MAX - 1; i >= 0; i--) -+ { -+ (void) pthread_mutex_unlock(session_cache[i].lock); -+ } -+ UNLOCK_OBJSTORE(OP_DH); -+ UNLOCK_OBJSTORE(OP_DSA); -+ UNLOCK_OBJSTORE(OP_RSA); -+ (void) pthread_mutex_unlock(uri_lock); -+ } -+ -+/* Initialization function for the pk11 engine */ -+static int pk11_init(ENGINE *e) -+ { -+ return (pk11_library_init(e)); -+ } -+ -+/* -+ * Helper function that unsets reference to current engine (pk11_engine = NULL). -+ * -+ * Use of local variable only seems clumsy, it needs to be this way! -+ * This is to prevent double free in the unlucky scenario: -+ * ENGINE_free calls pk11_destroy calls pk11_finish calls ENGINE_free -+ * Setting pk11_engine to NULL prior to ENGINE_free() avoids this. -+ */ -+static void pk11_engine_free() -+ { -+ ENGINE* old_engine = pk11_engine; -+ -+ if (old_engine) -+ { -+ pk11_engine = NULL; -+ } -+ } -+ -+/* -+ * Initialization function. Sets up various PKCS#11 library components. -+ * It selects a slot based on predefined critiera. In the process, it also -+ * count how many ciphers and digests to support. Since the cipher and -+ * digest information is needed when setting default engine, this function -+ * needs to be called before calling ENGINE_set_default. -+ */ -+/* ARGSUSED */ -+static int pk11_library_init(ENGINE *e) -+ { -+ CK_C_GetFunctionList p; -+ CK_RV rv = CKR_OK; -+ CK_INFO info; -+ CK_ULONG ul_state_len; -+ int any_slot_found; -+ int i; -+ -+ if (e != pk11_engine) -+ { -+ pk11_engine_free(); -+ pk11_engine = e; -+ } -+ -+ /* -+ * pk11_library_initialized is set to 0 in pk11_finish() which is called -+ * from ENGINE_finish(). However, if there is still at least one -+ * existing functional reference to the engine (see engine(3) for more -+ * information), pk11_finish() is skipped. For example, this can happen -+ * if an application forgets to clear one cipher context. In case of a -+ * fork() when the application is finishing the engine so that it can be -+ * reinitialized in the child, forgotten functional reference causes -+ * pk11_library_initialized to stay 1. In that case we need the PID -+ * check so that we properly initialize the engine again. -+ */ -+ if (pk11_library_initialized) -+ { -+ if (pk11_pid == getpid()) -+ { -+ return (1); -+ } -+ else -+ { -+ global_session = CK_INVALID_HANDLE; -+ /* -+ * free the locks first to prevent memory leak in case -+ * the application calls fork() without finishing the -+ * engine first. -+ */ -+ pk11_free_all_locks(); -+ } -+ } -+ -+ -+ /* Attempt to load PKCS#11 library */ -+ if (!pk11_dso) -+ { -+ pk11_dso = DSO_load(NULL, get_PK11_LIBNAME(), NULL, 0); -+ if (pk11_dso == NULL) -+ { -+ PK11err(PK11_F_LOAD, PK11_R_DSO_FAILURE); -+ goto err; -+ } -+ } -+ -+#ifdef SOLARIS_HW_SLOT_SELECTION -+ if (check_hw_mechanisms() == 0) -+ goto err; -+#endif /* SOLARIS_HW_SLOT_SELECTION */ -+ -+ /* get the C_GetFunctionList function from the loaded library */ -+ p = (CK_C_GetFunctionList)DSO_bind_func(pk11_dso, -+ PK11_GET_FUNCTION_LIST); -+ if (!p) -+ { -+ PK11err(PK11_F_LIBRARY_INIT, PK11_R_DSO_FAILURE); -+ goto err; -+ } -+ -+ /* get the full function list from the loaded library */ -+ rv = p(&pFuncList); -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_LIBRARY_INIT, PK11_R_DSO_FAILURE, rv); -+ goto err; -+ } -+ -+ rv = pFuncList->C_Initialize(NULL_PTR); -+ if ((rv != CKR_OK) && (rv != CKR_CRYPTOKI_ALREADY_INITIALIZED)) -+ { -+ PK11err_add_data(PK11_F_LIBRARY_INIT, PK11_R_INITIALIZE, rv); -+ goto err; -+ } -+ -+ rv = pFuncList->C_GetInfo(&info); -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_LIBRARY_INIT, PK11_R_GETINFO, rv); -+ goto err; -+ } -+ -+ if (pk11_choose_slots(&any_slot_found) == 0) -+ goto err; -+ -+ /* -+ * The library we use, set in def_PK11_LIBNAME, may not offer any -+ * slot(s). In that case, we must not proceed but we must not return an -+ * error. The reason is that applications that try to set up the PKCS#11 -+ * engine don't exit on error during the engine initialization just -+ * because no slot was present. -+ */ -+ if (any_slot_found == 0) -+ return (1); -+ -+ if (global_session == CK_INVALID_HANDLE) -+ { -+ /* Open the global_session for the new process */ -+ rv = pFuncList->C_OpenSession(SLOTID, CKF_SERIAL_SESSION, -+ NULL_PTR, NULL_PTR, &global_session); -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_LIBRARY_INIT, -+ PK11_R_OPENSESSION, rv); -+ goto err; -+ } -+ } -+ -+ /* -+ * Disable digest if C_GetOperationState is not supported since -+ * this function is required by OpenSSL digest copy function -+ */ -+ if (pFuncList->C_GetOperationState(global_session, NULL, &ul_state_len) -+ == CKR_FUNCTION_NOT_SUPPORTED) -+ { -+ DEBUG_SLOT_SEL("%s: C_GetOperationState() not supported, " -+ "setting digest_count to 0\n", PK11_DBG); -+ digest_count = 0; -+ } -+ -+ pk11_library_initialized = CK_TRUE; -+ pk11_pid = getpid(); -+ /* -+ * if initialization of the locks fails pk11_init_all_locks() -+ * will do the cleanup. -+ */ -+ if (!pk11_init_all_locks()) -+ goto err; -+ for (i = 0; i < OP_MAX; i++) -+ session_cache[i].head = NULL; -+ /* -+ * initialize active lists. We only use active lists -+ * for asymmetric ciphers. -+ */ -+ for (i = 0; i < OP_MAX; i++) -+ active_list[i] = NULL; -+ -+ if (!pk11_atfork_initialized) -+ { -+ if (pthread_atfork(pk11_fork_prepare, pk11_fork_parent, -+ pk11_fork_child) != 0) -+ { -+ PK11err(PK11_F_LIBRARY_INIT, PK11_R_ATFORK_FAILED); -+ goto err; -+ } -+ pk11_atfork_initialized = CK_TRUE; -+ } -+ -+ return (1); -+ -+err: -+ return (0); -+ } -+ -+/* Destructor (complements the "ENGINE_pk11()" constructor) */ -+/* ARGSUSED */ -+static int pk11_destroy(ENGINE *e) -+ { -+ int rtn = 1; -+ -+ free_PK11_LIBNAME(); -+ ERR_unload_pk11_strings(); -+ if (pk11_library_initialized == CK_TRUE) -+ rtn = pk11_finish(e); -+ -+ return (rtn); -+ } -+ -+/* -+ * Termination function to clean up the session, the token, and the pk11 -+ * library. -+ */ -+/* ARGSUSED */ -+static int pk11_finish(ENGINE *e) -+ { -+ int i; -+ -+ /* -+ * Make sure, right engine instance is being destroyed. -+ * Engine e may be the wrong instance if -+ * 1) either someone calls ENGINE_load_pk11 twice -+ * 2) or last ref. to an already finished engine is being destroyed -+ */ -+ if (e != pk11_engine) -+ goto err; -+ -+ if (pk11_dso == NULL) -+ { -+ PK11err(PK11_F_FINISH, PK11_R_NOT_LOADED); -+ goto err; -+ } -+ -+ OPENSSL_assert(pFuncList != NULL); -+ -+ if (pk11_free_all_sessions() == 0) -+ goto err; -+ -+ /* free all active lists */ -+ for (i = 0; i < OP_MAX; i++) -+ pk11_free_active_list(i); -+ -+ pFuncList->C_CloseSession(global_session); -+ global_session = CK_INVALID_HANDLE; -+ -+ /* -+ * Since we are part of a library (libcrypto.so), calling this function -+ * may have side-effects. -+ */ -+#if 0 -+ pFuncList->C_Finalize(NULL); -+#endif -+ if (!DSO_free(pk11_dso)) -+ { -+ PK11err(PK11_F_FINISH, PK11_R_DSO_FAILURE); -+ goto err; -+ } -+ pk11_dso = NULL; -+ pFuncList = NULL; -+ pk11_library_initialized = CK_FALSE; -+ pk11_pid = 0; -+ pk11_engine_free(); -+ /* -+ * There is no way how to unregister atfork handlers (other than -+ * unloading the library) so we just free the locks. For this reason -+ * the atfork handlers check if the engine is initialized and bail out -+ * immediately if not. This is necessary in case a process finishes -+ * the engine before calling fork(). -+ */ -+ pk11_free_all_locks(); -+ -+ return (1); -+ -+err: -+ return (0); -+ } -+ -+/* Standard engine interface function to set the dynamic library path */ -+/* ARGSUSED */ -+static int pk11_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)()) -+ { -+ int initialized = ((pk11_dso == NULL) ? 0 : 1); -+ -+ switch (cmd) -+ { -+ case PK11_CMD_SO_PATH: -+ if (p == NULL) -+ { -+ PK11err(PK11_F_CTRL, ERR_R_PASSED_NULL_PARAMETER); -+ return (0); -+ } -+ -+ if (initialized) -+ { -+ PK11err(PK11_F_CTRL, PK11_R_ALREADY_LOADED); -+ return (0); -+ } -+ -+ return (set_PK11_LIBNAME((const char *)p)); -+ default: -+ break; -+ } -+ -+ PK11err(PK11_F_CTRL, PK11_R_CTRL_COMMAND_NOT_IMPLEMENTED); -+ -+ return (0); -+ } -+ -+ -+/* Required function by the engine random interface. It does nothing here */ -+static void pk11_rand_cleanup(void) -+ { -+ return; -+ } -+ -+/* ARGSUSED */ -+static void pk11_rand_add(const void *buf, int num, double add) -+ { -+ PK11_SESSION *sp; -+ -+ if ((sp = pk11_get_session(OP_RAND)) == NULL) -+ return; -+ -+ /* -+ * Ignore any errors (e.g. CKR_RANDOM_SEED_NOT_SUPPORTED) since -+ * the calling functions do not care anyway -+ */ -+ pFuncList->C_SeedRandom(sp->session, (unsigned char *) buf, num); -+ pk11_return_session(sp, OP_RAND); -+ -+ return; -+ } -+ -+static void pk11_rand_seed(const void *buf, int num) -+ { -+ pk11_rand_add(buf, num, 0); -+ } -+ -+static int pk11_rand_bytes(unsigned char *buf, int num) -+ { -+ CK_RV rv; -+ PK11_SESSION *sp; -+ -+ if ((sp = pk11_get_session(OP_RAND)) == NULL) -+ return (0); -+ -+ rv = pFuncList->C_GenerateRandom(sp->session, buf, num); -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_RAND_BYTES, PK11_R_GENERATERANDOM, rv); -+ pk11_return_session(sp, OP_RAND); -+ return (0); -+ } -+ -+ pk11_return_session(sp, OP_RAND); -+ return (1); -+ } -+ -+/* Required function by the engine random interface. It does nothing here */ -+static int pk11_rand_status(void) -+ { -+ return (1); -+ } -+ -+/* Free all BIGNUM structures from PK11_SESSION. */ -+static void pk11_free_nums(PK11_SESSION *sp, PK11_OPTYPE optype) -+ { -+ switch (optype) -+ { -+#ifndef OPENSSL_NO_RSA -+ case OP_RSA: -+ if (sp->opdata_rsa_n_num != NULL) -+ { -+ BN_free(sp->opdata_rsa_n_num); -+ sp->opdata_rsa_n_num = NULL; -+ } -+ if (sp->opdata_rsa_e_num != NULL) -+ { -+ BN_free(sp->opdata_rsa_e_num); -+ sp->opdata_rsa_e_num = NULL; -+ } -+ if (sp->opdata_rsa_d_num != NULL) -+ { -+ BN_free(sp->opdata_rsa_d_num); -+ sp->opdata_rsa_d_num = NULL; -+ } -+ break; -+#endif -+#ifndef OPENSSL_NO_DSA -+ case OP_DSA: -+ if (sp->opdata_dsa_pub_num != NULL) -+ { -+ BN_free(sp->opdata_dsa_pub_num); -+ sp->opdata_dsa_pub_num = NULL; -+ } -+ if (sp->opdata_dsa_priv_num != NULL) -+ { -+ BN_free(sp->opdata_dsa_priv_num); -+ sp->opdata_dsa_priv_num = NULL; -+ } -+ break; -+#endif -+#ifndef OPENSSL_NO_DH -+ case OP_DH: -+ if (sp->opdata_dh_priv_num != NULL) -+ { -+ BN_free(sp->opdata_dh_priv_num); -+ sp->opdata_dh_priv_num = NULL; -+ } -+ break; -+#endif -+ default: -+ break; -+ } -+ } -+ -+/* -+ * Get new PK11_SESSION structure ready for use. Every process must have -+ * its own freelist of PK11_SESSION structures so handle fork() here -+ * by destroying the old and creating new freelist. -+ * The returned PK11_SESSION structure is disconnected from the freelist. -+ */ -+PK11_SESSION * -+pk11_get_session(PK11_OPTYPE optype) -+ { -+ PK11_SESSION *sp = NULL, *sp1, *freelist; -+ pthread_mutex_t *freelist_lock; -+ static pid_t pid = 0; -+ pid_t new_pid; -+ CK_RV rv; -+ -+ switch (optype) -+ { -+ case OP_RSA: -+ case OP_DSA: -+ case OP_DH: -+ case OP_RAND: -+ case OP_DIGEST: -+ case OP_CIPHER: -+ freelist_lock = session_cache[optype].lock; -+ break; -+ default: -+ PK11err(PK11_F_GET_SESSION, -+ PK11_R_INVALID_OPERATION_TYPE); -+ return (NULL); -+ } -+ (void) pthread_mutex_lock(freelist_lock); -+ -+ /* -+ * Will use it to find out if we forked. We cannot use the PID field in -+ * the session structure because we could get a newly allocated session -+ * here, with no PID information. -+ */ -+ if (pid == 0) -+ pid = getpid(); -+ -+ freelist = session_cache[optype].head; -+ sp = freelist; -+ -+ /* -+ * If the free list is empty, allocate new uninitialized (filled -+ * with zeroes) PK11_SESSION structure otherwise return first -+ * structure from the freelist. -+ */ -+ if (sp == NULL) -+ { -+ if ((sp = OPENSSL_malloc(sizeof (PK11_SESSION))) == NULL) -+ { -+ PK11err(PK11_F_GET_SESSION, -+ PK11_R_MALLOC_FAILURE); -+ goto err; -+ } -+ (void) memset(sp, 0, sizeof (PK11_SESSION)); -+ -+ /* -+ * It is a new session so it will look like a cache miss to the -+ * code below. So, we must not try to to destroy its members so -+ * mark them as unused. -+ */ -+ sp->opdata_rsa_priv_key = CK_INVALID_HANDLE; -+ sp->opdata_rsa_pub_key = CK_INVALID_HANDLE; -+ } -+ else -+ freelist = sp->next; -+ -+ /* -+ * Check whether we have forked. In that case, we must get rid of all -+ * inherited sessions and start allocating new ones. -+ */ -+ if (pid != (new_pid = getpid())) -+ { -+ pid = new_pid; -+ -+ /* -+ * We are a new process and thus need to free any inherited -+ * PK11_SESSION objects aside from the first session (sp) which -+ * is the only PK11_SESSION structure we will reuse (for the -+ * head of the list). -+ */ -+ while ((sp1 = freelist) != NULL) -+ { -+ freelist = sp1->next; -+ /* -+ * NOTE: we do not want to call pk11_free_all_sessions() -+ * here because it would close underlying PKCS#11 -+ * sessions and destroy all objects. -+ */ -+ pk11_free_nums(sp1, optype); -+ OPENSSL_free(sp1); -+ } -+ -+ /* we have to free the active list as well. */ -+ pk11_free_active_list(optype); -+ -+ /* Initialize the process */ -+ rv = pFuncList->C_Initialize(NULL_PTR); -+ if ((rv != CKR_OK) && (rv != CKR_CRYPTOKI_ALREADY_INITIALIZED)) -+ { -+ PK11err_add_data(PK11_F_GET_SESSION, PK11_R_INITIALIZE, -+ rv); -+ OPENSSL_free(sp); -+ sp = NULL; -+ goto err; -+ } -+ -+ /* -+ * Choose slot here since the slot table is different on this -+ * process. If we are here then we must have found at least one -+ * usable slot before so we don't need to check any_slot_found. -+ * See pk11_library_init()'s usage of this function for more -+ * information. -+ */ -+#ifdef SOLARIS_HW_SLOT_SELECTION -+ if (check_hw_mechanisms() == 0) -+ goto err; -+#endif /* SOLARIS_HW_SLOT_SELECTION */ -+ if (pk11_choose_slots(NULL) == 0) -+ goto err; -+ -+ /* Open the global_session for the new process */ -+ rv = pFuncList->C_OpenSession(SLOTID, CKF_SERIAL_SESSION, -+ NULL_PTR, NULL_PTR, &global_session); -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_GET_SESSION, PK11_R_OPENSESSION, -+ rv); -+ OPENSSL_free(sp); -+ sp = NULL; -+ goto err; -+ } -+ -+ /* -+ * It is an inherited session from our parent so it needs -+ * re-initialization. -+ */ -+ if (pk11_setup_session(sp, optype) == 0) -+ { -+ OPENSSL_free(sp); -+ sp = NULL; -+ goto err; -+ } -+ if (pk11_token_relogin(sp->session) == 0) -+ { -+ /* -+ * We will keep the session in the cache list and let -+ * the caller cope with the situation. -+ */ -+ freelist = sp; -+ sp = NULL; -+ goto err; -+ } -+ } -+ -+ if (sp->pid == 0) -+ { -+ /* It is a new session and needs initialization. */ -+ if (pk11_setup_session(sp, optype) == 0) -+ { -+ OPENSSL_free(sp); -+ sp = NULL; -+ } -+ } -+ -+ /* set new head for the list of PK11_SESSION objects */ -+ session_cache[optype].head = freelist; -+ -+err: -+ if (sp != NULL) -+ sp->next = NULL; -+ -+ (void) pthread_mutex_unlock(freelist_lock); -+ -+ return (sp); -+ } -+ -+ -+void -+pk11_return_session(PK11_SESSION *sp, PK11_OPTYPE optype) -+ { -+ pthread_mutex_t *freelist_lock; -+ PK11_SESSION *freelist; -+ -+ /* -+ * If this is a session from the parent it will be taken care of and -+ * freed in pk11_get_session() as part of the post-fork clean up the -+ * next time we will ask for a new session. -+ */ -+ if (sp == NULL || sp->pid != getpid()) -+ return; -+ -+ switch (optype) -+ { -+ case OP_RSA: -+ case OP_DSA: -+ case OP_DH: -+ case OP_RAND: -+ case OP_DIGEST: -+ case OP_CIPHER: -+ freelist_lock = session_cache[optype].lock; -+ break; -+ default: -+ PK11err(PK11_F_RETURN_SESSION, -+ PK11_R_INVALID_OPERATION_TYPE); -+ return; -+ } -+ -+ (void) pthread_mutex_lock(freelist_lock); -+ freelist = session_cache[optype].head; -+ sp->next = freelist; -+ session_cache[optype].head = sp; -+ (void) pthread_mutex_unlock(freelist_lock); -+ } -+ -+ -+/* Destroy all objects. This function is called when the engine is finished */ -+static int pk11_free_all_sessions() -+ { -+ int ret = 1; -+ int type; -+ -+#ifndef OPENSSL_NO_RSA -+ (void) pk11_destroy_rsa_key_objects(NULL); -+#endif /* OPENSSL_NO_RSA */ -+#ifndef OPENSSL_NO_DSA -+ (void) pk11_destroy_dsa_key_objects(NULL); -+#endif /* OPENSSL_NO_DSA */ -+#ifndef OPENSSL_NO_DH -+ (void) pk11_destroy_dh_key_objects(NULL); -+#endif /* OPENSSL_NO_DH */ -+ (void) pk11_destroy_cipher_key_objects(NULL); -+ -+ /* -+ * We try to release as much as we can but any error means that we will -+ * return 0 on exit. -+ */ -+ for (type = 0; type < OP_MAX; type++) -+ { -+ if (pk11_free_session_list(type) == 0) -+ ret = 0; -+ } -+ -+ return (ret); -+ } -+ -+/* -+ * Destroy session structures from the linked list specified. Free as many -+ * sessions as possible but any failure in C_CloseSession() means that we -+ * return an error on return. -+ */ -+static int pk11_free_session_list(PK11_OPTYPE optype) -+ { -+ CK_RV rv; -+ PK11_SESSION *sp = NULL; -+ PK11_SESSION *freelist = NULL; -+ pid_t mypid = getpid(); -+ pthread_mutex_t *freelist_lock; -+ int ret = 1; -+ -+ switch (optype) -+ { -+ case OP_RSA: -+ case OP_DSA: -+ case OP_DH: -+ case OP_RAND: -+ case OP_DIGEST: -+ case OP_CIPHER: -+ freelist_lock = session_cache[optype].lock; -+ break; -+ default: -+ PK11err(PK11_F_FREE_ALL_SESSIONS, -+ PK11_R_INVALID_OPERATION_TYPE); -+ return (0); -+ } -+ -+ (void) pthread_mutex_lock(freelist_lock); -+ freelist = session_cache[optype].head; -+ while ((sp = freelist) != NULL) -+ { -+ if (sp->session != CK_INVALID_HANDLE && sp->pid == mypid) -+ { -+ rv = pFuncList->C_CloseSession(sp->session); -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_FREE_ALL_SESSIONS, -+ PK11_R_CLOSESESSION, rv); -+ ret = 0; -+ } -+ } -+ freelist = sp->next; -+ pk11_free_nums(sp, optype); -+ OPENSSL_free(sp); -+ } -+ -+ (void) pthread_mutex_unlock(freelist_lock); -+ return (ret); -+ } -+ -+ -+static int -+pk11_setup_session(PK11_SESSION *sp, PK11_OPTYPE optype) -+ { -+ CK_RV rv; -+ CK_SLOT_ID myslot; -+ -+ switch (optype) -+ { -+ case OP_RSA: -+ case OP_DSA: -+ case OP_DH: -+ myslot = pubkey_SLOTID; -+ break; -+ case OP_RAND: -+ myslot = rand_SLOTID; -+ break; -+ case OP_DIGEST: -+ case OP_CIPHER: -+ myslot = SLOTID; -+ break; -+ default: -+ PK11err(PK11_F_SETUP_SESSION, -+ PK11_R_INVALID_OPERATION_TYPE); -+ return (0); -+ } -+ -+ sp->session = CK_INVALID_HANDLE; -+ DEBUG_SLOT_SEL("%s: myslot=%d optype=%d\n", PK11_DBG, myslot, optype); -+ rv = pFuncList->C_OpenSession(myslot, CKF_SERIAL_SESSION, -+ NULL_PTR, NULL_PTR, &sp->session); -+ if (rv == CKR_CRYPTOKI_NOT_INITIALIZED) -+ { -+ /* -+ * We are probably a child process so force the -+ * reinitialize of the session -+ */ -+ pk11_library_initialized = CK_FALSE; -+ if (!pk11_library_init(NULL)) -+ return (0); -+ rv = pFuncList->C_OpenSession(myslot, CKF_SERIAL_SESSION, -+ NULL_PTR, NULL_PTR, &sp->session); -+ } -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_SETUP_SESSION, PK11_R_OPENSESSION, rv); -+ return (0); -+ } -+ -+ sp->pid = getpid(); -+ -+ switch (optype) -+ { -+#ifndef OPENSSL_NO_RSA -+ case OP_RSA: -+ sp->opdata_rsa_pub_key = CK_INVALID_HANDLE; -+ sp->opdata_rsa_priv_key = CK_INVALID_HANDLE; -+ sp->opdata_rsa_pub = NULL; -+ sp->opdata_rsa_n_num = NULL; -+ sp->opdata_rsa_e_num = NULL; -+ sp->opdata_rsa_priv = NULL; -+ sp->opdata_rsa_d_num = NULL; -+ break; -+#endif /* OPENSSL_NO_RSA */ -+#ifndef OPENSSL_NO_DSA -+ case OP_DSA: -+ sp->opdata_dsa_pub_key = CK_INVALID_HANDLE; -+ sp->opdata_dsa_priv_key = CK_INVALID_HANDLE; -+ sp->opdata_dsa_pub = NULL; -+ sp->opdata_dsa_pub_num = NULL; -+ sp->opdata_dsa_priv = NULL; -+ sp->opdata_dsa_priv_num = NULL; -+ break; -+#endif /* OPENSSL_NO_DSA */ -+#ifndef OPENSSL_NO_DH -+ case OP_DH: -+ sp->opdata_dh_key = CK_INVALID_HANDLE; -+ sp->opdata_dh = NULL; -+ sp->opdata_dh_priv_num = NULL; -+ break; -+#endif /* OPENSSL_NO_DH */ -+ case OP_CIPHER: -+ sp->opdata_cipher_key = CK_INVALID_HANDLE; -+ sp->opdata_encrypt = -1; -+ break; -+ } -+ -+ /* -+ * We always initialize the session as containing a non-persistent -+ * object. The key load functions set it to persistent if that is so. -+ */ -+ sp->persistent = CK_FALSE; -+ return (1); -+ } -+ -+#ifndef OPENSSL_NO_RSA -+/* -+ * Destroy all non-NULL RSA parameters. For the RSA keys by reference code, -+ * public components 'n'/'e' are the key components we use to check for the -+ * cache hit even for the private keys. So, no matter whether we are destroying -+ * a public or a private key, we always free what we can. -+ */ -+static void -+destroy_all_rsa_params(PK11_SESSION *sp) -+ { -+ if (sp->opdata_rsa_n_num != NULL) -+ { -+ BN_free(sp->opdata_rsa_n_num); -+ sp->opdata_rsa_n_num = NULL; -+ } -+ if (sp->opdata_rsa_e_num != NULL) -+ { -+ BN_free(sp->opdata_rsa_e_num); -+ sp->opdata_rsa_e_num = NULL; -+ } -+ if (sp->opdata_rsa_d_num != NULL) -+ { -+ BN_free(sp->opdata_rsa_d_num); -+ sp->opdata_rsa_d_num = NULL; -+ } -+ } -+ -+/* Destroy RSA public key from single session. */ -+int -+pk11_destroy_rsa_object_pub(PK11_SESSION *sp, CK_BBOOL uselock) -+ { -+ int ret = 0; -+ -+ if (sp->opdata_rsa_pub_key != CK_INVALID_HANDLE) -+ { -+ TRY_OBJ_DESTROY(sp, sp->opdata_rsa_pub_key, -+ ret, uselock, OP_RSA); -+ sp->opdata_rsa_pub_key = CK_INVALID_HANDLE; -+ sp->opdata_rsa_pub = NULL; -+ destroy_all_rsa_params(sp); -+ } -+ -+ return (ret); -+ } -+ -+/* Destroy RSA private key from single session. */ -+int -+pk11_destroy_rsa_object_priv(PK11_SESSION *sp, CK_BBOOL uselock) -+ { -+ int ret = 0; -+ -+ if (sp->opdata_rsa_priv_key != CK_INVALID_HANDLE) -+ { -+ TRY_OBJ_DESTROY(sp, sp->opdata_rsa_priv_key, -+ ret, uselock, OP_RSA); -+ sp->opdata_rsa_priv_key = CK_INVALID_HANDLE; -+ sp->opdata_rsa_priv = NULL; -+ destroy_all_rsa_params(sp); -+ } -+ -+ return (ret); -+ } -+ -+/* -+ * Destroy RSA key object wrapper. If session is NULL, try to destroy all -+ * objects in the free list. -+ */ -+int -+pk11_destroy_rsa_key_objects(PK11_SESSION *session) -+ { -+ int ret = 1; -+ PK11_SESSION *sp = NULL; -+ PK11_SESSION *local_free_session; -+ CK_BBOOL uselock = CK_TRUE; -+ -+ if (session != NULL) -+ local_free_session = session; -+ else -+ { -+ (void) pthread_mutex_lock(session_cache[OP_RSA].lock); -+ local_free_session = session_cache[OP_RSA].head; -+ uselock = CK_FALSE; -+ } -+ -+ /* -+ * go through the list of sessions and delete key objects -+ */ -+ while ((sp = local_free_session) != NULL) -+ { -+ local_free_session = sp->next; -+ -+ /* -+ * Do not terminate list traversal if one of the -+ * destroy operations fails. -+ */ -+ if (pk11_destroy_rsa_object_pub(sp, uselock) == 0) -+ { -+ ret = 0; -+ continue; -+ } -+ if (pk11_destroy_rsa_object_priv(sp, uselock) == 0) -+ { -+ ret = 0; -+ continue; -+ } -+ } -+ -+ if (session == NULL) -+ (void) pthread_mutex_unlock(session_cache[OP_RSA].lock); -+ -+ return (ret); -+ } -+#endif /* OPENSSL_NO_RSA */ -+ -+#ifndef OPENSSL_NO_DSA -+/* Destroy DSA public key from single session. */ -+int -+pk11_destroy_dsa_object_pub(PK11_SESSION *sp, CK_BBOOL uselock) -+ { -+ int ret = 0; -+ -+ if (sp->opdata_dsa_pub_key != CK_INVALID_HANDLE) -+ { -+ TRY_OBJ_DESTROY(sp, sp->opdata_dsa_pub_key, -+ ret, uselock, OP_DSA); -+ sp->opdata_dsa_pub_key = CK_INVALID_HANDLE; -+ sp->opdata_dsa_pub = NULL; -+ if (sp->opdata_dsa_pub_num != NULL) -+ { -+ BN_free(sp->opdata_dsa_pub_num); -+ sp->opdata_dsa_pub_num = NULL; -+ } -+ } -+ -+ return (ret); -+ } -+ -+/* Destroy DSA private key from single session. */ -+int -+pk11_destroy_dsa_object_priv(PK11_SESSION *sp, CK_BBOOL uselock) -+ { -+ int ret = 0; -+ -+ if (sp->opdata_dsa_priv_key != CK_INVALID_HANDLE) -+ { -+ TRY_OBJ_DESTROY(sp, sp->opdata_dsa_priv_key, -+ ret, uselock, OP_DSA); -+ sp->opdata_dsa_priv_key = CK_INVALID_HANDLE; -+ sp->opdata_dsa_priv = NULL; -+ if (sp->opdata_dsa_priv_num != NULL) -+ { -+ BN_free(sp->opdata_dsa_priv_num); -+ sp->opdata_dsa_priv_num = NULL; -+ } -+ } -+ -+ return (ret); -+ } -+ -+/* -+ * Destroy DSA key object wrapper. If session is NULL, try to destroy all -+ * objects in the free list. -+ */ -+int -+pk11_destroy_dsa_key_objects(PK11_SESSION *session) -+ { -+ int ret = 1; -+ PK11_SESSION *sp = NULL; -+ PK11_SESSION *local_free_session; -+ CK_BBOOL uselock = CK_TRUE; -+ -+ if (session != NULL) -+ local_free_session = session; -+ else -+ { -+ (void) pthread_mutex_lock(session_cache[OP_DSA].lock); -+ local_free_session = session_cache[OP_DSA].head; -+ uselock = CK_FALSE; -+ } -+ -+ /* -+ * go through the list of sessions and delete key objects -+ */ -+ while ((sp = local_free_session) != NULL) -+ { -+ local_free_session = sp->next; -+ -+ /* -+ * Do not terminate list traversal if one of the -+ * destroy operations fails. -+ */ -+ if (pk11_destroy_dsa_object_pub(sp, uselock) == 0) -+ { -+ ret = 0; -+ continue; -+ } -+ if (pk11_destroy_dsa_object_priv(sp, uselock) == 0) -+ { -+ ret = 0; -+ continue; -+ } -+ } -+ -+ if (session == NULL) -+ (void) pthread_mutex_unlock(session_cache[OP_DSA].lock); -+ -+ return (ret); -+ } -+#endif /* OPENSSL_NO_DSA */ -+ -+#ifndef OPENSSL_NO_DH -+/* Destroy DH key from single session. */ -+int -+pk11_destroy_dh_object(PK11_SESSION *sp, CK_BBOOL uselock) -+ { -+ int ret = 0; -+ -+ if (sp->opdata_dh_key != CK_INVALID_HANDLE) -+ { -+ TRY_OBJ_DESTROY(sp, sp->opdata_dh_key, -+ ret, uselock, OP_DH); -+ sp->opdata_dh_key = CK_INVALID_HANDLE; -+ sp->opdata_dh = NULL; -+ if (sp->opdata_dh_priv_num != NULL) -+ { -+ BN_free(sp->opdata_dh_priv_num); -+ sp->opdata_dh_priv_num = NULL; -+ } -+ } -+ -+ return (ret); -+ } -+ -+/* -+ * Destroy DH key object wrapper. -+ * -+ * arg0: pointer to PKCS#11 engine session structure -+ * if session is NULL, try to destroy all objects in the free list -+ */ -+int -+pk11_destroy_dh_key_objects(PK11_SESSION *session) -+ { -+ int ret = 1; -+ PK11_SESSION *sp = NULL; -+ PK11_SESSION *local_free_session; -+ CK_BBOOL uselock = CK_TRUE; -+ -+ if (session != NULL) -+ local_free_session = session; -+ else -+ { -+ (void) pthread_mutex_lock(session_cache[OP_DH].lock); -+ local_free_session = session_cache[OP_DH].head; -+ uselock = CK_FALSE; -+ } -+ -+ while ((sp = local_free_session) != NULL) -+ { -+ local_free_session = sp->next; -+ -+ /* -+ * Do not terminate list traversal if one of the -+ * destroy operations fails. -+ */ -+ if (pk11_destroy_dh_object(sp, uselock) == 0) -+ { -+ ret = 0; -+ continue; -+ } -+ } -+err: -+ if (session == NULL) -+ (void) pthread_mutex_unlock(session_cache[OP_DH].lock); -+ -+ return (ret); -+ } -+#endif /* OPENSSL_NO_DH */ -+ -+static int -+pk11_destroy_object(CK_SESSION_HANDLE session, CK_OBJECT_HANDLE oh, -+ CK_BBOOL persistent) -+ { -+ CK_RV rv; -+ -+ /* -+ * We never try to destroy persistent objects which are the objects -+ * stored in the keystore. Also, we always use read-only sessions so -+ * C_DestroyObject() would be returning CKR_SESSION_READ_ONLY here. -+ */ -+ if (persistent == CK_TRUE) -+ return (1); -+ -+ rv = pFuncList->C_DestroyObject(session, oh); -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_DESTROY_OBJECT, PK11_R_DESTROYOBJECT, -+ rv); -+ return (0); -+ } -+ -+ return (1); -+ } -+ -+ -+/* Symmetric ciphers and digests support functions */ -+ -+static int -+cipher_nid_to_pk11(int nid) -+ { -+ int i; -+ -+ for (i = 0; i < PK11_CIPHER_MAX; i++) -+ if (ciphers[i].nid == nid) -+ return (ciphers[i].id); -+ return (-1); -+ } -+ -+static int -+pk11_usable_ciphers(const int **nids) -+ { -+ if (cipher_count > 0) -+ *nids = cipher_nids; -+ else -+ *nids = NULL; -+ return (cipher_count); -+ } -+ -+static int -+pk11_usable_digests(const int **nids) -+ { -+ if (digest_count > 0) -+ *nids = digest_nids; -+ else -+ *nids = NULL; -+ return (digest_count); -+ } -+ -+/* -+ * Init context for encryption or decryption using a symmetric key. -+ */ -+static int pk11_init_symmetric(EVP_CIPHER_CTX *ctx, PK11_CIPHER *pcipher, -+ PK11_SESSION *sp, CK_MECHANISM_PTR pmech) -+ { -+ CK_RV rv; -+ CK_AES_CTR_PARAMS ctr_params; -+ -+ /* -+ * We expect pmech->mechanism to be already set and -+ * pParameter/ulParameterLen initialized to NULL/0 before -+ * pk11_init_symmetric() is called. -+ */ -+ OPENSSL_assert(pmech->mechanism != NULL); -+ OPENSSL_assert(pmech->pParameter == NULL); -+ OPENSSL_assert(pmech->ulParameterLen == 0); -+ -+ if (ctx->cipher->nid == NID_aes_128_ctr || -+ ctx->cipher->nid == NID_aes_192_ctr || -+ ctx->cipher->nid == NID_aes_256_ctr) -+ { -+ pmech->pParameter = (void *)(&ctr_params); -+ pmech->ulParameterLen = sizeof (ctr_params); -+ /* -+ * For now, we are limited to the fixed length of the counter, -+ * it covers the whole counter block. That's what RFC 4344 -+ * needs. For more information on internal structure of the -+ * counter block, see RFC 3686. If needed in the future, we can -+ * add code so that the counter length can be set via -+ * ENGINE_ctrl() function. -+ */ -+ ctr_params.ulCounterBits = AES_BLOCK_SIZE * 8; -+ OPENSSL_assert(pcipher->iv_len == AES_BLOCK_SIZE); -+ (void) memcpy(ctr_params.cb, ctx->iv, AES_BLOCK_SIZE); -+ } -+ else -+ { -+ if (pcipher->iv_len > 0) -+ { -+ pmech->pParameter = (void *)ctx->iv; -+ pmech->ulParameterLen = pcipher->iv_len; -+ } -+ } -+ -+ /* if we get here, the encryption needs to be reinitialized */ -+ if (ctx->encrypt) -+ rv = pFuncList->C_EncryptInit(sp->session, pmech, -+ sp->opdata_cipher_key); -+ else -+ rv = pFuncList->C_DecryptInit(sp->session, pmech, -+ sp->opdata_cipher_key); -+ -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_CIPHER_INIT, ctx->encrypt ? -+ PK11_R_ENCRYPTINIT : PK11_R_DECRYPTINIT, rv); -+ pk11_return_session(sp, OP_CIPHER); -+ return (0); -+ } -+ -+ return (1); -+ } -+ -+/* ARGSUSED */ -+static int -+pk11_cipher_init(EVP_CIPHER_CTX *ctx, const unsigned char *key, -+ const unsigned char *iv, int enc) -+ { -+ CK_MECHANISM mech; -+ int index; -+ PK11_CIPHER_STATE *state = (PK11_CIPHER_STATE *) ctx->cipher_data; -+ PK11_SESSION *sp; -+ PK11_CIPHER *p_ciph_table_row; -+ -+ state->sp = NULL; -+ -+ index = cipher_nid_to_pk11(ctx->cipher->nid); -+ if (index < 0 || index >= PK11_CIPHER_MAX) -+ return (0); -+ -+ p_ciph_table_row = &ciphers[index]; -+ /* -+ * iv_len in the ctx->cipher structure is the maximum IV length for the -+ * current cipher and it must be less or equal to the IV length in our -+ * ciphers table. The key length must be in the allowed interval. From -+ * all cipher modes that the PKCS#11 engine supports only RC4 allows a -+ * key length to be in some range, all other NIDs have a precise key -+ * length. Every application can define its own EVP functions so this -+ * code serves as a sanity check. -+ * -+ * Note that the reason why the IV length in ctx->cipher might be -+ * greater than the actual length is that OpenSSL uses BLOCK_CIPHER_defs -+ * macro to define functions that return EVP structures for all DES -+ * modes. So, even ECB modes get 8 byte IV. -+ */ -+ if (ctx->cipher->iv_len < p_ciph_table_row->iv_len || -+ ctx->key_len < p_ciph_table_row->min_key_len || -+ ctx->key_len > p_ciph_table_row->max_key_len) -+ { -+ PK11err(PK11_F_CIPHER_INIT, PK11_R_KEY_OR_IV_LEN_PROBLEM); -+ return (0); -+ } -+ -+ if ((sp = pk11_get_session(OP_CIPHER)) == NULL) -+ return (0); -+ -+ /* if applicable, the mechanism parameter is used for IV */ -+ mech.mechanism = p_ciph_table_row->mech_type; -+ mech.pParameter = NULL; -+ mech.ulParameterLen = 0; -+ -+ /* The key object is destroyed here if it is not the current key. */ -+ (void) check_new_cipher_key(sp, key, ctx->key_len); -+ -+ /* -+ * If the key is the same and the encryption is also the same, then -+ * just reuse it. However, we must not forget to reinitialize the -+ * context that was finalized in pk11_cipher_cleanup(). -+ */ -+ if (sp->opdata_cipher_key != CK_INVALID_HANDLE && -+ sp->opdata_encrypt == ctx->encrypt) -+ { -+ state->sp = sp; -+ if (pk11_init_symmetric(ctx, p_ciph_table_row, sp, &mech) == 0) -+ return (0); -+ -+ return (1); -+ } -+ -+ /* -+ * Check if the key has been invalidated. If so, a new key object -+ * needs to be created. -+ */ -+ if (sp->opdata_cipher_key == CK_INVALID_HANDLE) -+ { -+ sp->opdata_cipher_key = pk11_get_cipher_key( -+ ctx, key, p_ciph_table_row->key_type, sp); -+ } -+ -+ if (sp->opdata_encrypt != ctx->encrypt && sp->opdata_encrypt != -1) -+ { -+ /* -+ * The previous encryption/decryption is different. Need to -+ * terminate the previous * active encryption/decryption here. -+ */ -+ if (!pk11_cipher_final(sp)) -+ { -+ pk11_return_session(sp, OP_CIPHER); -+ return (0); -+ } -+ } -+ -+ if (sp->opdata_cipher_key == CK_INVALID_HANDLE) -+ { -+ pk11_return_session(sp, OP_CIPHER); -+ return (0); -+ } -+ -+ /* now initialize the context with a new key */ -+ if (pk11_init_symmetric(ctx, p_ciph_table_row, sp, &mech) == 0) -+ return (0); -+ -+ sp->opdata_encrypt = ctx->encrypt; -+ state->sp = sp; -+ -+ return (1); -+ } -+ -+/* -+ * When reusing the same key in an encryption/decryption session for a -+ * decryption/encryption session, we need to close the active session -+ * and recreate a new one. Note that the key is in the global session so -+ * that it needs not be recreated. -+ * -+ * It is more appropriate to use C_En/DecryptFinish here. At the time of this -+ * development, these two functions in the PKCS#11 libraries used return -+ * unexpected errors when passing in 0 length output. It may be a good -+ * idea to try them again if performance is a problem here and fix -+ * C_En/DecryptFinial if there are bugs there causing the problem. -+ */ -+static int -+pk11_cipher_final(PK11_SESSION *sp) -+ { -+ CK_RV rv; -+ -+ rv = pFuncList->C_CloseSession(sp->session); -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_CIPHER_FINAL, PK11_R_CLOSESESSION, rv); -+ return (0); -+ } -+ -+ rv = pFuncList->C_OpenSession(SLOTID, CKF_SERIAL_SESSION, -+ NULL_PTR, NULL_PTR, &sp->session); -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_CIPHER_FINAL, PK11_R_OPENSESSION, rv); -+ return (0); -+ } -+ -+ return (1); -+ } -+ -+/* -+ * An engine interface function. The calling function allocates sufficient -+ * memory for the output buffer "out" to hold the results. -+ */ -+static int -+pk11_cipher_do_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, -+ const unsigned char *in, size_t inl) -+ { -+ PK11_CIPHER_STATE *state = (PK11_CIPHER_STATE *) ctx->cipher_data; -+ PK11_SESSION *sp; -+ CK_RV rv; -+ unsigned long outl = inl; -+ -+ if (state == NULL || state->sp == NULL) -+ return (0); -+ -+ sp = (PK11_SESSION *) state->sp; -+ -+ if (!inl) -+ return (1); -+ -+ /* RC4 is the only stream cipher we support */ -+ if (ctx->cipher->nid != NID_rc4 && (inl % ctx->cipher->block_size) != 0) -+ return (0); -+ -+ if (ctx->encrypt) -+ { -+ rv = pFuncList->C_EncryptUpdate(sp->session, -+ (unsigned char *)in, inl, out, &outl); -+ -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_CIPHER_DO_CIPHER, -+ PK11_R_ENCRYPTUPDATE, rv); -+ return (0); -+ } -+ } -+ else -+ { -+ rv = pFuncList->C_DecryptUpdate(sp->session, -+ (unsigned char *)in, inl, out, &outl); -+ -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_CIPHER_DO_CIPHER, -+ PK11_R_DECRYPTUPDATE, rv); -+ return (0); -+ } -+ } -+ -+ /* -+ * For DES_CBC, DES3_CBC, AES_CBC, and RC4, the output size is always -+ * the same size of input. -+ * The application has guaranteed to call the block ciphers with -+ * correctly aligned buffers. -+ */ -+ if (inl != outl) -+ return (0); -+ -+ return (1); -+ } -+ -+/* -+ * Return the session to the pool. Calling C_EncryptFinal() and C_DecryptFinal() -+ * here is the right thing because in EVP_DecryptFinal_ex(), engine's -+ * do_cipher() is not even called, and in EVP_EncryptFinal_ex() it is called but -+ * the engine can't find out that it's the finalizing call. We wouldn't -+ * necessarily have to finalize the context here since reinitializing it with -+ * C_(Encrypt|Decrypt)Init() should be fine but for the sake of correctness, -+ * let's do it. Some implementations might leak memory if the previously used -+ * context is initialized without finalizing it first. -+ */ -+static int -+pk11_cipher_cleanup(EVP_CIPHER_CTX *ctx) -+ { -+ CK_RV rv; -+ CK_ULONG len = EVP_MAX_BLOCK_LENGTH; -+ CK_BYTE buf[EVP_MAX_BLOCK_LENGTH]; -+ PK11_CIPHER_STATE *state = ctx->cipher_data; -+ -+ if (state != NULL && state->sp != NULL) -+ { -+ /* -+ * We are not interested in the data here, we just need to get -+ * rid of the context. -+ */ -+ if (ctx->encrypt) -+ rv = pFuncList->C_EncryptFinal( -+ state->sp->session, buf, &len); -+ else -+ rv = pFuncList->C_DecryptFinal( -+ state->sp->session, buf, &len); -+ -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_CIPHER_CLEANUP, ctx->encrypt ? -+ PK11_R_ENCRYPTFINAL : PK11_R_DECRYPTFINAL, rv); -+ pk11_return_session(state->sp, OP_CIPHER); -+ return (0); -+ } -+ -+ pk11_return_session(state->sp, OP_CIPHER); -+ state->sp = NULL; -+ } -+ -+ return (1); -+ } -+ -+/* -+ * Registered by the ENGINE when used to find out how to deal with -+ * a particular NID in the ENGINE. This says what we'll do at the -+ * top level - note, that list is restricted by what we answer with -+ */ -+/* ARGSUSED */ -+static int -+pk11_engine_ciphers(ENGINE *e, const EVP_CIPHER **cipher, -+ const int **nids, int nid) -+ { -+ if (!cipher) -+ return (pk11_usable_ciphers(nids)); -+ -+ switch (nid) -+ { -+ case NID_des_ede3_cbc: -+ *cipher = &pk11_3des_cbc; -+ break; -+ case NID_des_cbc: -+ *cipher = &pk11_des_cbc; -+ break; -+ case NID_des_ede3_ecb: -+ *cipher = &pk11_3des_ecb; -+ break; -+ case NID_des_ecb: -+ *cipher = &pk11_des_ecb; -+ break; -+ case NID_aes_128_cbc: -+ *cipher = &pk11_aes_128_cbc; -+ break; -+ case NID_aes_192_cbc: -+ *cipher = &pk11_aes_192_cbc; -+ break; -+ case NID_aes_256_cbc: -+ *cipher = &pk11_aes_256_cbc; -+ break; -+ case NID_aes_128_ecb: -+ *cipher = &pk11_aes_128_ecb; -+ break; -+ case NID_aes_192_ecb: -+ *cipher = &pk11_aes_192_ecb; -+ break; -+ case NID_aes_256_ecb: -+ *cipher = &pk11_aes_256_ecb; -+ break; -+ case NID_aes_128_ctr: -+ *cipher = &pk11_aes_128_ctr; -+ break; -+ case NID_aes_192_ctr: -+ *cipher = &pk11_aes_192_ctr; -+ break; -+ case NID_aes_256_ctr: -+ *cipher = &pk11_aes_256_ctr; -+ break; -+ case NID_bf_cbc: -+ *cipher = &pk11_bf_cbc; -+ break; -+ case NID_rc4: -+ *cipher = &pk11_rc4; -+ break; -+ default: -+ *cipher = NULL; -+ break; -+ } -+ return (*cipher != NULL); -+ } -+ -+/* ARGSUSED */ -+static int -+pk11_engine_digests(ENGINE *e, const EVP_MD **digest, -+ const int **nids, int nid) -+ { -+ if (!digest) -+ return (pk11_usable_digests(nids)); -+ -+ switch (nid) -+ { -+ case NID_md5: -+ *digest = &pk11_md5; -+ break; -+ /* -+ * A special case. For "openssl dgst -dss1 -engine pkcs11 ...", -+ * OpenSSL calls EVP_get_digestbyname() on "dss1" which ends up -+ * calling pk11_engine_digests() for NID_dsa. Internally, if an -+ * engine is not used, OpenSSL uses SHA1_Init() as expected for -+ * DSA. So, we must return pk11_sha1() for NID_dsa as well. Note -+ * that this must have changed between 0.9.8 and 1.0.0 since we -+ * did not have the problem with the 0.9.8 version. -+ */ -+ case NID_sha1: -+ case NID_dsa: -+ *digest = &pk11_sha1; -+ break; -+ case NID_sha224: -+ *digest = &pk11_sha224; -+ break; -+ case NID_sha256: -+ *digest = &pk11_sha256; -+ break; -+ case NID_sha384: -+ *digest = &pk11_sha384; -+ break; -+ case NID_sha512: -+ *digest = &pk11_sha512; -+ break; -+ default: -+ *digest = NULL; -+ break; -+ } -+ return (*digest != NULL); -+ } -+ -+ -+/* Create a secret key object in a PKCS#11 session */ -+static CK_OBJECT_HANDLE pk11_get_cipher_key(EVP_CIPHER_CTX *ctx, -+ const unsigned char *key, CK_KEY_TYPE key_type, PK11_SESSION *sp) -+ { -+ CK_RV rv; -+ CK_OBJECT_HANDLE h_key = CK_INVALID_HANDLE; -+ CK_OBJECT_CLASS obj_key = CKO_SECRET_KEY; -+ CK_ULONG ul_key_attr_count = 6; -+ -+ CK_ATTRIBUTE a_key_template[] = -+ { -+ {CKA_CLASS, (void*) NULL, sizeof (CK_OBJECT_CLASS)}, -+ {CKA_KEY_TYPE, (void*) NULL, sizeof (CK_KEY_TYPE)}, -+ {CKA_TOKEN, &pk11_false, sizeof (pk11_false)}, -+ {CKA_ENCRYPT, &pk11_true, sizeof (pk11_true)}, -+ {CKA_DECRYPT, &pk11_true, sizeof (pk11_true)}, -+ {CKA_VALUE, (void*) NULL, 0}, -+ }; -+ -+ /* -+ * Create secret key object in global_session. All other sessions -+ * can use the key handles. Here is why: -+ * OpenSSL will call EncryptInit and EncryptUpdate using a secret key. -+ * It may then call DecryptInit and DecryptUpdate using the same key. -+ * To use the same key object, we need to call EncryptFinal with -+ * a 0 length message. Currently, this does not work for 3DES -+ * mechanism. To get around this problem, we close the session and -+ * then create a new session to use the same key object. When a session -+ * is closed, all the object handles will be invalid. Thus, create key -+ * objects in a global session, an individual session may be closed to -+ * terminate the active operation. -+ */ -+ CK_SESSION_HANDLE session = global_session; -+ a_key_template[0].pValue = &obj_key; -+ a_key_template[1].pValue = &key_type; -+ a_key_template[5].pValue = (void *) key; -+ a_key_template[5].ulValueLen = (unsigned long) ctx->key_len; -+ -+ rv = pFuncList->C_CreateObject(session, -+ a_key_template, ul_key_attr_count, &h_key); -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_GET_CIPHER_KEY, PK11_R_CREATEOBJECT, -+ rv); -+ goto err; -+ } -+ -+ /* -+ * Save the key information used in this session. -+ * The max can be saved is PK11_KEY_LEN_MAX. -+ */ -+ sp->opdata_key_len = ctx->key_len > PK11_KEY_LEN_MAX ? -+ PK11_KEY_LEN_MAX : ctx->key_len; -+ (void) memcpy(sp->opdata_key, key, sp->opdata_key_len); -+err: -+ -+ return (h_key); -+ } -+ -+static int -+md_nid_to_pk11(int nid) -+ { -+ int i; -+ -+ for (i = 0; i < PK11_DIGEST_MAX; i++) -+ if (digests[i].nid == nid) -+ return (digests[i].id); -+ return (-1); -+ } -+ -+static int -+pk11_digest_init(EVP_MD_CTX *ctx) -+ { -+ CK_RV rv; -+ CK_MECHANISM mech; -+ int index; -+ PK11_SESSION *sp; -+ PK11_DIGEST *pdp; -+ PK11_CIPHER_STATE *state = (PK11_CIPHER_STATE *) ctx->md_data; -+ -+ state->sp = NULL; -+ -+ index = md_nid_to_pk11(ctx->digest->type); -+ if (index < 0 || index >= PK11_DIGEST_MAX) -+ return (0); -+ -+ pdp = &digests[index]; -+ if ((sp = pk11_get_session(OP_DIGEST)) == NULL) -+ return (0); -+ -+ /* at present, no parameter is needed for supported digests */ -+ mech.mechanism = pdp->mech_type; -+ mech.pParameter = NULL; -+ mech.ulParameterLen = 0; -+ -+ rv = pFuncList->C_DigestInit(sp->session, &mech); -+ -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_DIGEST_INIT, PK11_R_DIGESTINIT, rv); -+ pk11_return_session(sp, OP_DIGEST); -+ return (0); -+ } -+ -+ state->sp = sp; -+ -+ return (1); -+ } -+ -+static int -+pk11_digest_update(EVP_MD_CTX *ctx, const void *data, size_t count) -+ { -+ CK_RV rv; -+ PK11_CIPHER_STATE *state = (PK11_CIPHER_STATE *) ctx->md_data; -+ -+ /* 0 length message will cause a failure in C_DigestFinal */ -+ if (count == 0) -+ return (1); -+ -+ if (state == NULL || state->sp == NULL) -+ return (0); -+ -+ rv = pFuncList->C_DigestUpdate(state->sp->session, (CK_BYTE *) data, -+ count); -+ -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_DIGEST_UPDATE, PK11_R_DIGESTUPDATE, rv); -+ pk11_return_session(state->sp, OP_DIGEST); -+ state->sp = NULL; -+ return (0); -+ } -+ -+ return (1); -+ } -+ -+static int -+pk11_digest_final(EVP_MD_CTX *ctx, unsigned char *md) -+ { -+ CK_RV rv; -+ unsigned long len; -+ PK11_CIPHER_STATE *state = (PK11_CIPHER_STATE *) ctx->md_data; -+ len = ctx->digest->md_size; -+ -+ if (state == NULL || state->sp == NULL) -+ return (0); -+ -+ rv = pFuncList->C_DigestFinal(state->sp->session, md, &len); -+ -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_DIGEST_FINAL, PK11_R_DIGESTFINAL, rv); -+ pk11_return_session(state->sp, OP_DIGEST); -+ state->sp = NULL; -+ return (0); -+ } -+ -+ if (ctx->digest->md_size != len) -+ return (0); -+ -+ /* -+ * Final is called and digest is returned, so return the session -+ * to the pool -+ */ -+ pk11_return_session(state->sp, OP_DIGEST); -+ state->sp = NULL; -+ -+ return (1); -+ } -+ -+static int -+pk11_digest_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from) -+ { -+ CK_RV rv; -+ int ret = 0; -+ PK11_CIPHER_STATE *state, *state_to; -+ CK_BYTE_PTR pstate = NULL; -+ CK_ULONG ul_state_len; -+ -+ if (from->md_data == NULL || to->digest->ctx_size == 0) -+ return (1); -+ -+ /* The copy-from state */ -+ state = (PK11_CIPHER_STATE *) from->md_data; -+ if (state->sp == NULL) -+ goto err; -+ -+ /* Initialize the copy-to state */ -+ if (!pk11_digest_init(to)) -+ goto err; -+ state_to = (PK11_CIPHER_STATE *) to->md_data; -+ -+ /* Get the size of the operation state of the copy-from session */ -+ rv = pFuncList->C_GetOperationState(state->sp->session, NULL, -+ &ul_state_len); -+ -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_DIGEST_COPY, PK11_R_GET_OPERATION_STATE, -+ rv); -+ goto err; -+ } -+ if (ul_state_len == 0) -+ { -+ goto err; -+ } -+ -+ pstate = OPENSSL_malloc(ul_state_len); -+ if (pstate == NULL) -+ { -+ PK11err(PK11_F_DIGEST_COPY, PK11_R_MALLOC_FAILURE); -+ goto err; -+ } -+ -+ /* Get the operation state of the copy-from session */ -+ rv = pFuncList->C_GetOperationState(state->sp->session, pstate, -+ &ul_state_len); -+ -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_DIGEST_COPY, PK11_R_GET_OPERATION_STATE, -+ rv); -+ goto err; -+ } -+ -+ /* Set the operation state of the copy-to session */ -+ rv = pFuncList->C_SetOperationState(state_to->sp->session, pstate, -+ ul_state_len, 0, 0); -+ -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_DIGEST_COPY, -+ PK11_R_SET_OPERATION_STATE, rv); -+ goto err; -+ } -+ -+ ret = 1; -+err: -+ if (pstate != NULL) -+ OPENSSL_free(pstate); -+ -+ return (ret); -+ } -+ -+/* Return any pending session state to the pool */ -+static int -+pk11_digest_cleanup(EVP_MD_CTX *ctx) -+ { -+ PK11_CIPHER_STATE *state = ctx->md_data; -+ unsigned char buf[EVP_MAX_MD_SIZE]; -+ -+ if (state != NULL && state->sp != NULL) -+ { -+ /* -+ * If state->sp is not NULL then pk11_digest_final() has not -+ * been called yet. We must call it now to free any memory -+ * that might have been allocated in the token when -+ * pk11_digest_init() was called. pk11_digest_final() -+ * will return the session to the cache. -+ */ -+ if (!pk11_digest_final(ctx, buf)) -+ return (0); -+ } -+ -+ return (1); -+ } -+ -+/* -+ * Check if the new key is the same as the key object in the session. If the key -+ * is the same, no need to create a new key object. Otherwise, the old key -+ * object needs to be destroyed and a new one will be created. Return 1 for -+ * cache hit, 0 for cache miss. Note that we must check the key length first -+ * otherwise we could end up reusing a different, longer key with the same -+ * prefix. -+ */ -+static int check_new_cipher_key(PK11_SESSION *sp, const unsigned char *key, -+ int key_len) -+ { -+ if (sp->opdata_key_len != key_len || -+ memcmp(sp->opdata_key, key, key_len) != 0) -+ { -+ (void) pk11_destroy_cipher_key_objects(sp); -+ return (0); -+ } -+ return (1); -+ } -+ -+/* Destroy one or more secret key objects. */ -+static int pk11_destroy_cipher_key_objects(PK11_SESSION *session) -+ { -+ int ret = 0; -+ PK11_SESSION *sp = NULL; -+ PK11_SESSION *local_free_session; -+ -+ if (session != NULL) -+ local_free_session = session; -+ else -+ { -+ (void) pthread_mutex_lock(session_cache[OP_CIPHER].lock); -+ local_free_session = session_cache[OP_CIPHER].head; -+ } -+ -+ while ((sp = local_free_session) != NULL) -+ { -+ local_free_session = sp->next; -+ -+ if (sp->opdata_cipher_key != CK_INVALID_HANDLE) -+ { -+ /* -+ * The secret key object is created in the -+ * global_session. See pk11_get_cipher_key(). -+ */ -+ if (pk11_destroy_object(global_session, -+ sp->opdata_cipher_key, CK_FALSE) == 0) -+ goto err; -+ sp->opdata_cipher_key = CK_INVALID_HANDLE; -+ } -+ } -+ ret = 1; -+err: -+ -+ if (session == NULL) -+ (void) pthread_mutex_unlock(session_cache[OP_CIPHER].lock); -+ -+ return (ret); -+ } -+ -+ -+/* -+ * Public key mechanisms optionally supported -+ * -+ * CKM_RSA_X_509 -+ * CKM_RSA_PKCS -+ * CKM_DSA -+ * -+ * The first slot that supports at least one of those mechanisms is chosen as a -+ * public key slot. -+ * -+ * Symmetric ciphers optionally supported -+ * -+ * CKM_DES3_CBC -+ * CKM_DES_CBC -+ * CKM_AES_CBC -+ * CKM_DES3_ECB -+ * CKM_DES_ECB -+ * CKM_AES_ECB -+ * CKM_AES_CTR -+ * CKM_RC4 -+ * CKM_BLOWFISH_CBC -+ * -+ * Digests optionally supported -+ * -+ * CKM_MD5 -+ * CKM_SHA_1 -+ * CKM_SHA224 -+ * CKM_SHA256 -+ * CKM_SHA384 -+ * CKM_SHA512 -+ * -+ * The output of this function is a set of global variables indicating which -+ * mechanisms from RSA, DSA, DH and RAND are present, and also two arrays of -+ * mechanisms, one for symmetric ciphers and one for digests. Also, 3 global -+ * variables carry information about which slot was chosen for (a) public key -+ * mechanisms, (b) random operations, and (c) symmetric ciphers and digests. -+ */ -+static int -+pk11_choose_slots(int *any_slot_found) -+ { -+ CK_SLOT_ID_PTR pSlotList = NULL_PTR; -+ CK_ULONG ulSlotCount = 0; -+ CK_MECHANISM_INFO mech_info; -+ CK_TOKEN_INFO token_info; -+ int i; -+ CK_RV rv; -+ CK_SLOT_ID best_pubkey_slot_sofar; -+ CK_SLOT_ID current_slot = 0; -+ int best_number_of_mechs = 0; -+ int local_cipher_nids[PK11_CIPHER_MAX]; -+ int local_digest_nids[PK11_DIGEST_MAX]; -+ -+ /* let's initialize the output parameter */ -+ if (any_slot_found != NULL) -+ *any_slot_found = 0; -+ -+ /* Get slot list for memory allocation */ -+ rv = pFuncList->C_GetSlotList(CK_FALSE, NULL_PTR, &ulSlotCount); -+ -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_CHOOSE_SLOT, PK11_R_GETSLOTLIST, rv); -+ return (0); -+ } -+ -+ /* it's not an error if we didn't find any providers */ -+ if (ulSlotCount == 0) -+ { -+ DEBUG_SLOT_SEL("%s: no crypto providers found\n", PK11_DBG); -+ return (1); -+ } -+ -+ pSlotList = OPENSSL_malloc(ulSlotCount * sizeof (CK_SLOT_ID)); -+ -+ if (pSlotList == NULL) -+ { -+ PK11err(PK11_F_CHOOSE_SLOT, PK11_R_MALLOC_FAILURE); -+ return (0); -+ } -+ -+ /* Get the slot list for processing */ -+ rv = pFuncList->C_GetSlotList(CK_FALSE, pSlotList, &ulSlotCount); -+ if (rv != CKR_OK) -+ { -+ PK11err_add_data(PK11_F_CHOOSE_SLOT, PK11_R_GETSLOTLIST, rv); -+ OPENSSL_free(pSlotList); -+ return (0); -+ } -+ -+ DEBUG_SLOT_SEL("%s: provider: %s\n", PK11_DBG, def_PK11_LIBNAME); -+ DEBUG_SLOT_SEL("%s: number of slots: %d\n", PK11_DBG, ulSlotCount); -+ -+ pubkey_SLOTID = pSlotList[0]; -+ for (i = 0; i < ulSlotCount; i++) -+ { -+ current_slot = pSlotList[i]; -+ DEBUG_SLOT_SEL("%s: == checking slot: %d ==\n", PK11_DBG, -+ current_slot); -+ rv = pFuncList->C_GetTokenInfo(current_slot, &token_info); -+ if (rv != CKR_OK) -+ continue; -+ -+ DEBUG_SLOT_SEL("%s: token label: %.32s\n", PK11_DBG, -+ token_info.label); -+ -+ pk11_choose_rand_slot(token_info, current_slot); -+ -+ pk11_choose_pubkey_slot(mech_info, token_info, current_slot, -+ rv, best_number_of_mechs, best_pubkey_slot_sofar); -+ -+ (void) memset(local_cipher_nids, 0, sizeof (local_cipher_nids)); -+ (void) memset(local_digest_nids, 0, sizeof (local_digest_nids)); -+ pk11_choose_cipher_digest(local_cipher_nids, -+ local_digest_nids, pFuncList, current_slot); -+ } -+ -+ if (best_number_of_mechs == 0) -+ { -+ DEBUG_SLOT_SEL("%s: no rsa/dsa/dh\n", PK11_DBG); -+ } -+ else -+ { -+ pubkey_SLOTID = best_pubkey_slot_sofar; -+ } -+ -+ DEBUG_SLOT_SEL("%s: chosen pubkey slot: %d\n", PK11_DBG, pubkey_SLOTID); -+ DEBUG_SLOT_SEL("%s: chosen rand slot: %d\n", PK11_DBG, rand_SLOTID); -+ DEBUG_SLOT_SEL("%s: chosen cipher/digest slot: %d\n", PK11_DBG, SLOTID); -+ DEBUG_SLOT_SEL("%s: pk11_have_rsa %d\n", PK11_DBG, pk11_have_rsa); -+ DEBUG_SLOT_SEL("%s: pk11_have_dsa %d\n", PK11_DBG, pk11_have_dsa); -+ DEBUG_SLOT_SEL("%s: pk11_have_dh %d\n", PK11_DBG, pk11_have_dh); -+ DEBUG_SLOT_SEL("%s: pk11_have_random %d\n", PK11_DBG, pk11_have_random); -+ DEBUG_SLOT_SEL("%s: cipher_count %d\n", PK11_DBG, cipher_count); -+ DEBUG_SLOT_SEL("%s: digest_count %d\n", PK11_DBG, digest_count); -+ -+ if (pSlotList != NULL) -+ OPENSSL_free(pSlotList); -+ -+#ifdef SOLARIS_HW_SLOT_SELECTION -+ OPENSSL_free(hw_cnids); -+ OPENSSL_free(hw_dnids); -+#endif /* SOLARIS_HW_SLOT_SELECTION */ -+ -+ if (any_slot_found != NULL) -+ *any_slot_found = 1; -+ return (1); -+ } -+ -+static void pk11_choose_rand_slot(CK_TOKEN_INFO token_info, -+ CK_SLOT_ID current_slot) -+ { -+ DEBUG_SLOT_SEL("%s: checking rand slots\n", PK11_DBG); -+ if (((token_info.flags & CKF_RNG) != 0) && !pk11_have_random) -+ { -+ DEBUG_SLOT_SEL("%s: this token has CKF_RNG flag\n", PK11_DBG); -+ pk11_have_random = CK_TRUE; -+ rand_SLOTID = current_slot; -+ } -+ } -+ -+static void pk11_choose_pubkey_slot(CK_MECHANISM_INFO mech_info, -+ CK_TOKEN_INFO token_info, CK_SLOT_ID current_slot, CK_RV rv, -+ int best_number_of_mechs, CK_SLOT_ID best_pubkey_slot_sofar) -+ { -+ CK_BBOOL slot_has_rsa = CK_FALSE; -+ CK_BBOOL slot_has_dsa = CK_FALSE; -+ CK_BBOOL slot_has_dh = CK_FALSE; -+ int current_number_of_mechs = 0; -+ -+ DEBUG_SLOT_SEL("%s: checking pubkey slots\n", PK11_DBG); -+ -+#ifndef OPENSSL_NO_RSA -+ /* -+ * Check if this slot is capable of signing and -+ * verifying with CKM_RSA_PKCS. -+ */ -+ rv = pFuncList->C_GetMechanismInfo(current_slot, CKM_RSA_PKCS, -+ &mech_info); -+ -+ if (rv == CKR_OK && ((mech_info.flags & CKF_SIGN) && -+ (mech_info.flags & CKF_VERIFY))) -+ { -+ /* -+ * Check if this slot is capable of encryption, -+ * decryption, sign, and verify with CKM_RSA_X_509. -+ */ -+ rv = pFuncList->C_GetMechanismInfo(current_slot, -+ CKM_RSA_X_509, &mech_info); -+ -+ if (rv == CKR_OK && ((mech_info.flags & CKF_SIGN) && -+ (mech_info.flags & CKF_VERIFY) && -+ (mech_info.flags & CKF_ENCRYPT) && -+ (mech_info.flags & CKF_VERIFY_RECOVER) && -+ (mech_info.flags & CKF_DECRYPT))) -+ { -+ slot_has_rsa = CK_TRUE; -+ current_number_of_mechs++; -+ } -+ } -+#endif /* OPENSSL_NO_RSA */ -+ -+#ifndef OPENSSL_NO_DSA -+ /* -+ * Check if this slot is capable of signing and -+ * verifying with CKM_DSA. -+ */ -+ rv = pFuncList->C_GetMechanismInfo(current_slot, CKM_DSA, -+ &mech_info); -+ if (rv == CKR_OK && ((mech_info.flags & CKF_SIGN) && -+ (mech_info.flags & CKF_VERIFY))) -+ { -+ slot_has_dsa = CK_TRUE; -+ current_number_of_mechs++; -+ } -+#endif /* OPENSSL_NO_DSA */ -+ -+#ifndef OPENSSL_NO_DH -+ /* -+ * Check if this slot is capable of DH key generataion and -+ * derivation. -+ */ -+ rv = pFuncList->C_GetMechanismInfo(current_slot, -+ CKM_DH_PKCS_KEY_PAIR_GEN, &mech_info); -+ -+ if (rv == CKR_OK && (mech_info.flags & CKF_GENERATE_KEY_PAIR)) -+ { -+ rv = pFuncList->C_GetMechanismInfo(current_slot, -+ CKM_DH_PKCS_DERIVE, &mech_info); -+ if (rv == CKR_OK && (mech_info.flags & CKF_DERIVE)) -+ { -+ slot_has_dh = CK_TRUE; -+ current_number_of_mechs++; -+ } -+ } -+#endif /* OPENSSL_NO_DH */ -+ -+ if (current_number_of_mechs > best_number_of_mechs) -+ { -+ best_pubkey_slot_sofar = current_slot; -+ pk11_have_rsa = slot_has_rsa; -+ pk11_have_dsa = slot_has_dsa; -+ pk11_have_dh = slot_has_dh; -+ best_number_of_mechs = current_number_of_mechs; -+ /* -+ * Cache the flags for later use. We might need those if -+ * RSA keys by reference feature is used. -+ */ -+ pubkey_token_flags = token_info.flags; -+ DEBUG_SLOT_SEL("%s: pubkey flags changed to " -+ "%lu.\n", PK11_DBG, pubkey_token_flags); -+ } -+ } -+ -+static void pk11_choose_cipher_digest(int *local_cipher_nids, -+ int *local_digest_nids, CK_FUNCTION_LIST_PTR pflist, -+ CK_SLOT_ID current_slot) -+ { -+ int current_slot_n_cipher = 0; -+ int current_slot_n_digest = 0; -+ -+ DEBUG_SLOT_SEL("%s: checking cipher/digest\n", PK11_DBG); -+ -+ pk11_find_symmetric_ciphers(pFuncList, current_slot, -+ ¤t_slot_n_cipher, local_cipher_nids); -+ -+ pk11_find_digests(pFuncList, current_slot, -+ ¤t_slot_n_digest, local_digest_nids); -+ -+ DEBUG_SLOT_SEL("%s: current_slot_n_cipher %d\n", PK11_DBG, -+ current_slot_n_cipher); -+ DEBUG_SLOT_SEL("%s: current_slot_n_digest %d\n", PK11_DBG, -+ current_slot_n_digest); -+ /* -+ * If the current slot supports more ciphers/digests than -+ * the previous best one we change the current best to this one, -+ * otherwise leave it where it is. -+ */ -+ if ((current_slot_n_cipher + current_slot_n_digest) > -+ (cipher_count + digest_count)) -+ { -+ DEBUG_SLOT_SEL("%s: changing best slot to %d\n", -+ PK11_DBG, current_slot); -+ SLOTID = current_slot; -+ cipher_count = current_slot_n_cipher; -+ digest_count = current_slot_n_digest; -+ OPENSSL_assert(cipher_count <= PK11_CIPHER_MAX); -+ OPENSSL_assert(digest_count <= PK11_DIGEST_MAX); -+ (void) memcpy(cipher_nids, local_cipher_nids, -+ sizeof (int) * cipher_count); -+ (void) memcpy(digest_nids, local_digest_nids, -+ sizeof (int) * digest_count); -+ } -+ } -+ -+static void pk11_get_symmetric_cipher(CK_FUNCTION_LIST_PTR pflist, -+ int slot_id, int *current_slot_n_cipher, int *local_cipher_nids, -+ PK11_CIPHER *cipher) -+ { -+ static CK_MECHANISM_INFO mech_info; -+ static CK_RV rv; -+ static CK_MECHANISM_TYPE last_checked_mech = (CK_MECHANISM_TYPE)-1; -+ -+ OPENSSL_assert(cipher->mech_type != (CK_MECHANISM_TYPE)-1); -+ -+ DEBUG_SLOT_SEL("%s: checking mech: %x", PK11_DBG, cipher->mech_type); -+ if (cipher->mech_type != last_checked_mech) -+ { -+ rv = pflist->C_GetMechanismInfo(slot_id, cipher->mech_type, -+ &mech_info); -+ } -+ -+ last_checked_mech = cipher->mech_type; -+ -+ if (rv != CKR_OK) -+ { -+ DEBUG_SLOT_SEL(" not found\n"); -+ return; -+ } -+ -+ if ((mech_info.flags & CKF_ENCRYPT) && -+ (mech_info.flags & CKF_DECRYPT)) -+ { -+ if (mech_info.ulMinKeySize > cipher->min_key_len || -+ mech_info.ulMaxKeySize < cipher->max_key_len) -+ { -+ DEBUG_SLOT_SEL(" engine key size range <%i-%i> does not" -+ " match mech range <%lu-%lu>\n", -+ cipher->min_key_len, cipher->max_key_len, -+ mech_info.ulMinKeySize, mech_info.ulMaxKeySize); -+ return; -+ } -+#ifdef SOLARIS_HW_SLOT_SELECTION -+ if (nid_in_table(cipher->nid, hw_cnids)) -+#endif /* SOLARIS_HW_SLOT_SELECTION */ -+ { -+ DEBUG_SLOT_SEL(" usable\n"); -+ local_cipher_nids[(*current_slot_n_cipher)++] = -+ cipher->nid; -+ } -+#ifdef SOLARIS_HW_SLOT_SELECTION -+ else -+ { -+ DEBUG_SLOT_SEL( -+ " rejected, software implementation only\n"); -+ } -+#endif /* SOLARIS_HW_SLOT_SELECTION */ -+ } -+ else -+ { -+ DEBUG_SLOT_SEL(" unusable\n"); -+ } -+ -+ return; -+ } -+ -+static void pk11_get_digest(CK_FUNCTION_LIST_PTR pflist, int slot_id, -+ int *current_slot_n_digest, int *local_digest_nids, PK11_DIGEST *digest) -+ { -+ CK_MECHANISM_INFO mech_info; -+ CK_RV rv; -+ -+ DEBUG_SLOT_SEL("%s: checking mech: %x", PK11_DBG, digest->mech_type); -+ rv = pflist->C_GetMechanismInfo(slot_id, digest->mech_type, &mech_info); -+ -+ if (rv != CKR_OK) -+ { -+ DEBUG_SLOT_SEL(" not found\n"); -+ return; -+ } -+ -+ if (mech_info.flags & CKF_DIGEST) -+ { -+#ifdef SOLARIS_HW_SLOT_SELECTION -+ if (nid_in_table(digest->nid, hw_dnids)) -+#endif /* SOLARIS_HW_SLOT_SELECTION */ -+ { -+ DEBUG_SLOT_SEL(" usable\n"); -+ local_digest_nids[(*current_slot_n_digest)++] = -+ digest->nid; -+ } -+#ifdef SOLARIS_HW_SLOT_SELECTION -+ else -+ { -+ DEBUG_SLOT_SEL( -+ " rejected, software implementation only\n"); -+ } -+#endif /* SOLARIS_HW_SLOT_SELECTION */ -+ } -+ else -+ { -+ DEBUG_SLOT_SEL(" unusable\n"); -+ } -+ -+ return; -+ } -+ -+/* Find what symmetric ciphers this slot supports. */ -+static void pk11_find_symmetric_ciphers(CK_FUNCTION_LIST_PTR pflist, -+ CK_SLOT_ID current_slot, int *current_slot_n_cipher, int *local_cipher_nids) -+ { -+ int i; -+ -+ for (i = 0; i < PK11_CIPHER_MAX; ++i) -+ { -+ pk11_get_symmetric_cipher(pflist, current_slot, -+ current_slot_n_cipher, local_cipher_nids, &ciphers[i]); -+ } -+ } -+ -+/* Find what digest algorithms this slot supports. */ -+static void pk11_find_digests(CK_FUNCTION_LIST_PTR pflist, -+ CK_SLOT_ID current_slot, int *current_slot_n_digest, int *local_digest_nids) -+ { -+ int i; -+ -+ for (i = 0; i < PK11_DIGEST_MAX; ++i) -+ { -+ pk11_get_digest(pflist, current_slot, current_slot_n_digest, -+ local_digest_nids, &digests[i]); -+ } -+ } -+ -+#ifdef SOLARIS_HW_SLOT_SELECTION -+/* -+ * It would be great if we could use pkcs11_kernel directly since this library -+ * offers hardware slots only. That's the easiest way to achieve the situation -+ * where we use the hardware accelerators when present and OpenSSL native code -+ * otherwise. That presumes the fact that OpenSSL native code is faster than the -+ * code in the soft token. It's a logical assumption - Crypto Framework has some -+ * inherent overhead so going there for the software implementation of a -+ * mechanism should be logically slower in contrast to the OpenSSL native code, -+ * presuming that both implementations are of similar speed. For example, the -+ * soft token for AES is roughly three times slower than OpenSSL for 64 byte -+ * blocks and still 20% slower for 8KB blocks. So, if we want to ship products @@ Diff output truncated at 100000 characters. @@ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From dmichelsen at users.sourceforge.net Sat Mar 21 20:34:50 2015 From: dmichelsen at users.sourceforge.net (dmichelsen at users.sourceforge.net) Date: Sat, 21 Mar 2015 19:34:50 +0000 Subject: SF.net SVN: gar:[24742] csw/mgar/pkg/libffi/trunk Message-ID: <3l8XHT4FM3zGP@mail.opencsw.org> Revision: 24742 http://sourceforge.net/p/gar/code/24742 Author: dmichelsen Date: 2015-03-21 19:34:49 +0000 (Sat, 21 Mar 2015) Log Message: ----------- libffi/trunk: Get rid of include relocation Modified Paths: -------------- csw/mgar/pkg/libffi/trunk/Makefile Removed Paths: ------------- csw/mgar/pkg/libffi/trunk/files/0005-libffi.pc-should-point-at-opt-csw-include.patch csw/mgar/pkg/libffi/trunk/files/0006-Set-libdir-to-opt-csw-lib-ffi.patch Modified: csw/mgar/pkg/libffi/trunk/Makefile =================================================================== --- csw/mgar/pkg/libffi/trunk/Makefile 2015-03-21 16:22:22 UTC (rev 24741) +++ csw/mgar/pkg/libffi/trunk/Makefile 2015-03-21 19:34:49 UTC (rev 24742) @@ -39,21 +39,17 @@ # found at http://software.intel.com/en-us/forums/showthread.php?t=56652 # originally for icc, but at least get the stuff to compile # PATCHFILES += ffi64.c.patch -#PATCHFILES += 0005-libffi.pc-should-point-at-opt-csw-include.patch -#PATCHFILES += 0006-Set-libdir-to-opt-csw-lib-ffi.patch - PACKAGES += CSWlibffi6 -PKGFILES_CSWlibffi6 += $(call baseisadirs,$(libdir),libffi\.so\.6(\.\d+)*) SPKG_DESC_CSWlibffi6 += $(DESCRIPTION), libffi.so.6 - +PKGFILES_CSWlibffi6 += $(call pkgfiles_lib,libffi.so.6) RUNTIME_DEP_PKGS_CSWlibffi6 += CSWlibgcc-s1 PACKAGES += CSWlibffi-dev SPKG_DESC_CSWlibffi-dev = $(DESCRIPTION) - developer package +# PKGFILES is catchall RUNTIME_DEP_PKGS_CSWlibffi-dev += CSWlibffi6 - LICENSE = LICENSE BUILD64 = 1 @@ -66,8 +62,7 @@ CONFIGURE_ENV_PATH = $(PATH):/opt/csw/gnu # disabled because they need DejaGNU -#TEST_TARGET = check -TEST_TARGET = +SKIPTEST ?= 1 include gar/category.mk @@ -84,14 +79,3 @@ aclocal; \ automake) $(MAKECOOKIE) - -post-install-modulated: - ginstall -m 755 -d $(DESTDIR)$(libdir) - ginstall -d -m 755 $(DESTDIR)$(includedir) - # By default, libffi installer puts include files into a subdirectory under - # /opt/csw/lib, which makes the header files hard to find. We're moving - # them to /opt/csw/include. - gmv -v $(DESTDIR)$(libdir)/$(NAME)-$(VERSION)/include/* $(DESTDIR)$(includedir) - rmdir $(DESTDIR)$(libdir)/$(NAME)-$(VERSION)/include - rmdir $(DESTDIR)$(libdir)/$(NAME)-$(VERSION) - @$(MAKECOOKIE) Deleted: csw/mgar/pkg/libffi/trunk/files/0005-libffi.pc-should-point-at-opt-csw-include.patch =================================================================== --- csw/mgar/pkg/libffi/trunk/files/0005-libffi.pc-should-point-at-opt-csw-include.patch 2015-03-21 16:22:22 UTC (rev 24741) +++ csw/mgar/pkg/libffi/trunk/files/0005-libffi.pc-should-point-at-opt-csw-include.patch 2015-03-21 19:34:49 UTC (rev 24742) @@ -1,25 +0,0 @@ -From f67593e5e96dfc0becb3dc3a2272f4b3cabc4e13 Mon Sep 17 00:00:00 2001 -From: Maciej Blizinski -Date: Mon, 14 Mar 2011 08:07:09 +0100 -Subject: [PATCH] libffi.pc should point at /opt/csw/include - ---- - libffi.pc.in | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/libffi.pc.in b/libffi.pc.in -index c2e1c7b..5f0e9db 100644 ---- a/libffi.pc.in -+++ b/libffi.pc.in -@@ -1,7 +1,7 @@ - prefix=@prefix@ - exec_prefix=@exec_prefix@ - libdir=@libdir@ --includedir=${libdir}/@PACKAGE_NAME at -@PACKAGE_VERSION@/include -+includedir=${prefix}/include - - Name: @PACKAGE_NAME@ - Description: Library supporting Foreign Function Interfaces --- -1.7.3.2 - Deleted: csw/mgar/pkg/libffi/trunk/files/0006-Set-libdir-to-opt-csw-lib-ffi.patch =================================================================== --- csw/mgar/pkg/libffi/trunk/files/0006-Set-libdir-to-opt-csw-lib-ffi.patch 2015-03-21 16:22:22 UTC (rev 24741) +++ csw/mgar/pkg/libffi/trunk/files/0006-Set-libdir-to-opt-csw-lib-ffi.patch 2015-03-21 19:34:49 UTC (rev 24742) @@ -1,23 +0,0 @@ -From 003977c00c9523f4a3a913b40b1460eb718b5d0e Mon Sep 17 00:00:00 2001 -From: Maciej Blizinski -Date: Sat, 25 Jun 2011 19:18:48 +0200 -Subject: [PATCH] Set libdir to /opt/csw/lib/ffi. - ---- - libffi.pc.in | 2 +- - 1 files changed, 1 insertions(+), 1 deletions(-) - -diff --git a/libffi.pc.in b/libffi.pc.in -index 692296d..88391dc 100644 ---- a/libffi.pc.in -+++ b/libffi.pc.in -@@ -6,5 +6,5 @@ includedir=${prefix}/include - Name: @PACKAGE_NAME@ - Description: Library supporting Foreign Function Interfaces - Version: @PACKAGE_VERSION@ --Libs: -L${libdir} -lffi -+Libs: -L${libdir}/ffi -lffi - Cflags: -I${includedir} --- -1.7.5.4 - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From rmottola at opencsw.org Sat Mar 21 21:05:28 2015 From: rmottola at opencsw.org (Riccardo Mottola) Date: Sat, 21 Mar 2015 21:05:28 +0100 Subject: SF.net SVN: gar:[24742] csw/mgar/pkg/libffi/trunk In-Reply-To: <3l8XHT4FM3zGP@mail.opencsw.org> References: <3l8XHT4FM3zGP@mail.opencsw.org> Message-ID: <550DCF08.2010609@opencsw.org> Hi Dago, did you with this patch finalize the removal of the special relocation of libffi.so ? I had a much easier patch but in case I throw it away for yours. Did you build & installed also the packages? I didn't see the emal for that. Riccardo dmichelsen at users.sourceforge.net wrote: > Revision: 24742 > http://sourceforge.net/p/gar/code/24742 > Author: dmichelsen > Date: 2015-03-21 19:34:49 +0000 (Sat, 21 Mar 2015) > Log Message: > ----------- > libffi/trunk: Get rid of include relocation > > Modified Paths: > -------------- > csw/mgar/pkg/libffi/trunk/Makefile > > Removed Paths: > ------------- > csw/mgar/pkg/libffi/trunk/files/0005-libffi.pc-should-point-at-opt-csw-include.patch > csw/mgar/pkg/libffi/trunk/files/0006-Set-libdir-to-opt-csw-lib-ffi.patch > > Modified: csw/mgar/pkg/libffi/trunk/Makefile > =================================================================== > --- csw/mgar/pkg/libffi/trunk/Makefile 2015-03-21 16:22:22 UTC (rev 24741) > +++ csw/mgar/pkg/libffi/trunk/Makefile 2015-03-21 19:34:49 UTC (rev 24742) > @@ -39,21 +39,17 @@ > # found at http://software.intel.com/en-us/forums/showthread.php?t=56652 > # originally for icc, but at least get the stuff to compile > # PATCHFILES += ffi64.c.patch > -#PATCHFILES += 0005-libffi.pc-should-point-at-opt-csw-include.patch > -#PATCHFILES += 0006-Set-libdir-to-opt-csw-lib-ffi.patch > > - > PACKAGES += CSWlibffi6 > -PKGFILES_CSWlibffi6 += $(call baseisadirs,$(libdir),libffi\.so\.6(\.\d+)*) > SPKG_DESC_CSWlibffi6 += $(DESCRIPTION), libffi.so.6 > - > +PKGFILES_CSWlibffi6 += $(call pkgfiles_lib,libffi.so.6) > RUNTIME_DEP_PKGS_CSWlibffi6 += CSWlibgcc-s1 > > PACKAGES += CSWlibffi-dev > SPKG_DESC_CSWlibffi-dev = $(DESCRIPTION) - developer package > +# PKGFILES is catchall > RUNTIME_DEP_PKGS_CSWlibffi-dev += CSWlibffi6 > > - > LICENSE = LICENSE > > BUILD64 = 1 > @@ -66,8 +62,7 @@ > CONFIGURE_ENV_PATH = $(PATH):/opt/csw/gnu > > # disabled because they need DejaGNU > -#TEST_TARGET = check > -TEST_TARGET = > +SKIPTEST ?= 1 > > include gar/category.mk > > @@ -84,14 +79,3 @@ > aclocal; \ > automake) > $(MAKECOOKIE) > - > -post-install-modulated: > - ginstall -m 755 -d $(DESTDIR)$(libdir) > - ginstall -d -m 755 $(DESTDIR)$(includedir) > - # By default, libffi installer puts include files into a subdirectory under > - # /opt/csw/lib, which makes the header files hard to find. We're moving > - # them to /opt/csw/include. > - gmv -v $(DESTDIR)$(libdir)/$(NAME)-$(VERSION)/include/* $(DESTDIR)$(includedir) > - rmdir $(DESTDIR)$(libdir)/$(NAME)-$(VERSION)/include > - rmdir $(DESTDIR)$(libdir)/$(NAME)-$(VERSION) > - @$(MAKECOOKIE) > > Deleted: csw/mgar/pkg/libffi/trunk/files/0005-libffi.pc-should-point-at-opt-csw-include.patch > =================================================================== > --- csw/mgar/pkg/libffi/trunk/files/0005-libffi.pc-should-point-at-opt-csw-include.patch 2015-03-21 16:22:22 UTC (rev 24741) > +++ csw/mgar/pkg/libffi/trunk/files/0005-libffi.pc-should-point-at-opt-csw-include.patch 2015-03-21 19:34:49 UTC (rev 24742) > @@ -1,25 +0,0 @@ > -From f67593e5e96dfc0becb3dc3a2272f4b3cabc4e13 Mon Sep 17 00:00:00 2001 > -From: Maciej Blizinski > -Date: Mon, 14 Mar 2011 08:07:09 +0100 > -Subject: [PATCH] libffi.pc should point at /opt/csw/include > - > ---- > - libffi.pc.in | 2 +- > - 1 files changed, 1 insertions(+), 1 deletions(-) > - > -diff --git a/libffi.pc.in b/libffi.pc.in > -index c2e1c7b..5f0e9db 100644 > ---- a/libffi.pc.in > -+++ b/libffi.pc.in > -@@ -1,7 +1,7 @@ > - prefix=@prefix@ > - exec_prefix=@exec_prefix@ > - libdir=@libdir@ > --includedir=${libdir}/@PACKAGE_NAME at -@PACKAGE_VERSION@/include > -+includedir=${prefix}/include > - > - Name: @PACKAGE_NAME@ > - Description: Library supporting Foreign Function Interfaces > --- > -1.7.3.2 > - > > Deleted: csw/mgar/pkg/libffi/trunk/files/0006-Set-libdir-to-opt-csw-lib-ffi.patch > =================================================================== > --- csw/mgar/pkg/libffi/trunk/files/0006-Set-libdir-to-opt-csw-lib-ffi.patch 2015-03-21 16:22:22 UTC (rev 24741) > +++ csw/mgar/pkg/libffi/trunk/files/0006-Set-libdir-to-opt-csw-lib-ffi.patch 2015-03-21 19:34:49 UTC (rev 24742) > @@ -1,23 +0,0 @@ > -From 003977c00c9523f4a3a913b40b1460eb718b5d0e Mon Sep 17 00:00:00 2001 > -From: Maciej Blizinski > -Date: Sat, 25 Jun 2011 19:18:48 +0200 > -Subject: [PATCH] Set libdir to /opt/csw/lib/ffi. > - > ---- > - libffi.pc.in | 2 +- > - 1 files changed, 1 insertions(+), 1 deletions(-) > - > -diff --git a/libffi.pc.in b/libffi.pc.in > -index 692296d..88391dc 100644 > ---- a/libffi.pc.in > -+++ b/libffi.pc.in > -@@ -6,5 +6,5 @@ includedir=${prefix}/include > - Name: @PACKAGE_NAME@ > - Description: Library supporting Foreign Function Interfaces > - Version: @PACKAGE_VERSION@ > --Libs: -L${libdir} -lffi > -+Libs: -L${libdir}/ffi -lffi > - Cflags: -I${includedir} > --- > -1.7.5.4 > - > > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. > From dmichelsen at users.sourceforge.net Sun Mar 22 10:22:56 2015 From: dmichelsen at users.sourceforge.net (dmichelsen at users.sourceforge.net) Date: Sun, 22 Mar 2015 09:22:56 +0000 Subject: SF.net SVN: gar:[24743] csw/mgar/pkg/sudo/trunk Message-ID: <3l8tfx5Jlxzp6@mail.opencsw.org> Revision: 24743 http://sourceforge.net/p/gar/code/24743 Author: dmichelsen Date: 2015-03-22 09:22:56 +0000 (Sun, 22 Mar 2015) Log Message: ----------- sudo/trunk: Update to 1.8.13 Modified Paths: -------------- csw/mgar/pkg/sudo/trunk/Makefile csw/mgar/pkg/sudo/trunk/checksums Modified: csw/mgar/pkg/sudo/trunk/Makefile =================================================================== --- csw/mgar/pkg/sudo/trunk/Makefile 2015-03-21 19:34:49 UTC (rev 24742) +++ csw/mgar/pkg/sudo/trunk/Makefile 2015-03-22 09:22:56 UTC (rev 24743) @@ -2,7 +2,7 @@ # NAME = sudo -VERSION = 1.8.12 +VERSION = 1.8.13 GARTYPE = v2 EXTRA_MODULATORS = LDAP Modified: csw/mgar/pkg/sudo/trunk/checksums =================================================================== --- csw/mgar/pkg/sudo/trunk/checksums 2015-03-21 19:34:49 UTC (rev 24742) +++ csw/mgar/pkg/sudo/trunk/checksums 2015-03-22 09:22:56 UTC (rev 24743) @@ -1 +1 @@ -87558f3a55c62bc9244b19594f103ffa sudo-1.8.12.tar.gz +f61577ec330ad1bd504c0e2eec6ea2d8 sudo-1.8.13.tar.gz This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From cgrzemba at users.sourceforge.net Sun Mar 22 11:31:08 2015 From: cgrzemba at users.sourceforge.net (cgrzemba at users.sourceforge.net) Date: Sun, 22 Mar 2015 10:31:08 +0000 Subject: SF.net SVN: gar:[24745] csw/mgar/pkg/lang-python/python/branches/python-2. 7-dtrace Message-ID: <3l8w9g5WGFzs8@mail.opencsw.org> Revision: 24745 http://sourceforge.net/p/gar/code/24745 Author: cgrzemba Date: 2015-03-22 10:31:08 +0000 (Sun, 22 Mar 2015) Log Message: ----------- lang-python/python/branches/python-2.7-dtrace: add DFLAG for 32bit build Modified Paths: -------------- csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/Makefile csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/05-dtrace.patch Modified: csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/Makefile =================================================================== --- csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/Makefile 2015-03-22 09:38:10 UTC (rev 24744) +++ csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/Makefile 2015-03-22 10:31:08 UTC (rev 24745) @@ -100,6 +100,7 @@ BASECFLAGS = $(CFLAGS) EXTRA_COMMON_EXPORTS = BASECFLAGS +EXTRA_BUILD_ENV = DFLAGS=-32 # To fix https://www.opencsw.org/mantis/view.php?id=5040 LINKER_IGNORE = Modified: csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/05-dtrace.patch =================================================================== --- csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/05-dtrace.patch 2015-03-22 09:38:10 UTC (rev 24744) +++ csw/mgar/pkg/lang-python/python/branches/python-2.7-dtrace/files/05-dtrace.patch 2015-03-22 10:31:08 UTC (rev 24745) @@ -55,8 +55,8 @@ f->f_lineno = code->co_firstlineno; f->f_iblock = 0; ---- Python-2.7.8/Python/ceval.c.~1~ 2014-06-29 19:05:46.000000000 -0700 -+++ Python-2.7.8/Python/ceval.c 2014-07-17 20:39:49.843868592 -0700 +--- Python-2.7.6/Python/ceval.c.~1~ 2013-11-09 23:36:41.000000000 -0800 ++++ Python-2.7.6/Python/ceval.c 2014-05-14 13:04:01.334853206 -0700 @@ -19,6 +19,11 @@ #include @@ -69,7 +69,7 @@ #ifndef WITH_TSC #define READ_TIMESTAMP(var) -@@ -678,6 +683,55 @@ +@@ -672,6 +677,55 @@ NULL); } @@ -125,7 +125,7 @@ /* Interpreter main loop */ -@@ -689,9 +743,84 @@ +@@ -683,9 +737,84 @@ return PyEval_EvalFrameEx(f, 0); } @@ -210,7 +210,7 @@ #ifdef DXPAIRS int lastopcode = 0; #endif -@@ -916,6 +1045,11 @@ +@@ -910,6 +1039,11 @@ } } @@ -222,7 +222,7 @@ co = f->f_code; names = co->co_names; consts = co->co_consts; -@@ -2673,6 +2807,9 @@ +@@ -2660,6 +2794,9 @@ PyObject **sp; PCALL(PCALL_ALL); sp = stack_pointer; @@ -232,7 +232,7 @@ #ifdef WITH_TSC x = call_function(&sp, oparg, &intr0, &intr1); #else -@@ -2714,6 +2851,9 @@ +@@ -2701,6 +2838,9 @@ } else Py_INCREF(func); sp = stack_pointer; @@ -242,7 +242,7 @@ READ_TIMESTAMP(intr0); x = ext_do_call(func, &sp, flags, na, nk); READ_TIMESTAMP(intr1); -@@ -3014,6 +3154,10 @@ +@@ -3001,6 +3141,10 @@ /* pop frame */ exit_eval_frame: @@ -408,9 +408,9 @@ +#pragma D attributes Private/Private/Common provider python function +#pragma D attributes Evolving/Evolving/Common provider python name +#pragma D attributes Evolving/Evolving/Common provider python args ---- Python-2.7.7/Lib/test/test_sys.py.~1~ 2014-05-31 11:58:39.000000000 -0700 -+++ Python-2.7.7/Lib/test/test_sys.py 2014-06-02 10:44:39.318709539 -0700 -@@ -594,7 +594,7 @@ +--- Python-2.7.6/Lib/test/test_sys.py.~1~ 2013-11-09 23:36:40.000000000 -0800 ++++ Python-2.7.6/Lib/test/test_sys.py 2014-05-14 13:07:05.332748121 -0700 +@@ -612,7 +612,7 @@ nfrees = len(x.f_code.co_freevars) extras = x.f_code.co_stacksize + x.f_code.co_nlocals +\ ncells + nfrees - 1 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From dmichelsen at users.sourceforge.net Sun Mar 22 13:06:23 2015 From: dmichelsen at users.sourceforge.net (dmichelsen at users.sourceforge.net) Date: Sun, 22 Mar 2015 12:06:23 +0000 Subject: SF.net SVN: gar:[24746] csw/mgar/pkg/ansible/trunk Message-ID: <3l8yHX3x5Gzw2@mail.opencsw.org> Revision: 24746 http://sourceforge.net/p/gar/code/24746 Author: dmichelsen Date: 2015-03-22 12:06:23 +0000 (Sun, 22 Mar 2015) Log Message: ----------- ansible/trunk: Update to 1.8.4 Modified Paths: -------------- csw/mgar/pkg/ansible/trunk/Makefile csw/mgar/pkg/ansible/trunk/checksums Modified: csw/mgar/pkg/ansible/trunk/Makefile =================================================================== --- csw/mgar/pkg/ansible/trunk/Makefile 2015-03-22 10:31:08 UTC (rev 24745) +++ csw/mgar/pkg/ansible/trunk/Makefile 2015-03-22 12:06:23 UTC (rev 24746) @@ -1,5 +1,5 @@ NAME = ansible -VERSION = 1.8.3 +VERSION = 1.8.4 GARTYPE = v2 CATEGORIES = python Modified: csw/mgar/pkg/ansible/trunk/checksums =================================================================== --- csw/mgar/pkg/ansible/trunk/checksums 2015-03-22 10:31:08 UTC (rev 24745) +++ csw/mgar/pkg/ansible/trunk/checksums 2015-03-22 12:06:23 UTC (rev 24746) @@ -1 +1 @@ -aa59af402c2636e019a5edc6fc78142f ansible-1.8.3.tar.gz +e0bbf484e9fa49cd119f50ad65905978 ansible-1.8.4.tar.gz This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From cptsalek at users.sourceforge.net Sun Mar 22 13:09:08 2015 From: cptsalek at users.sourceforge.net (cptsalek at users.sourceforge.net) Date: Sun, 22 Mar 2015 12:09:08 +0000 Subject: SF.net SVN: gar:[24747] csw/mgar/pkg/syslog_ng/trunk Message-ID: <3l8yLq3NRzzyP@mail.opencsw.org> Revision: 24747 http://sourceforge.net/p/gar/code/24747 Author: cptsalek Date: 2015-03-22 12:09:07 +0000 (Sun, 22 Mar 2015) Log Message: ----------- syslog_ng/trunk: Update to Syslog-NG 3.6.2 major cleanup Modified Paths: -------------- csw/mgar/pkg/syslog_ng/trunk/Makefile csw/mgar/pkg/syslog_ng/trunk/checksums Added Paths: ----------- csw/mgar/pkg/syslog_ng/trunk/files/0001-Added-definition-for-htonll-and-ntohll.patch csw/mgar/pkg/syslog_ng/trunk/files/0002-Add-asprintf.patch csw/mgar/pkg/syslog_ng/trunk/files/0002-amqp_private.h Modified: csw/mgar/pkg/syslog_ng/trunk/Makefile =================================================================== --- csw/mgar/pkg/syslog_ng/trunk/Makefile 2015-03-22 12:06:23 UTC (rev 24746) +++ csw/mgar/pkg/syslog_ng/trunk/Makefile 2015-03-22 12:09:07 UTC (rev 24747) @@ -1,7 +1,7 @@ # $Id$ NAME = syslog-ng -VERSION = 3.5.3 +VERSION = 3.6.2 GARTYPE = v2 DESCRIPTION = A powerful syslogd replacement @@ -21,7 +21,10 @@ # Patch taken from # https://www.redhat.com/archives/open-scap-list/2011-May/msg00021.html -PATCHFILES += 0001-Add-substitute-for-getline-on-Solaris.patch +# PATCHFILES += 0001-Add-substitute-for-getline-on-Solaris.patch +# Solaris <11 does not contain ntohll() and htonll() +PATCHFILES += 0001-Added-definition-for-htonll-and-ntohll.patch +PATCHFILES += 0002-Add-asprintf.patch VENDOR_URL = http://www.balabit.com/network-security/syslog-ng/opensource-logging-system/ @@ -35,12 +38,20 @@ PACKAGING_PLATFORMS = solaris9-sparc solaris9-i386 PACKAGING_PLATFORMS += solaris10-sparc solaris10-i386 +# Need XPG4v2 for struct msghdr +EXTRA_CFLAGS += -D_XOPEN_SOURCE=1 -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__ +# ...and -XPG6 to allow C99 with the flags above +EXTRA_CFLAGS += -std=gnu99 -D_XPG6 +# We need id -u +CONFIGURE_ENV_PATH = /usr/xpg4/bin:$(PATH) + CONFIGURE_ARGS = $(DIRPATHS) CONFIGURE_ARGS += --enable-dynamic-linking CONFIGURE_ARGS += --enable-spoof-source=no CONFIGURE_ARGS += --enable-tcp-wrapper CONFIGURE_ARGS += --enable-ssl +BUILD_ARGS += V=1 GARCOMPILER = GNU TEST_SCRIPTS = @@ -63,13 +74,11 @@ RUNTIME_DEP_PKGS_CSWsyslog-ng += CSWlibssl1-0-0 RUNTIME_DEP_PKGS_CSWsyslog-ng += CSWlibwrap1 RUNTIME_DEP_PKGS_CSWsyslog-ng += CSWlibintl8 -RUNTIME_DEP_PKGS_CSWsyslog-ng += CSWlibuuid1 -RUNTIME_DEP_PKGS_CSWsyslog-ng += CSWlibgnutls28 # This is correct, zoneinfo is searched at # /usr/share/zoneinfo/ # /usr/share/lib/zoneinfo/ -CHECKPKG_OVERRIDES_CSWsyslog-ng += file-with-bad-content|/usr/share|root/opt/csw/lib/libsyslog-ng-3.5.3.so +CHECKPKG_OVERRIDES_CSWsyslog-ng += file-with-bad-content|/usr/share|root/opt/csw/lib/libsyslog-ng-3.6.so.0.0.0 # This is optional CHECKPKG_OVERRIDES_CSWsyslog-ng += missing-dependency|CSWperl @@ -106,18 +115,13 @@ # PKGFILES_CSWsyslog-ng-dev += /opt/csw/lib/libsyslog-ng.so # RUNTIME_DEP_PKGS_CSWsyslog-ng-dev += CSWlibsyslog-ng0 -# A reference to /usr/share/lib/zoneinfo -CHECKPKG_OVERRIDES_CSWsyslog-ng += file-with-bad-content|/usr/share|root/opt/csw/lib/libsyslog-ng.so.0.0.0 - # Not splitting the syslog-ng libraries. There are no known packages linking # to syslog's shared objects. CHECKPKG_OVERRIDES_CSWsyslog-ng += shared-lib-package-contains-so-symlink CHECKPKG_OVERRIDES_CSWsyslog-ng += shared-lib-pkgname-mismatch -CHECKPKG_OVERRIDES_CSWsyslog-ng += soname-equals-filename +# Needed on Sparc only +CHECKPKG_OVERRIDES_CSWsyslog-ng += surplus-dependency|CSWlibintl8 -# Missing TLS symbols -EXTRA_LINKER_FLAGS = -lgnutls - include gar/category.mk post-install-modulated: Modified: csw/mgar/pkg/syslog_ng/trunk/checksums =================================================================== --- csw/mgar/pkg/syslog_ng/trunk/checksums 2015-03-22 12:06:23 UTC (rev 24746) +++ csw/mgar/pkg/syslog_ng/trunk/checksums 2015-03-22 12:09:07 UTC (rev 24747) @@ -1 +1 @@ -4cc29efa55fc41e65c48ece9bc88f88b syslog-ng_3.5.3.tar.gz +6928e9be3499a2e9ae52ea8aa204b165 syslog-ng_3.6.2.tar.gz Added: csw/mgar/pkg/syslog_ng/trunk/files/0001-Added-definition-for-htonll-and-ntohll.patch =================================================================== --- csw/mgar/pkg/syslog_ng/trunk/files/0001-Added-definition-for-htonll-and-ntohll.patch (rev 0) +++ csw/mgar/pkg/syslog_ng/trunk/files/0001-Added-definition-for-htonll-and-ntohll.patch 2015-03-22 12:09:07 UTC (rev 24747) @@ -0,0 +1,39 @@ +From 2bb001058cb1f36642ba5604193ac9af4713fdc8 Mon Sep 17 00:00:00 2001 +From: Christian Walther +Date: Sat, 21 Mar 2015 20:52:12 +0100 +Subject: [PATCH] Added definition for htonll and ntohll + +--- + modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h | 16 ++++++++++++++++ + 1 file changed, 16 insertions(+) + +diff --git a/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h b/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h +index bbee792..7640218 100644 +--- a/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h ++++ b/modules/afamqp/rabbitmq-c/librabbitmq/amqp_private.h +@@ -33,6 +33,22 @@ + * ***** END LICENSE BLOCK ***** + */ + ++/* cwalther at opencsw.org: ++ * Fix missing htonll and ntohll by providing one. ++ * The following code is based on: ++ * https://web.archive.org/web/20090221024054/http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=5007142 ++ */ ++ ++#ifndef htonll ++#ifdef _BIG_ENDIAN ++#define htonll(x) (x) ++#define ntohll(x) (x) ++#else ++#define htonll(x) ((((uint64_t)htonl(x)) << 32) + htonl(x >> 32)) ++#define ntohll(x) ((((uint64_t)ntohl(x)) << 32) + ntohl(x >> 32)) ++#endif ++#endif ++ + #ifdef HAVE_CONFIG_H + #include "config.h" + #endif +-- +2.3.1 + Added: csw/mgar/pkg/syslog_ng/trunk/files/0002-Add-asprintf.patch =================================================================== --- csw/mgar/pkg/syslog_ng/trunk/files/0002-Add-asprintf.patch (rev 0) +++ csw/mgar/pkg/syslog_ng/trunk/files/0002-Add-asprintf.patch 2015-03-22 12:09:07 UTC (rev 24747) @@ -0,0 +1,98 @@ +From a5df4fa76caf2b468d4edf0cbb4a67f4639755cc Mon Sep 17 00:00:00 2001 +From: Christian Walther +Date: Sat, 21 Mar 2015 22:15:35 +0100 +Subject: [PATCH 2/2] Add asprintf + +--- + modules/afamqp/rabbitmq-c/tools/asprintf.h | 63 ++++++++++++++++++++++++++++++ + modules/afamqp/rabbitmq-c/tools/common.c | 4 ++ + 2 files changed, 67 insertions(+) + create mode 100644 modules/afamqp/rabbitmq-c/tools/asprintf.h + +diff --git a/modules/afamqp/rabbitmq-c/tools/asprintf.h b/modules/afamqp/rabbitmq-c/tools/asprintf.h +new file mode 100644 +index 0000000..dac119b +--- /dev/null ++++ b/modules/afamqp/rabbitmq-c/tools/asprintf.h +@@ -0,0 +1,63 @@ ++/* $Id$ */ ++ ++/* ++ * Copyright (c) 2006 Nicholas Marriott ++ * ++ * Permission to use, copy, modify, and distribute this software for any ++ * purpose with or without fee is hereby granted, provided that the above ++ * copyright notice and this permission notice appear in all copies. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES ++ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF ++ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ++ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ++ * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER ++ * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING ++ * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ++ */ ++ ++#include ++#include ++#ifdef HAVE_STDINT_H ++#include ++#else ++#include ++#endif ++#include ++ ++int ++asprintf(char **ret, const char *fmt, ...) ++{ ++ va_list ap; ++ int n; ++ ++ va_start(ap, fmt); ++ n = vasprintf(ret, fmt, ap); ++ va_end(ap); ++ ++ return (n); ++} ++ ++int ++vasprintf(char **ret, const char *fmt, va_list ap) ++{ ++ int n; ++ va_list ap2; ++ ++ va_copy(ap2, ap); ++ ++ if ((n = vsnprintf(NULL, 0, fmt, ap)) < 0) ++ goto error; ++ ++ *ret = malloc(n + 1); ++ if ((n = vsnprintf(*ret, n + 1, fmt, ap2)) < 0) { ++ free(*ret); ++ goto error; ++ } ++ ++ return (n); ++ ++error: ++ *ret = NULL; ++ return (-1); ++} +diff --git a/modules/afamqp/rabbitmq-c/tools/common.c b/modules/afamqp/rabbitmq-c/tools/common.c +index 70f3bca..9d01f43 100644 +--- a/modules/afamqp/rabbitmq-c/tools/common.c ++++ b/modules/afamqp/rabbitmq-c/tools/common.c +@@ -51,6 +51,10 @@ + #include "compat.h" + #endif + ++#ifndef asprintf ++#include "asprintf.h" ++#endif ++ + void die(const char *fmt, ...) + { + va_list ap; +-- +2.3.1 + Added: csw/mgar/pkg/syslog_ng/trunk/files/0002-amqp_private.h =================================================================== --- csw/mgar/pkg/syslog_ng/trunk/files/0002-amqp_private.h (rev 0) +++ csw/mgar/pkg/syslog_ng/trunk/files/0002-amqp_private.h 2015-03-22 12:09:07 UTC (rev 24747) @@ -0,0 +1,27 @@ +*** amqp_private.h.orig Sat Mar 21 20:07:11 2015 +--- amqp_private.h Sat Mar 21 20:09:29 2015 +*************** +*** 33,38 **** +--- 33,54 ---- + * ***** END LICENSE BLOCK ***** + */ + ++ /* cwalther at opencsw.org: ++ * Fix missing htonll and ntohll by providing one. ++ * The following code is based on: ++ * https://web.archive.org/web/20090221024054/http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=5007142 ++ */ ++ ++ #ifndef htonll ++ #ifdef _BIG_ENDIAN ++ #define htonll(x) (x) ++ #define ntohll(x) (x) ++ #else ++ #define htonll(x) ((((uint64_t)htonl(x)) << 32) + htonl(x >> 32)) ++ #define ntohll(x) ((((uint64_t)ntohl(x)) << 32) + ntohl(x >> 32)) ++ #endif ++ #endif ++ + #ifdef HAVE_CONFIG_H + #include "config.h" + #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From cptsalek at users.sourceforge.net Sun Mar 22 13:46:02 2015 From: cptsalek at users.sourceforge.net (cptsalek at users.sourceforge.net) Date: Sun, 22 Mar 2015 12:46:02 +0000 Subject: SF.net SVN: gar:[24748] csw/mgar/pkg/syslog_ng/trunk/Makefile Message-ID: <3l8z9H0Rz1z11w@mail.opencsw.org> Revision: 24748 http://sourceforge.net/p/gar/code/24748 Author: cptsalek Date: 2015-03-22 12:46:01 +0000 (Sun, 22 Mar 2015) Log Message: ----------- syslog_ng/trunk: Removed unused references from Makefile Modified Paths: -------------- csw/mgar/pkg/syslog_ng/trunk/Makefile Modified: csw/mgar/pkg/syslog_ng/trunk/Makefile =================================================================== --- csw/mgar/pkg/syslog_ng/trunk/Makefile 2015-03-22 12:09:07 UTC (rev 24747) +++ csw/mgar/pkg/syslog_ng/trunk/Makefile 2015-03-22 12:46:01 UTC (rev 24748) @@ -35,8 +35,8 @@ # Syslog links against glib2, which is packaged in different packages on # Solaris 9 and Solaris 10. Therefore, we need to build separately on 9 and # 10, and declare different dependencies. -PACKAGING_PLATFORMS = solaris9-sparc solaris9-i386 -PACKAGING_PLATFORMS += solaris10-sparc solaris10-i386 +# PACKAGING_PLATFORMS = solaris9-sparc solaris9-i386 +PACKAGING_PLATFORMS = solaris10-sparc solaris10-i386 # Need XPG4v2 for struct msghdr EXTRA_CFLAGS += -D_XOPEN_SOURCE=1 -D_XOPEN_SOURCE_EXTENDED=1 -D__EXTENSIONS__ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From wahwah at users.sourceforge.net Sun Mar 22 13:57:33 2015 From: wahwah at users.sourceforge.net (wahwah at users.sourceforge.net) Date: Sun, 22 Mar 2015 12:57:33 +0000 Subject: SF.net SVN: gar:[24749] csw/mgar/pkg/opencsw-manual/trunk/files Message-ID: <3l8zQl4jybz14Q@mail.opencsw.org> Revision: 24749 http://sourceforge.net/p/gar/code/24749 Author: wahwah Date: 2015-03-22 12:57:33 +0000 (Sun, 22 Mar 2015) Log Message: ----------- opencsw-manual/trunk: Index updates Modified Paths: -------------- csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/faq.rst csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/getting-started.rst csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/introduction.rst csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/migrating-from-blastwave-to-opencsw.rst csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/mirror-setup.rst csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/setup-behind-proxy.rst csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/setup-old-versions.rst csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/setup.rst csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/solaris-10-sparse-zones.rst csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/32-bit-and-64-bit.rst csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/about-documentation.rst csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/automated-release-process.rst csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/buildfarm-setup.rst csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/building-a-catalog.rst csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/catalog-releases.rst csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/releasing-stable.rst Modified: csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/faq.rst =================================================================== --- csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/faq.rst 2015-03-22 12:46:01 UTC (rev 24748) +++ csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/faq.rst 2015-03-22 12:57:33 UTC (rev 24749) @@ -2,6 +2,9 @@ Frequently Asked Questions -------------------------- +.. index:: + single: FAQ + Please provide me with a Solaris binary for . ======================================================== Modified: csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/getting-started.rst =================================================================== --- csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/getting-started.rst 2015-03-22 12:46:01 UTC (rev 24748) +++ csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/getting-started.rst 2015-03-22 12:57:33 UTC (rev 24749) @@ -4,6 +4,9 @@ Getting started --------------- +.. index:: + pair: pkgutil; setup + Solaris 10 and Solaris 11: :: @@ -16,6 +19,8 @@ Done! +Continue to :ref:`Full setup `, or: + More complex cases: - :ref:`installing without internet access ` @@ -28,4 +33,3 @@ - :ref:`setting up cryptographic verification ` - :ref:`selecting the catalog release ` -Continue to :ref:`Full setup `. Modified: csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/introduction.rst =================================================================== --- csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/introduction.rst 2015-03-22 12:46:01 UTC (rev 24748) +++ csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/introduction.rst 2015-03-22 12:57:33 UTC (rev 24749) @@ -29,10 +29,10 @@ As of April 2014: -* Solaris 11 ? can use OpenCSW packages thanks to the backward binary compatibility +* :index:`Solaris 11` ? can use OpenCSW packages thanks to the backward binary compatibility * **Solaris 10 ? is the main focus** -* Solaris 9 ? best effort, occasional updates -* Solaris 8 ? no package updates at all +* :index:`Solaris 9` ? most packages not updated any more +* :index:`Solaris 8` ? no package updates at all Mailing lists ============= Modified: csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/migrating-from-blastwave-to-opencsw.rst =================================================================== --- csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/migrating-from-blastwave-to-opencsw.rst 2015-03-22 12:46:01 UTC (rev 24748) +++ csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/migrating-from-blastwave-to-opencsw.rst 2015-03-22 12:57:33 UTC (rev 24749) @@ -2,7 +2,7 @@ Migrating from Blastwave to OpenCSW ----------------------------------- -You cannot mix Blastwave packages with OpenCSW packages. +You cannot mix :index:`Blastwave` packages with OpenCSW packages. You need to migrate your packages, which means you need to uninstall all Blastwave packages and install corresponding OpenCSW packages. Modified: csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/mirror-setup.rst =================================================================== --- csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/mirror-setup.rst 2015-03-22 12:46:01 UTC (rev 24748) +++ csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/mirror-setup.rst 2015-03-22 12:57:33 UTC (rev 24749) @@ -2,10 +2,13 @@ .. _setting-up-local-mirror: ----------------------------------- -Setting up a :index:`local mirror` ----------------------------------- +------------------------- +Setting up a local mirror +------------------------- +.. index:: + triplet: local; mirror; setup + Sometimes it is sufficient to simply use a mirror on the Internet. However, there are situations where a local mirror can be useful. When you have a lot of servers accessing the repository, want to control the package updates Modified: csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/setup-behind-proxy.rst =================================================================== --- csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/setup-behind-proxy.rst 2015-03-22 12:46:01 UTC (rev 24748) +++ csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/setup-behind-proxy.rst 2015-03-22 12:57:33 UTC (rev 24749) @@ -3,8 +3,8 @@ Behind a proxy ============== -You may need to specify a proxy with ``-x :``, be aware that there -are known issues with Squid and possibly other proxies:: +You may need to specify a :index:`proxy` with ``-x :``, be aware +that there are known issues with Squid and possibly other proxies:: pkgadd -x myproxy:3128 -d http://get.opencsw.org/now Modified: csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/setup-old-versions.rst =================================================================== --- csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/setup-old-versions.rst 2015-03-22 12:46:01 UTC (rev 24748) +++ csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/setup-old-versions.rst 2015-03-22 12:57:33 UTC (rev 24749) @@ -1,4 +1,7 @@ .. _old-solaris: +.. index:: + single: Solaris 8 + single: Solaris 9 Solaris 8 or 9 ============== Modified: csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/setup.rst =================================================================== --- csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/setup.rst 2015-03-22 12:46:01 UTC (rev 24748) +++ csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/setup.rst 2015-03-22 12:57:33 UTC (rev 24749) @@ -88,7 +88,7 @@ pkgutil ======= -pkgutil can use two configuration files: +:index:`pkgutil` can use two configuration files: - ``/etc/opt/csw/pkgutil.conf`` - ``/opt/csw/etc/pkgutil.conf`` @@ -99,7 +99,7 @@ and ``/etc/opt/csw`` for zone-specific setting. Both ``pkgutil.conf`` are identical on installation with all configuration options commented out, so you can just pick one for now. As a rule of thumb it is recommended to prefer the -more prominent ``/etc/opt/csw``. +more prominent ``/etc/opt/csw``. preserveconf Modified: csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/solaris-10-sparse-zones.rst =================================================================== --- csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/solaris-10-sparse-zones.rst 2015-03-22 12:46:01 UTC (rev 24748) +++ csw/mgar/pkg/opencsw-manual/trunk/files/for-administrators/solaris-10-sparse-zones.rst 2015-03-22 12:57:33 UTC (rev 24749) @@ -1,7 +1,10 @@ --------------------------------- -Solaris 10 :index:`sparse zones` --------------------------------- +.. index:: + pair: sparse; zones +----------------------- +Solaris 10 sparse zones +----------------------- + 1. set inherit-pkg-dir on ``/opt/csw`` 2. install OpenCSW packages in the global zone @@ -29,7 +32,7 @@ Otherwise your setup won't work with OpenCSW packages, because the CSWcas-* package family installs `class action scripts`_ into /usr. See the -`cswclassutils wants to write in /usr`_ thread for more information. +`cswclassutils wants to write in /usr`_ thread for more information. .. _class action scripts: http://wiki.opencsw.org/cswclassutils-package Modified: csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/32-bit-and-64-bit.rst =================================================================== --- csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/32-bit-and-64-bit.rst 2015-03-22 12:46:01 UTC (rev 24748) +++ csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/32-bit-and-64-bit.rst 2015-03-22 12:57:33 UTC (rev 24749) @@ -2,11 +2,17 @@ 32-bit and 64-bit packages -------------------------- +.. index:: + single: 32-bit + single: 64-bit + single: isaexec + single: BUILD64 + 64-bit binaries aren't always best ---------------------------------- -It's counter-intuitive, but :index:`64-bit` binaries are more memory-hungry and -often slower than 32-bit ones. It makes sense to build 64-bit binaries when: +It's counter-intuitive, but 64-bit binaries are more memory-hungry and often +slower than 32-bit ones. It makes sense to build 64-bit binaries when: * There's a measurable speed boost. * The application needs to access more than 2G of RAM. Modified: csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/about-documentation.rst =================================================================== --- csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/about-documentation.rst 2015-03-22 12:46:01 UTC (rev 24748) +++ csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/about-documentation.rst 2015-03-22 12:57:33 UTC (rev 24749) @@ -7,7 +7,7 @@ Introduction ------------ -There are 6 places for documentation at OpenCSW: +There are 6 places for :index:`documentation` at OpenCSW: * `OpenCSW wiki`_ .a.k.a. wikidot Modified: csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/automated-release-process.rst =================================================================== --- csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/automated-release-process.rst 2015-03-22 12:46:01 UTC (rev 24748) +++ csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/automated-release-process.rst 2015-03-22 12:57:33 UTC (rev 24749) @@ -1,4 +1,7 @@ .. $Id$ +.. index:: + pair: automated; release + single: csw-upload-pkg ------------------------- Automated release process @@ -90,5 +93,3 @@ `_ .. [#opencsw-future] `opencsw-future catalog tree `_ - - Modified: csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/buildfarm-setup.rst =================================================================== --- csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/buildfarm-setup.rst 2015-03-22 12:46:01 UTC (rev 24748) +++ csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/buildfarm-setup.rst 2015-03-22 12:57:33 UTC (rev 24749) @@ -1,4 +1,6 @@ .. $Id$ +.. index:: + pair: buildfarm; setup ---------------- Build-farm setup @@ -11,7 +13,7 @@ starting from a fresh Solaris 10 install and ends with a built package. It takes about 2-3h to complete. It covers the basic GAR setup. -A :index:`buildfarm` is a set of hosts where you can build Solaris packages. +A buildfarm is a set of hosts where you can build Solaris packages. You can connect Intel and SPARC hosts together to build a set of packages with one shell command. Modified: csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/building-a-catalog.rst =================================================================== --- csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/building-a-catalog.rst 2015-03-22 12:46:01 UTC (rev 24748) +++ csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/building-a-catalog.rst 2015-03-22 12:57:33 UTC (rev 24749) @@ -1,3 +1,6 @@ +.. index:: + pair: building; catalog + .. _building-a-catalog: -------------------------- Modified: csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/catalog-releases.rst =================================================================== --- csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/catalog-releases.rst 2015-03-22 12:46:01 UTC (rev 24748) +++ csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/catalog-releases.rst 2015-03-22 12:57:33 UTC (rev 24749) @@ -1,3 +1,6 @@ +.. index:: + pair: catalog; release + .. _catalog-releases: --------------- @@ -9,12 +12,12 @@ also see the README file on the OpenCSW master mirror [#opencsw-master-mirror]_. -* **:index:`unstable`** is a working catalog where package maintainers make changes at +* :index:`unstable` is a working catalog where package maintainers make changes at will. Updates to unstable are pushed every 10 minutes (April 2014). * **testing** is a symlink to a named release. It gets periodically updated from the unstable catalog. As of March 2014, it is done infrequently, by a human. -* **:index:`stable`** is a symlink to a named release. Once a stable release is made, it +* :index:`stable` is a symlink to a named release. Once a stable release is made, it is not updated unless there are important security updates to be pushed. References Modified: csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/releasing-stable.rst =================================================================== --- csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/releasing-stable.rst 2015-03-22 12:46:01 UTC (rev 24748) +++ csw/mgar/pkg/opencsw-manual/trunk/files/for-maintainers/releasing-stable.rst 2015-03-22 12:57:33 UTC (rev 24749) @@ -1,6 +1,9 @@ Releasing stable ================ +.. index:: + pair: stable, release + Gotchas ------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From maciej at opencsw.org Sun Mar 22 14:53:18 2015 From: maciej at opencsw.org (=?UTF-8?Q?Maciej_=28Matchek=29_Blizi=C5=84ski?=) Date: Sun, 22 Mar 2015 13:53:18 +0000 Subject: SF.net SVN: gar:[24742] csw/mgar/pkg/libffi/trunk In-Reply-To: <550DCF08.2010609@opencsw.org> References: <3l8XHT4FM3zGP@mail.opencsw.org> <550DCF08.2010609@opencsw.org> Message-ID: [+dam directly] 2015-03-21 20:05 GMT+00:00 Riccardo Mottola : > Hi Dago, > > did you with this patch finalize the removal of the special relocation of > libffi.so ? > I had a much easier patch but in case I throw it away for yours. > > Did you build & installed also the packages? I didn't see the emal for > that. > > Riccardo > > > > dmichelsen at users.sourceforge.net wrote: > >> Revision: 24742 >> http://sourceforge.net/p/gar/code/24742 >> Author: dmichelsen >> Date: 2015-03-21 19:34:49 +0000 (Sat, 21 Mar 2015) >> Log Message: >> ----------- >> libffi/trunk: Get rid of include relocation >> >> Modified Paths: >> -------------- >> csw/mgar/pkg/libffi/trunk/Makefile >> >> Removed Paths: >> ------------- >> csw/mgar/pkg/libffi/trunk/files/0005-libffi.pc-should- >> point-at-opt-csw-include.patch >> csw/mgar/pkg/libffi/trunk/files/0006-Set-libdir-to-opt- >> csw-lib-ffi.patch >> >> Modified: csw/mgar/pkg/libffi/trunk/Makefile >> =================================================================== >> --- csw/mgar/pkg/libffi/trunk/Makefile 2015-03-21 16:22:22 UTC (rev >> 24741) >> +++ csw/mgar/pkg/libffi/trunk/Makefile 2015-03-21 19:34:49 UTC (rev >> 24742) >> @@ -39,21 +39,17 @@ >> # found at http://software.intel.com/en-us/forums/showthread.php?t= >> 56652 >> # originally for icc, but at least get the stuff to compile >> # PATCHFILES += ffi64.c.patch >> -#PATCHFILES += 0005-libffi.pc-should-point-at-opt-csw-include.patch >> -#PATCHFILES += 0006-Set-libdir-to-opt-csw-lib-ffi.patch >> - >> PACKAGES += CSWlibffi6 >> -PKGFILES_CSWlibffi6 += $(call baseisadirs,$(libdir),libffi\. >> so\.6(\.\d+)*) >> SPKG_DESC_CSWlibffi6 += $(DESCRIPTION), libffi.so.6 >> - >> +PKGFILES_CSWlibffi6 += $(call pkgfiles_lib,libffi.so.6) >> RUNTIME_DEP_PKGS_CSWlibffi6 += CSWlibgcc-s1 >> PACKAGES += CSWlibffi-dev >> SPKG_DESC_CSWlibffi-dev = $(DESCRIPTION) - developer package >> +# PKGFILES is catchall >> RUNTIME_DEP_PKGS_CSWlibffi-dev += CSWlibffi6 >> - >> LICENSE = LICENSE >> BUILD64 = 1 >> @@ -66,8 +62,7 @@ >> CONFIGURE_ENV_PATH = $(PATH):/opt/csw/gnu >> # disabled because they need DejaGNU >> -#TEST_TARGET = check >> -TEST_TARGET = >> +SKIPTEST ?= 1 >> include gar/category.mk >> @@ -84,14 +79,3 @@ >> aclocal; \ >> automake) >> $(MAKECOOKIE) >> - >> -post-install-modulated: >> - ginstall -m 755 -d $(DESTDIR)$(libdir) >> - ginstall -d -m 755 $(DESTDIR)$(includedir) >> - # By default, libffi installer puts include files into a >> subdirectory under >> - # /opt/csw/lib, which makes the header files hard to find. We're >> moving >> - # them to /opt/csw/include. >> - gmv -v $(DESTDIR)$(libdir)/$(NAME)-$(VERSION)/include/* >> $(DESTDIR)$(includedir) >> - rmdir $(DESTDIR)$(libdir)/$(NAME)-$(VERSION)/include >> - rmdir $(DESTDIR)$(libdir)/$(NAME)-$(VERSION) >> - @$(MAKECOOKIE) >> >> Deleted: csw/mgar/pkg/libffi/trunk/files/0005-libffi.pc-should- >> point-at-opt-csw-include.patch >> =================================================================== >> --- csw/mgar/pkg/libffi/trunk/files/0005-libffi.pc-should-point-at-opt-csw-include.patch >> 2015-03-21 16:22:22 UTC (rev 24741) >> +++ csw/mgar/pkg/libffi/trunk/files/0005-libffi.pc-should-point-at-opt-csw-include.patch >> 2015-03-21 19:34:49 UTC (rev 24742) >> @@ -1,25 +0,0 @@ >> -From f67593e5e96dfc0becb3dc3a2272f4b3cabc4e13 Mon Sep 17 00:00:00 2001 >> -From: Maciej Blizinski >> -Date: Mon, 14 Mar 2011 08:07:09 +0100 >> -Subject: [PATCH] libffi.pc should point at /opt/csw/include >> - >> ---- >> - libffi.pc.in | 2 +- >> - 1 files changed, 1 insertions(+), 1 deletions(-) >> - >> -diff --git a/libffi.pc.in b/libffi.pc.in >> -index c2e1c7b..5f0e9db 100644 >> ---- a/libffi.pc.in >> -+++ b/libffi.pc.in >> -@@ -1,7 +1,7 @@ >> - prefix=@prefix@ >> - exec_prefix=@exec_prefix@ >> - libdir=@libdir@ >> --includedir=${libdir}/@PACKAGE_NAME at -@PACKAGE_VERSION@/include >> -+includedir=${prefix}/include >> - >> - Name: @PACKAGE_NAME@ >> - Description: Library supporting Foreign Function Interfaces >> --- >> -1.7.3.2 >> - >> >> Deleted: csw/mgar/pkg/libffi/trunk/files/0006-Set-libdir-to-opt- >> csw-lib-ffi.patch >> =================================================================== >> --- csw/mgar/pkg/libffi/trunk/files/0006-Set-libdir-to-opt-csw-lib-ffi.patch >> 2015-03-21 16:22:22 UTC (rev 24741) >> +++ csw/mgar/pkg/libffi/trunk/files/0006-Set-libdir-to-opt-csw-lib-ffi.patch >> 2015-03-21 19:34:49 UTC (rev 24742) >> @@ -1,23 +0,0 @@ >> -From 003977c00c9523f4a3a913b40b1460eb718b5d0e Mon Sep 17 00:00:00 2001 >> -From: Maciej Blizinski >> -Date: Sat, 25 Jun 2011 19:18:48 +0200 >> -Subject: [PATCH] Set libdir to /opt/csw/lib/ffi. >> - >> ---- >> - libffi.pc.in | 2 +- >> - 1 files changed, 1 insertions(+), 1 deletions(-) >> - >> -diff --git a/libffi.pc.in b/libffi.pc.in >> -index 692296d..88391dc 100644 >> ---- a/libffi.pc.in >> -+++ b/libffi.pc.in >> -@@ -6,5 +6,5 @@ includedir=${prefix}/include >> - Name: @PACKAGE_NAME@ >> - Description: Library supporting Foreign Function Interfaces >> - Version: @PACKAGE_VERSION@ >> --Libs: -L${libdir} -lffi >> -+Libs: -L${libdir}/ffi -lffi >> - Cflags: -I${includedir} >> --- >> -1.7.5.4 >> - >> >> This was sent by the SourceForge.net collaborative development platform, >> the world's largest Open Source development site. >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmichelsen at users.sourceforge.net Sun Mar 22 14:59:52 2015 From: dmichelsen at users.sourceforge.net (dmichelsen at users.sourceforge.net) Date: Sun, 22 Mar 2015 13:59:52 +0000 Subject: SF.net SVN: gar:[24751] csw/mgar/pkg/sudo/trunk Message-ID: <3l90pf2hcsz19Y@mail.opencsw.org> Revision: 24751 http://sourceforge.net/p/gar/code/24751 Author: dmichelsen Date: 2015-03-22 13:59:52 +0000 (Sun, 22 Mar 2015) Log Message: ----------- sudo/trunk: Add patch for bug690 Modified Paths: -------------- csw/mgar/pkg/sudo/trunk/Makefile Added Paths: ----------- csw/mgar/pkg/sudo/trunk/files/bug690.patch Modified: csw/mgar/pkg/sudo/trunk/Makefile =================================================================== --- csw/mgar/pkg/sudo/trunk/Makefile 2015-03-22 13:09:41 UTC (rev 24750) +++ csw/mgar/pkg/sudo/trunk/Makefile 2015-03-22 13:59:52 UTC (rev 24751) @@ -21,6 +21,10 @@ DISTFILES += sudo.conf.CSW DISTFILES += map.sudo +# Use patch until this is fixed: +# http://bugzilla.sudo.ws/show_bug.cgi?id=690 +PATCHFILES += bug690.patch + LICENSE = doc/LICENSE VENDOR_URL = http://www.sudo.ws Added: csw/mgar/pkg/sudo/trunk/files/bug690.patch =================================================================== --- csw/mgar/pkg/sudo/trunk/files/bug690.patch (rev 0) +++ csw/mgar/pkg/sudo/trunk/files/bug690.patch 2015-03-22 13:59:52 UTC (rev 24751) @@ -0,0 +1,68 @@ +diff -r 68bd7297137e lib/util/Makefile.in +--- a/lib/util/Makefile.in Sat Mar 21 15:41:59 2015 -0600 ++++ b/lib/util/Makefile.in Sun Mar 22 07:08:53 2015 -0600 +@@ -79,7 +79,7 @@ + + # Regression tests + TEST_PROGS = atofoo_test conf_test hltq_test parseln_test progname_test @COMPAT_TEST_PROGS@ +-TEST_LIBS = @LIBS@ @LIBINTL@ ++TEST_LIBS = @LIBS@ + TEST_LDFLAGS = @LDFLAGS@ + + # User and group ids the installed files should be "owned" by +@@ -136,9 +136,9 @@ + libsudo_util.la: $(LTOBJS) @LT_LDDEP@ + case "$(LT_LDFLAGS)" in \ + *-no-install*) \ +- $(LIBTOOL) --mode=link $(CC) -o $@ $(LDFLAGS) $(LT_LDFLAGS) $(LTOBJS) @LIBDL@ @LIBRT@;; \ ++ $(LIBTOOL) --mode=link $(CC) -o $@ $(LDFLAGS) $(LT_LDFLAGS) $(LTOBJS) @LIBINTL@ @LIBDL@ @LIBRT@;; \ + *) \ +- $(LIBTOOL) --mode=link $(CC) -o $@ $(LDFLAGS) $(SSP_LDFLAGS) $(LT_LDFLAGS) $(LTOBJS) -version-info $(SHLIB_VERSION) -rpath $(libexecdir)/sudo @LT_DEP_LIBS@ @LIBDL@ @LIBRT@;; \ ++ $(LIBTOOL) --mode=link $(CC) -o $@ $(LDFLAGS) $(SSP_LDFLAGS) $(LT_LDFLAGS) $(LTOBJS) -version-info $(SHLIB_VERSION) -rpath $(libexecdir)/sudo @LT_DEP_LIBS@ @LIBINTL@ @LIBDL@ @LIBRT@;; \ + esac + + siglist.c: mksiglist +diff -r 68bd7297137e plugins/sudoers/Makefile.in +--- a/plugins/sudoers/Makefile.in Sat Mar 21 15:41:59 2015 -0600 ++++ b/plugins/sudoers/Makefile.in Sun Mar 22 07:08:53 2015 -0600 +@@ -51,7 +51,7 @@ + + # Libraries + LT_LIBS = $(top_builddir)/lib/util/libsudo_util.la +-LIBS = $(LT_LIBS) @LIBINTL@ ++LIBS = $(LT_LIBS) + NET_LIBS = @NET_LIBS@ + SUDOERS_LIBS = @SUDOERS_LIBS@ @AFS_LIBS@ @GETGROUPS_LIB@ $(LIBS) $(NET_LIBS) @ZLIB@ @LIBMD@ + REPLAY_LIBS = @REPLAY_LIBS@ @ZLIB@ +diff -r 68bd7297137e src/Makefile.in +--- a/src/Makefile.in Sat Mar 21 15:41:59 2015 -0600 ++++ b/src/Makefile.in Sun Mar 22 07:08:53 2015 -0600 +@@ -37,7 +37,7 @@ + + # Libraries + LT_LIBS = $(top_builddir)/lib/util/libsudo_util.la +-LIBS = @LIBS@ @SUDO_LIBS@ @GETGROUPS_LIB@ @NET_LIBS@ @LIBINTL@ $(LT_LIBS) ++LIBS = @LIBS@ @SUDO_LIBS@ @GETGROUPS_LIB@ @NET_LIBS@ $(LT_LIBS) + + # C preprocessor flags + CPPFLAGS = -I$(incdir) -I$(top_builddir) -I. -I$(srcdir) -I$(top_srcdir) @CPPFLAGS@ +@@ -86,7 +86,7 @@ + RC_LINK=@RC_LINK@ + + TEST_PROGS = check_ttyname +-TEST_LIBS = @LIBS@ @LIBINTL@ $(LT_LIBS) ++TEST_LIBS = @LIBS@ $(LT_LIBS) + TEST_LDFLAGS = @LDFLAGS@ + + # OS dependent defines +@@ -133,8 +133,8 @@ + sudo_noexec.la: sudo_noexec.lo + $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(LT_LDFLAGS) $(SSP_LDFLAGS) -o $@ sudo_noexec.lo -module -avoid-version -rpath $(noexecdir) -shrext .so + +-sesh: $(SESH_OBJS) @LIBINTL@ $(LT_LIBS) +- $(LIBTOOL) --mode=link $(CC) -o $@ $(SESH_OBJS) $(LDFLAGS) $(PIE_LDFLAGS) $(SSP_LDFLAGS) @LIBINTL@ $(LIBS) ++sesh: $(SESH_OBJS) $(LT_LIBS) ++ $(LIBTOOL) --mode=link $(CC) -o $@ $(SESH_OBJS) $(LDFLAGS) $(PIE_LDFLAGS) $(SSP_LDFLAGS) $(LIBS) + + check_ttyname: $(CHECK_TTYNAME_OBJS) $(top_builddir)/lib/util/libsudo_util.la + $(LIBTOOL) --mode=link $(CC) -o $@ $(CHECK_TTYNAME_OBJS) $(TEST_LDFLAGS) $(PIE_LDFLAGS) $(SSP_LDFLAGS) $(TEST_LIBS) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From dmichelsen at users.sourceforge.net Sun Mar 22 15:05:02 2015 From: dmichelsen at users.sourceforge.net (dmichelsen at users.sourceforge.net) Date: Sun, 22 Mar 2015 14:05:02 +0000 Subject: SF.net SVN: opencsw:[683] buildfarm/bin/make-freeze-opencsw-future Message-ID: <3l90wQ2Vbkz1D1@mail.opencsw.org> Revision: 683 http://sourceforge.net/p/opencsw/code/683 Author: dmichelsen Date: 2015-03-22 14:05:02 +0000 (Sun, 22 Mar 2015) Log Message: ----------- make-freeze-opencsw-future: Initial commit Added Paths: ----------- buildfarm/bin/make-freeze-opencsw-future Added: buildfarm/bin/make-freeze-opencsw-future =================================================================== --- buildfarm/bin/make-freeze-opencsw-future (rev 0) +++ buildfarm/bin/make-freeze-opencsw-future 2015-03-22 14:05:02 UTC (rev 683) @@ -0,0 +1,52 @@ +#!/opt/csw/bin/perl + +use strict; +use warnings; + +my ($year,$month) = @ARGV; +my $date = "${year}${month}01"; + +my $base = "/export/mirror/opencsw-future/"; +mkdir( $base ); + +my @archs = (qw( sparc i386 )); +my @vers = (qw( 5.8 5.9 5.10 5.11 )); + +my $ok = 1; +# Make sure we have all catalogs +foreach my $a (@archs) { + foreach my $v (@vers) { + my $catalog = "/export/mirror/opencsw/distribution/allcatalogs/catalog-$a-$v-$date"; + if( ! -f $catalog ) { + print STDERR "The catalog '$catalog' is missing.\n"; + $ok = 0; + } + } +} + +my $freeze = "$base/snapshots"; +mkdir( $freeze ); + +my $fcurrent = "$freeze/${year}.${month}"; +mkdir( $fcurrent ) || die "Directory '$fcurrent' can not be created: $!" ; + +foreach my $a (@archs) { + mkdir "$fcurrent/$a"; + foreach my $v (@vers) { + mkdir "$fcurrent/$a/$v"; + system( "cp /export/mirror/opencsw/distribution/allcatalogs/catalog-$a-$v-$date $fcurrent/$a/$v/catalog"); + system( "cp /export/mirror/opencsw/distribution/allcatalogs/descriptions-$a-$v-$date $fcurrent/$a/$v/descriptions"); + # 9menu 1.8,REV=2006.05.19 CSW9menu 9menu-1.8,REV=2006.05.19-SunOS5.8-i386-CSW.pkg.gz 51eaeee15a71a4290789729feb956759 12196 CSWcommon none + open C, "$fcurrent/$a/$v/catalog"; + my $drop; $drop = ; $drop = ; $drop = ; + while( ) { + last if( /^-----/ ); + chomp; + s/#.*//; + next if( /^$/ ); + my ($cname, $rev, $pkgname, $fname, $md5sum, $size, $dep, $idep) = split; + link "$base/allpkgs/$fname", "$fcurrent/$a/$v/$fname" || print STDERR "Problem linking $fname: $!"; + } + close C; + } +} Property changes on: buildfarm/bin/make-freeze-opencsw-future ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From cptsalek at users.sourceforge.net Sun Mar 22 17:11:18 2015 From: cptsalek at users.sourceforge.net (cptsalek at users.sourceforge.net) Date: Sun, 22 Mar 2015 16:11:18 +0000 Subject: SF.net SVN: gar:[24752] csw/mgar/pkg/syslog_ng/trunk/files/syslog-ng.conf. CSW Message-ID: <3l93k92XKsz1H6@mail.opencsw.org> Revision: 24752 http://sourceforge.net/p/gar/code/24752 Author: cptsalek Date: 2015-03-22 16:11:17 +0000 (Sun, 22 Mar 2015) Log Message: ----------- syslog_ng/trunk: Update package default configuration file Modified Paths: -------------- csw/mgar/pkg/syslog_ng/trunk/files/syslog-ng.conf.CSW Modified: csw/mgar/pkg/syslog_ng/trunk/files/syslog-ng.conf.CSW =================================================================== --- csw/mgar/pkg/syslog_ng/trunk/files/syslog-ng.conf.CSW 2015-03-22 13:59:52 UTC (rev 24751) +++ csw/mgar/pkg/syslog_ng/trunk/files/syslog-ng.conf.CSW 2015-03-22 16:11:17 UTC (rev 24752) @@ -4,13 +4,12 @@ # it could be configured a lot smarter. # # See syslog-ng(8) and syslog-ng.conf(5) for more information. -# -# 20000925 gb at sysfive.com -options { sync (0); + at version: 3.6 + +options { flush_lines (0); time_reopen (10); log_fifo_size (1000); - long_hostnames (off); use_dns (no); use_fqdn (no); create_dirs (no); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. From wahwah at users.sourceforge.net Sun Mar 22 17:33:48 2015 From: wahwah at users.sourceforge.net (wahwah at users.sourceforge.net) Date: Sun, 22 Mar 2015 16:33:48 +0000 Subject: SF.net SVN: opencsw:[685] web/wordpresscsw/wp-content/themes/opencsw Message-ID: <3l94D91TTcz1LH@mail.opencsw.org> Revision: 685 http://sourceforge.net/p/opencsw/code/685 Author: wahwah Date: 2015-03-22 16:33:47 +0000 (Sun, 22 Mar 2015) Log Message: ----------- Improve the package page template Details: http://lists.opencsw.org/pipermail/maintainers/2015-March/019784.html 1. On package pages (opencsw.org/package/), remove all the links from the green navigation bar, except for the Home link. 2. Remove the "Actions" heading 3. Move "Contact maintainer" into the table above, place it right under "View bugs about " 4. Move "View files in package" into the table above 5. Add a copy/pasteable code which installs the package. Modified Paths: -------------- web/wordpresscsw/wp-content/themes/opencsw/header-package.php web/wordpresscsw/wp-content/themes/opencsw/package.php Modified: web/wordpresscsw/wp-content/themes/opencsw/header-package.php =================================================================== --- web/wordpresscsw/wp-content/themes/opencsw/header-package.php 2015-03-22 14:10:31 UTC (rev 684) +++ web/wordpresscsw/wp-content/themes/opencsw/header-package.php 2015-03-22 16:33:47 UTC (rev 685) @@ -48,7 +48,13 @@