diff options
author | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:20:04 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-10 03:20:04 +0200 |
commit | 1b8dfe266937a37a4c642f96ceb2347bf4c00a17 (patch) | |
tree | 0c6aab146bb3c82efd9c7846a9a4e70dcb0ec84f /meta-networking | |
download | meta-openembedded-1b8dfe266937a37a4c642f96ceb2347bf4c00a17.tar.gz |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta-networking')
308 files changed, 17092 insertions, 0 deletions
diff --git a/meta-networking/COPYING.MIT b/meta-networking/COPYING.MIT new file mode 100644 index 0000000000..fb950dc69f --- /dev/null +++ b/meta-networking/COPYING.MIT | |||
@@ -0,0 +1,17 @@ | |||
1 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
2 | of this software and associated documentation files (the "Software"), to deal | ||
3 | in the Software without restriction, including without limitation the rights | ||
4 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
5 | copies of the Software, and to permit persons to whom the Software is | ||
6 | furnished to do so, subject to the following conditions: | ||
7 | |||
8 | The above copyright notice and this permission notice shall be included in | ||
9 | all copies or substantial portions of the Software. | ||
10 | |||
11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
12 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
13 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
14 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
15 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
16 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
17 | THE SOFTWARE. | ||
diff --git a/meta-networking/MAINTAINERS b/meta-networking/MAINTAINERS new file mode 100644 index 0000000000..953e6035a5 --- /dev/null +++ b/meta-networking/MAINTAINERS | |||
@@ -0,0 +1,31 @@ | |||
1 | This file contains a list of maintainers for the meta-networking layer. | ||
2 | |||
3 | Please submit any patches against meta-networking to the OpenEmbedded | ||
4 | development mailing list (openembedded-devel@lists.openembedded.org) with | ||
5 | '[meta-networking]' in the subject. | ||
6 | |||
7 | When sending single patches, please use something like: | ||
8 | |||
9 | git send-email -1 -M \ | ||
10 | --to openembedded-devel@lists.openembedded.org \ | ||
11 | --subject-prefix=meta-networking][PATCH | ||
12 | |||
13 | You may also contact the maintainers directly. | ||
14 | |||
15 | Descriptions of section entries: | ||
16 | |||
17 | M: Mail patches to: FullName <address@domain> | ||
18 | F: Files and directories with wildcard patterns. | ||
19 | A trailing slash includes all files and subdirectory files. | ||
20 | F: recipes-devtools/ all files in and below recipes-devtools | ||
21 | F: recipes-selinux/* all files in recipes-selinux, but not below | ||
22 | One pattern per line. Multiple F: lines acceptable. | ||
23 | |||
24 | Please keep this list in alphabetical order. | ||
25 | |||
26 | Maintainers List (try to look for most precise areas first) | ||
27 | |||
28 | COMMON | ||
29 | M: Joe MacDonald <joe.macdonald@windriver.com> | ||
30 | F: conf | ||
31 | F: recipes-* | ||
diff --git a/meta-networking/README b/meta-networking/README new file mode 100644 index 0000000000..872b013cc8 --- /dev/null +++ b/meta-networking/README | |||
@@ -0,0 +1,28 @@ | |||
1 | meta-networking | ||
2 | =============== | ||
3 | |||
4 | This layer is intended to be a central point for networking-related | ||
5 | packages and configuration. It should be useful directly on top of | ||
6 | oe-core and compliments meta-openembedded. It should be primarily useful | ||
7 | to the following groups: | ||
8 | |||
9 | - Anyone building a small networking device (eg. a home router / | ||
10 | bridge / switch). | ||
11 | |||
12 | - Anyone wanting to add network services to their device (eg. | ||
13 | anything that might benefit from a small ftp/tftp server) | ||
14 | |||
15 | Dependencies | ||
16 | ------------ | ||
17 | |||
18 | This layer depends on: | ||
19 | |||
20 | URI: git://github.com/openembedded/oe-core.git | ||
21 | branch: master | ||
22 | revision: HEAD | ||
23 | |||
24 | Maintenance | ||
25 | ----------- | ||
26 | |||
27 | Please see the MAINTAINERS file for information on contacting the | ||
28 | maintainers of this layer, as well as instructions for submitting patches. | ||
diff --git a/meta-networking/conf/layer.conf b/meta-networking/conf/layer.conf new file mode 100644 index 0000000000..39c2cebf56 --- /dev/null +++ b/meta-networking/conf/layer.conf | |||
@@ -0,0 +1,18 @@ | |||
1 | # We have a conf and classes directory, add to BBPATH | ||
2 | BBPATH .= ":${LAYERDIR}" | ||
3 | |||
4 | # We have a packages directory, add to BBFILES | ||
5 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ | ||
6 | ${LAYERDIR}/recipes-*/*/*.bbappend" | ||
7 | |||
8 | BBFILE_COLLECTIONS += "networking-layer" | ||
9 | BBFILE_PATTERN_networking-layer := "^${LAYERDIR}/" | ||
10 | BBFILE_PRIORITY_networking-layer = "5" | ||
11 | |||
12 | # This should only be incremented on significant changes that will | ||
13 | # cause compatibility issues with other layers | ||
14 | LAYERVERSION_networking-layer = "1" | ||
15 | |||
16 | LAYERDEPENDS_networking-layer = "core" | ||
17 | |||
18 | LICENSE_PATH += "${LAYERDIR}/licenses" | ||
diff --git a/meta-networking/licenses/netperf b/meta-networking/licenses/netperf new file mode 100644 index 0000000000..3f3ceb2fc2 --- /dev/null +++ b/meta-networking/licenses/netperf | |||
@@ -0,0 +1,43 @@ | |||
1 | |||
2 | |||
3 | Copyright (C) 1993 Hewlett-Packard Company | ||
4 | ALL RIGHTS RESERVED. | ||
5 | |||
6 | The enclosed software and documentation includes copyrighted works | ||
7 | of Hewlett-Packard Co. For as long as you comply with the following | ||
8 | limitations, you are hereby authorized to (i) use, reproduce, and | ||
9 | modify the software and documentation, and to (ii) distribute the | ||
10 | software and documentation, including modifications, for | ||
11 | non-commercial purposes only. | ||
12 | |||
13 | 1. The enclosed software and documentation is made available at no | ||
14 | charge in order to advance the general development of | ||
15 | high-performance networking products. | ||
16 | |||
17 | 2. You may not delete any copyright notices contained in the | ||
18 | software or documentation. All hard copies, and copies in | ||
19 | source code or object code form, of the software or | ||
20 | documentation (including modifications) must contain at least | ||
21 | one of the copyright notices. | ||
22 | |||
23 | 3. The enclosed software and documentation has not been subjected | ||
24 | to testing and quality control and is not a Hewlett-Packard Co. | ||
25 | product. At a future time, Hewlett-Packard Co. may or may not | ||
26 | offer a version of the software and documentation as a product. | ||
27 | |||
28 | 4. THE SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS". | ||
29 | HEWLETT-PACKARD COMPANY DOES NOT WARRANT THAT THE USE, | ||
30 | REPRODUCTION, MODIFICATION OR DISTRIBUTION OF THE SOFTWARE OR | ||
31 | DOCUMENTATION WILL NOT INFRINGE A THIRD PARTY'S INTELLECTUAL | ||
32 | PROPERTY RIGHTS. HP DOES NOT WARRANT THAT THE SOFTWARE OR | ||
33 | DOCUMENTATION IS ERROR FREE. HP DISCLAIMS ALL WARRANTIES, | ||
34 | EXPRESS AND IMPLIED, WITH REGARD TO THE SOFTWARE AND THE | ||
35 | DOCUMENTATION. HP SPECIFICALLY DISCLAIMS ALL WARRANTIES OF | ||
36 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
37 | |||
38 | 5. HEWLETT-PACKARD COMPANY WILL NOT IN ANY EVENT BE LIABLE FOR ANY | ||
39 | DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES | ||
40 | (INCLUDING LOST PROFITS) RELATED TO ANY USE, REPRODUCTION, | ||
41 | MODIFICATION, OR DISTRIBUTION OF THE SOFTWARE OR DOCUMENTATION. | ||
42 | |||
43 | |||
diff --git a/meta-networking/recipes-connectivity/barnyard2/barnyard2-1.8/barnyard2-cross-fix.patch b/meta-networking/recipes-connectivity/barnyard2/barnyard2-1.8/barnyard2-cross-fix.patch new file mode 100644 index 0000000000..7b5a60c2c5 --- /dev/null +++ b/meta-networking/recipes-connectivity/barnyard2/barnyard2-1.8/barnyard2-cross-fix.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | Index: barnyard2-1.8/configure.in | ||
4 | =================================================================== | ||
5 | --- barnyard2-1.8.orig/configure.in 2010-08-03 15:12:06.000000000 +0400 | ||
6 | +++ barnyard2-1.8/configure.in 2010-08-03 15:13:46.000000000 +0400 | ||
7 | @@ -73,7 +73,7 @@ | ||
8 | # libpcap doesn't even LOOK at the timeout you give it under Linux | ||
9 | AC_DEFINE([PCAP_TIMEOUT_IGNORED],[1],[Define if pcap timeout is ignored]) | ||
10 | AC_SUBST(extra_incl) | ||
11 | - extra_incl="-I/usr/include/pcap" | ||
12 | + extra_incl="-I=/usr/include/pcap" | ||
13 | ;; | ||
14 | *-hpux10*|*-hpux11*) | ||
15 | AC_DEFINE([HPUX],[1],[Define if HP-UX 10 or 11]) | ||
16 | @@ -230,7 +230,7 @@ | ||
17 | # In case INADDR_NONE is not defined (like on Solaris) | ||
18 | have_inaddr_none="no" | ||
19 | AC_MSG_CHECKING([for INADDR_NONE]) | ||
20 | -AC_RUN_IFELSE( | ||
21 | +AC_COMPILE_IFELSE( | ||
22 | [AC_LANG_PROGRAM( | ||
23 | [[ | ||
24 | #include <sys/types.h> | ||
diff --git a/meta-networking/recipes-connectivity/barnyard2/barnyard2_1.8.bb b/meta-networking/recipes-connectivity/barnyard2/barnyard2_1.8.bb new file mode 100644 index 0000000000..14acdac66e --- /dev/null +++ b/meta-networking/recipes-connectivity/barnyard2/barnyard2_1.8.bb | |||
@@ -0,0 +1,18 @@ | |||
1 | DESCRIPTION = "Barnyard2 is a fork of the original barnyard project, designed specifically for Snort's new unified2 file format" | ||
2 | HOMEPAGE = "http://www.securixlive.com/barnyard2/" | ||
3 | LICENSE = "GPLv2" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=751419260aa954499f7abaabaa882bbe" | ||
5 | DEPENDS = "libpcap" | ||
6 | |||
7 | SRC_URI = " \ | ||
8 | http://www.securixlive.com/download/barnyard2/${BP}.tar.gz \ | ||
9 | file://barnyard2-cross-fix.patch \ | ||
10 | " | ||
11 | SRC_URI[md5sum] = "72fc6c490db6ea6a0f46c27d24998067" | ||
12 | SRC_URI[sha256sum] = "1abfe6530d721debd98921421722b02c844c289564730b1e85729e4915b2bb7a" | ||
13 | |||
14 | inherit autotools pkgconfig | ||
15 | |||
16 | EXTRA_OECONF = "--enable-prelude --enable-gre --without-mysql" | ||
17 | |||
18 | CONFFILES_${PN} = "${sysconfdir}/barnyard2.conf" | ||
diff --git a/meta-networking/recipes-connectivity/crda/crda_1.1.3.bb b/meta-networking/recipes-connectivity/crda/crda_1.1.3.bb new file mode 100644 index 0000000000..0bb899860b --- /dev/null +++ b/meta-networking/recipes-connectivity/crda/crda_1.1.3.bb | |||
@@ -0,0 +1,38 @@ | |||
1 | SUMMARY = "Wireless Central Regulatory Domain Agent" | ||
2 | HOMEPAGE = "http://wireless.kernel.org/en/developers/Regulatory/CRDA" | ||
3 | |||
4 | LICENSE = "ISC" | ||
5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=07c4f6dea3845b02a18dc00c8c87699c" | ||
6 | |||
7 | |||
8 | DEPENDS = "python-m2crypto-native python-native libgcrypt libnl" | ||
9 | |||
10 | SRC_URI = "http://wireless.kernel.org/download/crda/${BP}.tar.bz2;name=crda \ | ||
11 | http://wireless.kernel.org/download/wireless-regdb/regulatory.bins/2013.01.11-regulatory.bin;name=bin \ | ||
12 | " | ||
13 | SRC_URI[crda.md5sum] = "29579185e06a75675507527243d28e5c" | ||
14 | SRC_URI[crda.sha256sum] = "aa8a7fe92f0765986c421a5b6768a185375ac210393df0605ee132f6754825f0" | ||
15 | SRC_URI[bin.md5sum] = "e0c8a5ca63fb8bf803213f9a0c90b50b" | ||
16 | SRC_URI[bin.sha256sum] = "b1ee0b20c123c612dfdb6851ab42c01666f66fb583e0e590942f19bb54cf84be" | ||
17 | |||
18 | inherit python-dir pythonnative | ||
19 | # Recursive make problem | ||
20 | EXTRA_OEMAKE = "MAKEFLAGS= DESTDIR=${D}" | ||
21 | |||
22 | do_compile() { | ||
23 | oe_runmake all_noverify | ||
24 | } | ||
25 | |||
26 | do_install() { | ||
27 | oe_runmake SBINDIR=${sbindir}/ install | ||
28 | |||
29 | install -d ${D}${libdir}/crda/ | ||
30 | |||
31 | install -m 0644 ${WORKDIR}/2013.01.11-regulatory.bin ${D}${libdir}/crda/regulatory.bin | ||
32 | } | ||
33 | |||
34 | |||
35 | RDEPENDS_${PN} = "udev" | ||
36 | FILES_${PN} += "${libdir}crda/regulatory.bin \ | ||
37 | ${base_libdir}/udev/rules.d/85-regulatory.rules \ | ||
38 | " | ||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/disable-pre-ANSI-compilers.patch b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/disable-pre-ANSI-compilers.patch new file mode 100644 index 0000000000..a7fa61c798 --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/disable-pre-ANSI-compilers.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | disable pre-ANSI compilers | ||
4 | |||
5 | Signed-off-by: Chunrong Guo <b40290@freescale.com> | ||
6 | --- inetutils-1.9.1/configure.ac 2012-01-06 22:05:05.000000000 +0800 | ||
7 | +++ inetutils-1.9.1/configure.ac 2012-11-12 14:05:30.756957063 +0800 | ||
8 | @@ -586,7 +586,7 @@ | ||
9 | #include <arpa/tftp.h>]) | ||
10 | |||
11 | ### Checks for compiler characteristics. | ||
12 | -AM_C_PROTOTYPES dnl FIXME: Does inetutils even compile on pre-ANSI compilers? | ||
13 | +#AM_C_PROTOTYPES dnl FIXME: Does inetutils even compile on pre-ANSI compilers? | ||
14 | AC_C_CONST | ||
15 | |||
16 | dnl See if `weak refs' are possible; these make it possible (with shared | ||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/fix-disable-ipv6.patch b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/fix-disable-ipv6.patch new file mode 100644 index 0000000000..bd3ae476bd --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/fix-disable-ipv6.patch | |||
@@ -0,0 +1,60 @@ | |||
1 | Upstream: http://www.mail-archive.com/bug-inetutils@gnu.org/msg02103.html | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | diff -ur inetutils-1.8.orig/ping/ping_common.h inetutils-1.8/ping/ping_common.h | ||
6 | --- inetutils-1.8.orig/ping/ping_common.h 2010-05-15 20:55:47.000000000 +0930 | ||
7 | +++ inetutils-1.8/ping/ping_common.h 2010-12-01 12:19:08.000000000 +1030 | ||
8 | @@ -17,10 +17,14 @@ | ||
9 | You should have received a copy of the GNU General Public License | ||
10 | along with this program. If not, see `http://www.gnu.org/licenses/'. */ | ||
11 | |||
12 | +#include <config.h> | ||
13 | + | ||
14 | #include <netinet/in_systm.h> | ||
15 | #include <netinet/in.h> | ||
16 | #include <netinet/ip.h> | ||
17 | +#ifdef HAVE_IPV6 | ||
18 | #include <netinet/icmp6.h> | ||
19 | +#endif | ||
20 | #include <icmp.h> | ||
21 | #include <error.h> | ||
22 | #include <progname.h> | ||
23 | @@ -66,13 +70,19 @@ | ||
24 | (t).tv_usec = ((i)%PING_PRECISION)*(1000000/PING_PRECISION) ;\ | ||
25 | } while (0) | ||
26 | |||
27 | +#ifdef HAVE_IPV6 | ||
28 | /* Not sure about this step*/ | ||
29 | #define _PING_BUFLEN(p, USE_IPV6) ((USE_IPV6)? ((p)->ping_datalen + sizeof (struct icmp6_hdr)) : \ | ||
30 | ((p)->ping_datalen + sizeof (icmphdr_t))) | ||
31 | +#else | ||
32 | +#define _PING_BUFLEN(p, USE_IPV6) ((p)->ping_datalen + sizeof (icmphdr_t)) | ||
33 | +#endif | ||
34 | |||
35 | +#ifdef HAVE_IPV6 | ||
36 | typedef int (*ping_efp6) (int code, void *closure, struct sockaddr_in6 * dest, | ||
37 | struct sockaddr_in6 * from, struct icmp6_hdr * icmp, | ||
38 | int datalen); | ||
39 | +#endif | ||
40 | |||
41 | typedef int (*ping_efp) (int code, | ||
42 | void *closure, | ||
43 | @@ -81,13 +91,17 @@ | ||
44 | struct ip * ip, icmphdr_t * icmp, int datalen); | ||
45 | |||
46 | union event { | ||
47 | +#ifdef HAVE_IPV6 | ||
48 | ping_efp6 handler6; | ||
49 | +#endif | ||
50 | ping_efp handler; | ||
51 | }; | ||
52 | |||
53 | union ping_address { | ||
54 | struct sockaddr_in ping_sockaddr; | ||
55 | +#ifdef HAVE_IPV6 | ||
56 | struct sockaddr_in6 ping_sockaddr6; | ||
57 | +#endif | ||
58 | }; | ||
59 | |||
60 | typedef struct ping_data PING; | ||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch new file mode 100644 index 0000000000..3da4e9f55a --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | From 552a7d64ad4a7188a9b7cd89933ae7caf7ebfe90 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mike Frysinger <vapier at gentoo.org> | ||
3 | Date: Thu, 18 Nov 2010 16:59:14 -0500 | ||
4 | Subject: [PATCH gnulib] printf-parse: pull in features.h for __GLIBC__ | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Mike Frysinger <vapier at gentoo.org> | ||
9 | --- | ||
10 | lib/printf-parse.h | 3 +++ | ||
11 | 1 files changed, 3 insertions(+), 0 deletions(-) | ||
12 | |||
13 | diff --git a/lib/printf-parse.h b/lib/printf-parse.h | ||
14 | index 67a4a2a..3bd6152 100644 | ||
15 | --- a/lib/printf-parse.h | ||
16 | +++ b/lib/printf-parse.h | ||
17 | @@ -25,6 +25,9 @@ | ||
18 | |||
19 | #include "printf-args.h" | ||
20 | |||
21 | +#ifdef HAVE_FEATURES_H | ||
22 | +# include <features.h> /* for __GLIBC__ */ | ||
23 | +#endif | ||
24 | |||
25 | /* Flags */ | ||
26 | #define FLAG_GROUP 1 /* ' flag */ | ||
27 | -- | ||
28 | 1.7.3.2 | ||
29 | |||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/inetutils-1.8-0003-wchar.patch b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/inetutils-1.8-0003-wchar.patch new file mode 100644 index 0000000000..b13bb9229f --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/inetutils-1.8-0003-wchar.patch | |||
@@ -0,0 +1,14 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | --- inetutils-1.8/lib/wchar.in.h | ||
4 | +++ inetutils-1.8/lib/wchar.in.h | ||
5 | @@ -70,6 +70,9 @@ | ||
6 | /* The include_next requires a split double-inclusion guard. */ | ||
7 | #if @HAVE_WCHAR_H@ | ||
8 | # @INCLUDE_NEXT@ @NEXT_WCHAR_H@ | ||
9 | +#else | ||
10 | +# include <stddef.h> | ||
11 | +# define MB_CUR_MAX 1 | ||
12 | #endif | ||
13 | |||
14 | #undef _GL_ALREADY_INCLUDING_WCHAR_H | ||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/inetutils-1.9-PATH_PROCNET_DEV.patch b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/inetutils-1.9-PATH_PROCNET_DEV.patch new file mode 100644 index 0000000000..2592989a90 --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/inetutils-1.9-PATH_PROCNET_DEV.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | inetutils: define PATH_PROCNET_DEV if not already defined | ||
2 | |||
3 | this prevents the following compilation error : | ||
4 | system/linux.c:401:15: error: 'PATH_PROCNET_DEV' undeclared (first use in this function) | ||
5 | |||
6 | this patch comes from : | ||
7 | http://repository.timesys.com/buildsources/i/inetutils/inetutils-1.9/ | ||
8 | |||
9 | Upstream-Status: Inappropriate [not author] | ||
10 | |||
11 | Signed-of-by: Eric Bénard <eric@eukrea.com> | ||
12 | --- | ||
13 | diff -Naur inetutils-1.9.orig/ifconfig/system/linux.c inetutils-1.9/ifconfig/system/linux.c | ||
14 | --- inetutils-1.9.orig/ifconfig/system/linux.c 2012-01-04 16:31:36.000000000 -0500 | ||
15 | +++ inetutils-1.9/ifconfig/system/linux.c 2012-01-04 16:40:53.000000000 -0500 | ||
16 | @@ -49,6 +49,10 @@ | ||
17 | #include "../ifconfig.h" | ||
18 | |||
19 | |||
20 | +#ifndef PATH_PROCNET_DEV | ||
21 | + #define PATH_PROCNET_DEV "/proc/net/dev" | ||
22 | +#endif | ||
23 | + | ||
24 | /* ARPHRD stuff. */ | ||
25 | |||
26 | static void | ||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/remove-gets.patch b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/remove-gets.patch new file mode 100644 index 0000000000..61d16e3a74 --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/remove-gets.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | Uptream-Status: Pending | ||
2 | |||
3 | remove gets function | ||
4 | |||
5 | Signed-off-by: Chunrong Guo <b40290@freescale.com> | ||
6 | --- inetutils-1.9.1.org/lib/stdio.in.h 2012-01-06 22:11:13.000000000 +0800 | ||
7 | +++ inetutils-1.9.1/lib/stdio.in.h 2012-11-12 14:30:49.044958001 +0800 | ||
8 | @@ -715,9 +715,13 @@ | ||
9 | /* It is very rare that the developer ever has full control of stdin, | ||
10 | so any use of gets warrants an unconditional warning. Assume it is | ||
11 | always declared, since it is required by C89. */ | ||
12 | +#if defined gets | ||
13 | +#undef gets | ||
14 | _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead"); | ||
15 | #endif | ||
16 | |||
17 | +#endif | ||
18 | + | ||
19 | |||
20 | #if @GNULIB_OBSTACK_PRINTF@ || @GNULIB_OBSTACK_PRINTF_POSIX@ | ||
21 | struct obstack; | ||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/rexec.xinetd.inetutils b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/rexec.xinetd.inetutils new file mode 100644 index 0000000000..80aed36ffb --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/rexec.xinetd.inetutils | |||
@@ -0,0 +1,20 @@ | |||
1 | # default: off | ||
2 | # description: | ||
3 | # Rexecd is the server for the rexec program. The server provides remote | ||
4 | # execution facilities with authentication based on user names and | ||
5 | # passwords. | ||
6 | # | ||
7 | service exec | ||
8 | { | ||
9 | socket_type = stream | ||
10 | protocol = tcp | ||
11 | flags = NAMEINARGS | ||
12 | wait = no | ||
13 | user = root | ||
14 | group = root | ||
15 | log_on_success += USERID | ||
16 | log_on_failure += USERID | ||
17 | server = /usr/bin/tcpd | ||
18 | server_args = /usr/sbin/in.rexecd | ||
19 | disable = yes | ||
20 | } | ||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/rlogin.xinetd.inetutils b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/rlogin.xinetd.inetutils new file mode 100644 index 0000000000..00dbf935bb --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/rlogin.xinetd.inetutils | |||
@@ -0,0 +1,23 @@ | |||
1 | # default: off | ||
2 | # description: | ||
3 | # Rlogind is a server for the rlogin program. The server provides remote | ||
4 | # execution with authentication based on privileged port numbers from trusted | ||
5 | # host | ||
6 | # | ||
7 | service login | ||
8 | { | ||
9 | socket_type = stream | ||
10 | protocol = tcp | ||
11 | flags = NAMEINARGS | ||
12 | wait = no | ||
13 | user = root | ||
14 | group = root | ||
15 | log_on_success += USERID | ||
16 | log_on_failure += USERID | ||
17 | server = /usr/bin/tcpd | ||
18 | server_args = /usr/sbin/in.rlogind -a | ||
19 | disable = yes | ||
20 | } | ||
21 | |||
22 | |||
23 | |||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/rsh.xinetd.inetutils b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/rsh.xinetd.inetutils new file mode 100644 index 0000000000..ad59b62076 --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/rsh.xinetd.inetutils | |||
@@ -0,0 +1,21 @@ | |||
1 | # default: off | ||
2 | # description: | ||
3 | # The rshd server is a server for the rcmd(3) routine and, | ||
4 | # consequently, for the rsh(1) program. The server provides | ||
5 | # remote execution facilities with authentication based on | ||
6 | # privileged port numbers from trusted hosts. | ||
7 | # | ||
8 | service shell | ||
9 | { | ||
10 | socket_type = stream | ||
11 | protocol = tcp | ||
12 | flags = NAMEINARGS | ||
13 | wait = no | ||
14 | user = root | ||
15 | group = root | ||
16 | log_on_success += USERID | ||
17 | log_on_failure += USERID | ||
18 | server = /usr/bin/tcpd | ||
19 | server_args = /usr/sbin/in.rshd -aL | ||
20 | disable = yes | ||
21 | } | ||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/telnet.xinetd.inetutils b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/telnet.xinetd.inetutils new file mode 100644 index 0000000000..2a2a12e3ad --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/telnet.xinetd.inetutils | |||
@@ -0,0 +1,13 @@ | |||
1 | # default: on | ||
2 | # description: The telnet server serves telnet sessions; it uses \ | ||
3 | # unencrypted username/password pairs for authentication. | ||
4 | service telnet | ||
5 | { | ||
6 | disable = no | ||
7 | flags = REUSE | ||
8 | socket_type = stream | ||
9 | wait = no | ||
10 | user = root | ||
11 | server = /usr/sbin/in.telnetd | ||
12 | log_on_failure += USERID | ||
13 | } | ||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/tftpd.xinetd.inetutils b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/tftpd.xinetd.inetutils new file mode 100644 index 0000000000..f549163394 --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/tftpd.xinetd.inetutils | |||
@@ -0,0 +1,19 @@ | |||
1 | # default: off | ||
2 | # description: | ||
3 | # Tftpd is a server which supports the Internet Trivial File Transfer | ||
4 | # Pro-tocol (RFC 783). The TFTP server operates at the port indicated | ||
5 | # in the tftp service description; see services(5). | ||
6 | # | ||
7 | service tftp | ||
8 | { | ||
9 | disable = yes | ||
10 | socket_type = dgram | ||
11 | protocol = udp | ||
12 | flags = IPv6 | ||
13 | wait = yes | ||
14 | user = root | ||
15 | group = root | ||
16 | server = /usr/sbin/in.tftpd | ||
17 | server_args = /tftpboot | ||
18 | } | ||
19 | |||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/version.patch b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/version.patch new file mode 100644 index 0000000000..ac3181ddb2 --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils-1.9.1/version.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | remove m4_esyscmd function | ||
4 | |||
5 | Signed-off-by: Chunrong Guo <b40290@freescale.com> | ||
6 | --- inetutils-1.9.1/configure.ac 2012-01-06 22:05:05.000000000 +0800 | ||
7 | +++ inetutils-1.9.1/configure.ac 2012-11-12 14:01:11.732957019 +0800 | ||
8 | @@ -20,8 +20,7 @@ | ||
9 | |||
10 | AC_PREREQ(2.59) | ||
11 | |||
12 | -AC_INIT([GNU inetutils], | ||
13 | - m4_esyscmd([build-aux/git-version-gen .tarball-version 's/inetutils-/v/;s/_/./g']), | ||
14 | +AC_INIT([GNU inetutils],[1.9.1], | ||
15 | [bug-inetutils@gnu.org]) | ||
16 | |||
17 | AC_CONFIG_SRCDIR([src/inetd.c]) | ||
diff --git a/meta-networking/recipes-connectivity/inetutils/inetutils_1.9.1.bb b/meta-networking/recipes-connectivity/inetutils/inetutils_1.9.1.bb new file mode 100644 index 0000000000..0e47015c0e --- /dev/null +++ b/meta-networking/recipes-connectivity/inetutils/inetutils_1.9.1.bb | |||
@@ -0,0 +1,172 @@ | |||
1 | DESCRIPTION = "The GNU inetutils are a collection of common \ | ||
2 | networking utilities and servers including ftp, ftpd, rcp, \ | ||
3 | rexec, rlogin, rlogind, rsh, rshd, syslog, syslogd, talk, \ | ||
4 | talkd, telnet, telnetd, tftp, tftpd, and uucpd." | ||
5 | SECTION = "libs" | ||
6 | DEPENDS = "ncurses netbase readline" | ||
7 | LICENSE = "GPLv3" | ||
8 | |||
9 | LIC_FILES_CHKSUM = "file://COPYING;md5=0c7051aef9219dc7237f206c5c4179a7" | ||
10 | |||
11 | PR = "r1" | ||
12 | SRC_URI = "${GNU_MIRROR}/inetutils/inetutils-${PV}.tar.gz \ | ||
13 | file://disable-pre-ANSI-compilers.patch \ | ||
14 | file://version.patch \ | ||
15 | file://remove-gets.patch \ | ||
16 | file://inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch \ | ||
17 | file://inetutils-1.8-0003-wchar.patch \ | ||
18 | file://rexec.xinetd.inetutils \ | ||
19 | file://rlogin.xinetd.inetutils \ | ||
20 | file://rsh.xinetd.inetutils \ | ||
21 | file://telnet.xinetd.inetutils \ | ||
22 | file://tftpd.xinetd.inetutils \ | ||
23 | file://inetutils-1.9-PATH_PROCNET_DEV.patch \ | ||
24 | " | ||
25 | |||
26 | SRC_URI[md5sum] = "944f7196a2b3dba2d400e9088576000c" | ||
27 | SRC_URI[sha256sum] = "02a9ebde8a198cb85f87545b9d88fb103a183958139864a85fe9e027ad79ff2b" | ||
28 | |||
29 | inherit autotools gettext update-alternatives | ||
30 | |||
31 | SRC_URI += "${@base_contains('DISTRO_FEATURES', 'ipv6', '', 'file://fix-disable-ipv6.patch', d)}" | ||
32 | noipv6="${@base_contains('DISTRO_FEATURES', 'ipv6', '', '--disable-ipv6 gl_cv_socket_ipv6=no', d)}" | ||
33 | |||
34 | PACKAGECONFIG ??= "ftp uucpd" | ||
35 | PACKAGECONFIG[ftp] = "--enable-ftp,--disable-ftp,readline" | ||
36 | PACKAGECONFIG[uucpd] = "--enable-uucpd,--disable-uucpd,readline" | ||
37 | |||
38 | EXTRA_OECONF = "--with-ncurses-include-dir=${STAGING_INCDIR} \ | ||
39 | ${noipv6} \ | ||
40 | --with-libreadline-prefix=${STAGING_LIBDIR} \ | ||
41 | --enable-rpath=no \ | ||
42 | " | ||
43 | |||
44 | do_configure_prepend () { | ||
45 | export HELP2MAN='true' | ||
46 | cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${S}/build-aux/config.rpath | ||
47 | rm -f ${S}/glob/configure* | ||
48 | } | ||
49 | |||
50 | do_install_append () { | ||
51 | install -m 0755 -d ${D}${base_bindir} | ||
52 | install -m 0755 -d ${D}${base_sbindir} | ||
53 | install -m 0755 -d ${D}${sbindir} | ||
54 | install -m 0755 -d ${D}${sysconfdir}/xinetd.d | ||
55 | mv ${D}${bindir}/ping ${D}${base_bindir}/ | ||
56 | mv ${D}${bindir}/ping6 ${D}${base_bindir}/ | ||
57 | mv ${D}${bindir}/ifconfig ${D}${base_sbindir}/ | ||
58 | mv ${D}${libexecdir}/syslogd ${D}${base_sbindir}/ | ||
59 | mv ${D}${bindir}/hostname ${D}${base_bindir}/ | ||
60 | mv ${D}${libexecdir}/tftpd ${D}${sbindir}/in.tftpd | ||
61 | mv ${D}${libexecdir}/telnetd ${D}${sbindir}/in.telnetd | ||
62 | mv ${D}${libexecdir}/rexecd ${D}${sbindir}/in.rexecd | ||
63 | mv ${D}${libexecdir}/rlogind ${D}${sbindir}/in.rlogind | ||
64 | mv ${D}${libexecdir}/rshd ${D}${sbindir}/in.rshd | ||
65 | mv ${D}${libexecdir}/talkd ${D}${sbindir}/in.talkd | ||
66 | mv ${D}${libexecdir}/uucpd ${D}${sbindir}/in.uucpd | ||
67 | mv ${D}${libexecdir}/* ${D}${bindir}/ | ||
68 | cp ${WORKDIR}/rexec.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/rexec | ||
69 | cp ${WORKDIR}/rlogin.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/rlogin | ||
70 | cp ${WORKDIR}/rsh.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/rsh | ||
71 | cp ${WORKDIR}/telnet.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/telnet | ||
72 | cp ${WORKDIR}/tftpd.xinetd.inetutils ${D}/${sysconfdir}/xinetd.d/tftpd | ||
73 | rm -rf ${D}${libexecdir}/ | ||
74 | # remove usr/lib if empty | ||
75 | rmdir ${D}${libdir} | ||
76 | } | ||
77 | |||
78 | PACKAGES =+ "${PN}-ping ${PN}-ping6 ${PN}-hostname ${PN}-ifconfig \ | ||
79 | ${PN}-tftp ${PN}-logger ${PN}-traceroute ${PN}-syslogd \ | ||
80 | ${PN}-ftp ${PN}-ftpd ${PN}-tftpd ${PN}-telnet ${PN}-telnetd ${PN}-inetd \ | ||
81 | ${PN}-rsh ${PN}-rshd" | ||
82 | |||
83 | # The packages tftpd, telnetd and rshd conflict with the ones | ||
84 | # provided by netkit, so add the corresponding -dbg packages | ||
85 | # for them to avoid the confliction between the dbg package | ||
86 | # of inetutils and netkit. | ||
87 | PACKAGES += "${PN}-tftpd-dbg ${PN}-telnetd-dbg ${PN}-rshd-dbg" | ||
88 | |||
89 | ALTERNATIVE_PRIORITY = "80" | ||
90 | ALTERNATIVE_${PN} = "talk whois" | ||
91 | ALTERNATIVE_LINK_NAME[talkd] = "${sbindir}/in.talkd" | ||
92 | ALTERNATIVE_LINK_NAME[uucpd] = "${sbindir}/in.uucpd" | ||
93 | |||
94 | ALTERNATIVE_${PN}-logger = "logger" | ||
95 | ALTERNATIVE_${PN}-syslogd = "syslogd" | ||
96 | ALTERNATIVE_LINK_NAME[syslogd] = "${base_sbindir}/syslogd" | ||
97 | |||
98 | ALTERNATIVE_${PN}-ftp = "ftp" | ||
99 | ALTERNATIVE_${PN}-ftpd = "ftpd" | ||
100 | ALTERNATIVE_${PN}-tftp = "tftp" | ||
101 | ALTERNATIVE_${PN}-tftpd = "tftpd" | ||
102 | ALTERNATIVE_LINK_NAME[tftpd] = "${bindir}/tftpd" | ||
103 | ALTERNATIVE_TARGET[tftpd] = "${sbindir}/in.tftpd" | ||
104 | |||
105 | ALTERNATIVE_${PN}-telnet = "telnet" | ||
106 | ALTERNATIVE_${PN}-telnetd = "telnetd" | ||
107 | ALTERNATIVE_LINK_NAME[telnetd] = "${bindir}/telnetd" | ||
108 | ALTERNATIVE_TARGET[telnetd] = "${sbindir}/in.telnetd" | ||
109 | |||
110 | ALTERNATIVE_${PN}-rsh = "rcp rexec rlogin rsh" | ||
111 | ALTERNATIVE_${PN}-rshd = "rshd rexecd rlogind" | ||
112 | ALTERNATIVE_LINK_NAME[rshd] = "${bindir}/rshd" | ||
113 | ALTERNATIVE_TARGET[rshd] = "${sbindir}/in.rshd" | ||
114 | ALTERNATIVE_LINK_NAME[rexecd] = "${bindir}/rexecd" | ||
115 | ALTERNATIVE_TARGET[rexecd] = "${sbindir}/in.rexecd" | ||
116 | ALTERNATIVE_LINK_NAME[rlogind] = "${bindir}/rlogind" | ||
117 | ALTERNATIVE_TARGET[rlogind] = "${sbindir}/in.rlogind" | ||
118 | |||
119 | ALTERNATIVE_${PN}-inetd= "inetd" | ||
120 | ALTERNATIVE_${PN}-traceroute = "traceroute" | ||
121 | |||
122 | ALTERNATIVE_${PN}-hostname = "hostname" | ||
123 | ALTERNATIVE_LINK_NAME[hostname] = "${base_bindir}/hostname" | ||
124 | |||
125 | ALTERNATIVE_${PN}-ifconfig = "ifconfig" | ||
126 | ALTERNATIVE_LINK_NAME[ifconfig] = "${base_sbindir}/ifconfig" | ||
127 | |||
128 | ALTERNATIVE_${PN}-ping = "ping" | ||
129 | ALTERNATIVE_LINK_NAME[ping] = "${base_bindir}/ping" | ||
130 | |||
131 | ALTERNATIVE_${PN}-ping6 = "ping6" | ||
132 | ALTERNATIVE_LINK_NAME[ping6] = "${base_bindir}/ping6" | ||
133 | |||
134 | |||
135 | FILES_${PN}-ping = "${base_bindir}/ping.${BPN}" | ||
136 | FILES_${PN}-ping6 = "${base_bindir}/ping6.${BPN}" | ||
137 | FILES_${PN}-hostname = "${base_bindir}/hostname.${BPN}" | ||
138 | FILES_${PN}-ifconfig = "${base_sbindir}/ifconfig.${BPN}" | ||
139 | FILES_${PN}-traceroute = "${bindir}/traceroute.${BPN}" | ||
140 | FILES_${PN}-logger = "${bindir}/logger.${BPN}" | ||
141 | FILES_${PN}-syslogd = "${base_sbindir}/syslogd.${BPN}" | ||
142 | FILES_${PN}-ftp = "${bindir}/ftp.${BPN}" | ||
143 | |||
144 | FILES_${PN}-tftp = "${bindir}/tftp.${BPN}" | ||
145 | FILES_${PN}-telnet = "${bindir}/telnet.${BPN}" | ||
146 | FILES_${PN}-rsh = "${bindir}/rsh.${BPN} ${bindir}/rlogin.${BPN} ${bindir}/rexec.${BPN} ${bindir}/rcp.${BPN}" | ||
147 | |||
148 | FILES_${PN}-rshd = "${sbindir}/in.rshd ${sbindir}/in.rlogind ${sbindir}/in.rexecd \ | ||
149 | ${sysconfdir}/xinetd.d/rsh ${sysconfdir}/xinetd.d/rlogin ${sysconfdir}/xinetd.d/rexec" | ||
150 | FILES_${PN}-rshd-dbg = "${sbindir}/.debug/in.rshd ${sbindir}/.debug/in.rlogind ${sbindir}/.debug/in.rexecd" | ||
151 | RDEPENDS_${PN}-rshd += "xinetd tcp-wrappers" | ||
152 | RCONFLICTS_${PN}-rshd += "netkit-rshd" | ||
153 | RPROVIDES_${PN}-rshd = "rshd" | ||
154 | |||
155 | FILES_${PN}-ftpd = "${bindir}/ftpd.${BPN}" | ||
156 | FILES_${PN}-ftpd-dbg = "${bindir}/.debug/ftpd.${BPN}" | ||
157 | RDEPENDS_${PN}-ftpd += "xinetd" | ||
158 | |||
159 | FILES_${PN}-tftpd = "${sbindir}/in.tftpd ${sysconfdir}/xinetd.d/tftpd" | ||
160 | FILES_${PN}-tftpd-dbg = "${sbindir}/.debug/in.tftpd" | ||
161 | RCONFLICTS_${PN}-tftpd += "netkit-tftpd" | ||
162 | RDEPENDS_${PN}-tftpd += "xinetd" | ||
163 | |||
164 | FILES_${PN}-telnetd = "${sbindir}/in.telnetd ${sysconfdir}/xinetd.d/telnet" | ||
165 | FILES_${PN}-telnetd-dbg = "${sbindir}/.debug/in.telnetd" | ||
166 | RCONFLICTS_${PN}-telnetd += "netkit-telnetd" | ||
167 | RPROVIDES_${PN}-telnetd = "telnetd" | ||
168 | RDEPENDS_${PN}-telnetd += "xinetd" | ||
169 | |||
170 | FILES_${PN}-inetd = "${bindir}/inetd.${BPN}" | ||
171 | |||
172 | RDEPENDS_${PN} = "xinetd" | ||
diff --git a/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb b/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb new file mode 100644 index 0000000000..47525061ef --- /dev/null +++ b/meta-networking/recipes-connectivity/libdnet/libdnet_1.12.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | SUMMARY = "dumb networking library" | ||
2 | HOMEPAGE = "http://code.google.com/p/libdnet/" | ||
3 | LICENSE = "BSD" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=0036c1b155f4e999f3e0a373490b5db9" | ||
5 | |||
6 | SRC_URI = "http://libdnet.googlecode.com/files/libdnet-${PV}.tgz" | ||
7 | |||
8 | SRC_URI[md5sum] = "9253ef6de1b5e28e9c9a62b882e44cc9" | ||
9 | SRC_URI[sha256sum] = "83b33039787cf99990e977cef7f18a5d5e7aaffc4505548a83d31bd3515eb026" | ||
10 | |||
11 | inherit autotools | ||
12 | |||
13 | acpaths = "-I ./config/" | ||
14 | |||
diff --git a/meta-networking/recipes-connectivity/sethdlc/sethdlc.bb b/meta-networking/recipes-connectivity/sethdlc/sethdlc.bb new file mode 100644 index 0000000000..3a9692f86f --- /dev/null +++ b/meta-networking/recipes-connectivity/sethdlc/sethdlc.bb | |||
@@ -0,0 +1,30 @@ | |||
1 | DESCRIPTION = "set Linux HDLC packet radio modem driver port information" | ||
2 | HOMEPAGE = "https://www.kernel.org/pub/linux/utils/net/hdlc" | ||
3 | LICENSE = "GPLv2 & GPLv2+ " | ||
4 | LIC_FILES_CHKSUM = "file://Makefile;md5=19aada31930b2be84bf7138420d77263" | ||
5 | |||
6 | |||
7 | SRC_URI = "https://www.kernel.org/pub/linux/utils/net/hdlc/${BPN}-1.18.tar.gz \ | ||
8 | " | ||
9 | SRC_URI[md5sum] = "9016878156a5eadb06c0bae71cc5c9ab" | ||
10 | SRC_URI[sha256sum] = "21b1e2e1cb0e288b0ec8fcfd9fed449914e0f8e6fc273706bd5b3d4f6ab6b04e" | ||
11 | |||
12 | |||
13 | S = "${WORKDIR}/${BPN}-1.18" | ||
14 | |||
15 | DEPENDS="virtual/kernel" | ||
16 | |||
17 | EXTRA_OEMAKE="CROSS_COMPILE=${TARGET_PREFIX} CC='${CC} ${LDFLAGS}' \ | ||
18 | KERNEL_DIR=${STAGING_KERNEL_DIR} " | ||
19 | |||
20 | do_compile_prepend () { | ||
21 | oe_runmake clean | ||
22 | } | ||
23 | |||
24 | |||
25 | do_install() { | ||
26 | install -d ${D}/${bindir} | ||
27 | install sethdlc ${D}/${bindir}/ | ||
28 | } | ||
29 | |||
30 | FILES_${PN} += "${bindir}/sethdlc" | ||
diff --git a/meta-networking/recipes-connectivity/snort/files/0001-libpcap-search-sysroot-for-headers.patch b/meta-networking/recipes-connectivity/snort/files/0001-libpcap-search-sysroot-for-headers.patch new file mode 100644 index 0000000000..54c2a9521b --- /dev/null +++ b/meta-networking/recipes-connectivity/snort/files/0001-libpcap-search-sysroot-for-headers.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From 4d7ebe3ed6cee72bc7db98bd408d22c10ef5dd82 Mon Sep 17 00:00:00 2001 | ||
2 | From: Joe MacDonald <joe@deserted.net> | ||
3 | Date: Wed, 20 Nov 2013 16:06:07 -0500 | ||
4 | Subject: [PATCH] libpcap: search sysroot for headers | ||
5 | |||
6 | Configure hard-coded host header paths when building with libpcap. Point | ||
7 | the search path at the sysroot instead. | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | |||
11 | Signed-off-by: Joe MacDonald <joe@deserted.net> | ||
12 | --- | ||
13 | configure.in | 2 +- | ||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/configure.in b/configure.in | ||
17 | index e52bb6c..8ded35d 100644 | ||
18 | --- a/configure.in | ||
19 | +++ b/configure.in | ||
20 | @@ -78,7 +78,7 @@ case "$host" in | ||
21 | linux="yes" | ||
22 | AC_DEFINE([LINUX],[1],[Define if Linux]) | ||
23 | AC_SUBST(extra_incl) | ||
24 | - extra_incl="-I/usr/include/pcap" | ||
25 | + extra_incl="-I=/usr/include/pcap" | ||
26 | ;; | ||
27 | *-hpux10*|*-hpux11*) | ||
28 | AC_DEFINE([HPUX],[1],[Define if HP-UX 10 or 11]) | ||
29 | -- | ||
30 | 1.7.10.4 | ||
31 | |||
diff --git a/meta-networking/recipes-connectivity/snort/files/disable-dap-address-space-id.patch b/meta-networking/recipes-connectivity/snort/files/disable-dap-address-space-id.patch new file mode 100644 index 0000000000..39e5c9c03a --- /dev/null +++ b/meta-networking/recipes-connectivity/snort/files/disable-dap-address-space-id.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | Upstream-Status:Inappropriate [embedded specific] | ||
2 | |||
3 | fix the below error: | ||
4 | checking for dap address space id... configure: | ||
5 | configure: error: cannot run test program while cross compiling | ||
6 | |||
7 | |||
8 | Signed-off-by: Chunrong Guo <B40290@freescale.com> | ||
9 | |||
10 | --- a/configure.in 2013-08-23 00:06:37.239361932 -0500 | ||
11 | +++ b/configure.in 2013-08-23 00:07:32.860266534 -0500 | ||
12 | @@ -679,23 +679,23 @@ | ||
13 | |||
14 | AC_CHECK_FUNCS([daq_hup_apply] [daq_acquire_with_meta]) | ||
15 | |||
16 | -AC_MSG_CHECKING([for daq address space ID]) | ||
17 | -AC_RUN_IFELSE( | ||
18 | -[AC_LANG_PROGRAM( | ||
19 | -[[ | ||
20 | -#include <daq.h> | ||
21 | -]], | ||
22 | -[[ | ||
23 | - DAQ_PktHdr_t hdr; | ||
24 | - hdr.address_space_id = 0; | ||
25 | -]])], | ||
26 | -[have_daq_address_space_id="yes"], | ||
27 | -[have_daq_address_space_id="no"]) | ||
28 | -AC_MSG_RESULT($have_daq_address_space_id) | ||
29 | -if test "x$have_daq_address_space_id" = "xyes"; then | ||
30 | - AC_DEFINE([HAVE_DAQ_ADDRESS_SPACE_ID],[1], | ||
31 | - [DAQ version supports address space ID in header.]) | ||
32 | -fi | ||
33 | +#AC_MSG_CHECKING([for daq address space ID]) | ||
34 | +#AC_RUN_IFELSE( | ||
35 | +#[AC_LANG_PROGRAM( | ||
36 | +#[[ | ||
37 | +##include <daq.h> | ||
38 | +#]], | ||
39 | +#[[ | ||
40 | +# DAQ_PktHdr_t hdr; | ||
41 | +# hdr.address_space_id = 0; | ||
42 | +#]])], | ||
43 | +have_daq_address_space_id="yes" | ||
44 | +#[have_daq_address_space_id="no"]) | ||
45 | +#AC_MSG_RESULT($have_daq_address_space_id) | ||
46 | +#if test "x$have_daq_address_space_id" = "xyes"; then | ||
47 | +# AC_DEFINE([HAVE_DAQ_ADDRESS_SPACE_ID],[1], | ||
48 | +# [DAQ version supports address space ID in header.]) | ||
49 | +#fi | ||
50 | |||
51 | # any sparc platform has to have this one defined. | ||
52 | AC_MSG_CHECKING(for sparc) | ||
diff --git a/meta-networking/recipes-connectivity/snort/files/disable-inaddr-none.patch b/meta-networking/recipes-connectivity/snort/files/disable-inaddr-none.patch new file mode 100644 index 0000000000..9dafe63459 --- /dev/null +++ b/meta-networking/recipes-connectivity/snort/files/disable-inaddr-none.patch | |||
@@ -0,0 +1,75 @@ | |||
1 | Upstream-Status: Inappropriate [embedded specific] | ||
2 | |||
3 | fix the below error: | ||
4 | checking for INADDR_NONE... configure: | ||
5 | configure: error: cannot run test program while cross compiling | ||
6 | |||
7 | Signed-off-by: Chunrong Guo <B40290@freescale.com> | ||
8 | |||
9 | |||
10 | --- a/configure.in 2013-08-21 03:56:17.197414789 -0500 | ||
11 | +++ b/configure.in 2013-08-21 23:19:05.298553560 -0500 | ||
12 | @@ -281,25 +281,7 @@ | ||
13 | AC_CHECK_TYPES([boolean]) | ||
14 | |||
15 | # In case INADDR_NONE is not defined (like on Solaris) | ||
16 | -have_inaddr_none="no" | ||
17 | -AC_MSG_CHECKING([for INADDR_NONE]) | ||
18 | -AC_RUN_IFELSE( | ||
19 | -[AC_LANG_PROGRAM( | ||
20 | -[[ | ||
21 | -#include <sys/types.h> | ||
22 | -#include <netinet/in.h> | ||
23 | -#include <arpa/inet.h> | ||
24 | -]], | ||
25 | -[[ | ||
26 | - if (inet_addr("10,5,2") == INADDR_NONE); | ||
27 | - return 0; | ||
28 | -]])], | ||
29 | -[have_inaddr_none="yes"], | ||
30 | -[have_inaddr_none="no"]) | ||
31 | -AC_MSG_RESULT($have_inaddr_none) | ||
32 | -if test "x$have_inaddr_none" = "xno"; then | ||
33 | - AC_DEFINE([INADDR_NONE],[-1],[For INADDR_NONE definition]) | ||
34 | -fi | ||
35 | +have_inaddr_none="yes" | ||
36 | |||
37 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ | ||
38 | #include <stdio.h> | ||
39 | @@ -397,21 +379,21 @@ | ||
40 | fi | ||
41 | fi | ||
42 | |||
43 | -AC_MSG_CHECKING([for pcap_lex_destroy]) | ||
44 | -AC_RUN_IFELSE( | ||
45 | -[AC_LANG_PROGRAM( | ||
46 | -[[ | ||
47 | -#include <pcap.h> | ||
48 | -]], | ||
49 | -[[ | ||
50 | - pcap_lex_destroy(); | ||
51 | -]])], | ||
52 | -[have_pcap_lex_destroy="yes"], | ||
53 | -[have_pcap_lex_destroy="no"]) | ||
54 | -AC_MSG_RESULT($have_pcap_lex_destroy) | ||
55 | -if test "x$have_pcap_lex_destroy" = "xyes"; then | ||
56 | - AC_DEFINE([HAVE_PCAP_LEX_DESTROY],[1],[Can cleanup lex buffer stack created by pcap bpf filter]) | ||
57 | -fi | ||
58 | +#AC_MSG_CHECKING([for pcap_lex_destroy]) | ||
59 | +#AC_RUN_IFELSE( | ||
60 | +#[AC_LANG_PROGRAM( | ||
61 | +#[[ | ||
62 | +##include <pcap.h> | ||
63 | +#]], | ||
64 | +#[[ | ||
65 | +# pcap_lex_destroy(); | ||
66 | +#]])], | ||
67 | +have_pcap_lex_destroy="yes" | ||
68 | +#[have_pcap_lex_destroy="no"]) | ||
69 | +#AC_MSG_RESULT($have_pcap_lex_destroy) | ||
70 | +#if test "x$have_pcap_lex_destroy" = "xyes"; then | ||
71 | +# AC_DEFINE([HAVE_PCAP_LEX_DESTROY],[1],[Can cleanup lex buffer stack created by pcap bpf filter]) | ||
72 | +#fi | ||
73 | |||
74 | AC_MSG_CHECKING([for pcap_lib_version]) | ||
75 | AC_LINK_IFELSE( | ||
diff --git a/meta-networking/recipes-connectivity/snort/files/snort.init b/meta-networking/recipes-connectivity/snort/files/snort.init new file mode 100644 index 0000000000..d8a00c43fc --- /dev/null +++ b/meta-networking/recipes-connectivity/snort/files/snort.init | |||
@@ -0,0 +1,109 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # Snort Startup Script modified for OpenEmbedded | ||
4 | # | ||
5 | |||
6 | # Script variables | ||
7 | |||
8 | LAN_INTERFACE="$2" | ||
9 | RETURN_VAL=0 | ||
10 | BINARY=/usr/bin/snort | ||
11 | PATH=/bin:/usr/bin | ||
12 | PID=/var/run/snort_${LAN_INTERFACE}_ids.pid | ||
13 | DEL_PID=$PID | ||
14 | LOGDIR="/var/log/snort" | ||
15 | DATE=`/bin/date +%Y%m%d` | ||
16 | CONFIG_FILE=/etc/snort/snort.conf | ||
17 | PROG=snort | ||
18 | USER=root | ||
19 | GROUP=root | ||
20 | |||
21 | if [ ! -x "$BINARY" ]; then | ||
22 | echo "ERROR: $BINARY not found." | ||
23 | exit 1 | ||
24 | fi | ||
25 | |||
26 | if [ ! -r "$CONFIG_FILE" ]; then | ||
27 | echo "ERROR: $CONFIG_FILE not found." | ||
28 | exit 1 | ||
29 | fi | ||
30 | |||
31 | start() | ||
32 | { | ||
33 | |||
34 | [ -n "$LAN_INTERFACE" ] || return 0 | ||
35 | # Check if log diratory is present. Otherwise, create it. | ||
36 | if [ ! -d $LOGDIR/$DATE ]; then | ||
37 | mkdir -d $LOGDIR/$DATE | ||
38 | /bin/chown -R $USER:$USER $LOGDIR/$DATE | ||
39 | /bin/chmod -R 700 $LOGDIR/$DATE | ||
40 | fi | ||
41 | |||
42 | /bin/echo "Starting $PROG: " | ||
43 | # Snort parameters | ||
44 | # -D Run Snort in background (daemon) mode | ||
45 | # -i <if> Listen on interface <if> | ||
46 | # -u <uname> Run snort uid as <uname> user (or uid) | ||
47 | # -g <gname> Run snort uid as <gname> group (or gid) | ||
48 | # -c Load configuration file | ||
49 | # -N Turn off logging (alerts still work) (removed to enable logging) :) | ||
50 | # -l Log to directory | ||
51 | # -t Chroots process to directory after initialization | ||
52 | # -R <id> Include 'id' in snort_intf<id>.pid file name | ||
53 | |||
54 | $BINARY -D -i $LAN_INTERFACE -u $USER -g $GROUP -c $CONFIG_FILE -l $LOGDIR/$DATE -t $LOGDIR/$DATE -R _ids | ||
55 | /bin/echo "$PROG startup complete." | ||
56 | return $RETURN_VAL | ||
57 | } | ||
58 | |||
59 | stop() | ||
60 | { | ||
61 | if [ -s $PID ]; then | ||
62 | /bin/echo "Stopping $PROG with PID `cat $PID`: " | ||
63 | kill -TERM `cat $PID` 2>/dev/null | ||
64 | RETURN_VAL=$? | ||
65 | /bin/echo "$PROG shutdown complete." | ||
66 | [ -e $DEL_PID ] && rm -f $DEL_PID | ||
67 | [ -e $DEL_PID.lck ] && rm -f $DEL_PID.lck | ||
68 | else | ||
69 | /bin/echo "ERROR: PID in $PID file not found." | ||
70 | RETURN_VAL=1 | ||
71 | fi | ||
72 | return $RETURN_VAL | ||
73 | } | ||
74 | |||
75 | status() { | ||
76 | if [ -s $PID ]; then | ||
77 | echo "$PROG is running as pid `cat $PID`:" | ||
78 | else | ||
79 | echo "$PROG is not running." | ||
80 | fi | ||
81 | } | ||
82 | |||
83 | restart() | ||
84 | { | ||
85 | stop | ||
86 | start | ||
87 | RETURN_VAL=$? | ||
88 | return $RETURN_VAL | ||
89 | } | ||
90 | |||
91 | case "$1" in | ||
92 | start) | ||
93 | start | ||
94 | ;; | ||
95 | stop) | ||
96 | stop | ||
97 | ;; | ||
98 | status) | ||
99 | status | ||
100 | ;; | ||
101 | restart|reload) | ||
102 | restart | ||
103 | ;; | ||
104 | *) | ||
105 | /bin/echo "Usage: $0 {start|stop|status|restart|reload}" | ||
106 | RETURN_VAL=1 | ||
107 | esac | ||
108 | |||
109 | exit $RETURN_VAL | ||
diff --git a/meta-networking/recipes-connectivity/snort/snort_2.9.4.6.bb b/meta-networking/recipes-connectivity/snort/snort_2.9.4.6.bb new file mode 100644 index 0000000000..acb1b1a88d --- /dev/null +++ b/meta-networking/recipes-connectivity/snort/snort_2.9.4.6.bb | |||
@@ -0,0 +1,73 @@ | |||
1 | DESCRIPTION = "snort - a free lightweight network intrusion detection system for UNIX and Windows." | ||
2 | HOMEPAGE = "http://www.snort.org/" | ||
3 | LICENSE = "GPL-2.0" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=78fa8ef966b48fbf9095e13cc92377c5" | ||
5 | |||
6 | DEPENDS = "libpcap libpcre daq libdnet" | ||
7 | |||
8 | |||
9 | SRC_URI = " ${GENTOO_MIRROR}/${BP}.tar.gz;name=tarball \ | ||
10 | file://snort.init \ | ||
11 | file://disable-inaddr-none.patch \ | ||
12 | file://disable-dap-address-space-id.patch \ | ||
13 | file://0001-libpcap-search-sysroot-for-headers.patch \ | ||
14 | " | ||
15 | |||
16 | SRC_URI[tarball.md5sum] = "4111df01a4f21bd1d328a18b76d625bd" | ||
17 | SRC_URI[tarball.sha256sum] = "cfaa5390b1840aaaa68a6c05a7077dd92cb916e6186a014baa451d43cdb0b3bc" | ||
18 | |||
19 | inherit autotools gettext update-rc.d | ||
20 | |||
21 | INITSCRIPT_NAME = "snort" | ||
22 | INITSCRIPT_PARAMS = "defaults" | ||
23 | |||
24 | EXTRA_OECONF = " \ | ||
25 | --enable-gre \ | ||
26 | --enable-linux-smp-stats \ | ||
27 | --enable-reload \ | ||
28 | --enable-reload-error-restart \ | ||
29 | --enable-targetbased \ | ||
30 | --disable-static-daq \ | ||
31 | " | ||
32 | |||
33 | do_install_append() { | ||
34 | install -d ${D}/${sysconfdir}/snort/rules | ||
35 | install -d ${D}/${sysconfdir}/snort/preproc_rules | ||
36 | install -d ${D}${sysconfdir}/init.d | ||
37 | for i in map config conf dtd; do | ||
38 | cp ${S}/etc/*.$i ${D}/${sysconfdir}/snort/ | ||
39 | done | ||
40 | cp ${S}/preproc_rules/*.rules ${D}/${sysconfdir}/snort/preproc_rules/ | ||
41 | install -m 755 ${WORKDIR}/snort.init ${D}/${sysconfdir}/init.d/snort | ||
42 | mkdir -p ${D}/${localstatedir}/log/snort | ||
43 | install -d ${D}/var/log/snort | ||
44 | } | ||
45 | |||
46 | FILES_${PN} += " \ | ||
47 | ${libdir}/snort_dynamicengine/*.so.* \ | ||
48 | ${libdir}/snort_dynamicpreprocessor/*.so.* \ | ||
49 | ${libdir}/snort_dynamicrules/*.so.* \ | ||
50 | " | ||
51 | FILES_${PN}-dbg += " \ | ||
52 | ${libdir}/snort_dynamicengine/.debug \ | ||
53 | ${libdir}/snort_dynamicpreprocessor/.debug \ | ||
54 | ${libdir}/snort_dynamicrules/.debug \ | ||
55 | " | ||
56 | FILES_${PN}-staticdev += " \ | ||
57 | ${libdir}/snort_dynamicengine/*.a \ | ||
58 | ${libdir}/snort_dynamicpreprocessor/*.a \ | ||
59 | ${libdir}/snort_dynamicrules/*.a \ | ||
60 | ${libdir}/snort/dynamic_preproc/*.a \ | ||
61 | ${libdir}/snort/dynamic_output/*.a \ | ||
62 | " | ||
63 | FILES_${PN}-dev += " \ | ||
64 | ${libdir}/snort_dynamicengine/*.la \ | ||
65 | ${libdir}/snort_dynamicpreprocessor/*.la \ | ||
66 | ${libdir}/snort_dynamicrules/*.la \ | ||
67 | ${libdir}/snort_dynamicengine/*.so \ | ||
68 | ${libdir}/snort_dynamicpreprocessor/*.so \ | ||
69 | ${libdir}/snort_dynamicrules/*.so \ | ||
70 | ${prefix}/src/snort_dynamicsrc \ | ||
71 | " | ||
72 | |||
73 | RRECOMMENDS_${PN} += "barnyard2" | ||
diff --git a/meta-networking/recipes-connectivity/vlan/vlan_1.9.bb b/meta-networking/recipes-connectivity/vlan/vlan_1.9.bb new file mode 100644 index 0000000000..2c4f1577e8 --- /dev/null +++ b/meta-networking/recipes-connectivity/vlan/vlan_1.9.bb | |||
@@ -0,0 +1,25 @@ | |||
1 | SUMMARY = "VLAN provides vconfig utility" | ||
2 | LICENSE = "GPLv2" | ||
3 | LIC_FILES_CHKSUM = "file://vconfig.c;md5=293ef69c4e88434d37a5ee577a5288cb" | ||
4 | |||
5 | SRC_URI = "http://${BPN}.sourcearchive.com/downloads/${PV}-3ubuntu9/${BPN}_${PV}.orig.tar.gz" | ||
6 | |||
7 | SRC_URI[md5sum] = "5f0c6060b33956fb16e11a15467dd394" | ||
8 | SRC_URI[sha256sum] = "3b8f0a1bf0d3642764e5f646e1f3bbc8b1eeec474a77392d9aeb4868842b4cca" | ||
9 | |||
10 | S = "${WORKDIR}/${BPN}" | ||
11 | |||
12 | # comment out MakeInclude in Makefile which sets build environment | ||
13 | do_configure_append () { | ||
14 | sed -i 's/^ include/#^include/' ${S}/Makefile | ||
15 | } | ||
16 | |||
17 | # ignore strip to avoid yocto errors in stripping | ||
18 | do_compile () { | ||
19 | oe_runmake PLATFORM=ARM 'STRIP=echo' all | ||
20 | } | ||
21 | |||
22 | do_install () { | ||
23 | install -d ${D}/${exec_prefix}/bin | ||
24 | cp ${S}/vconfig ${D}/${exec_prefix}/bin | ||
25 | } | ||
diff --git a/meta-networking/recipes-connectivity/vpnc/vpnc/default.conf b/meta-networking/recipes-connectivity/vpnc/vpnc/default.conf new file mode 100644 index 0000000000..48b15eca6e --- /dev/null +++ b/meta-networking/recipes-connectivity/vpnc/vpnc/default.conf | |||
@@ -0,0 +1,19 @@ | |||
1 | # Comment out the options you need. | ||
2 | # Verify your config with "vpnc --print-config". | ||
3 | # You might also try "vpnc --long-help" or look into the documentation. | ||
4 | |||
5 | # Needed (you will be prompted if this is missing): | ||
6 | #IPSec gateway 10.1.2.3 | ||
7 | #IPSec ID YOURPEERSID | ||
8 | #IPSec secret YOURPEERSSECRET | ||
9 | #Xauth username YOURUSERNAME | ||
10 | #Xauth password YOURPASSWORD | ||
11 | |||
12 | # Optional: | ||
13 | #UDP Encapsulate | ||
14 | #UDP Encapsulation Port 10000 | ||
15 | #Noninteractive | ||
16 | #No Detach | ||
17 | #Debug 99 | ||
18 | #Interface name tun0 | ||
19 | #Script /etc/vpnc/vpnc-script | ||
diff --git a/meta-networking/recipes-connectivity/vpnc/vpnc/long-help b/meta-networking/recipes-connectivity/vpnc/vpnc/long-help new file mode 100644 index 0000000000..fbec254144 --- /dev/null +++ b/meta-networking/recipes-connectivity/vpnc/vpnc/long-help | |||
@@ -0,0 +1,168 @@ | |||
1 | Usage: vpnc [--version] [--print-config] [--help] [--long-help] [options] [config files] | ||
2 | |||
3 | Options: | ||
4 | --gateway <ip/hostname> | ||
5 | IP/name of your IPSec gateway | ||
6 | conf-variable: IPSec gateway <ip/hostname> | ||
7 | |||
8 | --id <ASCII string> | ||
9 | your group name | ||
10 | conf-variable: IPSec ID <ASCII string> | ||
11 | |||
12 | (configfile only option) | ||
13 | your group password (cleartext) | ||
14 | conf-variable: IPSec secret <ASCII string> | ||
15 | |||
16 | (configfile only option) | ||
17 | your group password (obfuscated) | ||
18 | conf-variable: IPSec obfuscated secret <hex string> | ||
19 | |||
20 | --username <ASCII string> | ||
21 | your username | ||
22 | conf-variable: Xauth username <ASCII string> | ||
23 | |||
24 | (configfile only option) | ||
25 | your password (cleartext) | ||
26 | conf-variable: Xauth password <ASCII string> | ||
27 | |||
28 | (configfile only option) | ||
29 | your password (obfuscated) | ||
30 | conf-variable: Xauth obfuscated password <hex string> | ||
31 | |||
32 | --domain <ASCII string> | ||
33 | (NT-) Domain name for authentication | ||
34 | conf-variable: Domain <ASCII string> | ||
35 | |||
36 | --xauth-inter | ||
37 | enable interactive extended authentication (for challenge response auth) | ||
38 | conf-variable: Xauth interactive | ||
39 | |||
40 | --vendor <cisco/netscreen> | ||
41 | vendor of your IPSec gateway | ||
42 | Default: cisco | ||
43 | conf-variable: Vendor <cisco/netscreen> | ||
44 | |||
45 | --natt-mode <natt/none/force-natt/cisco-udp> | ||
46 | Which NAT-Traversal Method to use: | ||
47 | * natt -- NAT-T as defined in RFC3947 | ||
48 | * none -- disable use of any NAT-T method | ||
49 | * force-natt -- always use NAT-T encapsulation even | ||
50 | without presence of a NAT device | ||
51 | (useful if the OS captures all ESP traffic) | ||
52 | * cisco-udp -- Cisco proprietary UDP encapsulation, commonly over Port 10000 | ||
53 | Note: cisco-tcp encapsulation is not yet supported | ||
54 | Default: natt | ||
55 | conf-variable: NAT Traversal Mode <natt/none/force-natt/cisco-udp> | ||
56 | |||
57 | --script <command> | ||
58 | command is executed using system() to configure the interface, | ||
59 | routing and so on. Device name, IP, etc. are passed using enviroment | ||
60 | variables, see README. This script is executed right after ISAKMP is | ||
61 | done, but before tunneling is enabled. It is called when vpnc | ||
62 | terminates, too | ||
63 | Default: /etc/vpnc/vpnc-script | ||
64 | conf-variable: Script <command> | ||
65 | |||
66 | --dh <dh1/dh2/dh5> | ||
67 | name of the IKE DH Group | ||
68 | Default: dh2 | ||
69 | conf-variable: IKE DH Group <dh1/dh2/dh5> | ||
70 | |||
71 | --pfs <nopfs/dh1/dh2/dh5/server> | ||
72 | Diffie-Hellman group to use for PFS | ||
73 | Default: server | ||
74 | conf-variable: Perfect Forward Secrecy <nopfs/dh1/dh2/dh5/server> | ||
75 | |||
76 | --enable-1des | ||
77 | enables weak single DES encryption | ||
78 | conf-variable: Enable Single DES | ||
79 | |||
80 | --enable-no-encryption | ||
81 | enables using no encryption for data traffic (key exchanged must be encrypted) | ||
82 | conf-variable: Enable no encryption | ||
83 | |||
84 | --application-version <ASCII string> | ||
85 | Application Version to report. Note: Default string is generated at runtime. | ||
86 | Default: Cisco Systems VPN Client 0.5.3-394:Linux | ||
87 | conf-variable: Application version <ASCII string> | ||
88 | |||
89 | --ifname <ASCII string> | ||
90 | visible name of the TUN/TAP interface | ||
91 | conf-variable: Interface name <ASCII string> | ||
92 | |||
93 | --ifmode <tun/tap> | ||
94 | mode of TUN/TAP interface: | ||
95 | * tun: virtual point to point interface (default) | ||
96 | * tap: virtual ethernet interface | ||
97 | Default: tun | ||
98 | conf-variable: Interface mode <tun/tap> | ||
99 | |||
100 | --debug <0/1/2/3/99> | ||
101 | Show verbose debug messages | ||
102 | * 0: Do not print debug information. | ||
103 | * 1: Print minimal debug information. | ||
104 | * 2: Show statemachine and packet/payload type information. | ||
105 | * 3: Dump everything exluding authentication data. | ||
106 | * 99: Dump everything INCLUDING AUTHENTICATION data (e.g. PASSWORDS). | ||
107 | conf-variable: Debug <0/1/2/3/99> | ||
108 | |||
109 | --no-detach | ||
110 | Don't detach from the console after login | ||
111 | conf-variable: No Detach | ||
112 | |||
113 | --pid-file <filename> | ||
114 | store the pid of background process in <filename> | ||
115 | Default: /var/run/vpnc/pid | ||
116 | conf-variable: Pidfile <filename> | ||
117 | |||
118 | --local-addr <ip/hostname> | ||
119 | local IP to use for ISAKMP / ESP / ... (0.0.0.0 == automatically assign) | ||
120 | Default: 0.0.0.0 | ||
121 | conf-variable: Local Addr <ip/hostname> | ||
122 | |||
123 | --local-port <0-65535> | ||
124 | local ISAKMP port number to use (0 == use random port) | ||
125 | Default: 500 | ||
126 | conf-variable: Local Port <0-65535> | ||
127 | |||
128 | --udp-port <0-65535> | ||
129 | Local UDP port number to use (0 == use random port). | ||
130 | This is only relevant if cisco-udp nat-traversal is used. | ||
131 | This is the _local_ port, the remote udp port is discovered automatically. | ||
132 | It is especially not the cisco-tcp port. | ||
133 | Default: 10000 | ||
134 | conf-variable: Cisco UDP Encapsulation Port <0-65535> | ||
135 | |||
136 | --dpd-idle <0,10-86400> | ||
137 | Send DPD packet after not receiving anything for <idle> seconds. | ||
138 | Use 0 to disable DPD completely (both ways). | ||
139 | Default: 300 | ||
140 | conf-variable: DPD idle timeout (our side) <0,10-86400> | ||
141 | |||
142 | --non-inter | ||
143 | Don't ask anything, exit on missing options | ||
144 | conf-variable: Noninteractive | ||
145 | |||
146 | --auth-mode <psk/cert/hybrid> | ||
147 | Authentication mode: | ||
148 | * psk: pre-shared key (default) | ||
149 | * cert: server + client certificate (not implemented yet) | ||
150 | * hybrid: server certificate + xauth (if built with openssl support) | ||
151 | Default: psk | ||
152 | conf-variable: IKE Authmode <psk/cert/hybrid> | ||
153 | |||
154 | --ca-file <filename> | ||
155 | filename and path to the CA-PEM-File | ||
156 | conf-variable: CA-File <filename> | ||
157 | |||
158 | --ca-dir <directory> | ||
159 | path of the trusted CA-Directory | ||
160 | Default: /etc/ssl/certs | ||
161 | conf-variable: CA-Dir <directory> | ||
162 | |||
163 | --target-network <target network/netmask> | ||
164 | Target network in dotted decimal or CIDR notation | ||
165 | Default: 0.0.0.0/0.0.0.0 | ||
166 | conf-variable: IPSEC target network <target network/netmask> | ||
167 | |||
168 | Report bugs to vpnc@unix-ag.uni-kl.de | ||
diff --git a/meta-networking/recipes-connectivity/vpnc/vpnc/makeman.patch b/meta-networking/recipes-connectivity/vpnc/vpnc/makeman.patch new file mode 100644 index 0000000000..f394e6abdd --- /dev/null +++ b/meta-networking/recipes-connectivity/vpnc/vpnc/makeman.patch | |||
@@ -0,0 +1,11 @@ | |||
1 | --- vpnc-0.5.1/makeman.pl.old 2008-03-16 02:17:59.000000000 -0500 | ||
2 | +++ vpnc-0.5.1/makeman.pl 2008-03-16 02:29:34.000000000 -0500 | ||
3 | @@ -29,7 +29,7 @@ my $vpnc = './vpnc'; | ||
4 | # indenting lists (those originally starting with an asterisk). I hope | ||
5 | # this pays off when converting the manpage to HTML or such. | ||
6 | |||
7 | -open my $LONGHELP, '-|', "$vpnc --long-help"; | ||
8 | +open my $LONGHELP, '-|', "cat ../long-help"; | ||
9 | my $vpnc_options = ''; | ||
10 | my $relative_indent = 0; | ||
11 | my $indent_needed = 0; | ||
diff --git a/meta-networking/recipes-connectivity/vpnc/vpnc/vpnc-install.patch b/meta-networking/recipes-connectivity/vpnc/vpnc/vpnc-install.patch new file mode 100644 index 0000000000..3de65ec35e --- /dev/null +++ b/meta-networking/recipes-connectivity/vpnc/vpnc/vpnc-install.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | --- a/Makefile~ 2009-01-20 18:44:30.000000000 +0100 | ||
2 | +++ b/Makefile 2009-01-20 18:44:30.000000000 +0100 | ||
3 | @@ -119,21 +119,21 @@ | ||
4 | else \ | ||
5 | install vpnc-script $(DESTDIR)$(ETCDIR); \ | ||
6 | fi | ||
7 | - install -m600 vpnc.conf $(DESTDIR)$(ETCDIR)/default.conf | ||
8 | - install -m755 vpnc-disconnect $(DESTDIR)$(SBINDIR) | ||
9 | - install -m755 pcf2vpnc $(DESTDIR)$(BINDIR) | ||
10 | - install -m644 vpnc.8 $(DESTDIR)$(MANDIR)/man8 | ||
11 | - install -m644 pcf2vpnc.1 $(DESTDIR)$(MANDIR)/man1 | ||
12 | - install -m644 cisco-decrypt.1 $(DESTDIR)$(MANDIR)/man1 | ||
13 | - install -m644 COPYING $(DESTDIR)$(DOCDIR) | ||
14 | + install -m 600 vpnc.conf $(DESTDIR)$(ETCDIR)/default.conf | ||
15 | + install -m 755 vpnc-disconnect $(DESTDIR)$(SBINDIR) | ||
16 | + install -m 755 pcf2vpnc $(DESTDIR)$(BINDIR) | ||
17 | + install -m 644 vpnc.8 $(DESTDIR)$(MANDIR)/man8 | ||
18 | + install -m 644 pcf2vpnc.1 $(DESTDIR)$(MANDIR)/man1 | ||
19 | + install -m 644 cisco-decrypt.1 $(DESTDIR)$(MANDIR)/man1 | ||
20 | + install -m 644 COPYING $(DESTDIR)$(DOCDIR) | ||
21 | |||
22 | install : install-common | ||
23 | - install -m755 vpnc $(DESTDIR)$(SBINDIR) | ||
24 | - install -m755 cisco-decrypt $(DESTDIR)$(BINDIR) | ||
25 | + install -m 755 vpnc $(DESTDIR)$(SBINDIR) | ||
26 | + install -m 755 cisco-decrypt $(DESTDIR)$(BINDIR) | ||
27 | |||
28 | install-strip : install-common | ||
29 | - install -s -m755 vpnc $(DESTDIR)$(SBINDIR) | ||
30 | - install -s -m755 cisco-decrypt $(DESTDIR)$(BINDIR) | ||
31 | + install -s -m 755 vpnc $(DESTDIR)$(SBINDIR) | ||
32 | + install -s -m 755 cisco-decrypt $(DESTDIR)$(BINDIR) | ||
33 | |||
34 | uninstall : | ||
35 | rm -f $(DESTDIR)$(SBINDIR)/vpnc \ | ||
diff --git a/meta-networking/recipes-connectivity/vpnc/vpnc_0.5.3.bb b/meta-networking/recipes-connectivity/vpnc/vpnc_0.5.3.bb new file mode 100644 index 0000000000..986416ade2 --- /dev/null +++ b/meta-networking/recipes-connectivity/vpnc/vpnc_0.5.3.bb | |||
@@ -0,0 +1,30 @@ | |||
1 | SUMMARY = "A client for the Cisco3000 VPN Concentrator" | ||
2 | HOMEPAGE = "http://www.unix-ag.uni-kl.de/~massar/vpnc/" | ||
3 | AUTHOR = "Maurice Massar vpnc@unix-ag.uni-kl.de" | ||
4 | SECTION = "console/network" | ||
5 | PRIORITY = "optional" | ||
6 | LICENSE = "GPL-2.0+" | ||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=173b74cb8ac640a9992c03f3bce22a33" | ||
8 | DEPENDS = "libgcrypt" | ||
9 | |||
10 | CFLAGS_append = ' -DVERSION=\\"${PV}\\"' | ||
11 | LDFLAGS_append = " -lgcrypt -lgpg-error" | ||
12 | |||
13 | do_install () { | ||
14 | sed -i s:m600:m\ 600:g Makefile | ||
15 | oe_runmake 'DESTDIR=${D}' 'PREFIX=/usr' install | ||
16 | rm -f ${D}${sysconfdir}/vpnc/vpnc.conf #This file is useless | ||
17 | install ${WORKDIR}/default.conf ${D}${sysconfdir}/vpnc/default.conf | ||
18 | } | ||
19 | |||
20 | CONFFILES_${PN} = "${sysconfdir}/vpnc/default.conf" | ||
21 | RDEPENDS_${PN} = "kernel-module-tun perl-module-io-file" | ||
22 | |||
23 | SRC_URI = "http://www.unix-ag.uni-kl.de/~massar/vpnc/vpnc-${PV}.tar.gz \ | ||
24 | file://makeman.patch \ | ||
25 | file://vpnc-install.patch \ | ||
26 | file://long-help \ | ||
27 | file://default.conf" | ||
28 | |||
29 | SRC_URI[md5sum] = "4378f9551d5b077e1770bbe09995afb3" | ||
30 | SRC_URI[sha256sum] = "46cea3bd02f207c62c7c6f2f22133382602baeda1dc320747809e94881414884" | ||
diff --git a/meta-networking/recipes-daemons/atftp/atftp/atftpd.service b/meta-networking/recipes-daemons/atftp/atftp/atftpd.service new file mode 100644 index 0000000000..480bc702e9 --- /dev/null +++ b/meta-networking/recipes-daemons/atftp/atftp/atftpd.service | |||
@@ -0,0 +1,10 @@ | |||
1 | [Unit] | ||
2 | Description=Advanced TFTP Server | ||
3 | After=syslog.target network.target | ||
4 | |||
5 | [Service] | ||
6 | Type=forking | ||
7 | ExecStart=/usr/sbin/atftpd --daemon --port 69 | ||
8 | |||
9 | [Install] | ||
10 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-daemons/atftp/atftp_git.bb b/meta-networking/recipes-daemons/atftp/atftp_git.bb new file mode 100644 index 0000000000..ee84f77252 --- /dev/null +++ b/meta-networking/recipes-daemons/atftp/atftp_git.bb | |||
@@ -0,0 +1,61 @@ | |||
1 | SUMMARY = "Advanced TFTP server and client" | ||
2 | SECTION = "network" | ||
3 | HOMEPAGE = "http://packages.debian.org/atftp" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
6 | PV = "0.7.1+git${SRCPV}" | ||
7 | PR = "r3" | ||
8 | |||
9 | SRCREV = "be3291a18c069ae23a124ffdc56d64a5ff0bbec7" | ||
10 | |||
11 | SRC_URI = "git://git.code.sf.net/p/atftp/code \ | ||
12 | file://atftpd-0.7_circumvent_tftp_size_restrictions.patch \ | ||
13 | file://atftpd-0.7_unprotected_assignments_crash.patch \ | ||
14 | file://atftpd.init \ | ||
15 | file://atftpd.service \ | ||
16 | file://atftp-0.7-sorcerers_apprentice.patch \ | ||
17 | " | ||
18 | S = "${WORKDIR}/git" | ||
19 | |||
20 | inherit autotools update-rc.d useradd systemd | ||
21 | |||
22 | PACKAGECONFIG ??= "tcp-wrappers" | ||
23 | PACKAGECONFIG[pcre] = "--enable-libpcre,--disable-libpcre,libpcre" | ||
24 | PACKAGECONFIG[tcp-wrappers] = "--enable-libwrap,--disable-libwrap,tcp-wrappers" | ||
25 | PACKAGECONFIG[readline] = "--enable-libreadline,--disable-libreadline,readline" | ||
26 | |||
27 | INITSCRIPT_PACKAGES = "${PN}d" | ||
28 | INITSCRIPT_NAME_${PN}d = "atftpd" | ||
29 | INITSCRIPT_PARAMS_${PN}d = "defaults 80" | ||
30 | |||
31 | USERADD_PACKAGES = "${PN}d" | ||
32 | USERADD_PARAM_${PN}d = "--system --no-create-home --shell /bin/false \ | ||
33 | --user-group nobody" | ||
34 | |||
35 | do_install_append() { | ||
36 | install -d ${D}${sysconfdir}/init.d | ||
37 | install -m 0755 ${WORKDIR}/atftpd.init ${D}${sysconfdir}/init.d/atftpd | ||
38 | |||
39 | install -d ${D}/srv/tftp | ||
40 | |||
41 | rm ${D}${sbindir}/in.tftpd | ||
42 | |||
43 | install -d ${D}${systemd_unitdir}/system | ||
44 | install -m 0644 ${WORKDIR}/atftpd.service ${D}${systemd_unitdir}/system | ||
45 | } | ||
46 | |||
47 | PACKAGES =+ "${PN}d" | ||
48 | |||
49 | FILES_${PN} = "${bindir}/*" | ||
50 | |||
51 | FILES_${PN}d = "${sbindir}/* \ | ||
52 | ${sysconfdir} \ | ||
53 | /srv/tftp \ | ||
54 | ${systemd_unitdir}/system/atftpd.service \ | ||
55 | " | ||
56 | |||
57 | SYSTEMD_PACKAGES = "${PN}d" | ||
58 | SYSTEMD_SERVICE_${PN}d = "atftpd.service" | ||
59 | RPROVIDES_${PN}d += "${PN}d-systemd" | ||
60 | RREPLACES_${PN}d += "${PN}d-systemd" | ||
61 | RCONFLICTS_${PN}d += "${PN}d-systemd" | ||
diff --git a/meta-networking/recipes-daemons/atftp/files/atftp-0.7-sorcerers_apprentice.patch b/meta-networking/recipes-daemons/atftp/files/atftp-0.7-sorcerers_apprentice.patch new file mode 100644 index 0000000000..fc64291cd3 --- /dev/null +++ b/meta-networking/recipes-daemons/atftp/files/atftp-0.7-sorcerers_apprentice.patch | |||
@@ -0,0 +1,94 @@ | |||
1 | atftp exhibits the well known "Sorcerer's Apprentice Syndrome"(SAS) problem. | ||
2 | According to RFC 1350, the fix to SAS is quite simple: further copies of the | ||
3 | acknowledgment for a particular data block would be ignored. | ||
4 | |||
5 | Patch originally from OpenSUSE: | ||
6 | https://build.opensuse.org/package/view_file?file=atftp-0.7-sorcerers_apprentice.patch&package=atftp.539&project=openSUSE%3A12.1%3AUpdate&rev=84569792975e00573d7df597d2a6e895 | ||
7 | |||
8 | Upstream-Status: Pending | ||
9 | |||
10 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
11 | Index: atftp-0.7/tftp_file.c | ||
12 | =================================================================== | ||
13 | --- atftp-0.7.orig/tftp_file.c 2011-11-22 15:12:53.792744083 +0100 | ||
14 | +++ atftp-0.7/tftp_file.c 2011-11-22 15:13:51.706421893 +0100 | ||
15 | @@ -605,6 +605,7 @@ | ||
16 | int timeout_state = state; /* what state should we go on when timeout */ | ||
17 | int result; | ||
18 | long block_number = 0; | ||
19 | + long last_requested_block = -1; | ||
20 | long last_block = -1; | ||
21 | int data_size; /* size of data received */ | ||
22 | int sockfd = data->sockfd; /* just to simplify calls */ | ||
23 | @@ -765,6 +766,17 @@ | ||
24 | connected = 1; | ||
25 | } | ||
26 | block_number = ntohs(tftphdr->th_block); | ||
27 | + | ||
28 | + if (last_requested_block >= block_number) | ||
29 | + { | ||
30 | + if (data->trace) | ||
31 | + fprintf(stderr, "received duplicated ACK <block: %ld >= %ld>\n", | ||
32 | + last_requested_block, block_number); | ||
33 | + break; | ||
34 | + } | ||
35 | + else | ||
36 | + last_requested_block = block_number; | ||
37 | + | ||
38 | if (data->trace) | ||
39 | fprintf(stderr, "received ACK <block: %ld>\n", | ||
40 | block_number); | ||
41 | Index: atftp-0.7/tftpd_file.c | ||
42 | =================================================================== | ||
43 | --- atftp-0.7.orig/tftpd_file.c 2011-11-22 15:12:53.793744112 +0100 | ||
44 | +++ atftp-0.7/tftpd_file.c 2011-11-22 15:15:04.617534260 +0100 | ||
45 | @@ -403,6 +403,7 @@ | ||
46 | int timeout_state = state; | ||
47 | int result; | ||
48 | long block_number = 0; | ||
49 | + long last_requested_block = -1; | ||
50 | long last_block = -1; | ||
51 | int block_loops = 0; | ||
52 | int data_size; | ||
53 | @@ -859,6 +860,32 @@ | ||
54 | { | ||
55 | logger(LOG_DEBUG, "received ACK <block: %d>", block_number); | ||
56 | } | ||
57 | + | ||
58 | + /* check whether the block request isn't already fulfilled */ | ||
59 | + | ||
60 | + /* multicast, block numbers could contain gaps */ | ||
61 | + if (multicast) { | ||
62 | + if (last_requested_block >= block_number) | ||
63 | + { | ||
64 | + if (data->trace) | ||
65 | + logger(LOG_DEBUG, "received duplicated ACK <block: %d >= %d>", last_requested_block, block_number); | ||
66 | + break; | ||
67 | + } | ||
68 | + else | ||
69 | + last_requested_block = block_number; | ||
70 | + /* unicast, blocks should be requested one after another */ | ||
71 | + } else { | ||
72 | + if (last_requested_block + 1 != block_number && last_requested_block != -1) | ||
73 | + { | ||
74 | + if (data->trace) | ||
75 | + logger(LOG_DEBUG, "received out of order ACK <block: %d != %d>", last_requested_block + 1, block_number); | ||
76 | + break; | ||
77 | + } | ||
78 | + else | ||
79 | + last_requested_block = block_number; | ||
80 | + } | ||
81 | + | ||
82 | + | ||
83 | if (ntohs(tftphdr->th_block) == 65535) | ||
84 | { | ||
85 | block_loops++; | ||
86 | @@ -958,6 +985,8 @@ | ||
87 | /* nedd to send an oack to that client */ | ||
88 | state = S_SEND_OACK; | ||
89 | fseek(fp, 0, SEEK_SET); | ||
90 | + /* reset the last block received counter */ | ||
91 | + last_requested_block = -1; | ||
92 | } | ||
93 | else | ||
94 | { | ||
diff --git a/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_circumvent_tftp_size_restrictions.patch b/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_circumvent_tftp_size_restrictions.patch new file mode 100644 index 0000000000..280b570b22 --- /dev/null +++ b/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_circumvent_tftp_size_restrictions.patch | |||
@@ -0,0 +1,163 @@ | |||
1 | Fate #303031: Circumvent TFTP size restrictions in atftpd | ||
2 | The size of a single image file that can be transferred with TFTP is limited to | ||
3 | 2^(2*8) *BLOCKSIZE (as per RFC 1350 there are only two bytes for the block | ||
4 | counter). This is problematic for one of our customers who needs to transfer | ||
5 | 100+ MB Windows images using a TFTP client (NT bootloader) which has a | ||
6 | hardwared BLOCKSIZE setting of 1432). | ||
7 | |||
8 | block rollover | ||
9 | http://www.compuphase.com/tftp.htm | ||
10 | |||
11 | Patch originally from OpenSUSE: | ||
12 | https://build.opensuse.org/package/show?package=atftp&project=openSUSE%3A12.2 | ||
13 | |||
14 | Upstream-Status: Pending | ||
15 | |||
16 | Index: git/tftp_def.h | ||
17 | =================================================================== | ||
18 | --- git.orig/tftp_def.h 2012-11-19 16:28:50.221027144 -0800 | ||
19 | +++ git/tftp_def.h 2012-11-20 17:40:54.391206979 -0800 | ||
20 | @@ -32,6 +32,7 @@ | ||
21 | #define TIMEOUT 5 /* Client timeout */ | ||
22 | #define S_TIMEOUT 5 /* Server timout. */ | ||
23 | #define NB_OF_RETRY 5 | ||
24 | +#define MAXBLOCKS 1000000 /* maximum number of blocks in a download */ | ||
25 | |||
26 | /* definition to use tftp_options structure */ | ||
27 | #define OPT_FILENAME 0 | ||
28 | Index: git/tftp_file.c | ||
29 | =================================================================== | ||
30 | --- git.orig/tftp_file.c 2012-11-19 16:28:50.221027144 -0800 | ||
31 | +++ git/tftp_file.c 2012-11-19 16:28:51.201027167 -0800 | ||
32 | @@ -622,8 +622,8 @@ | ||
33 | int state = S_SEND_REQ; /* current state in the state machine */ | ||
34 | int timeout_state = state; /* what state should we go on when timeout */ | ||
35 | int result; | ||
36 | - int block_number = 0; | ||
37 | - int last_block = -1; | ||
38 | + long block_number = 0; | ||
39 | + long last_block = -1; | ||
40 | int data_size; /* size of data received */ | ||
41 | int sockfd = data->sockfd; /* just to simplify calls */ | ||
42 | struct sockaddr_storage sa; /* a copy of data.sa_peer */ | ||
43 | @@ -637,8 +637,8 @@ | ||
44 | int convert = 0; /* if true, do netascii convertion */ | ||
45 | char string[MAXLEN]; | ||
46 | |||
47 | - int prev_block_number = 0; /* needed to support netascii convertion */ | ||
48 | - int prev_file_pos = 0; | ||
49 | + long prev_block_number = 0; /* needed to support netascii convertion */ | ||
50 | + long prev_file_pos = 0; | ||
51 | int temp = 0; | ||
52 | |||
53 | data->file_size = 0; | ||
54 | @@ -745,7 +745,7 @@ | ||
55 | data_size, data->data_buffer); | ||
56 | data->file_size += data_size; | ||
57 | if (data->trace) | ||
58 | - fprintf(stderr, "sent DATA <block: %d, size: %d>\n", | ||
59 | + fprintf(stderr, "sent DATA <block: %ld, size: %d>\n", | ||
60 | block_number + 1, data_size - 4); | ||
61 | state = S_WAIT_PACKET; | ||
62 | break; | ||
63 | @@ -785,7 +785,7 @@ | ||
64 | } | ||
65 | block_number = ntohs(tftphdr->th_block); | ||
66 | if (data->trace) | ||
67 | - fprintf(stderr, "received ACK <block: %d>\n", | ||
68 | + fprintf(stderr, "received ACK <block: %ld>\n", | ||
69 | block_number); | ||
70 | if ((last_block != -1) && (block_number > last_block)) | ||
71 | { | ||
72 | Index: git/tftp_io.c | ||
73 | =================================================================== | ||
74 | --- git.orig/tftp_io.c 2012-11-19 16:28:50.221027144 -0800 | ||
75 | +++ git/tftp_io.c 2012-11-19 16:28:51.201027167 -0800 | ||
76 | @@ -350,8 +350,8 @@ | ||
77 | /* | ||
78 | * Read from file and do netascii conversion if needed | ||
79 | */ | ||
80 | -int tftp_file_read(FILE *fp, char *data_buffer, int data_buffer_size, int block_number, | ||
81 | - int convert, int *prev_block_number, int *prev_file_pos, int *temp) | ||
82 | +int tftp_file_read(FILE *fp, char *data_buffer, int data_buffer_size, long block_number, | ||
83 | + int convert, long *prev_block_number, long *prev_file_pos, int *temp) | ||
84 | { | ||
85 | int i; | ||
86 | int c; | ||
87 | Index: git/tftp_io.h | ||
88 | =================================================================== | ||
89 | --- git.orig/tftp_io.h 2012-11-19 16:28:50.221027144 -0800 | ||
90 | +++ git/tftp_io.h 2012-11-19 16:28:51.201027167 -0800 | ||
91 | @@ -52,8 +52,8 @@ | ||
92 | int tftp_get_packet(int sock1, int sock2, int *sock, struct sockaddr_storage *sa, | ||
93 | struct sockaddr_storage *from, struct sockaddr_storage *to, | ||
94 | int timeout, int *size, char *data); | ||
95 | -int tftp_file_read(FILE *fp, char *buffer, int buffer_size, int block_number, int convert, | ||
96 | - int *prev_block_number, int *prev_file_pos, int *temp); | ||
97 | +int tftp_file_read(FILE *fp, char *buffer, int buffer_size, long block_number, int convert, | ||
98 | + long *prev_block_number, long *prev_file_pos, int *temp); | ||
99 | int tftp_file_write(FILE *fp, char *data_buffer, int data_buffer_size, int block_number, | ||
100 | int data_size, int convert, int *prev_block_number, int *temp); | ||
101 | #endif | ||
102 | Index: git/tftpd_file.c | ||
103 | =================================================================== | ||
104 | --- git.orig/tftpd_file.c 2012-11-19 16:28:50.225027144 -0800 | ||
105 | +++ git/tftpd_file.c 2012-11-19 16:28:51.201027167 -0800 | ||
106 | @@ -407,8 +407,9 @@ | ||
107 | int state = S_BEGIN; | ||
108 | int timeout_state = state; | ||
109 | int result; | ||
110 | - int block_number = 0; | ||
111 | - int last_block = -1; | ||
112 | + long block_number = 0; | ||
113 | + long last_block = -1; | ||
114 | + int block_loops = 0; | ||
115 | int data_size; | ||
116 | struct sockaddr_storage *sa = &data->client_info->client; | ||
117 | struct sockaddr_storage from; | ||
118 | @@ -431,8 +432,8 @@ | ||
119 | struct client_info *client_old = NULL; | ||
120 | struct tftp_opt options[OPT_NUMBER]; | ||
121 | |||
122 | - int prev_block_number = 0; /* needed to support netascii convertion */ | ||
123 | - int prev_file_pos = 0; | ||
124 | + long prev_block_number = 0; /* needed to support netascii convertion */ | ||
125 | + long prev_file_pos = 0; | ||
126 | int temp = 0; | ||
127 | |||
128 | /* look for mode option */ | ||
129 | @@ -565,11 +566,12 @@ | ||
130 | logger(LOG_INFO, "blksize option -> %d", result); | ||
131 | } | ||
132 | |||
133 | - /* Verify that the file can be sent in 2^16 block of BLKSIZE octets */ | ||
134 | - if ((file_stat.st_size / (data->data_buffer_size - 4)) > 65535) | ||
135 | + /* Verify that the file can be sent in MAXBLOCKS blocks of BLKSIZE octets */ | ||
136 | + if ((file_stat.st_size / (data->data_buffer_size - 4)) > MAXBLOCKS) | ||
137 | { | ||
138 | tftp_send_error(sockfd, sa, EUNDEF, data->data_buffer, data->data_buffer_size); | ||
139 | - logger(LOG_NOTICE, "Requested file to big, increase BLKSIZE"); | ||
140 | + logger(LOG_NOTICE, "Requested file too big, increase BLKSIZE"); | ||
141 | + logger(LOG_NOTICE, "Only %d blocks of %d bytes can be served.", MAXBLOCKS, data->data_buffer_size); | ||
142 | if (data->trace) | ||
143 | logger(LOG_DEBUG, "sent ERROR <code: %d, msg: %s>", EUNDEF, | ||
144 | tftp_errmsg[EUNDEF]); | ||
145 | @@ -880,10 +882,15 @@ | ||
146 | } | ||
147 | /* The ACK is from the current client */ | ||
148 | number_of_timeout = 0; | ||
149 | - block_number = ntohs(tftphdr->th_block); | ||
150 | + block_number = (block_loops * 65536) + ntohs(tftphdr->th_block); | ||
151 | if (data->trace) | ||
152 | - logger(LOG_DEBUG, "received ACK <block: %d>", | ||
153 | - block_number); | ||
154 | + { | ||
155 | + logger(LOG_DEBUG, "received ACK <block: %d>", block_number); | ||
156 | + } | ||
157 | + if (ntohs(tftphdr->th_block) == 65535) | ||
158 | + { | ||
159 | + block_loops++; | ||
160 | + }; | ||
161 | if ((last_block != -1) && (block_number > last_block)) | ||
162 | { | ||
163 | state = S_END; | ||
diff --git a/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch b/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch new file mode 100644 index 0000000000..28fba6cf50 --- /dev/null +++ b/meta-networking/recipes-daemons/atftp/files/atftpd-0.7_unprotected_assignments_crash.patch | |||
@@ -0,0 +1,152 @@ | |||
1 | Avoid assigning thread data outside of mutex lock | ||
2 | |||
3 | Patch originally from OpenSUSE: | ||
4 | https://build.opensuse.org/package/show?package=atftp&project=openSUSE%3A12.2 | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Index: git/tftpd_list.c | ||
9 | =================================================================== | ||
10 | --- git.orig/tftpd_list.c 2012-10-24 21:48:47.000000000 -0700 | ||
11 | +++ git/tftpd_list.c 2012-10-24 21:52:04.266205076 -0700 | ||
12 | @@ -49,11 +49,11 @@ | ||
13 | */ | ||
14 | int tftpd_list_add(struct thread_data *new) | ||
15 | { | ||
16 | - struct thread_data *current = thread_data; | ||
17 | + struct thread_data *current; | ||
18 | int ret; | ||
19 | |||
20 | pthread_mutex_lock(&thread_list_mutex); | ||
21 | - | ||
22 | + current = thread_data; | ||
23 | number_of_thread++; | ||
24 | |||
25 | ret = number_of_thread; | ||
26 | @@ -81,11 +81,13 @@ | ||
27 | */ | ||
28 | int tftpd_list_remove(struct thread_data *old) | ||
29 | { | ||
30 | - struct thread_data *current = thread_data; | ||
31 | + struct thread_data *current; | ||
32 | int ret; | ||
33 | |||
34 | pthread_mutex_lock(&thread_list_mutex); | ||
35 | |||
36 | + current = thread_data; | ||
37 | + | ||
38 | number_of_thread--; | ||
39 | ret = number_of_thread; | ||
40 | |||
41 | @@ -137,23 +139,26 @@ | ||
42 | struct thread_data *data, | ||
43 | struct client_info *client) | ||
44 | { | ||
45 | - struct thread_data *current = thread_data; /* head of the list */ | ||
46 | - struct tftp_opt *tftp_options = data->tftp_options; | ||
47 | + struct thread_data *current; /* head of the list */ | ||
48 | + struct tftp_opt *tftp_options; | ||
49 | struct client_info *tmp; | ||
50 | char options[MAXLEN]; | ||
51 | char string[MAXLEN]; | ||
52 | char *index; | ||
53 | int len; | ||
54 | |||
55 | + /* lock the whole list before walking it */ | ||
56 | + pthread_mutex_lock(&thread_list_mutex); | ||
57 | + | ||
58 | *thread = NULL; | ||
59 | |||
60 | + current = thread_data; | ||
61 | + tftp_options = data->tftp_options; | ||
62 | + | ||
63 | opt_request_to_string(tftp_options, options, MAXLEN); | ||
64 | index = strstr(options, "multicast"); | ||
65 | len = (int)index - (int)options; | ||
66 | |||
67 | - /* lock the whole list before walking it */ | ||
68 | - pthread_mutex_lock(&thread_list_mutex); | ||
69 | - | ||
70 | while (current) | ||
71 | { | ||
72 | if (current != data) | ||
73 | @@ -214,9 +219,10 @@ | ||
74 | void tftpd_clientlist_remove(struct thread_data *thread, | ||
75 | struct client_info *client) | ||
76 | { | ||
77 | - struct client_info *tmp = thread->client_info; | ||
78 | + struct client_info *tmp; | ||
79 | |||
80 | pthread_mutex_lock(&thread->client_mutex); | ||
81 | + tmp = thread->client_info; | ||
82 | while ((tmp->next != client) && (tmp->next != NULL)) | ||
83 | tmp = tmp->next; | ||
84 | if (tmp->next == NULL) | ||
85 | @@ -231,9 +237,11 @@ | ||
86 | void tftpd_clientlist_free(struct thread_data *thread) | ||
87 | { | ||
88 | struct client_info *tmp; | ||
89 | - struct client_info *head = thread->client_info; | ||
90 | + struct client_info *head; | ||
91 | |||
92 | pthread_mutex_lock(&thread->client_mutex); | ||
93 | + head = thread->client_info; | ||
94 | + | ||
95 | while (head) | ||
96 | { | ||
97 | tmp = head; | ||
98 | @@ -250,9 +258,10 @@ | ||
99 | struct client_info *client, | ||
100 | struct sockaddr_storage *sock) | ||
101 | { | ||
102 | - struct client_info *head = thread->client_info; | ||
103 | + struct client_info *head; | ||
104 | |||
105 | pthread_mutex_lock(&thread->client_mutex); | ||
106 | + head = thread->client_info; | ||
107 | |||
108 | if (client) | ||
109 | { | ||
110 | @@ -334,10 +343,10 @@ | ||
111 | |||
112 | void tftpd_list_kill_threads(void) | ||
113 | { | ||
114 | - struct thread_data *current = thread_data; /* head of list */ | ||
115 | + struct thread_data *current; /* head of list */ | ||
116 | |||
117 | pthread_mutex_lock(&thread_list_mutex); | ||
118 | - | ||
119 | + current = thread_data; | ||
120 | |||
121 | while (current != NULL) | ||
122 | { | ||
123 | Index: git/tftpd_mcast.c | ||
124 | =================================================================== | ||
125 | --- git.orig/tftpd_mcast.c 2012-10-24 21:48:47.000000000 -0700 | ||
126 | +++ git/tftpd_mcast.c 2012-10-24 21:49:11.570201582 -0700 | ||
127 | @@ -51,9 +51,11 @@ | ||
128 | */ | ||
129 | int tftpd_mcast_get_tid(char **addr, short *port) | ||
130 | { | ||
131 | - struct tid *current = tid_list; | ||
132 | + struct tid *current; | ||
133 | |||
134 | pthread_mutex_lock(&mcast_tid_list); | ||
135 | + current = tid_list; | ||
136 | + | ||
137 | /* walk the list for a free tid */ | ||
138 | while (current != NULL) | ||
139 | { | ||
140 | @@ -74,9 +76,11 @@ | ||
141 | |||
142 | int tftpd_mcast_free_tid(char *addr, short port) | ||
143 | { | ||
144 | - struct tid *current = tid_list; | ||
145 | + struct tid *current; | ||
146 | |||
147 | pthread_mutex_lock(&mcast_tid_list); | ||
148 | + current = tid_list; | ||
149 | + | ||
150 | while (current != NULL) | ||
151 | { | ||
152 | if ((current->used == 1) && (current->port == port) && | ||
diff --git a/meta-networking/recipes-daemons/atftp/files/atftpd.init b/meta-networking/recipes-daemons/atftp/files/atftpd.init new file mode 100644 index 0000000000..161d97aca7 --- /dev/null +++ b/meta-networking/recipes-daemons/atftp/files/atftpd.init | |||
@@ -0,0 +1,37 @@ | |||
1 | #! /bin/sh | ||
2 | # | ||
3 | # This is an init script for openembedded | ||
4 | # Copy it to /etc/init.d/atftpd and type | ||
5 | # > update-rc.d atftpd defaults 60 | ||
6 | # | ||
7 | |||
8 | |||
9 | test -f /usr/sbin/atftpd || exit 0 | ||
10 | |||
11 | test -d /srv/tftp || mkdir -p /srv/tftp | ||
12 | |||
13 | case "$1" in | ||
14 | start) | ||
15 | echo -n "Starting tftp daemon: atftpd" | ||
16 | start-stop-daemon --start --quiet --exec /usr/sbin/atftpd -- --daemon --port 69 | ||
17 | echo "." | ||
18 | ;; | ||
19 | stop) | ||
20 | echo -n "Stopping tftp daemon: atftpd" | ||
21 | start-stop-daemon --stop --quiet --exec /usr/sbin/atftpd | ||
22 | echo "." | ||
23 | ;; | ||
24 | reload|force-reload) | ||
25 | start-stop-daemon --stop --quiet --signal 1 --exec /usr/sbin/atftpd | ||
26 | ;; | ||
27 | restart) | ||
28 | $0 stop | ||
29 | sleep 1 | ||
30 | $0 start | ||
31 | ;; | ||
32 | *) | ||
33 | echo "Usage: /etc/init.d/atftpd {start|stop|reload|restart|force-reload}" | ||
34 | exit 1 | ||
35 | esac | ||
36 | |||
37 | exit 0 | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/0001-systemd-allow-with-systemd-to-take-a-path-arg.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/0001-systemd-allow-with-systemd-to-take-a-path-arg.patch new file mode 100644 index 0000000000..742f25de19 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/0001-systemd-allow-with-systemd-to-take-a-path-arg.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From 40971911d653bf53de295d7462c643e4073916b9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Joe MacDonald <joe@deserted.net> | ||
3 | Date: Fri, 1 Nov 2013 12:47:18 -0400 | ||
4 | Subject: [PATCH] systemd: allow --with-systemd to take a path arg | ||
5 | |||
6 | If building for a cross-compile environment with systemd it is convenient | ||
7 | to be able to specify a systemd path for the target that may not be the | ||
8 | same as that on the host. | ||
9 | |||
10 | Upstream-status: Submitted [http://www.spinics.net/lists/autofs/msg00740.html] | ||
11 | |||
12 | Signed-off-by: Joe MacDonald <joe@deserted.net> | ||
13 | --- | ||
14 | aclocal.m4 | 10 ++++++++-- | ||
15 | 1 file changed, 8 insertions(+), 2 deletions(-) | ||
16 | |||
17 | diff --git a/aclocal.m4 b/aclocal.m4 | ||
18 | index 3e6f223..105e3e9 100644 | ||
19 | --- a/aclocal.m4 | ||
20 | +++ b/aclocal.m4 | ||
21 | @@ -229,8 +229,10 @@ dnl Check the location of the systemd unit files directory | ||
22 | dnl -------------------------------------------------------------------------- | ||
23 | AC_DEFUN([AF_WITH_SYSTEMD], | ||
24 | [AC_ARG_WITH(systemd, | ||
25 | -[ --with-systemd install systemd unit file if systemd unit directory | ||
26 | - is found on system], | ||
27 | +[ --with-systemd@<:@=systemddir@:>@ install systemd unit file. If 'yes' | ||
28 | + probe the system for unit directory. | ||
29 | + If a path is specified, assume that | ||
30 | + is a valid install path.], | ||
31 | [if test "$withval" = yes; then | ||
32 | if test -z "$systemddir"; then | ||
33 | AC_MSG_CHECKING([location of the systemd unit files directory]) | ||
34 | @@ -247,6 +249,10 @@ AC_DEFUN([AF_WITH_SYSTEMD], | ||
35 | else | ||
36 | AC_MSG_RESULT(not found) | ||
37 | fi | ||
38 | +else | ||
39 | + if test "$withval" != no; then | ||
40 | + systemddir=$withval | ||
41 | + fi | ||
42 | fi]) | ||
43 | ]) | ||
44 | |||
45 | -- | ||
46 | 1.7.10.4 | ||
47 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/Makefile.rules-cross.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/Makefile.rules-cross.patch new file mode 100644 index 0000000000..7dc7096c2e --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/Makefile.rules-cross.patch | |||
@@ -0,0 +1,23 @@ | |||
1 | Index: autofs-5.0.7/Makefile.rules | ||
2 | =================================================================== | ||
3 | --- autofs-5.0.7.orig/Makefile.rules 2012-07-24 23:05:26.000000000 -0700 | ||
4 | +++ autofs-5.0.7/Makefile.rules 2012-10-26 09:23:40.270204270 -0700 | ||
5 | @@ -34,14 +34,14 @@ | ||
6 | else | ||
7 | CFLAGS ?= -O2 -Wall | ||
8 | LDFLAGS = -s | ||
9 | -STRIP = strip --strip-debug | ||
10 | +STRIP = ${TARGET_PREFIX}strip --strip-debug | ||
11 | endif | ||
12 | endif | ||
13 | |||
14 | -CC = gcc | ||
15 | -CXX = g++ | ||
16 | +CC ?= ${TARGET_PREFIX}gcc | ||
17 | +CXX ?= ${TARGET_PREFIX}g++ | ||
18 | CXXFLAGS = $(CFLAGS) | ||
19 | -LD = ld | ||
20 | +LD ?= ${TARGET_PREFIX}ld | ||
21 | SOLDFLAGS = -shared | ||
22 | |||
23 | CFLAGS += -D_REENTRANT -D_FILE_OFFSET_BITS=64 | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.6-fix-recursive-mount-deadlock.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.6-fix-recursive-mount-deadlock.patch new file mode 100644 index 0000000000..e6549a7c8f --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.6-fix-recursive-mount-deadlock.patch | |||
@@ -0,0 +1,78 @@ | |||
1 | autofs-5.0.6 - fix recursive mount deadlock | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | Prior to the vfs-automount changes that went into 2.6.38 | ||
6 | and were finalized in 3.1 it was not possible to block | ||
7 | path walks into multi-mounts whose root was covered by | ||
8 | another mount. To deal with that a write lock was used | ||
9 | to ensure the mount tree construction was completed. This | ||
10 | restricts the types of recursively defined mount maps that | ||
11 | can be used and can lead to a deadlock during lookup. | ||
12 | |||
13 | Now that we can prevent processes walking into multi-mounts | ||
14 | that are under construction we no longer need to use a | ||
15 | write lock. | ||
16 | |||
17 | Also, in the patch below, a cache writelock is changed to | ||
18 | a read lock because a write lock isn't needed since the | ||
19 | map cache entry isn't being updated. | ||
20 | --- | ||
21 | |||
22 | CHANGELOG | 1 + | ||
23 | daemon/direct.c | 14 ++++++++++++-- | ||
24 | 2 files changed, 13 insertions(+), 2 deletions(-) | ||
25 | |||
26 | |||
27 | diff --git a/CHANGELOG b/CHANGELOG | ||
28 | index 936c9ab..9cdad6e 100644 | ||
29 | --- a/CHANGELOG | ||
30 | +++ b/CHANGELOG | ||
31 | @@ -12,6 +12,7 @@ | ||
32 | - configure.in: allow cross compilation. | ||
33 | - README: update mailing list subscription info. | ||
34 | - allow non root user to check status. | ||
35 | +- fix recursive mount deadlock. | ||
36 | |||
37 | 25/07/2012 autofs-5.0.7 | ||
38 | ======================= | ||
39 | diff --git a/daemon/direct.c b/daemon/direct.c | ||
40 | index 7e2f0d7..3e09c5d 100644 | ||
41 | --- a/daemon/direct.c | ||
42 | +++ b/daemon/direct.c | ||
43 | @@ -1285,6 +1285,8 @@ int handle_packet_missing_direct(struct autofs_point *ap, autofs_packet_missing_ | ||
44 | struct timespec wait; | ||
45 | struct timeval now; | ||
46 | int ioctlfd, len, state; | ||
47 | + unsigned int kver_major = get_kver_major(); | ||
48 | + unsigned int kver_minor = get_kver_minor(); | ||
49 | |||
50 | pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &state); | ||
51 | |||
52 | @@ -1297,8 +1299,16 @@ int handle_packet_missing_direct(struct autofs_point *ap, autofs_packet_missing_ | ||
53 | * cache entry we will not be able to find the mapent. So | ||
54 | * we must take the source writelock to ensure the parent | ||
55 | * has mount is complete before we look for the entry. | ||
56 | + * | ||
57 | + * Since the vfs-automount kernel changes we can now block | ||
58 | + * on covered mounts during mount tree construction so a | ||
59 | + * write lock is no longer needed. So we now can handle a | ||
60 | + * wider class of recursively define mount lookups. | ||
61 | */ | ||
62 | - master_source_writelock(ap->entry); | ||
63 | + if (kver_major > 5 || (kver_major == 5 && kver_minor > 1)) | ||
64 | + master_source_readlock(ap->entry); | ||
65 | + else | ||
66 | + master_source_writelock(ap->entry); | ||
67 | map = ap->entry->maps; | ||
68 | while (map) { | ||
69 | /* | ||
70 | @@ -1311,7 +1321,7 @@ int handle_packet_missing_direct(struct autofs_point *ap, autofs_packet_missing_ | ||
71 | } | ||
72 | |||
73 | mc = map->mc; | ||
74 | - cache_writelock(mc); | ||
75 | + cache_readlock(mc); | ||
76 | me = cache_lookup_ino(mc, pkt->dev, pkt->ino); | ||
77 | if (me) | ||
78 | break; | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.6-increase-file-map-read-buffer-size.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.6-increase-file-map-read-buffer-size.patch new file mode 100644 index 0000000000..39b22212a7 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.6-increase-file-map-read-buffer-size.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | autofs-5.0.6 - increase file map read buffer size | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | The file map entry read buffer can be too small for larger | ||
6 | multi-mount map entries so increase it. | ||
7 | --- | ||
8 | |||
9 | CHANGELOG | 1 + | ||
10 | include/automount.h | 2 +- | ||
11 | 2 files changed, 2 insertions(+), 1 deletions(-) | ||
12 | |||
13 | |||
14 | diff --git a/CHANGELOG b/CHANGELOG | ||
15 | index 9cdad6e..3bdf8a4 100644 | ||
16 | --- a/CHANGELOG | ||
17 | +++ b/CHANGELOG | ||
18 | @@ -13,6 +13,7 @@ | ||
19 | - README: update mailing list subscription info. | ||
20 | - allow non root user to check status. | ||
21 | - fix recursive mount deadlock. | ||
22 | +- increase file map read buffer size. | ||
23 | |||
24 | 25/07/2012 autofs-5.0.7 | ||
25 | ======================= | ||
26 | diff --git a/include/automount.h b/include/automount.h | ||
27 | index 561fcc2..37541f5 100644 | ||
28 | --- a/include/automount.h | ||
29 | +++ b/include/automount.h | ||
30 | @@ -233,7 +233,7 @@ int rmdir_path(struct autofs_point *ap, const char *path, dev_t dev); | ||
31 | #define AUTOFS_LOOKUP_VERSION 5 | ||
32 | |||
33 | #define KEY_MAX_LEN NAME_MAX | ||
34 | -#define MAPENT_MAX_LEN 4095 | ||
35 | +#define MAPENT_MAX_LEN 16384 | ||
36 | #define PARSE_MAX_BUF KEY_MAX_LEN + MAPENT_MAX_LEN + 2 | ||
37 | |||
38 | int lookup_nss_read_master(struct master *master, time_t age); | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-README-update-mailing-list-subscription-info.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-README-update-mailing-list-subscription-info.patch new file mode 100644 index 0000000000..99b61818ca --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-README-update-mailing-list-subscription-info.patch | |||
@@ -0,0 +1,56 @@ | |||
1 | autofs-5.0.7 - README: update mailing list subscription info | ||
2 | |||
3 | From: Chris Packham <chris.packham@alliedtelesis.co.nz> | ||
4 | |||
5 | Following the kernel.org compromise the mailing list was moved to | ||
6 | vger.kernel.org. Update the subscription info and add URLs for the gmane | ||
7 | mailing list archive. | ||
8 | |||
9 | Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> | ||
10 | --- | ||
11 | |||
12 | CHANGELOG | 1 + | ||
13 | README | 17 ++++++++++++++--- | ||
14 | 2 files changed, 15 insertions(+), 3 deletions(-) | ||
15 | |||
16 | |||
17 | diff --git a/CHANGELOG b/CHANGELOG | ||
18 | index fe801e8..44c9fb2 100644 | ||
19 | --- a/CHANGELOG | ||
20 | +++ b/CHANGELOG | ||
21 | @@ -10,6 +10,7 @@ | ||
22 | - fix null map entry order handling. | ||
23 | - make description of default MOUNT_WAIT setting clear. | ||
24 | - configure.in: allow cross compilation. | ||
25 | +- README: update mailing list subscription info. | ||
26 | |||
27 | 25/07/2012 autofs-5.0.7 | ||
28 | ======================= | ||
29 | diff --git a/README b/README | ||
30 | index cef16a9..9024e64 100644 | ||
31 | --- a/README | ||
32 | +++ b/README | ||
33 | @@ -43,9 +43,20 @@ Fitzhardinge's <jeremy@goop.org> work on autofs 3. Further enhancements | ||
34 | have been made by Ian Kent <raven@themaw.net>. | ||
35 | |||
36 | If you use or want to help develop autofs, please join the autofs | ||
37 | -mailing list by visiting: | ||
38 | +mailing list by sending an email to: | ||
39 | |||
40 | - http://linux.kernel.org/mailman/listinfo/autofs | ||
41 | + majordomo@vger.kernel.org | ||
42 | |||
43 | -and folling the instructions there to subscribe to the autofs mailing list. | ||
44 | +With the body text: | ||
45 | + | ||
46 | + subscribe autofs | ||
47 | + | ||
48 | +Once subscribed you can send patches to: | ||
49 | + | ||
50 | + autofs@vger.kernel.org | ||
51 | + | ||
52 | +The autofs mailing list archive can be viewed on gmane: | ||
53 | + | ||
54 | + http://news.gmane.org/gmane.linux.kernel.autofs | ||
55 | + http://blog.gmane.org/gmane.linux.kernel.autofs | ||
56 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-add-symlink-pseudo-option.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-add-symlink-pseudo-option.patch new file mode 100644 index 0000000000..b0440f4a51 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-add-symlink-pseudo-option.patch | |||
@@ -0,0 +1,217 @@ | |||
1 | autofs-5.0.7 - add symlink pseudo option | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | Add a "symlink" pseudo option to tell the bind mount module to symlink | ||
6 | instead of bind when mounting mounts other than direct mounts and | ||
7 | non-root indirect mount offset mounts (aka. non-root multi-mount | ||
8 | entries). | ||
9 | --- | ||
10 | CHANGELOG | 1 + | ||
11 | include/automount.h | 3 +++ | ||
12 | lib/master_parse.y | 8 +++++++- | ||
13 | lib/master_tok.l | 1 + | ||
14 | man/auto.master.5.in | 8 ++++++++ | ||
15 | modules/mount_autofs.c | 5 +++++ | ||
16 | modules/mount_bind.c | 36 +++++++++++++++++++++++++++++++++++- | ||
17 | 7 files changed, 60 insertions(+), 2 deletions(-) | ||
18 | |||
19 | diff --git a/CHANGELOG b/CHANGELOG | ||
20 | index c189483..247d334 100644 | ||
21 | --- a/CHANGELOG | ||
22 | +++ b/CHANGELOG | ||
23 | @@ -32,6 +32,7 @@ | ||
24 | - fix wildcard multi map regression. | ||
25 | - fix file descriptor leak when reloading the daemon. | ||
26 | - depricate nosymlink pseudo option. | ||
27 | +- add symlink pseudo option. | ||
28 | |||
29 | 25/07/2012 autofs-5.0.7 | ||
30 | ======================= | ||
31 | diff --git a/include/automount.h b/include/automount.h | ||
32 | index 37541f5..e72fa0d 100644 | ||
33 | --- a/include/automount.h | ||
34 | +++ b/include/automount.h | ||
35 | @@ -455,6 +455,9 @@ struct kernel_mod_version { | ||
36 | /* Don't use bind mounts even when system supports them */ | ||
37 | #define MOUNT_FLAG_NOBIND 0x0020 | ||
38 | |||
39 | +/* Use symlinks instead of bind mounting local mounts */ | ||
40 | +#define MOUNT_FLAG_SYMLINK 0x0040 | ||
41 | + | ||
42 | struct autofs_point { | ||
43 | pthread_t thid; | ||
44 | char *path; /* Mount point name */ | ||
45 | diff --git a/lib/master_parse.y b/lib/master_parse.y | ||
46 | index f925b5a..11caf5b 100644 | ||
47 | --- a/lib/master_parse.y | ||
48 | +++ b/lib/master_parse.y | ||
49 | @@ -57,6 +57,7 @@ static char *type; | ||
50 | static char *format; | ||
51 | static long timeout; | ||
52 | static long negative_timeout; | ||
53 | +static unsigned symlnk; | ||
54 | static unsigned nobind; | ||
55 | static unsigned ghost; | ||
56 | extern unsigned global_selection_options; | ||
57 | @@ -100,7 +101,7 @@ static int master_fprintf(FILE *, char *, ...); | ||
58 | %token COMMENT | ||
59 | %token MAP | ||
60 | %token OPT_TIMEOUT OPT_NTIMEOUT OPT_NOBIND OPT_NOGHOST OPT_GHOST OPT_VERBOSE | ||
61 | -%token OPT_DEBUG OPT_RANDOM OPT_USE_WEIGHT | ||
62 | +%token OPT_DEBUG OPT_RANDOM OPT_USE_WEIGHT OPT_SYMLINK | ||
63 | %token COLON COMMA NL DDASH | ||
64 | %type <strtype> map | ||
65 | %type <strtype> options | ||
66 | @@ -186,6 +187,7 @@ line: | ||
67 | | PATH OPT_USE_WEIGHT { master_notify($1); YYABORT; } | ||
68 | | PATH OPT_DEBUG { master_notify($1); YYABORT; } | ||
69 | | PATH OPT_TIMEOUT { master_notify($1); YYABORT; } | ||
70 | + | PATH OPT_SYMLINK { master_notify($1); YYABORT; } | ||
71 | | PATH OPT_NOBIND { master_notify($1); YYABORT; } | ||
72 | | PATH OPT_GHOST { master_notify($1); YYABORT; } | ||
73 | | PATH OPT_NOGHOST { master_notify($1); YYABORT; } | ||
74 | @@ -557,6 +559,7 @@ option: daemon_option | ||
75 | |||
76 | daemon_option: OPT_TIMEOUT NUMBER { timeout = $2; } | ||
77 | | OPT_NTIMEOUT NUMBER { negative_timeout = $2; } | ||
78 | + | OPT_SYMLINK { symlnk = 1; } | ||
79 | | OPT_NOBIND { nobind = 1; } | ||
80 | | OPT_NOGHOST { ghost = 0; } | ||
81 | | OPT_GHOST { ghost = 1; } | ||
82 | @@ -627,6 +630,7 @@ static void local_init_vars(void) | ||
83 | debug = 0; | ||
84 | timeout = -1; | ||
85 | negative_timeout = 0; | ||
86 | + symlnk = 0; | ||
87 | nobind = 0; | ||
88 | ghost = defaults_get_browse_mode(); | ||
89 | random_selection = global_selection_options & MOUNT_FLAG_RANDOM_SELECT; | ||
90 | @@ -811,6 +815,8 @@ int master_parse_entry(const char *buffer, unsigned int default_timeout, unsigne | ||
91 | entry->ap->flags |= MOUNT_FLAG_RANDOM_SELECT; | ||
92 | if (use_weight) | ||
93 | entry->ap->flags |= MOUNT_FLAG_USE_WEIGHT_ONLY; | ||
94 | + if (symlnk) | ||
95 | + entry->ap->flags |= MOUNT_FLAG_SYMLINK; | ||
96 | if (negative_timeout) | ||
97 | entry->ap->negative_timeout = negative_timeout; | ||
98 | |||
99 | diff --git a/lib/master_tok.l b/lib/master_tok.l | ||
100 | index 30abb15..f9b4e55 100644 | ||
101 | --- a/lib/master_tok.l | ||
102 | +++ b/lib/master_tok.l | ||
103 | @@ -361,6 +361,7 @@ OPTNTOUT (-n{OPTWS}|-n{OPTWS}={OPTWS}|--negative-timeout{OPTWS}|--negative-timeo | ||
104 | return(NUMBER); | ||
105 | } | ||
106 | |||
107 | + -?symlink { return(OPT_SYMLINK); } | ||
108 | -?nobind { return(OPT_NOBIND); } | ||
109 | -?nobrowse { return(OPT_NOGHOST); } | ||
110 | -g|--ghost|-?browse { return(OPT_GHOST); } | ||
111 | diff --git a/man/auto.master.5.in b/man/auto.master.5.in | ||
112 | index 8007542..bbea43a 100644 | ||
113 | --- a/man/auto.master.5.in | ||
114 | +++ b/man/auto.master.5.in | ||
115 | @@ -159,6 +159,14 @@ on individual map entries of both types. Bind mounting of NFS file | ||
116 | systems can also be prevented for specific map entrys by adding the | ||
117 | "port=" mount option to the entries. | ||
118 | .TP | ||
119 | +.I "symlink" | ||
120 | +This option makes bind mounting use a symlink instead of an actual bind | ||
121 | +mount. It is an autofs specific option that is a pseudo mount option and | ||
122 | +so is given without a leading dash. It may be used with indirect map | ||
123 | +entries only, either in the master map (so it effects all map entries) | ||
124 | +or with individual map entries. The option is ignored for direct mounts | ||
125 | +and non-root offest mount entries. | ||
126 | +.TP | ||
127 | .I "\-r, \-\-random-multimount-selection" | ||
128 | Enables the use of ramdom selection when choosing a host from a | ||
129 | list of replicated servers. This option is applied to this mount | ||
130 | diff --git a/modules/mount_autofs.c b/modules/mount_autofs.c | ||
131 | index ef16020..8c1e600 100644 | ||
132 | --- a/modules/mount_autofs.c | ||
133 | +++ b/modules/mount_autofs.c | ||
134 | @@ -51,6 +51,7 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, | ||
135 | int argc, status; | ||
136 | int nobind = ap->flags & MOUNT_FLAG_NOBIND; | ||
137 | int ghost = ap->flags & MOUNT_FLAG_GHOST; | ||
138 | + int symlnk = ap->flags & MOUNT_FLAG_SYMLINK; | ||
139 | time_t timeout = ap->entry->maps->exp_timeout; | ||
140 | unsigned logopt = ap->logopt; | ||
141 | struct map_type_info *info; | ||
142 | @@ -120,6 +121,8 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, | ||
143 | nobind = 1; | ||
144 | else if (strncmp(cp, "browse", 6) == 0) | ||
145 | ghost = 1; | ||
146 | + else if (strncmp(cp, "symlink", 7) == 0) | ||
147 | + symlnk = 1; | ||
148 | else if (strncmp(cp, "timeout=", 8) == 0) { | ||
149 | char *val = strchr(cp, '='); | ||
150 | unsigned tout; | ||
151 | @@ -158,6 +161,8 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, | ||
152 | } | ||
153 | nap = entry->ap; | ||
154 | nap->parent = ap; | ||
155 | + if (symlnk) | ||
156 | + nap->flags |= MOUNT_FLAG_SYMLINK; | ||
157 | |||
158 | argc = 1; | ||
159 | |||
160 | diff --git a/modules/mount_bind.c b/modules/mount_bind.c | ||
161 | index 9bce686..4975294 100644 | ||
162 | --- a/modules/mount_bind.c | ||
163 | +++ b/modules/mount_bind.c | ||
164 | @@ -73,10 +73,44 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int | ||
165 | char buf[MAX_ERR_BUF]; | ||
166 | int err; | ||
167 | int i, len; | ||
168 | + int symlnk = (*name != '/' && (ap->flags & MOUNT_FLAG_SYMLINK)); | ||
169 | |||
170 | if (ap->flags & MOUNT_FLAG_REMOUNT) | ||
171 | return 0; | ||
172 | |||
173 | + /* Extract "symlink" pseudo-option which forces local filesystems | ||
174 | + * to be symlinked instead of bound. | ||
175 | + */ | ||
176 | + if (*name != '/' && !symlnk && options) { | ||
177 | + const char *comma; | ||
178 | + int o_len = strlen(options) + 1; | ||
179 | + | ||
180 | + for (comma = options; *comma != '\0';) { | ||
181 | + const char *cp; | ||
182 | + const char *end; | ||
183 | + | ||
184 | + while (*comma == ',') | ||
185 | + comma++; | ||
186 | + | ||
187 | + /* Skip leading white space */ | ||
188 | + while (*comma == ' ' || *comma == '\t') | ||
189 | + comma++; | ||
190 | + | ||
191 | + cp = comma; | ||
192 | + while (*comma != '\0' && *comma != ',') | ||
193 | + comma++; | ||
194 | + | ||
195 | + /* Skip trailing white space */ | ||
196 | + end = comma - 1; | ||
197 | + while (*comma == ' ' || *comma == '\t') | ||
198 | + end--; | ||
199 | + | ||
200 | + o_len = end - cp + 1; | ||
201 | + if (strncmp("symlink", cp, o_len) == 0) | ||
202 | + symlnk = 1; | ||
203 | + } | ||
204 | + } | ||
205 | + | ||
206 | /* Root offset of multi-mount */ | ||
207 | len = strlen(root); | ||
208 | if (root[len - 1] == '/') { | ||
209 | @@ -100,7 +134,7 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int | ||
210 | if (options == NULL || *options == '\0') | ||
211 | options = "defaults"; | ||
212 | |||
213 | - if (bind_works) { | ||
214 | + if (!symlnk && bind_works) { | ||
215 | int status, existed = 1; | ||
216 | |||
217 | debug(ap->logopt, MODPREFIX "calling mkdir_path %s", fullpath); | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-add-timeout-option-description-to-man-page.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-add-timeout-option-description-to-man-page.patch new file mode 100644 index 0000000000..ac598dd729 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-add-timeout-option-description-to-man-page.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | autofs-5.0.7 - add timeout option description to man page | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | The pseudo option used t set the timeout for map entries is one of | ||
6 | the most most frequently used autofs options but is not mentioned | ||
7 | in auto.master(5). | ||
8 | --- | ||
9 | |||
10 | CHANGELOG | 1 + | ||
11 | man/auto.master.5.in | 5 +++++ | ||
12 | 2 files changed, 6 insertions(+), 0 deletions(-) | ||
13 | |||
14 | |||
15 | diff --git a/CHANGELOG b/CHANGELOG | ||
16 | index 93b9c26..7b8d185 100644 | ||
17 | --- a/CHANGELOG | ||
18 | +++ b/CHANGELOG | ||
19 | @@ -6,6 +6,7 @@ | ||
20 | - fix parse buffer initialization. | ||
21 | - fix typo in automount(8). | ||
22 | - dont wait forever to restart. | ||
23 | +- add timeout option description to man page. | ||
24 | |||
25 | 25/07/2012 autofs-5.0.7 | ||
26 | ======================= | ||
27 | diff --git a/man/auto.master.5.in b/man/auto.master.5.in | ||
28 | index 54269f8..21d7544 100644 | ||
29 | --- a/man/auto.master.5.in | ||
30 | +++ b/man/auto.master.5.in | ||
31 | @@ -167,6 +167,11 @@ server is specified in the map entry. If no server weights are given | ||
32 | then each available server will be tried in the order listed, within | ||
33 | proximity. | ||
34 | .TP | ||
35 | +.I "\-t, \-\-timeout <seconds>" | ||
36 | +Set the expire timeout for map entries. This option can be used to | ||
37 | +override the global default given either on the command line | ||
38 | +or in the configuration. | ||
39 | +.TP | ||
40 | .I "\-n, \-\-negative\-timeout <seconds>" | ||
41 | Set the timeout for caching failed key lookups. This option can be | ||
42 | used to override the global default given either on the command line | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-allow-non-root-user-to-check-status.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-allow-non-root-user-to-check-status.patch new file mode 100644 index 0000000000..6020c31e23 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-allow-non-root-user-to-check-status.patch | |||
@@ -0,0 +1,69 @@ | |||
1 | autofs-5.0.7 - allow non root user to check status | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | |||
6 | --- | ||
7 | |||
8 | CHANGELOG | 1 + | ||
9 | redhat/autofs.init.in | 20 +++++++++++++------- | ||
10 | 2 files changed, 14 insertions(+), 7 deletions(-) | ||
11 | |||
12 | |||
13 | diff --git a/CHANGELOG b/CHANGELOG | ||
14 | index 44c9fb2..936c9ab 100644 | ||
15 | --- a/CHANGELOG | ||
16 | +++ b/CHANGELOG | ||
17 | @@ -11,6 +11,7 @@ | ||
18 | - make description of default MOUNT_WAIT setting clear. | ||
19 | - configure.in: allow cross compilation. | ||
20 | - README: update mailing list subscription info. | ||
21 | +- allow non root user to check status. | ||
22 | |||
23 | 25/07/2012 autofs-5.0.7 | ||
24 | ======================= | ||
25 | diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in | ||
26 | index cd5cb34..fe18b3e 100644 | ||
27 | --- a/redhat/autofs.init.in | ||
28 | +++ b/redhat/autofs.init.in | ||
29 | @@ -167,6 +167,19 @@ function usage_message() { | ||
30 | |||
31 | RETVAL=0 | ||
32 | |||
33 | +# allow non-root users to read status / usage | ||
34 | + | ||
35 | +case "$1" in | ||
36 | + status) | ||
37 | + status -p @@autofspiddir@@/autofs.pid -l autofs $prog | ||
38 | + exit 0; | ||
39 | + ;; | ||
40 | + usage) | ||
41 | + usage_message | ||
42 | + exit 0; | ||
43 | + ;; | ||
44 | +esac | ||
45 | + | ||
46 | # Only the root user may change the service status | ||
47 | if [ `id -u` -ne 0 ] && [ "$1" != "status" ]; then | ||
48 | echo "insufficient privilege to change service status" | ||
49 | @@ -184,9 +197,6 @@ case "$1" in | ||
50 | stop) | ||
51 | stop | ||
52 | ;; | ||
53 | - status) | ||
54 | - status -p @@autofspiddir@@/autofs.pid -l autofs $prog | ||
55 | - ;; | ||
56 | restart|force-reload) | ||
57 | restart | ||
58 | ;; | ||
59 | @@ -202,10 +212,6 @@ case "$1" in | ||
60 | restart | ||
61 | fi | ||
62 | ;; | ||
63 | - usage) | ||
64 | - usage_message | ||
65 | - exit 0 | ||
66 | - ;; | ||
67 | *) | ||
68 | usage_message | ||
69 | exit 2 | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-allow-nsswitch_conf-to-not-contain-automount-lines.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-allow-nsswitch_conf-to-not-contain-automount-lines.patch new file mode 100644 index 0000000000..c342d1072e --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-allow-nsswitch_conf-to-not-contain-automount-lines.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | autofs-5.0.7 - Allow nsswitch.conf to not contain "automount:" lines | ||
2 | |||
3 | From: Michael Tokarev <mjt@tls.msk.ru> | ||
4 | |||
5 | Current code does not allow a case when nsswitch.conf | ||
6 | does not mention automount map at all, like all new | ||
7 | installations. It logs a rather unpleasant error | ||
8 | message instead: | ||
9 | |||
10 | syntax error in nsswitch config near [ syntax error ] | ||
11 | |||
12 | this patch has a minimal fix, to allo "file" to be empty. | ||
13 | |||
14 | Whole parser in C is about 25 lines of code, the "grammar" | ||
15 | is trivial, and it is better to ditch all this yacc/lex | ||
16 | stuff, but that will be much more intrusive change. | ||
17 | |||
18 | Signed-off-by: Michael Tokarev <mjt@tls.msk.ru> | ||
19 | Cc: 682266@bugs.debian.org | ||
20 | --- | ||
21 | |||
22 | CHANGELOG | 1 + | ||
23 | lib/nss_parse.y | 1 + | ||
24 | 2 files changed, 2 insertions(+), 0 deletions(-) | ||
25 | |||
26 | |||
27 | diff --git a/CHANGELOG b/CHANGELOG | ||
28 | index bd0dd82..16ac2a0 100644 | ||
29 | --- a/CHANGELOG | ||
30 | +++ b/CHANGELOG | ||
31 | @@ -16,6 +16,7 @@ | ||
32 | - increase file map read buffer size. | ||
33 | - handle new location of systemd. | ||
34 | - fix map entry duplicate offset detection. | ||
35 | +- Allow nsswitch.conf to not contain "automount:" lines. | ||
36 | |||
37 | 25/07/2012 autofs-5.0.7 | ||
38 | ======================= | ||
39 | diff --git a/lib/nss_parse.y b/lib/nss_parse.y | ||
40 | index a39fda4..055e9d7 100644 | ||
41 | --- a/lib/nss_parse.y | ||
42 | +++ b/lib/nss_parse.y | ||
43 | @@ -72,6 +72,7 @@ file: { | ||
44 | nss_debug = YYDEBUG; | ||
45 | #endif | ||
46 | } sources NL | ||
47 | + | /* empty */ | ||
48 | ; | ||
49 | |||
50 | sources: nss_source | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-configure-allow-cross-compilation-update.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-configure-allow-cross-compilation-update.patch new file mode 100644 index 0000000000..a8bc3ce857 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-configure-allow-cross-compilation-update.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | autofs-5.0.7 - configure: allow cross compilation update | ||
2 | |||
3 | From: Chris Packham <chris.packham@alliedtelesis.co.nz> | ||
4 | |||
5 | Run "make distclean" to update configure. This should have been included | ||
6 | in 5936c738 when configure.in was updated but it was missed. | ||
7 | --- | ||
8 | |||
9 | configure | 5 +---- | ||
10 | 1 files changed, 1 insertions(+), 4 deletions(-) | ||
11 | |||
12 | |||
13 | diff --git a/configure b/configure | ||
14 | index bf62203..ba3bba6 100755 | ||
15 | --- a/configure | ||
16 | +++ b/configure | ||
17 | @@ -5378,10 +5378,7 @@ DAEMON_LDFLAGS= | ||
18 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether gcc -fPIE works" >&5 | ||
19 | $as_echo_n "checking whether gcc -fPIE works... " >&6; } | ||
20 | if test "$cross_compiling" = yes; then : | ||
21 | - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 | ||
22 | -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} | ||
23 | -as_fn_error $? "cannot run test program while cross compiling | ||
24 | -See \`config.log' for more details" "$LINENO" 5; } | ||
25 | + gcc_supports_pie=no | ||
26 | else | ||
27 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | ||
28 | /* end confdefs.h. */ | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-configure-in-allow-cross-compilation.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-configure-in-allow-cross-compilation.patch new file mode 100644 index 0000000000..ac18bd94bd --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-configure-in-allow-cross-compilation.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | autofs-5.0.7 - configure.in: allow cross compilation | ||
2 | |||
3 | From: Chris Packham <chris.packham@alliedtelesis.co.nz> | ||
4 | |||
5 | The default behaviour of AC_RUN_IFELSE is to stop with an error if cross | ||
6 | compiling. Avoid this by providing the optional 4th argument to set | ||
7 | gcc_supports_pie=no if support for PIE cannot be detected. | ||
8 | |||
9 | Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> | ||
10 | --- | ||
11 | |||
12 | CHANGELOG | 1 + | ||
13 | configure.in | 2 +- | ||
14 | 2 files changed, 2 insertions(+), 1 deletions(-) | ||
15 | |||
16 | |||
17 | diff --git a/CHANGELOG b/CHANGELOG | ||
18 | index 961e340..fe801e8 100644 | ||
19 | --- a/CHANGELOG | ||
20 | +++ b/CHANGELOG | ||
21 | @@ -9,6 +9,7 @@ | ||
22 | - add timeout option description to man page. | ||
23 | - fix null map entry order handling. | ||
24 | - make description of default MOUNT_WAIT setting clear. | ||
25 | +- configure.in: allow cross compilation. | ||
26 | |||
27 | 25/07/2012 autofs-5.0.7 | ||
28 | ======================= | ||
29 | diff --git a/configure.in b/configure.in | ||
30 | index 1a24e34..90bda62 100644 | ||
31 | --- a/configure.in | ||
32 | +++ b/configure.in | ||
33 | @@ -307,7 +307,7 @@ DAEMON_CFLAGS= | ||
34 | DAEMON_LDFLAGS= | ||
35 | AC_MSG_CHECKING([whether gcc -fPIE works]) | ||
36 | AC_RUN_IFELSE([AC_LANG_PROGRAM([[]], [[int main(void) {return 0;}]])], | ||
37 | - [gcc_supports_pie=yes], [gcc_supports_pie=no]) | ||
38 | + [gcc_supports_pie=yes], [gcc_supports_pie=no], [gcc_supports_pie=no]) | ||
39 | AC_MSG_RESULT([$gcc_supports_pie]) | ||
40 | if test $gcc_supports_pie = yes ; then | ||
41 | DAEMON_CFLAGS="-fPIE" | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-depricate-nosymlink-pseudo-option.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-depricate-nosymlink-pseudo-option.patch new file mode 100644 index 0000000000..c784de7c92 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-depricate-nosymlink-pseudo-option.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | autofs-5.0.7 - depricate nosymlink pseudo option | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | The undocumented "nosymlink" option was the only way to force local | ||
6 | NFS mounting until the more descriptive "nobind" option was added. | ||
7 | |||
8 | So depricate the "nosymlink" option in favour of the "nobind" option. | ||
9 | --- | ||
10 | CHANGELOG | 1 + | ||
11 | modules/mount_nfs.c | 4 ++++ | ||
12 | 2 files changed, 5 insertions(+) | ||
13 | |||
14 | diff --git a/CHANGELOG b/CHANGELOG | ||
15 | index a7ed212..c189483 100644 | ||
16 | --- a/CHANGELOG | ||
17 | +++ b/CHANGELOG | ||
18 | @@ -31,6 +31,7 @@ | ||
19 | - dont fail on master map self include. | ||
20 | - fix wildcard multi map regression. | ||
21 | - fix file descriptor leak when reloading the daemon. | ||
22 | +- depricate nosymlink pseudo option. | ||
23 | |||
24 | 25/07/2012 autofs-5.0.7 | ||
25 | ======================= | ||
26 | diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c | ||
27 | index bbbb1de..e61320b 100644 | ||
28 | --- a/modules/mount_nfs.c | ||
29 | +++ b/modules/mount_nfs.c | ||
30 | @@ -125,6 +125,10 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int | ||
31 | |||
32 | o_len = end - cp + 1; | ||
33 | if (strncmp("nosymlink", cp, o_len) == 0) { | ||
34 | + warn(ap->logopt, MODPREFIX | ||
35 | + "the \"nosymlink\" option is depricated " | ||
36 | + "and will soon be removed, " | ||
37 | + "use the \"nobind\" option instead"); | ||
38 | nosymlink = 1; | ||
39 | } else if (strncmp("nobind", cp, o_len) == 0) { | ||
40 | nobind = 1; | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-do-not-check-for-modprobe.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-do-not-check-for-modprobe.patch new file mode 100644 index 0000000000..af5be6a830 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-do-not-check-for-modprobe.patch | |||
@@ -0,0 +1,75 @@ | |||
1 | Description: Loading autofs module is #ifdef'ed in the source, so | ||
2 | there is no need to check for /proc (which is only used | ||
3 | to load module) or modprobe. Both modprobe and /proc | ||
4 | are always in the fixed location so there's no need to | ||
5 | check for these to start with. | ||
6 | |||
7 | Upstream-Status: Backport [1] | ||
8 | [1] http://www.spinics.net/lists/autofs/msg00139.html | ||
9 | |||
10 | diff -urpN a/configure.in b/configure.in | ||
11 | --- a/configure.in 2013-01-15 11:30:22.000000000 +0800 | ||
12 | +++ b/configure.in 2013-01-15 11:31:45.000000000 +0800 | ||
13 | @@ -34,11 +34,6 @@ AC_MSG_CHECKING([for binaries in]) | ||
14 | AC_MSG_RESULT([$searchpath]) | ||
15 | |||
16 | # | ||
17 | -# Make sure we have "/proc" | ||
18 | -# | ||
19 | -AF_LINUX_PROCFS() | ||
20 | - | ||
21 | -# | ||
22 | # Location of init.d directory? | ||
23 | # | ||
24 | AF_INIT_D() | ||
25 | @@ -142,7 +137,6 @@ AF_PATH_INCLUDE(UMOUNT, umount, /bin/umo | ||
26 | AF_PATH_INCLUDE(E2FSCK, fsck.ext2 e2fsck, , $searchpath) | ||
27 | AF_PATH_INCLUDE(E3FSCK, fsck.ext3 e3fsck, , $searchpath) | ||
28 | AF_PATH_INCLUDE(E4FSCK, fsck.ext4 e4fsck, , $searchpath) | ||
29 | -AF_PATH_INCLUDE(MODPROBE, modprobe, , $searchpath) | ||
30 | |||
31 | AF_CHECK_PROG(LEX, flex lex, , $searchpath) | ||
32 | AF_CHECK_PROG(YACC, bison, , $searchpath) | ||
33 | diff -urpN a/daemon/module.c b/daemon/module.c | ||
34 | --- a/daemon/module.c 2013-01-15 11:30:49.000000000 +0800 | ||
35 | +++ b/daemon/module.c 2013-01-15 11:32:00.000000000 +0800 | ||
36 | @@ -18,6 +18,8 @@ | ||
37 | #include <stdlib.h> | ||
38 | #include "automount.h" | ||
39 | |||
40 | +#if 0 | ||
41 | +/* see comment in daemon/automount.c around load_autofs4_module() call */ | ||
42 | int load_autofs4_module(void) | ||
43 | { | ||
44 | FILE *fp; | ||
45 | @@ -52,6 +54,7 @@ int load_autofs4_module(void) | ||
46 | |||
47 | return 1; | ||
48 | } | ||
49 | +#endif | ||
50 | |||
51 | struct lookup_mod *open_lookup(const char *name, const char *err_prefix, | ||
52 | const char *mapfmt, int argc, const char *const *argv) | ||
53 | diff -urpN a/include/automount.h b/include/automount.h | ||
54 | --- a/include/automount.h 2013-01-15 11:31:10.000000000 +0800 | ||
55 | +++ b/include/automount.h 2013-01-15 11:32:06.000000000 +0800 | ||
56 | @@ -50,16 +50,11 @@ | ||
57 | #error Failed to locate umount(8)! | ||
58 | #endif | ||
59 | |||
60 | -#ifndef HAVE_MODPROBE | ||
61 | -#error Failed to locate modprobe(8)! | ||
62 | -#endif | ||
63 | - | ||
64 | -#ifndef HAVE_LINUX_PROCFS | ||
65 | -#error Failed to verify existence of procfs filesystem! | ||
66 | -#endif | ||
67 | - | ||
68 | +#if 0 | ||
69 | +/* see comment in daemon/automount.c around load_autofs4_module() call */ | ||
70 | #define FS_MODULE_NAME "autofs4" | ||
71 | int load_autofs4_module(void); | ||
72 | +#endif | ||
73 | |||
74 | /* The -s (sloppy) option to mount is good, if we have it... */ | ||
75 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-document-browse-option-in-man-page.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-document-browse-option-in-man-page.patch new file mode 100644 index 0000000000..4641342d24 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-document-browse-option-in-man-page.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | autofs-5.0.7 - document browse option in man page | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | The "browse" option has remained undocumented for a long time. | ||
6 | Finally add a section for it to auto.master(5) making special | ||
7 | note of the potential performance implications. | ||
8 | --- | ||
9 | CHANGELOG | 1 + | ||
10 | man/auto.master.5.in | 11 +++++++++++ | ||
11 | 2 files changed, 12 insertions(+) | ||
12 | |||
13 | diff --git a/CHANGELOG b/CHANGELOG | ||
14 | index ecdea0b..d8e4049 100644 | ||
15 | --- a/CHANGELOG | ||
16 | +++ b/CHANGELOG | ||
17 | @@ -36,6 +36,7 @@ | ||
18 | - fix requires in spec file. | ||
19 | - fix libtirpc build option to require libtirpc-devel if needed. | ||
20 | - fix systemd unidir in spec file. | ||
21 | +- document browse option in man page. | ||
22 | |||
23 | 25/07/2012 autofs-5.0.7 | ||
24 | ======================= | ||
25 | diff --git a/man/auto.master.5.in b/man/auto.master.5.in | ||
26 | index bbea43a..c552e56 100644 | ||
27 | --- a/man/auto.master.5.in | ||
28 | +++ b/man/auto.master.5.in | ||
29 | @@ -147,6 +147,17 @@ multiple file systems should be mounted (`multimounts'). If this option | ||
30 | is given, no file system is mounted at all if at least one file system | ||
31 | can't be mounted. | ||
32 | .TP | ||
33 | +.I "[no]browse" | ||
34 | +This is an autofs specific option that is a pseudo mount option and | ||
35 | +so is given without a leading dash. Use of the browse option pre-creates | ||
36 | +mount point directories for indirect mount maps so the map keys can be | ||
37 | +seen in a directory listing without being mounted. Use of this option | ||
38 | +can cause performance problem if the indirect map is large so it should | ||
39 | +be used with caution. The internal program default is to enable browse | ||
40 | +mode for indirect mounts but the default installed configuration overrides | ||
41 | +this by setting BROWSE_MODE to "no" because of the potential performance | ||
42 | +problem. | ||
43 | +.TP | ||
44 | .I "nobind" | ||
45 | This is an autofs specific option that is a pseudo mount option and | ||
46 | so is given without a leading dash. It may be used either in the master | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-fail-on-master-map-self-include.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-fail-on-master-map-self-include.patch new file mode 100644 index 0000000000..afb908b9e4 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-fail-on-master-map-self-include.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | autofs-5.0.7 - dont fail on master map self include | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | When reading the master map a self included file map should skip the source | ||
6 | and proceed to the next so, in this case, return an nss status that will | ||
7 | allow the map read to continue. In particular not NSS_STATUS_UNAVAIL which | ||
8 | causes the lookup to record a failure or NSS_STATUS_SUCCESS which indicates | ||
9 | a successful lookup and termintes the reading of sources. | ||
10 | --- | ||
11 | CHANGELOG | 1 + | ||
12 | modules/lookup_file.c | 7 ++++--- | ||
13 | 2 files changed, 5 insertions(+), 3 deletions(-) | ||
14 | |||
15 | diff --git a/CHANGELOG b/CHANGELOG | ||
16 | index 39388a5..97d6f48 100644 | ||
17 | --- a/CHANGELOG | ||
18 | +++ b/CHANGELOG | ||
19 | @@ -28,6 +28,7 @@ | ||
20 | - make yellow pages support optional. | ||
21 | - modules/replicated.c: use sin6_addr.s6_addr32. | ||
22 | - workaround missing GNU versionsort extension. | ||
23 | +- dont fail on master map self include. | ||
24 | |||
25 | 25/07/2012 autofs-5.0.7 | ||
26 | ======================= | ||
27 | diff --git a/modules/lookup_file.c b/modules/lookup_file.c | ||
28 | index facb305..f37bed9 100644 | ||
29 | --- a/modules/lookup_file.c | ||
30 | +++ b/modules/lookup_file.c | ||
31 | @@ -397,8 +397,9 @@ int lookup_read_master(struct master *master, time_t age, void *context) | ||
32 | unsigned int path_len, ent_len; | ||
33 | int entry, cur_state; | ||
34 | |||
35 | + /* Don't return fail on self include, skip source */ | ||
36 | if (master->recurse) | ||
37 | - return NSS_STATUS_UNAVAIL; | ||
38 | + return NSS_STATUS_TRYAGAIN; | ||
39 | |||
40 | if (master->depth > MAX_INCLUDE_DEPTH) { | ||
41 | error(logopt, MODPREFIX | ||
42 | @@ -443,7 +444,7 @@ int lookup_read_master(struct master *master, time_t age, void *context) | ||
43 | |||
44 | inc = check_master_self_include(master, ctxt); | ||
45 | if (inc) | ||
46 | - master->recurse = 1;; | ||
47 | + master->recurse = 1; | ||
48 | master->depth++; | ||
49 | status = lookup_nss_read_master(master, age); | ||
50 | if (!status) { | ||
51 | @@ -645,7 +646,7 @@ int lookup_read_map(struct autofs_point *ap, time_t age, void *context) | ||
52 | mc = source->mc; | ||
53 | |||
54 | if (source->recurse) | ||
55 | - return NSS_STATUS_UNAVAIL; | ||
56 | + return NSS_STATUS_TRYAGAIN; | ||
57 | |||
58 | if (source->depth > MAX_INCLUDE_DEPTH) { | ||
59 | error(ap->logopt, | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-schedule-new-alarms-after-readmap.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-schedule-new-alarms-after-readmap.patch new file mode 100644 index 0000000000..64446874cd --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-schedule-new-alarms-after-readmap.patch | |||
@@ -0,0 +1,69 @@ | |||
1 | autofs-5.0.7 - don't schedule new alarms after readmap | ||
2 | |||
3 | From: Leonardo Chiquitto <leonardo.lists@gmail.com> | ||
4 | |||
5 | Currently, a new alarm is scheduled every time the daemon receives | ||
6 | a SIGHUP (map re-read) or SIGUSR1 (forced expiration). Besides that, | ||
7 | map re-reads started on demand when a map is found to be outdated | ||
8 | also generate a new alarm. | ||
9 | |||
10 | Once added, these alarms are never deleted and hence increase the | ||
11 | number of times the daemon wakes up to run the expiration procedure. | ||
12 | After a couple of months, in setups with many mount points, it's | ||
13 | normal to see automount waking up every second to handle the | ||
14 | expiration timer. | ||
15 | |||
16 | This patch removes the alarm scheduling from the readmap cleanup | ||
17 | routine and makes sure the alarm is re-added after the expiration | ||
18 | process only when it was not triggered by SIGUSR1. | ||
19 | |||
20 | I couldn't think of any use case to justify keeping these alarms: | ||
21 | it's critical to have the alarm ticking every timeout/4 seconds, | ||
22 | but more than one periodic alarm running doesn't seem to make | ||
23 | sense. | ||
24 | --- | ||
25 | |||
26 | CHANGELOG | 1 + | ||
27 | daemon/state.c | 6 +----- | ||
28 | 2 files changed, 2 insertions(+), 5 deletions(-) | ||
29 | |||
30 | |||
31 | diff --git a/CHANGELOG b/CHANGELOG | ||
32 | index c9be73e..4cf5621 100644 | ||
33 | --- a/CHANGELOG | ||
34 | +++ b/CHANGELOG | ||
35 | @@ -22,6 +22,7 @@ | ||
36 | - fix init script status return. | ||
37 | - fix use get_proximity() without libtirpc. | ||
38 | - don't use dirent d_type to filter out files in scandir() | ||
39 | +- don't schedule new alarms after readmap. | ||
40 | |||
41 | 25/07/2012 autofs-5.0.7 | ||
42 | ======================= | ||
43 | diff --git a/daemon/state.c b/daemon/state.c | ||
44 | index b451c56..6e23022 100644 | ||
45 | --- a/daemon/state.c | ||
46 | +++ b/daemon/state.c | ||
47 | @@ -144,7 +144,7 @@ void expire_cleanup(void *arg) | ||
48 | ap->submount = 2; | ||
49 | } | ||
50 | |||
51 | - if (!ap->submount) | ||
52 | + if (ap->state == ST_EXPIRE && !ap->submount) | ||
53 | alarm_add(ap, ap->exp_runfreq); | ||
54 | |||
55 | /* FALLTHROUGH */ | ||
56 | @@ -330,13 +330,9 @@ static void do_readmap_cleanup(void *arg) | ||
57 | ap = ra->ap; | ||
58 | |||
59 | st_mutex_lock(); | ||
60 | - | ||
61 | ap->readmap_thread = 0; | ||
62 | st_set_done(ap); | ||
63 | - if (!ap->submount) | ||
64 | - alarm_add(ap, ap->exp_runfreq); | ||
65 | st_ready(ap); | ||
66 | - | ||
67 | st_mutex_unlock(); | ||
68 | |||
69 | free(ra); | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-use-dirent-d_type-to-filter-out-files-in-scandir.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-use-dirent-d_type-to-filter-out-files-in-scandir.patch new file mode 100644 index 0000000000..9c9d99b953 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-use-dirent-d_type-to-filter-out-files-in-scandir.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | autofs-5.0.7 - don't use dirent d_type to filter out files in scandir() | ||
2 | |||
3 | From: Leonardo Chiquitto <leonardo.lists@gmail.com> | ||
4 | |||
5 | The "d_type" field of a dirent structure is not filled in by all | ||
6 | file systems (XFS being one example), so we can't rely on it to | ||
7 | check file types. | ||
8 | --- | ||
9 | |||
10 | CHANGELOG | 1 + | ||
11 | modules/lookup_dir.c | 4 ---- | ||
12 | 2 files changed, 1 insertions(+), 4 deletions(-) | ||
13 | |||
14 | |||
15 | diff --git a/CHANGELOG b/CHANGELOG | ||
16 | index 460bd27..c9be73e 100644 | ||
17 | --- a/CHANGELOG | ||
18 | +++ b/CHANGELOG | ||
19 | @@ -21,6 +21,7 @@ | ||
20 | - fix submount offset delete. | ||
21 | - fix init script status return. | ||
22 | - fix use get_proximity() without libtirpc. | ||
23 | +- don't use dirent d_type to filter out files in scandir() | ||
24 | |||
25 | 25/07/2012 autofs-5.0.7 | ||
26 | ======================= | ||
27 | diff --git a/modules/lookup_dir.c b/modules/lookup_dir.c | ||
28 | index 658cc29..33901c0 100644 | ||
29 | --- a/modules/lookup_dir.c | ||
30 | +++ b/modules/lookup_dir.c | ||
31 | @@ -103,10 +103,6 @@ static int acceptable_dirent_p(const struct dirent *e) | ||
32 | { | ||
33 | size_t namesz; | ||
34 | |||
35 | - | ||
36 | - if (!(e->d_type == DT_REG || e->d_type == DT_LNK)) | ||
37 | - return 0; | ||
38 | - | ||
39 | namesz = strlen(e->d_name); | ||
40 | if (!namesz) | ||
41 | return 0; | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-wait-forever-to-restart.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-wait-forever-to-restart.patch new file mode 100644 index 0000000000..9973b47faf --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-dont-wait-forever-to-restart.patch | |||
@@ -0,0 +1,54 @@ | |||
1 | autofs-5.0.7 - dont wait forever to restart | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | When restarting autofs the daemon must be stopped before it is started | ||
6 | again if it is to function properly. At the moment the init script waits | ||
7 | forever which is not ok if the daemon won't exit for some reason. | ||
8 | |||
9 | So, if the daemon is still running after the stop, run stop() again, wait | ||
10 | a bit longer and if it still hasn't stopped kill it with a SIGKILL to clear | ||
11 | the way for the startup. | ||
12 | --- | ||
13 | |||
14 | CHANGELOG | 1 + | ||
15 | redhat/autofs.init.in | 13 ++++++++++--- | ||
16 | 2 files changed, 11 insertions(+), 3 deletions(-) | ||
17 | |||
18 | |||
19 | diff --git a/CHANGELOG b/CHANGELOG | ||
20 | index 6051723..93b9c26 100644 | ||
21 | --- a/CHANGELOG | ||
22 | +++ b/CHANGELOG | ||
23 | @@ -5,6 +5,7 @@ | ||
24 | - fix ipv6 proximity calculation. | ||
25 | - fix parse buffer initialization. | ||
26 | - fix typo in automount(8). | ||
27 | +- dont wait forever to restart. | ||
28 | |||
29 | 25/07/2012 autofs-5.0.7 | ||
30 | ======================= | ||
31 | diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in | ||
32 | index ec6d5d6..cd5cb34 100644 | ||
33 | --- a/redhat/autofs.init.in | ||
34 | +++ b/redhat/autofs.init.in | ||
35 | @@ -129,9 +129,16 @@ function restart() { | ||
36 | status autofs > /dev/null 2>&1 | ||
37 | if [ $? -eq 0 ]; then | ||
38 | stop | ||
39 | - while [ -n "`pidof $prog`" ] ; do | ||
40 | - sleep 5 | ||
41 | - done | ||
42 | + if [ -n "`pidof $prog`" ]; then | ||
43 | + # If we failed to stop, try at least one more time | ||
44 | + # after waiting a little while | ||
45 | + sleep 20 | ||
46 | + stop | ||
47 | + auto_pid=`pidof $prog` | ||
48 | + if [ -n "$auto_pid" ]; then | ||
49 | + kill -9 $auto_pid | ||
50 | + fi | ||
51 | + fi | ||
52 | fi | ||
53 | start | ||
54 | } | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-automounter-support-on-parisc.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-automounter-support-on-parisc.patch new file mode 100644 index 0000000000..e00fdc1901 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-automounter-support-on-parisc.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | autofs-5.0.7 - fix automounter support on parisc | ||
2 | |||
3 | From: Helge Deller <deller@gmx.de> | ||
4 | |||
5 | This patch fixes automounter support on the parisc architecture with | ||
6 | 64-bit kernel and 32-bit userspace. | ||
7 | |||
8 | Signed-off-by: Helge Deller <deller@gmx.de> | ||
9 | --- | ||
10 | daemon/automount.c | 1 + | ||
11 | 1 file changed, 1 insertion(+) | ||
12 | |||
13 | diff --git a/daemon/automount.c b/daemon/automount.c | ||
14 | index 4a3eb3d..4c651cf 100644 | ||
15 | --- a/daemon/automount.c | ||
16 | +++ b/daemon/automount.c | ||
17 | @@ -610,6 +610,7 @@ static size_t get_kpkt_len(void) | ||
18 | if (strcmp(un.machine, "alpha") == 0 || | ||
19 | strcmp(un.machine, "ia64") == 0 || | ||
20 | strcmp(un.machine, "x86_64") == 0 || | ||
21 | + strcmp(un.machine, "parisc64") == 0 || | ||
22 | strcmp(un.machine, "ppc64") == 0) | ||
23 | pkt_len += 4; | ||
24 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-file-descriptor-leak-when-reloading-the-daemon.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-file-descriptor-leak-when-reloading-the-daemon.patch new file mode 100644 index 0000000000..8ce6c0f9e3 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-file-descriptor-leak-when-reloading-the-daemon.patch | |||
@@ -0,0 +1,179 @@ | |||
1 | autofs-5.0.7 - fix file descriptor leak when reloading the daemon | ||
2 | |||
3 | From: Leonardo Chiquitto <leonardo.lists@gmail.com> | ||
4 | |||
5 | A customer reported that AutoFS may leak file descriptors when some | ||
6 | maps are modified and the daemon reloaded. I'm able to reproduce the | ||
7 | problem on 5.0.7 by following these steps: | ||
8 | |||
9 | 1. Configure a simple direct mount: | ||
10 | |||
11 | # cat /etc/auto.master | ||
12 | /- /etc/auto.direct | ||
13 | |||
14 | # cat /etc/auto.direct | ||
15 | /nfs server:/nfs | ||
16 | |||
17 | 2. Start the automounter and do NOT trigger the mount | ||
18 | |||
19 | 3. Replace /etc/auto.direct with: | ||
20 | |||
21 | # cat /etc/auto.direct | ||
22 | /nfs/1 server:/nfs | ||
23 | /nfs/2 server:/nfs | ||
24 | |||
25 | 4. Reload: | ||
26 | |||
27 | # kill -HUP $(pidof automount) | ||
28 | |||
29 | >From now on, every reload will leak a file descriptor: | ||
30 | |||
31 | # ls -la /proc/$(pidof automount)/fd | grep /nfs | ||
32 | lr-x------ 1 root root 64 Aug 14 22:08 11 -> /nfs | ||
33 | lr-x------ 1 root root 64 Aug 14 22:08 12 -> /nfs | ||
34 | lr-x------ 1 root root 64 Aug 14 22:08 13 -> /nfs | ||
35 | lr-x------ 1 root root 64 Aug 14 22:08 14 -> /nfs | ||
36 | lr-x------ 1 root root 64 Aug 14 22:08 5 -> /nfs | ||
37 | |||
38 | I've investigated the problem and discovered that the leak happens in | ||
39 | do_umount_autofs_direct(): | ||
40 | |||
41 | - edit imk | ||
42 | The same leak is present in umount_autofs_offset() also. | ||
43 | Updated patch to cover that too. | ||
44 | - end edit | ||
45 | |||
46 | int do_umount_autofs_direct(struct autofs_point *ap, struct mnt_list | ||
47 | *mnts, struct mapent *me) | ||
48 | { | ||
49 | (...) | ||
50 | if (me->ioctlfd != -1) { | ||
51 | if (tree_is_mounted(mnts, me->key, MNTS_REAL)) { | ||
52 | error(ap->logopt, | ||
53 | "attempt to umount busy direct mount %s", | ||
54 | me->key); | ||
55 | return 1; | ||
56 | } | ||
57 | ioctlfd = me->ioctlfd; | ||
58 | } else // ioctlfd == -1 | ||
59 | ops->open(ap->logopt, &ioctlfd, me->dev, me->key); <= we open it here | ||
60 | |||
61 | if (ioctlfd >= 0) { | ||
62 | unsigned int status = 1; | ||
63 | |||
64 | rv = ops->askumount(ap->logopt, ioctlfd, &status); | ||
65 | /// at this point, rv == 0 and status == 0 | ||
66 | if (rv) { | ||
67 | char *estr = strerror_r(errno, buf, MAX_ERR_BUF); | ||
68 | error(ap->logopt, "ioctl failed: %s", estr); | ||
69 | return 1; | ||
70 | } else if (!status) { | ||
71 | /// at this point, ap->state == ST_READMAP | ||
72 | if (ap->state != ST_SHUTDOWN_FORCE) { | ||
73 | error(ap->logopt, | ||
74 | "ask umount returned busy for %s", | ||
75 | me->key); | ||
76 | return 1; <= we return here, without closing the fd | ||
77 | } else { | ||
78 | me->ioctlfd = -1; | ||
79 | ops->catatonic(ap->logopt, ioctlfd); | ||
80 | ops->close(ap->logopt, ioctlfd); | ||
81 | goto force_umount; | ||
82 | } | ||
83 | (...) | ||
84 | --- | ||
85 | CHANGELOG | 1 + | ||
86 | daemon/direct.c | 19 ++++++++++++++++--- | ||
87 | 2 files changed, 17 insertions(+), 3 deletions(-) | ||
88 | |||
89 | diff --git a/CHANGELOG b/CHANGELOG | ||
90 | index 46ef335..a7ed212 100644 | ||
91 | --- a/CHANGELOG | ||
92 | +++ b/CHANGELOG | ||
93 | @@ -30,6 +30,7 @@ | ||
94 | - workaround missing GNU versionsort extension. | ||
95 | - dont fail on master map self include. | ||
96 | - fix wildcard multi map regression. | ||
97 | +- fix file descriptor leak when reloading the daemon. | ||
98 | |||
99 | 25/07/2012 autofs-5.0.7 | ||
100 | ======================= | ||
101 | diff --git a/daemon/direct.c b/daemon/direct.c | ||
102 | index 3e09c5d..228a666 100644 | ||
103 | --- a/daemon/direct.c | ||
104 | +++ b/daemon/direct.c | ||
105 | @@ -86,7 +86,8 @@ int do_umount_autofs_direct(struct autofs_point *ap, struct mnt_list *mnts, stru | ||
106 | { | ||
107 | struct ioctl_ops *ops = get_ioctl_ops(); | ||
108 | char buf[MAX_ERR_BUF]; | ||
109 | - int ioctlfd, rv, left, retries; | ||
110 | + int ioctlfd = -1, rv, left, retries; | ||
111 | + int opened = 0; | ||
112 | |||
113 | left = umount_multi(ap, me->key, 0); | ||
114 | if (left) { | ||
115 | @@ -103,8 +104,10 @@ int do_umount_autofs_direct(struct autofs_point *ap, struct mnt_list *mnts, stru | ||
116 | return 1; | ||
117 | } | ||
118 | ioctlfd = me->ioctlfd; | ||
119 | - } else | ||
120 | + } else { | ||
121 | ops->open(ap->logopt, &ioctlfd, me->dev, me->key); | ||
122 | + opened = 1; | ||
123 | + } | ||
124 | |||
125 | if (ioctlfd >= 0) { | ||
126 | unsigned int status = 1; | ||
127 | @@ -113,12 +116,16 @@ int do_umount_autofs_direct(struct autofs_point *ap, struct mnt_list *mnts, stru | ||
128 | if (rv) { | ||
129 | char *estr = strerror_r(errno, buf, MAX_ERR_BUF); | ||
130 | error(ap->logopt, "ioctl failed: %s", estr); | ||
131 | + if (opened && ioctlfd != -1) | ||
132 | + ops->close(ap->logopt, ioctlfd); | ||
133 | return 1; | ||
134 | } else if (!status) { | ||
135 | if (ap->state != ST_SHUTDOWN_FORCE) { | ||
136 | error(ap->logopt, | ||
137 | "ask umount returned busy for %s", | ||
138 | me->key); | ||
139 | + if (opened && ioctlfd != -1) | ||
140 | + ops->close(ap->logopt, ioctlfd); | ||
141 | return 1; | ||
142 | } else { | ||
143 | me->ioctlfd = -1; | ||
144 | @@ -536,7 +543,8 @@ int umount_autofs_offset(struct autofs_point *ap, struct mapent *me) | ||
145 | { | ||
146 | struct ioctl_ops *ops = get_ioctl_ops(); | ||
147 | char buf[MAX_ERR_BUF]; | ||
148 | - int ioctlfd, rv = 1, retries; | ||
149 | + int ioctlfd = -1, rv = 1, retries; | ||
150 | + int opened = 0; | ||
151 | |||
152 | if (me->ioctlfd != -1) { | ||
153 | if (is_mounted(_PATH_MOUNTED, me->key, MNTS_REAL)) { | ||
154 | @@ -554,6 +562,7 @@ int umount_autofs_offset(struct autofs_point *ap, struct mapent *me) | ||
155 | return 0; | ||
156 | } | ||
157 | ops->open(ap->logopt, &ioctlfd, me->dev, me->key); | ||
158 | + opened = 1; | ||
159 | } | ||
160 | |||
161 | if (ioctlfd >= 0) { | ||
162 | @@ -563,6 +572,8 @@ int umount_autofs_offset(struct autofs_point *ap, struct mapent *me) | ||
163 | if (rv) { | ||
164 | char *estr = strerror_r(errno, buf, MAX_ERR_BUF); | ||
165 | logerr("ioctl failed: %s", estr); | ||
166 | + if (opened && ioctlfd != -1) | ||
167 | + ops->close(ap->logopt, ioctlfd); | ||
168 | return 1; | ||
169 | } else if (!status) { | ||
170 | if (ap->state != ST_SHUTDOWN_FORCE) { | ||
171 | @@ -570,6 +581,8 @@ int umount_autofs_offset(struct autofs_point *ap, struct mapent *me) | ||
172 | error(ap->logopt, | ||
173 | "ask umount returned busy for %s", | ||
174 | me->key); | ||
175 | + if (opened && ioctlfd != -1) | ||
176 | + ops->close(ap->logopt, ioctlfd); | ||
177 | return 1; | ||
178 | } else { | ||
179 | me->ioctlfd = -1; | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-init-script-status-return.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-init-script-status-return.patch new file mode 100644 index 0000000000..a08d62fc3e --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-init-script-status-return.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | autofs-5.0.7 - fix init script status return | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | The patch that added the piddir to configure to fix incorrect init | ||
6 | script status() function returns failed to actually return the value | ||
7 | to the user. | ||
8 | --- | ||
9 | |||
10 | CHANGELOG | 1 + | ||
11 | redhat/autofs.init.in | 2 +- | ||
12 | 2 files changed, 2 insertions(+), 1 deletions(-) | ||
13 | |||
14 | |||
15 | diff --git a/CHANGELOG b/CHANGELOG | ||
16 | index 76c1f73..5bcb1af 100644 | ||
17 | --- a/CHANGELOG | ||
18 | +++ b/CHANGELOG | ||
19 | @@ -19,6 +19,7 @@ | ||
20 | - Allow nsswitch.conf to not contain "automount:" lines. | ||
21 | - fix nobind man page description. | ||
22 | - fix submount offset delete. | ||
23 | +- fix init script status return. | ||
24 | |||
25 | 25/07/2012 autofs-5.0.7 | ||
26 | ======================= | ||
27 | diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in | ||
28 | index fe18b3e..9d008ff 100644 | ||
29 | --- a/redhat/autofs.init.in | ||
30 | +++ b/redhat/autofs.init.in | ||
31 | @@ -172,7 +172,7 @@ RETVAL=0 | ||
32 | case "$1" in | ||
33 | status) | ||
34 | status -p @@autofspiddir@@/autofs.pid -l autofs $prog | ||
35 | - exit 0; | ||
36 | + exit $?; | ||
37 | ;; | ||
38 | usage) | ||
39 | usage_message | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-ipv6-proximity-calculation.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-ipv6-proximity-calculation.patch new file mode 100644 index 0000000000..b341ecdd50 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-ipv6-proximity-calculation.patch | |||
@@ -0,0 +1,297 @@ | |||
1 | autofs-5.0.7 - fix ipv6 proximity calculation | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | The socket based ioctl used to get interface information only | ||
6 | return IPv4 information. Change get_proximity() function to use | ||
7 | getifaddrs(3) instead. | ||
8 | --- | ||
9 | |||
10 | CHANGELOG | 1 | ||
11 | modules/replicated.c | 149 ++++++++++++++------------------------------------ | ||
12 | 2 files changed, 42 insertions(+), 108 deletions(-) | ||
13 | |||
14 | |||
15 | diff --git a/CHANGELOG b/CHANGELOG | ||
16 | index dc38580..34c70fa 100644 | ||
17 | --- a/CHANGELOG | ||
18 | +++ b/CHANGELOG | ||
19 | @@ -2,6 +2,7 @@ | ||
20 | ======================= | ||
21 | - fix nobind sun escaped map entries. | ||
22 | - fix use cache entry after free in lookup_prune_one_cache(). | ||
23 | +- fix ipv6 proximity calculation. | ||
24 | |||
25 | 25/07/2012 autofs-5.0.7 | ||
26 | ======================= | ||
27 | diff --git a/modules/replicated.c b/modules/replicated.c | ||
28 | index 78046c6..bd6003b 100644 | ||
29 | --- a/modules/replicated.c | ||
30 | +++ b/modules/replicated.c | ||
31 | @@ -52,6 +52,7 @@ | ||
32 | #include <net/if.h> | ||
33 | #include <netinet/in.h> | ||
34 | #include <netdb.h> | ||
35 | +#include <ifaddrs.h> | ||
36 | |||
37 | #include "rpc_subs.h" | ||
38 | #include "replicated.h" | ||
39 | @@ -110,58 +111,18 @@ void seed_random(void) | ||
40 | return; | ||
41 | } | ||
42 | |||
43 | -static int alloc_ifreq(struct ifconf *ifc, int sock) | ||
44 | -{ | ||
45 | - int ret, lastlen = ifc_last_len, len = ifc_buf_len; | ||
46 | - char err_buf[MAX_ERR_BUF], *buf; | ||
47 | - | ||
48 | - while (1) { | ||
49 | - buf = malloc(len); | ||
50 | - if (!buf) { | ||
51 | - char *estr = strerror_r(errno, err_buf, MAX_ERR_BUF); | ||
52 | - logerr("malloc: %s", estr); | ||
53 | - return 0; | ||
54 | - } | ||
55 | - | ||
56 | - ifc->ifc_len = len; | ||
57 | - ifc->ifc_req = (struct ifreq *) buf; | ||
58 | - | ||
59 | - ret = ioctl(sock, SIOCGIFCONF, ifc); | ||
60 | - if (ret == -1) { | ||
61 | - char *estr = strerror_r(errno, err_buf, MAX_ERR_BUF); | ||
62 | - logerr("ioctl: %s", estr); | ||
63 | - free(buf); | ||
64 | - return 0; | ||
65 | - } | ||
66 | - | ||
67 | - if (ifc->ifc_len <= lastlen) | ||
68 | - break; | ||
69 | - | ||
70 | - lastlen = ifc->ifc_len; | ||
71 | - len += MAX_IFC_BUF; | ||
72 | - free(buf); | ||
73 | - } | ||
74 | - | ||
75 | - if (lastlen != ifc_last_len) { | ||
76 | - ifc_last_len = lastlen; | ||
77 | - ifc_buf_len = len; | ||
78 | - } | ||
79 | - | ||
80 | - return 1; | ||
81 | -} | ||
82 | - | ||
83 | static unsigned int get_proximity(struct sockaddr *host_addr) | ||
84 | { | ||
85 | + struct ifaddrs *ifa = NULL; | ||
86 | + struct ifaddrs *this; | ||
87 | struct sockaddr_in *addr, *msk_addr, *if_addr; | ||
88 | struct sockaddr_in6 *addr6, *msk6_addr, *if6_addr; | ||
89 | struct in_addr *hst_addr; | ||
90 | struct in6_addr *hst6_addr; | ||
91 | int addr_len; | ||
92 | - char buf[MAX_ERR_BUF], *ptr; | ||
93 | - struct ifconf ifc; | ||
94 | - struct ifreq *ifr, nmptr; | ||
95 | - int sock, ret, i; | ||
96 | + char buf[MAX_ERR_BUF]; | ||
97 | uint32_t mask, ha, ia, *mask6, *ha6, *ia6; | ||
98 | + int ret; | ||
99 | |||
100 | addr = NULL; | ||
101 | addr6 = NULL; | ||
102 | @@ -170,13 +131,14 @@ static unsigned int get_proximity(struct sockaddr *host_addr) | ||
103 | mask6 = NULL; | ||
104 | ha6 = NULL; | ||
105 | ia6 = NULL; | ||
106 | + ha = 0; | ||
107 | |||
108 | switch (host_addr->sa_family) { | ||
109 | case AF_INET: | ||
110 | addr = (struct sockaddr_in *) host_addr; | ||
111 | hst_addr = (struct in_addr *) &addr->sin_addr; | ||
112 | ha = ntohl((uint32_t) hst_addr->s_addr); | ||
113 | - addr_len = sizeof(hst_addr); | ||
114 | + addr_len = sizeof(*hst_addr); | ||
115 | break; | ||
116 | |||
117 | case AF_INET6: | ||
118 | @@ -186,7 +148,7 @@ static unsigned int get_proximity(struct sockaddr *host_addr) | ||
119 | addr6 = (struct sockaddr_in6 *) host_addr; | ||
120 | hst6_addr = (struct in6_addr *) &addr6->sin6_addr; | ||
121 | ha6 = &hst6_addr->s6_addr32[0]; | ||
122 | - addr_len = sizeof(hst6_addr); | ||
123 | + addr_len = sizeof(*hst6_addr); | ||
124 | break; | ||
125 | #endif | ||
126 | |||
127 | @@ -194,36 +156,29 @@ static unsigned int get_proximity(struct sockaddr *host_addr) | ||
128 | return PROXIMITY_ERROR; | ||
129 | } | ||
130 | |||
131 | - sock = open_sock(AF_INET, SOCK_DGRAM, 0); | ||
132 | - if (sock < 0) { | ||
133 | + ret = getifaddrs(&ifa); | ||
134 | + if (ret) { | ||
135 | char *estr = strerror_r(errno, buf, MAX_ERR_BUF); | ||
136 | - logerr("socket creation failed: %s", estr); | ||
137 | + logerr("getifaddrs: %s", estr); | ||
138 | return PROXIMITY_ERROR; | ||
139 | } | ||
140 | |||
141 | - if (!alloc_ifreq(&ifc, sock)) { | ||
142 | - close(sock); | ||
143 | - return PROXIMITY_ERROR; | ||
144 | - } | ||
145 | - | ||
146 | - /* For each interface */ | ||
147 | - | ||
148 | - /* Is the address a local interface */ | ||
149 | - i = 0; | ||
150 | - ptr = (char *) &ifc.ifc_buf[0]; | ||
151 | - | ||
152 | - while (ptr < (char *) ifc.ifc_req + ifc.ifc_len) { | ||
153 | - ifr = (struct ifreq *) ptr; | ||
154 | + this = ifa; | ||
155 | + while (this) { | ||
156 | + if (this->ifa_flags & IFF_POINTOPOINT || | ||
157 | + this->ifa_addr->sa_data == NULL) { | ||
158 | + this = this->ifa_next; | ||
159 | + continue; | ||
160 | + } | ||
161 | |||
162 | - switch (ifr->ifr_addr.sa_family) { | ||
163 | + switch (this->ifa_addr->sa_family) { | ||
164 | case AF_INET: | ||
165 | if (host_addr->sa_family == AF_INET6) | ||
166 | break; | ||
167 | - if_addr = (struct sockaddr_in *) &ifr->ifr_addr; | ||
168 | + if_addr = (struct sockaddr_in *) this->ifa_addr; | ||
169 | ret = memcmp(&if_addr->sin_addr, hst_addr, addr_len); | ||
170 | if (!ret) { | ||
171 | - close(sock); | ||
172 | - free(ifc.ifc_req); | ||
173 | + freeifaddrs(ifa); | ||
174 | return PROXIMITY_LOCAL; | ||
175 | } | ||
176 | break; | ||
177 | @@ -234,55 +189,41 @@ static unsigned int get_proximity(struct sockaddr *host_addr) | ||
178 | #else | ||
179 | if (host_addr->sa_family == AF_INET) | ||
180 | break; | ||
181 | - | ||
182 | - if6_addr = (struct sockaddr_in6 *) &ifr->ifr_addr; | ||
183 | + if6_addr = (struct sockaddr_in6 *) this->ifa_addr; | ||
184 | ret = memcmp(&if6_addr->sin6_addr, hst6_addr, addr_len); | ||
185 | if (!ret) { | ||
186 | - close(sock); | ||
187 | - free(ifc.ifc_req); | ||
188 | + freeifaddrs(ifa); | ||
189 | return PROXIMITY_LOCAL; | ||
190 | } | ||
191 | #endif | ||
192 | - | ||
193 | default: | ||
194 | break; | ||
195 | } | ||
196 | - | ||
197 | - i++; | ||
198 | - ptr = (char *) &ifc.ifc_req[i]; | ||
199 | + this = this->ifa_next; | ||
200 | } | ||
201 | |||
202 | - i = 0; | ||
203 | - ptr = (char *) &ifc.ifc_buf[0]; | ||
204 | - | ||
205 | - while (ptr < (char *) ifc.ifc_req + ifc.ifc_len) { | ||
206 | - ifr = (struct ifreq *) ptr; | ||
207 | - | ||
208 | - nmptr = *ifr; | ||
209 | - ret = ioctl(sock, SIOCGIFNETMASK, &nmptr); | ||
210 | - if (ret == -1) { | ||
211 | - char *estr = strerror_r(errno, buf, MAX_ERR_BUF); | ||
212 | - logerr("ioctl: %s", estr); | ||
213 | - close(sock); | ||
214 | - free(ifc.ifc_req); | ||
215 | - return PROXIMITY_ERROR; | ||
216 | + this = ifa; | ||
217 | + while (this) { | ||
218 | + if (this->ifa_flags & IFF_POINTOPOINT || | ||
219 | + this->ifa_addr->sa_data == NULL) { | ||
220 | + this = this->ifa_next; | ||
221 | + continue; | ||
222 | } | ||
223 | |||
224 | - switch (ifr->ifr_addr.sa_family) { | ||
225 | + switch (this->ifa_addr->sa_family) { | ||
226 | case AF_INET: | ||
227 | if (host_addr->sa_family == AF_INET6) | ||
228 | break; | ||
229 | - if_addr = (struct sockaddr_in *) &ifr->ifr_addr; | ||
230 | + if_addr = (struct sockaddr_in *) this->ifa_addr; | ||
231 | ia = ntohl((uint32_t) if_addr->sin_addr.s_addr); | ||
232 | |||
233 | - /* Is the address within a localiy attached subnet */ | ||
234 | + /* Is the address within a localy attached subnet */ | ||
235 | |||
236 | - msk_addr = (struct sockaddr_in *) &nmptr.ifr_netmask; | ||
237 | + msk_addr = (struct sockaddr_in *) this->ifa_netmask; | ||
238 | mask = ntohl((uint32_t) msk_addr->sin_addr.s_addr); | ||
239 | |||
240 | if ((ia & mask) == (ha & mask)) { | ||
241 | - close(sock); | ||
242 | - free(ifc.ifc_req); | ||
243 | + freeifaddrs(ifa); | ||
244 | return PROXIMITY_SUBNET; | ||
245 | } | ||
246 | |||
247 | @@ -304,8 +245,7 @@ static unsigned int get_proximity(struct sockaddr *host_addr) | ||
248 | break; | ||
249 | |||
250 | if ((ia & mask) == (ha & mask)) { | ||
251 | - close(sock); | ||
252 | - free(ifc.ifc_req); | ||
253 | + freeifaddrs(ifa); | ||
254 | return PROXIMITY_NET; | ||
255 | } | ||
256 | break; | ||
257 | @@ -316,35 +256,28 @@ static unsigned int get_proximity(struct sockaddr *host_addr) | ||
258 | #else | ||
259 | if (host_addr->sa_family == AF_INET) | ||
260 | break; | ||
261 | - | ||
262 | - if6_addr = (struct sockaddr_in6 *) &ifr->ifr_addr; | ||
263 | + if6_addr = (struct sockaddr_in6 *) this->ifa_addr; | ||
264 | ia6 = &if6_addr->sin6_addr.s6_addr32[0]; | ||
265 | |||
266 | /* Is the address within the network of the interface */ | ||
267 | |||
268 | - msk6_addr = (struct sockaddr_in6 *) &nmptr.ifr_netmask; | ||
269 | + msk6_addr = (struct sockaddr_in6 *) this->ifa_netmask; | ||
270 | mask6 = &msk6_addr->sin6_addr.s6_addr32[0]; | ||
271 | |||
272 | if (ipv6_mask_cmp(ha6, ia6, mask6)) { | ||
273 | - close(sock); | ||
274 | - free(ifc.ifc_req); | ||
275 | + freeifaddrs(ifa); | ||
276 | return PROXIMITY_SUBNET; | ||
277 | } | ||
278 | |||
279 | /* How do we define "local network" in ipv6? */ | ||
280 | #endif | ||
281 | - break; | ||
282 | - | ||
283 | default: | ||
284 | break; | ||
285 | } | ||
286 | - | ||
287 | - i++; | ||
288 | - ptr = (char *) &ifc.ifc_req[i]; | ||
289 | + this = this->ifa_next; | ||
290 | } | ||
291 | |||
292 | - close(sock); | ||
293 | - free(ifc.ifc_req); | ||
294 | + freeifaddrs(ifa); | ||
295 | |||
296 | return PROXIMITY_OTHER; | ||
297 | } | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-lib-deps.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-lib-deps.patch new file mode 100644 index 0000000000..09fea495df --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-lib-deps.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | From 54a9bd28a307dd74df044d779ca85adcf36aa202 Mon Sep 17 00:00:00 2001 | ||
2 | From: Joe MacDonald <joe.macdonald@windriver.com> | ||
3 | Date: Tue, 18 Jun 2013 10:05:21 -0400 | ||
4 | Subject: [PATCH] Fix the dependency issue | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | autofs's lib sources have a dependency on a number of files that are | ||
9 | generated by rpcgen during buildtime | ||
10 | |||
11 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
12 | Signed-off-by: Joe MacDonald <joe.macdonald@windriver.com> | ||
13 | --- | ||
14 | lib/Makefile | 1 + | ||
15 | 1 file changed, 1 insertion(+) | ||
16 | |||
17 | diff --git a/lib/Makefile b/lib/Makefile | ||
18 | index 5418009..bff4e1d 100644 | ||
19 | --- a/lib/Makefile | ||
20 | +++ b/lib/Makefile | ||
21 | @@ -75,3 +75,4 @@ install: all | ||
22 | clean: | ||
23 | rm -f $(LIB) $(RPCS) $(OBJS) $(YACCSRC) *.output *~ | ||
24 | |||
25 | +$(OBJS): $(RPCS) | ||
26 | -- | ||
27 | 1.7.10.4 | ||
28 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-libtirpc-build-option.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-libtirpc-build-option.patch new file mode 100644 index 0000000000..8ad2afacff --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-libtirpc-build-option.patch | |||
@@ -0,0 +1,66 @@ | |||
1 | autofs-5.0.7 - fix libtirpc build option | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | |||
6 | --- | ||
7 | CHANGELOG | 1 + | ||
8 | autofs.spec | 17 ++++++++++++++++- | ||
9 | 2 files changed, 17 insertions(+), 1 deletion(-) | ||
10 | |||
11 | diff --git a/CHANGELOG b/CHANGELOG | ||
12 | index e848bcd..b6b2679 100644 | ||
13 | --- a/CHANGELOG | ||
14 | +++ b/CHANGELOG | ||
15 | @@ -34,6 +34,7 @@ | ||
16 | - depricate nosymlink pseudo option. | ||
17 | - add symlink pseudo option. | ||
18 | - fix requires in spec file. | ||
19 | +- fix libtirpc build option to require libtirpc-devel if needed. | ||
20 | |||
21 | 25/07/2012 autofs-5.0.7 | ||
22 | ======================= | ||
23 | diff --git a/autofs.spec b/autofs.spec | ||
24 | index 703f7a9..f77acc1 100644 | ||
25 | --- a/autofs.spec | ||
26 | +++ b/autofs.spec | ||
27 | @@ -12,6 +12,10 @@ | ||
28 | # disable them. | ||
29 | %define with_systemd %{?_without_systemd: 0} %{?!_without_systemd: 1} | ||
30 | |||
31 | +# Use --without libtirpc in your rpmbuild command or force values to 0 to | ||
32 | +# disable them. | ||
33 | +%define with_libtirpc %{?_without_libtirpc: 0} %{?!_without_libtirpc: 1} | ||
34 | + | ||
35 | Summary: A tool from automatically mounting and umounting filesystems. | ||
36 | Name: autofs | ||
37 | %define version 5.0.7 | ||
38 | @@ -25,6 +29,9 @@ Buildroot: %{_tmppath}/%{name}-tmp | ||
39 | %if %{with_systemd} | ||
40 | BuildRequires: systemd-units | ||
41 | %endif | ||
42 | +%if %{with_libtirpc} | ||
43 | +BuildRequires: libtirpc-devel | ||
44 | +%endif | ||
45 | BuildRequires: autoconf, hesiod-devel, openldap-devel, bison, flex, cyrus-sasl-devel | ||
46 | Requires: chkconfig | ||
47 | Requires: /bin/bash mktemp sed textutils sh-utils grep /bin/ps | ||
48 | @@ -72,9 +79,17 @@ echo %{version}-%{release} > .version | ||
49 | %define _unitdir %{?_unitdir:/lib/systemd/system} | ||
50 | %define systemd_configure_arg --with-systemd | ||
51 | %endif | ||
52 | +%if %{with_libtirpc} | ||
53 | + %define libtirpc_configure_arg --with-libtirpc | ||
54 | +%endif | ||
55 | |||
56 | %build | ||
57 | -CFLAGS="$RPM_OPT_FLAGS -Wall" ./configure --libdir=%{_libdir} --disable-mount-locking --enable-ignore-busy --with-libtirpc %{?systemd_configure_arg:} | ||
58 | +CFLAGS="$RPM_OPT_FLAGS -Wall" \ | ||
59 | +./configure --libdir=%{_libdir} \ | ||
60 | + --disable-mount-locking \ | ||
61 | + --enable-ignore-busy \ | ||
62 | + %{?systemd_configure_arg:} \ | ||
63 | + %{?libtirpc_configure_arg:} | ||
64 | CFLAGS="$RPM_OPT_FLAGS -Wall" make initdir=/etc/rc.d/init.d DONTSTRIP=1 | ||
65 | |||
66 | %install | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-map-entry-duplicate-offset-detection.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-map-entry-duplicate-offset-detection.patch new file mode 100644 index 0000000000..126d9a25b0 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-map-entry-duplicate-offset-detection.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | autofs-5.0.7 - fix map entry duplicate offset detection | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | Recent changes broke the detection of duplicate offsets in map entries. | ||
6 | --- | ||
7 | |||
8 | CHANGELOG | 1 + | ||
9 | lib/cache.c | 2 +- | ||
10 | 2 files changed, 2 insertions(+), 1 deletions(-) | ||
11 | |||
12 | |||
13 | diff --git a/CHANGELOG b/CHANGELOG | ||
14 | index 8f6bb3a..bd0dd82 100644 | ||
15 | --- a/CHANGELOG | ||
16 | +++ b/CHANGELOG | ||
17 | @@ -15,6 +15,7 @@ | ||
18 | - fix recursive mount deadlock. | ||
19 | - increase file map read buffer size. | ||
20 | - handle new location of systemd. | ||
21 | +- fix map entry duplicate offset detection. | ||
22 | |||
23 | 25/07/2012 autofs-5.0.7 | ||
24 | ======================= | ||
25 | diff --git a/lib/cache.c b/lib/cache.c | ||
26 | index 9179ad5..1e05a99 100644 | ||
27 | --- a/lib/cache.c | ||
28 | +++ b/lib/cache.c | ||
29 | @@ -659,7 +659,7 @@ int cache_update_offset(struct mapent_cache *mc, const char *mkey, const char *k | ||
30 | |||
31 | me = cache_lookup_distinct(mc, key); | ||
32 | if (me && me->age == age) { | ||
33 | - if (me->multi != owner) | ||
34 | + if (me->multi == owner) | ||
35 | return CHE_DUPLICATE; | ||
36 | } | ||
37 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-nobind-man-page-description.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-nobind-man-page-description.patch new file mode 100644 index 0000000000..41328a0e49 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-nobind-man-page-description.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | autofs-5.0.7 - fix nobind man page description | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | Update auto.master(5) to better describe the behavior of the "nobind" | ||
6 | option when used with direct mounts maps. | ||
7 | --- | ||
8 | |||
9 | CHANGELOG | 1 + | ||
10 | man/auto.master.5.in | 10 +++++++--- | ||
11 | 2 files changed, 8 insertions(+), 3 deletions(-) | ||
12 | |||
13 | |||
14 | diff --git a/CHANGELOG b/CHANGELOG | ||
15 | index 16ac2a0..7eb7235 100644 | ||
16 | --- a/CHANGELOG | ||
17 | +++ b/CHANGELOG | ||
18 | @@ -17,6 +17,7 @@ | ||
19 | - handle new location of systemd. | ||
20 | - fix map entry duplicate offset detection. | ||
21 | - Allow nsswitch.conf to not contain "automount:" lines. | ||
22 | +- fix nobind man page description. | ||
23 | |||
24 | 25/07/2012 autofs-5.0.7 | ||
25 | ======================= | ||
26 | diff --git a/man/auto.master.5.in b/man/auto.master.5.in | ||
27 | index 21d7544..8007542 100644 | ||
28 | --- a/man/auto.master.5.in | ||
29 | +++ b/man/auto.master.5.in | ||
30 | @@ -151,9 +151,13 @@ can't be mounted. | ||
31 | This is an autofs specific option that is a pseudo mount option and | ||
32 | so is given without a leading dash. It may be used either in the master | ||
33 | map entry (so it effects all the map entries) or with individual map | ||
34 | -entries to prevent bind mounting of local NFS filesystems. Bind mounting | ||
35 | -of NFS file systems can also be prevented for specific map entrys by | ||
36 | -adding the "port=" mount option to the entries. | ||
37 | +entries to prevent bind mounting of local NFS filesystems. For direct | ||
38 | +mount maps the option is only effective if specified on the first direct | ||
39 | +map entry and is applied to all direct mount maps in the master map. It | ||
40 | +is ignored if given on subsequent direct map entries. It may be used | ||
41 | +on individual map entries of both types. Bind mounting of NFS file | ||
42 | +systems can also be prevented for specific map entrys by adding the | ||
43 | +"port=" mount option to the entries. | ||
44 | .TP | ||
45 | .I "\-r, \-\-random-multimount-selection" | ||
46 | Enables the use of ramdom selection when choosing a host from a | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch new file mode 100644 index 0000000000..b5d7ad26ca --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | autofs-5.0.7 - fix nobind sun escaped map entries | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | If a map contains a Sun colon escape to indicate the mount is a local | ||
6 | file system and the "nobind" option is present there is no hostname in | ||
7 | the mount location and the mount fails. | ||
8 | --- | ||
9 | |||
10 | CHANGELOG | 4 ++++ | ||
11 | modules/mount_nfs.c | 5 +++-- | ||
12 | 2 files changed, 7 insertions(+), 2 deletions(-) | ||
13 | |||
14 | |||
15 | diff --git a/CHANGELOG b/CHANGELOG | ||
16 | index 67fdcec..faf4c80 100644 | ||
17 | --- a/CHANGELOG | ||
18 | +++ b/CHANGELOG | ||
19 | @@ -1,3 +1,7 @@ | ||
20 | +??/??/2012 autofs-5.0.8 | ||
21 | +======================= | ||
22 | +- fix nobind sun escaped map entries. | ||
23 | + | ||
24 | 25/07/2012 autofs-5.0.7 | ||
25 | ======================= | ||
26 | - fix ipv6 name for lookup fix. | ||
27 | diff --git a/modules/mount_nfs.c b/modules/mount_nfs.c | ||
28 | index 9b8e5f1..bbbb1de 100644 | ||
29 | --- a/modules/mount_nfs.c | ||
30 | +++ b/modules/mount_nfs.c | ||
31 | @@ -263,13 +263,14 @@ int mount_mount(struct autofs_point *ap, const char *root, const char *name, int | ||
32 | } else | ||
33 | strcpy(loc, n_addr); | ||
34 | } else { | ||
35 | - loc = malloc(strlen(this->name) + strlen(this->path) + 2); | ||
36 | + char *host = this->name ? this->name : "localhost"; | ||
37 | + loc = malloc(strlen(host) + strlen(this->path) + 2); | ||
38 | if (!loc) { | ||
39 | char *estr = strerror_r(errno, buf, MAX_ERR_BUF); | ||
40 | error(ap->logopt, "malloc: %s", estr); | ||
41 | goto forced_fail; | ||
42 | } | ||
43 | - strcpy(loc, this->name); | ||
44 | + strcpy(loc, host); | ||
45 | } | ||
46 | strcat(loc, ":"); | ||
47 | strcat(loc, this->path); | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-null-map-entry-order-handling.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-null-map-entry-order-handling.patch new file mode 100644 index 0000000000..610afaaa7a --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-null-map-entry-order-handling.patch | |||
@@ -0,0 +1,81 @@ | |||
1 | autofs-5.0.7 - fix null map entry order handling | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | If a null map entry appears after a corresponding indirect map entry | ||
6 | autofs doesn't handle it properly. | ||
7 | |||
8 | Since it appears after the map entry it should'nt affect it but autofs | ||
9 | doesn't account for this case and assumes the map entry is already | ||
10 | mounted and tries to shut it down causing attempted access to facilities | ||
11 | that don't exist. | ||
12 | --- | ||
13 | |||
14 | CHANGELOG | 1 + | ||
15 | lib/master.c | 32 +++++++++++++++++++++++++++++--- | ||
16 | 2 files changed, 30 insertions(+), 3 deletions(-) | ||
17 | |||
18 | |||
19 | diff --git a/CHANGELOG b/CHANGELOG | ||
20 | index 7b8d185..79cf673 100644 | ||
21 | --- a/CHANGELOG | ||
22 | +++ b/CHANGELOG | ||
23 | @@ -7,6 +7,7 @@ | ||
24 | - fix typo in automount(8). | ||
25 | - dont wait forever to restart. | ||
26 | - add timeout option description to man page. | ||
27 | +- fix null map entry order handling. | ||
28 | |||
29 | 25/07/2012 autofs-5.0.7 | ||
30 | ======================= | ||
31 | diff --git a/lib/master.c b/lib/master.c | ||
32 | index 904b13d..a0e62f2 100644 | ||
33 | --- a/lib/master.c | ||
34 | +++ b/lib/master.c | ||
35 | @@ -1179,9 +1179,35 @@ int master_mount_mounts(struct master *master, time_t age, int readall) | ||
36 | |||
37 | cache_readlock(nc); | ||
38 | ne = cache_lookup_distinct(nc, this->path); | ||
39 | - if (ne && this->age > ne->age) { | ||
40 | + /* | ||
41 | + * If this path matched a nulled entry the master map entry | ||
42 | + * must be an indirect mount so the master map entry line | ||
43 | + * number may be obtained from this->maps. | ||
44 | + */ | ||
45 | + if (ne) { | ||
46 | + int lineno = ne->age; | ||
47 | cache_unlock(nc); | ||
48 | - st_add_task(ap, ST_SHUTDOWN_PENDING); | ||
49 | + | ||
50 | + /* null entry appears after map entry */ | ||
51 | + if (this->maps->master_line < lineno) { | ||
52 | + warn(ap->logopt, | ||
53 | + "ignoring null entry that appears after " | ||
54 | + "existing entry for %s", this->path); | ||
55 | + goto cont; | ||
56 | + } | ||
57 | + if (ap->state != ST_INIT) { | ||
58 | + st_add_task(ap, ST_SHUTDOWN_PENDING); | ||
59 | + continue; | ||
60 | + } | ||
61 | + /* | ||
62 | + * The map entry hasn't been started yet and we've | ||
63 | + * seen a preceeding null map entry for it so just | ||
64 | + * delete it from the master map entry list so it | ||
65 | + * doesn't get in the road. | ||
66 | + */ | ||
67 | + list_del_init(&this->list); | ||
68 | + master_free_mapent_sources(ap->entry, 1); | ||
69 | + master_free_mapent(ap->entry); | ||
70 | continue; | ||
71 | } | ||
72 | nested = cache_partial_match(nc, this->path); | ||
73 | @@ -1194,7 +1220,7 @@ int master_mount_mounts(struct master *master, time_t age, int readall) | ||
74 | cache_delete(nc, nested->key); | ||
75 | } | ||
76 | cache_unlock(nc); | ||
77 | - | ||
78 | +cont: | ||
79 | st_mutex_lock(); | ||
80 | |||
81 | state_pipe = this->ap->state_pipe[1]; | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-parse-buffer-initialization.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-parse-buffer-initialization.patch new file mode 100644 index 0000000000..22bd5da25d --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-parse-buffer-initialization.patch | |||
@@ -0,0 +1,51 @@ | |||
1 | autofs-5.0.7 - fix parse buffer initialization | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | When parsing a master map entry, if the mount point path is longer than | ||
6 | the following map string the lexical analyzer buffer may not have a null | ||
7 | terminator where it is expected. If the map name string also contains a | ||
8 | string that is the same as a map type at the end the map name the map | ||
9 | name is not constructed correctly because of this lack of a string | ||
10 | terminator in the buffer. | ||
11 | --- | ||
12 | |||
13 | CHANGELOG | 1 + | ||
14 | lib/master_tok.l | 4 +++- | ||
15 | 2 files changed, 4 insertions(+), 1 deletions(-) | ||
16 | |||
17 | |||
18 | diff --git a/CHANGELOG b/CHANGELOG | ||
19 | index 34c70fa..276d6ba 100644 | ||
20 | --- a/CHANGELOG | ||
21 | +++ b/CHANGELOG | ||
22 | @@ -3,6 +3,7 @@ | ||
23 | - fix nobind sun escaped map entries. | ||
24 | - fix use cache entry after free in lookup_prune_one_cache(). | ||
25 | - fix ipv6 proximity calculation. | ||
26 | +- fix parse buffer initialization. | ||
27 | |||
28 | 25/07/2012 autofs-5.0.7 | ||
29 | ======================= | ||
30 | diff --git a/lib/master_tok.l b/lib/master_tok.l | ||
31 | index 0d6edb7..30abb15 100644 | ||
32 | --- a/lib/master_tok.l | ||
33 | +++ b/lib/master_tok.l | ||
34 | @@ -74,7 +74,8 @@ int my_yyinput(char *, int); | ||
35 | #define unput(c) (*(char *) --line = c) | ||
36 | #endif | ||
37 | |||
38 | -char buff[1024]; | ||
39 | +#define BUFF_LEN 1024 | ||
40 | +char buff[BUFF_LEN]; | ||
41 | char *bptr; | ||
42 | char *optr = buff; | ||
43 | unsigned int tlen; | ||
44 | @@ -174,6 +175,7 @@ OPTNTOUT (-n{OPTWS}|-n{OPTWS}={OPTWS}|--negative-timeout{OPTWS}|--negative-timeo | ||
45 | *bptr = '\0'; | ||
46 | strcpy(master_lval.strtype, buff); | ||
47 | bptr = buff; | ||
48 | + memset(buff, 0, BUFF_LEN); | ||
49 | return(PATH); | ||
50 | } | ||
51 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-requires-in-spec-file.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-requires-in-spec-file.patch new file mode 100644 index 0000000000..404c84854f --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-requires-in-spec-file.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | autofs-5.0.7 - fix requires in spec file | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | Fix the use of depricated reqires in tar spec file. | ||
6 | --- | ||
7 | CHANGELOG | 1 + | ||
8 | autofs.spec | 4 ++-- | ||
9 | 2 files changed, 3 insertions(+), 2 deletions(-) | ||
10 | |||
11 | diff --git a/CHANGELOG b/CHANGELOG | ||
12 | index 247d334..e848bcd 100644 | ||
13 | --- a/CHANGELOG | ||
14 | +++ b/CHANGELOG | ||
15 | @@ -33,6 +33,7 @@ | ||
16 | - fix file descriptor leak when reloading the daemon. | ||
17 | - depricate nosymlink pseudo option. | ||
18 | - add symlink pseudo option. | ||
19 | +- fix requires in spec file. | ||
20 | |||
21 | 25/07/2012 autofs-5.0.7 | ||
22 | ======================= | ||
23 | diff --git a/autofs.spec b/autofs.spec | ||
24 | index b8a3b7a..703f7a9 100644 | ||
25 | --- a/autofs.spec | ||
26 | +++ b/autofs.spec | ||
27 | @@ -25,8 +25,8 @@ Buildroot: %{_tmppath}/%{name}-tmp | ||
28 | %if %{with_systemd} | ||
29 | BuildRequires: systemd-units | ||
30 | %endif | ||
31 | -BuildPrereq: autoconf, hesiod-devel, openldap-devel, bison, flex, cyrus-sasl-devel | ||
32 | -Prereq: chkconfig | ||
33 | +BuildRequires: autoconf, hesiod-devel, openldap-devel, bison, flex, cyrus-sasl-devel | ||
34 | +Requires: chkconfig | ||
35 | Requires: /bin/bash mktemp sed textutils sh-utils grep /bin/ps | ||
36 | %if %{with_systemd} | ||
37 | Requires(post): systemd-sysv | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-submount-offset-delete.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-submount-offset-delete.patch new file mode 100644 index 0000000000..b38e21433c --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-submount-offset-delete.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | autofs-5.0.7 - fix submount offset delete | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | As part of the implementation to allow for limited update of | ||
6 | the internal hosts map by using a HUP signal some code that | ||
7 | deleted any offset entries from the cache on lookup was removed | ||
8 | as it appeared to not be needed. | ||
9 | |||
10 | There is however a case where it is needed to avoid a duplicate | ||
11 | cache entry failure on lookup. | ||
12 | --- | ||
13 | |||
14 | CHANGELOG | 1 + | ||
15 | daemon/automount.c | 4 ++-- | ||
16 | 2 files changed, 3 insertions(+), 2 deletions(-) | ||
17 | |||
18 | |||
19 | diff --git a/CHANGELOG b/CHANGELOG | ||
20 | index 7eb7235..76c1f73 100644 | ||
21 | --- a/CHANGELOG | ||
22 | +++ b/CHANGELOG | ||
23 | @@ -18,6 +18,7 @@ | ||
24 | - fix map entry duplicate offset detection. | ||
25 | - Allow nsswitch.conf to not contain "automount:" lines. | ||
26 | - fix nobind man page description. | ||
27 | +- fix submount offset delete. | ||
28 | |||
29 | 25/07/2012 autofs-5.0.7 | ||
30 | ======================= | ||
31 | diff --git a/daemon/automount.c b/daemon/automount.c | ||
32 | index e56f9e1..4a3eb3d 100644 | ||
33 | --- a/daemon/automount.c | ||
34 | +++ b/daemon/automount.c | ||
35 | @@ -544,8 +544,8 @@ int umount_multi(struct autofs_point *ap, const char *path, int incl) | ||
36 | * If we are a submount we need to umount any offsets our | ||
37 | * parent may have mounted over top of us. | ||
38 | */ | ||
39 | - /*if (ap->submount) | ||
40 | - left += umount_subtree_mounts(ap->parent, path, is_autofs_fs);*/ | ||
41 | + if (ap->submount) | ||
42 | + left += umount_subtree_mounts(ap->parent, path, is_autofs_fs); | ||
43 | |||
44 | left += umount_subtree_mounts(ap, path, is_autofs_fs); | ||
45 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-systemd-unidir-in-spec-file.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-systemd-unidir-in-spec-file.patch new file mode 100644 index 0000000000..d856faf429 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-systemd-unidir-in-spec-file.patch | |||
@@ -0,0 +1,72 @@ | |||
1 | autofs-5.0.7 - fix systemd unidir in spec file | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | |||
6 | --- | ||
7 | CHANGELOG | 1 + | ||
8 | autofs.spec | 16 ++++++++-------- | ||
9 | 2 files changed, 9 insertions(+), 8 deletions(-) | ||
10 | |||
11 | diff --git a/CHANGELOG b/CHANGELOG | ||
12 | index b6b2679..ecdea0b 100644 | ||
13 | --- a/CHANGELOG | ||
14 | +++ b/CHANGELOG | ||
15 | @@ -35,6 +35,7 @@ | ||
16 | - add symlink pseudo option. | ||
17 | - fix requires in spec file. | ||
18 | - fix libtirpc build option to require libtirpc-devel if needed. | ||
19 | +- fix systemd unidir in spec file. | ||
20 | |||
21 | 25/07/2012 autofs-5.0.7 | ||
22 | ======================= | ||
23 | diff --git a/autofs.spec b/autofs.spec | ||
24 | index f77acc1..a768e44 100644 | ||
25 | --- a/autofs.spec | ||
26 | +++ b/autofs.spec | ||
27 | @@ -76,7 +76,7 @@ inkludera n | ||
28 | %setup -q | ||
29 | echo %{version}-%{release} > .version | ||
30 | %if %{with_systemd} | ||
31 | - %define _unitdir %{?_unitdir:/lib/systemd/system} | ||
32 | + %define unitdir %{?_unitdir:/lib/systemd/system} | ||
33 | %define systemd_configure_arg --with-systemd | ||
34 | %endif | ||
35 | %if %{with_libtirpc} | ||
36 | @@ -95,7 +95,7 @@ CFLAGS="$RPM_OPT_FLAGS -Wall" make initdir=/etc/rc.d/init.d DONTSTRIP=1 | ||
37 | %install | ||
38 | rm -rf $RPM_BUILD_ROOT | ||
39 | %if %{with_systemd} | ||
40 | -install -d -m 755 $RPM_BUILD_ROOT%{_unitdir} | ||
41 | +install -d -m 755 $RPM_BUILD_ROOT%{unitdir} | ||
42 | %else | ||
43 | mkdir -p -m755 $RPM_BUILD_ROOT/etc/rc.d/init.d | ||
44 | %endif | ||
45 | @@ -109,9 +109,13 @@ make install mandir=%{_mandir} initdir=/etc/rc.d/init.d INSTALLROOT=$RPM_BUILD_R | ||
46 | echo make -C redhat | ||
47 | make -C redhat | ||
48 | %if %{with_systemd} | ||
49 | -install -m 644 redhat/autofs.service $RPM_BUILD_ROOT%{_unitdir}/autofs.service | ||
50 | +# Configure can get this wrong when the unit files appear under /lib and /usr/lib | ||
51 | +find $RPM_BUILD_ROOT -type f -name autofs.service -exec rm -f {} \; | ||
52 | +install -m 644 redhat/autofs.service $RPM_BUILD_ROOT%{unitdir}/autofs.service | ||
53 | +%define init_file_name %{unitdir}/autofs.service | ||
54 | %else | ||
55 | install -m 755 redhat/autofs.init $RPM_BUILD_ROOT/etc/rc.d/init.d/autofs | ||
56 | +%define init_file_name /etc/rc.d/init.d/autofs | ||
57 | %endif | ||
58 | install -m 644 redhat/autofs.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/autofs | ||
59 | |||
60 | @@ -170,11 +174,7 @@ fi | ||
61 | %files | ||
62 | %defattr(-,root,root) | ||
63 | %doc CREDITS CHANGELOG INSTALL COPY* README* samples/ldap* samples/autofs.schema samples/autofs_ldap_auth.conf | ||
64 | -%if %{with_systemd} | ||
65 | -%{_unitdir}/autofs.service | ||
66 | -%else | ||
67 | -%config /etc/rc.d/init.d/autofs | ||
68 | -%endif | ||
69 | +%config %{init_file_name} | ||
70 | %config(noreplace) /etc/auto.master | ||
71 | %config(noreplace,missingok) /etc/auto.misc | ||
72 | %config(noreplace,missingok) /etc/auto.net | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-typo-in-automount-8.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-typo-in-automount-8.patch new file mode 100644 index 0000000000..6d88ce0cbd --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-typo-in-automount-8.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | autofs-5.0.7 - fix typo in automount(8) | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | |||
6 | --- | ||
7 | |||
8 | CHANGELOG | 1 + | ||
9 | man/automount.8 | 2 +- | ||
10 | 2 files changed, 2 insertions(+), 1 deletions(-) | ||
11 | |||
12 | |||
13 | diff --git a/CHANGELOG b/CHANGELOG | ||
14 | index 276d6ba..6051723 100644 | ||
15 | --- a/CHANGELOG | ||
16 | +++ b/CHANGELOG | ||
17 | @@ -4,6 +4,7 @@ | ||
18 | - fix use cache entry after free in lookup_prune_one_cache(). | ||
19 | - fix ipv6 proximity calculation. | ||
20 | - fix parse buffer initialization. | ||
21 | +- fix typo in automount(8). | ||
22 | |||
23 | 25/07/2012 autofs-5.0.7 | ||
24 | ======================= | ||
25 | diff --git a/man/automount.8 b/man/automount.8 | ||
26 | index 0186984..dddebce 100644 | ||
27 | --- a/man/automount.8 | ||
28 | +++ b/man/automount.8 | ||
29 | @@ -51,7 +51,7 @@ are over-ridden macro definitions of the same name specified in | ||
30 | mount entries. | ||
31 | .TP | ||
32 | .I "\-f, \-\-foreground" | ||
33 | -Run the daemon in the forground and log to stderr instead of syslog." | ||
34 | +Run the daemon in the foreground and log to stderr instead of syslog." | ||
35 | .TP | ||
36 | .I "\-r, \-\-random-multimount-selection" | ||
37 | Enables the use of ramdom selection when choosing a host from a | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-use-cache-entry-after-free-mistake.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-use-cache-entry-after-free-mistake.patch new file mode 100644 index 0000000000..a469c16868 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-use-cache-entry-after-free-mistake.patch | |||
@@ -0,0 +1,49 @@ | |||
1 | autofs-5.0.7 - fix use cache entry after free mistake | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | Fix an obvious use after free mistake in lookup_prune_one_cache(). | ||
6 | --- | ||
7 | |||
8 | CHANGELOG | 1 + | ||
9 | daemon/lookup.c | 7 +++++-- | ||
10 | 2 files changed, 6 insertions(+), 2 deletions(-) | ||
11 | |||
12 | |||
13 | diff --git a/CHANGELOG b/CHANGELOG | ||
14 | index faf4c80..dc38580 100644 | ||
15 | --- a/CHANGELOG | ||
16 | +++ b/CHANGELOG | ||
17 | @@ -1,6 +1,7 @@ | ||
18 | ??/??/2012 autofs-5.0.8 | ||
19 | ======================= | ||
20 | - fix nobind sun escaped map entries. | ||
21 | +- fix use cache entry after free in lookup_prune_one_cache(). | ||
22 | |||
23 | 25/07/2012 autofs-5.0.7 | ||
24 | ======================= | ||
25 | diff --git a/daemon/lookup.c b/daemon/lookup.c | ||
26 | index 7909536..e3d9536 100644 | ||
27 | --- a/daemon/lookup.c | ||
28 | +++ b/daemon/lookup.c | ||
29 | @@ -1103,15 +1103,18 @@ void lookup_prune_one_cache(struct autofs_point *ap, struct mapent_cache *mc, ti | ||
30 | if (valid) | ||
31 | cache_delete(mc, key); | ||
32 | else if (!is_mounted(_PROC_MOUNTS, path, MNTS_AUTOFS)) { | ||
33 | + dev_t devid = ap->dev; | ||
34 | status = CHE_FAIL; | ||
35 | + if (ap->type == LKP_DIRECT) | ||
36 | + devid = this->dev; | ||
37 | if (this->ioctlfd == -1) | ||
38 | status = cache_delete(mc, key); | ||
39 | if (status != CHE_FAIL) { | ||
40 | if (ap->type == LKP_INDIRECT) { | ||
41 | if (ap->flags & MOUNT_FLAG_GHOST) | ||
42 | - rmdir_path(ap, path, ap->dev); | ||
43 | + rmdir_path(ap, path, devid); | ||
44 | } else | ||
45 | - rmdir_path(ap, path, this->dev); | ||
46 | + rmdir_path(ap, path, devid); | ||
47 | } | ||
48 | } | ||
49 | cache_unlock(mc); | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-use-get_proximity-without-libtirpc.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-use-get_proximity-without-libtirpc.patch new file mode 100644 index 0000000000..74ed8fa642 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-use-get_proximity-without-libtirpc.patch | |||
@@ -0,0 +1,54 @@ | |||
1 | autofs-5.0.7 - fix use get_proximity() without libtirpc | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | If autofs is not using libtirpc and there are any configured IPv6 | ||
6 | interfaces then get_proximity() will fail with PROXIMITY_UNSUPPORTED. | ||
7 | |||
8 | In this case when checking interfaces the IPv6 interfaces need to be | ||
9 | ignored. | ||
10 | --- | ||
11 | |||
12 | CHANGELOG | 1 + | ||
13 | modules/replicated.c | 8 ++------ | ||
14 | 2 files changed, 3 insertions(+), 6 deletions(-) | ||
15 | |||
16 | |||
17 | diff --git a/CHANGELOG b/CHANGELOG | ||
18 | index 5bcb1af..460bd27 100644 | ||
19 | --- a/CHANGELOG | ||
20 | +++ b/CHANGELOG | ||
21 | @@ -20,6 +20,7 @@ | ||
22 | - fix nobind man page description. | ||
23 | - fix submount offset delete. | ||
24 | - fix init script status return. | ||
25 | +- fix use get_proximity() without libtirpc. | ||
26 | |||
27 | 25/07/2012 autofs-5.0.7 | ||
28 | ======================= | ||
29 | diff --git a/modules/replicated.c b/modules/replicated.c | ||
30 | index bd6003b..6b96320 100644 | ||
31 | --- a/modules/replicated.c | ||
32 | +++ b/modules/replicated.c | ||
33 | @@ -184,9 +184,7 @@ static unsigned int get_proximity(struct sockaddr *host_addr) | ||
34 | break; | ||
35 | |||
36 | case AF_INET6: | ||
37 | -#ifndef WITH_LIBTIRPC | ||
38 | - return PROXIMITY_UNSUPPORTED; | ||
39 | -#else | ||
40 | +#ifdef WITH_LIBTIRPC | ||
41 | if (host_addr->sa_family == AF_INET) | ||
42 | break; | ||
43 | if6_addr = (struct sockaddr_in6 *) this->ifa_addr; | ||
44 | @@ -251,9 +249,7 @@ static unsigned int get_proximity(struct sockaddr *host_addr) | ||
45 | break; | ||
46 | |||
47 | case AF_INET6: | ||
48 | -#ifndef WITH_LIBTIRPC | ||
49 | - return PROXIMITY_UNSUPPORTED; | ||
50 | -#else | ||
51 | +#ifdef WITH_LIBTIRPC | ||
52 | if (host_addr->sa_family == AF_INET) | ||
53 | break; | ||
54 | if6_addr = (struct sockaddr_in6 *) this->ifa_addr; | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-wildcard-multi-map-regression.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-wildcard-multi-map-regression.patch new file mode 100644 index 0000000000..44e4a18e32 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-fix-wildcard-multi-map-regression.patch | |||
@@ -0,0 +1,225 @@ | |||
1 | autofs-5.0.7 - fix wildcard multi map regression | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | A recent patch that removed code to add the current map entry when | ||
6 | being parsed if it didn't already exist cause wildcard indirect | ||
7 | multi-mount map entries to fail to mount. | ||
8 | |||
9 | Indirect multi-mount map entries need the entry matched by a wildcard | ||
10 | lookup to be added to the map entry cache because subsequent operations | ||
11 | expect a distinct map entry to be present or they will fail. This is | ||
12 | what the code that was removed did but it did so in the wrong place | ||
13 | which caused a deadlock situation. | ||
14 | --- | ||
15 | CHANGELOG | 1 + | ||
16 | modules/lookup_file.c | 23 ++++++++++++++++------- | ||
17 | modules/lookup_ldap.c | 19 +++++++++++++++---- | ||
18 | modules/lookup_nisplus.c | 21 ++++++++++++++++----- | ||
19 | modules/lookup_sss.c | 17 ++++++++++++++--- | ||
20 | modules/lookup_yp.c | 21 ++++++++++++++++----- | ||
21 | 6 files changed, 78 insertions(+), 24 deletions(-) | ||
22 | |||
23 | diff --git a/CHANGELOG b/CHANGELOG | ||
24 | index 97d6f48..46ef335 100644 | ||
25 | --- a/CHANGELOG | ||
26 | +++ b/CHANGELOG | ||
27 | @@ -29,6 +29,7 @@ | ||
28 | - modules/replicated.c: use sin6_addr.s6_addr32. | ||
29 | - workaround missing GNU versionsort extension. | ||
30 | - dont fail on master map self include. | ||
31 | +- fix wildcard multi map regression. | ||
32 | |||
33 | 25/07/2012 autofs-5.0.7 | ||
34 | ======================= | ||
35 | diff --git a/modules/lookup_file.c b/modules/lookup_file.c | ||
36 | index f37bed9..65e5ee6 100644 | ||
37 | --- a/modules/lookup_file.c | ||
38 | +++ b/modules/lookup_file.c | ||
39 | @@ -1040,7 +1040,7 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | ||
40 | return NSS_STATUS_UNAVAIL; | ||
41 | } | ||
42 | |||
43 | - cache_readlock(mc); | ||
44 | + cache_writelock(mc); | ||
45 | me = cache_lookup_first(mc); | ||
46 | if (me && st.st_mtime <= me->age) { | ||
47 | /* | ||
48 | @@ -1082,7 +1082,7 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | ||
49 | } | ||
50 | } | ||
51 | |||
52 | - cache_readlock(mc); | ||
53 | + cache_writelock(mc); | ||
54 | do_cache_lookup: | ||
55 | me = cache_lookup(mc, key); | ||
56 | /* | ||
57 | @@ -1098,11 +1098,20 @@ do_cache_lookup: | ||
58 | if (!me) | ||
59 | me = cache_lookup_distinct(mc, "*"); | ||
60 | } | ||
61 | - if (me && me->mapent && (me->source == source || *me->key == '/')) { | ||
62 | - pthread_cleanup_push(cache_lock_cleanup, mc); | ||
63 | - strcpy(mapent_buf, me->mapent); | ||
64 | - mapent = mapent_buf; | ||
65 | - pthread_cleanup_pop(0); | ||
66 | + if (me && me->mapent) { | ||
67 | + /* | ||
68 | + * Add wildcard match for later validation checks and | ||
69 | + * negative cache lookups. | ||
70 | + */ | ||
71 | + if (ap->type == LKP_INDIRECT && *me->key == '*') { | ||
72 | + ret = cache_update(mc, source, key, me->mapent, me->age); | ||
73 | + if (!(ret & (CHE_OK | CHE_UPDATED))) | ||
74 | + me = NULL; | ||
75 | + } | ||
76 | + if (me && (me->source == source || *me->key == '/')) { | ||
77 | + strcpy(mapent_buf, me->mapent); | ||
78 | + mapent = mapent_buf; | ||
79 | + } | ||
80 | } | ||
81 | cache_unlock(mc); | ||
82 | |||
83 | diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c | ||
84 | index 431e50d..83e3215 100644 | ||
85 | --- a/modules/lookup_ldap.c | ||
86 | +++ b/modules/lookup_ldap.c | ||
87 | @@ -2969,7 +2969,7 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | ||
88 | return status; | ||
89 | } | ||
90 | |||
91 | - cache_readlock(mc); | ||
92 | + cache_writelock(mc); | ||
93 | me = cache_lookup(mc, key); | ||
94 | /* Stale mapent => check for entry in alternate source or wildcard */ | ||
95 | if (me && !me->mapent) { | ||
96 | @@ -2979,9 +2979,20 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | ||
97 | if (!me) | ||
98 | me = cache_lookup_distinct(mc, "*"); | ||
99 | } | ||
100 | - if (me && me->mapent && (me->source == source || *me->key == '/')) { | ||
101 | - strcpy(mapent_buf, me->mapent); | ||
102 | - mapent = mapent_buf; | ||
103 | + if (me && me->mapent) { | ||
104 | + /* | ||
105 | + * Add wildcard match for later validation checks and | ||
106 | + * negative cache lookups. | ||
107 | + */ | ||
108 | + if (ap->type == LKP_INDIRECT && *me->key == '*') { | ||
109 | + ret = cache_update(mc, source, key, me->mapent, me->age); | ||
110 | + if (!(ret & (CHE_OK | CHE_UPDATED))) | ||
111 | + me = NULL; | ||
112 | + } | ||
113 | + if (me && (me->source == source || *me->key == '/')) { | ||
114 | + strcpy(mapent_buf, me->mapent); | ||
115 | + mapent = mapent_buf; | ||
116 | + } | ||
117 | } | ||
118 | cache_unlock(mc); | ||
119 | |||
120 | diff --git a/modules/lookup_nisplus.c b/modules/lookup_nisplus.c | ||
121 | index 9fced96..8237a1e 100644 | ||
122 | --- a/modules/lookup_nisplus.c | ||
123 | +++ b/modules/lookup_nisplus.c | ||
124 | @@ -561,7 +561,7 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | ||
125 | return status; | ||
126 | } | ||
127 | |||
128 | - cache_readlock(mc); | ||
129 | + cache_writelock(mc); | ||
130 | me = cache_lookup(mc, key); | ||
131 | /* Stale mapent => check for entry in alternate source or wildcard */ | ||
132 | if (me && !me->mapent) { | ||
133 | @@ -571,10 +571,21 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | ||
134 | if (!me) | ||
135 | me = cache_lookup_distinct(mc, "*"); | ||
136 | } | ||
137 | - if (me && me->mapent && (me->source == source || *me->key == '/')) { | ||
138 | - mapent_len = strlen(me->mapent); | ||
139 | - mapent = malloc(mapent_len + 1); | ||
140 | - strcpy(mapent, me->mapent); | ||
141 | + if (me && me->mapent) { | ||
142 | + /* | ||
143 | + * Add wildcard match for later validation checks and | ||
144 | + * negative cache lookups. | ||
145 | + */ | ||
146 | + if (ap->type == LKP_INDIRECT && *me->key == '*') { | ||
147 | + ret = cache_update(mc, source, key, me->mapent, me->age); | ||
148 | + if (!(ret & (CHE_OK | CHE_UPDATED))) | ||
149 | + me = NULL; | ||
150 | + } | ||
151 | + if (me && (me->source == source || *me->key == '/')) { | ||
152 | + mapent_len = strlen(me->mapent); | ||
153 | + mapent = malloc(mapent_len + 1); | ||
154 | + strcpy(mapent, me->mapent); | ||
155 | + } | ||
156 | } | ||
157 | cache_unlock(mc); | ||
158 | |||
159 | diff --git a/modules/lookup_sss.c b/modules/lookup_sss.c | ||
160 | index e0b84cc..5c2ed0a 100644 | ||
161 | --- a/modules/lookup_sss.c | ||
162 | +++ b/modules/lookup_sss.c | ||
163 | @@ -645,9 +645,20 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | ||
164 | if (!me) | ||
165 | me = cache_lookup_distinct(mc, "*"); | ||
166 | } | ||
167 | - if (me && me->mapent && (me->source == source || *me->key == '/')) { | ||
168 | - strcpy(mapent_buf, me->mapent); | ||
169 | - mapent = mapent_buf; | ||
170 | + if (me && me->mapent) { | ||
171 | + /* | ||
172 | + * Add wildcard match for later validation checks and | ||
173 | + * negative cache lookups. | ||
174 | + */ | ||
175 | + if (ap->type == LKP_INDIRECT && *me->key == '*') { | ||
176 | + ret = cache_update(mc, source, key, me->mapent, me->age); | ||
177 | + if (!(ret & (CHE_OK | CHE_UPDATED))) | ||
178 | + me = NULL; | ||
179 | + } | ||
180 | + if (me && (me->source == source || *me->key == '/')) { | ||
181 | + strcpy(mapent_buf, me->mapent); | ||
182 | + mapent = mapent_buf; | ||
183 | + } | ||
184 | } | ||
185 | cache_unlock(mc); | ||
186 | |||
187 | diff --git a/modules/lookup_yp.c b/modules/lookup_yp.c | ||
188 | index 720df2e..a716e1f 100644 | ||
189 | --- a/modules/lookup_yp.c | ||
190 | +++ b/modules/lookup_yp.c | ||
191 | @@ -662,7 +662,7 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | ||
192 | return status; | ||
193 | } | ||
194 | |||
195 | - cache_readlock(mc); | ||
196 | + cache_writelock(mc); | ||
197 | me = cache_lookup(mc, key); | ||
198 | /* Stale mapent => check for entry in alternate source or wildcard */ | ||
199 | if (me && !me->mapent) { | ||
200 | @@ -672,10 +672,21 @@ int lookup_mount(struct autofs_point *ap, const char *name, int name_len, void * | ||
201 | if (!me) | ||
202 | me = cache_lookup_distinct(mc, "*"); | ||
203 | } | ||
204 | - if (me && me->mapent && (me->source == source || *me->key == '/')) { | ||
205 | - mapent_len = strlen(me->mapent); | ||
206 | - mapent = alloca(mapent_len + 1); | ||
207 | - strcpy(mapent, me->mapent); | ||
208 | + if (me && me->mapent) { | ||
209 | + /* | ||
210 | + * Add wildcard match for later validation checks and | ||
211 | + * negative cache lookups. | ||
212 | + */ | ||
213 | + if (ap->type == LKP_INDIRECT && *me->key == '*') { | ||
214 | + ret = cache_update(mc, source, key, me->mapent, me->age); | ||
215 | + if (!(ret & (CHE_OK | CHE_UPDATED))) | ||
216 | + me = NULL; | ||
217 | + } | ||
218 | + if (me && (me->source == source || *me->key == '/')) { | ||
219 | + mapent_len = strlen(me->mapent); | ||
220 | + mapent = alloca(mapent_len + 1); | ||
221 | + strcpy(mapent, me->mapent); | ||
222 | + } | ||
223 | } | ||
224 | cache_unlock(mc); | ||
225 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-handle-new-location-of-systemd.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-handle-new-location-of-systemd.patch new file mode 100644 index 0000000000..1c26794f50 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-handle-new-location-of-systemd.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | autofs-5.0.7 - Handle new location of systemd | ||
2 | |||
3 | From: Frederic Crozat <fcrozat@suse.com> | ||
4 | |||
5 | Some distributions are moving systemd unit files from /lib to | ||
6 | /usr/lib, so we need to test both directories. | ||
7 | |||
8 | edit: imk | ||
9 | It occurs to me I've forgotten to check for the 64 bit variants | ||
10 | of the directories, so add them as well. | ||
11 | end edit: imk | ||
12 | --- | ||
13 | |||
14 | CHANGELOG | 1 + | ||
15 | aclocal.m4 | 2 +- | ||
16 | configure | 2 +- | ||
17 | 3 files changed, 3 insertions(+), 2 deletions(-) | ||
18 | |||
19 | |||
20 | diff --git a/CHANGELOG b/CHANGELOG | ||
21 | index 3bdf8a4..8f6bb3a 100644 | ||
22 | --- a/CHANGELOG | ||
23 | +++ b/CHANGELOG | ||
24 | @@ -14,6 +14,7 @@ | ||
25 | - allow non root user to check status. | ||
26 | - fix recursive mount deadlock. | ||
27 | - increase file map read buffer size. | ||
28 | +- handle new location of systemd. | ||
29 | |||
30 | 25/07/2012 autofs-5.0.7 | ||
31 | ======================= | ||
32 | diff --git a/aclocal.m4 b/aclocal.m4 | ||
33 | index 1798c8b..47bca0c 100644 | ||
34 | --- a/aclocal.m4 | ||
35 | +++ b/aclocal.m4 | ||
36 | @@ -234,7 +234,7 @@ AC_DEFUN([AF_WITH_SYSTEMD], | ||
37 | [if test "$withval" = yes; then | ||
38 | if test -z "$systemddir"; then | ||
39 | AC_MSG_CHECKING([location of the systemd unit files directory]) | ||
40 | - for systemd_d in /lib/systemd/system; do | ||
41 | + for systemd_d in /usr/lib/systemd/system /usr/lib64/systemd/system /lib/systemd/system /lib64/systemd/system; do | ||
42 | if test -z "$systemddir"; then | ||
43 | if test -d "$systemd_d"; then | ||
44 | systemddir="$systemd_d" | ||
45 | diff --git a/configure b/configure | ||
46 | index ba3bba6..3722a46 100755 | ||
47 | --- a/configure | ||
48 | +++ b/configure | ||
49 | @@ -2157,7 +2157,7 @@ if test "${with_systemd+set}" = set; then : | ||
50 | if test -z "$systemddir"; then | ||
51 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking location of the systemd unit files directory" >&5 | ||
52 | $as_echo_n "checking location of the systemd unit files directory... " >&6; } | ||
53 | - for systemd_d in /lib/systemd/system; do | ||
54 | + for systemd_d in /usr/lib/systemd/system /usr/lib64/systemd/system /lib/systemd/system /lib64/systemd/system; do | ||
55 | if test -z "$systemddir"; then | ||
56 | if test -d "$systemd_d"; then | ||
57 | systemddir="$systemd_d" | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch new file mode 100644 index 0000000000..3a878980a4 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | Upstream-Status: Pending | ||
2 | |||
3 | From 44bdce8c6ed9b30c1643e5981172a4f9025f013c Mon Sep 17 00:00:00 2001 | ||
4 | From: Andreas Oberritter <obi@opendreambox.org> | ||
5 | Date: Wed, 13 Mar 2013 16:17:08 +0100 | ||
6 | Subject: [PATCH] autofs-5.0.7: include linux/nfs.h directly in rpc_subs.h | ||
7 | |||
8 | Fixes compile error with uclibc. Glibc's nfs/nfs.h contains | ||
9 | nothing but "#include linux/nfs.h". rpc_subs.h already includes | ||
10 | other linux/nfs*.h files directly. | ||
11 | |||
12 | Signed-off-by: Andreas Oberritter <obi@opendreambox.org> | ||
13 | --- | ||
14 | include/rpc_subs.h | 2 +- | ||
15 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
16 | |||
17 | diff --git a/include/rpc_subs.h b/include/rpc_subs.h | ||
18 | index b6d59f9..a2d9648 100644 | ||
19 | --- a/include/rpc_subs.h | ||
20 | +++ b/include/rpc_subs.h | ||
21 | @@ -18,7 +18,7 @@ | ||
22 | |||
23 | #include <rpc/rpc.h> | ||
24 | #include <rpc/pmap_prot.h> | ||
25 | -#include <nfs/nfs.h> | ||
26 | +#include <linux/nfs.h> | ||
27 | #include <linux/nfs2.h> | ||
28 | #include <linux/nfs3.h> | ||
29 | |||
30 | -- | ||
31 | 1.7.10.4 | ||
32 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-include-usage-in-usage-message.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-include-usage-in-usage-message.patch new file mode 100644 index 0000000000..1c8a565a29 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-include-usage-in-usage-message.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | autofs-5.0.7 - include usage in usage message | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | Since usage is a case entry we should also nclude it in the usage | ||
6 | message. | ||
7 | --- | ||
8 | |||
9 | redhat/autofs.init.in | 2 +- | ||
10 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
11 | |||
12 | |||
13 | diff --git a/redhat/autofs.init.in b/redhat/autofs.init.in | ||
14 | index 8e355da..ec6d5d6 100644 | ||
15 | --- a/redhat/autofs.init.in | ||
16 | +++ b/redhat/autofs.init.in | ||
17 | @@ -155,7 +155,7 @@ function reload() { | ||
18 | } | ||
19 | |||
20 | function usage_message() { | ||
21 | - echo $"Usage: $0 {start|forcestart|stop|status|restart|force-reload|forcerestart|reload|condrestart|try-restart}" | ||
22 | + echo $"Usage: $0 {start|forcestart|stop|status|restart|force-reload|forcerestart|reload|condrestart|try-restart|usage}" | ||
23 | } | ||
24 | |||
25 | RETVAL=0 | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-lib-defaults-use-WITH_LDAP-conditional-around-LDAP-types.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-lib-defaults-use-WITH_LDAP-conditional-around-LDAP-types.patch new file mode 100644 index 0000000000..22e0418e54 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-lib-defaults-use-WITH_LDAP-conditional-around-LDAP-types.patch | |||
@@ -0,0 +1,448 @@ | |||
1 | autofs-5.0.7 - lib/defaults.c: use WITH_LDAP conditional around LDAP types | ||
2 | |||
3 | From: Chris Packham <chris.packham@alliedtelesis.co.nz> | ||
4 | |||
5 | Wrap the inclusion of lookup_ldap.h and functions that use ldap_uri or | ||
6 | ldap_schema with the WITH_LDAP conditional. WITH_LDAP is set by the | ||
7 | configure step when LDAP support is not desired. This also allows | ||
8 | compilation on a system that doesn't have any LDAP libraries. | ||
9 | --- | ||
10 | |||
11 | CHANGELOG | 1 | ||
12 | include/defaults.h | 14 +- | ||
13 | include/lookup_ldap.h | 1 | ||
14 | lib/defaults.c | 325 +++++++++++++++++++++++++------------------------ | ||
15 | modules/lookup_ldap.c | 1 | ||
16 | 5 files changed, 175 insertions(+), 167 deletions(-) | ||
17 | |||
18 | |||
19 | diff --git a/CHANGELOG b/CHANGELOG | ||
20 | index ba1d65b..1130db6 100644 | ||
21 | --- a/CHANGELOG | ||
22 | +++ b/CHANGELOG | ||
23 | @@ -24,6 +24,7 @@ | ||
24 | - don't use dirent d_type to filter out files in scandir() | ||
25 | - don't schedule new alarms after readmap. | ||
26 | - use numeric protocol ids instead of protoent structs. | ||
27 | +- lib/defaults.c: use WITH_LDAP conditional around LDAP types. | ||
28 | |||
29 | 25/07/2012 autofs-5.0.7 | ||
30 | ======================= | ||
31 | diff --git a/include/defaults.h b/include/defaults.h | ||
32 | index cda2174..871e14b 100644 | ||
33 | --- a/include/defaults.h | ||
34 | +++ b/include/defaults.h | ||
35 | @@ -44,8 +44,16 @@ | ||
36 | |||
37 | #define DEFAULT_MAP_HASH_TABLE_SIZE 1024 | ||
38 | |||
39 | +#ifdef WITH_LDAP | ||
40 | struct ldap_schema; | ||
41 | struct ldap_searchdn; | ||
42 | +void defaults_free_uris(struct list_head *); | ||
43 | +struct list_head *defaults_get_uris(void); | ||
44 | +struct ldap_schema *defaults_get_default_schema(void); | ||
45 | +void defaults_free_searchdns(struct ldap_searchdn *); | ||
46 | +struct ldap_searchdn *defaults_get_searchdns(void); | ||
47 | +struct ldap_schema *defaults_get_schema(void); | ||
48 | +#endif | ||
49 | |||
50 | unsigned int defaults_read_config(unsigned int); | ||
51 | const char *defaults_get_master_map(void); | ||
52 | @@ -57,12 +65,6 @@ unsigned int defaults_get_logging(void); | ||
53 | const char *defaults_get_ldap_server(void); | ||
54 | unsigned int defaults_get_ldap_timeout(void); | ||
55 | unsigned int defaults_get_ldap_network_timeout(void); | ||
56 | -struct list_head *defaults_get_uris(void); | ||
57 | -void defaults_free_uris(struct list_head *); | ||
58 | -struct ldap_schema *defaults_get_default_schema(void); | ||
59 | -struct ldap_schema *defaults_get_schema(void); | ||
60 | -struct ldap_searchdn *defaults_get_searchdns(void); | ||
61 | -void defaults_free_searchdns(struct ldap_searchdn *); | ||
62 | unsigned int defaults_get_mount_nfs_default_proto(void); | ||
63 | unsigned int defaults_get_append_options(void); | ||
64 | unsigned int defaults_get_mount_wait(void); | ||
65 | diff --git a/include/lookup_ldap.h b/include/lookup_ldap.h | ||
66 | index e441a61..9a4ce73 100644 | ||
67 | --- a/include/lookup_ldap.h | ||
68 | +++ b/include/lookup_ldap.h | ||
69 | @@ -8,7 +8,6 @@ | ||
70 | #include <openssl/evp.h> | ||
71 | #include <openssl/err.h> | ||
72 | #include <sasl/sasl.h> | ||
73 | -#include <libxml/tree.h> | ||
74 | #include <krb5.h> | ||
75 | #endif | ||
76 | |||
77 | diff --git a/lib/defaults.c b/lib/defaults.c | ||
78 | index 5ce71b7..ae1162f 100644 | ||
79 | --- a/lib/defaults.c | ||
80 | +++ b/lib/defaults.c | ||
81 | @@ -17,9 +17,12 @@ | ||
82 | #include <ctype.h> | ||
83 | #include <string.h> | ||
84 | |||
85 | +#include "config.h" | ||
86 | #include "list.h" | ||
87 | #include "defaults.h" | ||
88 | +#ifdef WITH_LDAP | ||
89 | #include "lookup_ldap.h" | ||
90 | +#endif | ||
91 | #include "log.h" | ||
92 | #include "automount.h" | ||
93 | |||
94 | @@ -197,6 +200,7 @@ static int parse_line(char *line, char **res, char **value) | ||
95 | return 1; | ||
96 | } | ||
97 | |||
98 | +#ifdef WITH_LDAP | ||
99 | void defaults_free_uris(struct list_head *list) | ||
100 | { | ||
101 | struct list_head *next; | ||
102 | @@ -290,166 +294,6 @@ struct list_head *defaults_get_uris(void) | ||
103 | return list; | ||
104 | } | ||
105 | |||
106 | -/* | ||
107 | - * Read config env variables and check they have been set. | ||
108 | - * | ||
109 | - * This simple minded routine assumes the config file | ||
110 | - * is valid bourne shell script without spaces around "=" | ||
111 | - * and that it has valid values. | ||
112 | - */ | ||
113 | -unsigned int defaults_read_config(unsigned int to_syslog) | ||
114 | -{ | ||
115 | - FILE *f; | ||
116 | - char buf[MAX_LINE_LEN]; | ||
117 | - char *res; | ||
118 | - | ||
119 | - f = open_fopen_r(DEFAULTS_CONFIG_FILE); | ||
120 | - if (!f) | ||
121 | - return 0; | ||
122 | - | ||
123 | - while ((res = fgets(buf, MAX_LINE_LEN, f))) { | ||
124 | - char *key, *value; | ||
125 | - | ||
126 | - if (!parse_line(res, &key, &value)) | ||
127 | - continue; | ||
128 | - | ||
129 | - if (check_set_config_value(key, ENV_NAME_MASTER_MAP, value, to_syslog) || | ||
130 | - check_set_config_value(key, ENV_NAME_TIMEOUT, value, to_syslog) || | ||
131 | - check_set_config_value(key, ENV_NAME_NEGATIVE_TIMEOUT, value, to_syslog) || | ||
132 | - check_set_config_value(key, ENV_NAME_BROWSE_MODE, value, to_syslog) || | ||
133 | - check_set_config_value(key, ENV_NAME_LOGGING, value, to_syslog) || | ||
134 | - check_set_config_value(key, ENV_LDAP_TIMEOUT, value, to_syslog) || | ||
135 | - check_set_config_value(key, ENV_LDAP_NETWORK_TIMEOUT, value, to_syslog) || | ||
136 | - check_set_config_value(key, ENV_NAME_MAP_OBJ_CLASS, value, to_syslog) || | ||
137 | - check_set_config_value(key, ENV_NAME_ENTRY_OBJ_CLASS, value, to_syslog) || | ||
138 | - check_set_config_value(key, ENV_NAME_MAP_ATTR, value, to_syslog) || | ||
139 | - check_set_config_value(key, ENV_NAME_ENTRY_ATTR, value, to_syslog) || | ||
140 | - check_set_config_value(key, ENV_NAME_VALUE_ATTR, value, to_syslog) || | ||
141 | - check_set_config_value(key, ENV_APPEND_OPTIONS, value, to_syslog) || | ||
142 | - check_set_config_value(key, ENV_MOUNT_WAIT, value, to_syslog) || | ||
143 | - check_set_config_value(key, ENV_UMOUNT_WAIT, value, to_syslog) || | ||
144 | - check_set_config_value(key, ENV_AUTH_CONF_FILE, value, to_syslog) || | ||
145 | - check_set_config_value(key, ENV_MAP_HASH_TABLE_SIZE, value, to_syslog) || | ||
146 | - check_set_config_value(key, ENV_MOUNT_NFS_DEFAULT_PROTOCOL, value, to_syslog)) | ||
147 | - ; | ||
148 | - } | ||
149 | - | ||
150 | - if (!feof(f) || ferror(f)) { | ||
151 | - if (!to_syslog) { | ||
152 | - fprintf(stderr, | ||
153 | - "fgets returned error %d while reading %s\n", | ||
154 | - ferror(f), DEFAULTS_CONFIG_FILE); | ||
155 | - } else { | ||
156 | - logmsg("fgets returned error %d while reading %s", | ||
157 | - ferror(f), DEFAULTS_CONFIG_FILE); | ||
158 | - } | ||
159 | - fclose(f); | ||
160 | - return 0; | ||
161 | - } | ||
162 | - | ||
163 | - fclose(f); | ||
164 | - return 1; | ||
165 | -} | ||
166 | - | ||
167 | -const char *defaults_get_master_map(void) | ||
168 | -{ | ||
169 | - char *master; | ||
170 | - | ||
171 | - master = get_env_string(ENV_NAME_MASTER_MAP); | ||
172 | - if (!master) | ||
173 | - return strdup(default_master_map_name); | ||
174 | - | ||
175 | - return (const char *) master; | ||
176 | -} | ||
177 | - | ||
178 | -int defaults_master_set(void) | ||
179 | -{ | ||
180 | - char *val = getenv(ENV_NAME_MASTER_MAP); | ||
181 | - if (!val) | ||
182 | - return 0; | ||
183 | - | ||
184 | - return 1; | ||
185 | -} | ||
186 | - | ||
187 | -unsigned int defaults_get_timeout(void) | ||
188 | -{ | ||
189 | - long timeout; | ||
190 | - | ||
191 | - timeout = get_env_number(ENV_NAME_TIMEOUT); | ||
192 | - if (timeout < 0) | ||
193 | - timeout = DEFAULT_TIMEOUT; | ||
194 | - | ||
195 | - return (unsigned int) timeout; | ||
196 | -} | ||
197 | - | ||
198 | -unsigned int defaults_get_negative_timeout(void) | ||
199 | -{ | ||
200 | - long n_timeout; | ||
201 | - | ||
202 | - n_timeout = get_env_number(ENV_NAME_NEGATIVE_TIMEOUT); | ||
203 | - if (n_timeout <= 0) | ||
204 | - n_timeout = DEFAULT_NEGATIVE_TIMEOUT; | ||
205 | - | ||
206 | - return (unsigned int) n_timeout; | ||
207 | -} | ||
208 | - | ||
209 | -unsigned int defaults_get_browse_mode(void) | ||
210 | -{ | ||
211 | - int res; | ||
212 | - | ||
213 | - res = get_env_yesno(ENV_NAME_BROWSE_MODE); | ||
214 | - if (res < 0) | ||
215 | - res = DEFAULT_BROWSE_MODE; | ||
216 | - | ||
217 | - return res; | ||
218 | -} | ||
219 | - | ||
220 | -unsigned int defaults_get_logging(void) | ||
221 | -{ | ||
222 | - char *res; | ||
223 | - unsigned int logging = DEFAULT_LOGGING; | ||
224 | - | ||
225 | - res = get_env_string(ENV_NAME_LOGGING); | ||
226 | - if (!res) | ||
227 | - return logging; | ||
228 | - | ||
229 | - if (!strcasecmp(res, "none")) | ||
230 | - logging = DEFAULT_LOGGING; | ||
231 | - else { | ||
232 | - if (!strcasecmp(res, "verbose")) | ||
233 | - logging |= LOGOPT_VERBOSE; | ||
234 | - | ||
235 | - if (!strcasecmp(res, "debug")) | ||
236 | - logging |= LOGOPT_DEBUG; | ||
237 | - } | ||
238 | - | ||
239 | - free(res); | ||
240 | - | ||
241 | - return logging; | ||
242 | -} | ||
243 | - | ||
244 | -unsigned int defaults_get_ldap_timeout(void) | ||
245 | -{ | ||
246 | - int res; | ||
247 | - | ||
248 | - res = get_env_number(ENV_LDAP_TIMEOUT); | ||
249 | - if (res < 0) | ||
250 | - res = DEFAULT_LDAP_TIMEOUT; | ||
251 | - | ||
252 | - return res; | ||
253 | -} | ||
254 | - | ||
255 | -unsigned int defaults_get_ldap_network_timeout(void) | ||
256 | -{ | ||
257 | - int res; | ||
258 | - | ||
259 | - res = get_env_number(ENV_LDAP_NETWORK_TIMEOUT); | ||
260 | - if (res < 0) | ||
261 | - res = DEFAULT_LDAP_NETWORK_TIMEOUT; | ||
262 | - | ||
263 | - return res; | ||
264 | -} | ||
265 | - | ||
266 | struct ldap_schema *defaults_get_default_schema(void) | ||
267 | { | ||
268 | struct ldap_schema *schema; | ||
269 | @@ -645,6 +489,167 @@ struct ldap_schema *defaults_get_schema(void) | ||
270 | |||
271 | return schema; | ||
272 | } | ||
273 | +#endif | ||
274 | + | ||
275 | +/* | ||
276 | + * Read config env variables and check they have been set. | ||
277 | + * | ||
278 | + * This simple minded routine assumes the config file | ||
279 | + * is valid bourne shell script without spaces around "=" | ||
280 | + * and that it has valid values. | ||
281 | + */ | ||
282 | +unsigned int defaults_read_config(unsigned int to_syslog) | ||
283 | +{ | ||
284 | + FILE *f; | ||
285 | + char buf[MAX_LINE_LEN]; | ||
286 | + char *res; | ||
287 | + | ||
288 | + f = open_fopen_r(DEFAULTS_CONFIG_FILE); | ||
289 | + if (!f) | ||
290 | + return 0; | ||
291 | + | ||
292 | + while ((res = fgets(buf, MAX_LINE_LEN, f))) { | ||
293 | + char *key, *value; | ||
294 | + | ||
295 | + if (!parse_line(res, &key, &value)) | ||
296 | + continue; | ||
297 | + | ||
298 | + if (check_set_config_value(key, ENV_NAME_MASTER_MAP, value, to_syslog) || | ||
299 | + check_set_config_value(key, ENV_NAME_TIMEOUT, value, to_syslog) || | ||
300 | + check_set_config_value(key, ENV_NAME_NEGATIVE_TIMEOUT, value, to_syslog) || | ||
301 | + check_set_config_value(key, ENV_NAME_BROWSE_MODE, value, to_syslog) || | ||
302 | + check_set_config_value(key, ENV_NAME_LOGGING, value, to_syslog) || | ||
303 | + check_set_config_value(key, ENV_LDAP_TIMEOUT, value, to_syslog) || | ||
304 | + check_set_config_value(key, ENV_LDAP_NETWORK_TIMEOUT, value, to_syslog) || | ||
305 | + check_set_config_value(key, ENV_NAME_MAP_OBJ_CLASS, value, to_syslog) || | ||
306 | + check_set_config_value(key, ENV_NAME_ENTRY_OBJ_CLASS, value, to_syslog) || | ||
307 | + check_set_config_value(key, ENV_NAME_MAP_ATTR, value, to_syslog) || | ||
308 | + check_set_config_value(key, ENV_NAME_ENTRY_ATTR, value, to_syslog) || | ||
309 | + check_set_config_value(key, ENV_NAME_VALUE_ATTR, value, to_syslog) || | ||
310 | + check_set_config_value(key, ENV_APPEND_OPTIONS, value, to_syslog) || | ||
311 | + check_set_config_value(key, ENV_MOUNT_WAIT, value, to_syslog) || | ||
312 | + check_set_config_value(key, ENV_UMOUNT_WAIT, value, to_syslog) || | ||
313 | + check_set_config_value(key, ENV_AUTH_CONF_FILE, value, to_syslog) || | ||
314 | + check_set_config_value(key, ENV_MAP_HASH_TABLE_SIZE, value, to_syslog) || | ||
315 | + check_set_config_value(key, ENV_MOUNT_NFS_DEFAULT_PROTOCOL, value, to_syslog)) | ||
316 | + ; | ||
317 | + } | ||
318 | + | ||
319 | + if (!feof(f) || ferror(f)) { | ||
320 | + if (!to_syslog) { | ||
321 | + fprintf(stderr, | ||
322 | + "fgets returned error %d while reading %s\n", | ||
323 | + ferror(f), DEFAULTS_CONFIG_FILE); | ||
324 | + } else { | ||
325 | + logmsg("fgets returned error %d while reading %s", | ||
326 | + ferror(f), DEFAULTS_CONFIG_FILE); | ||
327 | + } | ||
328 | + fclose(f); | ||
329 | + return 0; | ||
330 | + } | ||
331 | + | ||
332 | + fclose(f); | ||
333 | + return 1; | ||
334 | +} | ||
335 | + | ||
336 | +const char *defaults_get_master_map(void) | ||
337 | +{ | ||
338 | + char *master; | ||
339 | + | ||
340 | + master = get_env_string(ENV_NAME_MASTER_MAP); | ||
341 | + if (!master) | ||
342 | + return strdup(default_master_map_name); | ||
343 | + | ||
344 | + return (const char *) master; | ||
345 | +} | ||
346 | + | ||
347 | +int defaults_master_set(void) | ||
348 | +{ | ||
349 | + char *val = getenv(ENV_NAME_MASTER_MAP); | ||
350 | + if (!val) | ||
351 | + return 0; | ||
352 | + | ||
353 | + return 1; | ||
354 | +} | ||
355 | + | ||
356 | +unsigned int defaults_get_timeout(void) | ||
357 | +{ | ||
358 | + long timeout; | ||
359 | + | ||
360 | + timeout = get_env_number(ENV_NAME_TIMEOUT); | ||
361 | + if (timeout < 0) | ||
362 | + timeout = DEFAULT_TIMEOUT; | ||
363 | + | ||
364 | + return (unsigned int) timeout; | ||
365 | +} | ||
366 | + | ||
367 | +unsigned int defaults_get_negative_timeout(void) | ||
368 | +{ | ||
369 | + long n_timeout; | ||
370 | + | ||
371 | + n_timeout = get_env_number(ENV_NAME_NEGATIVE_TIMEOUT); | ||
372 | + if (n_timeout <= 0) | ||
373 | + n_timeout = DEFAULT_NEGATIVE_TIMEOUT; | ||
374 | + | ||
375 | + return (unsigned int) n_timeout; | ||
376 | +} | ||
377 | + | ||
378 | +unsigned int defaults_get_browse_mode(void) | ||
379 | +{ | ||
380 | + int res; | ||
381 | + | ||
382 | + res = get_env_yesno(ENV_NAME_BROWSE_MODE); | ||
383 | + if (res < 0) | ||
384 | + res = DEFAULT_BROWSE_MODE; | ||
385 | + | ||
386 | + return res; | ||
387 | +} | ||
388 | + | ||
389 | +unsigned int defaults_get_logging(void) | ||
390 | +{ | ||
391 | + char *res; | ||
392 | + unsigned int logging = DEFAULT_LOGGING; | ||
393 | + | ||
394 | + res = get_env_string(ENV_NAME_LOGGING); | ||
395 | + if (!res) | ||
396 | + return logging; | ||
397 | + | ||
398 | + if (!strcasecmp(res, "none")) | ||
399 | + logging = DEFAULT_LOGGING; | ||
400 | + else { | ||
401 | + if (!strcasecmp(res, "verbose")) | ||
402 | + logging |= LOGOPT_VERBOSE; | ||
403 | + | ||
404 | + if (!strcasecmp(res, "debug")) | ||
405 | + logging |= LOGOPT_DEBUG; | ||
406 | + } | ||
407 | + | ||
408 | + free(res); | ||
409 | + | ||
410 | + return logging; | ||
411 | +} | ||
412 | + | ||
413 | +unsigned int defaults_get_ldap_timeout(void) | ||
414 | +{ | ||
415 | + int res; | ||
416 | + | ||
417 | + res = get_env_number(ENV_LDAP_TIMEOUT); | ||
418 | + if (res < 0) | ||
419 | + res = DEFAULT_LDAP_TIMEOUT; | ||
420 | + | ||
421 | + return res; | ||
422 | +} | ||
423 | + | ||
424 | +unsigned int defaults_get_ldap_network_timeout(void) | ||
425 | +{ | ||
426 | + int res; | ||
427 | + | ||
428 | + res = get_env_number(ENV_LDAP_NETWORK_TIMEOUT); | ||
429 | + if (res < 0) | ||
430 | + res = DEFAULT_LDAP_NETWORK_TIMEOUT; | ||
431 | + | ||
432 | + return res; | ||
433 | +} | ||
434 | |||
435 | unsigned int defaults_get_mount_nfs_default_proto(void) | ||
436 | { | ||
437 | diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c | ||
438 | index 3bc4dc5..431e50d 100644 | ||
439 | --- a/modules/lookup_ldap.c | ||
440 | +++ b/modules/lookup_ldap.c | ||
441 | @@ -28,6 +28,7 @@ | ||
442 | #include <arpa/nameser.h> | ||
443 | #include <resolv.h> | ||
444 | #include <lber.h> | ||
445 | +#include <libxml/tree.h> | ||
446 | |||
447 | #define MODULE_LOOKUP | ||
448 | #include "automount.h" | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-make-description-of-default-MOUNT_WAIT-setting-clear.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-make-description-of-default-MOUNT_WAIT-setting-clear.patch new file mode 100644 index 0000000000..a3dd3fb691 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-make-description-of-default-MOUNT_WAIT-setting-clear.patch | |||
@@ -0,0 +1,57 @@ | |||
1 | autofs-5.0.7 - make description of default MOUNT_WAIT setting clear | ||
2 | |||
3 | From: Ian Kent <ikent@redhat.com> | ||
4 | |||
5 | |||
6 | --- | ||
7 | |||
8 | CHANGELOG | 1 + | ||
9 | redhat/autofs.sysconfig.in | 5 +++-- | ||
10 | samples/autofs.conf.default.in | 5 +++-- | ||
11 | 3 files changed, 7 insertions(+), 4 deletions(-) | ||
12 | |||
13 | |||
14 | diff --git a/CHANGELOG b/CHANGELOG | ||
15 | index 79cf673..961e340 100644 | ||
16 | --- a/CHANGELOG | ||
17 | +++ b/CHANGELOG | ||
18 | @@ -8,6 +8,7 @@ | ||
19 | - dont wait forever to restart. | ||
20 | - add timeout option description to man page. | ||
21 | - fix null map entry order handling. | ||
22 | +- make description of default MOUNT_WAIT setting clear. | ||
23 | |||
24 | 25/07/2012 autofs-5.0.7 | ||
25 | ======================= | ||
26 | diff --git a/redhat/autofs.sysconfig.in b/redhat/autofs.sysconfig.in | ||
27 | index 36b924d..a8992c4 100644 | ||
28 | --- a/redhat/autofs.sysconfig.in | ||
29 | +++ b/redhat/autofs.sysconfig.in | ||
30 | @@ -18,8 +18,9 @@ TIMEOUT=300 | ||
31 | # Setting this timeout can cause problems when | ||
32 | # mount would otherwise wait for a server that | ||
33 | # is temporarily unavailable, such as when it's | ||
34 | -# restarting. The defailt of waiting for mount(8) | ||
35 | -# usually results in a wait of around 3 minutes. | ||
36 | +# restarting. The default setting (-1) of waiting | ||
37 | +# for mount(8) usually results in a wait of around | ||
38 | +# 3 minutes. | ||
39 | # | ||
40 | #MOUNT_WAIT=-1 | ||
41 | # | ||
42 | diff --git a/samples/autofs.conf.default.in b/samples/autofs.conf.default.in | ||
43 | index ac2f63b..1da89cf 100644 | ||
44 | --- a/samples/autofs.conf.default.in | ||
45 | +++ b/samples/autofs.conf.default.in | ||
46 | @@ -18,8 +18,9 @@ TIMEOUT=300 | ||
47 | # Setting this timeout can cause problems when | ||
48 | # mount would otherwise wait for a server that | ||
49 | # is temporarily unavailable, such as when it's | ||
50 | -# restarting. The defailt of waiting for mount(8) | ||
51 | -# usually results in a wait of around 3 minutes. | ||
52 | +# restarting. The default setting (-1) of waiting | ||
53 | +# for mount(8) usually results in a wait of around | ||
54 | +# 3 minutes. | ||
55 | # | ||
56 | #MOUNT_WAIT=-1 | ||
57 | # | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-make-yellow-pages-support-optional.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-make-yellow-pages-support-optional.patch new file mode 100644 index 0000000000..41996906c1 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-make-yellow-pages-support-optional.patch | |||
@@ -0,0 +1,156 @@ | |||
1 | autofs-5.0.7 - make yellow pages support optional | ||
2 | |||
3 | From: Chris Packham <chris.packham@alliedtelesis.co.nz> | ||
4 | |||
5 | If rpcsvc/ypclnt.h is not available don't compile in Yellow Pages | ||
6 | support. | ||
7 | --- | ||
8 | |||
9 | CHANGELOG | 1 + | ||
10 | Makefile.conf.in | 3 +++ | ||
11 | configure | 16 ++++++++++++++++ | ||
12 | configure.in | 9 +++++++++ | ||
13 | include/config.h.in | 3 +++ | ||
14 | lib/rpc_subs.c | 1 - | ||
15 | modules/Makefile | 9 +++++++-- | ||
16 | 7 files changed, 39 insertions(+), 3 deletions(-) | ||
17 | |||
18 | |||
19 | diff --git a/CHANGELOG b/CHANGELOG | ||
20 | index 1130db6..ed17163 100644 | ||
21 | --- a/CHANGELOG | ||
22 | +++ b/CHANGELOG | ||
23 | @@ -25,6 +25,7 @@ | ||
24 | - don't schedule new alarms after readmap. | ||
25 | - use numeric protocol ids instead of protoent structs. | ||
26 | - lib/defaults.c: use WITH_LDAP conditional around LDAP types. | ||
27 | +- make yellow pages support optional. | ||
28 | |||
29 | 25/07/2012 autofs-5.0.7 | ||
30 | ======================= | ||
31 | diff --git a/Makefile.conf.in b/Makefile.conf.in | ||
32 | index 802318b..3766d45 100644 | ||
33 | --- a/Makefile.conf.in | ||
34 | +++ b/Makefile.conf.in | ||
35 | @@ -43,6 +43,9 @@ NISPLUS = @HAVE_NISPLUS@ | ||
36 | # SMBFS support: yes (1) no (0) | ||
37 | SMBFS = @HAVE_SMBMOUNT@ | ||
38 | |||
39 | +# YellowPages support: yes (1) no (0) | ||
40 | +YPCLNT = @HAVE_YPCLNT@ | ||
41 | + | ||
42 | # Support for calling e2fsck when mounting ext2 filesystems | ||
43 | EXT2FS = @HAVE_E2FSCK@ | ||
44 | |||
45 | diff --git a/configure b/configure | ||
46 | index 3722a46..cf6428c 100755 | ||
47 | --- a/configure | ||
48 | +++ b/configure | ||
49 | @@ -614,6 +614,7 @@ XML_FLAGS | ||
50 | LIBLDAP | ||
51 | HAVE_LDAP | ||
52 | LDAP_FLAGS | ||
53 | +HAVE_YPCLNT | ||
54 | HAVE_NISPLUS | ||
55 | EGREP | ||
56 | GREP | ||
57 | @@ -4575,6 +4576,21 @@ fi | ||
58 | |||
59 | |||
60 | |||
61 | +# YellowPages support? | ||
62 | +HAVE_YPCLNT=0 | ||
63 | +ac_fn_c_check_header_mongrel "$LINENO" "rpcsvc/ypclnt.h" "ac_cv_header_rpcsvc_ypclnt_h" "$ac_includes_default" | ||
64 | +if test "x$ac_cv_header_rpcsvc_ypclnt_h" = xyes; then : | ||
65 | + HAVE_YPCLNT=1 | ||
66 | +fi | ||
67 | + | ||
68 | + | ||
69 | + | ||
70 | +if test "$HAVE_YPCLNT" = "1"; then | ||
71 | + | ||
72 | +$as_echo "#define HAVE_YPCLNT 1" >>confdefs.h | ||
73 | + | ||
74 | +fi | ||
75 | + | ||
76 | # | ||
77 | # OpenLDAP support? Expect that this may have a special directory... | ||
78 | # | ||
79 | diff --git a/configure.in b/configure.in | ||
80 | index 90bda62..363c376 100644 | ||
81 | --- a/configure.in | ||
82 | +++ b/configure.in | ||
83 | @@ -213,6 +213,15 @@ HAVE_NISPLUS=0 | ||
84 | AC_CHECK_HEADER(rpcsvc/nis.h, HAVE_NISPLUS=1) | ||
85 | AC_SUBST(HAVE_NISPLUS) | ||
86 | |||
87 | +# YellowPages support? | ||
88 | +HAVE_YPCLNT=0 | ||
89 | +AC_CHECK_HEADER([rpcsvc/ypclnt.h], HAVE_YPCLNT=1) | ||
90 | +AC_SUBST(HAVE_YPCLNT) | ||
91 | +if test "$HAVE_YPCLNT" = "1"; then | ||
92 | + AC_DEFINE(HAVE_YPCLNT, 1, | ||
93 | + [Define if using YellowPages]) | ||
94 | +fi | ||
95 | + | ||
96 | # | ||
97 | # OpenLDAP support? Expect that this may have a special directory... | ||
98 | # | ||
99 | diff --git a/include/config.h.in b/include/config.h.in | ||
100 | index 9bdf98a..7f1c5b5 100644 | ||
101 | --- a/include/config.h.in | ||
102 | +++ b/include/config.h.in | ||
103 | @@ -72,6 +72,9 @@ | ||
104 | /* Define to 1 if you have the <unistd.h> header file. */ | ||
105 | #undef HAVE_UNISTD_H | ||
106 | |||
107 | +/* Define if using YellowPages */ | ||
108 | +#undef HAVE_YPCLNT | ||
109 | + | ||
110 | /* Use libxml2 tsd usage workaround */ | ||
111 | #undef LIBXML2_WORKAROUND | ||
112 | |||
113 | diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c | ||
114 | index ad1d557..718caf9 100644 | ||
115 | --- a/lib/rpc_subs.c | ||
116 | +++ b/lib/rpc_subs.c | ||
117 | @@ -27,7 +27,6 @@ | ||
118 | #include <net/if.h> | ||
119 | #include <netinet/in.h> | ||
120 | #include <arpa/inet.h> | ||
121 | -#include <rpcsvc/ypclnt.h> | ||
122 | #include <errno.h> | ||
123 | #include <sys/ioctl.h> | ||
124 | #include <ctype.h> | ||
125 | diff --git a/modules/Makefile b/modules/Makefile | ||
126 | index 939da7c..c5deb24 100644 | ||
127 | --- a/modules/Makefile | ||
128 | +++ b/modules/Makefile | ||
129 | @@ -5,13 +5,13 @@ | ||
130 | -include ../Makefile.conf | ||
131 | include ../Makefile.rules | ||
132 | |||
133 | -SRCS := lookup_yp.c lookup_file.c lookup_program.c lookup_userhome.c \ | ||
134 | +SRCS := lookup_file.c lookup_program.c lookup_userhome.c \ | ||
135 | lookup_multi.c lookup_hosts.c lookup_dir.c \ | ||
136 | parse_sun.c \ | ||
137 | mount_generic.c mount_nfs.c mount_afs.c mount_autofs.c \ | ||
138 | mount_changer.c mount_bind.c | ||
139 | |||
140 | -MODS := lookup_yp.so lookup_file.so lookup_program.so lookup_userhome.so \ | ||
141 | +MODS := lookup_file.so lookup_program.so lookup_userhome.so \ | ||
142 | lookup_multi.so lookup_hosts.so lookup_dir.so \ | ||
143 | parse_sun.so \ | ||
144 | mount_generic.so mount_nfs.so mount_afs.so mount_autofs.so \ | ||
145 | @@ -37,6 +37,11 @@ ifeq ($(NISPLUS), 1) | ||
146 | MODS += lookup_nisplus.so | ||
147 | endif | ||
148 | |||
149 | +ifeq ($(YPCLNT), 1) | ||
150 | + SRCS += lookup_yp.c | ||
151 | + MODS += lookup_yp.so | ||
152 | +endif | ||
153 | + | ||
154 | ifeq ($(LDAP), 1) | ||
155 | SRCS += lookup_ldap.c | ||
156 | MODS += lookup_ldap.so | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-modules-replicated-use-sin6.addr-s6_addr32.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-modules-replicated-use-sin6.addr-s6_addr32.patch new file mode 100644 index 0000000000..4516bc5f25 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-modules-replicated-use-sin6.addr-s6_addr32.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | autofs-5.0.7 - modules/replicated.c: use sin6_addr.s6_addr32 | ||
2 | |||
3 | From: Chris Packham <chris.packham@alliedtelesis.co.nz> | ||
4 | |||
5 | The exported in6.h kernel header provides a convenience macro s6_addr32 | ||
6 | for accessing the 32bit words of an ipv6 address. Use this instead of | ||
7 | __in6_u.__u6_addr32. | ||
8 | --- | ||
9 | |||
10 | CHANGELOG | 1 + | ||
11 | modules/replicated.c | 2 +- | ||
12 | 2 files changed, 2 insertions(+), 1 deletions(-) | ||
13 | |||
14 | |||
15 | diff --git a/CHANGELOG b/CHANGELOG | ||
16 | index ed17163..4eaa9f9 100644 | ||
17 | --- a/CHANGELOG | ||
18 | +++ b/CHANGELOG | ||
19 | @@ -26,6 +26,7 @@ | ||
20 | - use numeric protocol ids instead of protoent structs. | ||
21 | - lib/defaults.c: use WITH_LDAP conditional around LDAP types. | ||
22 | - make yellow pages support optional. | ||
23 | +- modules/replicated.c: use sin6_addr.s6_addr32. | ||
24 | |||
25 | 25/07/2012 autofs-5.0.7 | ||
26 | ======================= | ||
27 | diff --git a/modules/replicated.c b/modules/replicated.c | ||
28 | index dbd5513..26f64b8 100644 | ||
29 | --- a/modules/replicated.c | ||
30 | +++ b/modules/replicated.c | ||
31 | @@ -1146,7 +1146,7 @@ try_name: | ||
32 | rr4++; | ||
33 | } else if (this->ai_family == AF_INET6) { | ||
34 | struct sockaddr_in6 *addr = (struct sockaddr_in6 *) this->ai_addr; | ||
35 | - if (!IN6_IS_ADDR_LOOPBACK(addr->sin6_addr.__in6_u.__u6_addr32)) | ||
36 | + if (!IN6_IS_ADDR_LOOPBACK(addr->sin6_addr.s6_addr32)) | ||
37 | rr6++; | ||
38 | } | ||
39 | this = this->ai_next; | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-update-kernel-include-files.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-update-kernel-include-files.patch new file mode 100644 index 0000000000..3b6bb926ab --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-update-kernel-include-files.patch | |||
@@ -0,0 +1,92 @@ | |||
1 | autofs-5.0.7 - update kernel include files | ||
2 | |||
3 | From: Ian Kent <raven@themaw.net> | ||
4 | |||
5 | Update autofs include files to include the latest changes. | ||
6 | --- | ||
7 | include/linux/auto_fs.h | 33 ++++++++++----------------------- | ||
8 | include/linux/auto_fs4.h | 3 ++- | ||
9 | 2 files changed, 12 insertions(+), 24 deletions(-) | ||
10 | |||
11 | diff --git a/include/linux/auto_fs.h b/include/linux/auto_fs.h | ||
12 | index 91d414f..64df1a6 100644 | ||
13 | --- a/include/linux/auto_fs.h | ||
14 | +++ b/include/linux/auto_fs.h | ||
15 | @@ -14,13 +14,8 @@ | ||
16 | #ifndef _LINUX_AUTO_FS_H | ||
17 | #define _LINUX_AUTO_FS_H | ||
18 | |||
19 | -#ifdef __KERNEL__ | ||
20 | -#include <linux/fs.h> | ||
21 | -#include <linux/limits.h> | ||
22 | #include <linux/types.h> | ||
23 | -#include <linux/ioctl.h> | ||
24 | -#else | ||
25 | -#include <asm/types.h> | ||
26 | +#ifndef __KERNEL__ | ||
27 | #include <sys/ioctl.h> | ||
28 | #endif /* __KERNEL__ */ | ||
29 | |||
30 | @@ -32,25 +27,16 @@ | ||
31 | #define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION | ||
32 | |||
33 | /* | ||
34 | - * Architectures where both 32- and 64-bit binaries can be executed | ||
35 | - * on 64-bit kernels need this. This keeps the structure format | ||
36 | - * uniform, and makes sure the wait_queue_token isn't too big to be | ||
37 | - * passed back down to the kernel. | ||
38 | - * | ||
39 | - * This assumes that on these architectures: | ||
40 | - * mode 32 bit 64 bit | ||
41 | - * ------------------------- | ||
42 | - * int 32 bit 32 bit | ||
43 | - * long 32 bit 64 bit | ||
44 | - * | ||
45 | - * If so, 32-bit user-space code should be backwards compatible. | ||
46 | + * The wait_queue_token (autofs_wqt_t) is part of a structure which is passed | ||
47 | + * back to the kernel via ioctl from userspace. On architectures where 32- and | ||
48 | + * 64-bit userspace binaries can be executed it's important that the size of | ||
49 | + * autofs_wqt_t stays constant between 32- and 64-bit Linux kernels so that we | ||
50 | + * do not break the binary ABI interface by changing the structure size. | ||
51 | */ | ||
52 | - | ||
53 | -#if defined(__sparc__) || defined(__mips__) || defined(__x86_64__) \ | ||
54 | - || defined(__powerpc__) || defined(__s390__) | ||
55 | -typedef unsigned int autofs_wqt_t; | ||
56 | -#else | ||
57 | +#if defined(__ia64__) || defined(__alpha__) /* pure 64bit architectures */ | ||
58 | typedef unsigned long autofs_wqt_t; | ||
59 | +#else | ||
60 | +typedef unsigned int autofs_wqt_t; | ||
61 | #endif | ||
62 | |||
63 | /* Packet types */ | ||
64 | @@ -81,6 +67,7 @@ struct autofs_packet_expire { | ||
65 | #define AUTOFS_IOC_FAIL _IO(0x93,0x61) | ||
66 | #define AUTOFS_IOC_CATATONIC _IO(0x93,0x62) | ||
67 | #define AUTOFS_IOC_PROTOVER _IOR(0x93,0x63,int) | ||
68 | +#define AUTOFS_IOC_SETTIMEOUT32 _IOWR(0x93,0x64,compat_ulong_t) | ||
69 | #define AUTOFS_IOC_SETTIMEOUT _IOWR(0x93,0x64,unsigned long) | ||
70 | #define AUTOFS_IOC_EXPIRE _IOR(0x93,0x65,struct autofs_packet_expire) | ||
71 | |||
72 | diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h | ||
73 | index 55fa478..e02982f 100644 | ||
74 | --- a/include/linux/auto_fs4.h | ||
75 | +++ b/include/linux/auto_fs4.h | ||
76 | @@ -12,6 +12,7 @@ | ||
77 | #define _LINUX_AUTO_FS4_H | ||
78 | |||
79 | /* Include common v3 definitions */ | ||
80 | +#include <linux/types.h> | ||
81 | #include <linux/auto_fs.h> | ||
82 | |||
83 | /* autofs v4 definitions */ | ||
84 | @@ -23,7 +24,7 @@ | ||
85 | #define AUTOFS_MIN_PROTO_VERSION 3 | ||
86 | #define AUTOFS_MAX_PROTO_VERSION 5 | ||
87 | |||
88 | -#define AUTOFS_PROTO_SUBVERSION 1 | ||
89 | +#define AUTOFS_PROTO_SUBVERSION 2 | ||
90 | |||
91 | /* Mask for expire behaviour */ | ||
92 | #define AUTOFS_EXP_IMMEDIATE 1 | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-use-numeric-protocol-ids-instead-of-protoent-structs.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-use-numeric-protocol-ids-instead-of-protoent-structs.patch new file mode 100644 index 0000000000..113b0a06ef --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-use-numeric-protocol-ids-instead-of-protoent-structs.patch | |||
@@ -0,0 +1,471 @@ | |||
1 | autofs-5.0.7 - use numeric protocol ids instead of protoent structs | ||
2 | |||
3 | From: Leonardo Chiquitto <leonardo.lists@gmail.com> | ||
4 | |||
5 | The function getprotobyname() is not reentrant, so we can't call | ||
6 | it simultaneously from multiple threads. Instead of switching to | ||
7 | the reentrant version which adds more complexity to the code, | ||
8 | lets use numeric protocol IDs instead of protoent structures. | ||
9 | --- | ||
10 | |||
11 | CHANGELOG | 1 + | ||
12 | include/rpc_subs.h | 4 +-- | ||
13 | lib/rpc_subs.c | 80 ++++++++++++++++++-------------------------------- | ||
14 | modules/replicated.c | 42 +++++++++++--------------- | ||
15 | 4 files changed, 50 insertions(+), 77 deletions(-) | ||
16 | |||
17 | |||
18 | diff --git a/CHANGELOG b/CHANGELOG | ||
19 | index 4cf5621..ba1d65b 100644 | ||
20 | --- a/CHANGELOG | ||
21 | +++ b/CHANGELOG | ||
22 | @@ -23,6 +23,7 @@ | ||
23 | - fix use get_proximity() without libtirpc. | ||
24 | - don't use dirent d_type to filter out files in scandir() | ||
25 | - don't schedule new alarms after readmap. | ||
26 | +- use numeric protocol ids instead of protoent structs. | ||
27 | |||
28 | 25/07/2012 autofs-5.0.7 | ||
29 | ======================= | ||
30 | diff --git a/include/rpc_subs.h b/include/rpc_subs.h | ||
31 | index ca474d9..b6d59f9 100644 | ||
32 | --- a/include/rpc_subs.h | ||
33 | +++ b/include/rpc_subs.h | ||
34 | @@ -54,7 +54,7 @@ struct conn_info { | ||
35 | unsigned short port; | ||
36 | unsigned long program; | ||
37 | unsigned long version; | ||
38 | - struct protoent *proto; | ||
39 | + int proto; | ||
40 | unsigned int send_sz; | ||
41 | unsigned int recv_sz; | ||
42 | struct timeval timeout; | ||
43 | @@ -66,7 +66,7 @@ int rpc_udp_getclient(struct conn_info *, unsigned int, unsigned int); | ||
44 | void rpc_destroy_udp_client(struct conn_info *); | ||
45 | int rpc_tcp_getclient(struct conn_info *, unsigned int, unsigned int); | ||
46 | void rpc_destroy_tcp_client(struct conn_info *); | ||
47 | -int rpc_portmap_getclient(struct conn_info *, const char *, struct sockaddr *, size_t, const char *, unsigned int); | ||
48 | +int rpc_portmap_getclient(struct conn_info *, const char *, struct sockaddr *, size_t, int, unsigned int); | ||
49 | int rpc_portmap_getport(struct conn_info *, struct pmap *, unsigned short *); | ||
50 | int rpc_ping_proto(struct conn_info *); | ||
51 | int rpc_ping(const char *, long, long, unsigned int); | ||
52 | diff --git a/lib/rpc_subs.c b/lib/rpc_subs.c | ||
53 | index d33a3c4..ad1d557 100644 | ||
54 | --- a/lib/rpc_subs.c | ||
55 | +++ b/lib/rpc_subs.c | ||
56 | @@ -170,7 +170,7 @@ static int rpc_do_create_client(struct sockaddr *addr, struct conn_info *info, i | ||
57 | |||
58 | *client = NULL; | ||
59 | |||
60 | - proto = info->proto->p_proto; | ||
61 | + proto = info->proto; | ||
62 | if (proto == IPPROTO_UDP) | ||
63 | type = SOCK_DGRAM; | ||
64 | else | ||
65 | @@ -201,7 +201,7 @@ static int rpc_do_create_client(struct sockaddr *addr, struct conn_info *info, i | ||
66 | in4_raddr = (struct sockaddr_in *) addr; | ||
67 | in4_raddr->sin_port = htons(info->port); | ||
68 | |||
69 | - switch (info->proto->p_proto) { | ||
70 | + switch (info->proto) { | ||
71 | case IPPROTO_UDP: | ||
72 | clnt = clntudp_bufcreate(in4_raddr, | ||
73 | info->program, info->version, | ||
74 | @@ -241,7 +241,7 @@ static int rpc_do_create_client(struct sockaddr *addr, struct conn_info *info, i | ||
75 | |||
76 | *client = NULL; | ||
77 | |||
78 | - proto = info->proto->p_proto; | ||
79 | + proto = info->proto; | ||
80 | if (proto == IPPROTO_UDP) | ||
81 | type = SOCK_DGRAM; | ||
82 | else | ||
83 | @@ -292,11 +292,11 @@ static int rpc_do_create_client(struct sockaddr *addr, struct conn_info *info, i | ||
84 | nb_addr.maxlen = nb_addr.len = slen; | ||
85 | nb_addr.buf = addr; | ||
86 | |||
87 | - if (info->proto->p_proto == IPPROTO_UDP) | ||
88 | + if (info->proto == IPPROTO_UDP) | ||
89 | clnt = clnt_dg_create(*fd, &nb_addr, | ||
90 | info->program, info->version, | ||
91 | info->send_sz, info->recv_sz); | ||
92 | - else if (info->proto->p_proto == IPPROTO_TCP) { | ||
93 | + else if (info->proto == IPPROTO_TCP) { | ||
94 | ret = connect_nb(*fd, addr, slen, &info->timeout); | ||
95 | if (ret < 0) | ||
96 | return ret; | ||
97 | @@ -355,7 +355,7 @@ static int create_client(struct conn_info *info, CLIENT **client) | ||
98 | memset(&hints, 0, sizeof(hints)); | ||
99 | hints.ai_flags = AI_ADDRCONFIG; | ||
100 | hints.ai_family = AF_UNSPEC; | ||
101 | - if (info->proto->p_proto == IPPROTO_UDP) | ||
102 | + if (info->proto == IPPROTO_UDP) | ||
103 | hints.ai_socktype = SOCK_DGRAM; | ||
104 | else | ||
105 | hints.ai_socktype = SOCK_STREAM; | ||
106 | @@ -370,7 +370,7 @@ static int create_client(struct conn_info *info, CLIENT **client) | ||
107 | |||
108 | haddr = ai; | ||
109 | while (haddr) { | ||
110 | - if (haddr->ai_protocol != info->proto->p_proto) { | ||
111 | + if (haddr->ai_protocol != info->proto) { | ||
112 | haddr = haddr->ai_next; | ||
113 | continue; | ||
114 | } | ||
115 | @@ -417,16 +417,11 @@ out_close: | ||
116 | int rpc_udp_getclient(struct conn_info *info, | ||
117 | unsigned int program, unsigned int version) | ||
118 | { | ||
119 | - struct protoent *pe_proto; | ||
120 | CLIENT *client; | ||
121 | int ret; | ||
122 | |||
123 | if (!info->client) { | ||
124 | - pe_proto = getprotobyname("udp"); | ||
125 | - if (!pe_proto) | ||
126 | - return -ENOENT; | ||
127 | - | ||
128 | - info->proto = pe_proto; | ||
129 | + info->proto = IPPROTO_UDP; | ||
130 | info->timeout.tv_sec = RPC_TOUT_UDP; | ||
131 | info->timeout.tv_usec = 0; | ||
132 | info->send_sz = UDPMSGSIZE; | ||
133 | @@ -458,16 +453,11 @@ void rpc_destroy_udp_client(struct conn_info *info) | ||
134 | int rpc_tcp_getclient(struct conn_info *info, | ||
135 | unsigned int program, unsigned int version) | ||
136 | { | ||
137 | - struct protoent *pe_proto; | ||
138 | CLIENT *client; | ||
139 | int ret; | ||
140 | |||
141 | if (!info->client) { | ||
142 | - pe_proto = getprotobyname("tcp"); | ||
143 | - if (!pe_proto) | ||
144 | - return -ENOENT; | ||
145 | - | ||
146 | - info->proto = pe_proto; | ||
147 | + info->proto = IPPROTO_TCP; | ||
148 | info->timeout.tv_sec = RPC_TOUT_TCP; | ||
149 | info->timeout.tv_usec = 0; | ||
150 | info->send_sz = 0; | ||
151 | @@ -513,23 +503,18 @@ void rpc_destroy_tcp_client(struct conn_info *info) | ||
152 | |||
153 | int rpc_portmap_getclient(struct conn_info *info, | ||
154 | const char *host, struct sockaddr *addr, size_t addr_len, | ||
155 | - const char *proto, unsigned int option) | ||
156 | + int proto, unsigned int option) | ||
157 | { | ||
158 | - struct protoent *pe_proto; | ||
159 | CLIENT *client; | ||
160 | int ret; | ||
161 | |||
162 | - pe_proto = getprotobyname(proto); | ||
163 | - if (!pe_proto) | ||
164 | - return -ENOENT; | ||
165 | - | ||
166 | info->host = host; | ||
167 | info->addr = addr; | ||
168 | info->addr_len = addr_len; | ||
169 | info->program = PMAPPROG; | ||
170 | info->port = PMAPPORT; | ||
171 | info->version = PMAPVERS; | ||
172 | - info->proto = pe_proto; | ||
173 | + info->proto = proto; | ||
174 | info->send_sz = RPCSMALLMSGSIZE; | ||
175 | info->recv_sz = RPCSMALLMSGSIZE; | ||
176 | info->timeout.tv_sec = PMAP_TOUT_UDP; | ||
177 | @@ -537,7 +522,7 @@ int rpc_portmap_getclient(struct conn_info *info, | ||
178 | info->close_option = option; | ||
179 | info->client = NULL; | ||
180 | |||
181 | - if (pe_proto->p_proto == IPPROTO_TCP) | ||
182 | + if (info->proto == IPPROTO_TCP) | ||
183 | info->timeout.tv_sec = PMAP_TOUT_TCP; | ||
184 | |||
185 | ret = create_client(info, &client); | ||
186 | @@ -555,7 +540,7 @@ int rpc_portmap_getport(struct conn_info *info, | ||
187 | struct conn_info pmap_info; | ||
188 | CLIENT *client; | ||
189 | enum clnt_stat status; | ||
190 | - int proto = info->proto->p_proto; | ||
191 | + int proto = info->proto; | ||
192 | int ret; | ||
193 | |||
194 | memset(&pmap_info, 0, sizeof(struct conn_info)); | ||
195 | @@ -633,13 +618,13 @@ int rpc_ping_proto(struct conn_info *info) | ||
196 | { | ||
197 | CLIENT *client; | ||
198 | enum clnt_stat status; | ||
199 | - int proto = info->proto->p_proto; | ||
200 | + int proto = info->proto; | ||
201 | int ret; | ||
202 | |||
203 | if (info->client) | ||
204 | client = info->client; | ||
205 | else { | ||
206 | - if (info->proto->p_proto == IPPROTO_UDP) { | ||
207 | + if (info->proto == IPPROTO_UDP) { | ||
208 | info->send_sz = UDPMSGSIZE; | ||
209 | info->recv_sz = UDPMSGSIZE; | ||
210 | } | ||
211 | @@ -688,7 +673,7 @@ int rpc_ping_proto(struct conn_info *info) | ||
212 | |||
213 | static unsigned int __rpc_ping(const char *host, | ||
214 | unsigned long version, | ||
215 | - char *proto, | ||
216 | + int proto, | ||
217 | long seconds, long micros, | ||
218 | unsigned int option) | ||
219 | { | ||
220 | @@ -696,6 +681,7 @@ static unsigned int __rpc_ping(const char *host, | ||
221 | struct conn_info info; | ||
222 | struct pmap parms; | ||
223 | |||
224 | + info.proto = proto; | ||
225 | info.host = host; | ||
226 | info.addr = NULL; | ||
227 | info.addr_len = 0; | ||
228 | @@ -710,13 +696,9 @@ static unsigned int __rpc_ping(const char *host, | ||
229 | |||
230 | status = RPC_PING_FAIL; | ||
231 | |||
232 | - info.proto = getprotobyname(proto); | ||
233 | - if (!info.proto) | ||
234 | - return status; | ||
235 | - | ||
236 | parms.pm_prog = NFS_PROGRAM; | ||
237 | parms.pm_vers = version; | ||
238 | - parms.pm_prot = info.proto->p_proto; | ||
239 | + parms.pm_prot = info.proto; | ||
240 | parms.pm_port = 0; | ||
241 | |||
242 | status = rpc_portmap_getport(&info, &parms, &info.port); | ||
243 | @@ -734,19 +716,19 @@ int rpc_ping(const char *host, long seconds, long micros, unsigned int option) | ||
244 | unsigned long vers2 = NFS2_VERSION; | ||
245 | unsigned int status; | ||
246 | |||
247 | - status = __rpc_ping(host, vers2, "udp", seconds, micros, option); | ||
248 | + status = __rpc_ping(host, vers2, IPPROTO_UDP, seconds, micros, option); | ||
249 | if (status > 0) | ||
250 | return RPC_PING_V2 | RPC_PING_UDP; | ||
251 | |||
252 | - status = __rpc_ping(host, vers3, "udp", seconds, micros, option); | ||
253 | + status = __rpc_ping(host, vers3, IPPROTO_UDP, seconds, micros, option); | ||
254 | if (status > 0) | ||
255 | return RPC_PING_V3 | RPC_PING_UDP; | ||
256 | |||
257 | - status = __rpc_ping(host, vers2, "tcp", seconds, micros, option); | ||
258 | + status = __rpc_ping(host, vers2, IPPROTO_TCP, seconds, micros, option); | ||
259 | if (status > 0) | ||
260 | return RPC_PING_V2 | RPC_PING_TCP; | ||
261 | |||
262 | - status = __rpc_ping(host, vers3, "tcp", seconds, micros, option); | ||
263 | + status = __rpc_ping(host, vers3, IPPROTO_TCP, seconds, micros, option); | ||
264 | if (status > 0) | ||
265 | return RPC_PING_V3 | RPC_PING_TCP; | ||
266 | |||
267 | @@ -769,7 +751,7 @@ int rpc_time(const char *host, | ||
268 | double taken; | ||
269 | struct timeval start, end; | ||
270 | struct timezone tz; | ||
271 | - char *proto = (ping_proto & RPC_PING_UDP) ? "udp" : "tcp"; | ||
272 | + int proto = (ping_proto & RPC_PING_UDP) ? IPPROTO_UDP : IPPROTO_TCP; | ||
273 | unsigned long vers = ping_vers; | ||
274 | |||
275 | gettimeofday(&start, &tz); | ||
276 | @@ -791,12 +773,12 @@ static int rpc_get_exports_proto(struct conn_info *info, exports *exp) | ||
277 | { | ||
278 | CLIENT *client; | ||
279 | enum clnt_stat status; | ||
280 | - int proto = info->proto->p_proto; | ||
281 | + int proto = info->proto; | ||
282 | unsigned int option = info->close_option; | ||
283 | int vers_entry; | ||
284 | int ret; | ||
285 | |||
286 | - if (info->proto->p_proto == IPPROTO_UDP) { | ||
287 | + if (info->proto == IPPROTO_UDP) { | ||
288 | info->send_sz = UDPMSGSIZE; | ||
289 | info->recv_sz = UDPMSGSIZE; | ||
290 | } | ||
291 | @@ -903,11 +885,9 @@ exports rpc_get_exports(const char *host, long seconds, long micros, unsigned in | ||
292 | parms.pm_port = 0; | ||
293 | |||
294 | /* Try UDP first */ | ||
295 | - info.proto = getprotobyname("udp"); | ||
296 | - if (!info.proto) | ||
297 | - goto try_tcp; | ||
298 | + info.proto = IPPROTO_UDP; | ||
299 | |||
300 | - parms.pm_prot = info.proto->p_proto; | ||
301 | + parms.pm_prot = info.proto; | ||
302 | |||
303 | status = rpc_portmap_getport(&info, &parms, &info.port); | ||
304 | if (status < 0) | ||
305 | @@ -920,11 +900,9 @@ exports rpc_get_exports(const char *host, long seconds, long micros, unsigned in | ||
306 | return exportlist; | ||
307 | |||
308 | try_tcp: | ||
309 | - info.proto = getprotobyname("tcp"); | ||
310 | - if (!info.proto) | ||
311 | - return NULL; | ||
312 | + info.proto = IPPROTO_TCP; | ||
313 | |||
314 | - parms.pm_prot = info.proto->p_proto; | ||
315 | + parms.pm_prot = info.proto; | ||
316 | |||
317 | status = rpc_portmap_getport(&info, &parms, &info.port); | ||
318 | if (status < 0) | ||
319 | diff --git a/modules/replicated.c b/modules/replicated.c | ||
320 | index 6b96320..dbd5513 100644 | ||
321 | --- a/modules/replicated.c | ||
322 | +++ b/modules/replicated.c | ||
323 | @@ -419,7 +419,7 @@ void free_host_list(struct host **list) | ||
324 | |||
325 | static unsigned int get_nfs_info(unsigned logopt, struct host *host, | ||
326 | struct conn_info *pm_info, struct conn_info *rpc_info, | ||
327 | - const char *proto, unsigned int version, int port) | ||
328 | + int proto, unsigned int version, int port) | ||
329 | { | ||
330 | unsigned int random_selection = host->options & MOUNT_FLAG_RANDOM_SELECT; | ||
331 | unsigned int use_weight_only = host->options & MOUNT_FLAG_USE_WEIGHT_ONLY; | ||
332 | @@ -433,22 +433,18 @@ static unsigned int get_nfs_info(unsigned logopt, struct host *host, | ||
333 | int status, count = 0; | ||
334 | |||
335 | if (host->addr) | ||
336 | - debug(logopt, "called with host %s(%s) proto %s version 0x%x", | ||
337 | + debug(logopt, "called with host %s(%s) proto %d version 0x%x", | ||
338 | host->name, get_addr_string(host->addr, buf, len), | ||
339 | proto, version); | ||
340 | else | ||
341 | debug(logopt, | ||
342 | - "called for host %s proto %s version 0x%x", | ||
343 | + "called for host %s proto %d version 0x%x", | ||
344 | host->name, proto, version); | ||
345 | |||
346 | - rpc_info->proto = getprotobyname(proto); | ||
347 | - if (!rpc_info->proto) | ||
348 | - return 0; | ||
349 | - | ||
350 | + rpc_info->proto = proto; | ||
351 | memset(&parms, 0, sizeof(struct pmap)); | ||
352 | - | ||
353 | parms.pm_prog = NFS_PROGRAM; | ||
354 | - parms.pm_prot = rpc_info->proto->p_proto; | ||
355 | + parms.pm_prot = proto; | ||
356 | |||
357 | if (!(version & NFS4_REQUESTED)) | ||
358 | goto v3_ver; | ||
359 | @@ -479,7 +475,7 @@ static unsigned int get_nfs_info(unsigned logopt, struct host *host, | ||
360 | } | ||
361 | } | ||
362 | |||
363 | - if (rpc_info->proto->p_proto == IPPROTO_UDP) | ||
364 | + if (rpc_info->proto == IPPROTO_UDP) | ||
365 | status = rpc_udp_getclient(rpc_info, NFS_PROGRAM, NFS4_VERSION); | ||
366 | else | ||
367 | status = rpc_tcp_getclient(rpc_info, NFS_PROGRAM, NFS4_VERSION); | ||
368 | @@ -540,7 +536,7 @@ v3_ver: | ||
369 | goto v2_ver; | ||
370 | } | ||
371 | |||
372 | - if (rpc_info->proto->p_proto == IPPROTO_UDP) | ||
373 | + if (rpc_info->proto == IPPROTO_UDP) | ||
374 | status = rpc_udp_getclient(rpc_info, NFS_PROGRAM, NFS3_VERSION); | ||
375 | else | ||
376 | status = rpc_tcp_getclient(rpc_info, NFS_PROGRAM, NFS3_VERSION); | ||
377 | @@ -587,7 +583,7 @@ v2_ver: | ||
378 | goto done_ver; | ||
379 | } | ||
380 | |||
381 | - if (rpc_info->proto->p_proto == IPPROTO_UDP) | ||
382 | + if (rpc_info->proto == IPPROTO_UDP) | ||
383 | status = rpc_udp_getclient(rpc_info, NFS_PROGRAM, NFS2_VERSION); | ||
384 | else | ||
385 | status = rpc_tcp_getclient(rpc_info, NFS_PROGRAM, NFS2_VERSION); | ||
386 | @@ -618,7 +614,7 @@ v2_ver: | ||
387 | } | ||
388 | |||
389 | done_ver: | ||
390 | - if (rpc_info->proto->p_proto == IPPROTO_UDP) { | ||
391 | + if (rpc_info->proto == IPPROTO_UDP) { | ||
392 | rpc_destroy_udp_client(rpc_info); | ||
393 | rpc_destroy_udp_client(pm_info); | ||
394 | } else { | ||
395 | @@ -675,7 +671,7 @@ static int get_vers_and_cost(unsigned logopt, struct host *host, | ||
396 | |||
397 | if (version & TCP_REQUESTED) { | ||
398 | supported = get_nfs_info(logopt, host, | ||
399 | - &pm_info, &rpc_info, "tcp", vers, port); | ||
400 | + &pm_info, &rpc_info, IPPROTO_TCP, vers, port); | ||
401 | if (IS_ERR(supported)) { | ||
402 | if (ERR(supported) == EHOSTUNREACH || | ||
403 | ERR(supported) == ETIMEDOUT) | ||
404 | @@ -688,7 +684,7 @@ static int get_vers_and_cost(unsigned logopt, struct host *host, | ||
405 | |||
406 | if (version & UDP_REQUESTED) { | ||
407 | supported = get_nfs_info(logopt, host, | ||
408 | - &pm_info, &rpc_info, "udp", vers, port); | ||
409 | + &pm_info, &rpc_info, IPPROTO_UDP, vers, port); | ||
410 | if (IS_ERR(supported)) { | ||
411 | if (!ret && ERR(supported) == ETIMEDOUT) | ||
412 | return ret; | ||
413 | @@ -709,7 +705,7 @@ static int get_supported_ver_and_cost(unsigned logopt, struct host *host, | ||
414 | socklen_t len = INET6_ADDRSTRLEN; | ||
415 | char buf[len + 1]; | ||
416 | struct conn_info pm_info, rpc_info; | ||
417 | - const char *proto; | ||
418 | + int proto; | ||
419 | unsigned int vers; | ||
420 | struct timeval start, end; | ||
421 | struct timezone tz; | ||
422 | @@ -748,10 +744,10 @@ static int get_supported_ver_and_cost(unsigned logopt, struct host *host, | ||
423 | * So, we do the conversion here. | ||
424 | */ | ||
425 | if (version & UDP_SELECTED_MASK) { | ||
426 | - proto = "udp"; | ||
427 | + proto = IPPROTO_UDP; | ||
428 | version >>= 8; | ||
429 | } else | ||
430 | - proto = "tcp"; | ||
431 | + proto = IPPROTO_TCP; | ||
432 | |||
433 | switch (version) { | ||
434 | case NFS2_SUPPORTED: | ||
435 | @@ -768,9 +764,7 @@ static int get_supported_ver_and_cost(unsigned logopt, struct host *host, | ||
436 | return 0; | ||
437 | } | ||
438 | |||
439 | - rpc_info.proto = getprotobyname(proto); | ||
440 | - if (!rpc_info.proto) | ||
441 | - return 0; | ||
442 | + rpc_info.proto = proto; | ||
443 | |||
444 | if (port > 0) | ||
445 | rpc_info.port = port; | ||
446 | @@ -786,14 +780,14 @@ static int get_supported_ver_and_cost(unsigned logopt, struct host *host, | ||
447 | |||
448 | memset(&parms, 0, sizeof(struct pmap)); | ||
449 | parms.pm_prog = NFS_PROGRAM; | ||
450 | - parms.pm_prot = rpc_info.proto->p_proto; | ||
451 | + parms.pm_prot = rpc_info.proto; | ||
452 | parms.pm_vers = vers; | ||
453 | ret = rpc_portmap_getport(&pm_info, &parms, &rpc_info.port); | ||
454 | if (ret < 0) | ||
455 | goto done; | ||
456 | } | ||
457 | |||
458 | - if (rpc_info.proto->p_proto == IPPROTO_UDP) | ||
459 | + if (rpc_info.proto == IPPROTO_UDP) | ||
460 | status = rpc_udp_getclient(&rpc_info, NFS_PROGRAM, vers); | ||
461 | else | ||
462 | status = rpc_tcp_getclient(&rpc_info, NFS_PROGRAM, vers); | ||
463 | @@ -815,7 +809,7 @@ static int get_supported_ver_and_cost(unsigned logopt, struct host *host, | ||
464 | } | ||
465 | } | ||
466 | done: | ||
467 | - if (rpc_info.proto->p_proto == IPPROTO_UDP) { | ||
468 | + if (rpc_info.proto == IPPROTO_UDP) { | ||
469 | rpc_destroy_udp_client(&rpc_info); | ||
470 | rpc_destroy_udp_client(&pm_info); | ||
471 | } else { | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-workaround-missing-GNU-versionsort-extension.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-workaround-missing-GNU-versionsort-extension.patch new file mode 100644 index 0000000000..6a1a49e62c --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-5.0.7-workaround-missing-GNU-versionsort-extension.patch | |||
@@ -0,0 +1,149 @@ | |||
1 | autofs-5.0.7 - workaround missing GNU versionsort extension | ||
2 | |||
3 | From: Chris Packham <chris.packham@alliedtelesis.co.nz> | ||
4 | |||
5 | alphasort() and scandir() are specified in POSIX.1-2008, versionsort() | ||
6 | is a GNU extension. When versionsort isn't available fallback to using | ||
7 | alphasort. | ||
8 | --- | ||
9 | |||
10 | CHANGELOG | 1 + | ||
11 | configure | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
12 | configure.in | 6 +++++ | ||
13 | include/config.h.in | 3 ++ | ||
14 | modules/lookup_dir.c | 5 ++++ | ||
15 | 5 files changed, 77 insertions(+), 0 deletions(-) | ||
16 | |||
17 | |||
18 | diff --git a/CHANGELOG b/CHANGELOG | ||
19 | index 4eaa9f9..39388a5 100644 | ||
20 | --- a/CHANGELOG | ||
21 | +++ b/CHANGELOG | ||
22 | @@ -27,6 +27,7 @@ | ||
23 | - lib/defaults.c: use WITH_LDAP conditional around LDAP types. | ||
24 | - make yellow pages support optional. | ||
25 | - modules/replicated.c: use sin6_addr.s6_addr32. | ||
26 | +- workaround missing GNU versionsort extension. | ||
27 | |||
28 | 25/07/2012 autofs-5.0.7 | ||
29 | ======================= | ||
30 | diff --git a/configure b/configure | ||
31 | index cf6428c..c1423d8 100755 | ||
32 | --- a/configure | ||
33 | +++ b/configure | ||
34 | @@ -4010,6 +4010,68 @@ $as_echo "yes" >&6; } | ||
35 | KRB5_FLAGS=`$KRB5_CONFIG --cflags` | ||
36 | fi | ||
37 | |||
38 | +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing versionsort" >&5 | ||
39 | +$as_echo_n "checking for library containing versionsort... " >&6; } | ||
40 | +if ${ac_cv_search_versionsort+:} false; then : | ||
41 | + $as_echo_n "(cached) " >&6 | ||
42 | +else | ||
43 | + ac_func_search_save_LIBS=$LIBS | ||
44 | +cat confdefs.h - <<_ACEOF >conftest.$ac_ext | ||
45 | +/* end confdefs.h. */ | ||
46 | + | ||
47 | +/* Override any GCC internal prototype to avoid an error. | ||
48 | + Use char because int might match the return type of a GCC | ||
49 | + builtin and then its argument prototype would still apply. */ | ||
50 | +#ifdef __cplusplus | ||
51 | +extern "C" | ||
52 | +#endif | ||
53 | +char versionsort (); | ||
54 | +int | ||
55 | +main () | ||
56 | +{ | ||
57 | +return versionsort (); | ||
58 | + ; | ||
59 | + return 0; | ||
60 | +} | ||
61 | +_ACEOF | ||
62 | +for ac_lib in '' ; do | ||
63 | + if test -z "$ac_lib"; then | ||
64 | + ac_res="none required" | ||
65 | + else | ||
66 | + ac_res=-l$ac_lib | ||
67 | + LIBS="-l$ac_lib $ac_func_search_save_LIBS" | ||
68 | + fi | ||
69 | + if ac_fn_c_try_link "$LINENO"; then : | ||
70 | + ac_cv_search_versionsort=$ac_res | ||
71 | +fi | ||
72 | +rm -f core conftest.err conftest.$ac_objext \ | ||
73 | + conftest$ac_exeext | ||
74 | + if ${ac_cv_search_versionsort+:} false; then : | ||
75 | + break | ||
76 | +fi | ||
77 | +done | ||
78 | +if ${ac_cv_search_versionsort+:} false; then : | ||
79 | + | ||
80 | +else | ||
81 | + ac_cv_search_versionsort=no | ||
82 | +fi | ||
83 | +rm conftest.$ac_ext | ||
84 | +LIBS=$ac_func_search_save_LIBS | ||
85 | +fi | ||
86 | +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_versionsort" >&5 | ||
87 | +$as_echo "$ac_cv_search_versionsort" >&6; } | ||
88 | +ac_res=$ac_cv_search_versionsort | ||
89 | +if test "$ac_res" != no; then : | ||
90 | + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" | ||
91 | + | ||
92 | +fi | ||
93 | + | ||
94 | +if test "$ac_cv_search_versionsort" = "no"; then | ||
95 | + | ||
96 | +$as_echo "#define WITHOUT_VERSIONSORT 1" >>confdefs.h | ||
97 | + | ||
98 | +fi | ||
99 | + | ||
100 | # | ||
101 | # glibc/libc 6 new libraries | ||
102 | # | ||
103 | diff --git a/configure.in b/configure.in | ||
104 | index 363c376..4029375 100644 | ||
105 | --- a/configure.in | ||
106 | +++ b/configure.in | ||
107 | @@ -163,6 +163,12 @@ AF_SLOPPY_MOUNT() | ||
108 | AF_CHECK_LIBXML() | ||
109 | AF_CHECK_KRB5() | ||
110 | |||
111 | +AC_SEARCH_LIBS([versionsort],[]) | ||
112 | +if test "$ac_cv_search_versionsort" = "no"; then | ||
113 | + AC_DEFINE(WITHOUT_VERSIONSORT, 1, | ||
114 | + [Define if your C library does not provide versionsort]) | ||
115 | +fi | ||
116 | + | ||
117 | # | ||
118 | # glibc/libc 6 new libraries | ||
119 | # | ||
120 | diff --git a/include/config.h.in b/include/config.h.in | ||
121 | index 7f1c5b5..a2a05a8 100644 | ||
122 | --- a/include/config.h.in | ||
123 | +++ b/include/config.h.in | ||
124 | @@ -135,6 +135,9 @@ | ||
125 | /* Define to 1 to use the libtirpc tsd usage workaround */ | ||
126 | #undef TIRPC_WORKAROUND | ||
127 | |||
128 | +/* Define if your C library does not provide versionsort */ | ||
129 | +#undef WITHOUT_VERSIONSORT | ||
130 | + | ||
131 | /* Define if using the dmalloc debugging malloc package */ | ||
132 | #undef WITH_DMALLOC | ||
133 | |||
134 | diff --git a/modules/lookup_dir.c b/modules/lookup_dir.c | ||
135 | index 33901c0..07471b7 100644 | ||
136 | --- a/modules/lookup_dir.c | ||
137 | +++ b/modules/lookup_dir.c | ||
138 | @@ -39,6 +39,11 @@ | ||
139 | #define AUTOFS_DIR_EXT ".autofs" | ||
140 | #define AUTOFS_DIR_EXTSIZ (sizeof(AUTOFS_DIR_EXT) - 1) | ||
141 | |||
142 | +/* Work around non-GNU systems that don't provide versionsort */ | ||
143 | +#ifdef WITHOUT_VERSIONSORT | ||
144 | +#define versionsort alphasort | ||
145 | +#endif | ||
146 | + | ||
147 | struct lookup_context { | ||
148 | const char *mapname; | ||
149 | }; | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-additional-distros.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-additional-distros.patch new file mode 100644 index 0000000000..6a35843cea --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/autofs-additional-distros.patch | |||
@@ -0,0 +1,12 @@ | |||
1 | --- autofs-4.1.4/samples/rc.autofs.in~ 2005-04-11 06:30:54.000000000 -0500 | ||
2 | +++ autofs-4.1.4/samples/rc.autofs.in 2007-04-07 13:18:44.000000000 -0500 | ||
3 | @@ -43,6 +43,9 @@ | ||
4 | system=debian | ||
5 | elif [ -f /etc/redhat-release ]; then | ||
6 | system=redhat | ||
7 | +elif [ -f /etc/issue ] && grep -q "^SlugOS\|Yocto" /etc/issue ; then | ||
8 | + # SlugOS and Yocto behave like Debian, at least for autofs purposes. | ||
9 | + system=debian | ||
10 | else | ||
11 | echo "$0: Unknown system, please port and contact autofs@linux.kernel.org" 1>&2 | ||
12 | exit 1 | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/cross.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/cross.patch new file mode 100644 index 0000000000..8f1af625f0 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/cross.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | Index: autofs-5.0.7/aclocal.m4 | ||
2 | =================================================================== | ||
3 | --- autofs-5.0.7.orig/aclocal.m4 2012-10-28 04:45:07.000000000 -0700 | ||
4 | +++ autofs-5.0.7/aclocal.m4 2012-10-28 10:47:53.263996910 -0700 | ||
5 | @@ -7,6 +7,8 @@ | ||
6 | AC_DEFUN(AF_PATH_INCLUDE, | ||
7 | [AC_PATH_PROGS($1,$2,$3,$4) | ||
8 | if test -n "$$1"; then | ||
9 | + AH_TEMPLATE([HAVE_$1], [Have $2]) | ||
10 | + AH_TEMPLATE([PATH_$1], [Have $2]) | ||
11 | AC_DEFINE(HAVE_$1,1,[define if you have $1]) | ||
12 | AC_DEFINE_UNQUOTED(PATH_$1, "$$1", [define if you have $1]) | ||
13 | HAVE_$1=1 | ||
14 | Index: autofs-5.0.7/configure.in | ||
15 | =================================================================== | ||
16 | --- autofs-5.0.7.orig/configure.in 2012-10-28 04:45:06.000000000 -0700 | ||
17 | +++ autofs-5.0.7/configure.in 2012-10-28 10:50:07.580000628 -0700 | ||
18 | @@ -301,13 +301,15 @@ | ||
19 | cat > pietest.c <<EOF | ||
20 | int main(void) { return 0; } | ||
21 | EOF | ||
22 | +AF_tmp_ldflags="$LDFLAGS" | ||
23 | +AF_tmp_cflags="$CFLAGS" | ||
24 | CFLAGS=-fPIE | ||
25 | LDFLAGS=-pie | ||
26 | DAEMON_CFLAGS= | ||
27 | DAEMON_LDFLAGS= | ||
28 | AC_MSG_CHECKING([whether gcc -fPIE works]) | ||
29 | -AC_RUN_IFELSE([AC_LANG_PROGRAM([[]], [[int main(void) {return 0;}]])], | ||
30 | - [gcc_supports_pie=yes], [gcc_supports_pie=no], [gcc_supports_pie=no]) | ||
31 | +AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int main(void) {return 0;}]])], | ||
32 | + [gcc_supports_pie=yes], [gcc_supports_pie=no], [gcc_supports_pie=no]) | ||
33 | AC_MSG_RESULT([$gcc_supports_pie]) | ||
34 | if test $gcc_supports_pie = yes ; then | ||
35 | DAEMON_CFLAGS="-fPIE" | ||
36 | @@ -316,6 +318,8 @@ | ||
37 | rm -f pietest.c | ||
38 | AC_SUBST(DAEMON_CFLAGS) | ||
39 | AC_SUBST(DAEMON_LDFLAGS) | ||
40 | +CFLAGS="${AF_tmp_cflags}" | ||
41 | +LDFLAGS="${AF_tmp_ldflags}" | ||
42 | |||
43 | # | ||
44 | # Enable ability to access value in external env variable | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/fix_disable_ldap.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/fix_disable_ldap.patch new file mode 100644 index 0000000000..31c8510a69 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/fix_disable_ldap.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | autofs: fails to compile with openldap disabled | ||
2 | |||
3 | As of 5.0.6, it appears that changes were introduced so that | ||
4 | if you compile with openldap disabled and openldap headers are not | ||
5 | available, then autofs fails to build. | ||
6 | |||
7 | Upstream-Status: Pending | ||
8 | |||
9 | Signed-off-by: Amy Fong <amy.fong@windriver.com> | ||
10 | -- | ||
11 | lookup_ldap.h | 4 ++++ | ||
12 | 1 file changed, 4 insertions(+) | ||
13 | |||
14 | --- | ||
15 | include/lookup_ldap.h | 4 ++++ | ||
16 | 1 file changed, 4 insertions(+) | ||
17 | |||
18 | --- a/include/lookup_ldap.h | ||
19 | +++ b/include/lookup_ldap.h | ||
20 | @@ -1,7 +1,9 @@ | ||
21 | #ifndef LOOKUP_LDAP_H | ||
22 | #define LOOKUP_LDAP_H | ||
23 | |||
24 | +#ifdef WITH_LDAP | ||
25 | #include <ldap.h> | ||
26 | +#endif | ||
27 | |||
28 | #ifdef WITH_SASL | ||
29 | #include <openssl/ssl.h> | ||
30 | @@ -109,10 +111,12 @@ | ||
31 | |||
32 | #define LDAP_AUTH_USESIMPLE 0x0008 | ||
33 | |||
34 | +#ifdef WITH_LDAP | ||
35 | /* lookup_ldap.c */ | ||
36 | LDAP *init_ldap_connection(unsigned logopt, const char *uri, struct lookup_context *ctxt); | ||
37 | int unbind_ldap_connection(unsigned logopt, LDAP *ldap, struct lookup_context *ctxt); | ||
38 | int authtype_requires_creds(const char *authtype); | ||
39 | +#endif | ||
40 | |||
41 | #ifdef WITH_SASL | ||
42 | /* cyrus-sasl.c */ | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/libtirpc-name-clash-backout.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/libtirpc-name-clash-backout.patch new file mode 100644 index 0000000000..104724014d --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/libtirpc-name-clash-backout.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | Index: autofs-5.0.7/lib/rpc_subs.c | ||
2 | =================================================================== | ||
3 | --- autofs-5.0.7.orig/lib/rpc_subs.c 2012-07-24 23:05:26.000000000 -0700 | ||
4 | +++ autofs-5.0.7/lib/rpc_subs.c 2012-10-28 14:47:49.008382116 -0700 | ||
5 | @@ -34,16 +34,6 @@ | ||
6 | #include <pthread.h> | ||
7 | #include <poll.h> | ||
8 | |||
9 | -#ifdef WITH_LIBTIRPC | ||
10 | -#undef auth_destroy | ||
11 | -#define auth_destroy(auth) \ | ||
12 | - do { \ | ||
13 | - int refs; \ | ||
14 | - if ((refs = auth_put((auth))) == 0) \ | ||
15 | - ((*((auth)->ah_ops->ah_destroy))(auth));\ | ||
16 | - } while (0) | ||
17 | -#endif | ||
18 | - | ||
19 | #include "mount.h" | ||
20 | #include "rpc_subs.h" | ||
21 | #include "automount.h" | ||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/libtirpc.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/libtirpc.patch new file mode 100644 index 0000000000..04f52c6f0e --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/libtirpc.patch | |||
@@ -0,0 +1,26 @@ | |||
1 | Index: autofs-5.0.7/aclocal.m4 | ||
2 | =================================================================== | ||
3 | --- autofs-5.0.7.orig/aclocal.m4 2012-10-28 13:17:45.504237027 -0700 | ||
4 | +++ autofs-5.0.7/aclocal.m4 2012-10-28 13:20:50.108242739 -0700 | ||
5 | @@ -403,7 +403,7 @@ | ||
6 | # save current flags | ||
7 | af_check_libtirpc_save_cflags="$CFLAGS" | ||
8 | af_check_libtirpc_save_ldflags="$LDFLAGS" | ||
9 | -CFLAGS="$CFLAGS -I/usr/include/tirpc" | ||
10 | +CFLAGS="$CFLAGS -I=/usr/include/tirpc" | ||
11 | LDFLAGS="$LDFLAGS -ltirpc" | ||
12 | |||
13 | AC_TRY_LINK( | ||
14 | Index: autofs-5.0.7/Makefile.rules | ||
15 | =================================================================== | ||
16 | --- autofs-5.0.7.orig/Makefile.rules 2012-10-28 13:17:45.308237022 -0700 | ||
17 | +++ autofs-5.0.7/Makefile.rules 2012-10-28 13:21:25.720242803 -0700 | ||
18 | @@ -48,7 +48,7 @@ | ||
19 | LDFLAGS += -lpthread | ||
20 | |||
21 | ifdef TIRPCLIB | ||
22 | -CFLAGS += -I/usr/include/tirpc | ||
23 | +CFLAGS += -I=/usr/include/tirpc | ||
24 | LDFLAGS += $(TIRPCLIB) | ||
25 | endif | ||
26 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs-5.0.7/no-bash.patch b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/no-bash.patch new file mode 100644 index 0000000000..cf03635270 --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs-5.0.7/no-bash.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | Index: autofs-5.0.7/samples/auto.net | ||
2 | =================================================================== | ||
3 | --- autofs-5.0.7.orig/samples/auto.net 2012-07-24 23:05:26.000000000 -0700 | ||
4 | +++ autofs-5.0.7/samples/auto.net 2012-10-28 10:44:25.035991715 -0700 | ||
5 | @@ -1,4 +1,4 @@ | ||
6 | -#!/bin/bash | ||
7 | +#!/bin/sh | ||
8 | |||
9 | # This file must be executable to work! chmod 755! | ||
10 | |||
11 | Index: autofs-5.0.7/samples/auto.smb | ||
12 | =================================================================== | ||
13 | --- autofs-5.0.7.orig/samples/auto.smb 2012-07-24 23:05:26.000000000 -0700 | ||
14 | +++ autofs-5.0.7/samples/auto.smb 2012-10-28 10:44:25.035991715 -0700 | ||
15 | @@ -1,4 +1,4 @@ | ||
16 | -#!/bin/bash | ||
17 | +#!/bin/sh | ||
18 | |||
19 | # This file must be executable to work! chmod 755! | ||
20 | |||
diff --git a/meta-networking/recipes-daemons/autofs/autofs_5.0.7.bb b/meta-networking/recipes-daemons/autofs/autofs_5.0.7.bb new file mode 100644 index 0000000000..501e40acdd --- /dev/null +++ b/meta-networking/recipes-daemons/autofs/autofs_5.0.7.bb | |||
@@ -0,0 +1,112 @@ | |||
1 | SUMMARY = "Kernel based automounter for linux" | ||
2 | SECTION = "base" | ||
3 | LICENSE = "GPL-2.0" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" | ||
5 | |||
6 | PR = "r6" | ||
7 | |||
8 | DEPENDS += "libtirpc flex-native bison-native" | ||
9 | |||
10 | inherit autotools systemd | ||
11 | |||
12 | SRC_URI = "${KERNELORG_MIRROR}/linux/daemons/autofs/v5/autofs-${PV}.tar.bz2 \ | ||
13 | file://autofs-5.0.7-fix-nobind-sun-escaped-map-entries.patch \ | ||
14 | file://autofs-5.0.7-fix-use-cache-entry-after-free-mistake.patch \ | ||
15 | file://autofs-5.0.7-fix-ipv6-proximity-calculation.patch \ | ||
16 | file://autofs-5.0.7-fix-parse-buffer-initialization.patch \ | ||
17 | file://autofs-5.0.7-fix-typo-in-automount-8.patch \ | ||
18 | file://autofs-5.0.7-include-usage-in-usage-message.patch \ | ||
19 | file://autofs-5.0.7-dont-wait-forever-to-restart.patch \ | ||
20 | file://autofs-5.0.7-add-timeout-option-description-to-man-page.patch \ | ||
21 | file://autofs-5.0.7-fix-null-map-entry-order-handling.patch \ | ||
22 | file://autofs-5.0.7-make-description-of-default-MOUNT_WAIT-setting-clear.patch \ | ||
23 | file://autofs-5.0.7-configure-in-allow-cross-compilation.patch \ | ||
24 | file://autofs-5.0.7-README-update-mailing-list-subscription-info.patch \ | ||
25 | file://autofs-5.0.7-allow-non-root-user-to-check-status.patch \ | ||
26 | file://autofs-5.0.7-configure-allow-cross-compilation-update.patch \ | ||
27 | file://autofs-5.0.6-fix-recursive-mount-deadlock.patch \ | ||
28 | file://autofs-5.0.6-increase-file-map-read-buffer-size.patch \ | ||
29 | file://autofs-5.0.7-handle-new-location-of-systemd.patch \ | ||
30 | file://autofs-5.0.7-fix-map-entry-duplicate-offset-detection.patch \ | ||
31 | file://autofs-5.0.7-allow-nsswitch_conf-to-not-contain-automount-lines.patch \ | ||
32 | file://autofs-5.0.7-fix-nobind-man-page-description.patch \ | ||
33 | file://autofs-5.0.7-fix-submount-offset-delete.patch \ | ||
34 | file://autofs-5.0.7-fix-init-script-status-return.patch \ | ||
35 | file://autofs-5.0.7-fix-use-get_proximity-without-libtirpc.patch \ | ||
36 | file://autofs-5.0.7-dont-use-dirent-d_type-to-filter-out-files-in-scandir.patch \ | ||
37 | file://autofs-5.0.7-dont-schedule-new-alarms-after-readmap.patch \ | ||
38 | file://autofs-5.0.7-use-numeric-protocol-ids-instead-of-protoent-structs.patch \ | ||
39 | file://autofs-5.0.7-lib-defaults-use-WITH_LDAP-conditional-around-LDAP-types.patch \ | ||
40 | file://autofs-5.0.7-make-yellow-pages-support-optional.patch \ | ||
41 | file://autofs-5.0.7-modules-replicated-use-sin6.addr-s6_addr32.patch \ | ||
42 | file://autofs-5.0.7-workaround-missing-GNU-versionsort-extension.patch \ | ||
43 | file://autofs-5.0.7-dont-fail-on-master-map-self-include.patch \ | ||
44 | file://autofs-5.0.7-fix-wildcard-multi-map-regression.patch \ | ||
45 | file://autofs-5.0.7-fix-file-descriptor-leak-when-reloading-the-daemon.patch \ | ||
46 | file://autofs-5.0.7-depricate-nosymlink-pseudo-option.patch \ | ||
47 | file://autofs-5.0.7-add-symlink-pseudo-option.patch \ | ||
48 | file://autofs-5.0.7-update-kernel-include-files.patch \ | ||
49 | file://autofs-5.0.7-fix-requires-in-spec-file.patch \ | ||
50 | file://autofs-5.0.7-fix-libtirpc-build-option.patch \ | ||
51 | file://autofs-5.0.7-fix-systemd-unidir-in-spec-file.patch \ | ||
52 | file://autofs-5.0.7-document-browse-option-in-man-page.patch \ | ||
53 | file://autofs-5.0.7-fix-automounter-support-on-parisc.patch \ | ||
54 | file://autofs-5.0.7-include-linux-nfs.h-directly-in-rpc_sub.patch \ | ||
55 | file://Makefile.rules-cross.patch \ | ||
56 | file://no-bash.patch \ | ||
57 | file://cross.patch \ | ||
58 | file://libtirpc.patch \ | ||
59 | file://libtirpc-name-clash-backout.patch \ | ||
60 | file://autofs-5.0.7-do-not-check-for-modprobe.patch \ | ||
61 | file://fix_disable_ldap.patch \ | ||
62 | file://autofs-5.0.7-fix-lib-deps.patch \ | ||
63 | file://0001-systemd-allow-with-systemd-to-take-a-path-arg.patch \ | ||
64 | " | ||
65 | |||
66 | SRC_URI[md5sum] = "bc46838dece83c02d800ff144ed9f431" | ||
67 | SRC_URI[sha256sum] = "08c4304d8076dc80c14df559bc5fd821b67ef3457b245f61068bd053d8f94ccc" | ||
68 | |||
69 | inherit update-rc.d pkgconfig | ||
70 | |||
71 | INITSCRIPT_NAME = "autofs" | ||
72 | INITSCRIPT_PARAMS = "defaults" | ||
73 | |||
74 | # FIXME: modules/Makefile has crappy rules that don't obey LDFLAGS | ||
75 | CFLAGS += "${LDFLAGS}" | ||
76 | |||
77 | PACKAGECONFIG[systemd] = "--with-systemd=${systemd_unitdir}/system,--without-systemd,systemd" | ||
78 | |||
79 | PACKAGECONFIG ?= "${@base_contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)}" | ||
80 | |||
81 | EXTRA_OEMAKE = "DONTSTRIP=1" | ||
82 | EXTRA_OECONF += "--disable-mount-locking \ | ||
83 | --enable-ignore-busy --with-openldap=no \ | ||
84 | --with-sasl=no --with-libtirpc=yes \ | ||
85 | --with-path=${STAGING_BINDIR_NATIVE} \ | ||
86 | " | ||
87 | CACHED_CONFIGUREVARS = "ac_cv_path_RANLIB=${RANLIB} \ | ||
88 | ac_cv_path_RPCGEN=rpcgen \ | ||
89 | " | ||
90 | |||
91 | do_configure_prepend () { | ||
92 | sed -e "s:filagdir:flagdir:" -i configure.in | ||
93 | if [ ! -e acinclude.m4 ]; then | ||
94 | cp aclocal.m4 acinclude.m4 | ||
95 | fi | ||
96 | } | ||
97 | |||
98 | do_install_append () { | ||
99 | if [ -d ${D}/run ]; then | ||
100 | rmdir ${D}/run | ||
101 | fi | ||
102 | if [ -d ${D}${localstatedir}/run ]; then | ||
103 | rmdir ${D}${localstatedir}/run | ||
104 | fi | ||
105 | } | ||
106 | |||
107 | INSANE_SKIP_${PN} = "dev-so" | ||
108 | |||
109 | RPROVIDES_${PN} += "${PN}-systemd" | ||
110 | RREPLACES_${PN} += "${PN}-systemd" | ||
111 | RCONFLICTS_${PN} += "${PN}-systemd" | ||
112 | SYSTEMD_SERVICE_${PN} = "autofs.service" | ||
diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/Fix-hardcoded-libdir.patch b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/Fix-hardcoded-libdir.patch new file mode 100644 index 0000000000..3fa8431c34 --- /dev/null +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/Fix-hardcoded-libdir.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | Fix hardcoded libdir. | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
6 | --- | ||
7 | plugins/Makefile.am | 2 +- | ||
8 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
9 | |||
10 | diff --git a/plugins/Makefile.am b/plugins/Makefile.am | ||
11 | index b00915f..25262a1 100644 | ||
12 | --- a/plugins/Makefile.am | ||
13 | +++ b/plugins/Makefile.am | ||
14 | @@ -62,7 +62,7 @@ plugindir = @plugindir@ | ||
15 | |||
16 | common_sources = plugin_common.c plugin_common.h | ||
17 | |||
18 | -sasldir = $(prefix)/lib/sasl2 | ||
19 | +sasldir = $(libdir)/sasl2 | ||
20 | sasl_LTLIBRARIES = @SASL_MECHS@ | ||
21 | EXTRA_LTLIBRARIES = libplain.la libanonymous.la libkerberos4.la libcrammd5.la \ | ||
22 | libgs2.la libgssapiv2.la libdigestmd5.la liblogin.la libsrp.la libotp.la \ | ||
23 | -- | ||
24 | 1.7.4.1 | ||
25 | |||
diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/avoid-to-call-AC_TRY_RUN.patch b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/avoid-to-call-AC_TRY_RUN.patch new file mode 100644 index 0000000000..6407721ae3 --- /dev/null +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/avoid-to-call-AC_TRY_RUN.patch | |||
@@ -0,0 +1,46 @@ | |||
1 | Avoid to call AC_TRY_RUN | ||
2 | |||
3 | Upstream-Status: Inappropriate [configuration] | ||
4 | |||
5 | Avoid to call AC_TRY_RUN to check if GSSAPI libraries support SPNEGO | ||
6 | on cross-compile environment by definition AC_ARG_ENABLE enable-spnego | ||
7 | |||
8 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
9 | --- | ||
10 | cmulocal/sasl2.m4 | 13 ++++++++++++- | ||
11 | 1 file changed, 12 insertions(+), 1 deletion(-) | ||
12 | |||
13 | diff --git a/cmulocal/sasl2.m4 b/cmulocal/sasl2.m4 | ||
14 | index 3c2841a..a5ecf81 100644 | ||
15 | --- a/cmulocal/sasl2.m4 | ||
16 | +++ b/cmulocal/sasl2.m4 | ||
17 | @@ -281,6 +281,17 @@ if test "$gssapi" != no; then | ||
18 | |||
19 | cmu_save_LIBS="$LIBS" | ||
20 | LIBS="$LIBS $GSSAPIBASE_LIBS" | ||
21 | + AC_ARG_ENABLE([spnego], | ||
22 | + [AC_HELP_STRING([--enable-spnego=<DIR>], | ||
23 | + [enable SPNEGO support in GSSAPI libraries [no]])], | ||
24 | + [spnego=$enableval], | ||
25 | + [spnego=no]) | ||
26 | + | ||
27 | + if test "$spnego" = no; then | ||
28 | + echo "no" | ||
29 | + elif test "$spnego" = yes; then | ||
30 | + AC_DEFINE(HAVE_GSS_SPNEGO,,[Define if your GSSAPI implementation supports SPNEGO]) | ||
31 | + else | ||
32 | AC_MSG_CHECKING([for SPNEGO support in GSSAPI libraries]) | ||
33 | AC_TRY_RUN([ | ||
34 | #ifdef HAVE_GSSAPI_H | ||
35 | @@ -308,7 +319,7 @@ int main(void) | ||
36 | AC_MSG_RESULT(yes) ], | ||
37 | AC_MSG_RESULT(no)) | ||
38 | LIBS="$cmu_save_LIBS" | ||
39 | - | ||
40 | + fi | ||
41 | else | ||
42 | AC_MSG_RESULT([disabled]) | ||
43 | fi | ||
44 | -- | ||
45 | 1.7.10.4 | ||
46 | |||
diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0009_sasldb_al.diff b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0009_sasldb_al.diff new file mode 100644 index 0000000000..8eff5a8bdd --- /dev/null +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0009_sasldb_al.diff | |||
@@ -0,0 +1,14 @@ | |||
1 | Author: Fabian Fagerholm <fabbe@debian.org> | ||
2 | Description: Fix linking with libsasldb.a when saslauthd is built with sasldb | ||
3 | support. | ||
4 | --- a/saslauthd/configure.in | ||
5 | +++ b/saslauthd/configure.in | ||
6 | @@ -77,7 +77,7 @@ if test "$authsasldb" != no; then | ||
7 | AC_DEFINE(AUTH_SASLDB,[],[Include SASLdb Support]) | ||
8 | SASL_DB_PATH_CHECK() | ||
9 | SASL_DB_CHECK() | ||
10 | - SASL_DB_LIB="$SASL_DB_LIB ../sasldb/.libs/libsasldb.al" | ||
11 | + SASL_DB_LIB="$SASL_DB_LIB ../sasldb/.libs/libsasldb.a" | ||
12 | fi | ||
13 | |||
14 | AC_ARG_ENABLE(httpform, [ --enable-httpform enable HTTP form authentication [[no]] ], | ||
diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0014_avoid_pic_overwrite.diff b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0014_avoid_pic_overwrite.diff new file mode 100644 index 0000000000..2e5b1750d0 --- /dev/null +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/debian_patches_0014_avoid_pic_overwrite.diff | |||
@@ -0,0 +1,27 @@ | |||
1 | Author: Fabian Fagerholm <fabbe@debian.org> | ||
2 | Description: This patch makes sure the non-PIC version of libsasldb.a, which | ||
3 | is created out of non-PIC objects, is not going to overwrite the PIC version, | ||
4 | which is created out of PIC objects. The PIC version is placed in .libs, and | ||
5 | the non-PIC version in the current directory. This ensures that both non-PIC | ||
6 | and PIC versions are available in the correct locations. | ||
7 | --- a/lib/Makefile.am | ||
8 | +++ b/lib/Makefile.am | ||
9 | @@ -78,7 +78,7 @@ endif | ||
10 | |||
11 | libsasl2.a: libsasl2.la $(SASL_STATIC_OBJS) | ||
12 | @echo adding static plugins and dependencies | ||
13 | - $(AR) cru .libs/$@ $(SASL_STATIC_OBJS) | ||
14 | + $(AR) cru $@ $(SASL_STATIC_OBJS) | ||
15 | @for i in ./libsasl2.la ../sasldb/libsasldb.la ../plugins/lib*.la; do \ | ||
16 | if test ! -f $$i; then continue; fi; . $$i; \ | ||
17 | for j in $$dependency_libs foo; do \ | ||
18 | --- a/sasldb/Makefile.am | ||
19 | +++ b/sasldb/Makefile.am | ||
20 | @@ -63,6 +63,6 @@ libsasldb_a_SOURCES = | ||
21 | EXTRA_libsasldb_a_SOURCES = | ||
22 | |||
23 | libsasldb.a: libsasldb.la $(SASL_DB_BACKEND_STATIC) | ||
24 | - $(AR) cru .libs/$@ $(SASL_DB_BACKEND_STATIC) | ||
25 | + $(AR) cru $@ $(SASL_DB_BACKEND_STATIC) | ||
26 | |||
27 | |||
diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch new file mode 100644 index 0000000000..ecbab845d0 --- /dev/null +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl/sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From 92d72789c811b0d55f624a8bac5ccc4412f5996e Mon Sep 17 00:00:00 2001 | ||
2 | From: Ken Murchison <murch@andrew.cmu.edu> | ||
3 | Date: Thu, 20 Dec 2012 18:14:50 -0500 | ||
4 | Subject: [PATCH] sasl.h: #include <stddef.h> for size_t on NetBSD | ||
5 | |||
6 | This patch was imported from git://git.cyrusimap.org/cyrus-sasl | ||
7 | commit 67a188693796a14e3a76ac603104807fbbfddfc4 | ||
8 | |||
9 | Upstream-Status: Backport | ||
10 | |||
11 | Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> | ||
12 | --- | ||
13 | include/sasl.h | 2 ++ | ||
14 | 1 file changed, 2 insertions(+) | ||
15 | |||
16 | diff --git a/include/sasl.h b/include/sasl.h | ||
17 | index fef4d51..8b8a63f 100755 | ||
18 | --- a/include/sasl.h | ||
19 | +++ b/include/sasl.h | ||
20 | @@ -121,6 +121,8 @@ | ||
21 | #ifndef SASL_H | ||
22 | #define SASL_H 1 | ||
23 | |||
24 | +#include <stddef.h> /* For size_t */ | ||
25 | + | ||
26 | /* Keep in sync with win32/common.mak */ | ||
27 | #define SASL_VERSION_MAJOR 2 | ||
28 | #define SASL_VERSION_MINOR 1 | ||
29 | -- | ||
30 | 1.8.3.2 | ||
31 | |||
diff --git a/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb new file mode 100644 index 0000000000..e3ff56d821 --- /dev/null +++ b/meta-networking/recipes-daemons/cyrus-sasl/cyrus-sasl_2.1.26.bb | |||
@@ -0,0 +1,69 @@ | |||
1 | SUMMARY = "Generic client/server library for SASL authentication" | ||
2 | SECTION = "console/network" | ||
3 | DEPENDS = "openssl virtual/db" | ||
4 | LICENSE = "BSD" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=3f55e0974e3d6db00ca6f57f2d206396" | ||
6 | |||
7 | SRC_URI = "ftp://ftp.cyrusimap.org/cyrus-sasl/cyrus-sasl-${PV}.tar.gz \ | ||
8 | file://avoid-to-call-AC_TRY_RUN.patch \ | ||
9 | file://Fix-hardcoded-libdir.patch \ | ||
10 | file://debian_patches_0009_sasldb_al.diff \ | ||
11 | file://debian_patches_0014_avoid_pic_overwrite.diff \ | ||
12 | file://sasl.h-include-stddef.h-for-size_t-on-NetBSD.patch \ | ||
13 | " | ||
14 | |||
15 | inherit autotools pkgconfig useradd | ||
16 | |||
17 | EXTRA_OECONF += "--with-dblib=berkeley \ | ||
18 | --with-bdb-libdir=${STAGING_LIBDIR} \ | ||
19 | --with-bdb-incdir=${STAGING_INCDIR} \ | ||
20 | --with-bdb=db-5.3 \ | ||
21 | --with-plugindir="${libdir}/sasl2/" \ | ||
22 | andrew_cv_runpath_switch=none" | ||
23 | |||
24 | PACKAGECONFIG ??= "ntlm \ | ||
25 | ${@base_contains('DISTRO_FEATURES', 'ldap', 'ldap', '', d)} \ | ||
26 | ${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \ | ||
27 | " | ||
28 | PACKAGECONFIG[gssapi] = "--enable-gssapi=yes,--enable-gssapi=no,krb5," | ||
29 | PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam," | ||
30 | PACKAGECONFIG[opie] = "--with-opie,--without-opie,opie," | ||
31 | PACKAGECONFIG[des] = "--with-des,--without-des,," | ||
32 | PACKAGECONFIG[ldap] = "--with-ldap=${STAGING_LIBDIR} --enable-ldapdb,--without-ldap --disable-ldapdb,openldap," | ||
33 | PACKAGECONFIG[ntlm] = "--with-ntlm,--without-ntlm,," | ||
34 | |||
35 | CFLAGS += "-fPIC" | ||
36 | |||
37 | do_configure_prepend () { | ||
38 | rm -f acinclude.m4 config/libtool.m4 | ||
39 | |||
40 | # make it be able to work with db 5.0 version | ||
41 | local sed_files="sasldb/db_berkeley.c utils/dbconverter-2.c" | ||
42 | for sed_file in $sed_files; do | ||
43 | sed -i 's#DB_VERSION_MAJOR == 4.*#(&) || DB_VERSION_MAJOR == 5#' $sed_file | ||
44 | done | ||
45 | } | ||
46 | |||
47 | do_compile_prepend () { | ||
48 | cd include | ||
49 | ${BUILD_CC} ${BUILD_CFLAGS} ${BUILD_LDFLAGS} makemd5.c -o makemd5 | ||
50 | touch makemd5.o makemd5.lo makemd5 | ||
51 | cd .. | ||
52 | } | ||
53 | |||
54 | USERADD_PACKAGES = "${PN}-bin" | ||
55 | GROUPADD_PARAM_${PN}-bin = "--system mail" | ||
56 | USERADD_PARAM_${PN}-bin = "--system --home=/var/spool/mail -g mail cyrus" | ||
57 | |||
58 | SRC_URI[md5sum] = "a7f4e5e559a0e37b3ffc438c9456e425" | ||
59 | SRC_URI[sha256sum] = "8fbc5136512b59bb793657f36fadda6359cae3b08f01fd16b3d406f1345b7bc3" | ||
60 | |||
61 | PACKAGES =+ "${PN}-bin" | ||
62 | |||
63 | FILES_${PN} += "${libdir}/sasl2/*.so*" | ||
64 | FILES_${PN}-bin += "${bindir}" | ||
65 | FILES_${PN}-dev += "${libdir}/sasl2/*.la" | ||
66 | FILES_${PN}-dbg += "${libdir}/sasl2/.debug" | ||
67 | FILES_${PN}-staticdev += "${libdir}/sasl2/*.a" | ||
68 | |||
69 | INSANE_SKIP_${PN} += "dev-so" | ||
diff --git a/meta-networking/recipes-daemons/proftpd/files/basic.conf.patch b/meta-networking/recipes-daemons/proftpd/files/basic.conf.patch new file mode 100644 index 0000000000..4967bed1e7 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/basic.conf.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | Upstream-Status: Inappropriate [configuration] | ||
2 | |||
3 | proftpd tries to get the IP address from the hostname. | ||
4 | Unluckily now the hostname is not properly configured in /etc/hosts. | ||
5 | We can use this patch as a workaround. | ||
6 | |||
7 | Author: Dexuan Cui <dexuan.cui@intel.com> | ||
8 | Tue Oct 25 12:59:27 CST 2011 | ||
9 | |||
10 | --- proftpd-1.3.3c.orig/sample-configurations/basic.conf | ||
11 | +++ proftpd-1.3.3c/sample-configurations/basic.conf | ||
12 | @@ -7,6 +7,9 @@ | ||
13 | ServerType standalone | ||
14 | DefaultServer on | ||
15 | |||
16 | +#By default we bind to all interfaces. | ||
17 | +DefaultAddress 0.0.0.0 | ||
18 | + | ||
19 | # Port 21 is the standard FTP port. | ||
20 | Port 21 | ||
21 | |||
diff --git a/meta-networking/recipes-daemons/proftpd/files/close-RequireValidShell-check.patch b/meta-networking/recipes-daemons/proftpd/files/close-RequireValidShell-check.patch new file mode 100644 index 0000000000..c64535cac8 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/close-RequireValidShell-check.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | close RequireValidShell check | ||
2 | |||
3 | Upstream-Status: Inappropriate [configuration] | ||
4 | |||
5 | close RequireValidShell check since we like to make /bin/false as shell | ||
6 | for ftp user | ||
7 | |||
8 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
9 | --- | ||
10 | sample-configurations/basic.conf | 1 + | ||
11 | 1 file changed, 1 insertion(+) | ||
12 | |||
13 | diff --git a/sample-configurations/basic.conf b/sample-configurations/basic.conf | ||
14 | index 314eb79..abcb284 100644 | ||
15 | --- a/sample-configurations/basic.conf | ||
16 | +++ b/sample-configurations/basic.conf | ||
17 | @@ -53,6 +53,7 @@ AllowOverwrite on | ||
18 | # We want clients to be able to login with "anonymous" as well as "ftp" | ||
19 | UserAlias anonymous ftp | ||
20 | |||
21 | + RequireValidShell off | ||
22 | # Limit the maximum number of anonymous logins | ||
23 | MaxClients 10 | ||
24 | |||
25 | -- | ||
26 | 1.7.10.4 | ||
27 | |||
diff --git a/meta-networking/recipes-daemons/proftpd/files/contrib.patch b/meta-networking/recipes-daemons/proftpd/files/contrib.patch new file mode 100644 index 0000000000..7e2a8e3ce0 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/contrib.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | The contrib directory now contains its own Makefile which is | ||
2 | used during installation. It was required to pass DESTDIR through | ||
3 | when it gets called from the base Makefile. | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | Signed-off-by: Kevin Strasser <kevin.strasser@linux.intel.com> | ||
8 | --- | ||
9 | Makefile.in | 2 +- | ||
10 | contrib/Makefile.in | 6 +++--- | ||
11 | 2 files changed, 4 insertions(+), 4 deletions(-) | ||
12 | |||
13 | diff --git a/Makefile.in b/Makefile.in | ||
14 | index 5b2e683..ee72fe1 100644 | ||
15 | --- a/Makefile.in | ||
16 | +++ b/Makefile.in | ||
17 | @@ -120,7 +120,7 @@ install-modules: $(DESTDIR)$(libexecdir) $(DESTDIR)$(sysconfdir) | ||
18 | test -z "$(SHARED_MODULE_OBJS)" -a -z "$(SHARED_MODULE_DIRS)" -a -z "$(STATIC_MODULE_DIRS)" || (cd modules/ && $(MAKE) install) | ||
19 | |||
20 | install-utils: $(DESTDIR)$(sbindir) $(DESTDIR)$(bindir) | ||
21 | - cd contrib/ && $(MAKE) install-utils | ||
22 | + cd contrib/ && $(MAKE) DESTDIR=${DESTDIR} install-utils | ||
23 | $(INSTALL_BIN) ftpcount $(DESTDIR)$(bindir)/ftpcount | ||
24 | $(INSTALL_BIN) ftpdctl $(DESTDIR)$(bindir)/ftpdctl | ||
25 | $(INSTALL_SBIN) ftpscrub $(DESTDIR)$(sbindir)/ftpscrub | ||
26 | diff --git a/contrib/Makefile.in b/contrib/Makefile.in | ||
27 | index 5bcc038..51d248c 100644 | ||
28 | --- a/contrib/Makefile.in | ||
29 | +++ b/contrib/Makefile.in | ||
30 | @@ -18,6 +18,6 @@ Makefile: Makefile.in ../config.status | ||
31 | cd ../ && ./config.status | ||
32 | |||
33 | install-utils: | ||
34 | - $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 ftpasswd $(DESTDIR)$(bindir)/ftpasswd | ||
35 | - $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 ftpmail $(DESTDIR)$(bindir)/ftpmail | ||
36 | - $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 ftpquota $(DESTDIR)$(bindir)/ftpquota | ||
37 | + $(INSTALL) -m 0755 ftpasswd $(DESTDIR)$(bindir)/ftpasswd | ||
38 | + $(INSTALL) -m 0755 ftpmail $(DESTDIR)$(bindir)/ftpmail | ||
39 | + $(INSTALL) -m 0755 ftpquota $(DESTDIR)$(bindir)/ftpquota | ||
40 | -- | ||
41 | 1.7.9.5 | ||
42 | |||
diff --git a/meta-networking/recipes-daemons/proftpd/files/default b/meta-networking/recipes-daemons/proftpd/files/default new file mode 100644 index 0000000000..b31f36ce25 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/default | |||
@@ -0,0 +1,9 @@ | |||
1 | # Defaults for proftpd initscript | ||
2 | |||
3 | # Master system-wide proftpd switch. The initscript | ||
4 | # will not run if it is not set to yes. | ||
5 | RUN="yes" | ||
6 | |||
7 | # Default options. | ||
8 | # For more exhaustive logging, try "-d 3". | ||
9 | OPTIONS="" | ||
diff --git a/meta-networking/recipes-daemons/proftpd/files/make.patch b/meta-networking/recipes-daemons/proftpd/files/make.patch new file mode 100644 index 0000000000..c5ff0136da --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/make.patch | |||
@@ -0,0 +1,66 @@ | |||
1 | Upstream-Status: Inappropriate [configuration] | ||
2 | |||
3 | Index: proftpd-1.3.2/Makefile.in | ||
4 | =================================================================== | ||
5 | --- proftpd-1.3.2.orig/Makefile.in | ||
6 | +++ proftpd-1.3.2/Makefile.in | ||
7 | @@ -76,7 +76,6 @@ check: proftpd$(EXEEXT) | ||
8 | $(DESTDIR)$(localedir) $(DESTDIR)$(includedir) $(DESTDIR)$(includedir)/proftpd $(DESTDIR)$(libdir) $(DESTDIR)$(pkgconfigdir) $(DESTDIR)$(libdir)/proftpd $(DESTDIR)$(libexecdir) $(DESTDIR)$(localstatedir) $(DESTDIR)$(sysconfdir) $(DESTDIR)$(rundir) $(DESTDIR)$(bindir) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir) $(DESTDIR)$(mandir)/man1 $(DESTDIR)$(mandir)/man5 $(DESTDIR)$(mandir)/man8: | ||
9 | @if [ ! -d $@ ]; then \ | ||
10 | mkdir -p $@; \ | ||
11 | - chown $(INSTALL_USER):$(INSTALL_GROUP) $@; \ | ||
12 | chmod 0755 $@; \ | ||
13 | fi | ||
14 | |||
15 | @@ -86,7 +85,6 @@ install-proftpd: proftpd $(DESTDIR)$(inc | ||
16 | rm -f $(DESTDIR)$(sbindir)/in.proftpd ; \ | ||
17 | fi | ||
18 | ln -s proftpd $(DESTDIR)$(sbindir)/in.proftpd | ||
19 | - -chown -h $(INSTALL_USER):$(INSTALL_GROUP) $(DESTDIR)$(sbindir)/in.proftpd | ||
20 | |||
21 | install-libs: $(DESTDIR)$(libdir)/proftpd | ||
22 | cd lib/ && $(MAKE) install | ||
23 | @@ -121,11 +119,11 @@ install-utils: $(DESTDIR)$(sbindir) $(DE | ||
24 | $(INSTALL_SBIN) ftpshut $(DESTDIR)$(sbindir)/ftpshut | ||
25 | $(INSTALL_BIN) ftptop $(DESTDIR)$(bindir)/ftptop | ||
26 | $(INSTALL_BIN) ftpwho $(DESTDIR)$(bindir)/ftpwho | ||
27 | - $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 src/prxs $(DESTDIR)$(bindir)/prxs | ||
28 | + $(INSTALL) -m 0755 src/prxs $(DESTDIR)$(bindir)/prxs | ||
29 | |||
30 | install-conf: $(DESTDIR)$(sysconfdir) | ||
31 | if [ ! -f $(DESTDIR)$(sysconfdir)/proftpd.conf ] ; then \ | ||
32 | - $(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0644 \ | ||
33 | + $(INSTALL) -m 0644 \ | ||
34 | $(top_srcdir)/sample-configurations/basic.conf \ | ||
35 | $(DESTDIR)$(sysconfdir)/proftpd.conf ; \ | ||
36 | fi | ||
37 | Index: proftpd-1.3.2/Make.rules.in | ||
38 | =================================================================== | ||
39 | --- proftpd-1.3.2.orig/Make.rules.in | ||
40 | +++ proftpd-1.3.2/Make.rules.in | ||
41 | @@ -29,9 +29,9 @@ UTILS_LIBS=@UTILS_LIBS@ @LIBS@ | ||
42 | INSTALL=@INSTALL@ | ||
43 | INSTALL_USER=@install_user@ | ||
44 | INSTALL_GROUP=@install_group@ | ||
45 | -INSTALL_BIN=$(INSTALL) @INSTALL_STRIP@ -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 | ||
46 | -INSTALL_SBIN=$(INSTALL) @INSTALL_STRIP@ -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0755 | ||
47 | -INSTALL_MAN=$(INSTALL) -o $(INSTALL_USER) -g $(INSTALL_GROUP) -m 0644 | ||
48 | +INSTALL_BIN=$(INSTALL) -m 0755 | ||
49 | +INSTALL_SBIN=$(INSTALL) -m 0755 | ||
50 | +INSTALL_MAN=$(INSTALL) -m 0644 | ||
51 | |||
52 | RM=rm -f | ||
53 | SHELL=/bin/sh | ||
54 | Index: proftpd-1.3.2/lib/libcap/Makefile | ||
55 | =================================================================== | ||
56 | --- proftpd-1.3.2.orig/lib/libcap/Makefile | ||
57 | +++ proftpd-1.3.2/lib/libcap/Makefile | ||
58 | @@ -26,7 +26,7 @@ OBJS=$(addsuffix .o, $(FILES)) | ||
59 | all: $(LIBNAME) | ||
60 | |||
61 | _makenames: _makenames.c cap_names.sed | ||
62 | - $(CC) $(CFLAGS) $(LDFLAGS) $< -o $@ | ||
63 | + $(BUILD_CC) $(CFLAGS) $(LDFLAGS) $< -o $@ | ||
64 | |||
65 | cap_names.h: _makenames | ||
66 | ./_makenames > cap_names.h | ||
diff --git a/meta-networking/recipes-daemons/proftpd/files/move-pidfile-to-var-run.patch b/meta-networking/recipes-daemons/proftpd/files/move-pidfile-to-var-run.patch new file mode 100644 index 0000000000..953bbddef0 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/move-pidfile-to-var-run.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | move pidfile to /var/run | ||
2 | |||
3 | Upstream-Status: Inappropriate [configuration] | ||
4 | |||
5 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
6 | --- | ||
7 | configure | 2 +- | ||
8 | configure.in | 2 +- | ||
9 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
10 | |||
11 | diff --git a/configure b/configure | ||
12 | index e6268f5..ebed38e 100755 | ||
13 | --- a/configure | ||
14 | +++ b/configure | ||
15 | @@ -33587,7 +33587,7 @@ cat >>confdefs.h <<_ACEOF | ||
16 | _ACEOF | ||
17 | |||
18 | cat >>confdefs.h <<_ACEOF | ||
19 | -#define PR_PID_FILE_PATH "`eval echo "${localstatedir}/proftpd.pid"`" | ||
20 | +#define PR_PID_FILE_PATH "`eval echo "${localstatedir}/run/proftpd.pid"`" | ||
21 | _ACEOF | ||
22 | |||
23 | |||
24 | diff --git a/configure.in b/configure.in | ||
25 | index df9186a..e2ae868 100644 | ||
26 | --- a/configure.in | ||
27 | +++ b/configure.in | ||
28 | @@ -2790,7 +2790,7 @@ AC_DEFINE_UNQUOTED(PR_LOCALE_DIR, "`eval echo "${locale_dir}"`") | ||
29 | |||
30 | AC_DEFINE_UNQUOTED(PR_RUN_DIR, "`eval echo "${localstatedir}"`") | ||
31 | AC_DEFINE_UNQUOTED(PR_CONFIG_FILE_PATH, "`eval echo "${sysconfdir}/proftpd.conf"`") | ||
32 | -AC_DEFINE_UNQUOTED(PR_PID_FILE_PATH, "`eval echo "${localstatedir}/proftpd.pid"`") | ||
33 | +AC_DEFINE_UNQUOTED(PR_PID_FILE_PATH, "`eval echo "${localstatedir}/run/proftpd.pid"`") | ||
34 | |||
35 | prefix="$pr_saved_prefix" | ||
36 | exec_prefix="$pr_saved_exec_prefix" | ||
37 | -- | ||
38 | 1.7.10.4 | ||
39 | |||
diff --git a/meta-networking/recipes-daemons/proftpd/files/move-runfile-to-var-run.patch b/meta-networking/recipes-daemons/proftpd/files/move-runfile-to-var-run.patch new file mode 100644 index 0000000000..1561ed80e3 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/move-runfile-to-var-run.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | redefine PR_RUN_DIR as ${localstatedir}/run | ||
2 | |||
3 | Upstream-Status: Inappropriate [configuration] | ||
4 | |||
5 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
6 | --- | ||
7 | configure | 2 +- | ||
8 | configure.in | 2 +- | ||
9 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
10 | |||
11 | diff --git a/configure b/configure | ||
12 | index ebed38e..445d5bc 100755 | ||
13 | --- a/configure | ||
14 | +++ b/configure | ||
15 | @@ -33579,7 +33579,7 @@ _ACEOF | ||
16 | |||
17 | |||
18 | cat >>confdefs.h <<_ACEOF | ||
19 | -#define PR_RUN_DIR "`eval echo "${localstatedir}"`" | ||
20 | +#define PR_RUN_DIR "`eval echo "${localstatedir}"/run/`" | ||
21 | _ACEOF | ||
22 | |||
23 | cat >>confdefs.h <<_ACEOF | ||
24 | diff --git a/configure.in b/configure.in | ||
25 | index c17929c..df9186a 100644 | ||
26 | --- a/configure.in | ||
27 | +++ b/configure.in | ||
28 | @@ -2788,7 +2788,7 @@ locale_dir="`eval echo ${localedir}`" | ||
29 | locale_dir="`eval echo ${locale_dir}`" | ||
30 | AC_DEFINE_UNQUOTED(PR_LOCALE_DIR, "`eval echo "${locale_dir}"`") | ||
31 | |||
32 | -AC_DEFINE_UNQUOTED(PR_RUN_DIR, "`eval echo "${localstatedir}"`") | ||
33 | +AC_DEFINE_UNQUOTED(PR_RUN_DIR, "`eval echo "${localstatedir}/run"`") | ||
34 | AC_DEFINE_UNQUOTED(PR_CONFIG_FILE_PATH, "`eval echo "${sysconfdir}/proftpd.conf"`") | ||
35 | AC_DEFINE_UNQUOTED(PR_PID_FILE_PATH, "`eval echo "${localstatedir}/run/proftpd.pid"`") | ||
36 | |||
37 | -- | ||
38 | 1.7.10.4 | ||
39 | |||
diff --git a/meta-networking/recipes-daemons/proftpd/files/proftpd-basic.init b/meta-networking/recipes-daemons/proftpd/files/proftpd-basic.init new file mode 100644 index 0000000000..01c998c924 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/files/proftpd-basic.init | |||
@@ -0,0 +1,220 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | ### BEGIN INIT INFO | ||
4 | # Provides: proftpd | ||
5 | # Required-Start: $remote_fs $syslog $local_fs $network | ||
6 | # Required-Stop: $remote_fs $syslog $local_fs $network | ||
7 | # Should-Start: $named | ||
8 | # Should-Stop: $named | ||
9 | # Default-Start: 2 3 4 5 | ||
10 | # Default-Stop: 0 1 6 | ||
11 | # Short-Description: Starts ProFTPD daemon | ||
12 | # Description: This script runs the FTP service offered | ||
13 | # by the ProFTPD daemon | ||
14 | ### END INIT INFO | ||
15 | |||
16 | # Start the proftpd FTP daemon. | ||
17 | |||
18 | PATH=/bin:/usr/bin:/sbin:/usr/sbin | ||
19 | DAEMON=/usr/sbin/proftpd | ||
20 | NAME=proftpd | ||
21 | |||
22 | # Defaults | ||
23 | RUN="no" | ||
24 | OPTIONS="" | ||
25 | CONFIG_FILE=/etc/proftpd.conf | ||
26 | |||
27 | PIDFILE=`grep -i '^pidfile' $CONFIG_FILE|awk '{ print $2 }'` | ||
28 | if [ "x$PIDFILE" = "x" ]; | ||
29 | then | ||
30 | PIDFILE=/var/run/proftpd.pid | ||
31 | fi | ||
32 | |||
33 | # Read config (will override defaults) | ||
34 | [ -r /etc/default/proftpd ] && . /etc/default/proftpd | ||
35 | |||
36 | trap "" 1 | ||
37 | trap "" 15 | ||
38 | |||
39 | test -f $DAEMON || exit 0 | ||
40 | |||
41 | . /etc/init.d/functions | ||
42 | |||
43 | # | ||
44 | # Servertype could be inetd|standalone|none. | ||
45 | # In all cases check against inetd and xinetd support. | ||
46 | # | ||
47 | if ! egrep -qi "^[[:space:]]*ServerType.*standalone" $CONFIG_FILE | ||
48 | then | ||
49 | if egrep -qi "server[[:space:]]*=[[:space:]]*/usr/sbin/proftpd" /etc/xinetd.conf 2>/dev/null || \ | ||
50 | egrep -qi "server[[:space:]]*=[[:space:]]*/usr/sbin/proftpd" /etc/xinetd.d/* 2>/dev/null || \ | ||
51 | egrep -qi "^ftp.*/usr/sbin/proftpd" /etc/inetd.conf 2>/dev/null | ||
52 | then | ||
53 | RUN="no" | ||
54 | INETD="yes" | ||
55 | else | ||
56 | if ! egrep -qi "^[[:space:]]*ServerType.*inetd" $CONFIG_FILE | ||
57 | then | ||
58 | RUN="yes" | ||
59 | INETD="no" | ||
60 | else | ||
61 | RUN="no" | ||
62 | INETD="no" | ||
63 | fi | ||
64 | fi | ||
65 | fi | ||
66 | |||
67 | # /var/run could be on a tmpfs | ||
68 | |||
69 | [ ! -d /var/run/proftpd ] && mkdir /var/run/proftpd | ||
70 | |||
71 | inetd_check() | ||
72 | { | ||
73 | if [ ! -x /usr/sbin/inetd -a ! -x /usr/sbin/xinetd ]; then | ||
74 | echo "Neither inetd nor xinetd appears installed: check your configuration." | ||
75 | fi | ||
76 | } | ||
77 | |||
78 | start() | ||
79 | { | ||
80 | set -e | ||
81 | echo -n "Starting ftp server $NAME... " | ||
82 | start-stop-daemon --start --quiet --pidfile "$PIDFILE" --oknodo --exec $DAEMON -- -c $CONFIG_FILE $OPTIONS | ||
83 | echo "done." | ||
84 | } | ||
85 | |||
86 | signal() | ||
87 | { | ||
88 | |||
89 | if [ "$1" = "stop" ]; then | ||
90 | SIGNAL="TERM" | ||
91 | echo -n "Stopping ftp server $NAME... " | ||
92 | else | ||
93 | if [ "$1" = "reload" ]; then | ||
94 | SIGNAL="HUP" | ||
95 | echo -n "Reloading ftp server $NAME... " | ||
96 | else | ||
97 | echo "ERR: wrong parameter given to signal()" | ||
98 | exit 1 | ||
99 | fi | ||
100 | fi | ||
101 | if [ -f "$PIDFILE" ]; then | ||
102 | start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE" | ||
103 | if [ $? = 0 ]; then | ||
104 | echo "done." | ||
105 | return | ||
106 | else | ||
107 | SIGNAL="KILL" | ||
108 | start-stop-daemon --stop --signal $SIGNAL --quiet --pidfile "$PIDFILE" | ||
109 | if [ $? != 0 ]; then | ||
110 | echo | ||
111 | [ $2 != 0 ] || exit 0 | ||
112 | else | ||
113 | echo "done." | ||
114 | return | ||
115 | fi | ||
116 | fi | ||
117 | if [ "$SIGNAL" = "KILL" ]; then | ||
118 | rm -f "$PIDFILE" | ||
119 | fi | ||
120 | else | ||
121 | echo "done." | ||
122 | return | ||
123 | fi | ||
124 | } | ||
125 | |||
126 | case "$1" in | ||
127 | start) | ||
128 | if [ "x$RUN" = "xyes" ] ; then | ||
129 | start | ||
130 | else | ||
131 | if [ "x$INETD" = "xyes" ] ; then | ||
132 | echo "ProFTPD is started from inetd/xinetd." | ||
133 | inetd_check | ||
134 | else | ||
135 | echo "ProFTPD warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration." | ||
136 | fi | ||
137 | fi | ||
138 | ;; | ||
139 | |||
140 | force-start) | ||
141 | if [ "x$INETD" = "xyes" ] ; then | ||
142 | echo "Warning: ProFTPD is started from inetd/xinetd (trying to start anyway)." | ||
143 | inetd_check | ||
144 | fi | ||
145 | start | ||
146 | ;; | ||
147 | |||
148 | stop) | ||
149 | if [ "x$RUN" = "xyes" ] ; then | ||
150 | signal stop 0 | ||
151 | else | ||
152 | if [ "x$INETD" = "xyes" ] ; then | ||
153 | echo "ProFTPD is started from inetd/xinetd." | ||
154 | inetd_check | ||
155 | else | ||
156 | echo "ProFTPD warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration." | ||
157 | fi | ||
158 | fi | ||
159 | ;; | ||
160 | |||
161 | force-stop) | ||
162 | if [ "x$INETD" = "xyes" ] ; then | ||
163 | echo "Warning: ProFTPD is started from inetd/xinetd (trying to kill anyway)." | ||
164 | inetd_check | ||
165 | fi | ||
166 | signal stop 0 | ||
167 | ;; | ||
168 | |||
169 | reload) | ||
170 | signal reload 0 | ||
171 | ;; | ||
172 | |||
173 | force-reload|restart) | ||
174 | if [ "x$RUN" = "xyes" ] ; then | ||
175 | signal stop 1 | ||
176 | sleep 2 | ||
177 | start | ||
178 | else | ||
179 | if [ "x$INETD" = "xyes" ] ; then | ||
180 | echo "ProFTPD is started from inetd/xinetd." | ||
181 | inetd_check | ||
182 | else | ||
183 | echo "ProFTPD warning: cannot start neither in standalone nor in inetd/xinetd mode. Check your configuration." | ||
184 | fi | ||
185 | fi | ||
186 | ;; | ||
187 | |||
188 | status) | ||
189 | if [ "x$INETD" = "xyes" ] ; then | ||
190 | echo "ProFTPD is started from inetd/xinetd." | ||
191 | inetd_check | ||
192 | exit 0 | ||
193 | else | ||
194 | if [ -f "$PIDFILE" ]; then | ||
195 | pid=$(cat $PIDFILE) | ||
196 | else | ||
197 | pid="x" | ||
198 | fi | ||
199 | if [ `pidof proftpd|grep "$pid"|wc -l` -ne 0 ] ; then | ||
200 | echo "ProFTPD is started in standalone mode, currently running." | ||
201 | exit 0 | ||
202 | else | ||
203 | echo "ProFTPD is started in standalone mode, currently not running." | ||
204 | exit 3 | ||
205 | fi | ||
206 | fi | ||
207 | ;; | ||
208 | |||
209 | check-config) | ||
210 | $DAEMON -t >/dev/null && echo "ProFTPD configuration OK" && exit 0 | ||
211 | exit 1 | ||
212 | ;; | ||
213 | |||
214 | *) | ||
215 | echo "Usage: /etc/init.d/$NAME {start|status|force-start|stop|force-stop|reload|restart|force-reload|check-config}" | ||
216 | exit 1 | ||
217 | ;; | ||
218 | esac | ||
219 | |||
220 | exit 0 | ||
diff --git a/meta-networking/recipes-daemons/proftpd/proftpd_1.3.4b.bb b/meta-networking/recipes-daemons/proftpd/proftpd_1.3.4b.bb new file mode 100644 index 0000000000..cfbadfb089 --- /dev/null +++ b/meta-networking/recipes-daemons/proftpd/proftpd_1.3.4b.bb | |||
@@ -0,0 +1,70 @@ | |||
1 | SUMMARY = "Secure and configurable FTP server" | ||
2 | SECTION = "console/network" | ||
3 | HOMEPAGE = "http://www.proftpd.org" | ||
4 | LICENSE = "GPLv2+" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=fb0d1484d11915fa88a6a7702f1dc184" | ||
6 | |||
7 | PR = "r3" | ||
8 | |||
9 | SRC_URI = "ftp://ftp.proftpd.org/distrib/source/${BPN}-${PV}.tar.gz \ | ||
10 | file://make.patch \ | ||
11 | file://basic.conf.patch \ | ||
12 | file://contrib.patch \ | ||
13 | file://proftpd-basic.init \ | ||
14 | file://default \ | ||
15 | file://move-pidfile-to-var-run.patch \ | ||
16 | file://close-RequireValidShell-check.patch \ | ||
17 | file://move-runfile-to-var-run.patch \ | ||
18 | " | ||
19 | |||
20 | SRC_URI[md5sum] = "0871e0b93c9c3c88ca950b6d9a04aed2" | ||
21 | SRC_URI[sha256sum] = "9f659585cea90fc6af34a0ffae4a90e4ed37abe92dbd9b6c311f95a436c961cb" | ||
22 | |||
23 | inherit autotools useradd update-rc.d | ||
24 | |||
25 | PACKAGECONFIG ??= "" | ||
26 | PACKAGECONFIG[curses] = "--enable-curses --enable-ncurses,--disable-curses --disable-ncurses,ncurses" | ||
27 | |||
28 | EXTRA_OECONF = "--disable-cap \ | ||
29 | --disable-auth-pam \ | ||
30 | " | ||
31 | |||
32 | # proftpd uses libltdl which currently makes configuring using | ||
33 | # autotools.bbclass a pain... | ||
34 | do_configure () { | ||
35 | oe_runconf | ||
36 | } | ||
37 | |||
38 | FTPUSER = "ftp" | ||
39 | FTPGROUP = "ftp" | ||
40 | |||
41 | do_install () { | ||
42 | oe_runmake DESTDIR=${D} install | ||
43 | rmdir ${D}${libdir}/proftpd ${D}${datadir}/locale | ||
44 | [ -d ${D}${libexecdir} ] && rmdir ${D}${libexecdir} | ||
45 | sed -i '/ *User[ \t]*/s/ftp/${FTPUSER}/' ${D}${sysconfdir}/proftpd.conf | ||
46 | sed -i '/ *Group[ \t]*/s/ftp/${FTPGROUP}/' ${D}${sysconfdir}/proftpd.conf | ||
47 | install -d ${D}${sysconfdir}/init.d | ||
48 | install -m 0755 ${WORKDIR}/proftpd-basic.init ${D}${sysconfdir}/init.d/proftpd | ||
49 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/proftpd | ||
50 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/proftpd | ||
51 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/proftpd | ||
52 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/proftpd | ||
53 | |||
54 | install -d ${D}${sysconfdir}/default | ||
55 | install -m 0755 ${WORKDIR}/default ${D}${sysconfdir}/default/proftpd | ||
56 | |||
57 | # create the pub directory | ||
58 | mkdir -p ${D}/home/${FTPUSER}/pub/ | ||
59 | chown -R ${FTPUSER}:${FTPGROUP} ${D}/home/${FTPUSER}/pub | ||
60 | } | ||
61 | |||
62 | INITSCRIPT_NAME = "proftpd" | ||
63 | INITSCRIPT_PARAM = "defaults 85 15" | ||
64 | |||
65 | USERADD_PACKAGES = "${PN}" | ||
66 | GROUPADD_PARAM_${PN} = "--system ${FTPGROUP}" | ||
67 | USERADD_PARAM_${PN} = "--system -g ${FTPGROUP} --home-dir /var/lib/${FTPUSER} --no-create-home \ | ||
68 | --shell /bin/false ${FTPUSER}" | ||
69 | |||
70 | FILES_${PN} += "/home/${FTPUSER}" | ||
diff --git a/meta-networking/recipes-daemons/ptpd/ptpd-2.2.0/ld-as-needed.patch b/meta-networking/recipes-daemons/ptpd/ptpd-2.2.0/ld-as-needed.patch new file mode 100644 index 0000000000..7d5251be3d --- /dev/null +++ b/meta-networking/recipes-daemons/ptpd/ptpd-2.2.0/ld-as-needed.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | Patch from http://patch-tracker.debian.org/package/ptpd | ||
2 | |||
3 | Description: Fix ld --as-needed | ||
4 | This patch fixes the order of gcc arguments to fix ld --as-needed | ||
5 | Author: Roland Stigge <stigge@antcom.de> | ||
6 | Bug-Debian: http://bugs.debian.org/607583 | ||
7 | |||
8 | Signed-off-by: Jackie Huang <jackie.huang@windriver.com> | ||
9 | --- | ||
10 | src/Makefile | 4 ++-- | ||
11 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
12 | |||
13 | diff --git a/src/Makefile b/src/Makefile | ||
14 | index a672625..88a2fc8 100644 | ||
15 | --- a/src/Makefile | ||
16 | +++ b/src/Makefile | ||
17 | @@ -40,7 +40,7 @@ CFLAGS += -DDBG_SIGUSR2_CHANGE_DEBUG | ||
18 | |||
19 | CFLAGS += -DPTP_EXPERIMENTAL | ||
20 | |||
21 | -LDFLAGS+= -lm -lrt | ||
22 | +LIBS += -lm -lrt | ||
23 | |||
24 | PROG = ptpd | ||
25 | SRCS = ptpd.c arith.c bmc.c protocol.c display.c\ | ||
26 | @@ -63,7 +63,7 @@ TAGFILES = GPATH GRTAGS GSYMS GTAGS cscope.in.out cscope.out cscope.po.out | ||
27 | all: $(PROG) | ||
28 | |||
29 | $(PROG): $(OBJS) | ||
30 | - $(CC) -o $@ $(OBJS) $(LDFLAGS) | ||
31 | + $(CC) -o $@ $(OBJS) $(LDFLAGS) $(LIBS) | ||
32 | |||
33 | $(OBJS): $(HDRS) | ||
34 | |||
35 | -- | ||
36 | 1.7.4 | ||
37 | |||
diff --git a/meta-networking/recipes-daemons/ptpd/ptpd_2.2.0.bb b/meta-networking/recipes-daemons/ptpd/ptpd_2.2.0.bb new file mode 100644 index 0000000000..f2e895d1ca --- /dev/null +++ b/meta-networking/recipes-daemons/ptpd/ptpd_2.2.0.bb | |||
@@ -0,0 +1,28 @@ | |||
1 | SUMMARY = "The PTP daemon (PTPd)" | ||
2 | DESCRIPTION = "The PTP daemon (PTPd) implements the Precision Time protocol (PTP) as \ | ||
3 | defined by the relevant IEEE 1588 standard. PTP Version 1 implements IEEE-1588-2002, \ | ||
4 | and PTP Version 2 implements IEEE-1588-2008. PTP was developed to provide very precise \ | ||
5 | time coordination of LAN connected computers." | ||
6 | HOMEPAGE = "http://sourceforge.net/projects/ptpd" | ||
7 | SECTION = "network" | ||
8 | LICENSE = "BSD" | ||
9 | LIC_FILES_CHKSUM = "file://../COPYRIGHT;md5=3d8ac2c46c116bce2d2ad838b6cf3491" | ||
10 | |||
11 | PR = "r1" | ||
12 | |||
13 | SRC_URI = "http://downloads.sourceforge.net/project/ptpd/ptpd/${PV}/ptpd-${PV}.tar.gz \ | ||
14 | file://ld-as-needed.patch;striplevel=2 \ | ||
15 | " | ||
16 | |||
17 | SRC_URI[md5sum] = "c63a3a149d30c710773ccb02df5782a3" | ||
18 | SRC_URI[sha256sum] = "f2266a22db84318d8b9ce266ea83772c03438c31f4993fa9643fa675a07c26b4" | ||
19 | |||
20 | S = "${WORKDIR}/ptpd-${PV}/src" | ||
21 | |||
22 | EXTRA_OEMAKE = "" | ||
23 | |||
24 | do_install() { | ||
25 | install -d ${D}${bindir} ${D}${mandir}/man8 | ||
26 | install -m 0755 ptpd2 ${D}${bindir} | ||
27 | install -m 0644 ptpd2.8 ${D}${mandir}/man8 | ||
28 | } | ||
diff --git a/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch b/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch new file mode 100644 index 0000000000..54088b0447 --- /dev/null +++ b/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From cffca7cb7c055f82ced316ddee90bb701b85b92d Mon Sep 17 00:00:00 2001 | ||
2 | From: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com> | ||
3 | Date: Tue, 10 Jan 2012 19:15:25 +0300 | ||
4 | Subject: [PATCH] Remove hardcoded /usr/local includes from configure.ac | ||
5 | |||
6 | Upstream-Status: Inappropriate [config] | ||
7 | |||
8 | Signed-off-by: Yauhen Kharuzhy <yauhen.kharuzhy@promwad.com> | ||
9 | --- | ||
10 | configure.ac | 12 ------------ | ||
11 | 1 files changed, 0 insertions(+), 12 deletions(-) | ||
12 | |||
13 | diff --git a/configure.ac b/configure.ac | ||
14 | index ae00c08..9ba6d8d 100644 | ||
15 | --- a/configure.ac | ||
16 | +++ b/configure.ac | ||
17 | @@ -67,18 +67,6 @@ AC_ARG_VAR(PYTHON,local path to the python interpreter) | ||
18 | python_possible_path="/usr/bin:/usr/local/bin:/bin:/opt/python/bin:/opt/python/usr/bin:/opt/python/usr/local/bin" | ||
19 | AC_PATH_PROG(PYTHON,python,/usr/bin/env python,$python_possible_path) | ||
20 | |||
21 | -if test -d /usr/local/include; then | ||
22 | - CPPFLAGS="$CPPFLAGS -I/usr/local/include" | ||
23 | -fi | ||
24 | - | ||
25 | -if test -d /usr/kerberos/include; then | ||
26 | - CPPFLAGS="$CPPFLAGS -I/usr/kerberos/include" | ||
27 | -fi | ||
28 | - | ||
29 | -if test -d /usr/local/lib; then | ||
30 | - LDFLAGS="$LDFLAGS -L/usr/local/lib" | ||
31 | -fi | ||
32 | - | ||
33 | if uname | fgrep SunOS > /dev/null 2> /dev/null ; then | ||
34 | CPPFLAGS="$CPPFLAGS -D_XPG4_2=1" | ||
35 | fi | ||
36 | -- | ||
37 | 1.7.7.3 | ||
38 | |||
diff --git a/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/nostrip.patch b/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/nostrip.patch new file mode 100644 index 0000000000..5cbbc5fa7b --- /dev/null +++ b/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd/nostrip.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | From 45eb89d1a6fde65caaf2d6e1a5d527f1ae7beb9c Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
3 | Date: Mon, 3 Dec 2012 17:12:11 +0000 | ||
4 | Subject: [PATCH] Don't mess with CFLAGS and LDFLAGS when --with-minimal is specified | ||
5 | |||
6 | We especially don't want stripping enabled. | ||
7 | |||
8 | Upstream-Status: Inappropriate [config] | ||
9 | |||
10 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
11 | --- | ||
12 | configure.ac | 2 -- | ||
13 | 1 files changed, 0 insertions(+), 2 deletions(-) | ||
14 | |||
15 | diff --git a/configure.ac b/configure.ac | ||
16 | index 3d59409..6836c0e 100644 | ||
17 | --- a/configure.ac | ||
18 | +++ b/configure.ac | ||
19 | @@ -413,8 +413,6 @@ AC_ARG_WITH(minimal, | ||
20 | AC_DEFINE(NO_FTP_USERS) | ||
21 | AC_DEFINE(WITHOUT_ASCII) | ||
22 | AC_DEFINE(BORING_MODE) | ||
23 | - CFLAGS="$CFLAGS -Os -fomit-frame-pointer -fgcse -falign-functions=2 -falign-jumps=2 -fno-unroll-loops " | ||
24 | - LDFLAGS="$LDFLAGS -s " | ||
25 | fi ]) | ||
26 | |||
27 | AC_ARG_WITH(paranoidmsg, | ||
28 | -- | ||
29 | 1.7.1 | ||
30 | |||
diff --git a/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd_1.0.36.bb b/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd_1.0.36.bb new file mode 100644 index 0000000000..974e6b74b7 --- /dev/null +++ b/meta-networking/recipes-daemons/pure-ftpd/pure-ftpd_1.0.36.bb | |||
@@ -0,0 +1,19 @@ | |||
1 | SUMMARY = "FTP Server with a strong focus on software security" | ||
2 | DESCRIPTION = "Pure-FTPd is a free (BSD license), secure, production-quality and standard-conformant FTP server." | ||
3 | HOMEPAGE = "http://www.pureftpd.org/project/pure-ftpd" | ||
4 | LICENSE = "BSD" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=ae9e161311a5a0768c333b537a40e332" | ||
6 | |||
7 | DEPENDS = "libcap" | ||
8 | |||
9 | |||
10 | SRC_URI = "http://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-${PV}.tar.gz \ | ||
11 | file://0001-Remove-hardcoded-usr-local-includes-from-configure.a.patch \ | ||
12 | file://nostrip.patch \ | ||
13 | " | ||
14 | SRC_URI[md5sum] = "bbcb48e8aa6ec1abff9775b89f84af91" | ||
15 | SRC_URI[sha256sum] = "90fb63b1a9d448076aa9f3e3c74b298965f98e03c824e9a4d241fffe8eb3a130" | ||
16 | |||
17 | inherit autotools | ||
18 | |||
19 | EXTRA_OECONF = "--with-minimal" | ||
diff --git a/meta-networking/recipes-daemons/radvd/files/radvd.init b/meta-networking/recipes-daemons/radvd/files/radvd.init new file mode 100755 index 0000000000..8b26317ee6 --- /dev/null +++ b/meta-networking/recipes-daemons/radvd/files/radvd.init | |||
@@ -0,0 +1,135 @@ | |||
1 | #! /bin/sh | ||
2 | # | ||
3 | ### BEGIN INIT INFO | ||
4 | # Provides: radvd | ||
5 | # Required-Start: $remote_fs $named $syslog | ||
6 | # Required-Stop: $remote_fs $named $syslog | ||
7 | # Default-Start: 3 5 | ||
8 | # Default-Stop: 0 1 2 6 | ||
9 | # Description: router advertisement daemon | ||
10 | ### END INIT INFO | ||
11 | |||
12 | # Source function library. | ||
13 | . /etc/init.d/functions | ||
14 | |||
15 | PATH=/sbin:/bin:/usr/sbin:/usr/bin | ||
16 | DAEMON=/usr/sbin/radvd | ||
17 | NAME=radvd | ||
18 | DESC=radvd | ||
19 | CONFIG=/etc/radvd.conf | ||
20 | SAVED_SETTINGS=/var/run/radvd/saved-settings | ||
21 | PIDFILE=/var/run/radvd/radvd.pid | ||
22 | OPTIONS="-u radvd -p $PIDFILE" | ||
23 | |||
24 | test -x $DAEMON || exit 0 | ||
25 | |||
26 | set -e | ||
27 | |||
28 | # Check for IPv6 support in kernel | ||
29 | if test \! -e /proc/sys/net/ipv6; then | ||
30 | echo "IPv6 support must be enabled in the kernel for $DESC to work." | ||
31 | exit | ||
32 | fi | ||
33 | |||
34 | save_settings() | ||
35 | { | ||
36 | local file=$1 | ||
37 | |||
38 | rm -f $file | ||
39 | for if_conf in /proc/sys/net/ipv6/conf/*; do | ||
40 | echo -e "$if_conf/forwarding\t `cat $if_conf/forwarding`" >> $file | ||
41 | done | ||
42 | return 0 | ||
43 | } | ||
44 | |||
45 | restore_settings() | ||
46 | { | ||
47 | file=$1 | ||
48 | |||
49 | if [ ! -f $file ]; then | ||
50 | echo "$0: warning: cannot restore settings" | ||
51 | return | ||
52 | fi | ||
53 | |||
54 | ( | ||
55 | while read f value; do | ||
56 | if [ -w $f ]; then | ||
57 | echo $value > $f | ||
58 | fi | ||
59 | done | ||
60 | ) < $file | ||
61 | } | ||
62 | |||
63 | chkconfig() { | ||
64 | if [ ! -e $CONFIG -o ! -s $CONFIG ]; then | ||
65 | echo "" | ||
66 | echo "* $CONFIG does not exist or is empty." | ||
67 | echo "* See /usr/share/doc/radvd/radvd.conf.example for a simple" | ||
68 | echo "* configuration suitable for most systems, and radvd.conf(5)" | ||
69 | echo "* for configuration file syntax. radvd will *not* be started." | ||
70 | exit 0 | ||
71 | fi | ||
72 | } | ||
73 | |||
74 | case "$1" in | ||
75 | start) | ||
76 | echo -n "Starting $DESC: " | ||
77 | chkconfig | ||
78 | save_settings $SAVED_SETTINGS | ||
79 | |||
80 | # We must enable IPv6 forwarding for radvd to work | ||
81 | echo 1 > /proc/sys/net/ipv6/conf/all/forwarding | ||
82 | |||
83 | # Check for stale pidfile; radvd won't start if one is lying around | ||
84 | if [ -f $PIDFILE ] && ! ps `cat $PIDFILE` > /dev/null; then | ||
85 | rm -f $PIDFILE | ||
86 | fi | ||
87 | if ! start-stop-daemon --oknodo --start --pidfile $PIDFILE \ | ||
88 | --exec $DAEMON -- $OPTIONS; then | ||
89 | echo "failed." && exit 1 | ||
90 | fi | ||
91 | echo "$NAME." | ||
92 | ;; | ||
93 | stop) | ||
94 | echo -n "Stopping $DESC: " | ||
95 | if ! [ -f $PIDFILE ] ; then | ||
96 | echo "not running." | ||
97 | exit 0 | ||
98 | fi | ||
99 | start-stop-daemon --oknodo --stop --pidfile $PIDFILE \ | ||
100 | --exec $DAEMON | ||
101 | restore_settings $SAVED_SETTINGS | ||
102 | rm -f $SAVED_SETTINGS | ||
103 | echo "$NAME." | ||
104 | ;; | ||
105 | status) | ||
106 | status $DAEMON; | ||
107 | exit $? | ||
108 | ;; | ||
109 | reload|force-reload) | ||
110 | echo "Reloading $DESC configuration files." | ||
111 | start-stop-daemon --stop --signal HUP --quiet --pidfile \ | ||
112 | $PIDFILE --exec $DAEMON | ||
113 | ;; | ||
114 | restart) | ||
115 | chkconfig | ||
116 | echo -n "Restarting $DESC: " | ||
117 | if ! start-stop-daemon --stop --quiet --pidfile \ | ||
118 | $PIDFILE --exec $DAEMON; then | ||
119 | # stop failed, so we were not running | ||
120 | save_settings $SAVED_SETTINGS | ||
121 | echo 1 > /proc/sys/net/ipv6/conf/all/forwarding | ||
122 | fi | ||
123 | sleep 1 | ||
124 | start-stop-daemon --start --quiet --pidfile \ | ||
125 | $PIDFILE --exec $DAEMON -- $OPTIONS | ||
126 | echo "$NAME." | ||
127 | ;; | ||
128 | *) | ||
129 | N=/etc/init.d/$NAME | ||
130 | echo "Usage: $N {start|stop|status|restart|reload|force-reload}" >&2 | ||
131 | exit 1 | ||
132 | ;; | ||
133 | esac | ||
134 | |||
135 | exit 0 | ||
diff --git a/meta-networking/recipes-daemons/radvd/files/volatiles.03_radvd b/meta-networking/recipes-daemons/radvd/files/volatiles.03_radvd new file mode 100644 index 0000000000..89256a40e4 --- /dev/null +++ b/meta-networking/recipes-daemons/radvd/files/volatiles.03_radvd | |||
@@ -0,0 +1,2 @@ | |||
1 | # <type> <owner> <group> <mode> <path> <linksource> | ||
2 | d radvd root 0755 /var/run/radvd none | ||
diff --git a/meta-networking/recipes-daemons/radvd/radvd.inc b/meta-networking/recipes-daemons/radvd/radvd.inc new file mode 100644 index 0000000000..9e194012c0 --- /dev/null +++ b/meta-networking/recipes-daemons/radvd/radvd.inc | |||
@@ -0,0 +1,51 @@ | |||
1 | SUMMARY = "IPv6 router advertisement daemon" | ||
2 | DESCRIPTION = "radvd is the router advertisement daemon for IPv6. It \ | ||
3 | listens to router solicitations and sends router \ | ||
4 | advertisements as described in RFC 2461, Neighbor \ | ||
5 | Discovery for IP Version 6 (IPv6). With these \ | ||
6 | advertisements hosts can automatically configure their \ | ||
7 | addresses and some other parameters. They also can \ | ||
8 | choose a default router based on these advertisements." | ||
9 | HOMEPAGE = "http://www.litech.org/radvd/" | ||
10 | SECTION = "console/network" | ||
11 | DEPENDS = "flex-native libdaemon" | ||
12 | |||
13 | # License is BSD-Style (with advertising clause) but also has an additional 0th clause | ||
14 | LICENSE = "radvd" | ||
15 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=73ebbf7182ae996e65e8fadc9a8c45db" | ||
16 | |||
17 | SRC_URI = "http://v6web.litech.org/radvd/dist/radvd-${PV}.tar.gz \ | ||
18 | file://radvd.init \ | ||
19 | file://volatiles.03_radvd" | ||
20 | |||
21 | inherit autotools update-rc.d useradd | ||
22 | |||
23 | do_install_append () { | ||
24 | install -m 0755 -d ${D}${sysconfdir}/init.d \ | ||
25 | ${D}${sysconfdir}/default/volatiles \ | ||
26 | ${D}${docdir}/radvd | ||
27 | # Install init script and volatiles | ||
28 | install -m 0755 ${WORKDIR}/radvd.init ${D}${sysconfdir}/init.d/radvd | ||
29 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/radvd | ||
30 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/radvd | ||
31 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/radvd | ||
32 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/radvd | ||
33 | |||
34 | install -m 0644 ${WORKDIR}/volatiles.03_radvd ${D}${sysconfdir}/default/volatiles/volatiles.03_radvd | ||
35 | # Documentation | ||
36 | for i in radvd.conf.example README; do \ | ||
37 | install -m 0644 $i ${D}${docdir}/radvd; \ | ||
38 | done | ||
39 | } | ||
40 | |||
41 | INITSCRIPT_NAME = "radvd" | ||
42 | INITSCRIPT_PARAMS = "defaults 20 80" | ||
43 | |||
44 | USERADD_PACKAGES = "${PN}" | ||
45 | USERADD_PARAM_${PN} = "--system --home ${localstatedir}/run/radvd/ -M -g nogroup radvd" | ||
46 | |||
47 | pkg_postinst_${PN} () { | ||
48 | if [ -z "$D" -a -x /etc/init.d/populate-volatile.sh ]; then | ||
49 | /etc/init.d/populate-volatile.sh update | ||
50 | fi | ||
51 | } | ||
diff --git a/meta-networking/recipes-daemons/radvd/radvd_1.9.8.bb b/meta-networking/recipes-daemons/radvd/radvd_1.9.8.bb new file mode 100644 index 0000000000..407eb43d3b --- /dev/null +++ b/meta-networking/recipes-daemons/radvd/radvd_1.9.8.bb | |||
@@ -0,0 +1,6 @@ | |||
1 | PR = "r0" | ||
2 | |||
3 | require radvd.inc | ||
4 | |||
5 | SRC_URI[md5sum] = "7a96a38252c3964ee18bbc1fdeae25fa" | ||
6 | SRC_URI[sha256sum] = "645ccf1c9b16e769ff4179813712e580e2c8786d64a888d8afa1e296c057c1c1" | ||
diff --git a/meta-networking/recipes-daemons/syslog-ng/files/initscript b/meta-networking/recipes-daemons/syslog-ng/files/initscript new file mode 100644 index 0000000000..b95e8adc20 --- /dev/null +++ b/meta-networking/recipes-daemons/syslog-ng/files/initscript | |||
@@ -0,0 +1,45 @@ | |||
1 | #! /bin/sh | ||
2 | # | ||
3 | # This is an init script for openembedded | ||
4 | # Copy it to /etc/init.d/syslog-ng and type | ||
5 | # > update-rc.d syslog-ng defaults 5 | ||
6 | # | ||
7 | |||
8 | |||
9 | syslog_ng=/usr/sbin/syslog-ng | ||
10 | test -x "$syslog_ng" || exit 0 | ||
11 | |||
12 | case "$1" in | ||
13 | start) | ||
14 | echo -n "Starting syslog-ng:" | ||
15 | start-stop-daemon --start --quiet --exec $syslog_ng | ||
16 | echo "." | ||
17 | ;; | ||
18 | stop) | ||
19 | echo -n "Stopping syslog-ng:" | ||
20 | start-stop-daemon --stop --quiet --pidfile /var/run/syslog-ng.pid | ||
21 | echo "." | ||
22 | ;; | ||
23 | reload|force-reload) | ||
24 | start-stop-daemon --stop --quiet --signal 1 --exec $syslog_ng | ||
25 | ;; | ||
26 | restart) | ||
27 | echo "Stopping syslog-ng:" | ||
28 | start-stop-daemon --stop --quiet --pidfile /var/run/syslog-ng.pid | ||
29 | echo -n "Waiting for syslog-ng to die off" | ||
30 | for i in 1 2 3 ; | ||
31 | do | ||
32 | sleep 1 | ||
33 | echo -n "." | ||
34 | done | ||
35 | echo "" | ||
36 | echo -n "Starting syslog-ng:" | ||
37 | start-stop-daemon --start --quiet --exec $syslog_ng | ||
38 | echo "." | ||
39 | ;; | ||
40 | *) | ||
41 | echo "Usage: /etc/init.d/syslog-ng {start|stop|reload|restart|force-reload}" | ||
42 | exit 1 | ||
43 | esac | ||
44 | |||
45 | exit 0 | ||
diff --git a/meta-networking/recipes-daemons/syslog-ng/files/syslog-ng.conf b/meta-networking/recipes-daemons/syslog-ng/files/syslog-ng.conf new file mode 100644 index 0000000000..96b631bf0f --- /dev/null +++ b/meta-networking/recipes-daemons/syslog-ng/files/syslog-ng.conf | |||
@@ -0,0 +1,155 @@ | |||
1 | @version: 3.2 | ||
2 | # | ||
3 | # Syslog-ng configuration file, compatible with default Debian syslogd | ||
4 | # installation. Originally written by anonymous (I can't find his name) | ||
5 | # Revised, and rewrited by me (SZALAY Attila <sasa@debian.org>) | ||
6 | |||
7 | # First, set some global options. | ||
8 | options { long_hostnames(off); flush_lines(0); use_dns(no); use_fqdn(no); | ||
9 | owner("root"); group("adm"); perm(0640); stats_freq(0); | ||
10 | bad_hostname("^gconfd$"); | ||
11 | }; | ||
12 | |||
13 | ######################## | ||
14 | # Sources | ||
15 | ######################## | ||
16 | # This is the default behavior of sysklogd package | ||
17 | # Logs may come from unix stream, but not from another machine. | ||
18 | # | ||
19 | source s_src { unix-dgram("/dev/log"); internal(); | ||
20 | file("/proc/kmsg" program_override("kernel")); | ||
21 | }; | ||
22 | |||
23 | # If you wish to get logs from remote machine you should uncomment | ||
24 | # this and comment the above source line. | ||
25 | # | ||
26 | #source s_net { tcp(ip(127.0.0.1) port(1000) authentication(required) encrypt(allow)); }; | ||
27 | |||
28 | ######################## | ||
29 | # Destinations | ||
30 | ######################## | ||
31 | # First some standard logfile | ||
32 | # | ||
33 | destination d_auth { file("/var/log/auth.log"); }; | ||
34 | destination d_cron { file("/var/log/cron.log"); }; | ||
35 | destination d_daemon { file("/var/log/daemon.log"); }; | ||
36 | destination d_kern { file("/var/log/kern.log"); }; | ||
37 | destination d_lpr { file("/var/log/lpr.log"); }; | ||
38 | destination d_mail { file("/var/log/mail.log"); }; | ||
39 | destination d_syslog { file("/var/log/syslog"); }; | ||
40 | destination d_user { file("/var/log/user.log"); }; | ||
41 | destination d_uucp { file("/var/log/uucp.log"); }; | ||
42 | |||
43 | # This files are the log come from the mail subsystem. | ||
44 | # | ||
45 | destination d_mailinfo { file("/var/log/mail/mail.info"); }; | ||
46 | destination d_mailwarn { file("/var/log/mail/mail.warn"); }; | ||
47 | destination d_mailerr { file("/var/log/mail/mail.err"); }; | ||
48 | |||
49 | # Logging for INN news system | ||
50 | # | ||
51 | destination d_newscrit { file("/var/log/news/news.crit"); }; | ||
52 | destination d_newserr { file("/var/log/news/news.err"); }; | ||
53 | destination d_newsnotice { file("/var/log/news/news.notice"); }; | ||
54 | |||
55 | # Some `catch-all' logfiles. | ||
56 | # | ||
57 | destination d_debug { file("/var/log/debug"); }; | ||
58 | destination d_error { file("/var/log/error"); }; | ||
59 | destination d_messages { file("/var/log/messages"); }; | ||
60 | |||
61 | # The root's console. | ||
62 | # | ||
63 | destination d_console { usertty("root"); }; | ||
64 | |||
65 | # Virtual console. | ||
66 | # | ||
67 | destination d_console_all { file("/dev/tty10"); }; | ||
68 | |||
69 | # The named pipe /dev/xconsole is for the nsole' utility. To use it, | ||
70 | # you must invoke nsole' with the -file' option: | ||
71 | # | ||
72 | # $ xconsole -file /dev/xconsole [...] | ||
73 | # | ||
74 | destination d_xconsole { pipe("/dev/xconsole"); }; | ||
75 | |||
76 | # Send the messages to an other host | ||
77 | # | ||
78 | #destination d_net { tcp("127.0.0.1" port(1000) authentication(on) encrypt(on) log_fifo_size(1000)); }; | ||
79 | |||
80 | # Debian only | ||
81 | destination d_ppp { file("/var/log/ppp.log"); }; | ||
82 | |||
83 | ######################## | ||
84 | # Filters | ||
85 | ######################## | ||
86 | # Here's come the filter options. With this rules, we can set which | ||
87 | # message go where. | ||
88 | |||
89 | filter f_dbg { level(debug); }; | ||
90 | filter f_info { level(info); }; | ||
91 | filter f_notice { level(notice); }; | ||
92 | filter f_warn { level(warn); }; | ||
93 | filter f_err { level(err); }; | ||
94 | filter f_crit { level(crit .. emerg); }; | ||
95 | |||
96 | filter f_debug { level(debug) and not facility(auth, authpriv, news, mail); }; | ||
97 | filter f_error { level(err .. emerg) ; }; | ||
98 | filter f_messages { level(info,notice,warn) and | ||
99 | not facility(auth,authpriv,cron,daemon,mail,news); }; | ||
100 | |||
101 | filter f_auth { facility(auth, authpriv) and not filter(f_debug); }; | ||
102 | filter f_cron { facility(cron) and not filter(f_debug); }; | ||
103 | filter f_daemon { facility(daemon) and not filter(f_debug); }; | ||
104 | filter f_kern { facility(kern) and not filter(f_debug); }; | ||
105 | filter f_lpr { facility(lpr) and not filter(f_debug); }; | ||
106 | filter f_local { facility(local0, local1, local3, local4, local5, | ||
107 | local6, local7) and not filter(f_debug); }; | ||
108 | filter f_mail { facility(mail) and not filter(f_debug); }; | ||
109 | filter f_news { facility(news) and not filter(f_debug); }; | ||
110 | filter f_syslog3 { not facility(auth, authpriv, mail) and not filter(f_debug); }; | ||
111 | filter f_user { facility(user) and not filter(f_debug); }; | ||
112 | filter f_uucp { facility(uucp) and not filter(f_debug); }; | ||
113 | |||
114 | filter f_cnews { level(notice, err, crit) and facility(news); }; | ||
115 | filter f_cother { level(debug, info, notice, warn) or facility(daemon, mail); }; | ||
116 | |||
117 | filter f_ppp { facility(local2) and not filter(f_debug); }; | ||
118 | filter f_console { level(warn .. emerg); }; | ||
119 | |||
120 | ######################## | ||
121 | # Log paths | ||
122 | ######################## | ||
123 | log { source(s_src); filter(f_auth); destination(d_auth); }; | ||
124 | log { source(s_src); filter(f_cron); destination(d_cron); }; | ||
125 | log { source(s_src); filter(f_daemon); destination(d_daemon); }; | ||
126 | log { source(s_src); filter(f_kern); destination(d_kern); }; | ||
127 | log { source(s_src); filter(f_lpr); destination(d_lpr); }; | ||
128 | log { source(s_src); filter(f_syslog3); destination(d_syslog); }; | ||
129 | log { source(s_src); filter(f_user); destination(d_user); }; | ||
130 | log { source(s_src); filter(f_uucp); destination(d_uucp); }; | ||
131 | |||
132 | log { source(s_src); filter(f_mail); destination(d_mail); }; | ||
133 | #log { source(s_src); filter(f_mail); filter(f_info); destination(d_mailinfo); }; | ||
134 | #log { source(s_src); filter(f_mail); filter(f_warn); destination(d_mailwarn); }; | ||
135 | #log { source(s_src); filter(f_mail); filter(f_err); destination(d_mailerr); }; | ||
136 | |||
137 | log { source(s_src); filter(f_news); filter(f_crit); destination(d_newscrit); }; | ||
138 | log { source(s_src); filter(f_news); filter(f_err); destination(d_newserr); }; | ||
139 | log { source(s_src); filter(f_news); filter(f_notice); destination(d_newsnotice); }; | ||
140 | #log { source(s_src); filter(f_cnews); destination(d_console_all); }; | ||
141 | #log { source(s_src); filter(f_cother); destination(d_console_all); }; | ||
142 | |||
143 | #log { source(s_src); filter(f_ppp); destination(d_ppp); }; | ||
144 | |||
145 | log { source(s_src); filter(f_debug); destination(d_debug); }; | ||
146 | log { source(s_src); filter(f_error); destination(d_error); }; | ||
147 | log { source(s_src); filter(f_messages); destination(d_messages); }; | ||
148 | |||
149 | log { source(s_src); filter(f_console); destination(d_console_all); | ||
150 | destination(d_xconsole); }; | ||
151 | log { source(s_src); filter(f_crit); destination(d_console); }; | ||
152 | |||
153 | # All messages send to a remote site | ||
154 | # | ||
155 | #log { source(s_src); destination(d_net); }; | ||
diff --git a/meta-networking/recipes-daemons/syslog-ng/syslog-ng.inc b/meta-networking/recipes-daemons/syslog-ng/syslog-ng.inc new file mode 100644 index 0000000000..ef183d7028 --- /dev/null +++ b/meta-networking/recipes-daemons/syslog-ng/syslog-ng.inc | |||
@@ -0,0 +1,78 @@ | |||
1 | DESCRIPTION = "Alternative system logger daemon" | ||
2 | DEPENDS = "libol flex eventlog glib-2.0" | ||
3 | LICENSE = "GPL LGPL" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=e0e8658d9be248f01b7933df24dc1408" | ||
5 | |||
6 | # syslog initscript is handled explicitly because order of | ||
7 | # update-rc.d and update-alternatives is important | ||
8 | RDEPENDS_${PN} += " ${@base_conditional("ONLINE_PACKAGE_MANAGEMENT", "none", "", "update-rc.d", d)}" | ||
9 | |||
10 | INC_PR = "r6" | ||
11 | |||
12 | inherit autotools | ||
13 | |||
14 | SRC_URI = "http://www.balabit.com/downloads/files/syslog-ng/sources/${PV}/source/${PN}_${PV}.tar.gz" | ||
15 | |||
16 | noipv6 = "${@base_contains('DISTRO_FEATURES', 'ipv6', '', '--disable-ipv6', d)}" | ||
17 | |||
18 | EXTRA_OECONF = " \ | ||
19 | --with-libnet=${STAGING_BINDIR_CROSS} \ | ||
20 | --enable-dynamic-linking \ | ||
21 | ${noipv6} \ | ||
22 | --enable-ssl \ | ||
23 | --disable-sub-streams \ | ||
24 | --disable-pacct \ | ||
25 | --disable-linux-caps \ | ||
26 | --disable-pcre \ | ||
27 | --disable-sql \ | ||
28 | " | ||
29 | |||
30 | do_configure_prepend() { | ||
31 | eval "${@base_contains('DISTRO_FEATURES', 'largefile', '', 'sed -i -e "s/-D_LARGEFILE_SOURCE//" -e "s/-D_FILE_OFFSET_BITS=64//" ${S}/configure.in', d)}" | ||
32 | } | ||
33 | |||
34 | do_install_append() { | ||
35 | install ${WORKDIR}/syslog-ng.conf ${D}${sysconfdir}/${PN}.conf | ||
36 | install -d ${D}/${sysconfdir}/init.d | ||
37 | install -m 755 ${WORKDIR}/initscript ${D}/${sysconfdir}/init.d/syslog.${PN} | ||
38 | } | ||
39 | |||
40 | CONFFILES_${PN} = "${sysconfdir}/${PN}.conf" | ||
41 | |||
42 | pkg_postinst_${PN} () { | ||
43 | /etc/init.d/syslog stop | ||
44 | update-alternatives --install ${sysconfdir}/init.d/syslog syslog-init syslog.${PN} 200 | ||
45 | |||
46 | if test "x$D" != "x"; then | ||
47 | OPT="-r $D" | ||
48 | else | ||
49 | OPT="-s" | ||
50 | fi | ||
51 | # remove all rc.d-links potentially created from alternative | ||
52 | # syslog packages before creating new ones | ||
53 | update-rc.d $OPT -f syslog remove | ||
54 | update-rc.d $OPT syslog start 20 2 3 4 5 . stop 90 0 1 6 . | ||
55 | } | ||
56 | |||
57 | pkg_prerm_${PN} () { | ||
58 | if test "x$D" = "x"; then | ||
59 | if test "$1" = "upgrade" -o "$1" = "remove"; then | ||
60 | /etc/init.d/syslog stop | ||
61 | fi | ||
62 | fi | ||
63 | |||
64 | update-alternatives --remove syslog-init syslog.${PN} | ||
65 | } | ||
66 | |||
67 | pkg_postrm_${PN} () { | ||
68 | if test "x$D" != "x"; then | ||
69 | OPT="-r $D" | ||
70 | else | ||
71 | OPT="" | ||
72 | fi | ||
73 | if test "$1" = "remove" -o "$1" = "purge"; then | ||
74 | if ! test -e "/etc/init.d/syslog"; then | ||
75 | update-rc.d $OPT syslog remove | ||
76 | fi | ||
77 | fi | ||
78 | } | ||
diff --git a/meta-networking/recipes-daemons/syslog-ng/syslog-ng_3.5.3.bb b/meta-networking/recipes-daemons/syslog-ng/syslog-ng_3.5.3.bb new file mode 100644 index 0000000000..ce10ecefe0 --- /dev/null +++ b/meta-networking/recipes-daemons/syslog-ng/syslog-ng_3.5.3.bb | |||
@@ -0,0 +1,15 @@ | |||
1 | require syslog-ng.inc | ||
2 | PR = "${INC_PR}.1" | ||
3 | |||
4 | SRC_URI += " \ | ||
5 | file://syslog-ng.conf \ | ||
6 | file://initscript \ | ||
7 | " | ||
8 | |||
9 | SRC_URI[md5sum] = "4cc29efa55fc41e65c48ece9bc88f88b" | ||
10 | SRC_URI[sha256sum] = "a349a1baa272e7b07fa4b0d6a85512e71dd946476ae12bc8f9c9ad64311164d0" | ||
11 | |||
12 | INSANE_SKIP_${PN} += "dev-so" | ||
13 | |||
14 | FILES_${PN} += "/usr/share/" | ||
15 | |||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/add-error-check-for-disk-filled-up.patch b/meta-networking/recipes-daemons/tftp-hpa/files/add-error-check-for-disk-filled-up.patch new file mode 100644 index 0000000000..d01c20d385 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/add-error-check-for-disk-filled-up.patch | |||
@@ -0,0 +1,81 @@ | |||
1 | From bd5773947af5ca80ca546ad5625818fc912bdd60 Mon Sep 17 00:00:00 2001 | ||
2 | From: "Roy.Li" <rongqing.li@windriver.com> | ||
3 | Date: Thu, 22 Aug 2013 08:56:09 +0800 | ||
4 | Subject: [PATCH] tftp-hpa: add error check for disk filled up | ||
5 | |||
6 | Upstream-status: Pending [Sent to http://www.syslinux.org/archives/2013-August/020765.html] | ||
7 | |||
8 | Add error check when the write-buffer is finally flushed to the file, | ||
9 | the caller can detect if the disk filled up (or had an i/o error) and | ||
10 | return a NOSAPCE nak to the other side. | ||
11 | |||
12 | Signed-off-by: Ming Liu <ming.liu@windriver.com> | ||
13 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
14 | --- | ||
15 | common/tftpsubs.c | 8 +++++--- | ||
16 | tftpd/tftpd.c | 12 ++++++++++-- | ||
17 | 2 files changed, 15 insertions(+), 5 deletions(-) | ||
18 | |||
19 | diff --git a/common/tftpsubs.c b/common/tftpsubs.c | ||
20 | index 8c999f6..b4d4ffe 100644 | ||
21 | --- a/common/tftpsubs.c | ||
22 | +++ b/common/tftpsubs.c | ||
23 | @@ -206,20 +206,22 @@ int write_behind(FILE * file, int convert) | ||
24 | |||
25 | p = buf; | ||
26 | ct = count; | ||
27 | + count = 0; | ||
28 | while (ct--) { /* loop over the buffer */ | ||
29 | c = *p++; /* pick up a character */ | ||
30 | if (prevchar == '\r') { /* if prev char was cr */ | ||
31 | if (c == '\n') /* if have cr,lf then just */ | ||
32 | - fseek(file, -1, 1); /* smash lf on top of the cr */ | ||
33 | + count = count - 1; | ||
34 | else if (c == '\0') /* if have cr,nul then */ | ||
35 | goto skipit; /* just skip over the putc */ | ||
36 | /* else just fall through and allow it */ | ||
37 | } | ||
38 | - putc(c, file); | ||
39 | + buf[count] = c; | ||
40 | + count ++; | ||
41 | skipit: | ||
42 | prevchar = c; | ||
43 | } | ||
44 | - return count; | ||
45 | + return write(fileno(file), buf, count); | ||
46 | } | ||
47 | |||
48 | /* When an error has occurred, it is possible that the two sides | ||
49 | diff --git a/tftpd/tftpd.c b/tftpd/tftpd.c | ||
50 | index 1873e70..c2adbda 100644 | ||
51 | --- a/tftpd/tftpd.c | ||
52 | +++ b/tftpd/tftpd.c | ||
53 | @@ -1681,7 +1681,11 @@ static void tftp_recvfile(const struct formats *pf, struct tftphdr *oap, int oac | ||
54 | syslog(LOG_WARNING, "tftpd: write(ack): %m"); | ||
55 | goto abort; | ||
56 | } | ||
57 | - write_behind(file, pf->f_convert); | ||
58 | + if(write_behind(file, pf->f_convert) < 0) { | ||
59 | + nak(ENOSPACE, NULL); | ||
60 | + (void)fclose(file); | ||
61 | + goto abort; | ||
62 | + } | ||
63 | for (;;) { | ||
64 | n = recv_time(peer, dp, PKTSIZE, 0, &r_timeout); | ||
65 | if (n < 0) { /* really? */ | ||
66 | @@ -1712,7 +1716,11 @@ static void tftp_recvfile(const struct formats *pf, struct tftphdr *oap, int oac | ||
67 | goto abort; | ||
68 | } | ||
69 | } while (size == segsize); | ||
70 | - write_behind(file, pf->f_convert); | ||
71 | + if(write_behind(file, pf->f_convert) < 0) { | ||
72 | + nak(ENOSPACE, NULL); | ||
73 | + (void)fclose(file); | ||
74 | + goto abort; | ||
75 | + } | ||
76 | (void)fclose(file); /* close data file */ | ||
77 | |||
78 | ap->th_opcode = htons((u_short) ACK); /* send the "final" ack */ | ||
79 | -- | ||
80 | 1.7.10.4 | ||
81 | |||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/default b/meta-networking/recipes-daemons/tftp-hpa/files/default new file mode 100644 index 0000000000..1dce7fdfeb --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/default | |||
@@ -0,0 +1,3 @@ | |||
1 | #Defaults for tftpd-hpa | ||
2 | RUN_DAEMON="yes" | ||
3 | OPTIONS="-l -s /var/lib/tftpboot" | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/init b/meta-networking/recipes-daemons/tftp-hpa/files/init new file mode 100644 index 0000000000..9e1843635c --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/init | |||
@@ -0,0 +1,105 @@ | |||
1 | #! /bin/sh | ||
2 | # | ||
3 | # Author: Jaakko Niemi <liiwi@iki.fi> | ||
4 | # Modified from skeleton file in sarge | ||
5 | |||
6 | ### BEGIN INIT INFO | ||
7 | # Provides: tftp-hpa | ||
8 | # Required-Start: $local_fs $remote_fs $syslog $network | ||
9 | # Required-Stop: $local_fs $remote_fs $syslog $network | ||
10 | # Default-Start: 2 3 4 5 | ||
11 | # Default-Stop: 1 | ||
12 | # Short-Description: HPA's tftp client | ||
13 | # Description: tftp server to allow booting clients which support | ||
14 | # the PXE protocol. | ||
15 | ### END INIT INFO | ||
16 | |||
17 | set -e | ||
18 | |||
19 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
20 | DESC="HPA's tftpd" | ||
21 | NAME=in.tftpd-hpa | ||
22 | SCRIPTNAME=/etc/init.d/tftpd-hpa | ||
23 | |||
24 | # Read config file if it is present. | ||
25 | if [ -r /etc/default/tftpd-hpa ] | ||
26 | then | ||
27 | . /etc/default/tftpd-hpa | ||
28 | fi | ||
29 | |||
30 | DAEMON=/usr/sbin/$NAME | ||
31 | PIDFILE=/var/run/$NAME.pid | ||
32 | |||
33 | # Gracefully exit if the package has been removed. | ||
34 | test -x $DAEMON || exit 0 | ||
35 | |||
36 | if [ "$RUN_DAEMON" != "yes" ] ; then | ||
37 | echo "tftpd-hpa disabled in /etc/default/tftpd-hpa" | ||
38 | exit 0 | ||
39 | fi | ||
40 | |||
41 | # | ||
42 | # Function that starts the daemon/service. | ||
43 | # | ||
44 | d_start() { | ||
45 | start-stop-daemon --start --quiet --exec $DAEMON -- $OPTIONS | ||
46 | } | ||
47 | |||
48 | # | ||
49 | # Function that stops the daemon/service. | ||
50 | # | ||
51 | d_stop() { | ||
52 | start-stop-daemon --stop --quiet --name $NAME | ||
53 | } | ||
54 | |||
55 | # | ||
56 | # Function that sends a SIGHUP to the daemon/service. | ||
57 | # | ||
58 | d_reload() { | ||
59 | start-stop-daemon --stop --quiet --name $NAME --signal 1 | ||
60 | } | ||
61 | |||
62 | case "$1" in | ||
63 | start) | ||
64 | echo "Starting $DESC: $NAME" | ||
65 | d_start | ||
66 | echo "." | ||
67 | ;; | ||
68 | stop) | ||
69 | echo "Stopping $DESC: $NAME" | ||
70 | d_stop | ||
71 | echo "." | ||
72 | ;; | ||
73 | #reload) | ||
74 | # | ||
75 | # If the daemon can reload its configuration without | ||
76 | # restarting (for example, when it is sent a SIGHUP), | ||
77 | # then implement that here. | ||
78 | # | ||
79 | # If the daemon responds to changes in its config file | ||
80 | # directly anyway, make this an "exit 0". | ||
81 | # | ||
82 | # echo -n "Reloading $DESC configuration..." | ||
83 | # d_reload | ||
84 | # echo "done." | ||
85 | #;; | ||
86 | restart|force-reload) | ||
87 | # | ||
88 | # If the "reload" option is implemented, move the "force-reload" | ||
89 | # option to the "reload" entry above. If not, "force-reload" is | ||
90 | # just the same as "restart". | ||
91 | # | ||
92 | echo "Restarting $DESC: $NAME" | ||
93 | d_stop | ||
94 | sleep 1 | ||
95 | d_start | ||
96 | echo "." | ||
97 | ;; | ||
98 | *) | ||
99 | # echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2 | ||
100 | echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2 | ||
101 | exit 1 | ||
102 | ;; | ||
103 | esac | ||
104 | |||
105 | exit 0 | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch new file mode 100644 index 0000000000..3f690609a6 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.40-remap.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -up tftp-hpa-0.49/tftpd/remap.c.zero tftp-hpa-0.49/tftpd/remap.c | ||
8 | --- tftp-hpa-0.49/tftpd/remap.c.zero 2008-10-20 18:08:31.000000000 -0400 | ||
9 | +++ tftp-hpa-0.49/tftpd/remap.c 2008-11-25 11:41:09.000000000 -0500 | ||
10 | @@ -286,6 +286,7 @@ struct rule *parserulefile(FILE * f) | ||
11 | int lineno = 0; | ||
12 | int err = 0; | ||
13 | |||
14 | + memset(this_rule, '\0', sizeof(struct rule)); | ||
15 | while (lineno++, fgets(line, MAXLINE, f)) { | ||
16 | rv = parseline(line, this_rule, lineno); | ||
17 | if (rv < 0) | ||
18 | @@ -294,6 +295,7 @@ struct rule *parserulefile(FILE * f) | ||
19 | *last_rule = this_rule; | ||
20 | last_rule = &this_rule->next; | ||
21 | this_rule = tfmalloc(sizeof(struct rule)); | ||
22 | + memset(this_rule, '\0', sizeof(struct rule)); | ||
23 | } | ||
24 | } | ||
25 | |||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch new file mode 100644 index 0000000000..98a86b78b0 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.42-tftpboot.patch | |||
@@ -0,0 +1,60 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -up tftp-hpa-0.48/tftp-xinetd.tftpboot tftp-hpa-0.48/tftp-xinetd | ||
8 | --- tftp-hpa-0.48/tftp-xinetd.tftpboot 2007-01-31 00:51:05.000000000 +0100 | ||
9 | +++ tftp-hpa-0.48/tftp-xinetd 2008-05-20 12:05:53.000000000 +0200 | ||
10 | @@ -10,7 +10,7 @@ service tftp | ||
11 | wait = yes | ||
12 | user = root | ||
13 | server = /usr/sbin/in.tftpd | ||
14 | - server_args = -s /tftpboot | ||
15 | + server_args = -s /var/lib/tftpboot | ||
16 | disable = yes | ||
17 | per_source = 11 | ||
18 | cps = 100 2 | ||
19 | diff -up tftp-hpa-0.48/README.security.tftpboot tftp-hpa-0.48/README.security | ||
20 | --- tftp-hpa-0.48/README.security.tftpboot 2008-05-29 17:36:32.000000000 +0200 | ||
21 | +++ tftp-hpa-0.48/README.security 2008-05-29 17:37:21.000000000 +0200 | ||
22 | @@ -17,10 +17,10 @@ probably the following: | ||
23 | |||
24 | 1. Create a separate "tftpd" user and group only used for tftpd; | ||
25 | 2. Have all your boot files in a single directory tree (usually called | ||
26 | - /tftpboot). | ||
27 | -3. Specify "-p -u tftpd -s /tftpboot" on the tftpd command line; if | ||
28 | + /var/lib/tftpboot). | ||
29 | +3. Specify "-p -u tftpd -s /var/lib/tftpboot" on the tftpd command line; if | ||
30 | you want clients to be able to create files use | ||
31 | - "-p -c -U 002 -u tftpd -s /tftpboot" (replace 002 with whatever | ||
32 | + "-p -c -U 002 -u tftpd -s /var/lib/tftpboot" (replace 002 with whatever | ||
33 | umask is appropriate for your setup.) | ||
34 | |||
35 | ======================================= | ||
36 | @@ -40,12 +40,12 @@ directly. Thus, if your /etc/inetd.conf | ||
37 | line): | ||
38 | |||
39 | tftp dgram udp wait root /usr/sbin/tcpd | ||
40 | -/usr/sbin/in.tftpd -s /tftpboot -r blksize | ||
41 | +/usr/sbin/in.tftpd -s /var/lib/tftpboot -r blksize | ||
42 | |||
43 | ... it's better to change to ... | ||
44 | |||
45 | tftp dgram udp wait root /usr/sbin/in.tftpd | ||
46 | -in.tftpd -s /tftpboot -r blksize | ||
47 | +in.tftpd -s /var/lib/tftpboot -r blksize | ||
48 | |||
49 | You should make sure that you are using "wait" option in tftpd; you | ||
50 | also need to have tftpd spawned as root in order for chroot (-s) to | ||
51 | diff -up tftp-hpa-0.48/tftpd/sample.rules.tftpboot tftp-hpa-0.48/tftpd/sample.rules | ||
52 | --- tftp-hpa-0.48/tftpd/sample.rules.tftpboot 2008-05-29 17:38:46.000000000 +0200 | ||
53 | +++ tftp-hpa-0.48/tftpd/sample.rules 2008-05-29 17:38:05.000000000 +0200 | ||
54 | @@ -30,5 +30,5 @@ rg \\ / # Convert backslashes to slash | ||
55 | rg \# @ # Convert hash marks to @ signs | ||
56 | rg /../ /..no../ # Convert /../ to /..no../ | ||
57 | e ^ok/ # These are always ok | ||
58 | -r ^[^/] /tftpboot/\0 # Convert non-absolute files | ||
59 | +r ^[^/] /var/lib/tftpboot/\0 # Convert non-absolute files | ||
60 | a \.pvt$ # Reject requests for private files | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch new file mode 100644 index 0000000000..7ae1a87220 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-chk_retcodes.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -up tftp-hpa-0.49/tftpd/tftpd.c.chk_retcodes tftp-hpa-0.49/tftpd/tftpd.c | ||
8 | --- tftp-hpa-0.49/tftpd/tftpd.c.chk_retcodes 2009-01-15 15:28:50.000000000 +0100 | ||
9 | +++ tftp-hpa-0.49/tftpd/tftpd.c 2009-01-15 15:31:36.000000000 +0100 | ||
10 | @@ -932,7 +932,10 @@ int main(int argc, char **argv) | ||
11 | exit(EX_OSERR); | ||
12 | } | ||
13 | #ifdef __CYGWIN__ | ||
14 | - chdir("/"); /* Cygwin chroot() bug workaround */ | ||
15 | + if (chdir("/") < 0) { /* Cygwin chroot() bug workaround */ | ||
16 | + syslog(LOG_ERR, "chroot: %m"); | ||
17 | + exit(EX_OSERR); | ||
18 | + } | ||
19 | #endif | ||
20 | } | ||
21 | #ifdef HAVE_SETREGID | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-cmd_arg.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-cmd_arg.patch new file mode 100644 index 0000000000..6b8ceaaeba --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-0.49-cmd_arg.patch | |||
@@ -0,0 +1,165 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -up tftp-hpa-0.49/config.h.cmd_arg tftp-hpa-0.49/config.h | ||
8 | --- tftp-hpa-0.49/config.h.cmd_arg 2010-04-19 15:29:10.567331454 +0200 | ||
9 | +++ tftp-hpa-0.49/config.h 2010-04-20 07:33:03.133232772 +0200 | ||
10 | @@ -291,6 +291,7 @@ typedef int socklen_t; | ||
11 | /* Prototypes for libxtra functions */ | ||
12 | |||
13 | void *xmalloc(size_t); | ||
14 | +void *xrealloc(void *, size_t); | ||
15 | char *xstrdup(const char *); | ||
16 | |||
17 | #ifndef HAVE_BSD_SIGNAL | ||
18 | diff -up tftp-hpa-0.49/configure.in.cmd_arg tftp-hpa-0.49/configure.in | ||
19 | --- tftp-hpa-0.49/configure.in.cmd_arg 2008-10-21 00:08:31.000000000 +0200 | ||
20 | +++ tftp-hpa-0.49/configure.in 2010-04-19 11:05:12.387340698 +0200 | ||
21 | @@ -152,6 +152,7 @@ OBJROOT=`pwd` | ||
22 | |||
23 | XTRA=false | ||
24 | PA_SEARCH_LIBS_AND_ADD(xmalloc, iberty) | ||
25 | +PA_SEARCH_LIBS_AND_ADD(xrealloc, iberty) | ||
26 | PA_SEARCH_LIBS_AND_ADD(xstrdup, iberty) | ||
27 | PA_SEARCH_LIBS_AND_ADD(bsd_signal, bsd, bsdsignal) | ||
28 | PA_SEARCH_LIBS_AND_ADD(getopt_long, getopt, getopt_long) | ||
29 | diff -up tftp-hpa-0.49/lib/xrealloc.c.cmd_arg tftp-hpa-0.49/lib/xrealloc.c | ||
30 | --- tftp-hpa-0.49/lib/xrealloc.c.cmd_arg 2010-04-19 11:05:12.387340698 +0200 | ||
31 | +++ tftp-hpa-0.49/lib/xrealloc.c 2010-04-19 11:05:12.387340698 +0200 | ||
32 | @@ -0,0 +1,20 @@ | ||
33 | +/* | ||
34 | + * xrealloc.c | ||
35 | + * | ||
36 | + * Simple error-checking version of realloc() | ||
37 | + * | ||
38 | + */ | ||
39 | + | ||
40 | +#include "config.h" | ||
41 | + | ||
42 | +void *xrealloc(void *ptr, size_t size) | ||
43 | +{ | ||
44 | + void *p = realloc(ptr, size); | ||
45 | + | ||
46 | + if (!p) { | ||
47 | + fprintf(stderr, "Out of memory!\n"); | ||
48 | + exit(128); | ||
49 | + } | ||
50 | + | ||
51 | + return p; | ||
52 | +} | ||
53 | diff -up tftp-hpa-0.49/tftp/main.c.cmd_arg tftp-hpa-0.49/tftp/main.c | ||
54 | --- tftp-hpa-0.49/tftp/main.c.cmd_arg 2008-10-21 00:08:31.000000000 +0200 | ||
55 | +++ tftp-hpa-0.49/tftp/main.c 2010-04-19 11:05:12.389329337 +0200 | ||
56 | @@ -89,11 +89,14 @@ int connected; | ||
57 | const struct modes *mode; | ||
58 | #ifdef WITH_READLINE | ||
59 | char *line = NULL; | ||
60 | +char *remote_pth = NULL; | ||
61 | #else | ||
62 | char line[LBUFLEN]; | ||
63 | +char remote_pth[LBUFLEN]; | ||
64 | #endif | ||
65 | int margc; | ||
66 | -char *margv[20]; | ||
67 | +char **margv; | ||
68 | +int sizeof_margv=0; | ||
69 | const char *prompt = "tftp> "; | ||
70 | sigjmp_buf toplevel; | ||
71 | void intr(int); | ||
72 | @@ -379,6 +382,10 @@ static void getmoreargs(const char *part | ||
73 | free(line); | ||
74 | line = NULL; | ||
75 | } | ||
76 | + if (remote_pth) { | ||
77 | + free(remote_pth); | ||
78 | + remote_pth = NULL; | ||
79 | + } | ||
80 | line = xmalloc(len + elen + 1); | ||
81 | strcpy(line, partial); | ||
82 | strcpy(line + len, eline); | ||
83 | @@ -535,6 +542,7 @@ void put(int argc, char *argv[]) | ||
84 | int fd; | ||
85 | int n, err; | ||
86 | char *cp, *targ; | ||
87 | + long dirlen, namelen, lastlen=0; | ||
88 | |||
89 | if (argc < 2) { | ||
90 | getmoreargs("send ", "(file) "); | ||
91 | @@ -588,9 +596,22 @@ void put(int argc, char *argv[]) | ||
92 | } | ||
93 | /* this assumes the target is a directory */ | ||
94 | /* on a remote unix system. hmmmm. */ | ||
95 | - cp = strchr(targ, '\0'); | ||
96 | - *cp++ = '/'; | ||
97 | + dirlen = strlen(targ)+1; | ||
98 | +#ifdef WITH_READLINE | ||
99 | + remote_pth = xmalloc(dirlen+1); | ||
100 | +#endif | ||
101 | + strcpy(remote_pth, targ); | ||
102 | + remote_pth[dirlen-1] = '/'; | ||
103 | + cp = remote_pth + dirlen; | ||
104 | for (n = 1; n < argc - 1; n++) { | ||
105 | +#ifdef WITH_READLINE | ||
106 | + namelen = strlen(tail(argv[n])) + 1; | ||
107 | + if (namelen > lastlen) { | ||
108 | + remote_pth = xrealloc(remote_pth, dirlen + namelen + 1); | ||
109 | + cp = remote_pth + dirlen; | ||
110 | + lastlen = namelen; | ||
111 | + } | ||
112 | +#endif | ||
113 | strcpy(cp, tail(argv[n])); | ||
114 | fd = open(argv[n], O_RDONLY | mode->m_openflags); | ||
115 | if (fd < 0) { | ||
116 | @@ -600,9 +621,9 @@ void put(int argc, char *argv[]) | ||
117 | } | ||
118 | if (verbose) | ||
119 | printf("putting %s to %s:%s [%s]\n", | ||
120 | - argv[n], hostname, targ, mode->m_mode); | ||
121 | + argv[n], hostname, remote_pth, mode->m_mode); | ||
122 | sa_set_port(&peeraddr, port); | ||
123 | - tftp_sendfile(fd, targ, mode->m_mode); | ||
124 | + tftp_sendfile(fd, remote_pth, mode->m_mode); | ||
125 | } | ||
126 | } | ||
127 | |||
128 | @@ -801,6 +822,10 @@ static void command(void) | ||
129 | free(line); | ||
130 | line = NULL; | ||
131 | } | ||
132 | + if (remote_pth) { | ||
133 | + free(remote_pth); | ||
134 | + remote_pth = NULL; | ||
135 | + } | ||
136 | line = readline(prompt); | ||
137 | if (!line) | ||
138 | exit(0); /* EOF */ | ||
139 | @@ -872,7 +897,13 @@ struct cmd *getcmd(char *name) | ||
140 | static void makeargv(void) | ||
141 | { | ||
142 | char *cp; | ||
143 | - char **argp = margv; | ||
144 | + char **argp; | ||
145 | + | ||
146 | + if (!sizeof_margv) { | ||
147 | + sizeof_margv = 20; | ||
148 | + margv = xmalloc(sizeof_margv * sizeof(char *)); | ||
149 | + } | ||
150 | + argp = margv; | ||
151 | |||
152 | margc = 0; | ||
153 | for (cp = line; *cp;) { | ||
154 | @@ -882,6 +913,11 @@ static void makeargv(void) | ||
155 | break; | ||
156 | *argp++ = cp; | ||
157 | margc += 1; | ||
158 | + if (margc == sizeof_margv) { | ||
159 | + sizeof_margv += 20; | ||
160 | + margv = xrealloc(margv, sizeof_margv * sizeof(char *)); | ||
161 | + argp = margv + margc; | ||
162 | + } | ||
163 | while (*cp != '\0' && !isspace(*cp)) | ||
164 | cp++; | ||
165 | if (*cp == '\0') | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch new file mode 100644 index 0000000000..85110eb285 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.39-tzfix.patch | |||
@@ -0,0 +1,24 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -up tftp-hpa-0.49/tftpd/tftpd.c.tzfix tftp-hpa-0.49/tftpd/tftpd.c | ||
8 | --- tftp-hpa-0.49/tftpd/tftpd.c.tzfix 2008-10-20 18:08:31.000000000 -0400 | ||
9 | +++ tftp-hpa-0.49/tftpd/tftpd.c 2008-11-25 11:45:27.000000000 -0500 | ||
10 | @@ -350,6 +350,14 @@ int main(int argc, char **argv) | ||
11 | const char *pidfile = NULL; | ||
12 | u_short tp_opcode; | ||
13 | |||
14 | + time_t my_time = 0; | ||
15 | + struct tm* p_tm; | ||
16 | + char envtz[10]; | ||
17 | + my_time = time(NULL); | ||
18 | + p_tm = localtime(&my_time); | ||
19 | + snprintf(envtz, sizeof(envtz) - 1, "UTC%+d", (p_tm->tm_gmtoff * -1)/3600); | ||
20 | + setenv("TZ", envtz, 0); | ||
21 | + | ||
22 | /* basename() is way too much of a pain from a portability standpoint */ | ||
23 | |||
24 | p = strrchr(argv[0], '/'); | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-fortify-strcpy-crash.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-fortify-strcpy-crash.patch new file mode 100644 index 0000000000..08d2b5b7d6 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-fortify-strcpy-crash.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -urN tftp-hpa-0.49.orig/tftp/tftp.c tftp-hpa-0.49/tftp/tftp.c | ||
8 | --- tftp-hpa-0.49.orig/tftp/tftp.c 2008-10-20 18:08:31.000000000 -0400 | ||
9 | +++ tftp-hpa-0.49/tftp/tftp.c 2009-08-05 09:47:18.072585848 -0400 | ||
10 | @@ -279,15 +279,16 @@ | ||
11 | struct tftphdr *tp, const char *mode) | ||
12 | { | ||
13 | char *cp; | ||
14 | + size_t len; | ||
15 | |||
16 | tp->th_opcode = htons((u_short) request); | ||
17 | cp = (char *)&(tp->th_stuff); | ||
18 | - strcpy(cp, name); | ||
19 | - cp += strlen(name); | ||
20 | - *cp++ = '\0'; | ||
21 | - strcpy(cp, mode); | ||
22 | - cp += strlen(mode); | ||
23 | - *cp++ = '\0'; | ||
24 | + len = strlen(name) + 1; | ||
25 | + memcpy(cp, name, len); | ||
26 | + cp += len; | ||
27 | + len = strlen(mode) + 1; | ||
28 | + memcpy(cp, mode, len); | ||
29 | + cp += len; | ||
30 | return (cp - (char *)tp); | ||
31 | } | ||
32 | |||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch new file mode 100644 index 0000000000..720cd69dec --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-0.49-stats.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -up tftp-hpa-0.49/tftp/tftp.c.stats tftp-hpa-0.49/tftp/tftp.c | ||
8 | --- tftp-hpa-0.49/tftp/tftp.c.stats 2011-01-03 15:38:34.217918067 +0100 | ||
9 | +++ tftp-hpa-0.49/tftp/tftp.c 2011-01-03 15:38:37.498917014 +0100 | ||
10 | @@ -400,8 +400,8 @@ static void printstats(const char *direc | ||
11 | { | ||
12 | double delta; | ||
13 | |||
14 | - delta = (tstop.tv_sec + (tstop.tv_usec / 100000.0)) - | ||
15 | - (tstart.tv_sec + (tstart.tv_usec / 100000.0)); | ||
16 | + delta = (tstop.tv_sec + (tstop.tv_usec / 1000000.0)) - | ||
17 | + (tstart.tv_sec + (tstart.tv_usec / 1000000.0)); | ||
18 | if (verbose) { | ||
19 | printf("%s %lu bytes in %.1f seconds", direction, amount, delta); | ||
20 | printf(" [%.0f bit/s]", (amount * 8.) / delta); | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.2-pktinfo.patch b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.2-pktinfo.patch new file mode 100644 index 0000000000..216349d26f --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-hpa-5.2-pktinfo.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | Patch originally from Fedora | ||
2 | |||
3 | http://pkgs.fedoraproject.org/cgit/tftp.git/ | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | diff -up tftp-hpa-5.2/tftpd/recvfrom.c.test tftp-hpa-5.2/tftpd/recvfrom.c | ||
8 | --- tftp-hpa-5.2/tftpd/recvfrom.c.test 2011-12-11 23:13:52.000000000 +0100 | ||
9 | +++ tftp-hpa-5.2/tftpd/recvfrom.c 2012-01-04 10:05:17.852042256 +0100 | ||
10 | @@ -149,16 +149,16 @@ myrecvfrom(int s, void *buf, int len, un | ||
11 | |||
12 | /* Try to enable getting the return address */ | ||
13 | #ifdef IP_RECVDSTADDR | ||
14 | - if (from->sa_family == AF_INET) | ||
15 | + if (from->sa_family == AF_INET || !from->sa_family) | ||
16 | setsockopt(s, IPPROTO_IP, IP_RECVDSTADDR, &on, sizeof(on)); | ||
17 | #endif | ||
18 | #ifdef IP_PKTINFO | ||
19 | - if (from->sa_family == AF_INET) | ||
20 | + if (from->sa_family == AF_INET || !from->sa_family) | ||
21 | setsockopt(s, IPPROTO_IP, IP_PKTINFO, &on, sizeof(on)); | ||
22 | #endif | ||
23 | #ifdef HAVE_IPV6 | ||
24 | #ifdef IPV6_RECVPKTINFO | ||
25 | - if (from->sa_family == AF_INET6) | ||
26 | + if (from->sa_family == AF_INET6 || !from->sa_family) | ||
27 | setsockopt(s, IPPROTO_IPV6, IPV6_RECVPKTINFO, &on, sizeof(on)); | ||
28 | #endif | ||
29 | #endif | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/files/tftp-xinetd b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-xinetd new file mode 100644 index 0000000000..fe70163966 --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/files/tftp-xinetd | |||
@@ -0,0 +1,18 @@ | |||
1 | # default: off | ||
2 | # description: The tftp server serves files using the trivial file transfer \ | ||
3 | # protocol. The tftp protocol is often used to boot diskless \ | ||
4 | # workstations, download configuration files to network-aware printers, \ | ||
5 | # and to start the installation process for some operating systems. | ||
6 | service tftp | ||
7 | { | ||
8 | socket_type = dgram | ||
9 | protocol = udp | ||
10 | wait = yes | ||
11 | user = root | ||
12 | server = /usr/sbin/in.tftpd-hpa | ||
13 | server_args = -s /var/lib/tftpboot | ||
14 | disable = yes | ||
15 | per_source = 11 | ||
16 | cps = 100 2 | ||
17 | flags = IPv6 | ||
18 | } | ||
diff --git a/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb b/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb new file mode 100644 index 0000000000..6978e0669c --- /dev/null +++ b/meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb | |||
@@ -0,0 +1,72 @@ | |||
1 | SUMMARY = "Client for the Trivial File Transfer Protocol" | ||
2 | DESCRIPTION = \ | ||
3 | "The Trivial File Transfer Protocol (TFTP) is normally used only for \ | ||
4 | booting diskless workstations. The tftp package provides the user \ | ||
5 | interface for TFTP, which allows users to transfer files to and from a \ | ||
6 | remote machine. This program and TFTP provide very little security, \ | ||
7 | and should not be enabled unless it is expressly needed." | ||
8 | DEPENDS = "tcp-wrappers readline" | ||
9 | SECTION = "network" | ||
10 | LICENSE = "BSD-4-Clause" | ||
11 | LIC_FILES_CHKSUM = "file://MCONFIG.in;beginline=1;endline=9;md5=c28ba5adb43041fae4629db05c83cbdd \ | ||
12 | file://tftp/tftp.c;beginline=1;endline=32;md5=988c1cba99d70858a26cd877209857f4" | ||
13 | |||
14 | |||
15 | SRC_URI = "http://kernel.org/pub/software/network/tftp/tftp-hpa/tftp-hpa-${PV}.tar.bz2 \ | ||
16 | file://tftp-0.40-remap.patch \ | ||
17 | file://tftp-0.42-tftpboot.patch \ | ||
18 | file://tftp-0.49-chk_retcodes.patch \ | ||
19 | file://tftp-0.49-cmd_arg.patch \ | ||
20 | file://tftp-hpa-0.39-tzfix.patch \ | ||
21 | file://tftp-hpa-0.49-fortify-strcpy-crash.patch \ | ||
22 | file://tftp-hpa-0.49-stats.patch \ | ||
23 | file://tftp-hpa-5.2-pktinfo.patch \ | ||
24 | file://default \ | ||
25 | file://init \ | ||
26 | file://add-error-check-for-disk-filled-up.patch \ | ||
27 | " | ||
28 | |||
29 | SRC_URI[md5sum] = "46c9bd20bbffa62f79c958c7b99aac21" | ||
30 | SRC_URI[sha256sum] = "0a9f88d4c1c02687b4853b02ab5dd8779d4de4ffdb9b2e5c9332841304d1a269" | ||
31 | |||
32 | inherit autotools update-rc.d update-alternatives | ||
33 | |||
34 | EXTRA_OECONF += "--disable-option-checking" | ||
35 | |||
36 | # configure.in has errors | ||
37 | do_configure() { | ||
38 | oe_runconf | ||
39 | } | ||
40 | |||
41 | do_install() { | ||
42 | oe_runmake install INSTALLROOT=${D} | ||
43 | mv ${D}${bindir}/tftp ${D}${bindir}/tftp-hpa | ||
44 | mv ${D}${sbindir}/in.tftpd ${D}${sbindir}/in.tftpd-hpa | ||
45 | |||
46 | install -m 755 -d ${D}${localstatedir}/lib/tftpboot/ | ||
47 | install -d ${D}${sysconfdir}/init.d | ||
48 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/tftpd-hpa | ||
49 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa | ||
50 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa | ||
51 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/tftpd-hpa | ||
52 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/tftpd-hpa | ||
53 | |||
54 | install -d ${D}${sysconfdir}/default | ||
55 | install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/tftpd-hpa | ||
56 | } | ||
57 | |||
58 | FILES_${PN} = "${bindir}" | ||
59 | |||
60 | PACKAGES += "tftp-hpa-server" | ||
61 | SUMMARY_tftp-hpa-server = "Server for the Trivial File Transfer Protocol" | ||
62 | FILES_tftp-hpa-server = "${sbindir} ${sysconfdir} ${localstatedir}" | ||
63 | CONFFILES_tftp-hpa-server = "${sysconfdir}/default/tftpd-hpa" | ||
64 | |||
65 | INITSCRIPT_PACKAGES = "tftp-hpa-server" | ||
66 | INITSCRIPT_NAME = "tftpd-hpa" | ||
67 | INITSCRIPT_PARAMS = "start 20 2 3 4 5 . stop 20 1 ." | ||
68 | |||
69 | ALTERNATIVE_${PN} = "tftp" | ||
70 | ALTERNATIVE_TARGET[tftp] = "${bindir}/tftp-hpa" | ||
71 | ALTERNATIVE_PRIORITY = "50" | ||
72 | |||
diff --git a/meta-networking/recipes-daemons/vblade/files/cross.patch b/meta-networking/recipes-daemons/vblade/files/cross.patch new file mode 100644 index 0000000000..d2eb156143 --- /dev/null +++ b/meta-networking/recipes-daemons/vblade/files/cross.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | Remove CC and CFLAGS values, we set these ourselves | ||
2 | |||
3 | Upstream-Status: Inappropriate [config] | ||
4 | |||
5 | diff -urN vblade-19.old//makefile vblade-19//makefile | ||
6 | --- vblade-19.old//makefile 2008-10-08 22:07:40.000000000 +0100 | ||
7 | +++ vblade-19//makefile 2008-11-18 19:07:51.700365029 +0000 | ||
8 | @@ -9,8 +9,6 @@ | ||
9 | mandir = ${sharedir}/man | ||
10 | |||
11 | O=aoe.o bpf.o ${PLATFORM}.o ata.o | ||
12 | -CFLAGS += -Wall -g -O2 | ||
13 | -CC = gcc | ||
14 | |||
15 | vblade: $O | ||
16 | ${CC} -o vblade $O | ||
diff --git a/meta-networking/recipes-daemons/vblade/vblade_20.bb b/meta-networking/recipes-daemons/vblade/vblade_20.bb new file mode 100644 index 0000000000..5b7c167643 --- /dev/null +++ b/meta-networking/recipes-daemons/vblade/vblade_20.bb | |||
@@ -0,0 +1,20 @@ | |||
1 | SUMMARY = "Virtual EtherDrive blade AoE target" | ||
2 | SECTION = "console/network" | ||
3 | |||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
6 | |||
7 | SRC_URI = "${SOURCEFORGE_MIRROR}/aoetools/${BPN}-${PV}.tgz \ | ||
8 | file://cross.patch" | ||
9 | |||
10 | SRC_URI[md5sum] = "3c80e4a6bc7d66ae0c235b88cb44bd59" | ||
11 | SRC_URI[sha256sum] = "c8fe2fc4f2fba8e07e5cfdf17335982584eef2cd5c78bf8b1db93f2b56e7121d" | ||
12 | |||
13 | inherit autotools | ||
14 | |||
15 | do_install() { | ||
16 | install -D -m 0755 ${S}/vblade ${D}/${sbindir}/vblade | ||
17 | install -D -m 0755 ${S}/vbladed ${D}/${sbindir}/vbladed | ||
18 | install -D -m 0644 ${S}/vblade.8 ${D}/${mandir}/man8/vblade.8 | ||
19 | } | ||
20 | |||
diff --git a/meta-networking/recipes-daemons/vsftpd/files/change-secure_chroot_dir.patch b/meta-networking/recipes-daemons/vsftpd/files/change-secure_chroot_dir.patch new file mode 100644 index 0000000000..5f2860e846 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/files/change-secure_chroot_dir.patch | |||
@@ -0,0 +1,55 @@ | |||
1 | vsftpd: change default value of secure_chroot_dir | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Change secure_chroot_dir pointing to a volatile directory. | ||
6 | |||
7 | Signed-off-by: Ming Liu <ming.liu@windriver.com> | ||
8 | --- | ||
9 | INSTALL | 6 +++--- | ||
10 | tunables.c | 2 +- | ||
11 | vsftpd.conf.5 | 2 +- | ||
12 | 3 files changed, 5 insertions(+), 5 deletions(-) | ||
13 | |||
14 | diff -urpN a/INSTALL b/INSTALL | ||
15 | --- a/INSTALL 2013-09-13 10:23:57.504972397 +0800 | ||
16 | +++ b/INSTALL 2013-09-13 10:25:25.664971779 +0800 | ||
17 | @@ -27,11 +27,11 @@ user in case it does not already exist. | ||
18 | [root@localhost root]# useradd nobody | ||
19 | useradd: user nobody exists | ||
20 | |||
21 | -2b) vsftpd needs the (empty) directory /usr/share/empty in the default | ||
22 | +2b) vsftpd needs the (empty) directory /var/run/vsftpd/empty in the default | ||
23 | configuration. Add this directory in case it does not already exist. e.g.: | ||
24 | |||
25 | -[root@localhost root]# mkdir /usr/share/empty/ | ||
26 | -mkdir: cannot create directory `/usr/share/empty': File exists | ||
27 | +[root@localhost root]# mkdir /var/run/vsftpd/empty/ | ||
28 | +mkdir: cannot create directory `/var/run/vsftpd/empty': File exists | ||
29 | |||
30 | 2c) For anonymous FTP, you will need the user "ftp" to exist, and have a | ||
31 | valid home directory (which is NOT owned or writable by the user "ftp"). | ||
32 | diff -urpN a/tunables.c b/tunables.c | ||
33 | --- a/tunables.c 2013-09-13 10:26:29.554972817 +0800 | ||
34 | +++ b/tunables.c 2013-09-13 10:27:18.104972210 +0800 | ||
35 | @@ -254,7 +254,7 @@ tunables_load_defaults() | ||
36 | /* -rw------- */ | ||
37 | tunable_chown_upload_mode = 0600; | ||
38 | |||
39 | - install_str_setting("/usr/share/empty", &tunable_secure_chroot_dir); | ||
40 | + install_str_setting("/var/run/vsftpd/empty", &tunable_secure_chroot_dir); | ||
41 | install_str_setting("ftp", &tunable_ftp_username); | ||
42 | install_str_setting("root", &tunable_chown_username); | ||
43 | install_str_setting("/var/log/xferlog", &tunable_xferlog_file); | ||
44 | diff -urpN a/vsftpd.conf.5 b/vsftpd.conf.5 | ||
45 | --- a/vsftpd.conf.5 2013-09-13 10:09:33.774972462 +0800 | ||
46 | +++ b/vsftpd.conf.5 2013-09-13 10:10:41.914971989 +0800 | ||
47 | @@ -969,7 +969,7 @@ This option should be the name of a dire | ||
48 | directory should not be writable by the ftp user. This directory is used | ||
49 | as a secure chroot() jail at times vsftpd does not require filesystem access. | ||
50 | |||
51 | -Default: /usr/share/empty | ||
52 | +Default: /var/run/vsftpd/empty | ||
53 | .TP | ||
54 | .B ssl_ciphers | ||
55 | This option can be used to select which SSL ciphers vsftpd will allow for | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/files/init b/meta-networking/recipes-daemons/vsftpd/files/init new file mode 100755 index 0000000000..d0ec010dc7 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/files/init | |||
@@ -0,0 +1,41 @@ | |||
1 | #!/bin/sh | ||
2 | DAEMON=/usr/sbin/vsftpd | ||
3 | NAME=vsftpd | ||
4 | DESC="FTP Server" | ||
5 | ARGS="" | ||
6 | FTPDIR=/var/lib/ftp | ||
7 | |||
8 | test -f $DAEMON || exit 0 | ||
9 | |||
10 | set -e | ||
11 | |||
12 | case "$1" in | ||
13 | start) | ||
14 | echo -n "* starting $DESC: $NAME... " | ||
15 | if ! test -d $FTPDIR; then | ||
16 | mkdir -p $FTPDIR/in | ||
17 | chown ftp $FTPDIR -R | ||
18 | chmod a-w $FTPDIR | ||
19 | chmod u+w $FTPDIR/in | ||
20 | fi | ||
21 | start-stop-daemon -S -b -x $DAEMON -- $ARGS | ||
22 | echo "done." | ||
23 | ;; | ||
24 | stop) | ||
25 | echo -n "* stopping $DESC: $NAME... " | ||
26 | start-stop-daemon -K -x $DAEMON | ||
27 | echo "done." | ||
28 | ;; | ||
29 | restart) | ||
30 | echo "* restarting $DESC: $NAME... " | ||
31 | $0 stop | ||
32 | $0 start | ||
33 | echo "done." | ||
34 | ;; | ||
35 | *) | ||
36 | echo "Usage: $0 {start|stop|restart}" | ||
37 | exit 1 | ||
38 | ;; | ||
39 | esac | ||
40 | |||
41 | exit 0 | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/files/volatiles.99_vsftpd b/meta-networking/recipes-daemons/vsftpd/files/volatiles.99_vsftpd new file mode 100644 index 0000000000..8a602ba37d --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/files/volatiles.99_vsftpd | |||
@@ -0,0 +1 @@ | |||
d root root 0755 /var/run/vsftpd/empty none | |||
diff --git a/meta-networking/recipes-daemons/vsftpd/files/vsftpd.conf b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.conf new file mode 100644 index 0000000000..bb1929480d --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.conf | |||
@@ -0,0 +1,139 @@ | |||
1 | # Example config file /etc/vsftpd.conf | ||
2 | # | ||
3 | # The default compiled in settings are fairly paranoid. This sample file | ||
4 | # loosens things up a bit, to make the ftp daemon more usable. | ||
5 | # Please see vsftpd.conf.5 for all compiled in defaults. | ||
6 | # | ||
7 | # READ THIS: This example file is NOT an exhaustive list of vsftpd options. | ||
8 | # Please read the vsftpd.conf.5 manual page to get a full idea of vsftpd's | ||
9 | # capabilities. | ||
10 | |||
11 | # run standalone | ||
12 | listen=YES | ||
13 | |||
14 | # Allow anonymous FTP? (Beware - allowed by default if you comment this out). | ||
15 | anonymous_enable=NO | ||
16 | # | ||
17 | # Uncomment this to allow local users to log in. | ||
18 | local_enable=YES | ||
19 | # | ||
20 | # Uncomment this to enable any form of FTP write command. | ||
21 | write_enable=YES | ||
22 | # | ||
23 | # Default umask for local users is 077. You may wish to change this to 022, | ||
24 | # if your users expect that (022 is used by most other ftpd's) | ||
25 | local_umask=022 | ||
26 | # | ||
27 | # Uncomment this to allow the anonymous FTP user to upload files. This only | ||
28 | # has an effect if the above global write enable is activated. Also, you will | ||
29 | # obviously need to create a directory writable by the FTP user. | ||
30 | #anon_upload_enable=YES | ||
31 | # | ||
32 | # Uncomment this if you want the anonymous FTP user to be able to create | ||
33 | # new directories. | ||
34 | #anon_mkdir_write_enable=YES | ||
35 | # | ||
36 | # Activate directory messages - messages given to remote users when they | ||
37 | # go into a certain directory. | ||
38 | dirmessage_enable=YES | ||
39 | # | ||
40 | # Activate logging of uploads/downloads. | ||
41 | xferlog_enable=YES | ||
42 | # | ||
43 | # Make sure PORT transfer connections originate from port 20 (ftp-data). | ||
44 | connect_from_port_20=YES | ||
45 | # | ||
46 | # If you want, you can arrange for uploaded anonymous files to be owned by | ||
47 | # a different user. Note! Using "root" for uploaded files is not | ||
48 | # recommended! | ||
49 | #chown_uploads=YES | ||
50 | #chown_username=whoever | ||
51 | # | ||
52 | # You may override where the log file goes if you like. The default is shown | ||
53 | # below. | ||
54 | #xferlog_file=/var/log/vsftpd.log | ||
55 | # | ||
56 | # If you want, you can have your log file in standard ftpd xferlog format | ||
57 | xferlog_std_format=YES | ||
58 | # | ||
59 | # You may change the default value for timing out an idle session. | ||
60 | #idle_session_timeout=600 | ||
61 | # | ||
62 | # You may change the default value for timing out a data connection. | ||
63 | #data_connection_timeout=120 | ||
64 | # | ||
65 | # It is recommended that you define on your system a unique user which the | ||
66 | # ftp server can use as a totally isolated and unprivileged user. | ||
67 | #nopriv_user=ftp | ||
68 | # | ||
69 | # Enable this and the server will recognise asynchronous ABOR requests. Not | ||
70 | # recommended for security (the code is non-trivial). Not enabling it, | ||
71 | # however, may confuse older FTP clients. | ||
72 | #async_abor_enable=YES | ||
73 | # | ||
74 | # By default the server will pretend to allow ASCII mode but in fact ignore | ||
75 | # the request. Turn on the below options to have the server actually do ASCII | ||
76 | # mangling on files when in ASCII mode. | ||
77 | # Beware that turning on ascii_download_enable enables malicious remote parties | ||
78 | # to consume your I/O resources, by issuing the command "SIZE /big/file" in | ||
79 | # ASCII mode. | ||
80 | # These ASCII options are split into upload and download because you may wish | ||
81 | # to enable ASCII uploads (to prevent uploaded scripts etc. from breaking), | ||
82 | # without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be | ||
83 | # on the client anyway.. | ||
84 | #ascii_upload_enable=YES | ||
85 | #ascii_download_enable=YES | ||
86 | # | ||
87 | # You may fully customise the login banner string: | ||
88 | #ftpd_banner=Welcome to blah FTP service. | ||
89 | # | ||
90 | # You may specify a file of disallowed anonymous e-mail addresses. Apparently | ||
91 | # useful for combatting certain DoS attacks. | ||
92 | #deny_email_enable=YES | ||
93 | # (default follows) | ||
94 | #banned_email_file=/etc/vsftpd.banned_emails | ||
95 | # | ||
96 | # You may specify an explicit list of local users to chroot() to their home | ||
97 | # directory. If chroot_local_user is YES, then this list becomes a list of | ||
98 | # users to NOT chroot(). | ||
99 | #chroot_list_enable=YES | ||
100 | # (default follows) | ||
101 | #chroot_list_file=/etc/vsftpd.chroot_list | ||
102 | # | ||
103 | # You may activate the "-R" option to the builtin ls. This is disabled by | ||
104 | # default to avoid remote users being able to cause excessive I/O on large | ||
105 | # sites. However, some broken FTP clients such as "ncftp" and "mirror" assume | ||
106 | # the presence of the "-R" option, so there is a strong case for enabling it. | ||
107 | #ls_recurse_enable=YES | ||
108 | # | ||
109 | # This string is the name of the PAM service vsftpd will use. | ||
110 | pam_service_name=vsftpd | ||
111 | # | ||
112 | # This option is examined if userlist_enable is activated. If you set this | ||
113 | # setting to NO, then users will be denied login unless they are explicitly | ||
114 | # listed in the file specified by userlist_file. When login is denied, the | ||
115 | # denial is issued before the user is asked for a password. | ||
116 | userlist_deny=YES | ||
117 | # | ||
118 | # If enabled, vsftpd will load a list of usernames, from the filename given by | ||
119 | # userlist_file. If a user tries to log in using a name in this file, they | ||
120 | # will be denied before they are asked for a password. This may be useful in | ||
121 | # preventing cleartext passwords being transmitted. See also userlist_deny. | ||
122 | userlist_enable=YES | ||
123 | # | ||
124 | # If enabled, vsftpd will display directory listings with the time in your | ||
125 | # local time zone. The default is to display GMT. The times returned by the | ||
126 | # MDTM FTP command are also affected by this option. | ||
127 | use_localtime=YES | ||
128 | # | ||
129 | # If set to YES, local users will be (by default) placed in a chroot() jail in | ||
130 | # their home directory after login. Warning: This option has security | ||
131 | # implications, especially if the users have upload permission, or shell access. | ||
132 | # Only enable if you know what you are doing. Note that these security implications | ||
133 | # are not vsftpd specific. They apply to all FTP daemons which offer to put | ||
134 | # local users in chroot() jails. | ||
135 | chroot_local_user=YES | ||
136 | # | ||
137 | allow_writeable_chroot=YES | ||
138 | # | ||
139 | tcp_wrappers=YES | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/files/vsftpd.ftpusers b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.ftpusers new file mode 100644 index 0000000000..096142f5df --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.ftpusers | |||
@@ -0,0 +1,15 @@ | |||
1 | # Users that are not allowed to login via ftp | ||
2 | root | ||
3 | bin | ||
4 | daemon | ||
5 | adm | ||
6 | lp | ||
7 | sync | ||
8 | shutdown | ||
9 | halt | ||
10 | |||
11 | news | ||
12 | uucp | ||
13 | operator | ||
14 | games | ||
15 | nobody | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/files/vsftpd.user_list b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.user_list new file mode 100644 index 0000000000..d283e3d260 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/files/vsftpd.user_list | |||
@@ -0,0 +1,20 @@ | |||
1 | # vsftpd userlist | ||
2 | # If userlist_deny=NO, only allow users in this file | ||
3 | # If userlist_deny=YES (default), never allow users in this file, and | ||
4 | # do not even prompt for a password. | ||
5 | # Note that the default vsftpd pam config also checks /etc/vsftpd.ftpusers | ||
6 | # for users that are denied. | ||
7 | root | ||
8 | bin | ||
9 | daemon | ||
10 | adm | ||
11 | lp | ||
12 | sync | ||
13 | shutdown | ||
14 | halt | ||
15 | |||
16 | news | ||
17 | uucp | ||
18 | operator | ||
19 | games | ||
20 | nobody | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/makefile-destdir.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/makefile-destdir.patch new file mode 100644 index 0000000000..1980d09fd4 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/makefile-destdir.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | Use DESTDIR within install to allow installing under a prefix | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
6 | |||
7 | diff --git a/Makefile b/Makefile | ||
8 | --- a/Makefile | ||
9 | +++ b/Makefile | ||
10 | @@ -24,21 +24,21 @@ | ||
11 | $(CC) -o vsftpd $(OBJS) $(LINK) $(LIBS) | ||
12 | |||
13 | install: | ||
14 | - if [ -x /usr/local/sbin ]; then \ | ||
15 | - $(INSTALL) -m 755 vsftpd /usr/local/sbin/vsftpd; \ | ||
16 | + if [ -x ${DESTDIR}/usr/local/sbin ]; then \ | ||
17 | + $(INSTALL) -m 755 vsftpd ${DESTDIR}/usr/local/sbin/vsftpd; \ | ||
18 | else \ | ||
19 | - $(INSTALL) -m 755 vsftpd /usr/sbin/vsftpd; fi | ||
20 | - if [ -x /usr/local/man ]; then \ | ||
21 | - $(INSTALL) -m 644 vsftpd.8 /usr/local/man/man8/vsftpd.8; \ | ||
22 | - $(INSTALL) -m 644 vsftpd.conf.5 /usr/local/man/man5/vsftpd.conf.5; \ | ||
23 | - elif [ -x /usr/share/man ]; then \ | ||
24 | - $(INSTALL) -m 644 vsftpd.8 /usr/share/man/man8/vsftpd.8; \ | ||
25 | - $(INSTALL) -m 644 vsftpd.conf.5 /usr/share/man/man5/vsftpd.conf.5; \ | ||
26 | + $(INSTALL) -m 755 vsftpd ${DESTDIR}/usr/sbin/vsftpd; fi | ||
27 | + if [ -x ${DESTDIR}/usr/local/man ]; then \ | ||
28 | + $(INSTALL) -m 644 vsftpd.8 ${DESTDIR}/usr/local/man/man8/vsftpd.8; \ | ||
29 | + $(INSTALL) -m 644 vsftpd.conf.5 ${DESTDIR}/usr/local/man/man5/vsftpd.conf.5; \ | ||
30 | + elif [ -x ${DESTDIR}/usr/share/man ]; then \ | ||
31 | + $(INSTALL) -m 644 vsftpd.8 ${DESTDIR}/usr/share/man/man8/vsftpd.8; \ | ||
32 | + $(INSTALL) -m 644 vsftpd.conf.5 ${DESTDIR}/usr/share/man/man5/vsftpd.conf.5; \ | ||
33 | else \ | ||
34 | - $(INSTALL) -m 644 vsftpd.8 /usr/man/man8/vsftpd.8; \ | ||
35 | - $(INSTALL) -m 644 vsftpd.conf.5 /usr/man/man5/vsftpd.conf.5; fi | ||
36 | - if [ -x /etc/xinetd.d ]; then \ | ||
37 | - $(INSTALL) -m 644 xinetd.d/vsftpd /etc/xinetd.d/vsftpd; fi | ||
38 | + $(INSTALL) -m 644 vsftpd.8 ${DESTDIR}/usr/man/man8/vsftpd.8; \ | ||
39 | + $(INSTALL) -m 644 vsftpd.conf.5 ${DESTDIR}/usr/man/man5/vsftpd.conf.5; fi | ||
40 | + if [ -x ${DESTDIR}/etc/xinetd.d ]; then \ | ||
41 | + $(INSTALL) -m 644 xinetd.d/vsftpd ${DESTDIR}/etc/xinetd.d/vsftpd; fi | ||
42 | |||
43 | clean: | ||
44 | rm -f *.o *.swp vsftpd | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/makefile-libs.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/makefile-libs.patch new file mode 100644 index 0000000000..9a10f722f4 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/makefile-libs.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | Hardcode LIBS instead of using a script to determine available libs | ||
2 | |||
3 | We want to avoid this dynamic detection so we have a deterministic | ||
4 | build. | ||
5 | |||
6 | Upstream-Status: Inappropriate [config] | ||
7 | |||
8 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
9 | |||
10 | diff --git a/Makefile b/Makefile | ||
11 | --- a/Makefile | ||
12 | +++ b/Makefile | ||
13 | @@ -5,7 +5,7 @@ | ||
14 | #CFLAGS = -g | ||
15 | CFLAGS = -O2 -Wall -W -Wshadow #-pedantic -Werror -Wconversion | ||
16 | |||
17 | -LIBS = `./vsf_findlibs.sh` | ||
18 | +LIBS = -lssl -lcrypto -lnsl -lresolv | ||
19 | LINK = -Wl,-s | ||
20 | |||
21 | OBJS = main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o \ | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/makefile-strip.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/makefile-strip.patch new file mode 100644 index 0000000000..fd3160037f --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/makefile-strip.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | Disable stripping at link time | ||
2 | |||
3 | Upstream-Status: Inappropriate [config] | ||
4 | |||
5 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
6 | |||
7 | diff --git a/Makefile b/Makefile | ||
8 | --- a/Makefile | ||
9 | +++ b/Makefile | ||
10 | @@ -9,7 +9,6 @@ CFLAGS = -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 \ | ||
11 | #-pedantic -Wconversion | ||
12 | |||
13 | LIBS = -lssl -lcrypto -lnsl -lresolv | ||
14 | -LINK = -Wl,-s | ||
15 | LDFLAGS = -fPIE -pie -Wl,-z,relro -Wl,-z,now | ||
16 | |||
17 | OBJS = main.o utility.o prelogin.o ftpcmdio.o postlogin.o privsock.o \ | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/nopam-with-tcp_wrappers.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/nopam-with-tcp_wrappers.patch new file mode 100644 index 0000000000..fdcf3a02b6 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/nopam-with-tcp_wrappers.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | Disable PAM | ||
2 | |||
3 | Upstream-Status: Inappropriate [config] | ||
4 | |||
5 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
6 | diff -ur vsftpd-2.0.1_org/builddefs.h vsftpd-2.0.1_patch/builddefs.h | ||
7 | --- vsftpd-2.0.1_org/builddefs.h 2004-07-02 16:36:59.000000000 +0200 | ||
8 | +++ vsftpd-2.0.1_patch/builddefs.h 2004-07-21 09:34:49.044900488 +0200 | ||
9 | @@ -2,7 +2,7 @@ | ||
10 | #define VSF_BUILDDEFS_H | ||
11 | |||
12 | #define VSF_BUILD_TCPWRAPPERS | ||
13 | -#define VSF_BUILD_PAM | ||
14 | +#undef VSF_BUILD_PAM | ||
15 | #undef VSF_BUILD_SSL | ||
16 | |||
17 | #endif /* VSF_BUILDDEFS_H */ | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/nopam.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/nopam.patch new file mode 100644 index 0000000000..cf0d68e272 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/nopam.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | Disable PAM | ||
2 | |||
3 | Upstream-Status: Inappropriate [config] | ||
4 | |||
5 | diff -ur vsftpd-2.0.1_org/builddefs.h vsftpd-2.0.1_patch/builddefs.h | ||
6 | --- vsftpd-2.0.1_org/builddefs.h 2004-07-02 16:36:59.000000000 +0200 | ||
7 | +++ vsftpd-2.0.1_patch/builddefs.h 2004-07-21 09:34:49.044900488 +0200 | ||
8 | @@ -2,7 +2,7 @@ | ||
9 | #define VSF_BUILDDEFS_H | ||
10 | |||
11 | #undef VSF_BUILD_TCPWRAPPERS | ||
12 | -#define VSF_BUILD_PAM | ||
13 | +#undef VSF_BUILD_PAM | ||
14 | #undef VSF_BUILD_SSL | ||
15 | |||
16 | #endif /* VSF_BUILDDEFS_H */ | ||
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/vsftpd-tcp_wrappers-support.patch b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/vsftpd-tcp_wrappers-support.patch new file mode 100644 index 0000000000..69745b3a10 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd-3.0.0/vsftpd-tcp_wrappers-support.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | Enable tcp_wrapper. | ||
2 | |||
3 | Upstream-Status: Inappropriate [configuration] | ||
4 | |||
5 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
6 | --- | ||
7 | builddefs.h | 2 +- | ||
8 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
9 | |||
10 | diff --git a/builddefs.h b/builddefs.h | ||
11 | index e908352..0106d1a 100644 | ||
12 | --- a/builddefs.h | ||
13 | +++ b/builddefs.h | ||
14 | @@ -1,7 +1,7 @@ | ||
15 | #ifndef VSF_BUILDDEFS_H | ||
16 | #define VSF_BUILDDEFS_H | ||
17 | |||
18 | -#undef VSF_BUILD_TCPWRAPPERS | ||
19 | +#define VSF_BUILD_TCPWRAPPERS | ||
20 | #define VSF_BUILD_PAM | ||
21 | #undef VSF_BUILD_SSL | ||
22 | |||
23 | -- | ||
24 | 1.7.1 | ||
25 | |||
diff --git a/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.0.bb b/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.0.bb new file mode 100644 index 0000000000..0698a63258 --- /dev/null +++ b/meta-networking/recipes-daemons/vsftpd/vsftpd_3.0.0.bb | |||
@@ -0,0 +1,84 @@ | |||
1 | SUMMARY = "Very Secure FTP server" | ||
2 | HOMEPAGE = "https://security.appspot.com/vsftpd.html" | ||
3 | SECTION = "network" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271" | ||
6 | |||
7 | DEPENDS = "libcap openssl" | ||
8 | |||
9 | SRC_URI = "https://security.appspot.com/downloads/vsftpd-${PV}.tar.gz \ | ||
10 | file://makefile-destdir.patch \ | ||
11 | file://makefile-libs.patch \ | ||
12 | file://makefile-strip.patch \ | ||
13 | file://init \ | ||
14 | file://vsftpd.conf \ | ||
15 | file://vsftpd.user_list \ | ||
16 | file://vsftpd.ftpusers \ | ||
17 | file://change-secure_chroot_dir.patch \ | ||
18 | file://volatiles.99_vsftpd \ | ||
19 | " | ||
20 | |||
21 | LIC_FILES_CHKSUM = "file://COPYING;md5=a6067ad950b28336613aed9dd47b1271 \ | ||
22 | file://COPYRIGHT;md5=04251b2eb0f298dae376d92454f6f72e \ | ||
23 | file://LICENSE;md5=654df2042d44b8cac8a5654fc5be63eb" | ||
24 | SRC_URI[md5sum] = "ad9fa952558c2c5b0426ccaccff0f972" | ||
25 | SRC_URI[sha256sum] = "ef70205dcd0c7f03b008b9578fb44c0cbe31e66daab8cfafb9904747c17fc2a8" | ||
26 | |||
27 | PACKAGECONFIG ??= "tcp-wrappers" | ||
28 | PACKAGECONFIG[tcp-wrappers] = ",,tcp-wrappers" | ||
29 | SRC_URI +="${@base_contains('PACKAGECONFIG', 'tcp-wrappers', 'file://vsftpd-tcp_wrappers-support.patch', '', d)}" | ||
30 | |||
31 | DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" | ||
32 | RDEPENDS_${PN} += "${@base_contains('DISTRO_FEATURES', 'pam', 'pam-plugin-listfile', '', d)}" | ||
33 | PAMLIB = "${@base_contains('DISTRO_FEATURES', 'pam', '-L${STAGING_BASELIBDIR} -lpam', '', d)}" | ||
34 | NOPAM_SRC ="${@base_contains('PACKAGECONFIG', 'tcp-wrappers', 'file://nopam-with-tcp_wrappers.patch', 'file://nopam.patch', d)}" | ||
35 | SRC_URI += "${@base_contains('DISTRO_FEATURES', 'pam', '', '${NOPAM_SRC}', d)}" | ||
36 | |||
37 | inherit update-rc.d useradd | ||
38 | |||
39 | CONFFILES_${PN} = "${sysconfdir}/vsftpd.conf" | ||
40 | LDFLAGS_append =" -lcrypt -lcap" | ||
41 | |||
42 | do_configure() { | ||
43 | # Fix hardcoded /usr, /etc, /var mess. | ||
44 | cat tunables.c|sed s:\"/usr:\"${prefix}:g|sed s:\"/var:\"${localstatedir}:g \ | ||
45 | |sed s:\"/etc:\"${sysconfdir}:g > tunables.c.new | ||
46 | mv tunables.c.new tunables.c | ||
47 | } | ||
48 | |||
49 | do_compile() { | ||
50 | oe_runmake "LIBS=-L${STAGING_LIBDIR} -lcrypt -lcap ${PAMLIB} -lwrap" | ||
51 | } | ||
52 | |||
53 | do_install() { | ||
54 | install -d ${D}${sbindir} | ||
55 | install -d ${D}${mandir}/man8 | ||
56 | install -d ${D}${mandir}/man5 | ||
57 | oe_runmake 'DESTDIR=${D}' install | ||
58 | install -d ${D}${sysconfdir} | ||
59 | install -m 600 ${WORKDIR}/vsftpd.conf ${D}${sysconfdir}/vsftpd.conf | ||
60 | install -d ${D}${sysconfdir}/init.d/ | ||
61 | install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/vsftpd | ||
62 | install -d ${D}/${sysconfdir}/default/volatiles | ||
63 | install -m 644 ${WORKDIR}/volatiles.99_vsftpd ${D}/${sysconfdir}/default/volatiles/99_vsftpd | ||
64 | |||
65 | install -m 600 ${WORKDIR}/vsftpd.ftpusers ${D}${sysconfdir}/ | ||
66 | install -m 600 ${WORKDIR}/vsftpd.user_list ${D}${sysconfdir}/ | ||
67 | if ! test -z "${PAMLIB}" ; then | ||
68 | install -d ${D}${sysconfdir}/pam.d/ | ||
69 | cp ${S}/RedHat/vsftpd.pam ${D}${sysconfdir}/pam.d/vsftpd | ||
70 | sed -i "s:/lib/security:${base_libdir}/security:" ${D}${sysconfdir}/pam.d/vsftpd | ||
71 | sed -i "s:ftpusers:vsftpd.ftpusers:" ${D}${sysconfdir}/pam.d/vsftpd | ||
72 | fi | ||
73 | install -d ${D}${localstatedir}/run/vsftpd/empty | ||
74 | } | ||
75 | |||
76 | INITSCRIPT_PACKAGES = "${PN}" | ||
77 | INITSCRIPT_NAME_${PN} = "vsftpd" | ||
78 | INITSCRIPT_PARAMS_${PN} = "defaults 80" | ||
79 | |||
80 | USERADD_PACKAGES = "${PN}" | ||
81 | USERADD_PARAM_${PN} = "--system --home-dir /var/lib/ftp --no-create-home -g ftp \ | ||
82 | --shell /bin/false ftp " | ||
83 | GROUPADD_PARAM_${PN} = "-r ftp" | ||
84 | |||
diff --git a/meta-networking/recipes-filter/conntrack-tools/conntrack-tools_1.4.0.bb b/meta-networking/recipes-filter/conntrack-tools/conntrack-tools_1.4.0.bb new file mode 100644 index 0000000000..907a3bec57 --- /dev/null +++ b/meta-networking/recipes-filter/conntrack-tools/conntrack-tools_1.4.0.bb | |||
@@ -0,0 +1,32 @@ | |||
1 | SUMMARY = "Connection tracking userspace tools for Linux" | ||
2 | LICENSE = "GPLv2+" | ||
3 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
4 | DEPENDS = "libnfnetlink libnetfilter-conntrack libnetfilter-cttimeout \ | ||
5 | libnetfilter-cthelper libnetfilter-queue" | ||
6 | |||
7 | |||
8 | SRC_URI = " \ | ||
9 | http://www.netfilter.org/projects/conntrack-tools/files/conntrack-tools-${PV}.tar.bz2;name=tar \ | ||
10 | file://conntrack-failover \ | ||
11 | file://init \ | ||
12 | " | ||
13 | SRC_URI[tar.md5sum] = "ee737c774e01349f75e935228a2d851b" | ||
14 | SRC_URI[tar.sha256sum] = "036b032a5c4d180aad686df21399d74506b9b3d3000794eb13ac313482e24896" | ||
15 | |||
16 | inherit autotools update-rc.d | ||
17 | |||
18 | INITSCRIPT_NAME = "conntrackd" | ||
19 | |||
20 | do_install_append() { | ||
21 | install -d ${D}/${sysconfdir}/conntrackd | ||
22 | install -d ${D}/${sysconfdir}/init.d | ||
23 | install -m 0644 doc/sync/ftfw/conntrackd.conf ${D}/${sysconfdir}/conntrackd/conntrackd.conf.sample | ||
24 | install -m 0755 ${WORKDIR}/conntrack-failover ${D}/${sysconfdir}/init.d/conntrack-failover | ||
25 | install -m 0755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/conntrackd | ||
26 | |||
27 | # Fix hardcoded paths in scripts | ||
28 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}/${sysconfdir}/init.d/conntrack-failover ${D}/${sysconfdir}/init.d/conntrackd | ||
29 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}/${sysconfdir}/init.d/conntrack-failover ${D}/${sysconfdir}/init.d/conntrackd | ||
30 | sed -i 's!/var/!${localstatedir}/!g' ${D}/${sysconfdir}/init.d/conntrack-failover ${D}/${sysconfdir}/init.d/conntrackd ${D}/${sysconfdir}/conntrackd/conntrackd.conf.sample | ||
31 | sed -i 's!^export PATH=.*!export PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}/${sysconfdir}/init.d/conntrackd | ||
32 | } | ||
diff --git a/meta-networking/recipes-filter/conntrack-tools/files/conntrack-failover b/meta-networking/recipes-filter/conntrack-tools/files/conntrack-failover new file mode 100644 index 0000000000..6d92e637ff --- /dev/null +++ b/meta-networking/recipes-filter/conntrack-tools/files/conntrack-failover | |||
@@ -0,0 +1,77 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # (C) 2008 by Pablo Neira Ayuso <pablo@netfilter.org> | ||
4 | # (C) 2009 Roman I Khimov <khimov@altell.ru> | ||
5 | # | ||
6 | # This software may be used and distributed according to the terms | ||
7 | # of the GNU General Public License, incorporated herein by reference. | ||
8 | # | ||
9 | # Description: | ||
10 | # | ||
11 | # This is the script for primary-backup setups for keepalived | ||
12 | # (http://www.keepalived.org). You may adapt it to make it work with other | ||
13 | # high-availability managers. | ||
14 | # | ||
15 | # Do not forget to include the required modifications to your keepalived.conf | ||
16 | # file to invoke this script during keepalived's state transitions. | ||
17 | # | ||
18 | # Contributions to improve this script are welcome :). | ||
19 | # | ||
20 | ## Modified to work as init.d script under pacemaker control | ||
21 | |||
22 | CONNTRACKD_BIN=/usr/sbin/conntrackd | ||
23 | CONNTRACKD_LOCK=/var/lock/conntrack.lock | ||
24 | CONNTRACKD_CONFIG=/etc/conntrackd/conntrackd.conf | ||
25 | |||
26 | case "$1" in | ||
27 | start) | ||
28 | # | ||
29 | # commit the external cache into the kernel table | ||
30 | # | ||
31 | $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -c | ||
32 | if [ $? -eq 1 ] | ||
33 | then | ||
34 | logger "ERROR: failed to invoke conntrackd -c" | ||
35 | fi | ||
36 | |||
37 | # | ||
38 | # flush the internal and the external caches | ||
39 | # | ||
40 | $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -f | ||
41 | if [ $? -eq 1 ] | ||
42 | then | ||
43 | logger "ERROR: failed to invoke conntrackd -f" | ||
44 | fi | ||
45 | |||
46 | # | ||
47 | # resynchronize my internal cache to the kernel table | ||
48 | # | ||
49 | $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -R | ||
50 | if [ $? -eq 1 ] | ||
51 | then | ||
52 | logger "ERROR: failed to invoke conntrackd -R" | ||
53 | fi | ||
54 | |||
55 | # | ||
56 | # send a bulk update to backups | ||
57 | # | ||
58 | $CONNTRACKD_BIN -C $CONNTRACKD_CONFIG -B | ||
59 | if [ $? -eq 1 ] | ||
60 | then | ||
61 | logger "ERROR: failed to invoke conntrackd -B" | ||
62 | fi | ||
63 | ;; | ||
64 | stop) | ||
65 | $CONNTRACKD_BIN -t | ||
66 | $CONNTRACKD_BIN -n | ||
67 | ;; | ||
68 | status) | ||
69 | ;; | ||
70 | *) | ||
71 | logger "ERROR: unknown command" | ||
72 | echo "Usage: conntrack-failover {start|stop|status}" | ||
73 | exit 1 | ||
74 | ;; | ||
75 | esac | ||
76 | |||
77 | exit 0 | ||
diff --git a/meta-networking/recipes-filter/conntrack-tools/files/init b/meta-networking/recipes-filter/conntrack-tools/files/init new file mode 100644 index 0000000000..bce2075a72 --- /dev/null +++ b/meta-networking/recipes-filter/conntrack-tools/files/init | |||
@@ -0,0 +1,87 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # /etc/init.d/conntrackd | ||
4 | # | ||
5 | # Maximilian Wilhelm <max@rfc2324.org> | ||
6 | # -- Mon, 06 Nov 2006 18:39:07 +0100 | ||
7 | # | ||
8 | # Roman I Khimov <khimov@altell.ru> | ||
9 | # -- Tue, 27 Oct 2009 14:34:00 +0300 | ||
10 | |||
11 | ### BEGIN INIT INFO | ||
12 | # Provides: conntrackd | ||
13 | # Required-Start: $remote_fs $syslog | ||
14 | # Required-Stop: $remote_fs $syslog | ||
15 | # Default-Start: 2 3 4 5 | ||
16 | # Default-Stop: 0 1 6 | ||
17 | # Description: Starts conntrackd | ||
18 | # short-description: Starts conntrackd | ||
19 | ### END INIT INFO | ||
20 | |||
21 | export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
22 | |||
23 | NAME="conntrackd" | ||
24 | DAEMON="/usr/sbin/conntrackd" | ||
25 | CONFIG="/etc/conntrackd/conntrackd.conf" | ||
26 | PIDFILE="/var/run/${NAME}.pid" | ||
27 | |||
28 | |||
29 | # Gracefully exit if there is no daemon (debian way of life) | ||
30 | if [ ! -x "${DAEMON}" ]; then | ||
31 | exit 0 | ||
32 | fi | ||
33 | |||
34 | # Check for config file | ||
35 | if [ ! -f /etc/conntrackd/conntrackd.conf ]; then | ||
36 | echo "Error: There is no config file for $NAME" >&2 | ||
37 | exit 1; | ||
38 | fi | ||
39 | |||
40 | case "$1" in | ||
41 | start) | ||
42 | echo -n "Starting $NAME: " | ||
43 | for i in nf_conntrack_netlink nf_conntrack_netbios_ns nf_conntrack_proto_dccp nf_conntrack_tftp \ | ||
44 | nf_conntrack_sane nf_conntrack_pptp nf_conntrack_irc nf_conntrack_amanda nf_conntrack_h323 \ | ||
45 | nf_conntrack_proto_udplite nf_conntrack_proto_gre nf_conntrack_proto_sctp nf_conntrack_ftp \ | ||
46 | nf_conntrack_sip; do | ||
47 | modprobe $i >/dev/null 2>/dev/null & | ||
48 | done | ||
49 | start-stop-daemon --start --quiet --make-pidfile --pidfile "/var/run/${NAME}.pid" --background --exec "${DAEMON}" | ||
50 | RET=$? | ||
51 | if [ "$?" = "0" ]; then | ||
52 | sleep 2 | ||
53 | # Sync with other server | ||
54 | conntrackd -n | ||
55 | echo "done." | ||
56 | else | ||
57 | echo "FAILED!" | ||
58 | fi | ||
59 | exit $RET | ||
60 | ;; | ||
61 | stop) | ||
62 | echo -n "Stopping $NAME:" | ||
63 | start-stop-daemon --stop --quiet --oknodo --pidfile "/var/run/${NAME}.pid" && echo "done." || echo "FAILED!" | ||
64 | ;; | ||
65 | status) | ||
66 | echo -n "conntrackd " | ||
67 | start-stop-daemon -q -K -t -x $DAEMON | ||
68 | RET=$? | ||
69 | if [ "$RET" = "0" ]; then | ||
70 | PID=`cat $PIDFILE` | ||
71 | echo "($PID) is running" | ||
72 | else | ||
73 | echo "is not running" | ||
74 | exit $RET | ||
75 | fi | ||
76 | ;; | ||
77 | restart) | ||
78 | $0 stop | ||
79 | $0 start | ||
80 | ;; | ||
81 | |||
82 | *) | ||
83 | echo "Usage: /etc/init.d/conntrackd {start|stop|restart}" | ||
84 | exit 1 | ||
85 | esac | ||
86 | |||
87 | exit 0 | ||
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/01debian_defaultconfig.patch b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/01debian_defaultconfig.patch new file mode 100644 index 0000000000..c260403eaf --- /dev/null +++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/01debian_defaultconfig.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | #! /bin/sh /usr/share/dpatch/dpatch-run | ||
2 | ## debian_defaultconfig.dpatch by <hesso@pool.math.tu-berlin.de> | ||
3 | ## | ||
4 | ## DP: Debian enhancements to the ebtables "sysconfig" default settings. | ||
5 | |||
6 | @DPATCH@ | ||
7 | |||
8 | --- ebtables-2.0.8.1.orig/ebtables-config | ||
9 | +++ ebtables-2.0.8.1/ebtables-config | ||
10 | @@ -1,17 +1,3 @@ | ||
11 | -# Save (and possibly restore) in text format. | ||
12 | -# Value: yes|no, default: yes | ||
13 | -# Save the firewall rules in text format to __SYSCONFIG__/ebtables | ||
14 | -# If EBTABLES_BINARY_FORMAT="no" then restoring the firewall rules | ||
15 | -# is done using this text format. | ||
16 | -EBTABLES_TEXT_FORMAT="yes" | ||
17 | - | ||
18 | -# Save (and restore) in binary format. | ||
19 | -# Value: yes|no, default: yes | ||
20 | -# Save (and restore) the firewall rules in binary format to (and from) | ||
21 | -# __SYSCONFIG__/ebtables.<chain>. Enabling this option will make | ||
22 | -# firewall initialisation a lot faster. | ||
23 | -EBTABLES_BINARY_FORMAT="yes" | ||
24 | - | ||
25 | # Unload modules on restart and stop | ||
26 | # Value: yes|no, default: yes | ||
27 | # This option has to be 'yes' to get to a sane state for a firewall | ||
28 | @@ -19,6 +5,12 @@ | ||
29 | # modules. | ||
30 | EBTABLES_MODULES_UNLOAD="yes" | ||
31 | |||
32 | +# Load firewall rules on system startup. | ||
33 | +# Value: yes|no, default: no | ||
34 | +# Restores the ebtables rulesets from the last saved state when the | ||
35 | +# system boots up. | ||
36 | +EBTABLES_LOAD_ON_START="no" | ||
37 | + | ||
38 | # Save current firewall rules on stop. | ||
39 | # Value: yes|no, default: no | ||
40 | # Saves all firewall rules if firewall gets stopped | ||
41 | @@ -35,3 +27,9 @@ | ||
42 | # Save rule counters when saving a kernel table to a file. If the | ||
43 | # rule counters were saved, they will be restored when restoring the table. | ||
44 | EBTABLES_SAVE_COUNTER="no" | ||
45 | + | ||
46 | +# Backup suffix for ruleset save files. | ||
47 | +# Value: <string>, default: "~" | ||
48 | +# Keep one backup level of saved rules. | ||
49 | +# Set this variable to the empty string to disable backups. | ||
50 | +EBTABLES_BACKUP_SUFFIX="~" | ||
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.init b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.init new file mode 100755 index 0000000000..0044e9825e --- /dev/null +++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/ebtables.init | |||
@@ -0,0 +1,186 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # init script for the Ethernet Bridge filter tables | ||
4 | # | ||
5 | # Written by Dag Wieers <dag@wieers.com> | ||
6 | # Modified by Rok Papez <rok.papez@arnes.si> | ||
7 | # Bart De Schuymer <bdschuym@pandora.be> | ||
8 | # Adapted to Debian by Jan Christoph Nordholz <hesso@pool.math.tu-berlin.de> | ||
9 | # Adapted to OpenEmbedded by Roman I Khimov <khimov@altell.ru> | ||
10 | # | ||
11 | # chkconfig: - 15 85 | ||
12 | # description: Ethernet Bridge filtering tables | ||
13 | # | ||
14 | ### BEGIN INIT INFO | ||
15 | # Provides: ebtables | ||
16 | # Required-Start: | ||
17 | # Required-Stop: | ||
18 | # Should-Start: $local_fs | ||
19 | # Should-Stop: $local_fs | ||
20 | # Default-Start: S | ||
21 | # Default-Stop: 0 6 | ||
22 | # Short-Description: ebtables ruleset management | ||
23 | # Description: Saves and restores the state of the ebtables rulesets. | ||
24 | ### END INIT INFO | ||
25 | |||
26 | [ -x /sbin/ebtables ] || exit 1 | ||
27 | |||
28 | EBTABLES_DUMPFILE_STEM=/etc/ebtables/dump | ||
29 | |||
30 | RETVAL=0 | ||
31 | prog="ebtables" | ||
32 | desc="Ethernet bridge filtering" | ||
33 | umask 0077 | ||
34 | |||
35 | #default configuration | ||
36 | EBTABLES_MODULES_UNLOAD="yes" | ||
37 | EBTABLES_LOAD_ON_START="no" | ||
38 | EBTABLES_SAVE_ON_STOP="no" | ||
39 | EBTABLES_SAVE_ON_RESTART="no" | ||
40 | EBTABLES_SAVE_COUNTER="no" | ||
41 | EBTABLES_BACKUP_SUFFIX="~" | ||
42 | |||
43 | config=/etc/default/$prog | ||
44 | [ -f "$config" ] && . "$config" | ||
45 | |||
46 | function get_supported_tables() { | ||
47 | EBTABLES_SUPPORTED_TABLES= | ||
48 | /sbin/ebtables -t filter -L 2>&1 1>/dev/null | grep -q permission | ||
49 | if [ $? -eq 0 ]; then | ||
50 | echo "Error: insufficient privileges to access the ebtables rulesets." | ||
51 | exit 1 | ||
52 | fi | ||
53 | for table in filter nat broute; do | ||
54 | /sbin/ebtables -t $table -L &> /dev/null | ||
55 | if [ $? -eq 0 ]; then | ||
56 | EBTABLES_SUPPORTED_TABLES="${EBTABLES_SUPPORTED_TABLES} $table" | ||
57 | fi | ||
58 | done | ||
59 | } | ||
60 | |||
61 | function load() { | ||
62 | RETVAL=0 | ||
63 | get_supported_tables | ||
64 | echo -n "Restoring ebtables rulesets: " | ||
65 | for table in $EBTABLES_SUPPORTED_TABLES; do | ||
66 | echo -n "$table " | ||
67 | if [ -s ${EBTABLES_DUMPFILE_STEM}.$table ]; then | ||
68 | /sbin/ebtables -t $table --atomic-file ${EBTABLES_DUMPFILE_STEM}.$table --atomic-commit | ||
69 | RET=$? | ||
70 | if [ $RET -ne 0 ]; then | ||
71 | echo -n "(failed) " | ||
72 | RETVAL=$RET | ||
73 | fi | ||
74 | else | ||
75 | echo -n "(no saved state) " | ||
76 | fi | ||
77 | done | ||
78 | if [ -z "$EBTABLES_SUPPORTED_TABLES" ]; then | ||
79 | echo -n "no kernel support. " | ||
80 | else | ||
81 | echo -n "done. " | ||
82 | fi | ||
83 | if [ $RETVAL -eq 0 ]; then | ||
84 | echo "ok" | ||
85 | else | ||
86 | echo "fail" | ||
87 | fi | ||
88 | } | ||
89 | |||
90 | function clear() { | ||
91 | RETVAL=0 | ||
92 | get_supported_tables | ||
93 | echo -n "Clearing ebtables rulesets: " | ||
94 | for table in $EBTABLES_SUPPORTED_TABLES; do | ||
95 | echo -n "$table " | ||
96 | /sbin/ebtables -t $table --init-table | ||
97 | done | ||
98 | |||
99 | if [ "$EBTABLES_MODULES_UNLOAD" = "yes" ]; then | ||
100 | for mod in $(grep -E '^(ebt|ebtable)_' /proc/modules | cut -d' ' -f1) ebtables; do | ||
101 | rmmod $mod 2> /dev/null | ||
102 | done | ||
103 | fi | ||
104 | if [ -z "$EBTABLES_SUPPORTED_TABLES" ]; then | ||
105 | echo -n "no kernel support. " | ||
106 | else | ||
107 | echo -n "done. " | ||
108 | fi | ||
109 | if [ $RETVAL -eq 0 ]; then | ||
110 | echo "ok" | ||
111 | else | ||
112 | echo "fail" | ||
113 | fi | ||
114 | } | ||
115 | |||
116 | function save() { | ||
117 | RETVAL=0 | ||
118 | get_supported_tables | ||
119 | echo -n "Saving ebtables rulesets: " | ||
120 | for table in $EBTABLES_SUPPORTED_TABLES; do | ||
121 | echo -n "$table " | ||
122 | [ -n "$EBTABLES_BACKUP_SUFFIX" ] && [ -s ${EBTABLES_DUMPFILE_STEM}.$table ] && \ | ||
123 | mv ${EBTABLES_DUMPFILE_STEM}.$table ${EBTABLES_DUMPFILE_STEM}.$table$EBTABLES_BACKUP_SUFFIX | ||
124 | /sbin/ebtables -t $table --atomic-file ${EBTABLES_DUMPFILE_STEM}.$table --atomic-save | ||
125 | RET=$? | ||
126 | if [ $RET -ne 0 ]; then | ||
127 | echo -n "(failed) " | ||
128 | RETVAL=$RET | ||
129 | else | ||
130 | if [ "$EBTABLES_SAVE_COUNTER" = "no" ]; then | ||
131 | /sbin/ebtables -t $table --atomic-file ${EBTABLES_DUMPFILE_STEM}.$table -Z | ||
132 | fi | ||
133 | fi | ||
134 | done | ||
135 | if [ -z "$EBTABLES_SUPPORTED_TABLES" ]; then | ||
136 | echo -n "no kernel support. " | ||
137 | else | ||
138 | echo -n "done. " | ||
139 | fi | ||
140 | if [ $RETVAL -eq 0 ]; then | ||
141 | echo "ok" | ||
142 | else | ||
143 | echo "fail" | ||
144 | fi | ||
145 | } | ||
146 | |||
147 | case "$1" in | ||
148 | start) | ||
149 | [ "$EBTABLES_LOAD_ON_START" = "yes" ] && load | ||
150 | ;; | ||
151 | stop) | ||
152 | [ "$EBTABLES_SAVE_ON_STOP" = "yes" ] && save | ||
153 | clear | ||
154 | ;; | ||
155 | restart|reload|force-reload) | ||
156 | [ "$EBTABLES_SAVE_ON_RESTART" = "yes" ] && save | ||
157 | clear | ||
158 | [ "$EBTABLES_LOAD_ON_START" = "yes" ] && load | ||
159 | ;; | ||
160 | load) | ||
161 | load | ||
162 | ;; | ||
163 | save) | ||
164 | save | ||
165 | ;; | ||
166 | status) | ||
167 | get_supported_tables | ||
168 | if [ -z "$EBTABLES_SUPPORTED_TABLES" ]; then | ||
169 | echo "No kernel support for ebtables." | ||
170 | RETVAL=1 | ||
171 | else | ||
172 | echo -n "Ebtables support available, number of installed rules: " | ||
173 | for table in $EBTABLES_SUPPORTED_TABLES; do | ||
174 | COUNT=$(( $(/sbin/ebtables -t $table -L | sed -e "/^Bridge chain/! d" -e "s/^.*entries: //" -e "s/,.*$/ +/") 0 )) | ||
175 | echo -n "$table($COUNT) " | ||
176 | done | ||
177 | echo ok | ||
178 | RETVAL=0 | ||
179 | fi | ||
180 | ;; | ||
181 | *) | ||
182 | echo "Usage: $0 {start|stop|restart|reload|force-reload|load|save|status}" >&2 | ||
183 | RETVAL=1 | ||
184 | esac | ||
185 | |||
186 | exit $RETVAL | ||
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/installnonroot.patch b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/installnonroot.patch new file mode 100644 index 0000000000..bcd9bed238 --- /dev/null +++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/installnonroot.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | diff --git a/Makefile b/Makefile | ||
2 | index c1106a4..7ea6b7a 100644 | ||
3 | --- a/Makefile | ||
4 | +++ b/Makefile | ||
5 | @@ -157,31 +157,31 @@ tmp3:=$(shell printf $(PIPE) | sed 's/\//\\\//g') | ||
6 | scripts: ebtables-save ebtables.sysv ebtables-config | ||
7 | cat ebtables-save | sed 's/__EXEC_PATH__/$(tmp1)/g' > ebtables-save_ | ||
8 | mkdir -p $(DESTDIR)$(BINDIR) | ||
9 | - install -m 0755 -o root -g root ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save | ||
10 | + install -m 0755 ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save | ||
11 | cat ebtables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables.sysv_ | ||
12 | if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(INITDIR); fi | ||
13 | - if test -d $(DESTDIR)$(INITDIR); then install -m 0755 -o root -g root ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables; fi | ||
14 | + if test -d $(DESTDIR)$(INITDIR); then install -m 0755 ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables; fi | ||
15 | cat ebtables-config | sed 's/__SYSCONFIG__/$(tmp2)/g' > ebtables-config_ | ||
16 | if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(SYSCONFIGDIR); fi | ||
17 | - if test -d $(DESTDIR)$(SYSCONFIGDIR); then install -m 0600 -o root -g root ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config; fi | ||
18 | + if test -d $(DESTDIR)$(SYSCONFIGDIR); then install -m 0600 ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config; fi | ||
19 | rm -f ebtables-save_ ebtables.sysv_ ebtables-config_ | ||
20 | |||
21 | tmp4:=$(shell printf $(LOCKFILE) | sed 's/\//\\\//g') | ||
22 | $(MANDIR)/man8/ebtables.8: ebtables.8 | ||
23 | mkdir -p $(DESTDIR)$(@D) | ||
24 | sed -e 's/$$(VERSION)/$(PROGVERSION)/' -e 's/$$(DATE)/$(PROGDATE)/' -e 's/$$(LOCKFILE)/$(tmp4)/' ebtables.8 > ebtables.8_ | ||
25 | - install -m 0644 -o root -g root ebtables.8_ $(DESTDIR)$@ | ||
26 | + install -m 0644 ebtables.8_ $(DESTDIR)$@ | ||
27 | rm -f ebtables.8_ | ||
28 | |||
29 | $(DESTDIR)$(ETHERTYPESFILE): ethertypes | ||
30 | mkdir -p $(@D) | ||
31 | - install -m 0644 -o root -g root $< $@ | ||
32 | + install -m 0644 $< $@ | ||
33 | |||
34 | .PHONY: exec | ||
35 | exec: ebtables ebtables-restore | ||
36 | mkdir -p $(DESTDIR)$(BINDIR) | ||
37 | - install -m 0755 -o root -g root $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME) | ||
38 | - install -m 0755 -o root -g root ebtables-restore $(DESTDIR)$(BINDIR)/ebtables-restore | ||
39 | + install -m 0755 $(PROGNAME) $(DESTDIR)$(BINDIR)/$(PROGNAME) | ||
40 | + install -m 0755 ebtables-restore $(DESTDIR)$(BINDIR)/ebtables-restore | ||
41 | |||
42 | .PHONY: install | ||
43 | install: $(MANDIR)/man8/ebtables.8 $(DESTDIR)$(ETHERTYPESFILE) exec scripts | ||
diff --git a/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/no-as-needed.patch b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/no-as-needed.patch new file mode 100644 index 0000000000..336119d6ba --- /dev/null +++ b/meta-networking/recipes-filter/ebtables/ebtables-2.0.10-4/no-as-needed.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | link ebtables with --no-as-needed and adjust the link order to fix runtime crash | ||
2 | |||
3 | Program terminated with signal 11, Segmentation fault. | ||
4 | #0 0x00007ffaa837fb53 in ebt_initialize_entry () from /lib64/ebtables/libebtc.so | ||
5 | (gdb) bt | ||
6 | #0 0x00007ffaa837fb53 in ebt_initialize_entry () from /lib64/ebtables/libebtc.so | ||
7 | #1 0x00007ffaa83824dc in do_command () from /lib64/ebtables/libebtc.so | ||
8 | #2 0x000000000040065c in ?? () | ||
9 | #3 0x00007ffaa7fed755 in __libc_start_main () from /lib64/libc.so.6 | ||
10 | #4 0x0000000000400691 in ?? () | ||
11 | |||
12 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
13 | Index: ebtables-v2.0.10-4/Makefile | ||
14 | =================================================================== | ||
15 | --- ebtables-v2.0.10-4.orig/Makefile 2011-12-15 12:02:47.000000000 -0800 | ||
16 | +++ ebtables-v2.0.10-4/Makefile 2012-12-17 22:09:45.065973753 -0800 | ||
17 | @@ -90,7 +90,7 @@ | ||
18 | $(CC) -shared $(LDFLAGS) -Wl,-soname,libebtc.so -o libebtc.so -lc $(OBJECTS2) | ||
19 | |||
20 | ebtables: $(OBJECTS) ebtables-standalone.o libebtc.so | ||
21 | - $(CC) $(CFLAGS) $(CFLAGS_SH_LIB) $(LDFLAGS) -o $@ ebtables-standalone.o -I$(KERNEL_INCLUDES) -L. -Lextensions -lebtc $(EXT_LIBSI) \ | ||
22 | + $(CC) $(CFLAGS) $(CFLAGS_SH_LIB) $(LDFLAGS) -o $@ ebtables-standalone.o -I$(KERNEL_INCLUDES) -L. -Lextensions -Wl,--no-as-needed $(EXT_LIBSI) -lebtc \ | ||
23 | -Wl,-rpath,$(LIBDIR) | ||
24 | |||
25 | ebtablesu: ebtablesu.c | ||
diff --git a/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb b/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb new file mode 100644 index 0000000000..9222b2d447 --- /dev/null +++ b/meta-networking/recipes-filter/ebtables/ebtables_2.0.10-4.bb | |||
@@ -0,0 +1,65 @@ | |||
1 | SUMMARY = "Filtering tool for a Linux-based bridging firewall" | ||
2 | DESCRIPTION = "Utility for basic Ethernet frame filtering on a Linux bridge, \ | ||
3 | advanced logging, MAC DNAT/SNAT and brouting." | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=53b4a999993871a28ab1488fdbd2e73e" | ||
6 | SECTION = "console/network" | ||
7 | PR = "r3" | ||
8 | |||
9 | RDEPENDS_${PN} += "perl" | ||
10 | |||
11 | RRECOMMENDS_${PN} += "kernel-module-ebtables \ | ||
12 | " | ||
13 | |||
14 | SRC_URI = "${SOURCEFORGE_MIRROR}/ebtables/ebtables-v${PV}.tar.gz \ | ||
15 | file://installnonroot.patch \ | ||
16 | file://01debian_defaultconfig.patch \ | ||
17 | file://ebtables.init \ | ||
18 | file://no-as-needed.patch \ | ||
19 | " | ||
20 | |||
21 | SRC_URI[md5sum] = "506742a3d44b9925955425a659c1a8d0" | ||
22 | SRC_URI[sha256sum] = "dc6f7b484f207dc712bfca81645f45120cb6aee3380e77a1771e9c34a9a4455d" | ||
23 | |||
24 | S = "${WORKDIR}/ebtables-v${PV}" | ||
25 | |||
26 | inherit update-rc.d | ||
27 | |||
28 | EXTRA_OEMAKE = " \ | ||
29 | BINDIR=${base_sbindir} \ | ||
30 | MANDIR=${mandir} \ | ||
31 | ETHERTYPESPATH=${sysconfdir} \ | ||
32 | INITDIR=${sysconfdir}/init.d \ | ||
33 | SYSCONFIGDIR=${sysconfdir}/default \ | ||
34 | LIBDIR=${base_libdir}/ebtables \ | ||
35 | 'CC=${CC}' \ | ||
36 | 'CFLAGS=${CFLAGS}' \ | ||
37 | 'LDFLAGS=${LDFLAGS} -Wl,--no-as-needed' \ | ||
38 | 'LD=${LD}' \ | ||
39 | " | ||
40 | |||
41 | do_install () { | ||
42 | install -d ${D}${sysconfdir}/init.d | ||
43 | install -d ${D}${sysconfdir}/default | ||
44 | install -d ${D}${sysconfdir}/ebtables | ||
45 | oe_runmake DESTDIR='${D}' install | ||
46 | install -m 0755 ${WORKDIR}/ebtables.init ${D}/${sysconfdir}/init.d/ebtables | ||
47 | mv ${D}${sysconfdir}/default/ebtables-config ${D}${sysconfdir}/default/ebtables | ||
48 | |||
49 | # Fix hardcoded paths in scripts | ||
50 | sed -i 's!/sbin/!${base_sbindir}/!g' ${D}/${sysconfdir}/init.d/ebtables | ||
51 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}/${sysconfdir}/init.d/ebtables | ||
52 | |||
53 | # The script ebtables-save refernces perl in exec_prefix, so | ||
54 | # move it to sbindir to avoid QA issue | ||
55 | install -d ${D}/${sbindir} | ||
56 | mv ${D}/${base_sbindir}/ebtables-save ${D}/${sbindir} | ||
57 | } | ||
58 | |||
59 | CONFFILES_${PN} += "${sysconfdir}/default/ebtables" | ||
60 | |||
61 | INITSCRIPT_NAME = "ebtables" | ||
62 | INITSCRIPT_PARAMS = "start 41 S . stop 41 6 ." | ||
63 | |||
64 | FILES_${PN}-dbg += "${base_libdir}/ebtables/.debug" | ||
65 | FILES_${PN} += "${base_libdir}/ebtables/*.so" | ||
diff --git a/meta-networking/recipes-filter/libmnl/libmnl_1.0.3.bb b/meta-networking/recipes-filter/libmnl/libmnl_1.0.3.bb new file mode 100644 index 0000000000..74f9096603 --- /dev/null +++ b/meta-networking/recipes-filter/libmnl/libmnl_1.0.3.bb | |||
@@ -0,0 +1,12 @@ | |||
1 | SUMMARY = "Minimalistic user-space Netlink utility library" | ||
2 | DESCRIPTION = "Minimalistic user-space library oriented to Netlink developers, providing \ | ||
3 | functions for common tasks in parsing, validating, and constructing both the Netlink header and TLVs." | ||
4 | HOMEPAGE = "http://www.netfilter.org/projects/libmnl/index.html" | ||
5 | LICENSE = "LGPLv2.1+" | ||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c" | ||
7 | |||
8 | SRC_URI = "http://www.netfilter.org/projects/libmnl/files/libmnl-${PV}.tar.bz2;name=tar" | ||
9 | SRC_URI[tar.md5sum] = "7d95fc3bea3365bc03c48e484224f65f" | ||
10 | SRC_URI[tar.sha256sum] = "6f14336e9acdbc62c2dc71bbb59ce162e54e9af5c80153e92476c5443fe784de" | ||
11 | |||
12 | inherit autotools pkgconfig | ||
diff --git a/meta-networking/recipes-filter/libnetfilter/libnetfilter-conntrack_1.0.2.bb b/meta-networking/recipes-filter/libnetfilter/libnetfilter-conntrack_1.0.2.bb new file mode 100644 index 0000000000..fb915abbfd --- /dev/null +++ b/meta-networking/recipes-filter/libnetfilter/libnetfilter-conntrack_1.0.2.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | SUMMARY = "Netfilter connection tracking library" | ||
2 | DESCRIPTION = "Userspace library providing a programming interface (API) to the Linux kernel netfilter connection tracking state table" | ||
3 | HOMEPAGE = "http://www.netfilter.org/projects/libnetfilter_conntrack/index.html" | ||
4 | LICENSE = "GPLv2+" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
6 | DEPENDS = "libnfnetlink libmnl" | ||
7 | |||
8 | SRC_URI = "http://www.netfilter.org/projects/libnetfilter_conntrack/files/libnetfilter_conntrack-${PV}.tar.bz2;name=tar" | ||
9 | SRC_URI[tar.md5sum] = "447114b5d61bb9a9617ead3217c3d3ff" | ||
10 | SRC_URI[tar.sha256sum] = "a0bd747dd58ae1513586b43c7125b41e6325f97eb95ac63d53cf5aeb33254d12" | ||
11 | |||
12 | S = "${WORKDIR}/libnetfilter_conntrack-${PV}" | ||
13 | |||
14 | inherit autotools pkgconfig | ||
diff --git a/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb b/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb new file mode 100644 index 0000000000..405e8bfae2 --- /dev/null +++ b/meta-networking/recipes-filter/libnetfilter/libnetfilter-cthelper_1.0.0.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | SUMMARY = "Netfilter connection tracking helper library" | ||
2 | DESCRIPTION = "Userspace library providing a programming interface (API) to the Linux kernel netfilter user-space helper infrastructure" | ||
3 | HOMEPAGE = "http://www.netfilter.org/projects/libnetfilter_cthelper/index.html" | ||
4 | LICENSE = "GPLv2+" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
6 | DEPENDS = "libmnl" | ||
7 | |||
8 | SRC_URI = "http://www.netfilter.org/projects/libnetfilter_cthelper/files/libnetfilter_cthelper-${PV}.tar.bz2;name=tar" | ||
9 | SRC_URI[tar.md5sum] = "b2efab1a3a198a5add448960ba011acd" | ||
10 | SRC_URI[tar.sha256sum] = "07618e71c4d9a6b6b3dc1986540486ee310a9838ba754926c7d14a17d8fccf3d" | ||
11 | |||
12 | S = "${WORKDIR}/libnetfilter_cthelper-${PV}" | ||
13 | |||
14 | inherit autotools pkgconfig | ||
diff --git a/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb b/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb new file mode 100644 index 0000000000..2f25852173 --- /dev/null +++ b/meta-networking/recipes-filter/libnetfilter/libnetfilter-cttimeout_1.0.0.bb | |||
@@ -0,0 +1,13 @@ | |||
1 | SUMMARY = "Netfilter connection tracking timeout library" | ||
2 | DESCRIPTION = "Userspace library providing a programming interface (API) to the Linux kernel netfilter fine-grain connection tracking timeout infrastructure" | ||
3 | LICENSE = "GPLv2+" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
5 | DEPENDS = "libmnl" | ||
6 | |||
7 | SRC_URI = "http://www.netfilter.org/projects/libnetfilter_cttimeout/files/libnetfilter_cttimeout-${PV}.tar.bz2;name=tar" | ||
8 | SRC_URI[tar.md5sum] = "7697437fc9ebb6f6b83df56a633db7f9" | ||
9 | SRC_URI[tar.sha256sum] = "aeab12754f557cba3ce2950a2029963d817490df7edb49880008b34d7ff8feba" | ||
10 | |||
11 | S = "${WORKDIR}/libnetfilter_cttimeout-${PV}" | ||
12 | |||
13 | inherit autotools pkgconfig | ||
diff --git a/meta-networking/recipes-filter/libnetfilter/libnetfilter-log_1.0.1.bb b/meta-networking/recipes-filter/libnetfilter/libnetfilter-log_1.0.1.bb new file mode 100644 index 0000000000..81909b8be1 --- /dev/null +++ b/meta-networking/recipes-filter/libnetfilter/libnetfilter-log_1.0.1.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | SUMMARY = "Netfilter logging library" | ||
2 | DESCRIPTION = "Userspace library providing a programming interface (API) to the Linux kernel netfilter log message (NFLOG)" | ||
3 | HOMEPAGE = "http://www.netfilter.org/projects/libnetfilter_log/index.html" | ||
4 | LICENSE = "GPLv2+" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
6 | DEPENDS = "libnfnetlink" | ||
7 | |||
8 | SRC_URI = "http://www.netfilter.org/projects/libnetfilter_log/files/libnetfilter_log-${PV}.tar.bz2;name=tar" | ||
9 | SRC_URI[tar.md5sum] = "2a4bb0654ae675a52d2e8d1c06090b94" | ||
10 | SRC_URI[tar.sha256sum] = "74e0fe75753dba3ac114531b5e73240452c789a3f3adccf5c51217da1d933b21" | ||
11 | |||
12 | S = "${WORKDIR}/libnetfilter_log-${PV}" | ||
13 | |||
14 | inherit autotools pkgconfig | ||
diff --git a/meta-networking/recipes-filter/libnetfilter/libnetfilter-queue_1.0.2.bb b/meta-networking/recipes-filter/libnetfilter/libnetfilter-queue_1.0.2.bb new file mode 100644 index 0000000000..b932ff65ff --- /dev/null +++ b/meta-networking/recipes-filter/libnetfilter/libnetfilter-queue_1.0.2.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | SUMMARY = "Netfilter packet queue access library" | ||
2 | DESCRIPTION = "Userspace library providing a programming interface (API) to access the Linux kernel netfilter packet queue" | ||
3 | HOMEPAGE = "http://www.netfilter.org/projects/libnetfilter_queue/index.html" | ||
4 | LICENSE = "GPLv2+" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
6 | DEPENDS = "libnfnetlink libmnl" | ||
7 | |||
8 | SRC_URI = "http://www.netfilter.org/projects/libnetfilter_queue/files/libnetfilter_queue-${PV}.tar.bz2;name=tar" | ||
9 | SRC_URI[tar.md5sum] = "df09befac35cb215865b39a36c96a3fa" | ||
10 | SRC_URI[tar.sha256sum] = "838490eb5dbe358f9669823704982f5313a8d397111562373200203f93ac1a32" | ||
11 | |||
12 | S = "${WORKDIR}/libnetfilter_queue-${PV}" | ||
13 | |||
14 | inherit autotools pkgconfig | ||
diff --git a/meta-networking/recipes-filter/libnfnetlink/libnfnetlink_1.0.1.bb b/meta-networking/recipes-filter/libnfnetlink/libnfnetlink_1.0.1.bb new file mode 100644 index 0000000000..9cb615bb47 --- /dev/null +++ b/meta-networking/recipes-filter/libnfnetlink/libnfnetlink_1.0.1.bb | |||
@@ -0,0 +1,18 @@ | |||
1 | SUMMARY = "Low-level library for netfilter related kernel/userspace communication" | ||
2 | DESCRIPTION = "libnfnetlink is the low-level library for netfilter related \ | ||
3 | kernel/userspace communication. It provides a generic messaging \ | ||
4 | infrastructure for in-kernel netfilter subsystems (such as nfnetlink_log, \ | ||
5 | nfnetlink_queue, nfnetlink_conntrack) and their respective users and/or \ | ||
6 | management tools in userspace." | ||
7 | HOMEPAGE = "http://www.netfilter.org/projects/libnfnetlink/index.html" | ||
8 | SECTION = "devel/libs" | ||
9 | LICENSE = "GPLv2+" | ||
10 | |||
11 | |||
12 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
13 | |||
14 | SRC_URI = "http://www.netfilter.org/projects/libnfnetlink/files/libnfnetlink-${PV}.tar.bz2;name=tar" | ||
15 | SRC_URI[tar.md5sum] = "98927583d2016a9fb1936fed992e2c5e" | ||
16 | SRC_URI[tar.sha256sum] = "f270e19de9127642d2a11589ef2ec97ef90a649a74f56cf9a96306b04817b51a" | ||
17 | |||
18 | inherit autotools pkgconfig | ||
diff --git a/meta-networking/recipes-irc/znc/znc_git.bb b/meta-networking/recipes-irc/znc/znc_git.bb new file mode 100644 index 0000000000..b648cd2247 --- /dev/null +++ b/meta-networking/recipes-irc/znc/znc_git.bb | |||
@@ -0,0 +1,19 @@ | |||
1 | SUMMARY = "ZNC, an advanced IRC bouncer" | ||
2 | LICENSE = "GPLv2" | ||
3 | LIC_FILES_CHKSUM = "file://LICENSE;md5=751419260aa954499f7abaabaa882bbe" | ||
4 | |||
5 | DEPENDS = "openssl" | ||
6 | |||
7 | PV = "1.0+git" | ||
8 | |||
9 | SRCREV = "ef59c23068547c132cb678092fba9a21317fd5f2" | ||
10 | SRC_URI = "git://github.com/znc/znc.git" | ||
11 | |||
12 | S = "${WORKDIR}/git" | ||
13 | |||
14 | inherit autotools | ||
15 | |||
16 | # ZNC has a custom autogen.sh that states that this command is needed *and* expected to fail | ||
17 | do_configure_prepend() { | ||
18 | automake --add-missing || true | ||
19 | } | ||
diff --git a/meta-networking/recipes-protocols/accel-ppp/accel-ppp_git.bb b/meta-networking/recipes-protocols/accel-ppp/accel-ppp_git.bb new file mode 100644 index 0000000000..526818c05e --- /dev/null +++ b/meta-networking/recipes-protocols/accel-ppp/accel-ppp_git.bb | |||
@@ -0,0 +1,41 @@ | |||
1 | SUMMARY = "ACCEL-PPP is a high performance VPN server application for linux" | ||
2 | HOMEPAGE = "http://sourceforge.net/apps/trac/accel-ppp/wiki" | ||
3 | |||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=eb723b61539feef013de476e68b5c50a" | ||
6 | |||
7 | DEPENDS = "openssl libpcre" | ||
8 | |||
9 | inherit cmake | ||
10 | |||
11 | PR = "r1" | ||
12 | PV = "1.7.3+git" | ||
13 | |||
14 | SRCREV = "4acfa46c321a344b9a6ce4128e72d1e02828d8a0" | ||
15 | SRC_URI = "git://accel-ppp.git.sourceforge.net/gitroot/accel-ppp/accel-ppp;branch=1.7" | ||
16 | |||
17 | S = "${WORKDIR}/git" | ||
18 | |||
19 | EXTRA_OECMAKE = " \ | ||
20 | -DBUILD_DRIVER=FALSE \ | ||
21 | -DCMAKE_INSTALL_PREFIX=${prefix} \ | ||
22 | -DCMAKE_BUILD_TYPE=Release \ | ||
23 | -DLOG_PGSQL=FALSE \ | ||
24 | -DRADIUS=FALSE \ | ||
25 | -DNETSNMP=FALSE \ | ||
26 | " | ||
27 | FILES_${PN}-dbg += "/usr/lib/${BPN}/.debug/*" | ||
28 | |||
29 | PACKAGES =+ "${PN}-libs" | ||
30 | FILES_${PN}-libs = "${libdir}/${BPN}/*.so /usr/lib/${BPN}/*.so" | ||
31 | INSANE_SKIP_${PN}-libs = "dev-so" | ||
32 | RDEPENDS_${PN} += "${PN}-libs" | ||
33 | |||
34 | do_install_prepend() { | ||
35 | cmlist=`find ${S} -name CMakeLists.txt` | ||
36 | for file in $cmlist; do | ||
37 | sed -i -e "s:LIBRARY DESTINATION lib/accel-ppp:LIBRARY DESTINATION ${baselib}/accel-ppp:g" \ | ||
38 | -e "s:\${CMAKE_INSTALL_PREFIX}/lib/accel-ppp:\${CMAKE_INSTALL_PREFIX}/${baselib}/accel-ppp:g" \ | ||
39 | $cmlist | ||
40 | done | ||
41 | } | ||
diff --git a/meta-networking/recipes-protocols/net-snmp/files/ifmib.patch b/meta-networking/recipes-protocols/net-snmp/files/ifmib.patch new file mode 100644 index 0000000000..859c52c3e3 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/files/ifmib.patch | |||
@@ -0,0 +1,66 @@ | |||
1 | Signed-off-by: Jack Mitchell <jack@embed.me.uk> | ||
2 | Upstream-Status: Pending | ||
3 | Bug-Report: http://sourceforge.net/p/net-snmp/bugs/2449/ | ||
4 | |||
5 | diff --git a/agent/mibgroup/if-mib/data_access/interface_linux.c b/agent/mibgroup/if-mib/data_access/interface_linux.c | ||
6 | index 3419811..d6eb91a 100644 | ||
7 | --- a/agent/mibgroup/if-mib/data_access/interface_linux.c | ||
8 | +++ b/agent/mibgroup/if-mib/data_access/interface_linux.c | ||
9 | @@ -18,7 +18,31 @@ netsnmp_feature_require(interface_ioctl_flags_set) | ||
10 | |||
11 | #ifdef HAVE_PCI_LOOKUP_NAME | ||
12 | #include <pci/pci.h> | ||
13 | +#include <setjmp.h> | ||
14 | static struct pci_access *pci_access; | ||
15 | + | ||
16 | +/* Avoid letting libpci call exit(1) when no PCI bus is available. */ | ||
17 | +static int do_longjmp =0; | ||
18 | +static jmp_buf err_buf; | ||
19 | +static void | ||
20 | +netsnmp_pci_error(char *msg, ...) | ||
21 | +{ | ||
22 | + va_list args; | ||
23 | + char *buf; | ||
24 | + int buflen; | ||
25 | + | ||
26 | + va_start(args, msg); | ||
27 | + buflen = strlen("pcilib: ")+strlen(msg)+2; | ||
28 | + buf = malloc(buflen); | ||
29 | + snprintf(buf, buflen, "pcilib: %s\n", msg); | ||
30 | + snmp_vlog(LOG_ERR, buf, args); | ||
31 | + free(buf); | ||
32 | + va_end(args); | ||
33 | + if (do_longjmp) | ||
34 | + longjmp(err_buf, 1); | ||
35 | + else | ||
36 | + exit(1); | ||
37 | +} | ||
38 | #endif | ||
39 | |||
40 | #ifdef HAVE_LINUX_ETHTOOL_H | ||
41 | @@ -147,10 +171,22 @@ netsnmp_arch_interface_init(void) | ||
42 | |||
43 | #ifdef HAVE_PCI_LOOKUP_NAME | ||
44 | pci_access = pci_alloc(); | ||
45 | - if (pci_access) | ||
46 | + if (!pci_access) { | ||
47 | + snmp_log(LOG_ERR, "pcilib: pci_alloc failed\n"); | ||
48 | + return; | ||
49 | + } | ||
50 | + | ||
51 | + pci_access->error = netsnmp_pci_error; | ||
52 | + | ||
53 | + do_longjmp = 1; | ||
54 | + if (setjmp(err_buf)) { | ||
55 | + pci_cleanup(pci_access); | ||
56 | + snmp_log(LOG_ERR, "pcilib: pci_init failed\n"); | ||
57 | + pci_access = NULL; | ||
58 | + } | ||
59 | + else if (pci_access) | ||
60 | pci_init(pci_access); | ||
61 | - else | ||
62 | - snmp_log(LOG_ERR, "Unable to create pci access method\n"); | ||
63 | + do_longjmp = 0; | ||
64 | #endif | ||
65 | } | ||
66 | |||
diff --git a/meta-networking/recipes-protocols/net-snmp/files/init b/meta-networking/recipes-protocols/net-snmp/files/init new file mode 100755 index 0000000000..434b2fa3f2 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/files/init | |||
@@ -0,0 +1,63 @@ | |||
1 | #! /bin/sh | ||
2 | # /etc/init.d/snmpd: start snmp daemon. | ||
3 | |||
4 | test -x /usr/sbin/snmpd || exit 0 | ||
5 | test -x /usr/sbin/snmptrapd || exit 0 | ||
6 | |||
7 | # Defaults | ||
8 | export MIBDIRS=/usr/share/snmp/mibs | ||
9 | SNMPDRUN=yes | ||
10 | SNMPDOPTS='-Lsd -Lf /dev/null -p /var/run/snmpd.pid' | ||
11 | TRAPDRUN=no | ||
12 | TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid' | ||
13 | |||
14 | # Cd to / before starting any daemons. | ||
15 | cd / | ||
16 | |||
17 | case "$1" in | ||
18 | start) | ||
19 | echo -n "Starting network management services:" | ||
20 | if [ "$SNMPDRUN" = "yes" -a -f /etc/snmp/snmpd.conf ]; then | ||
21 | start-stop-daemon -S -x /usr/sbin/snmpd \ | ||
22 | -- $SNMPDOPTS | ||
23 | echo -n " snmpd" | ||
24 | fi | ||
25 | if [ "$TRAPDRUN" = "yes" -a -f /etc/snmp/snmptrapd.conf ]; then | ||
26 | start-stop-daemon -S -x /usr/sbin/snmptrapd \ | ||
27 | -- $TRAPDOPTS | ||
28 | echo -n " snmptrapd" | ||
29 | fi | ||
30 | echo "." | ||
31 | ;; | ||
32 | stop) | ||
33 | echo -n "Stopping network management services:" | ||
34 | start-stop-daemon -K -x /usr/sbin/snmpd | ||
35 | echo -n " snmpd" | ||
36 | start-stop-daemon -K -x /usr/sbin/snmptrapd | ||
37 | echo -n " snmptrapd" | ||
38 | echo "." | ||
39 | ;; | ||
40 | restart|reload|force-reload) | ||
41 | echo -n "Restarting network management services:" | ||
42 | start-stop-daemon -K -x /usr/sbin/snmpd | ||
43 | start-stop-daemon -K -x /usr/sbin/snmptrapd | ||
44 | # Allow the daemons time to exit completely. | ||
45 | sleep 2 | ||
46 | if [ "$SNMPDRUN" = "yes" -a -f /etc/snmp/snmpd.conf ]; then | ||
47 | start-stop-daemon -S -x /usr/sbin/snmpd -- $SNMPDOPTS | ||
48 | echo -n " snmpd" | ||
49 | fi | ||
50 | if [ "$TRAPDRUN" = "yes" -a -f /etc/snmp/snmptrapd.conf ]; then | ||
51 | # Allow snmpd time to start up. | ||
52 | sleep 1 | ||
53 | start-stop-daemon -S -x /usr/sbin/snmptrapd -- $TRAPDOPTS | ||
54 | echo -n " snmptrapd" | ||
55 | fi | ||
56 | echo "." | ||
57 | ;; | ||
58 | *) | ||
59 | echo "Usage: /etc/init.d/snmpd {start|stop|restart|reload|force-reload}" | ||
60 | exit 1 | ||
61 | esac | ||
62 | |||
63 | exit 0 | ||
diff --git a/meta-networking/recipes-protocols/net-snmp/files/snmpd.conf b/meta-networking/recipes-protocols/net-snmp/files/snmpd.conf new file mode 100644 index 0000000000..728171c427 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/files/snmpd.conf | |||
@@ -0,0 +1,422 @@ | |||
1 | ############################################################################### | ||
2 | # | ||
3 | # EXAMPLE.conf: | ||
4 | # An example configuration file for configuring the ucd-snmp snmpd agent. | ||
5 | # | ||
6 | ############################################################################### | ||
7 | # | ||
8 | # This file is intended to only be an example. If, however, you want | ||
9 | # to use it, it should be placed in /etc/snmp/snmpd.conf. | ||
10 | # When the snmpd agent starts up, this is where it will look for it. | ||
11 | # | ||
12 | # You might be interested in generating your own snmpd.conf file using | ||
13 | # the "snmpconf" program (perl script) instead. It's a nice menu | ||
14 | # based interface to writing well commented configuration files. Try it! | ||
15 | # | ||
16 | # Note: This file is automatically generated from EXAMPLE.conf.def. | ||
17 | # Do NOT read the EXAMPLE.conf.def file! Instead, after you have run | ||
18 | # configure & make, and then make sure you read the EXAMPLE.conf file | ||
19 | # instead, as it will tailor itself to your configuration. | ||
20 | |||
21 | # All lines beginning with a '#' are comments and are intended for you | ||
22 | # to read. All other lines are configuration commands for the agent. | ||
23 | |||
24 | # | ||
25 | # PLEASE: read the snmpd.conf(5) manual page as well! | ||
26 | # | ||
27 | |||
28 | |||
29 | ############################################################################### | ||
30 | # Access Control | ||
31 | ############################################################################### | ||
32 | |||
33 | # YOU SHOULD CHANGE THE "COMMUNITY" TOKEN BELOW TO A NEW KEYWORD ONLY | ||
34 | # KNOWN AT YOUR SITE. YOU *MUST* CHANGE THE NETWORK TOKEN BELOW TO | ||
35 | # SOMETHING REFLECTING YOUR LOCAL NETWORK ADDRESS SPACE. | ||
36 | |||
37 | # By far, the most common question I get about the agent is "why won't | ||
38 | # it work?", when really it should be "how do I configure the agent to | ||
39 | # allow me to access it?" | ||
40 | # | ||
41 | # By default, the agent responds to the "public" community for read | ||
42 | # only access, if run out of the box without any configuration file in | ||
43 | # place. The following examples show you other ways of configuring | ||
44 | # the agent so that you can change the community names, and give | ||
45 | # yourself write access as well. | ||
46 | # | ||
47 | # The following lines change the access permissions of the agent so | ||
48 | # that the COMMUNITY string provides read-only access to your entire | ||
49 | # NETWORK (EG: 10.10.10.0/24), and read/write access to only the | ||
50 | # localhost (127.0.0.1, not its real ipaddress). | ||
51 | # | ||
52 | # For more information, read the FAQ as well as the snmpd.conf(5) | ||
53 | # manual page. | ||
54 | |||
55 | #### | ||
56 | # First, map the community name (COMMUNITY) into a security name | ||
57 | # (local and mynetwork, depending on where the request is coming | ||
58 | # from): | ||
59 | |||
60 | # sec.name source community | ||
61 | com2sec paranoid default public | ||
62 | #com2sec readonly default public | ||
63 | #com2sec readwrite default private | ||
64 | |||
65 | #### | ||
66 | # Second, map the security names into group names: | ||
67 | |||
68 | # sec.model sec.name | ||
69 | group MyROSystem v1 paranoid | ||
70 | group MyROSystem v2c paranoid | ||
71 | group MyROSystem usm paranoid | ||
72 | group MyROGroup v1 readonly | ||
73 | group MyROGroup v2c readonly | ||
74 | group MyROGroup usm readonly | ||
75 | group MyRWGroup v1 readwrite | ||
76 | group MyRWGroup v2c readwrite | ||
77 | group MyRWGroup usm readwrite | ||
78 | |||
79 | #### | ||
80 | # Third, create a view for us to let the groups have rights to: | ||
81 | |||
82 | # incl/excl subtree mask | ||
83 | view all included .1 80 | ||
84 | view system included .iso.org.dod.internet.mgmt.mib-2.system | ||
85 | |||
86 | #### | ||
87 | # Finally, grant the 2 groups access to the 1 view with different | ||
88 | # write permissions: | ||
89 | |||
90 | # context sec.model sec.level match read write notif | ||
91 | access MyROSystem "" any noauth exact system none none | ||
92 | access MyROGroup "" any noauth exact all none none | ||
93 | access MyRWGroup "" any noauth exact all all none | ||
94 | |||
95 | # ----------------------------------------------------------------------------- | ||
96 | |||
97 | |||
98 | ############################################################################### | ||
99 | # System contact information | ||
100 | # | ||
101 | |||
102 | # It is also possible to set the sysContact and sysLocation system | ||
103 | # variables through the snmpd.conf file. **PLEASE NOTE** that setting | ||
104 | # the value of these objects here makes these objects READ-ONLY | ||
105 | # (regardless of any access control settings). Any attempt to set the | ||
106 | # value of an object whose value is given here will fail with an error | ||
107 | # status of notWritable. | ||
108 | |||
109 | syslocation Unknown (configure /etc/snmp/snmpd.local.conf) | ||
110 | syscontact Root <root@localhost> (configure /etc/snmp/snmpd.local.conf) | ||
111 | |||
112 | # Example output of snmpwalk: | ||
113 | # % snmpwalk -v 1 -c public localhost system | ||
114 | # system.sysDescr.0 = "SunOS name sun4c" | ||
115 | # system.sysObjectID.0 = OID: enterprises.ucdavis.ucdSnmpAgent.sunos4 | ||
116 | # system.sysUpTime.0 = Timeticks: (595637548) 68 days, 22:32:55 | ||
117 | # system.sysContact.0 = "Me <me@somewhere.org>" | ||
118 | # system.sysName.0 = "name" | ||
119 | # system.sysLocation.0 = "Right here, right now." | ||
120 | # system.sysServices.0 = 72 | ||
121 | |||
122 | |||
123 | # ----------------------------------------------------------------------------- | ||
124 | |||
125 | |||
126 | ############################################################################### | ||
127 | # Process checks. | ||
128 | # | ||
129 | # The following are examples of how to use the agent to check for | ||
130 | # processes running on the host. The syntax looks something like: | ||
131 | # | ||
132 | # proc NAME [MAX=0] [MIN=0] | ||
133 | # | ||
134 | # NAME: the name of the process to check for. It must match | ||
135 | # exactly (ie, http will not find httpd processes). | ||
136 | # MAX: the maximum number allowed to be running. Defaults to 0. | ||
137 | # MIN: the minimum number to be running. Defaults to 0. | ||
138 | |||
139 | # | ||
140 | # Examples: | ||
141 | # | ||
142 | |||
143 | # Make sure mountd is running | ||
144 | #proc mountd | ||
145 | |||
146 | # Make sure there are no more than 4 ntalkds running, but 0 is ok too. | ||
147 | #proc ntalkd 4 | ||
148 | |||
149 | # Make sure at least one sendmail, but less than or equal to 10 are running. | ||
150 | #proc sendmail 10 1 | ||
151 | |||
152 | # A snmpwalk of the prTable would look something like this: | ||
153 | # | ||
154 | # % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.2 | ||
155 | # enterprises.ucdavis.procTable.prEntry.prIndex.1 = 1 | ||
156 | # enterprises.ucdavis.procTable.prEntry.prIndex.2 = 2 | ||
157 | # enterprises.ucdavis.procTable.prEntry.prIndex.3 = 3 | ||
158 | # enterprises.ucdavis.procTable.prEntry.prNames.1 = "mountd" | ||
159 | # enterprises.ucdavis.procTable.prEntry.prNames.2 = "ntalkd" | ||
160 | # enterprises.ucdavis.procTable.prEntry.prNames.3 = "sendmail" | ||
161 | # enterprises.ucdavis.procTable.prEntry.prMin.1 = 0 | ||
162 | # enterprises.ucdavis.procTable.prEntry.prMin.2 = 0 | ||
163 | # enterprises.ucdavis.procTable.prEntry.prMin.3 = 1 | ||
164 | # enterprises.ucdavis.procTable.prEntry.prMax.1 = 0 | ||
165 | # enterprises.ucdavis.procTable.prEntry.prMax.2 = 4 | ||
166 | # enterprises.ucdavis.procTable.prEntry.prMax.3 = 10 | ||
167 | # enterprises.ucdavis.procTable.prEntry.prCount.1 = 0 | ||
168 | # enterprises.ucdavis.procTable.prEntry.prCount.2 = 0 | ||
169 | # enterprises.ucdavis.procTable.prEntry.prCount.3 = 1 | ||
170 | # enterprises.ucdavis.procTable.prEntry.prErrorFlag.1 = 1 | ||
171 | # enterprises.ucdavis.procTable.prEntry.prErrorFlag.2 = 0 | ||
172 | # enterprises.ucdavis.procTable.prEntry.prErrorFlag.3 = 0 | ||
173 | # enterprises.ucdavis.procTable.prEntry.prErrMessage.1 = "No mountd process running." | ||
174 | # enterprises.ucdavis.procTable.prEntry.prErrMessage.2 = "" | ||
175 | # enterprises.ucdavis.procTable.prEntry.prErrMessage.3 = "" | ||
176 | # enterprises.ucdavis.procTable.prEntry.prErrFix.1 = 0 | ||
177 | # enterprises.ucdavis.procTable.prEntry.prErrFix.2 = 0 | ||
178 | # enterprises.ucdavis.procTable.prEntry.prErrFix.3 = 0 | ||
179 | # | ||
180 | # Note that the errorFlag for mountd is set to 1 because one is not | ||
181 | # running (in this case an rpc.mountd is, but thats not good enough), | ||
182 | # and the ErrMessage tells you what's wrong. The configuration | ||
183 | # imposed in the snmpd.conf file is also shown. | ||
184 | # | ||
185 | # Special Case: When the min and max numbers are both 0, it assumes | ||
186 | # you want a max of infinity and a min of 1. | ||
187 | # | ||
188 | |||
189 | |||
190 | # ----------------------------------------------------------------------------- | ||
191 | |||
192 | |||
193 | ############################################################################### | ||
194 | # Executables/scripts | ||
195 | # | ||
196 | |||
197 | # | ||
198 | # You can also have programs run by the agent that return a single | ||
199 | # line of output and an exit code. Here are two examples. | ||
200 | # | ||
201 | # exec NAME PROGRAM [ARGS ...] | ||
202 | # | ||
203 | # NAME: A generic name. | ||
204 | # PROGRAM: The program to run. Include the path! | ||
205 | # ARGS: optional arguments to be passed to the program | ||
206 | |||
207 | # a simple hello world | ||
208 | #exec echotest /bin/echo hello world | ||
209 | |||
210 | # Run a shell script containing: | ||
211 | # | ||
212 | # #!/bin/sh | ||
213 | # echo hello world | ||
214 | # echo hi there | ||
215 | # exit 35 | ||
216 | # | ||
217 | # Note: this has been specifically commented out to prevent | ||
218 | # accidental security holes due to someone else on your system writing | ||
219 | # a /tmp/shtest before you do. Uncomment to use it. | ||
220 | # | ||
221 | #exec shelltest /bin/sh /tmp/shtest | ||
222 | |||
223 | # Then, | ||
224 | # % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.8 | ||
225 | # enterprises.ucdavis.extTable.extEntry.extIndex.1 = 1 | ||
226 | # enterprises.ucdavis.extTable.extEntry.extIndex.2 = 2 | ||
227 | # enterprises.ucdavis.extTable.extEntry.extNames.1 = "echotest" | ||
228 | # enterprises.ucdavis.extTable.extEntry.extNames.2 = "shelltest" | ||
229 | # enterprises.ucdavis.extTable.extEntry.extCommand.1 = "/bin/echo hello world" | ||
230 | # enterprises.ucdavis.extTable.extEntry.extCommand.2 = "/bin/sh /tmp/shtest" | ||
231 | # enterprises.ucdavis.extTable.extEntry.extResult.1 = 0 | ||
232 | # enterprises.ucdavis.extTable.extEntry.extResult.2 = 35 | ||
233 | # enterprises.ucdavis.extTable.extEntry.extOutput.1 = "hello world." | ||
234 | # enterprises.ucdavis.extTable.extEntry.extOutput.2 = "hello world." | ||
235 | # enterprises.ucdavis.extTable.extEntry.extErrFix.1 = 0 | ||
236 | # enterprises.ucdavis.extTable.extEntry.extErrFix.2 = 0 | ||
237 | |||
238 | # Note that the second line of the /tmp/shtest shell script is cut | ||
239 | # off. Also note that the exit status of 35 was returned. | ||
240 | |||
241 | # ----------------------------------------------------------------------------- | ||
242 | |||
243 | |||
244 | ############################################################################### | ||
245 | # disk checks | ||
246 | # | ||
247 | |||
248 | # The agent can check the amount of available disk space, and make | ||
249 | # sure it is above a set limit. | ||
250 | |||
251 | # disk PATH [MIN=DEFDISKMINIMUMSPACE] | ||
252 | # | ||
253 | # PATH: mount path to the disk in question. | ||
254 | # MIN: Disks with space below this value will have the Mib's errorFlag set. | ||
255 | # Default value = DEFDISKMINIMUMSPACE. | ||
256 | |||
257 | # Check the / partition and make sure it contains at least 10 megs. | ||
258 | |||
259 | #disk / 10000 | ||
260 | |||
261 | # % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.9 | ||
262 | # enterprises.ucdavis.diskTable.dskEntry.diskIndex.1 = 0 | ||
263 | # enterprises.ucdavis.diskTable.dskEntry.diskPath.1 = "/" Hex: 2F | ||
264 | # enterprises.ucdavis.diskTable.dskEntry.diskDevice.1 = "/dev/dsk/c201d6s0" | ||
265 | # enterprises.ucdavis.diskTable.dskEntry.diskMinimum.1 = 10000 | ||
266 | # enterprises.ucdavis.diskTable.dskEntry.diskTotal.1 = 837130 | ||
267 | # enterprises.ucdavis.diskTable.dskEntry.diskAvail.1 = 316325 | ||
268 | # enterprises.ucdavis.diskTable.dskEntry.diskUsed.1 = 437092 | ||
269 | # enterprises.ucdavis.diskTable.dskEntry.diskPercent.1 = 58 | ||
270 | # enterprises.ucdavis.diskTable.dskEntry.diskErrorFlag.1 = 0 | ||
271 | # enterprises.ucdavis.diskTable.dskEntry.diskErrorMsg.1 = "" | ||
272 | |||
273 | # ----------------------------------------------------------------------------- | ||
274 | |||
275 | |||
276 | ############################################################################### | ||
277 | # load average checks | ||
278 | # | ||
279 | |||
280 | # load [1MAX=DEFMAXLOADAVE] [5MAX=DEFMAXLOADAVE] [15MAX=DEFMAXLOADAVE] | ||
281 | # | ||
282 | # 1MAX: If the 1 minute load average is above this limit at query | ||
283 | # time, the errorFlag will be set. | ||
284 | # 5MAX: Similar, but for 5 min average. | ||
285 | # 15MAX: Similar, but for 15 min average. | ||
286 | |||
287 | # Check for loads: | ||
288 | #load 12 14 14 | ||
289 | |||
290 | # % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.10 | ||
291 | # enterprises.ucdavis.loadTable.laEntry.loadaveIndex.1 = 1 | ||
292 | # enterprises.ucdavis.loadTable.laEntry.loadaveIndex.2 = 2 | ||
293 | # enterprises.ucdavis.loadTable.laEntry.loadaveIndex.3 = 3 | ||
294 | # enterprises.ucdavis.loadTable.laEntry.loadaveNames.1 = "Load-1" | ||
295 | # enterprises.ucdavis.loadTable.laEntry.loadaveNames.2 = "Load-5" | ||
296 | # enterprises.ucdavis.loadTable.laEntry.loadaveNames.3 = "Load-15" | ||
297 | # enterprises.ucdavis.loadTable.laEntry.loadaveLoad.1 = "0.49" Hex: 30 2E 34 39 | ||
298 | # enterprises.ucdavis.loadTable.laEntry.loadaveLoad.2 = "0.31" Hex: 30 2E 33 31 | ||
299 | # enterprises.ucdavis.loadTable.laEntry.loadaveLoad.3 = "0.26" Hex: 30 2E 32 36 | ||
300 | # enterprises.ucdavis.loadTable.laEntry.loadaveConfig.1 = "12.00" | ||
301 | # enterprises.ucdavis.loadTable.laEntry.loadaveConfig.2 = "14.00" | ||
302 | # enterprises.ucdavis.loadTable.laEntry.loadaveConfig.3 = "14.00" | ||
303 | # enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.1 = 0 | ||
304 | # enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.2 = 0 | ||
305 | # enterprises.ucdavis.loadTable.laEntry.loadaveErrorFlag.3 = 0 | ||
306 | # enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.1 = "" | ||
307 | # enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.2 = "" | ||
308 | # enterprises.ucdavis.loadTable.laEntry.loadaveErrMessage.3 = "" | ||
309 | |||
310 | # ----------------------------------------------------------------------------- | ||
311 | |||
312 | |||
313 | ############################################################################### | ||
314 | # Extensible sections. | ||
315 | # | ||
316 | |||
317 | # This alleviates the multiple line output problem found in the | ||
318 | # previous executable mib by placing each mib in its own mib table: | ||
319 | |||
320 | # Run a shell script containing: | ||
321 | # | ||
322 | # #!/bin/sh | ||
323 | # echo hello world | ||
324 | # echo hi there | ||
325 | # exit 35 | ||
326 | # | ||
327 | # Note: this has been specifically commented out to prevent | ||
328 | # accidental security holes due to someone else on your system writing | ||
329 | # a /tmp/shtest before you do. Uncomment to use it. | ||
330 | # | ||
331 | # exec .1.3.6.1.4.1.2021.50 shelltest /bin/sh /tmp/shtest | ||
332 | |||
333 | # % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.50 | ||
334 | # enterprises.ucdavis.50.1.1 = 1 | ||
335 | # enterprises.ucdavis.50.2.1 = "shelltest" | ||
336 | # enterprises.ucdavis.50.3.1 = "/bin/sh /tmp/shtest" | ||
337 | # enterprises.ucdavis.50.100.1 = 35 | ||
338 | # enterprises.ucdavis.50.101.1 = "hello world." | ||
339 | # enterprises.ucdavis.50.101.2 = "hi there." | ||
340 | # enterprises.ucdavis.50.102.1 = 0 | ||
341 | |||
342 | # Now the Output has grown to two lines, and we can see the 'hi | ||
343 | # there.' output as the second line from our shell script. | ||
344 | # | ||
345 | # Note that you must alter the mib.txt file to be correct if you want | ||
346 | # the .50.* outputs above to change to reasonable text descriptions. | ||
347 | |||
348 | # Other ideas: | ||
349 | # | ||
350 | # exec .1.3.6.1.4.1.2021.51 ps /bin/ps | ||
351 | # exec .1.3.6.1.4.1.2021.52 top /usr/local/bin/top | ||
352 | # exec .1.3.6.1.4.1.2021.53 mailq /usr/bin/mailq | ||
353 | |||
354 | # ----------------------------------------------------------------------------- | ||
355 | |||
356 | |||
357 | ############################################################################### | ||
358 | # Pass through control. | ||
359 | # | ||
360 | |||
361 | # Usage: | ||
362 | # pass MIBOID EXEC-COMMAND | ||
363 | # | ||
364 | # This will pass total control of the mib underneath the MIBOID | ||
365 | # portion of the mib to the EXEC-COMMAND. | ||
366 | # | ||
367 | # Note: You'll have to change the path of the passtest script to your | ||
368 | # source directory or install it in the given location. | ||
369 | # | ||
370 | # Example: (see the script for details) | ||
371 | # (commented out here since it requires that you place the | ||
372 | # script in the right location. (its not installed by default)) | ||
373 | |||
374 | # pass .1.3.6.1.4.1.2021.255 /bin/sh /usr/local/passtest | ||
375 | |||
376 | # % snmpwalk -v 1 -c public localhost .1.3.6.1.4.1.2021.255 | ||
377 | # enterprises.ucdavis.255.1 = "life the universe and everything" | ||
378 | # enterprises.ucdavis.255.2.1 = 42 | ||
379 | # enterprises.ucdavis.255.2.2 = OID: 42.42.42 | ||
380 | # enterprises.ucdavis.255.3 = Timeticks: (363136200) 42 days, 0:42:42 | ||
381 | # enterprises.ucdavis.255.4 = IpAddress: 127.0.0.1 | ||
382 | # enterprises.ucdavis.255.5 = 42 | ||
383 | # enterprises.ucdavis.255.6 = Gauge: 42 | ||
384 | # | ||
385 | # % snmpget -v 1 -c public localhost .1.3.6.1.4.1.2021.255.5 | ||
386 | # enterprises.ucdavis.255.5 = 42 | ||
387 | # | ||
388 | # % snmpset -v 1 -c public localhost .1.3.6.1.4.1.2021.255.1 s "New string" | ||
389 | # enterprises.ucdavis.255.1 = "New string" | ||
390 | # | ||
391 | |||
392 | # For specific usage information, see the man/snmpd.conf.5 manual page | ||
393 | # as well as the local/passtest script used in the above example. | ||
394 | |||
395 | ############################################################################### | ||
396 | # Subagent control | ||
397 | # | ||
398 | |||
399 | # The agent can support subagents using a number of extension mechanisms. | ||
400 | # From the 4.2.1 release, AgentX support is being compiled in by default. | ||
401 | # However, this is still experimental code, so should not be used on | ||
402 | # critical production systems. | ||
403 | # Please see the file README.agentx for more details. | ||
404 | # | ||
405 | # If having read, marked, learnt and inwardly digested this information, | ||
406 | # you decide that you do wish to make use of this mechanism, simply | ||
407 | # uncomment the following directive. | ||
408 | # | ||
409 | # master agentx | ||
410 | # | ||
411 | # I repeat - this is *NOT* regarded as suitable for front-line production | ||
412 | # systems, though it is probably stable enough for day-to-day use. | ||
413 | # Probably. | ||
414 | # | ||
415 | # No refunds will be given. | ||
416 | |||
417 | ############################################################################### | ||
418 | # Further Information | ||
419 | # | ||
420 | # See the snmpd.conf manual page, and the output of "snmpd -H". | ||
421 | # MUCH more can be done with the snmpd.conf than is shown as an | ||
422 | # example here. | ||
diff --git a/meta-networking/recipes-protocols/net-snmp/files/snmptrapd.conf b/meta-networking/recipes-protocols/net-snmp/files/snmptrapd.conf new file mode 100644 index 0000000000..8d2e4375ef --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/files/snmptrapd.conf | |||
@@ -0,0 +1,18 @@ | |||
1 | ############################################################################### | ||
2 | # | ||
3 | # EXAMPLE.conf: | ||
4 | # An example configuration file for configuring the ucd-snmp snmptrapd agent. | ||
5 | # | ||
6 | ############################################################################### | ||
7 | # | ||
8 | # This file is intended to only be an example. If, however, you want | ||
9 | # to use it, it should be placed in /etc/snmp/snmptrapd.conf. | ||
10 | # When the snmptrapd agent starts up, this is where it will look for it. | ||
11 | # | ||
12 | # All lines beginning with a '#' are comments and are intended for you | ||
13 | # to read. All other lines are configuration commands for the agent. | ||
14 | |||
15 | # | ||
16 | # PLEASE: read the snmptrapd.conf(5) manual page as well! | ||
17 | # | ||
18 | |||
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/snmpd.service b/meta-networking/recipes-protocols/net-snmp/net-snmp/snmpd.service new file mode 100644 index 0000000000..10a1eb2128 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/snmpd.service | |||
@@ -0,0 +1,13 @@ | |||
1 | [Unit] | ||
2 | Description=Simple Network Management Protocol (SNMP) Daemon. | ||
3 | After=syslog.target network.target | ||
4 | |||
5 | [Service] | ||
6 | Type=notify | ||
7 | Environment=OPTIONS="-LS0-6d" | ||
8 | EnvironmentFile=-/etc/default/snmpd | ||
9 | ExecStart=/usr/sbin/snmpd $OPTIONS -f | ||
10 | ExecReload=/bin/kill -HUP $MAINPID | ||
11 | |||
12 | [Install] | ||
13 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/snmptrapd.service b/meta-networking/recipes-protocols/net-snmp/net-snmp/snmptrapd.service new file mode 100644 index 0000000000..951f9f2707 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/snmptrapd.service | |||
@@ -0,0 +1,13 @@ | |||
1 | [Unit] | ||
2 | Description=Simple Network Management Protocol (SNMP) Trap Daemon. | ||
3 | After=syslog.target network.target | ||
4 | |||
5 | [Service] | ||
6 | Type=notify | ||
7 | Environment=OPTIONS="-Lsd" | ||
8 | EnvironmentFile=-/etc/default/snmptrapd | ||
9 | ExecStart=/usr/sbin/snmptrapd $OPTIONS -f | ||
10 | ExecReload=/bin/kill -HUP $MAINPID | ||
11 | |||
12 | [Install] | ||
13 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/systemd-support.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/systemd-support.patch new file mode 100644 index 0000000000..e19153bbc4 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/systemd-support.patch | |||
@@ -0,0 +1,1618 @@ | |||
1 | Systemd support backported from the master branch as of 23/04/2012 (post 5.7.1, pre 5.8). | ||
2 | |||
3 | The following commits have been cherry-picked: | ||
4 | |||
5 | 19499c3c90bf9d7b2b9e5d08baa26cc6bba28a11 | ||
6 | fef6cddfdb94da1a6b1fb768af62918b80f11fd3 | ||
7 | 0641e43c694c485cbbffef0556efc4641bd3ff50 | ||
8 | 76530a89f1c8bbd0b63acce63e10d5d4812a1a16 (conflict resolved) | ||
9 | bf108d7f1354f6276fc43c129963f2c49b9fc242 | ||
10 | 3692875172352f72cf3afd0d35f355e83d7e421b | ||
11 | 74412748067c685e1d8ab6ed3bcc3ca9c2774844 | ||
12 | 86132e3f1e6ef7b4e0b96d8fa24e37c81b71b0e0 | ||
13 | 63557cf8986a33dba1d4429b583a901361052c4f | ||
14 | |||
15 | Upstream-Status: Backport | ||
16 | |||
17 | Signed-off-by: Thomas Fitzsimmons <fitzsim@cisco.com> | ||
18 | diff --git a/README.systemd b/README.systemd | ||
19 | new file mode 100644 | ||
20 | index 0000000..f731851 | ||
21 | --- /dev/null | ||
22 | +++ b/README.systemd | ||
23 | @@ -0,0 +1,41 @@ | ||
24 | +README.systemd | ||
25 | +-------------- | ||
26 | +Net-SNMP provides two daemons, which support systemd system manager. | ||
27 | +See http://www.freedesktop.org/wiki/Software/systemd to learn how | ||
28 | +systemd works. Both socket activation and notification is supported by these | ||
29 | +daemons. | ||
30 | + | ||
31 | +To enable systemd support, the sources must be compiled with | ||
32 | +--with-systemd configure option. | ||
33 | + | ||
34 | +snmpd - The SNMP agent | ||
35 | +---------------------- | ||
36 | +Socket activation od snmpd daemon is implemented, but it's discouraged. | ||
37 | +The reason is simple - snmpd not only listens and processes SNMP requests | ||
38 | +from network, but also gathers system statistics counters, sends traps and | ||
39 | +communicates with subagents. It even opens few netlink sockets. | ||
40 | + | ||
41 | +In other words, snmpd should run from system start to properly work. | ||
42 | +This can be done in two ways: | ||
43 | +1) either as snmpd service unit with 'Type=notification' and without a socket | ||
44 | + unit | ||
45 | +2) or as snmpd service unit with 'Type=simple', appropriate socket socket unit | ||
46 | + and the snmpd service enabled. This way systemd creates the snmpd listening | ||
47 | + socket early during boot and passes the sockets to snmpd slightly later | ||
48 | + (but still during machine boot). This way systemd can paralelize start of | ||
49 | + services, which depend on snmpd. Admins must adjust the socket file manually, | ||
50 | + depending if the snmpd support AgentX, IPv6, SMUX etc. | ||
51 | + | ||
52 | +snmpd should be started with '-f' command line parameter to disable forking - | ||
53 | +systemd does that for us automatically. | ||
54 | + | ||
55 | + | ||
56 | +snmptrapd - The trap processing daemon | ||
57 | +-------------------------------------- | ||
58 | +snmptrapd supports full socket activation and also notification (if needed). | ||
59 | +Both 'Type=simple' (with appropriate socket unit) and 'Type=notify' services | ||
60 | +will work. Again, '-f' parameter should be provided on snmptrapd command line. | ||
61 | + | ||
62 | +If integration with SNMP agent using AgentX protocol is enabled, snmptrapd should | ||
63 | +start during boot and not after first SNMP trap arrives. Same rules as for snmpd | ||
64 | +applies then. | ||
65 | \ No newline at end of file | ||
66 | diff --git a/agent/snmpd.c b/agent/snmpd.c | ||
67 | index b177d5b..08bdfc7 100644 | ||
68 | --- a/agent/snmpd.c | ||
69 | +++ b/agent/snmpd.c | ||
70 | @@ -164,6 +164,10 @@ typedef long fd_mask; | ||
71 | |||
72 | #endif | ||
73 | |||
74 | +#ifndef NETSNMP_NO_SYSTEMD | ||
75 | +#include <net-snmp/library/sd-daemon.h> | ||
76 | +#endif | ||
77 | + | ||
78 | netsnmp_feature_want(logging_file) | ||
79 | netsnmp_feature_want(logging_stdio) | ||
80 | netsnmp_feature_want(logging_syslog) | ||
81 | @@ -441,18 +445,28 @@ main(int argc, char *argv[]) | ||
82 | int agent_mode = -1; | ||
83 | char *pid_file = NULL; | ||
84 | char option_compatability[] = "-Le"; | ||
85 | +#ifndef WIN32 | ||
86 | + int prepared_sockets = 0; | ||
87 | +#endif | ||
88 | #if HAVE_GETPID | ||
89 | int fd; | ||
90 | FILE *PID; | ||
91 | #endif | ||
92 | |||
93 | #ifndef WIN32 | ||
94 | +#ifndef NETSNMP_NO_SYSTEMD | ||
95 | + /* check if systemd has sockets for us and don't close them */ | ||
96 | + prepared_sockets = netsnmp_sd_listen_fds(0); | ||
97 | +#endif /* NETSNMP_NO_SYSTEMD */ | ||
98 | + | ||
99 | /* | ||
100 | * close all non-standard file descriptors we may have | ||
101 | * inherited from the shell. | ||
102 | */ | ||
103 | - for (i = getdtablesize() - 1; i > 2; --i) { | ||
104 | - (void) close(i); | ||
105 | + if (!prepared_sockets) { | ||
106 | + for (i = getdtablesize() - 1; i > 2; --i) { | ||
107 | + (void) close(i); | ||
108 | + } | ||
109 | } | ||
110 | #endif /* #WIN32 */ | ||
111 | |||
112 | @@ -1100,6 +1114,19 @@ main(int argc, char *argv[]) | ||
113 | netsnmp_addrcache_initialise(); | ||
114 | |||
115 | /* | ||
116 | + * Let systemd know we're up. | ||
117 | + */ | ||
118 | +#ifndef NETSNMP_NO_SYSTEMD | ||
119 | + netsnmp_sd_notify(1, "READY=1\n"); | ||
120 | + if (prepared_sockets) | ||
121 | + /* | ||
122 | + * Clear the environment variable, we already processed all the sockets | ||
123 | + * by now. | ||
124 | + */ | ||
125 | + netsnmp_sd_listen_fds(1); | ||
126 | +#endif | ||
127 | + | ||
128 | + /* | ||
129 | * Forever monitor the dest_port for incoming PDUs. | ||
130 | */ | ||
131 | DEBUGMSGTL(("snmpd/main", "We're up. Starting to process data.\n")); | ||
132 | diff --git a/apps/snmptrapd.c b/apps/snmptrapd.c | ||
133 | index 1a52080..0857ae1 100644 | ||
134 | --- a/apps/snmptrapd.c | ||
135 | +++ b/apps/snmptrapd.c | ||
136 | @@ -125,6 +125,10 @@ SOFTWARE. | ||
137 | |||
138 | #include <net-snmp/net-snmp-features.h> | ||
139 | |||
140 | +#ifndef NETSNMP_NO_SYSTEMD | ||
141 | +#include <net-snmp/library/sd-daemon.h> | ||
142 | +#endif | ||
143 | + | ||
144 | #ifndef BSD4_3 | ||
145 | #define BSD4_2 | ||
146 | #endif | ||
147 | @@ -655,15 +659,24 @@ main(int argc, char *argv[]) | ||
148 | int agentx_subagent = 1; | ||
149 | #endif | ||
150 | netsnmp_trapd_handler *traph; | ||
151 | +#ifndef WIN32 | ||
152 | + int prepared_sockets = 0; | ||
153 | +#endif | ||
154 | |||
155 | |||
156 | #ifndef WIN32 | ||
157 | +#ifndef NETSNMP_NO_SYSTEMD | ||
158 | + /* check if systemd has sockets for us and don't close them */ | ||
159 | + prepared_sockets = netsnmp_sd_listen_fds(0); | ||
160 | +#endif | ||
161 | /* | ||
162 | * close all non-standard file descriptors we may have | ||
163 | * inherited from the shell. | ||
164 | */ | ||
165 | - for (i = getdtablesize() - 1; i > 2; --i) { | ||
166 | - (void) close(i); | ||
167 | + if (!prepared_sockets) { | ||
168 | + for (i = getdtablesize() - 1; i > 2; --i) { | ||
169 | + (void) close(i); | ||
170 | + } | ||
171 | } | ||
172 | #endif /* #WIN32 */ | ||
173 | |||
174 | @@ -1311,6 +1324,19 @@ main(int argc, char *argv[]) | ||
175 | #endif | ||
176 | #endif | ||
177 | |||
178 | + /* | ||
179 | + * Let systemd know we're up. | ||
180 | + */ | ||
181 | +#ifndef NETSNMP_NO_SYSTEMD | ||
182 | + netsnmp_sd_notify(1, "READY=1\n"); | ||
183 | + if (prepared_sockets) | ||
184 | + /* | ||
185 | + * Clear the environment variable, we already processed all the sockets | ||
186 | + * by now. | ||
187 | + */ | ||
188 | + netsnmp_sd_listen_fds(1); | ||
189 | +#endif | ||
190 | + | ||
191 | #ifdef WIN32SERVICE | ||
192 | trapd_status = SNMPTRAPD_RUNNING; | ||
193 | #endif | ||
194 | diff --git a/configure.d/config_modules_lib b/configure.d/config_modules_lib | ||
195 | index b6609c1..5849072 100644 | ||
196 | --- a/configure.d/config_modules_lib | ||
197 | +++ b/configure.d/config_modules_lib | ||
198 | @@ -53,6 +53,14 @@ if test "x$PARTIALTARGETOS" = "xmingw32" -o "x$PARTIALTARGETOS" = "xmingw32msvc" | ||
199 | other_ftobjs_list="$other_ftobjs_list winpipe.ft" | ||
200 | fi | ||
201 | |||
202 | +# Linux systemd | ||
203 | +if test "x$with_systemd" == "xyes"; then | ||
204 | + other_src_list="$other_src_list sd-daemon.c" | ||
205 | + other_objs_list="$other_objs_list sd-daemon.o" | ||
206 | + other_lobjs_list="$other_lobjs_list sd-daemon.lo" | ||
207 | + other_ftobjs_list="$other_ftobjs_list sd-daemon.ft" | ||
208 | +fi | ||
209 | + | ||
210 | AC_SUBST(other_src_list) | ||
211 | AC_SUBST(other_objs_list) | ||
212 | AC_SUBST(other_lobjs_list) | ||
213 | diff --git a/configure.d/config_project_with_enable b/configure.d/config_project_with_enable | ||
214 | index 8b46ad2..59d6d5c 100644 | ||
215 | --- a/configure.d/config_project_with_enable | ||
216 | +++ b/configure.d/config_project_with_enable | ||
217 | @@ -689,6 +689,15 @@ if test "x$with_dummy_values" != "xyes"; then | ||
218 | data for]) | ||
219 | fi | ||
220 | |||
221 | +NETSNMP_ARG_WITH(systemd, | ||
222 | +[ --with-systemd Provide systemd support. See README.systemd | ||
223 | + for details.]) | ||
224 | +# Define unless specifically suppressed (i.e., option defaults to false). | ||
225 | +if test "x$with_systemd" != "xyes"; then | ||
226 | + AC_DEFINE(NETSNMP_NO_SYSTEMD, 1, | ||
227 | + [If you don't want to integrate with systemd.]) | ||
228 | +fi | ||
229 | + | ||
230 | NETSNMP_ARG_ENABLE(set-support, | ||
231 | [ --disable-set-support Do not allow SNMP set requests.]) | ||
232 | if test "x$enable_set_support" = "xno"; then | ||
233 | diff --git a/dist/snmpd.service b/dist/snmpd.service | ||
234 | new file mode 100644 | ||
235 | index 0000000..31391e5 | ||
236 | --- /dev/null | ||
237 | +++ b/dist/snmpd.service | ||
238 | @@ -0,0 +1,18 @@ | ||
239 | +# | ||
240 | +# SNMP agent service file for systemd | ||
241 | +# | ||
242 | +# | ||
243 | +# The service should be enabled, i.e. snmpd should start during machine boot. | ||
244 | +# Socket activation shall not be used. See README.systemd for details. | ||
245 | + | ||
246 | +[Unit] | ||
247 | +Description=Simple Network Management Protocol (SNMP) daemon. | ||
248 | +After=syslog.target network.target | ||
249 | + | ||
250 | +[Service] | ||
251 | +# Type=notify is also supported. It should be set when snmpd.socket is not used. | ||
252 | +Type=simple | ||
253 | +ExecStart=/usr/sbin/snmpd -f | ||
254 | + | ||
255 | +[Install] | ||
256 | +WantedBy=multi-user.target | ||
257 | diff --git a/dist/snmpd.socket b/dist/snmpd.socket | ||
258 | new file mode 100644 | ||
259 | index 0000000..7f3a2d9 | ||
260 | --- /dev/null | ||
261 | +++ b/dist/snmpd.socket | ||
262 | @@ -0,0 +1,17 @@ | ||
263 | +[Unit] | ||
264 | +Description=Socket listening for SNMP and AgentX messages | ||
265 | + | ||
266 | +[Socket] | ||
267 | +ListenDatagram=0.0.0.0:161 | ||
268 | +# Uncomment other listening addresses as needed - TCP, UDP6, TCP6. | ||
269 | +# It must match listening addresses/ports defined in snmpd.service | ||
270 | +# or snmpd.conf. | ||
271 | +# ListenStream=0.0.0.0:161 | ||
272 | +# ListenDatagram=[::]:161 | ||
273 | +# ListenStream=[::]:161 | ||
274 | +# | ||
275 | +# Uncomment AgentX socket if snmpd.conf enables AgentX protocol. | ||
276 | +# ListenStream=/var/agentx/master | ||
277 | + | ||
278 | +[Install] | ||
279 | +WantedBy=sockets.target | ||
280 | diff --git a/dist/snmptrapd.service b/dist/snmptrapd.service | ||
281 | new file mode 100644 | ||
282 | index 0000000..e88a5b4 | ||
283 | --- /dev/null | ||
284 | +++ b/dist/snmptrapd.service | ||
285 | @@ -0,0 +1,16 @@ | ||
286 | +# | ||
287 | +# SNMP trap-processing service file for systemd | ||
288 | +# | ||
289 | + | ||
290 | +[Unit] | ||
291 | +Description=Simple Network Management Protocol (SNMP) Trap daemon. | ||
292 | +After=syslog.target network.target | ||
293 | + | ||
294 | +[Service] | ||
295 | +# Type=notify is also supported. It should be set when snmptrapd.socket is not | ||
296 | +# used. | ||
297 | +Type=simple | ||
298 | +ExecStart=/usr/sbin/snmptrapd -f | ||
299 | + | ||
300 | +[Install] | ||
301 | +WantedBy=multi-user.target | ||
302 | diff --git a/dist/snmptrapd.socket b/dist/snmptrapd.socket | ||
303 | new file mode 100644 | ||
304 | index 0000000..0fc8a7c | ||
305 | --- /dev/null | ||
306 | +++ b/dist/snmptrapd.socket | ||
307 | @@ -0,0 +1,14 @@ | ||
308 | +[Unit] | ||
309 | +Description=Socket listening for SNMP trap messages | ||
310 | + | ||
311 | +[Socket] | ||
312 | +ListenDatagram=0.0.0.0:162 | ||
313 | +# Uncomment other listening addresses as needed - TCP, UDP6, TCP6. | ||
314 | +# It must match listening addresses/ports defined in snmptrapd.service | ||
315 | +# or snmptrapd.conf. | ||
316 | +# ListenStream=0.0.0.0:162 | ||
317 | +# ListenDatagram=[::]:162 | ||
318 | +# ListenStream=[::]:162 | ||
319 | + | ||
320 | +[Install] | ||
321 | +WantedBy=sockets.target | ||
322 | diff --git a/include/net-snmp/library/sd-daemon.h b/include/net-snmp/library/sd-daemon.h | ||
323 | new file mode 100644 | ||
324 | index 0000000..85274c9 | ||
325 | --- /dev/null | ||
326 | +++ b/include/net-snmp/library/sd-daemon.h | ||
327 | @@ -0,0 +1,290 @@ | ||
328 | +/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ | ||
329 | + | ||
330 | +#ifndef SNMPD_SD_DAEMON_H | ||
331 | +#define SNMPD_SD_DAEMON_H | ||
332 | + | ||
333 | +/*** | ||
334 | + Copyright 2010 Lennart Poettering | ||
335 | + | ||
336 | + Permission is hereby granted, free of charge, to any person | ||
337 | + obtaining a copy of this software and associated documentation files | ||
338 | + (the "Software"), to deal in the Software without restriction, | ||
339 | + including without limitation the rights to use, copy, modify, merge, | ||
340 | + publish, distribute, sublicense, and/or sell copies of the Software, | ||
341 | + and to permit persons to whom the Software is furnished to do so, | ||
342 | + subject to the following conditions: | ||
343 | + | ||
344 | + The above copyright notice and this permission notice shall be | ||
345 | + included in all copies or substantial portions of the Software. | ||
346 | + | ||
347 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
348 | + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
349 | + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
350 | + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
351 | + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
352 | + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
353 | + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
354 | + SOFTWARE. | ||
355 | +***/ | ||
356 | + | ||
357 | +#ifdef HAVE_SYS_TYPES_H | ||
358 | +#include <sys/types.h> | ||
359 | +#endif | ||
360 | +#ifdef HAVE_INTTYPES_H | ||
361 | +#include <inttypes.h> | ||
362 | +#endif | ||
363 | + | ||
364 | +#ifdef __cplusplus | ||
365 | +extern "C" { | ||
366 | +#endif | ||
367 | + | ||
368 | +/* | ||
369 | + Reference implementation of a few systemd related interfaces for | ||
370 | + writing daemons. These interfaces are trivial to implement. To | ||
371 | + simplify porting we provide this reference implementation. | ||
372 | + Applications are welcome to reimplement the algorithms described | ||
373 | + here if they do not want to include these two source files. | ||
374 | + | ||
375 | + The following functionality is provided: | ||
376 | + | ||
377 | + - Support for logging with log levels on stderr | ||
378 | + - File descriptor passing for socket-based activation | ||
379 | + - Daemon startup and status notification | ||
380 | + - Detection of systemd boots | ||
381 | + | ||
382 | + You may compile this with -DDISABLE_SYSTEMD to disable systemd | ||
383 | + support. This makes all those calls NOPs that are directly related to | ||
384 | + systemd (i.e. only sd_is_xxx() will stay useful). | ||
385 | + | ||
386 | + Since this is drop-in code we don't want any of our symbols to be | ||
387 | + exported in any case. Hence we declare hidden visibility for all of | ||
388 | + them. | ||
389 | + | ||
390 | + You may find an up-to-date version of these source files online: | ||
391 | + | ||
392 | + http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h | ||
393 | + http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c | ||
394 | + | ||
395 | + This should compile on non-Linux systems, too, but with the | ||
396 | + exception of the sd_is_xxx() calls all functions will become NOPs. | ||
397 | + | ||
398 | + See sd-daemon(7) for more information. | ||
399 | +*/ | ||
400 | + | ||
401 | +#ifndef _sd_printf_attr_ | ||
402 | +#if __GNUC__ >= 4 | ||
403 | +#define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b))) | ||
404 | +#else | ||
405 | +#define _sd_printf_attr_(a,b) | ||
406 | +#endif | ||
407 | +#endif | ||
408 | + | ||
409 | +/* | ||
410 | + Log levels for usage on stderr: | ||
411 | + | ||
412 | + fprintf(stderr, SD_NOTICE "Hello World!\n"); | ||
413 | + | ||
414 | + This is similar to printk() usage in the kernel. | ||
415 | +*/ | ||
416 | +#define SD_EMERG "<0>" /* system is unusable */ | ||
417 | +#define SD_ALERT "<1>" /* action must be taken immediately */ | ||
418 | +#define SD_CRIT "<2>" /* critical conditions */ | ||
419 | +#define SD_ERR "<3>" /* error conditions */ | ||
420 | +#define SD_WARNING "<4>" /* warning conditions */ | ||
421 | +#define SD_NOTICE "<5>" /* normal but significant condition */ | ||
422 | +#define SD_INFO "<6>" /* informational */ | ||
423 | +#define SD_DEBUG "<7>" /* debug-level messages */ | ||
424 | + | ||
425 | +/* The first passed file descriptor is fd 3 */ | ||
426 | +#define SD_LISTEN_FDS_START 3 | ||
427 | + | ||
428 | +/* | ||
429 | + Returns how many file descriptors have been passed, or a negative | ||
430 | + errno code on failure. Optionally, removes the $LISTEN_FDS and | ||
431 | + $LISTEN_PID file descriptors from the environment (recommended, but | ||
432 | + problematic in threaded environments). If r is the return value of | ||
433 | + this function you'll find the file descriptors passed as fds | ||
434 | + SD_LISTEN_FDS_START to SD_LISTEN_FDS_START+r-1. Returns a negative | ||
435 | + errno style error code on failure. This function call ensures that | ||
436 | + the FD_CLOEXEC flag is set for the passed file descriptors, to make | ||
437 | + sure they are not passed on to child processes. If FD_CLOEXEC shall | ||
438 | + not be set, the caller needs to unset it after this call for all file | ||
439 | + descriptors that are used. | ||
440 | + | ||
441 | + See sd_listen_fds(3) for more information. | ||
442 | +*/ | ||
443 | +int netsnmp_sd_listen_fds(int unset_environment); | ||
444 | + | ||
445 | +/* | ||
446 | + Helper call for identifying a passed file descriptor. Returns 1 if | ||
447 | + the file descriptor is a FIFO in the file system stored under the | ||
448 | + specified path, 0 otherwise. If path is NULL a path name check will | ||
449 | + not be done and the call only verifies if the file descriptor | ||
450 | + refers to a FIFO. Returns a negative errno style error code on | ||
451 | + failure. | ||
452 | + | ||
453 | + See sd_is_fifo(3) for more information. | ||
454 | +*/ | ||
455 | +int netsnmp_sd_is_fifo(int fd, const char *path); | ||
456 | + | ||
457 | +/* | ||
458 | + Helper call for identifying a passed file descriptor. Returns 1 if | ||
459 | + the file descriptor is a special character device on the file | ||
460 | + system stored under the specified path, 0 otherwise. | ||
461 | + If path is NULL a path name check will not be done and the call | ||
462 | + only verifies if the file descriptor refers to a special character. | ||
463 | + Returns a negative errno style error code on failure. | ||
464 | + | ||
465 | + See sd_is_special(3) for more information. | ||
466 | +*/ | ||
467 | +int netsnmp_sd_is_special(int fd, const char *path); | ||
468 | + | ||
469 | +/* | ||
470 | + Helper call for identifying a passed file descriptor. Returns 1 if | ||
471 | + the file descriptor is a socket of the specified family (AF_INET, | ||
472 | + ...) and type (SOCK_DGRAM, SOCK_STREAM, ...), 0 otherwise. If | ||
473 | + family is 0 a socket family check will not be done. If type is 0 a | ||
474 | + socket type check will not be done and the call only verifies if | ||
475 | + the file descriptor refers to a socket. If listening is > 0 it is | ||
476 | + verified that the socket is in listening mode. (i.e. listen() has | ||
477 | + been called) If listening is == 0 it is verified that the socket is | ||
478 | + not in listening mode. If listening is < 0 no listening mode check | ||
479 | + is done. Returns a negative errno style error code on failure. | ||
480 | + | ||
481 | + See sd_is_socket(3) for more information. | ||
482 | +*/ | ||
483 | +int netsnmp_sd_is_socket(int fd, int family, int type, int listening); | ||
484 | + | ||
485 | +/* | ||
486 | + Helper call for identifying a passed file descriptor. Returns 1 if | ||
487 | + the file descriptor is an Internet socket, of the specified family | ||
488 | + (either AF_INET or AF_INET6) and the specified type (SOCK_DGRAM, | ||
489 | + SOCK_STREAM, ...), 0 otherwise. If version is 0 a protocol version | ||
490 | + check is not done. If type is 0 a socket type check will not be | ||
491 | + done. If port is 0 a socket port check will not be done. The | ||
492 | + listening flag is used the same way as in sd_is_socket(). Returns a | ||
493 | + negative errno style error code on failure. | ||
494 | + | ||
495 | + See sd_is_socket_inet(3) for more information. | ||
496 | +*/ | ||
497 | +int netsnmp_sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port); | ||
498 | + | ||
499 | +/* | ||
500 | + Helper call for identifying a passed file descriptor. Returns 1 if | ||
501 | + the file descriptor is an AF_UNIX socket of the specified type | ||
502 | + (SOCK_DGRAM, SOCK_STREAM, ...) and path, 0 otherwise. If type is 0 | ||
503 | + a socket type check will not be done. If path is NULL a socket path | ||
504 | + check will not be done. For normal AF_UNIX sockets set length to | ||
505 | + 0. For abstract namespace sockets set length to the length of the | ||
506 | + socket name (including the initial 0 byte), and pass the full | ||
507 | + socket path in path (including the initial 0 byte). The listening | ||
508 | + flag is used the same way as in sd_is_socket(). Returns a negative | ||
509 | + errno style error code on failure. | ||
510 | + | ||
511 | + See sd_is_socket_unix(3) for more information. | ||
512 | +*/ | ||
513 | +int netsnmp_sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length); | ||
514 | + | ||
515 | +/* | ||
516 | + Informs systemd about changed daemon state. This takes a number of | ||
517 | + newline separated environment-style variable assignments in a | ||
518 | + string. The following variables are known: | ||
519 | + | ||
520 | + READY=1 Tells systemd that daemon startup is finished (only | ||
521 | + relevant for services of Type=notify). The passed | ||
522 | + argument is a boolean "1" or "0". Since there is | ||
523 | + little value in signaling non-readiness the only | ||
524 | + value daemons should send is "READY=1". | ||
525 | + | ||
526 | + STATUS=... Passes a single-line status string back to systemd | ||
527 | + that describes the daemon state. This is free-from | ||
528 | + and can be used for various purposes: general state | ||
529 | + feedback, fsck-like programs could pass completion | ||
530 | + percentages and failing programs could pass a human | ||
531 | + readable error message. Example: "STATUS=Completed | ||
532 | + 66% of file system check..." | ||
533 | + | ||
534 | + ERRNO=... If a daemon fails, the errno-style error code, | ||
535 | + formatted as string. Example: "ERRNO=2" for ENOENT. | ||
536 | + | ||
537 | + BUSERROR=... If a daemon fails, the D-Bus error-style error | ||
538 | + code. Example: "BUSERROR=org.freedesktop.DBus.Error.TimedOut" | ||
539 | + | ||
540 | + MAINPID=... The main pid of a daemon, in case systemd did not | ||
541 | + fork off the process itself. Example: "MAINPID=4711" | ||
542 | + | ||
543 | + Daemons can choose to send additional variables. However, it is | ||
544 | + recommended to prefix variable names not listed above with X_. | ||
545 | + | ||
546 | + Returns a negative errno-style error code on failure. Returns > 0 | ||
547 | + if systemd could be notified, 0 if it couldn't possibly because | ||
548 | + systemd is not running. | ||
549 | + | ||
550 | + Example: When a daemon finished starting up, it could issue this | ||
551 | + call to notify systemd about it: | ||
552 | + | ||
553 | + sd_notify(0, "READY=1"); | ||
554 | + | ||
555 | + See sd_notifyf() for more complete examples. | ||
556 | + | ||
557 | + See sd_notify(3) for more information. | ||
558 | +*/ | ||
559 | +int netsnmp_sd_notify(int unset_environment, const char *state); | ||
560 | + | ||
561 | +/* | ||
562 | + Similar to sd_notify() but takes a format string. | ||
563 | + | ||
564 | + Example 1: A daemon could send the following after initialization: | ||
565 | + | ||
566 | + sd_notifyf(0, "READY=1\n" | ||
567 | + "STATUS=Processing requests...\n" | ||
568 | + "MAINPID=%lu", | ||
569 | + (unsigned long) getpid()); | ||
570 | + | ||
571 | + Example 2: A daemon could send the following shortly before | ||
572 | + exiting, on failure: | ||
573 | + | ||
574 | + sd_notifyf(0, "STATUS=Failed to start up: %s\n" | ||
575 | + "ERRNO=%i", | ||
576 | + strerror(errno), | ||
577 | + errno); | ||
578 | + | ||
579 | + See sd_notifyf(3) for more information. | ||
580 | +*/ | ||
581 | +int netsnmp_sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_attr_(2,3); | ||
582 | + | ||
583 | +/* | ||
584 | + Returns > 0 if the system was booted with systemd. Returns < 0 on | ||
585 | + error. Returns 0 if the system was not booted with systemd. Note | ||
586 | + that all of the functions above handle non-systemd boots just | ||
587 | + fine. You should NOT protect them with a call to this function. Also | ||
588 | + note that this function checks whether the system, not the user | ||
589 | + session is controlled by systemd. However the functions above work | ||
590 | + for both user and system services. | ||
591 | + | ||
592 | + See sd_booted(3) for more information. | ||
593 | +*/ | ||
594 | +int netsnmp_sd_booted(void); | ||
595 | + | ||
596 | +/** | ||
597 | + * Find an socket with given parameters. See man sd_is_socket_inet for | ||
598 | + * description of the arguments. | ||
599 | + * | ||
600 | + * Returns the file descriptor if it is found, 0 otherwise. | ||
601 | + */ | ||
602 | +int netsnmp_sd_find_inet_socket(int family, int type, int listening, int port); | ||
603 | + | ||
604 | +/** | ||
605 | + * Find an unix socket with given parameters. See man sd_is_socket_unix for | ||
606 | + * description of the arguments. | ||
607 | + * | ||
608 | + * Returns the file descriptor if it is found, 0 otherwise. | ||
609 | + */ | ||
610 | +int | ||
611 | +netsnmp_sd_find_unix_socket(int type, int listening, const char *path); | ||
612 | + | ||
613 | +#ifdef __cplusplus | ||
614 | +} | ||
615 | +#endif | ||
616 | + | ||
617 | +#endif /* SNMPD_SD_DAEMON_H */ | ||
618 | diff --git a/snmplib/sd-daemon.c b/snmplib/sd-daemon.c | ||
619 | new file mode 100644 | ||
620 | index 0000000..42dba29 | ||
621 | --- /dev/null | ||
622 | +++ b/snmplib/sd-daemon.c | ||
623 | @@ -0,0 +1,532 @@ | ||
624 | +/* | ||
625 | + * Systemd integration parts. | ||
626 | + * | ||
627 | + * Most of this file is directly copied from systemd sources. | ||
628 | + * Changes: | ||
629 | + * - all functions were renamed to have netsnmp_ prefix | ||
630 | + * - includes were changed to match Net-SNMP style. | ||
631 | + * - removed gcc export macros | ||
632 | + * - removed POSIX message queues | ||
633 | + */ | ||
634 | + | ||
635 | +#include <net-snmp/net-snmp-config.h> | ||
636 | +#include <net-snmp/net-snmp-features.h> | ||
637 | +#include <net-snmp/types.h> | ||
638 | +#include <net-snmp/library/snmp_debug.h> | ||
639 | + | ||
640 | +#ifndef NETSNMP_NO_SYSTEMD | ||
641 | + | ||
642 | +/*** | ||
643 | + Copyright 2010 Lennart Poettering | ||
644 | + | ||
645 | + Permission is hereby granted, free of charge, to any person | ||
646 | + obtaining a copy of this software and associated documentation files | ||
647 | + (the "Software"), to deal in the Software without restriction, | ||
648 | + including without limitation the rights to use, copy, modify, merge, | ||
649 | + publish, distribute, sublicense, and/or sell copies of the Software, | ||
650 | + and to permit persons to whom the Software is furnished to do so, | ||
651 | + subject to the following conditions: | ||
652 | + | ||
653 | + The above copyright notice and this permission notice shall be | ||
654 | + included in all copies or substantial portions of the Software. | ||
655 | + | ||
656 | + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
657 | + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
658 | + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
659 | + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
660 | + BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
661 | + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
662 | + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
663 | + SOFTWARE. | ||
664 | +***/ | ||
665 | + | ||
666 | +#ifndef _GNU_SOURCE | ||
667 | +#define _GNU_SOURCE | ||
668 | +#endif | ||
669 | + | ||
670 | +#include <sys/types.h> | ||
671 | +#include <sys/stat.h> | ||
672 | +#include <sys/socket.h> | ||
673 | +#include <sys/un.h> | ||
674 | +#include <sys/fcntl.h> | ||
675 | +#include <netinet/in.h> | ||
676 | +#include <stdlib.h> | ||
677 | +#include <errno.h> | ||
678 | +#include <unistd.h> | ||
679 | +#include <string.h> | ||
680 | +#include <stdarg.h> | ||
681 | +#include <stdio.h> | ||
682 | +#include <stddef.h> | ||
683 | +#include <limits.h> | ||
684 | + | ||
685 | +#include <net-snmp/library/sd-daemon.h> | ||
686 | + | ||
687 | +int netsnmp_sd_listen_fds(int unset_environment) { | ||
688 | + | ||
689 | + int r, fd; | ||
690 | + const char *e; | ||
691 | + char *p = NULL; | ||
692 | + unsigned long l; | ||
693 | + | ||
694 | + if (!(e = getenv("LISTEN_PID"))) { | ||
695 | + r = 0; | ||
696 | + goto finish; | ||
697 | + } | ||
698 | + | ||
699 | + errno = 0; | ||
700 | + l = strtoul(e, &p, 10); | ||
701 | + | ||
702 | + if (errno != 0) { | ||
703 | + r = -errno; | ||
704 | + goto finish; | ||
705 | + } | ||
706 | + | ||
707 | + if (!p || *p || l <= 0) { | ||
708 | + r = -EINVAL; | ||
709 | + goto finish; | ||
710 | + } | ||
711 | + | ||
712 | + /* Is this for us? */ | ||
713 | + if (getpid() != (pid_t) l) { | ||
714 | + r = 0; | ||
715 | + goto finish; | ||
716 | + } | ||
717 | + | ||
718 | + if (!(e = getenv("LISTEN_FDS"))) { | ||
719 | + r = 0; | ||
720 | + goto finish; | ||
721 | + } | ||
722 | + | ||
723 | + errno = 0; | ||
724 | + l = strtoul(e, &p, 10); | ||
725 | + | ||
726 | + if (errno != 0) { | ||
727 | + r = -errno; | ||
728 | + goto finish; | ||
729 | + } | ||
730 | + | ||
731 | + if (!p || *p) { | ||
732 | + r = -EINVAL; | ||
733 | + goto finish; | ||
734 | + } | ||
735 | + | ||
736 | + for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + (int) l; fd ++) { | ||
737 | + int flags; | ||
738 | + | ||
739 | + if ((flags = fcntl(fd, F_GETFD)) < 0) { | ||
740 | + r = -errno; | ||
741 | + goto finish; | ||
742 | + } | ||
743 | + | ||
744 | + if (flags & FD_CLOEXEC) | ||
745 | + continue; | ||
746 | + | ||
747 | + if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) < 0) { | ||
748 | + r = -errno; | ||
749 | + goto finish; | ||
750 | + } | ||
751 | + } | ||
752 | + | ||
753 | + r = (int) l; | ||
754 | + | ||
755 | +finish: | ||
756 | + if (unset_environment) { | ||
757 | + unsetenv("LISTEN_PID"); | ||
758 | + unsetenv("LISTEN_FDS"); | ||
759 | + } | ||
760 | + | ||
761 | + return r; | ||
762 | +} | ||
763 | + | ||
764 | +int netsnmp_sd_is_fifo(int fd, const char *path) { | ||
765 | + struct stat st_fd; | ||
766 | + | ||
767 | + if (fd < 0) | ||
768 | + return -EINVAL; | ||
769 | + | ||
770 | + memset(&st_fd, 0, sizeof(st_fd)); | ||
771 | + if (fstat(fd, &st_fd) < 0) | ||
772 | + return -errno; | ||
773 | + | ||
774 | + if (!S_ISFIFO(st_fd.st_mode)) | ||
775 | + return 0; | ||
776 | + | ||
777 | + if (path) { | ||
778 | + struct stat st_path; | ||
779 | + | ||
780 | + memset(&st_path, 0, sizeof(st_path)); | ||
781 | + if (stat(path, &st_path) < 0) { | ||
782 | + | ||
783 | + if (errno == ENOENT || errno == ENOTDIR) | ||
784 | + return 0; | ||
785 | + | ||
786 | + return -errno; | ||
787 | + } | ||
788 | + | ||
789 | + return | ||
790 | + st_path.st_dev == st_fd.st_dev && | ||
791 | + st_path.st_ino == st_fd.st_ino; | ||
792 | + } | ||
793 | + | ||
794 | + return 1; | ||
795 | +} | ||
796 | + | ||
797 | +int netsnmp_sd_is_special(int fd, const char *path) { | ||
798 | + struct stat st_fd; | ||
799 | + | ||
800 | + if (fd < 0) | ||
801 | + return -EINVAL; | ||
802 | + | ||
803 | + if (fstat(fd, &st_fd) < 0) | ||
804 | + return -errno; | ||
805 | + | ||
806 | + if (!S_ISREG(st_fd.st_mode) && !S_ISCHR(st_fd.st_mode)) | ||
807 | + return 0; | ||
808 | + | ||
809 | + if (path) { | ||
810 | + struct stat st_path; | ||
811 | + | ||
812 | + if (stat(path, &st_path) < 0) { | ||
813 | + | ||
814 | + if (errno == ENOENT || errno == ENOTDIR) | ||
815 | + return 0; | ||
816 | + | ||
817 | + return -errno; | ||
818 | + } | ||
819 | + | ||
820 | + if (S_ISREG(st_fd.st_mode) && S_ISREG(st_path.st_mode)) | ||
821 | + return | ||
822 | + st_path.st_dev == st_fd.st_dev && | ||
823 | + st_path.st_ino == st_fd.st_ino; | ||
824 | + else if (S_ISCHR(st_fd.st_mode) && S_ISCHR(st_path.st_mode)) | ||
825 | + return st_path.st_rdev == st_fd.st_rdev; | ||
826 | + else | ||
827 | + return 0; | ||
828 | + } | ||
829 | + | ||
830 | + return 1; | ||
831 | +} | ||
832 | + | ||
833 | +static int sd_is_socket_internal(int fd, int type, int listening) { | ||
834 | + struct stat st_fd; | ||
835 | + | ||
836 | + if (fd < 0 || type < 0) | ||
837 | + return -EINVAL; | ||
838 | + | ||
839 | + if (fstat(fd, &st_fd) < 0) | ||
840 | + return -errno; | ||
841 | + | ||
842 | + if (!S_ISSOCK(st_fd.st_mode)) | ||
843 | + return 0; | ||
844 | + | ||
845 | + if (type != 0) { | ||
846 | + int other_type = 0; | ||
847 | + socklen_t l = sizeof(other_type); | ||
848 | + | ||
849 | + if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &other_type, &l) < 0) | ||
850 | + return -errno; | ||
851 | + | ||
852 | + if (l != sizeof(other_type)) | ||
853 | + return -EINVAL; | ||
854 | + | ||
855 | + if (other_type != type) | ||
856 | + return 0; | ||
857 | + } | ||
858 | + | ||
859 | + if (listening >= 0) { | ||
860 | + int accepting = 0; | ||
861 | + socklen_t l = sizeof(accepting); | ||
862 | + | ||
863 | + if (getsockopt(fd, SOL_SOCKET, SO_ACCEPTCONN, &accepting, &l) < 0) | ||
864 | + return -errno; | ||
865 | + | ||
866 | + if (l != sizeof(accepting)) | ||
867 | + return -EINVAL; | ||
868 | + | ||
869 | + if (!accepting != !listening) | ||
870 | + return 0; | ||
871 | + } | ||
872 | + | ||
873 | + return 1; | ||
874 | +} | ||
875 | + | ||
876 | +union sockaddr_union { | ||
877 | + struct sockaddr sa; | ||
878 | + struct sockaddr_in in4; | ||
879 | + struct sockaddr_in6 in6; | ||
880 | + struct sockaddr_un un; | ||
881 | + struct sockaddr_storage storage; | ||
882 | +}; | ||
883 | + | ||
884 | +int netsnmp_sd_is_socket(int fd, int family, int type, int listening) { | ||
885 | + int r; | ||
886 | + | ||
887 | + if (family < 0) | ||
888 | + return -EINVAL; | ||
889 | + | ||
890 | + if ((r = sd_is_socket_internal(fd, type, listening)) <= 0) | ||
891 | + return r; | ||
892 | + | ||
893 | + if (family > 0) { | ||
894 | + union sockaddr_union sockaddr; | ||
895 | + socklen_t l; | ||
896 | + | ||
897 | + memset(&sockaddr, 0, sizeof(sockaddr)); | ||
898 | + l = sizeof(sockaddr); | ||
899 | + | ||
900 | + if (getsockname(fd, &sockaddr.sa, &l) < 0) | ||
901 | + return -errno; | ||
902 | + | ||
903 | + if (l < sizeof(sa_family_t)) | ||
904 | + return -EINVAL; | ||
905 | + | ||
906 | + return sockaddr.sa.sa_family == family; | ||
907 | + } | ||
908 | + | ||
909 | + return 1; | ||
910 | +} | ||
911 | + | ||
912 | +int netsnmp_sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) { | ||
913 | + union sockaddr_union sockaddr; | ||
914 | + socklen_t l; | ||
915 | + int r; | ||
916 | + | ||
917 | + if (family != 0 && family != AF_INET && family != AF_INET6) | ||
918 | + return -EINVAL; | ||
919 | + | ||
920 | + if ((r = sd_is_socket_internal(fd, type, listening)) <= 0) | ||
921 | + return r; | ||
922 | + | ||
923 | + memset(&sockaddr, 0, sizeof(sockaddr)); | ||
924 | + l = sizeof(sockaddr); | ||
925 | + | ||
926 | + if (getsockname(fd, &sockaddr.sa, &l) < 0) | ||
927 | + return -errno; | ||
928 | + | ||
929 | + if (l < sizeof(sa_family_t)) | ||
930 | + return -EINVAL; | ||
931 | + | ||
932 | + if (sockaddr.sa.sa_family != AF_INET && | ||
933 | + sockaddr.sa.sa_family != AF_INET6) | ||
934 | + return 0; | ||
935 | + | ||
936 | + if (family > 0) | ||
937 | + if (sockaddr.sa.sa_family != family) | ||
938 | + return 0; | ||
939 | + | ||
940 | + if (port > 0) { | ||
941 | + if (sockaddr.sa.sa_family == AF_INET) { | ||
942 | + if (l < sizeof(struct sockaddr_in)) | ||
943 | + return -EINVAL; | ||
944 | + | ||
945 | + return htons(port) == sockaddr.in4.sin_port; | ||
946 | + } else { | ||
947 | + if (l < sizeof(struct sockaddr_in6)) | ||
948 | + return -EINVAL; | ||
949 | + | ||
950 | + return htons(port) == sockaddr.in6.sin6_port; | ||
951 | + } | ||
952 | + } | ||
953 | + | ||
954 | + return 1; | ||
955 | +} | ||
956 | + | ||
957 | +int netsnmp_sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) { | ||
958 | + union sockaddr_union sockaddr; | ||
959 | + socklen_t l; | ||
960 | + int r; | ||
961 | + | ||
962 | + if ((r = sd_is_socket_internal(fd, type, listening)) <= 0) | ||
963 | + return r; | ||
964 | + | ||
965 | + memset(&sockaddr, 0, sizeof(sockaddr)); | ||
966 | + l = sizeof(sockaddr); | ||
967 | + | ||
968 | + if (getsockname(fd, &sockaddr.sa, &l) < 0) | ||
969 | + return -errno; | ||
970 | + | ||
971 | + if (l < sizeof(sa_family_t)) | ||
972 | + return -EINVAL; | ||
973 | + | ||
974 | + if (sockaddr.sa.sa_family != AF_UNIX) | ||
975 | + return 0; | ||
976 | + | ||
977 | + if (path) { | ||
978 | + if (length <= 0) | ||
979 | + length = strlen(path); | ||
980 | + | ||
981 | + if (length <= 0) | ||
982 | + /* Unnamed socket */ | ||
983 | + return l == offsetof(struct sockaddr_un, sun_path); | ||
984 | + | ||
985 | + if (path[0]) | ||
986 | + /* Normal path socket */ | ||
987 | + return | ||
988 | + (l >= offsetof(struct sockaddr_un, sun_path) + length + 1) && | ||
989 | + memcmp(path, sockaddr.un.sun_path, length+1) == 0; | ||
990 | + else | ||
991 | + /* Abstract namespace socket */ | ||
992 | + return | ||
993 | + (l == offsetof(struct sockaddr_un, sun_path) + length) && | ||
994 | + memcmp(path, sockaddr.un.sun_path, length) == 0; | ||
995 | + } | ||
996 | + | ||
997 | + return 1; | ||
998 | +} | ||
999 | + | ||
1000 | +int netsnmp_sd_notify(int unset_environment, const char *state) { | ||
1001 | + int fd = -1, r; | ||
1002 | + struct msghdr msghdr; | ||
1003 | + struct iovec iovec; | ||
1004 | + union sockaddr_union sockaddr; | ||
1005 | + const char *e; | ||
1006 | + | ||
1007 | + if (!state) { | ||
1008 | + r = -EINVAL; | ||
1009 | + goto finish; | ||
1010 | + } | ||
1011 | + | ||
1012 | + if (!(e = getenv("NOTIFY_SOCKET"))) | ||
1013 | + return 0; | ||
1014 | + | ||
1015 | + /* Must be an abstract socket, or an absolute path */ | ||
1016 | + if ((e[0] != '@' && e[0] != '/') || e[1] == 0) { | ||
1017 | + r = -EINVAL; | ||
1018 | + goto finish; | ||
1019 | + } | ||
1020 | + | ||
1021 | + if ((fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0)) < 0) { | ||
1022 | + r = -errno; | ||
1023 | + goto finish; | ||
1024 | + } | ||
1025 | + | ||
1026 | + memset(&sockaddr, 0, sizeof(sockaddr)); | ||
1027 | + sockaddr.sa.sa_family = AF_UNIX; | ||
1028 | + strncpy(sockaddr.un.sun_path, e, sizeof(sockaddr.un.sun_path)); | ||
1029 | + | ||
1030 | + if (sockaddr.un.sun_path[0] == '@') | ||
1031 | + sockaddr.un.sun_path[0] = 0; | ||
1032 | + | ||
1033 | + memset(&iovec, 0, sizeof(iovec)); | ||
1034 | + iovec.iov_base = (char *)state; | ||
1035 | + iovec.iov_len = strlen(state); | ||
1036 | + | ||
1037 | + memset(&msghdr, 0, sizeof(msghdr)); | ||
1038 | + msghdr.msg_name = &sockaddr; | ||
1039 | + msghdr.msg_namelen = offsetof(struct sockaddr_un, sun_path) + strlen(e); | ||
1040 | + | ||
1041 | + if (msghdr.msg_namelen > sizeof(struct sockaddr_un)) | ||
1042 | + msghdr.msg_namelen = sizeof(struct sockaddr_un); | ||
1043 | + | ||
1044 | + msghdr.msg_iov = &iovec; | ||
1045 | + msghdr.msg_iovlen = 1; | ||
1046 | + | ||
1047 | + if (sendmsg(fd, &msghdr, MSG_NOSIGNAL) < 0) { | ||
1048 | + r = -errno; | ||
1049 | + goto finish; | ||
1050 | + } | ||
1051 | + | ||
1052 | + r = 1; | ||
1053 | + | ||
1054 | +finish: | ||
1055 | + if (unset_environment) | ||
1056 | + unsetenv("NOTIFY_SOCKET"); | ||
1057 | + | ||
1058 | + if (fd >= 0) | ||
1059 | + close(fd); | ||
1060 | + | ||
1061 | + return r; | ||
1062 | +} | ||
1063 | + | ||
1064 | +int netsnmp_sd_notifyf(int unset_environment, const char *format, ...) { | ||
1065 | + va_list ap; | ||
1066 | + char *p = NULL; | ||
1067 | + int r; | ||
1068 | + | ||
1069 | + va_start(ap, format); | ||
1070 | + r = vasprintf(&p, format, ap); | ||
1071 | + va_end(ap); | ||
1072 | + | ||
1073 | + if (r < 0 || !p) | ||
1074 | + return -ENOMEM; | ||
1075 | + | ||
1076 | + r = netsnmp_sd_notify(unset_environment, p); | ||
1077 | + free(p); | ||
1078 | + | ||
1079 | + return r; | ||
1080 | +} | ||
1081 | + | ||
1082 | +int netsnmp_sd_booted(void) { | ||
1083 | + struct stat a, b; | ||
1084 | + | ||
1085 | + /* We simply test whether the systemd cgroup hierarchy is | ||
1086 | + * mounted */ | ||
1087 | + | ||
1088 | + if (lstat("/sys/fs/cgroup", &a) < 0) | ||
1089 | + return 0; | ||
1090 | + | ||
1091 | + if (lstat("/sys/fs/cgroup/systemd", &b) < 0) | ||
1092 | + return 0; | ||
1093 | + | ||
1094 | + return a.st_dev != b.st_dev; | ||
1095 | +} | ||
1096 | + | ||
1097 | +/* End of original sd-daemon.c from systemd sources */ | ||
1098 | + | ||
1099 | +int | ||
1100 | +netsnmp_sd_find_inet_socket(int family, int type, int listening, int port) | ||
1101 | +{ | ||
1102 | + int count, fd; | ||
1103 | + | ||
1104 | + count = netsnmp_sd_listen_fds(0); | ||
1105 | + if (count <= 0) { | ||
1106 | + DEBUGMSGTL(("systemd:find_inet_socket", "No LISTEN_FDS found.\n")); | ||
1107 | + return 0; | ||
1108 | + } | ||
1109 | + DEBUGMSGTL(("systemd:find_inet_socket", "LISTEN_FDS reports %d sockets.\n", | ||
1110 | + count)); | ||
1111 | + | ||
1112 | + for (fd = 3; fd < 3+count; fd++) { | ||
1113 | + int rc = netsnmp_sd_is_socket_inet(fd, family, type, listening, port); | ||
1114 | + if (rc < 0) | ||
1115 | + DEBUGMSGTL(("systemd:find_inet_socket", | ||
1116 | + "sd_is_socket_inet error: %d\n", rc)); | ||
1117 | + if (rc > 0) { | ||
1118 | + DEBUGMSGTL(("systemd:find_inet_socket", | ||
1119 | + "Found the socket in LISTEN_FDS\n")); | ||
1120 | + return fd; | ||
1121 | + } | ||
1122 | + } | ||
1123 | + DEBUGMSGTL(("systemd:find_inet_socket", "Socket not found in LISTEN_FDS\n")); | ||
1124 | + return 0; | ||
1125 | +} | ||
1126 | + | ||
1127 | +int | ||
1128 | +netsnmp_sd_find_unix_socket(int type, int listening, const char *path) | ||
1129 | +{ | ||
1130 | + int count, fd; | ||
1131 | + | ||
1132 | + count = netsnmp_sd_listen_fds(0); | ||
1133 | + if (count <= 0) { | ||
1134 | + DEBUGMSGTL(("systemd:find_unix_socket", "No LISTEN_FDS found.\n")); | ||
1135 | + return 0; | ||
1136 | + } | ||
1137 | + DEBUGMSGTL(("systemd:find_unix_socket", "LISTEN_FDS reports %d sockets.\n", | ||
1138 | + count)); | ||
1139 | + | ||
1140 | + for (fd = 3; fd < 3+count; fd++) { | ||
1141 | + int rc = netsnmp_sd_is_socket_unix(fd, type, listening, path, 0); | ||
1142 | + if (rc < 0) | ||
1143 | + DEBUGMSGTL(("systemd:find_unix_socket", | ||
1144 | + "netsnmp_sd_is_socket_unix error: %d\n", rc)); | ||
1145 | + if (rc > 0) { | ||
1146 | + DEBUGMSGTL(("systemd:find_unix_socket", | ||
1147 | + "Found the socket in LISTEN_FDS\n")); | ||
1148 | + return fd; | ||
1149 | + } | ||
1150 | + } | ||
1151 | + DEBUGMSGTL(("systemd:find_unix_socket", "Socket not found in LISTEN_FDS\n")); | ||
1152 | + return 0; | ||
1153 | +} | ||
1154 | + | ||
1155 | +#endif /* ! NETSNMP_NO_SYSTEMD */ | ||
1156 | diff --git a/snmplib/transports/snmpTCPDomain.c b/snmplib/transports/snmpTCPDomain.c | ||
1157 | index b8bdba4..ab7f3a1 100644 | ||
1158 | --- a/snmplib/transports/snmpTCPDomain.c | ||
1159 | +++ b/snmplib/transports/snmpTCPDomain.c | ||
1160 | @@ -43,6 +43,10 @@ | ||
1161 | #include <net-snmp/library/snmpTCPBaseDomain.h> | ||
1162 | #include <net-snmp/library/tools.h> | ||
1163 | |||
1164 | +#ifndef NETSNMP_NO_SYSTEMD | ||
1165 | +#include <net-snmp/library/sd-daemon.h> | ||
1166 | +#endif | ||
1167 | + | ||
1168 | /* | ||
1169 | * needs to be in sync with the definitions in snmplib/snmpUDPDomain.c | ||
1170 | * and perl/agent/agent.xs | ||
1171 | @@ -149,6 +153,7 @@ netsnmp_tcp_transport(struct sockaddr_in *addr, int local) | ||
1172 | netsnmp_transport *t = NULL; | ||
1173 | netsnmp_udp_addr_pair *addr_pair = NULL; | ||
1174 | int rc = 0; | ||
1175 | + int socket_initialized = 0; | ||
1176 | |||
1177 | #ifdef NETSNMP_NO_LISTEN_SUPPORT | ||
1178 | if (local) | ||
1179 | @@ -178,7 +183,19 @@ netsnmp_tcp_transport(struct sockaddr_in *addr, int local) | ||
1180 | t->domain_length = | ||
1181 | sizeof(netsnmp_snmpTCPDomain) / sizeof(netsnmp_snmpTCPDomain[0]); | ||
1182 | |||
1183 | - t->sock = socket(PF_INET, SOCK_STREAM, 0); | ||
1184 | +#ifndef NETSNMP_NO_SYSTEMD | ||
1185 | + /* | ||
1186 | + * Maybe the socket was already provided by systemd... | ||
1187 | + */ | ||
1188 | + if (local) { | ||
1189 | + t->sock = netsnmp_sd_find_inet_socket(PF_INET, SOCK_STREAM, 1, | ||
1190 | + ntohs(addr->sin_port)); | ||
1191 | + if (t->sock) | ||
1192 | + socket_initialized = 1; | ||
1193 | + } | ||
1194 | +#endif | ||
1195 | + if (!socket_initialized) | ||
1196 | + t->sock = socket(PF_INET, SOCK_STREAM, 0); | ||
1197 | if (t->sock < 0) { | ||
1198 | netsnmp_transport_free(t); | ||
1199 | return NULL; | ||
1200 | @@ -215,11 +232,13 @@ netsnmp_tcp_transport(struct sockaddr_in *addr, int local) | ||
1201 | setsockopt(t->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&opt, | ||
1202 | sizeof(opt)); | ||
1203 | |||
1204 | - rc = bind(t->sock, (struct sockaddr *)addr, sizeof(struct sockaddr)); | ||
1205 | - if (rc != 0) { | ||
1206 | - netsnmp_socketbase_close(t); | ||
1207 | - netsnmp_transport_free(t); | ||
1208 | - return NULL; | ||
1209 | + if (!socket_initialized) { | ||
1210 | + rc = bind(t->sock, (struct sockaddr *)addr, sizeof(struct sockaddr)); | ||
1211 | + if (rc != 0) { | ||
1212 | + netsnmp_socketbase_close(t); | ||
1213 | + netsnmp_transport_free(t); | ||
1214 | + return NULL; | ||
1215 | + } | ||
1216 | } | ||
1217 | |||
1218 | /* | ||
1219 | @@ -235,12 +254,13 @@ netsnmp_tcp_transport(struct sockaddr_in *addr, int local) | ||
1220 | /* | ||
1221 | * Now sit here and wait for connections to arrive. | ||
1222 | */ | ||
1223 | - | ||
1224 | - rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); | ||
1225 | - if (rc != 0) { | ||
1226 | - netsnmp_socketbase_close(t); | ||
1227 | - netsnmp_transport_free(t); | ||
1228 | - return NULL; | ||
1229 | + if (!socket_initialized) { | ||
1230 | + rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); | ||
1231 | + if (rc != 0) { | ||
1232 | + netsnmp_socketbase_close(t); | ||
1233 | + netsnmp_transport_free(t); | ||
1234 | + return NULL; | ||
1235 | + } | ||
1236 | } | ||
1237 | |||
1238 | /* | ||
1239 | diff --git a/snmplib/transports/snmpTCPIPv6Domain.c b/snmplib/transports/snmpTCPIPv6Domain.c | ||
1240 | index 3c96856..305a861 100644 | ||
1241 | --- a/snmplib/transports/snmpTCPIPv6Domain.c | ||
1242 | +++ b/snmplib/transports/snmpTCPIPv6Domain.c | ||
1243 | @@ -49,6 +49,10 @@ | ||
1244 | #include <net-snmp/library/snmpTCPBaseDomain.h> | ||
1245 | #include <net-snmp/library/tools.h> | ||
1246 | |||
1247 | +#ifndef NETSNMP_NO_SYSTEMD | ||
1248 | +#include <net-snmp/library/sd-daemon.h> | ||
1249 | +#endif | ||
1250 | + | ||
1251 | #include "inet_ntop.h" | ||
1252 | |||
1253 | oid netsnmp_TCPIPv6Domain[] = { TRANSPORT_DOMAIN_TCP_IPV6 }; | ||
1254 | @@ -140,6 +144,8 @@ netsnmp_tcp6_transport(struct sockaddr_in6 *addr, int local) | ||
1255 | { | ||
1256 | netsnmp_transport *t = NULL; | ||
1257 | int rc = 0; | ||
1258 | + char *str = NULL; | ||
1259 | + int socket_initialized = 0; | ||
1260 | |||
1261 | #ifdef NETSNMP_NO_LISTEN_SUPPORT | ||
1262 | if (local) | ||
1263 | @@ -174,7 +180,19 @@ netsnmp_tcp6_transport(struct sockaddr_in6 *addr, int local) | ||
1264 | t->domain = netsnmp_TCPIPv6Domain; | ||
1265 | t->domain_length = sizeof(netsnmp_TCPIPv6Domain) / sizeof(oid); | ||
1266 | |||
1267 | - t->sock = socket(PF_INET6, SOCK_STREAM, 0); | ||
1268 | +#ifndef NETSNMP_NO_SYSTEMD | ||
1269 | + /* | ||
1270 | + * Maybe the socket was already provided by systemd... | ||
1271 | + */ | ||
1272 | + if (local) { | ||
1273 | + t->sock = netsnmp_sd_find_inet_socket(PF_INET6, SOCK_STREAM, 1, | ||
1274 | + ntohs(addr->sin6_port)); | ||
1275 | + if (t->sock) | ||
1276 | + socket_initialized = 1; | ||
1277 | + } | ||
1278 | +#endif | ||
1279 | + if (!socket_initialized) | ||
1280 | + t->sock = socket(PF_INET6, SOCK_STREAM, 0); | ||
1281 | if (t->sock < 0) { | ||
1282 | netsnmp_transport_free(t); | ||
1283 | return NULL; | ||
1284 | @@ -220,12 +238,14 @@ netsnmp_tcp6_transport(struct sockaddr_in6 *addr, int local) | ||
1285 | |||
1286 | setsockopt(t->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&opt, sizeof(opt)); | ||
1287 | |||
1288 | - rc = bind(t->sock, (struct sockaddr *) addr, | ||
1289 | - sizeof(struct sockaddr_in6)); | ||
1290 | - if (rc != 0) { | ||
1291 | - netsnmp_socketbase_close(t); | ||
1292 | - netsnmp_transport_free(t); | ||
1293 | - return NULL; | ||
1294 | + if (!socket_initialized) { | ||
1295 | + rc = bind(t->sock, (struct sockaddr *) addr, | ||
1296 | + sizeof(struct sockaddr_in6)); | ||
1297 | + if (rc != 0) { | ||
1298 | + netsnmp_socketbase_close(t); | ||
1299 | + netsnmp_transport_free(t); | ||
1300 | + return NULL; | ||
1301 | + } | ||
1302 | } | ||
1303 | |||
1304 | /* | ||
1305 | @@ -242,11 +262,13 @@ netsnmp_tcp6_transport(struct sockaddr_in6 *addr, int local) | ||
1306 | * Now sit here and wait for connections to arrive. | ||
1307 | */ | ||
1308 | |||
1309 | - rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); | ||
1310 | - if (rc != 0) { | ||
1311 | - netsnmp_socketbase_close(t); | ||
1312 | - netsnmp_transport_free(t); | ||
1313 | - return NULL; | ||
1314 | + if (!socket_initialized) { | ||
1315 | + rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); | ||
1316 | + if (rc != 0) { | ||
1317 | + netsnmp_socketbase_close(t); | ||
1318 | + netsnmp_transport_free(t); | ||
1319 | + return NULL; | ||
1320 | + } | ||
1321 | } | ||
1322 | |||
1323 | /* | ||
1324 | diff --git a/snmplib/transports/snmpUDPIPv4BaseDomain.c b/snmplib/transports/snmpUDPIPv4BaseDomain.c | ||
1325 | index c67427b..428e6d6 100644 | ||
1326 | --- a/snmplib/transports/snmpUDPIPv4BaseDomain.c | ||
1327 | +++ b/snmplib/transports/snmpUDPIPv4BaseDomain.c | ||
1328 | @@ -40,6 +40,10 @@ | ||
1329 | |||
1330 | #include <net-snmp/library/snmpSocketBaseDomain.h> | ||
1331 | |||
1332 | +#ifndef NETSNMP_NO_SYSTEMD | ||
1333 | +#include <net-snmp/library/sd-daemon.h> | ||
1334 | +#endif | ||
1335 | + | ||
1336 | #if (defined(linux) && defined(IP_PKTINFO)) \ | ||
1337 | || defined(IP_RECVDSTADDR) && HAVE_STRUCT_MSGHDR_MSG_CONTROL \ | ||
1338 | && HAVE_STRUCT_MSGHDR_MSG_FLAGS | ||
1339 | @@ -67,6 +71,7 @@ netsnmp_udpipv4base_transport(struct sockaddr_in *addr, int local) | ||
1340 | char *client_socket = NULL; | ||
1341 | netsnmp_indexed_addr_pair addr_pair; | ||
1342 | socklen_t local_addr_len; | ||
1343 | + int socket_initialized = 0; | ||
1344 | |||
1345 | #ifdef NETSNMP_NO_LISTEN_SUPPORT | ||
1346 | if (local) | ||
1347 | @@ -91,7 +96,19 @@ netsnmp_udpipv4base_transport(struct sockaddr_in *addr, int local) | ||
1348 | free(str); | ||
1349 | } | ||
1350 | |||
1351 | - t->sock = socket(PF_INET, SOCK_DGRAM, 0); | ||
1352 | +#ifndef NETSNMP_NO_SYSTEMD | ||
1353 | + /* | ||
1354 | + * Maybe the socket was already provided by systemd... | ||
1355 | + */ | ||
1356 | + if (local) { | ||
1357 | + t->sock = netsnmp_sd_find_inet_socket(PF_INET, SOCK_DGRAM, -1, | ||
1358 | + ntohs(addr->sin_port)); | ||
1359 | + if (t->sock) | ||
1360 | + socket_initialized = 1; | ||
1361 | + } | ||
1362 | +#endif | ||
1363 | + if (!socket_initialized) | ||
1364 | + t->sock = socket(PF_INET, SOCK_DGRAM, 0); | ||
1365 | DEBUGMSGTL(("UDPBase", "openned socket %d as local=%d\n", t->sock, local)); | ||
1366 | if (t->sock < 0) { | ||
1367 | netsnmp_transport_free(t); | ||
1368 | @@ -141,12 +158,14 @@ netsnmp_udpipv4base_transport(struct sockaddr_in *addr, int local) | ||
1369 | DEBUGMSGTL(("netsnmp_udp", "set IP_RECVDSTADDR\n")); | ||
1370 | } | ||
1371 | #endif | ||
1372 | - rc = bind(t->sock, (struct sockaddr *) addr, | ||
1373 | - sizeof(struct sockaddr)); | ||
1374 | - if (rc != 0) { | ||
1375 | - netsnmp_socketbase_close(t); | ||
1376 | - netsnmp_transport_free(t); | ||
1377 | - return NULL; | ||
1378 | + if (!socket_initialized) { | ||
1379 | + rc = bind(t->sock, (struct sockaddr *) addr, | ||
1380 | + sizeof(struct sockaddr)); | ||
1381 | + if (rc != 0) { | ||
1382 | + netsnmp_socketbase_close(t); | ||
1383 | + netsnmp_transport_free(t); | ||
1384 | + return NULL; | ||
1385 | + } | ||
1386 | } | ||
1387 | t->data = NULL; | ||
1388 | t->data_length = 0; | ||
1389 | diff --git a/snmplib/transports/snmpUDPIPv6Domain.c b/snmplib/transports/snmpUDPIPv6Domain.c | ||
1390 | index b3eaae4..35b617f 100644 | ||
1391 | --- a/snmplib/transports/snmpUDPIPv6Domain.c | ||
1392 | +++ b/snmplib/transports/snmpUDPIPv6Domain.c | ||
1393 | @@ -67,6 +67,10 @@ static const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT; | ||
1394 | #include <net-snmp/library/snmpSocketBaseDomain.h> | ||
1395 | #include <net-snmp/library/tools.h> | ||
1396 | |||
1397 | +#ifndef NETSNMP_NO_SYSTEMD | ||
1398 | +#include <net-snmp/library/sd-daemon.h> | ||
1399 | +#endif | ||
1400 | + | ||
1401 | #include "inet_ntop.h" | ||
1402 | #include "inet_pton.h" | ||
1403 | |||
1404 | @@ -190,6 +194,8 @@ netsnmp_udp6_transport(struct sockaddr_in6 *addr, int local) | ||
1405 | { | ||
1406 | netsnmp_transport *t = NULL; | ||
1407 | int rc = 0; | ||
1408 | + char *str = NULL; | ||
1409 | + int socket_initialized = 0; | ||
1410 | |||
1411 | #ifdef NETSNMP_NO_LISTEN_SUPPORT | ||
1412 | if (local) | ||
1413 | @@ -217,7 +223,19 @@ netsnmp_udp6_transport(struct sockaddr_in6 *addr, int local) | ||
1414 | t->domain_length = | ||
1415 | sizeof(netsnmp_UDPIPv6Domain) / sizeof(netsnmp_UDPIPv6Domain[0]); | ||
1416 | |||
1417 | - t->sock = socket(PF_INET6, SOCK_DGRAM, 0); | ||
1418 | +#ifndef NETSNMP_NO_SYSTEMD | ||
1419 | + /* | ||
1420 | + * Maybe the socket was already provided by systemd... | ||
1421 | + */ | ||
1422 | + if (local) { | ||
1423 | + t->sock = netsnmp_sd_find_inet_socket(PF_INET6, SOCK_DGRAM, -1, | ||
1424 | + ntohs(addr->sin6_port)); | ||
1425 | + if (t->sock) | ||
1426 | + socket_initialized = 1; | ||
1427 | + } | ||
1428 | +#endif | ||
1429 | + if (!socket_initialized) | ||
1430 | + t->sock = socket(PF_INET6, SOCK_DGRAM, 0); | ||
1431 | if (t->sock < 0) { | ||
1432 | netsnmp_transport_free(t); | ||
1433 | return NULL; | ||
1434 | @@ -242,13 +260,14 @@ netsnmp_udp6_transport(struct sockaddr_in6 *addr, int local) | ||
1435 | } | ||
1436 | } | ||
1437 | #endif | ||
1438 | - | ||
1439 | - rc = bind(t->sock, (struct sockaddr *) addr, | ||
1440 | - sizeof(struct sockaddr_in6)); | ||
1441 | - if (rc != 0) { | ||
1442 | - netsnmp_socketbase_close(t); | ||
1443 | - netsnmp_transport_free(t); | ||
1444 | - return NULL; | ||
1445 | + if (!socket_initialized) { | ||
1446 | + rc = bind(t->sock, (struct sockaddr *) addr, | ||
1447 | + sizeof(struct sockaddr_in6)); | ||
1448 | + if (rc != 0) { | ||
1449 | + netsnmp_socketbase_close(t); | ||
1450 | + netsnmp_transport_free(t); | ||
1451 | + return NULL; | ||
1452 | + } | ||
1453 | } | ||
1454 | t->local = (unsigned char*)malloc(18); | ||
1455 | if (t->local == NULL) { | ||
1456 | diff --git a/snmplib/transports/snmpUnixDomain.c b/snmplib/transports/snmpUnixDomain.c | ||
1457 | index 674dc2b..9f3d3cb 100644 | ||
1458 | --- a/snmplib/transports/snmpUnixDomain.c | ||
1459 | +++ b/snmplib/transports/snmpUnixDomain.c | ||
1460 | @@ -37,6 +37,10 @@ | ||
1461 | #include <net-snmp/library/system.h> /* mkdirhier */ | ||
1462 | #include <net-snmp/library/tools.h> | ||
1463 | |||
1464 | +#ifndef NETSNMP_NO_SYSTEMD | ||
1465 | +#include <net-snmp/library/sd-daemon.h> | ||
1466 | +#endif | ||
1467 | + | ||
1468 | netsnmp_feature_child_of(transport_unix_socket_all, transport_all) | ||
1469 | netsnmp_feature_child_of(unix_socket_paths, transport_unix_socket_all) | ||
1470 | |||
1471 | @@ -295,6 +299,8 @@ netsnmp_unix_transport(struct sockaddr_un *addr, int local) | ||
1472 | netsnmp_transport *t = NULL; | ||
1473 | sockaddr_un_pair *sup = NULL; | ||
1474 | int rc = 0; | ||
1475 | + char *string = NULL; | ||
1476 | + int socket_initialized = 0; | ||
1477 | |||
1478 | #ifdef NETSNMP_NO_LISTEN_SUPPORT | ||
1479 | /* SPECIAL CIRCUMSTANCE: We still want AgentX to be able to operate, | ||
1480 | @@ -333,7 +339,18 @@ netsnmp_unix_transport(struct sockaddr_un *addr, int local) | ||
1481 | t->data_length = sizeof(sockaddr_un_pair); | ||
1482 | sup = (sockaddr_un_pair *) t->data; | ||
1483 | |||
1484 | - t->sock = socket(PF_UNIX, SOCK_STREAM, 0); | ||
1485 | +#ifndef NETSNMP_NO_SYSTEMD | ||
1486 | + /* | ||
1487 | + * Maybe the socket was already provided by systemd... | ||
1488 | + */ | ||
1489 | + if (local) { | ||
1490 | + t->sock = netsnmp_sd_find_unix_socket(SOCK_STREAM, 1, addr->sun_path); | ||
1491 | + if (t->sock) | ||
1492 | + socket_initialized = 1; | ||
1493 | + } | ||
1494 | +#endif | ||
1495 | + if (!socket_initialized) | ||
1496 | + t->sock = socket(PF_UNIX, SOCK_STREAM, 0); | ||
1497 | if (t->sock < 0) { | ||
1498 | netsnmp_transport_free(t); | ||
1499 | return NULL; | ||
1500 | @@ -357,25 +374,26 @@ netsnmp_unix_transport(struct sockaddr_un *addr, int local) | ||
1501 | |||
1502 | t->flags |= NETSNMP_TRANSPORT_FLAG_LISTEN; | ||
1503 | |||
1504 | - unlink(addr->sun_path); | ||
1505 | - rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr)); | ||
1506 | - | ||
1507 | - if (rc != 0 && errno == ENOENT && create_path) { | ||
1508 | - rc = mkdirhier(addr->sun_path, create_mode, 1); | ||
1509 | + if (!socket_initialized) { | ||
1510 | + unlink(addr->sun_path); | ||
1511 | + rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr)); | ||
1512 | + if (rc != 0 && errno == ENOENT && create_path) { | ||
1513 | + rc = mkdirhier(addr->sun_path, create_mode, 1); | ||
1514 | + if (rc != 0) { | ||
1515 | + netsnmp_unix_close(t); | ||
1516 | + netsnmp_transport_free(t); | ||
1517 | + return NULL; | ||
1518 | + } | ||
1519 | + rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr)); | ||
1520 | + } | ||
1521 | if (rc != 0) { | ||
1522 | + DEBUGMSGTL(("netsnmp_unix_transport", | ||
1523 | + "couldn't bind \"%s\", errno %d (%s)\n", | ||
1524 | + addr->sun_path, errno, strerror(errno))); | ||
1525 | netsnmp_unix_close(t); | ||
1526 | netsnmp_transport_free(t); | ||
1527 | return NULL; | ||
1528 | } | ||
1529 | - rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr)); | ||
1530 | - } | ||
1531 | - if (rc != 0) { | ||
1532 | - DEBUGMSGTL(("netsnmp_unix_transport", | ||
1533 | - "couldn't bind \"%s\", errno %d (%s)\n", | ||
1534 | - addr->sun_path, errno, strerror(errno))); | ||
1535 | - netsnmp_unix_close(t); | ||
1536 | - netsnmp_transport_free(t); | ||
1537 | - return NULL; | ||
1538 | } | ||
1539 | |||
1540 | /* | ||
1541 | @@ -391,16 +409,17 @@ netsnmp_unix_transport(struct sockaddr_un *addr, int local) | ||
1542 | * Now sit here and listen for connections to arrive. | ||
1543 | */ | ||
1544 | |||
1545 | - rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); | ||
1546 | - if (rc != 0) { | ||
1547 | - DEBUGMSGTL(("netsnmp_unix_transport", | ||
1548 | - "couldn't listen to \"%s\", errno %d (%s)\n", | ||
1549 | - addr->sun_path, errno, strerror(errno))); | ||
1550 | - netsnmp_unix_close(t); | ||
1551 | - netsnmp_transport_free(t); | ||
1552 | - return NULL; | ||
1553 | + if (!socket_initialized) { | ||
1554 | + rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); | ||
1555 | + if (rc != 0) { | ||
1556 | + DEBUGMSGTL(("netsnmp_unix_transport", | ||
1557 | + "couldn't listen to \"%s\", errno %d (%s)\n", | ||
1558 | + addr->sun_path, errno, strerror(errno))); | ||
1559 | + netsnmp_unix_close(t); | ||
1560 | + netsnmp_transport_free(t); | ||
1561 | + return NULL; | ||
1562 | + } | ||
1563 | } | ||
1564 | - | ||
1565 | } else { | ||
1566 | t->remote = (u_char *)malloc(strlen(addr->sun_path)); | ||
1567 | if (t->remote == NULL) { | ||
1568 | diff --git a/win32/libsnmp/Makefile.in b/win32/libsnmp/Makefile.in | ||
1569 | index 98d83c8..dd5689b 100644 | ||
1570 | --- a/win32/libsnmp/Makefile.in | ||
1571 | +++ b/win32/libsnmp/Makefile.in | ||
1572 | @@ -42,6 +42,7 @@ LIB32_OBJS= \ | ||
1573 | "$(INTDIR)\read_config.obj" \ | ||
1574 | "$(INTDIR)\readdir.obj" \ | ||
1575 | "$(INTDIR)\scapi.obj" \ | ||
1576 | + "$(INTDIR)\sd-daemon.obj" \ | ||
1577 | "$(INTDIR)\snmp-tc.obj" \ | ||
1578 | "$(INTDIR)\snmp.obj" \ | ||
1579 | "$(INTDIR)\snmpCallbackDomain.obj" \ | ||
1580 | @@ -307,6 +308,12 @@ SOURCE=..\..\snmplib\scapi.c | ||
1581 | $(CPP) $(CPP_PROJ) $(SOURCE) | ||
1582 | |||
1583 | |||
1584 | +SOURCE=..\..\snmplib\sd-daemon.c | ||
1585 | + | ||
1586 | +"$(INTDIR)\sd-daemon.obj" : $(SOURCE) "$(INTDIR)" | ||
1587 | + $(CPP) $(CPP_PROJ) $(SOURCE) | ||
1588 | + | ||
1589 | + | ||
1590 | SOURCE="..\..\snmplib\snmp-tc.c" | ||
1591 | |||
1592 | "$(INTDIR)\snmp-tc.obj" : $(SOURCE) "$(INTDIR)" | ||
1593 | diff --git a/win32/net-snmp/net-snmp-config.h b/win32/net-snmp/net-snmp-config.h | ||
1594 | index 7791ee0..1eccf42 100644 | ||
1595 | --- a/win32/net-snmp/net-snmp-config.h | ||
1596 | +++ b/win32/net-snmp/net-snmp-config.h | ||
1597 | @@ -1705,6 +1705,8 @@ enum { | ||
1598 | #define DMALLOC_FUNC_CHECK | ||
1599 | #endif | ||
1600 | |||
1601 | +#define NETSNMP_NO_SYSTEMD | ||
1602 | + | ||
1603 | /* #undef NETSNMP_ENABLE_LOCAL_SMUX */ | ||
1604 | |||
1605 | /* define if agentx transport is to use domain sockets only */ | ||
1606 | diff --git a/win32/net-snmp/net-snmp-config.h.in b/win32/net-snmp/net-snmp-config.h.in | ||
1607 | index 5215865..1607bfa 100644 | ||
1608 | --- a/win32/net-snmp/net-snmp-config.h.in | ||
1609 | +++ b/win32/net-snmp/net-snmp-config.h.in | ||
1610 | @@ -1705,6 +1705,8 @@ enum { | ||
1611 | #define DMALLOC_FUNC_CHECK | ||
1612 | #endif | ||
1613 | |||
1614 | +#define NETSNMP_NO_SYSTEMD | ||
1615 | + | ||
1616 | /* #undef NETSNMP_ENABLE_LOCAL_SMUX */ | ||
1617 | |||
1618 | /* define if agentx transport is to use domain sockets only */ | ||
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.2.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.2.bb new file mode 100644 index 0000000000..d21995a9e1 --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.2.bb | |||
@@ -0,0 +1,120 @@ | |||
1 | SUMMARY = "Various tools relating to the Simple Network Management Protocol" | ||
2 | HOMEPAGE = "http://www.net-snmp.org/" | ||
3 | LICENSE = "BSD" | ||
4 | |||
5 | LIC_FILES_CHKSUM = "file://README;beginline=3;endline=8;md5=7f7f00ba639ac8e8deb5a622ea24634e" | ||
6 | |||
7 | DEPENDS = "openssl libnl pciutils" | ||
8 | |||
9 | PR = "r1" | ||
10 | |||
11 | SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz \ | ||
12 | file://init \ | ||
13 | file://snmpd.conf \ | ||
14 | file://snmptrapd.conf \ | ||
15 | file://systemd-support.patch \ | ||
16 | file://snmpd.service \ | ||
17 | file://snmptrapd.service \ | ||
18 | file://ifmib.patch \ | ||
19 | " | ||
20 | |||
21 | SRC_URI[md5sum] = "5bddd02e2f82b62daa79f82717737a14" | ||
22 | SRC_URI[sha256sum] = "09ed31b4cc1f3c0411ef9a16eff79ef3b30d89c32ca46d5a01a41826c4ceb816" | ||
23 | |||
24 | inherit autotools update-rc.d siteinfo systemd | ||
25 | |||
26 | EXTRA_OEMAKE = "INSTALL_PREFIX=${D}" | ||
27 | |||
28 | PARALLEL_MAKE = "" | ||
29 | CCACHE = "" | ||
30 | |||
31 | TARGET_CC_ARCH += "${LDFLAGS}" | ||
32 | |||
33 | EXTRA_OECONF = "--disable-embedded-perl \ | ||
34 | --with-perl-modules=no \ | ||
35 | --enable-shared \ | ||
36 | --disable-manuals \ | ||
37 | --with-defaults \ | ||
38 | ${@base_conditional('SITEINFO_ENDIANNESS', 'le', '--with-endianness=little', '--with-endianness=big', d)}" | ||
39 | |||
40 | do_install_append() { | ||
41 | install -d ${D}${sysconfdir}/snmp | ||
42 | install -d ${D}${sysconfdir}/init.d | ||
43 | install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/snmpd | ||
44 | install -m 644 ${WORKDIR}/snmpd.conf ${D}${sysconfdir}/snmp/ | ||
45 | install -m 644 ${WORKDIR}/snmptrapd.conf ${D}${sysconfdir}/snmp/ | ||
46 | install -d ${STAGING_BINDIR} | ||
47 | install -m 0755 ${D}${bindir}/net-snmp-config ${STAGING_BINDIR}/ | ||
48 | sed -e "s@-I/usr/include@@g" \ | ||
49 | -e "s@^prefix=.*@prefix=${STAGING_DIR_HOST}@g" \ | ||
50 | -e "s@^exec_prefix=.*@exec_prefix=${STAGING_DIR_HOST}@g" \ | ||
51 | -e "s@^includedir=.*@includedir=${STAGING_INCDIR}@g" \ | ||
52 | -e "s@^libdir=.*@libdir=${STAGING_LIBDIR}@g" \ | ||
53 | -i ${STAGING_BINDIR}/net-snmp-config | ||
54 | install -d ${D}${systemd_unitdir}/system | ||
55 | install -m 0644 ${WORKDIR}/snmpd.service ${D}${systemd_unitdir}/system | ||
56 | install -m 0644 ${WORKDIR}/snmptrapd.service ${D}${systemd_unitdir}/system | ||
57 | } | ||
58 | |||
59 | PACKAGES = "${PN}-dbg ${PN}-doc ${PN}-dev ${PN}-staticdev ${PN}-static ${PN}-libs \ | ||
60 | ${PN}-mibs ${PN}-server ${PN}-client ${PN}-server-snmpd ${PN}-server-snmptrapd" | ||
61 | |||
62 | ALLOW_EMPTY_${PN}-server = "1" | ||
63 | |||
64 | FILES_${PN}-libs = "${libdir}/lib*${SOLIBS}" | ||
65 | FILES_${PN}-mibs = "${datadir}/snmp/mibs" | ||
66 | FILES_${PN}-server-snmpd = "${sbindir}/snmpd \ | ||
67 | ${sysconfdir}/snmp/snmpd.conf \ | ||
68 | ${sysconfdir}/init.d \ | ||
69 | ${systemd_unitdir}/system/snmpd.service \ | ||
70 | " | ||
71 | |||
72 | FILES_${PN}-server-snmptrapd = "${sbindir}/snmptrapd \ | ||
73 | ${sysconfdir}/snmp/snmptrapd.conf \ | ||
74 | ${systemd_unitdir}/system/snmptrapd.service \ | ||
75 | " | ||
76 | |||
77 | FILES_${PN}-client = "${bindir}/* ${datadir}/snmp/" | ||
78 | FILES_${PN}-dbg += "${libdir}/.debug/ ${sbindir}/.debug/ ${bindir}/.debug/" | ||
79 | FILES_${PN}-dev += "${bindir}/net-snmp-config ${bindir}/mib2c ${bindir}/mib2c-update" | ||
80 | |||
81 | CONFFILES_${PN}-server-snmpd = "${sysconfdir}/snmp/snmpd.conf" | ||
82 | CONFFILES_${PN}-server-snmptrapd = "${sysconfdir}/snmp/snmptrapd.conf" | ||
83 | |||
84 | INITSCRIPT_PACKAGES = "${PN}-server" | ||
85 | INITSCRIPT_NAME_${PN}-server = "snmpd" | ||
86 | INITSCRIPT_PARAMS_${PN}-server = "defaults" | ||
87 | |||
88 | EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'systemd', '--with-systemd', '--without-systemd', d)}" | ||
89 | |||
90 | SYSTEMD_PACKAGES = "${PN}-server-snmpd \ | ||
91 | ${PN}-server-snmptrapd" | ||
92 | |||
93 | SYSTEMD_SERVICE_${PN}-server-snmpd = "snmpd.service" | ||
94 | SYSTEMD_SERVICE_${PN}-server-snmptrapd = "snmptrapd.service" | ||
95 | |||
96 | RDEPENDS_${PN}-server-snmpd += "net-snmp-mibs" | ||
97 | RDEPENDS_${PN}-server-snmptrapd += "net-snmp-server-snmpd" | ||
98 | RDEPENDS_${PN}-server += "net-snmp-server-snmpd net-snmp-server-snmptrapd" | ||
99 | RDEPENDS_${PN}-client += "net-snmp-mibs" | ||
100 | RDEPENDS_${PN}-dev = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})" | ||
101 | RRECOMMENDS_${PN}-dbg = "net-snmp-client (= ${EXTENDPKGV}) net-snmp-server (= ${EXTENDPKGV})" | ||
102 | |||
103 | RPROVIDES_${PN}-server-snmpd += "${PN}-server-snmpd-systemd" | ||
104 | RREPLACES_${PN}-server-snmpd += "${PN}-server-snmpd-systemd" | ||
105 | RCONFLICTS_${PN}-server-snmpd += "${PN}-server-snmpd-systemd" | ||
106 | |||
107 | RPROVIDES_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" | ||
108 | RREPLACES_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" | ||
109 | RCONFLICTS_${PN}-server-snmptrapd += "${PN}-server-snmptrapd-systemd" | ||
110 | |||
111 | LEAD_SONAME = "libnetsnmp.so" | ||
112 | |||
113 | pkg_postrm_${PN}-server() { | ||
114 | if test "x$D" != "x"; then | ||
115 | OPT="-r $D " | ||
116 | else | ||
117 | OPT="" | ||
118 | /etc/init.d/snmpd stop | ||
119 | fi | ||
120 | } | ||
diff --git a/meta-networking/recipes-protocols/openflow/openflow.inc b/meta-networking/recipes-protocols/openflow/openflow.inc new file mode 100644 index 0000000000..43af54ea59 --- /dev/null +++ b/meta-networking/recipes-protocols/openflow/openflow.inc | |||
@@ -0,0 +1,35 @@ | |||
1 | SUMMARY = "OpenFlow communications protocol" | ||
2 | DESCRIPTION = "\ | ||
3 | Open standard that enables researchers to run experimental protocols in \ | ||
4 | contained networks. OpenFlow is a communications interface between \ | ||
5 | control and forwarding planes of a software-defined networking architecture.\ | ||
6 | " | ||
7 | HOMEPAGE = "http://www.openflow.org" | ||
8 | |||
9 | SECTION = "networking" | ||
10 | LICENSE = "GPLv2" | ||
11 | |||
12 | LIC_FILES_CHKSUM = "file://COPYING;md5=e870c934e2c3d6ccf085fd7cf0a1e2e2" | ||
13 | |||
14 | SRC_URI = "git://gitosis.stanford.edu/openflow.git;protocol=git" | ||
15 | |||
16 | DEPENDS = "virtual/libc" | ||
17 | |||
18 | EXTRA_OECONF += "KARCH=${TARGET_ARCH}" | ||
19 | |||
20 | PACKAGECONFIG ??= "openssl" | ||
21 | PACKAGECONFIG[openssl] = "--enable-ssl,--disable-ssl, openssl, libssl" | ||
22 | |||
23 | S = "${WORKDIR}/git" | ||
24 | |||
25 | inherit autotools | ||
26 | |||
27 | do_configure() { | ||
28 | ./boot.sh | ||
29 | oe_runconf | ||
30 | } | ||
31 | |||
32 | do_install_append() { | ||
33 | # Remove /var/run as it is created on startup | ||
34 | rm -rf ${D}${localstatedir}/run | ||
35 | } | ||
diff --git a/meta-networking/recipes-protocols/openflow/openflow_1.0.bb b/meta-networking/recipes-protocols/openflow/openflow_1.0.bb new file mode 100644 index 0000000000..a7e254dd85 --- /dev/null +++ b/meta-networking/recipes-protocols/openflow/openflow_1.0.bb | |||
@@ -0,0 +1,4 @@ | |||
1 | include ${BPN}.inc | ||
2 | |||
3 | SRCREV = "5ccca75a69f99791659bcfbcf35353ab1921320a" | ||
4 | PV = "1.0" | ||
diff --git a/meta-networking/recipes-protocols/openflow/openflow_git.bb b/meta-networking/recipes-protocols/openflow/openflow_git.bb new file mode 100644 index 0000000000..6403bfb220 --- /dev/null +++ b/meta-networking/recipes-protocols/openflow/openflow_git.bb | |||
@@ -0,0 +1,4 @@ | |||
1 | include ${BPN}.inc | ||
2 | |||
3 | SRCREV = "c84f33f09d5dbcfc9b489f64cb30475bf36f653a" | ||
4 | PV = "1.0+git${SRCPV}" | ||
diff --git a/meta-networking/recipes-protocols/pptp-linux/pptp-linux-1.7.2/fix-parallel-build.patch b/meta-networking/recipes-protocols/pptp-linux/pptp-linux-1.7.2/fix-parallel-build.patch new file mode 100644 index 0000000000..77722b064d --- /dev/null +++ b/meta-networking/recipes-protocols/pptp-linux/pptp-linux-1.7.2/fix-parallel-build.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | pptp.c and version.c depend on config.h | ||
2 | |||
3 | Upstream-Status: Backport | ||
4 | |||
5 | Upstream has already similar fixes. Will be available on next release. | ||
6 | |||
7 | Signed-off-by: Jesse Zhang <sen.zhang@windriver.com> | ||
8 | |||
9 | --- a/Makefile 2013-02-27 17:09:24.431226665 +0800 | ||
10 | +++ b/Makefile 2013-02-27 17:09:03.442075550 +0800 | ||
11 | @@ -43,6 +43,8 @@ | ||
12 | pptpsetup.8: pptpsetup | ||
13 | pod2man $? > $@ | ||
14 | |||
15 | +pptp.o version.o: config.h | ||
16 | + | ||
17 | config.h: | ||
18 | echo "/* text added by Makefile target config.h */" > config.h | ||
19 | echo "#define PPTP_LINUX_VERSION \"$(VERSION)$(RELEASE)\"" >> config.h | ||
diff --git a/meta-networking/recipes-protocols/pptp-linux/pptp-linux-1.7.2/options.pptp b/meta-networking/recipes-protocols/pptp-linux/pptp-linux-1.7.2/options.pptp new file mode 100644 index 0000000000..f446e22a6a --- /dev/null +++ b/meta-networking/recipes-protocols/pptp-linux/pptp-linux-1.7.2/options.pptp | |||
@@ -0,0 +1,30 @@ | |||
1 | # | ||
2 | # Lock the port | ||
3 | # | ||
4 | lock | ||
5 | |||
6 | # | ||
7 | # We don't need the tunnel server to authenticate itself | ||
8 | # | ||
9 | noauth | ||
10 | |||
11 | # | ||
12 | # Turn off transmission protocols we know won't be used | ||
13 | # | ||
14 | nobsdcomp | ||
15 | nodeflate | ||
16 | |||
17 | # | ||
18 | # We want MPPE | ||
19 | # (option naming specific to ppp 2.4.0 with unofficial patch) | ||
20 | # | ||
21 | #mppe-40 | ||
22 | mppe-128 | ||
23 | #mppe-stateless | ||
24 | |||
25 | # | ||
26 | # We want a sane mtu/mru | ||
27 | # (ppp 2.4.0 with unofficial patch) | ||
28 | # | ||
29 | #mtu 1000 | ||
30 | #mru 1000 | ||
diff --git a/meta-networking/recipes-protocols/pptp-linux/pptp-linux_1.7.2.bb b/meta-networking/recipes-protocols/pptp-linux/pptp-linux_1.7.2.bb new file mode 100644 index 0000000000..6a90578bc6 --- /dev/null +++ b/meta-networking/recipes-protocols/pptp-linux/pptp-linux_1.7.2.bb | |||
@@ -0,0 +1,31 @@ | |||
1 | SUMMARY = "Client for Microsoft PPTP VPNs" | ||
2 | DESCRIPTION = "PPTP Client is a Linux, FreeBSD, NetBSD \ | ||
3 | and OpenBSD client for the proprietary Microsoft Point-to-Point \ | ||
4 | Tunneling Protocol, PPTP. Allows connection to a PPTP based \ | ||
5 | Virtual Private Network (VPN) as used by employers and some \ | ||
6 | cable and ADSL internet service providers." | ||
7 | HOMEPAGE = "http://pptpclient.sourceforge.net" | ||
8 | SECTION = "network" | ||
9 | LICENSE = "GPLv2+" | ||
10 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b" | ||
11 | |||
12 | PR = "r1" | ||
13 | |||
14 | SRC_URI = "${SOURCEFORGE_MIRROR}/sourceforge/pptpclient/pptp-${PV}.tar.gz \ | ||
15 | file://options.pptp \ | ||
16 | file://fix-parallel-build.patch \ | ||
17 | " | ||
18 | |||
19 | SRC_URI[md5sum] = "4c3d19286a37459a632c7128c92a9857" | ||
20 | SRC_URI[sha256sum] = "e98ae0065d2a39fa3131654ff28cb7070e996f668ed6d0e7d9a445b8d37694bc" | ||
21 | |||
22 | S = "${WORKDIR}/pptp-${PV}" | ||
23 | |||
24 | do_install() { | ||
25 | install -d ${D}${sbindir} ${D}${sysconfdir}/ppp ${D}${mandir}/man8 | ||
26 | install -m 555 pptp ${D}${sbindir} | ||
27 | install -m 644 pptp.8 ${D}${mandir}/man8 | ||
28 | install -m 644 ${WORKDIR}/options.pptp ${D}${sysconfdir}/ppp | ||
29 | } | ||
30 | |||
31 | RDEPENDS_${PN} = "ppp" | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/0001-doc-fix-makeinfo-errors-and-one-warning.patch b/meta-networking/recipes-protocols/quagga/files/0001-doc-fix-makeinfo-errors-and-one-warning.patch new file mode 100644 index 0000000000..24fdac505a --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/0001-doc-fix-makeinfo-errors-and-one-warning.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | From d6cbd8bbc34529a1aff74b5ee73366b89526c961 Mon Sep 17 00:00:00 2001 | ||
2 | From: Joe MacDonald <joe@deserted.net> | ||
3 | Date: Fri, 22 Mar 2013 08:54:44 +0000 | ||
4 | Subject: [PATCH] doc: fix makeinfo errors and one warning | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | commit 4afa50b added few lines that are syntactically incorrect | ||
10 | with leading plus sign. | ||
11 | |||
12 | Upstream-Status: Backport [http://git.savannah.gnu.org/gitweb/?p=quagga.git;a=commit;h=b58c90807c9d0bfa9601704c7490a16070906004] | ||
13 | |||
14 | Cc: Denis Ovsienko <infrastation@yandex.ru> | ||
15 | Signed-off-by: Timo Teräs <timo.teras@iki.fi> | ||
16 | Signed-off-by: David Lamparter <equinox@opensourcerouting.org> | ||
17 | Signed-off-by: Joe MacDonald <joe@deserted.net> | ||
18 | --- | ||
19 | doc/ipv6.texi | 4 ++-- | ||
20 | doc/quagga.texi | 6 +++--- | ||
21 | 2 files changed, 5 insertions(+), 5 deletions(-) | ||
22 | |||
23 | diff --git a/doc/ipv6.texi b/doc/ipv6.texi | ||
24 | index b6cc437..2482c1c 100644 | ||
25 | --- a/doc/ipv6.texi | ||
26 | +++ b/doc/ipv6.texi | ||
27 | @@ -136,8 +136,8 @@ for the lowest preference possible. | ||
28 | Default: 0 | ||
29 | @end deffn | ||
30 | |||
31 | -+@deffn {Interface Command} {ipv6 nd home-agent-lifetime <0-65520>} {} | ||
32 | -+@deffnx {Interface Command} {no ipv6 nd home-agent-lifetime [<0-65520>]} {} | ||
33 | +@deffn {Interface Command} {ipv6 nd home-agent-lifetime <0-65520>} {} | ||
34 | +@deffnx {Interface Command} {no ipv6 nd home-agent-lifetime [<0-65520>]} {} | ||
35 | The value to be placed in Home Agent Option, when Home Agent config flag is set, | ||
36 | which indicates to hosts Home Agent Lifetime. The default value of 0 means to | ||
37 | place the current Router Lifetime value. | ||
38 | diff --git a/doc/quagga.texi b/doc/quagga.texi | ||
39 | index ff913aa..b4105ac 100644 | ||
40 | --- a/doc/quagga.texi | ||
41 | +++ b/doc/quagga.texi | ||
42 | @@ -1,13 +1,13 @@ | ||
43 | \input texinfo @c -*- texinfo -*- | ||
44 | +@c Set variables - sourced from defines.texi | ||
45 | +@include defines.texi | ||
46 | + | ||
47 | @c %**start of header | ||
48 | @setchapternewpage odd | ||
49 | @settitle @uref{http://www.quagga.net,,@value{PACKAGE_NAME}} | ||
50 | @setfilename quagga.info | ||
51 | @c %**end of header | ||
52 | |||
53 | -@c Set variables - sourced from defines.texi | ||
54 | -@include defines.texi | ||
55 | - | ||
56 | @c automake will automatically generate version.texi | ||
57 | @c and set EDITION, VERSION, UPDATED and UPDATED-MONTH | ||
58 | @include version.texi | ||
59 | -- | ||
60 | 1.7.10.4 | ||
61 | |||
diff --git a/meta-networking/recipes-protocols/quagga/files/Zebra-sync-zebra-routing-table-with-the-kernel-one.patch b/meta-networking/recipes-protocols/quagga/files/Zebra-sync-zebra-routing-table-with-the-kernel-one.patch new file mode 100644 index 0000000000..35f4637d8e --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/Zebra-sync-zebra-routing-table-with-the-kernel-one.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | sync zebra routing table with the kernel one when interface is down | ||
2 | |||
3 | Add router to kernel main router table with "ip", then you can see | ||
4 | a router item in kernel main router table. Also can see this router | ||
5 | item in zebra router table. If down the interface, this router item | ||
6 | will be deleted from kernel main router table, but it will not be | ||
7 | deleted from zebra router table, just set as inactive. | ||
8 | |||
9 | This patch is adopted from [1]. | ||
10 | [1] http://www.gossamer-threads.com/lists/quagga/dev/22609 | ||
11 | |||
12 | Upstream-Status: Pending | ||
13 | |||
14 | Signed-of-by: Aws Ismail <aws.ismail@windriver.com> | ||
15 | Signed-of-by: Roy.Li <rongqing.li@windriver.com> | ||
16 | |||
17 | --- | ||
18 | zebra/zebra_rib.c | 7 +++++++ | ||
19 | 1 files changed, 7 insertions(+), 0 deletions(-) | ||
20 | |||
21 | diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c | ||
22 | index 154e8d5..63434d0 100644 | ||
23 | --- a/zebra/zebra_rib.c | ||
24 | +++ b/zebra/zebra_rib.c | ||
25 | @@ -765,6 +765,9 @@ rib_match_ipv6 (struct in6_addr *addr) | ||
26 | #define RIB_SYSTEM_ROUTE(R) \ | ||
27 | ((R)->type == ZEBRA_ROUTE_KERNEL || (R)->type == ZEBRA_ROUTE_CONNECT) | ||
28 | |||
29 | +#define RIB_KERNEL_ROUTE(R) \ | ||
30 | + ((R)->type == ZEBRA_ROUTE_KERNEL) | ||
31 | + | ||
32 | /* This function verifies reachability of one given nexthop, which can be | ||
33 | * numbered or unnumbered, IPv4 or IPv6. The result is unconditionally stored | ||
34 | * in nexthop->flags field. If the 4th parameter, 'set', is non-zero, | ||
35 | @@ -1135,6 +1138,10 @@ rib_process (struct route_node *rn) | ||
36 | redistribute_delete (&rn->p, fib); | ||
37 | if (! RIB_SYSTEM_ROUTE (fib)) | ||
38 | rib_uninstall_kernel (rn, fib); | ||
39 | +#ifdef GNU_LINUX | ||
40 | + else if(RIB_KERNEL_ROUTE (fib) && !if_is_up(if_lookup_by_index(fib->nexthop->ifindex))) | ||
41 | + del=fib; | ||
42 | +#endif | ||
43 | UNSET_FLAG (fib->flags, ZEBRA_FLAG_SELECTED); | ||
44 | |||
45 | /* Set real nexthop. */ | ||
46 | -- | ||
47 | 1.7.4.1 | ||
48 | |||
diff --git a/meta-networking/recipes-protocols/quagga/files/babel-close-the-stdout-stderr-as-in-other-daemons.patch b/meta-networking/recipes-protocols/quagga/files/babel-close-the-stdout-stderr-as-in-other-daemons.patch new file mode 100644 index 0000000000..c2757a2fb7 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/babel-close-the-stdout-stderr-as-in-other-daemons.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | From ba71f768e6dbb1f2ac72ed3bd880bff75a48d345 Mon Sep 17 00:00:00 2001 | ||
2 | From: Roy Li <rongqing.li@windriver.com> | ||
3 | Date: Wed, 19 Feb 2014 14:13:40 +0800 | ||
4 | Subject: [PATCH] babeld: close stdout once the background daemon is created | ||
5 | |||
6 | Upstream-Status: pending | ||
7 | |||
8 | Once babald becomes a background daemon, it should not output information to | ||
9 | stdout, so need to close stdout. | ||
10 | |||
11 | In fact, other daemons close their stdout when they run into background, like | ||
12 | ospfd, isisd and bgpd, by calling daemon() which is in lib/daemon.c | ||
13 | |||
14 | Closing the stdout can fix a tee hang issue { #/usr/sbin/babeld -d |tee tmp } | ||
15 | |||
16 | Signed-off-by: Roy Li <rongqing.li@windriver.com> | ||
17 | --- | ||
18 | babeld/util.c | 10 +++++++++- | ||
19 | 1 file changed, 9 insertions(+), 1 deletion(-) | ||
20 | |||
21 | diff --git a/babeld/util.c b/babeld/util.c | ||
22 | index 011f382..76203bc 100644 | ||
23 | --- a/babeld/util.c | ||
24 | +++ b/babeld/util.c | ||
25 | @@ -425,7 +425,7 @@ uchar_to_in6addr(struct in6_addr *dest, const unsigned char *src) | ||
26 | int | ||
27 | daemonise() | ||
28 | { | ||
29 | - int rc; | ||
30 | + int rc, fd; | ||
31 | |||
32 | fflush(stdout); | ||
33 | fflush(stderr); | ||
34 | @@ -441,5 +441,13 @@ daemonise() | ||
35 | if(rc < 0) | ||
36 | return -1; | ||
37 | |||
38 | + fd = open("/dev/null", O_RDWR, 0); | ||
39 | + if (fd != -1) | ||
40 | + { | ||
41 | + dup2(fd, STDOUT_FILENO); | ||
42 | + if (fd > 2) | ||
43 | + close(fd); | ||
44 | + } | ||
45 | + | ||
46 | return 1; | ||
47 | } | ||
48 | -- | ||
49 | 1.7.10.4 | ||
50 | |||
diff --git a/meta-networking/recipes-protocols/quagga/files/build-fix-extract.pl-for-cross-compilation.patch b/meta-networking/recipes-protocols/quagga/files/build-fix-extract.pl-for-cross-compilation.patch new file mode 100644 index 0000000000..7e5beef30d --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/build-fix-extract.pl-for-cross-compilation.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | Upstream-Status: Backport | ||
2 | |||
3 | From ed6e297972318a0070ad4d973401fbc6e0def558 Mon Sep 17 00:00:00 2001 | ||
4 | From: Serj Kalichev <serj.kalichev@gmail.com> | ||
5 | Date: Fri, 7 Sep 2012 13:29:42 +0400 | ||
6 | Subject: [PATCH] build: fix extract.pl for cross compilation | ||
7 | |||
8 | extract.pl should invoke the C preprocessor for the target system, not the | ||
9 | host. | ||
10 | |||
11 | * vtysh/extract.pl.in: use @CPP@ to get target cpp | ||
12 | --- | ||
13 | vtysh/extract.pl.in | 2 +- | ||
14 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
15 | |||
16 | diff --git a/vtysh/extract.pl.in b/vtysh/extract.pl.in | ||
17 | index 7612aff..4c3a47f 100755 | ||
18 | --- a/vtysh/extract.pl.in | ||
19 | +++ b/vtysh/extract.pl.in | ||
20 | @@ -63,7 +63,7 @@ $ignore{'"show history"'} = "ignore"; | ||
21 | foreach (@ARGV) { | ||
22 | $file = $_; | ||
23 | |||
24 | - open (FH, "cpp -DHAVE_CONFIG_H -DVTYSH_EXTRACT_PL -DHAVE_IPV6 -I@top_builddir@ -I@srcdir@/ -I@srcdir@/.. -I@top_srcdir@/lib -I@top_srcdir@/isisd/topology @SNMP_INCLUDES@ @CPPFLAGS@ $file |"); | ||
25 | + open (FH, "@CPP@ -DHAVE_CONFIG_H -DVTYSH_EXTRACT_PL -DHAVE_IPV6 -I@top_builddir@ -I@srcdir@/ -I@srcdir@/.. -I@top_srcdir@/lib -I@top_srcdir@/isisd/topology @SNMP_INCLUDES@ @CPPFLAGS@ $file |"); | ||
26 | local $/; undef $/; | ||
27 | $line = <FH>; | ||
28 | close (FH); | ||
29 | -- | ||
30 | 1.7.1 | ||
31 | |||
diff --git a/meta-networking/recipes-protocols/quagga/files/fix-for-lib-inpath.patch b/meta-networking/recipes-protocols/quagga/files/fix-for-lib-inpath.patch new file mode 100644 index 0000000000..50f0ad502f --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/fix-for-lib-inpath.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | At first this worked, then I tried a clean build in a directory that | ||
2 | contained lib in it (oe/build/titan-glibc) and vtysh no longer | ||
3 | worked. It's test for the lib directory was excepting anything | ||
4 | containing lib. | ||
5 | |||
6 | With this patch you still cannot have lib in the path anywhere, but | ||
7 | at least things containing lib will now work. | ||
8 | |||
9 | --- quagga-0.99.2/vtysh/extract.pl.in 2005/11/16 04:12:04 1.1 | ||
10 | +++ quagga-0.99.2/vtysh/extract.pl.in 2005/11/16 04:12:16 | ||
11 | @@ -89,7 +89,7 @@ | ||
12 | $cmd =~ s/\s+$//g; | ||
13 | |||
14 | # $protocol is VTYSH_PROTO format for redirection of user input | ||
15 | - if ($file =~ /lib/) { | ||
16 | + if ($file =~ /\/lib\//) { | ||
17 | if ($file =~ /keychain.c/) { | ||
18 | $protocol = "VTYSH_RIPD"; | ||
19 | } | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/lingering-IP-address-after-deletion-BZ-486.patch b/meta-networking/recipes-protocols/quagga/files/lingering-IP-address-after-deletion-BZ-486.patch new file mode 100644 index 0000000000..42bdc20fcb --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/lingering-IP-address-after-deletion-BZ-486.patch | |||
@@ -0,0 +1,64 @@ | |||
1 | From 7f062c217b262e362a3362c677dea6c5e820adf1 Mon Sep 17 00:00:00 2001 | ||
2 | From: David Lamparter <equinox@diac24.net> | ||
3 | Date: Mon, 1 Feb 2010 16:41:26 +0100 | ||
4 | Subject: [PATCH] zebra: lingering IP address after deletion (BZ#486) | ||
5 | |||
6 | Upstream-status: Backport | ||
7 | |||
8 | zebra address bookkeeping is a mess. this is just a workaround to have | ||
9 | IPv4 address deletion somewhat working on Linux. | ||
10 | |||
11 | the if_unset_prefix call is synchronous, when it returns success the | ||
12 | address deletion completed successfully. this is either signaled by a | ||
13 | netlink ACK or by an OK return value from ioctl(). | ||
14 | |||
15 | This version is wrapped by #ifdef HAVE_NETLINK so we don't touch the | ||
16 | BSDs for now. | ||
17 | |||
18 | * zebra/interface.c: On Linux, update zebra internal state after | ||
19 | deleting an address. | ||
20 | |||
21 | Signed-off-by: David Lamparter <equinox@opensourcerouting.org> | ||
22 | --- | ||
23 | zebra/interface.c | 21 ++++++++++++++++++--- | ||
24 | 1 file changed, 18 insertions(+), 3 deletions(-) | ||
25 | |||
26 | diff --git a/zebra/interface.c b/zebra/interface.c | ||
27 | index 2242259..3578b79 100644 | ||
28 | --- a/zebra/interface.c | ||
29 | +++ b/zebra/interface.c | ||
30 | @@ -1297,13 +1297,28 @@ ip_address_uninstall (struct vty *vty, struct interface *ifp, | ||
31 | safe_strerror(errno), VTY_NEWLINE); | ||
32 | return CMD_WARNING; | ||
33 | } | ||
34 | + /* success! call returned that the address deletion went through. | ||
35 | + * this is a synchronous operation, so we know it succeeded and can | ||
36 | + * now update all internal state. */ | ||
37 | + | ||
38 | + /* the HAVE_NETLINK check is only here because, on BSD, although the | ||
39 | + * call above is still synchronous, we get a second confirmation later | ||
40 | + * through the route socket, and we don't want to touch that behaviour | ||
41 | + * for now. It should work without the #ifdef, but why take the risk... | ||
42 | + * -- equinox 2012-07-13 */ | ||
43 | +#ifdef HAVE_NETLINK | ||
44 | + | ||
45 | + /* Remove connected route. */ | ||
46 | + connected_down_ipv4 (ifp, ifc); | ||
47 | |||
48 | -#if 0 | ||
49 | /* Redistribute this information. */ | ||
50 | zebra_interface_address_delete_update (ifp, ifc); | ||
51 | |||
52 | - /* Remove connected route. */ | ||
53 | - connected_down_ipv4 (ifp, ifc); | ||
54 | + /* IP address propery set. */ | ||
55 | + UNSET_FLAG (ifc->conf, ZEBRA_IFC_REAL); | ||
56 | + | ||
57 | + /* remove from interface, remark secondaries */ | ||
58 | + if_subnet_delete (ifp, ifc); | ||
59 | |||
60 | /* Free address information. */ | ||
61 | listnode_delete (ifp->connected, ifc); | ||
62 | -- | ||
63 | 1.7.10.4 | ||
64 | |||
diff --git a/meta-networking/recipes-protocols/quagga/files/quagga-0.99.17-libcap.patch b/meta-networking/recipes-protocols/quagga/files/quagga-0.99.17-libcap.patch new file mode 100644 index 0000000000..9563ea2f36 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/quagga-0.99.17-libcap.patch | |||
@@ -0,0 +1,64 @@ | |||
1 | From 63e97633d01908da6d3776ac61e4033e6fa91e5c Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= <flameeyes@gmail.com> | ||
3 | Date: Sun, 5 Sep 2010 18:19:09 +0200 | ||
4 | Subject: [PATCH] build: fix linking position for libcap | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | * lib/Makefile.am: link libzebra to libcap, since it uses symbols | ||
10 | from there. | ||
11 | * zebra/Makefile.am: no need to link libcap here now, since it's not | ||
12 | used directly (libtool with apply transitive dependencies for | ||
13 | static linking). | ||
14 | |||
15 | Signed-off-by: Diego Elio Pettenò <flameeyes@gmail.com> | ||
16 | |||
17 | Imported from Gentoo by Paul Eggleton <paul.eggleton@linux.intel.com> | ||
18 | Upstream-Status: Pending | ||
19 | |||
20 | --- | ||
21 | lib/Makefile.am | 2 +- | ||
22 | zebra/Makefile.am | 5 ++--- | ||
23 | 2 files changed, 3 insertions(+), 4 deletions(-) | ||
24 | |||
25 | diff --git a/lib/Makefile.am b/lib/Makefile.am | ||
26 | index 315e919..6e69993 100644 | ||
27 | --- a/lib/Makefile.am | ||
28 | +++ b/lib/Makefile.am | ||
29 | @@ -18,7 +18,7 @@ BUILT_SOURCES = memtypes.h route_types.h | ||
30 | |||
31 | libzebra_la_DEPENDENCIES = @LIB_REGEX@ | ||
32 | |||
33 | -libzebra_la_LIBADD = @LIB_REGEX@ | ||
34 | +libzebra_la_LIBADD = @LIB_REGEX@ $(LIBCAP) | ||
35 | |||
36 | pkginclude_HEADERS = \ | ||
37 | buffer.h checksum.h command.h filter.h getopt.h hash.h \ | ||
38 | diff --git a/zebra/Makefile.am b/zebra/Makefile.am | ||
39 | index 542f36f..d09a209 100644 | ||
40 | --- a/zebra/Makefile.am | ||
41 | +++ b/zebra/Makefile.am | ||
42 | @@ -5,7 +5,6 @@ DEFS = @DEFS@ -DSYSCONFDIR=\"$(sysconfdir)/\" -DMULTIPATH_NUM=@MULTIPATH_NUM@ | ||
43 | INSTALL_SDATA=@INSTALL@ -m 600 | ||
44 | |||
45 | LIB_IPV6 = @LIB_IPV6@ | ||
46 | -LIBCAP = @LIBCAP@ | ||
47 | |||
48 | ipforward = @IPFORWARD@ | ||
49 | if_method = @IF_METHOD@ | ||
50 | @@ -39,9 +38,9 @@ noinst_HEADERS = \ | ||
51 | connected.h ioctl.h rib.h rt.h zserv.h redistribute.h debug.h rtadv.h \ | ||
52 | interface.h ipforward.h irdp.h router-id.h kernel_socket.h | ||
53 | |||
54 | -zebra_LDADD = $(otherobj) $(LIBCAP) $(LIB_IPV6) ../lib/libzebra.la | ||
55 | +zebra_LDADD = $(otherobj) ../lib/libzebra.la $(LIB_IPV6) | ||
56 | |||
57 | -testzebra_LDADD = $(LIBCAP) $(LIB_IPV6) ../lib/libzebra.la | ||
58 | +testzebra_LDADD = ../lib/libzebra.la $(LIB_IPV6) | ||
59 | |||
60 | zebra_DEPENDENCIES = $(otherobj) | ||
61 | |||
62 | -- | ||
63 | 1.7.2.2 | ||
64 | |||
diff --git a/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch b/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch new file mode 100644 index 0000000000..a07e33f9fd --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/quagga-Avoid-duplicate-connected-address.patch | |||
@@ -0,0 +1,54 @@ | |||
1 | quagga: Avoid duplicate connected address adding to the list | ||
2 | |||
3 | commit 27ba970b9("quagga/ripd: Fix two bugs after received SIGHUP signal") | ||
4 | introduces an regression: ifp->connected list is cleaned up when ripd is | ||
5 | restarting, however, for interface addresses which are not specified in | ||
6 | ripd configuration file, they are never to be added into ifp->connected | ||
7 | again, this will lead to some abnormal behavior for route advertising. | ||
8 | |||
9 | Instead of cleaning up the ifp->connected list to avoid duplicated | ||
10 | connected address being added into this list, we can check this | ||
11 | condition during interface address adding process and return early | ||
12 | when an identical address has already been added. | ||
13 | |||
14 | Upstream-Status: Pending | ||
15 | |||
16 | Signed-off-by: Hu Yadi <Yadi.hu@windriver.com> | ||
17 | Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com> | ||
18 | Signed-off-by: Joe MacDonald <joe@deserted.net> | ||
19 | --- | ||
20 | --- a/lib/if.c | ||
21 | +++ b/lib/if.c | ||
22 | @@ -738,6 +738,16 @@ connected_add_by_prefix (struct interfac | ||
23 | struct prefix *destination) | ||
24 | { | ||
25 | struct connected *ifc; | ||
26 | + struct listnode *cnode; | ||
27 | + struct connected *c; | ||
28 | + int ret = 0; | ||
29 | + | ||
30 | + for (ALL_LIST_ELEMENTS_RO (ifp->connected, cnode, c)) | ||
31 | + { | ||
32 | + ret = connected_same_prefix (p, (c->address)); | ||
33 | + if(ret == 1) | ||
34 | + return NULL; | ||
35 | + } | ||
36 | |||
37 | /* Allocate new connected address. */ | ||
38 | ifc = connected_new (); | ||
39 | --- a/ripd/rip_interface.c | ||
40 | +++ b/ripd/rip_interface.c | ||
41 | @@ -516,13 +516,6 @@ rip_interface_clean (void) | ||
42 | thread_cancel (ri->t_wakeup); | ||
43 | ri->t_wakeup = NULL; | ||
44 | } | ||
45 | - | ||
46 | - for (conn_node = listhead (ifp->connected); conn_node; conn_node = next) | ||
47 | - { | ||
48 | - ifc = listgetdata (conn_node); | ||
49 | - next = conn_node->next; | ||
50 | - listnode_delete (ifp->connected, ifc); | ||
51 | - } | ||
52 | } | ||
53 | } | ||
54 | |||
diff --git a/meta-networking/recipes-protocols/quagga/files/quagga-fix-CVE-2013-6051.patch b/meta-networking/recipes-protocols/quagga/files/quagga-fix-CVE-2013-6051.patch new file mode 100644 index 0000000000..fde9e0ca81 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/quagga-fix-CVE-2013-6051.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | |||
2 | From 8794e8d229dc9fe29ea31424883433d4880ef408 | ||
3 | From: Paul Jakma <paul@quagga.net> | ||
4 | Date: Mon, 13 Feb 2012 13:53:07 +0000 | ||
5 | Subject: bgpd: Fix regression in args consolidation, total should be inited from args | ||
6 | |||
7 | bgpd: Fix regression in args consolidation, total should be inited from args | ||
8 | |||
9 | * bgp_attr.c: (bgp_attr_unknown) total should be initialised from the args. | ||
10 | |||
11 | Upstream-Status: Backport | ||
12 | |||
13 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
14 | --- | ||
15 | |||
16 | diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c | ||
17 | index 65af824..839f64d 100644 | ||
18 | --- a/bgpd/bgp_attr.c | ||
19 | +++ b/bgpd/bgp_attr.c | ||
20 | |||
21 | @@ -1646,7 +1646,7 @@ | ||
22 | static bgp_attr_parse_ret_t | ||
23 | bgp_attr_unknown (struct bgp_attr_parser_args *args) | ||
24 | { | ||
25 | - bgp_size_t total; | ||
26 | + bgp_size_t total = args->total; | ||
27 | struct transit *transit; | ||
28 | struct attr_extra *attre; | ||
29 | struct peer *const peer = args->peer; | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/quagga.default b/meta-networking/recipes-protocols/quagga/files/quagga.default new file mode 100644 index 0000000000..0c1ce6c042 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/quagga.default | |||
@@ -0,0 +1,13 @@ | |||
1 | # If this option is set the /etc/init.d/quagga script automatically loads | ||
2 | # the config via "vtysh -b" when the servers are started. | ||
3 | vtysh_enable=yes | ||
4 | |||
5 | # Bind all daemons to loopback only by default | ||
6 | zebra_options=" --daemon -A 127.0.0.1" | ||
7 | babeld_options="--daemon -A 127.0.0.1" | ||
8 | bgpd_options=" --daemon -A 127.0.0.1" | ||
9 | ospfd_options=" --daemon -A 127.0.0.1" | ||
10 | ospf6d_options="--daemon -A ::1" | ||
11 | ripd_options=" --daemon -A 127.0.0.1" | ||
12 | ripngd_options="--daemon -A ::1" | ||
13 | isisd_options=" --daemon -A 127.0.0.1" | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/quagga.init b/meta-networking/recipes-protocols/quagga/files/quagga.init new file mode 100644 index 0000000000..60b5ab01a1 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/quagga.init | |||
@@ -0,0 +1,200 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # /etc/init.d/quagga -- start/stop the Quagga routing daemons | ||
4 | # | ||
5 | # Based on debian version by Endre Hirling <endre@mail.elte.hu> and | ||
6 | # Christian Hammers <ch@debian.org>. | ||
7 | # | ||
8 | |||
9 | ### BEGIN INIT INFO | ||
10 | # Provides: quagga | ||
11 | # Required-Start: $local_fs $network $remote_fs $syslog | ||
12 | # Required-Stop: $local_fs $network $remote_fs $syslog | ||
13 | # Default-Start: 2 3 4 5 | ||
14 | # Default-Stop: 0 1 6 | ||
15 | # Short-Description: start and stop the Quagga routing suite | ||
16 | # Description: Quagga is a routing suite for IP routing protocols like | ||
17 | # BGP, OSPF, RIP and others. This script contols the main | ||
18 | # daemon "quagga" as well as the individual protocol daemons. | ||
19 | ### END INIT INFO | ||
20 | |||
21 | # NOTE: sbin must be before bin so we get the iproute2 ip and not the | ||
22 | # busybox ip command. The busybox one flushes all routes instead of just | ||
23 | # the dynamic routes | ||
24 | PATH=/sbin:/usr/sbin:/bin:/usr/bin:/sbin | ||
25 | D_PATH=/usr/sbin | ||
26 | C_PATH=/etc/quagga | ||
27 | |||
28 | # Keep zebra first and do not list watchquagga! | ||
29 | DAEMONS="zebra bgpd ripd ripngd ospfd ospf6d isisd babeld" | ||
30 | |||
31 | # Print the name of the pidfile. | ||
32 | pidfile() | ||
33 | { | ||
34 | echo "/var/run/quagga/$1.pid" | ||
35 | } | ||
36 | |||
37 | # Check if daemon is started by using the pidfile. | ||
38 | started() | ||
39 | { | ||
40 | [ -e `pidfile $1` ] && kill -0 `cat \`pidfile $1\`` 2> /dev/null && return 0 | ||
41 | return 1 | ||
42 | } | ||
43 | |||
44 | # Loads the config via vtysh -b if configured to do so. | ||
45 | vtysh_b () | ||
46 | { | ||
47 | # Rember, that all variables have been incremented by 1 in convert_daemon_prios() | ||
48 | if [ "$vtysh_enable" = 2 -a -f $C_PATH/Quagga.conf ]; then | ||
49 | /usr/bin/vtysh -b | ||
50 | fi | ||
51 | } | ||
52 | |||
53 | # Check if the daemon is activated and if its executable and config files | ||
54 | # are in place. | ||
55 | # params: daemon name | ||
56 | # returns: 0=ok, 1=error | ||
57 | check_daemon() | ||
58 | { | ||
59 | # If the integrated config file is used the others are not checked. | ||
60 | if [ -r "$C_PATH/Quagga.conf" ]; then | ||
61 | return 0 | ||
62 | fi | ||
63 | |||
64 | # check for config file | ||
65 | if [ ! -r "$C_PATH/$1.conf" ]; then | ||
66 | return 1 | ||
67 | fi | ||
68 | return 0 | ||
69 | } | ||
70 | |||
71 | # Starts the server if it's not alrady running according to the pid file. | ||
72 | # The Quagga daemons creates the pidfile when starting. | ||
73 | start() | ||
74 | { | ||
75 | if ! check_daemon $1; then echo -n " (!$1)"; return; fi | ||
76 | echo -n " $1" | ||
77 | start-stop-daemon \ | ||
78 | --start \ | ||
79 | --pidfile=`pidfile $1` \ | ||
80 | --exec "$D_PATH/$1" \ | ||
81 | -- \ | ||
82 | `eval echo "$""$1""_options"` | ||
83 | |||
84 | } | ||
85 | |||
86 | # Stop the daemon given in the parameter, printing its name to the terminal. | ||
87 | stop() | ||
88 | { | ||
89 | if ! started "$1" ; then | ||
90 | echo -n " (!$1)" | ||
91 | return 0 | ||
92 | else | ||
93 | PIDFILE=`pidfile $1` | ||
94 | PID=`cat $PIDFILE 2>/dev/null` | ||
95 | start-stop-daemon --stop --quiet --exec "$D_PATH/$1" | ||
96 | # | ||
97 | # Now we have to wait until $DAEMON has _really_ stopped. | ||
98 | # | ||
99 | if test -n "$PID" && kill -0 $PID 2>/dev/null; then | ||
100 | echo -n " (waiting) ." | ||
101 | cnt=0 | ||
102 | while kill -0 $PID 2>/dev/null; do | ||
103 | cnt=`expr $cnt + 1` | ||
104 | if [ $cnt -gt 60 ]; then | ||
105 | # Waited 120 secs now, fail. | ||
106 | echo -n "Failed.. " | ||
107 | break | ||
108 | fi | ||
109 | sleep 2 | ||
110 | echo -n "." | ||
111 | done | ||
112 | fi | ||
113 | echo -n " $1" | ||
114 | rm -f `pidfile $1` | ||
115 | fi | ||
116 | } | ||
117 | |||
118 | stop_all() | ||
119 | { | ||
120 | local daemon_list | ||
121 | daemon_list=${1:-$DAEMONS} | ||
122 | |||
123 | echo -n "Stopping Quagga daemons:" | ||
124 | for daemon_name in $daemon_list; do | ||
125 | stop "$daemon_name" | ||
126 | done | ||
127 | echo "." | ||
128 | } | ||
129 | |||
130 | start_all() | ||
131 | { | ||
132 | local daemon_list | ||
133 | daemon_list=${1:-$DAEMONS} | ||
134 | |||
135 | echo -n "Starting Quagga daemons:" | ||
136 | for daemon_name in $daemon_list; do | ||
137 | start "$daemon_name" | ||
138 | done | ||
139 | echo "." | ||
140 | } | ||
141 | |||
142 | status_all() | ||
143 | { | ||
144 | local daemon_list | ||
145 | daemon_list=${1:-$DAEMONS} | ||
146 | res=1 | ||
147 | |||
148 | echo -n "quagga: " | ||
149 | for daemon_name in $daemon_list; do | ||
150 | if started "$daemon_name" ; then | ||
151 | id=`cat \`pidfile $daemon_name\`` | ||
152 | echo -n "$daemon_name (pid $id) " | ||
153 | res=0 | ||
154 | fi | ||
155 | done | ||
156 | if [ $res -eq 0 ]; then | ||
157 | echo "is running..." | ||
158 | else | ||
159 | echo "is stopped..." | ||
160 | fi | ||
161 | exit $res | ||
162 | } | ||
163 | |||
164 | ######################################################### | ||
165 | # Main program # | ||
166 | ######################################################### | ||
167 | |||
168 | # Load configuration | ||
169 | test -f /etc/default/quagga && . /etc/default/quagga | ||
170 | |||
171 | case "$1" in | ||
172 | start) | ||
173 | cd $C_PATH/ | ||
174 | start_all $2 | ||
175 | vtysh_b | ||
176 | ;; | ||
177 | |||
178 | stop) | ||
179 | stop_all $2 | ||
180 | echo "Removing all routes made by zebra." | ||
181 | ip route flush proto zebra | ||
182 | ;; | ||
183 | |||
184 | status) | ||
185 | status_all $2 | ||
186 | ;; | ||
187 | |||
188 | restart|force-reload) | ||
189 | $0 stop $2 | ||
190 | sleep 1 | ||
191 | $0 start $2 | ||
192 | ;; | ||
193 | |||
194 | *) | ||
195 | echo "Usage: /etc/init.d/quagga {start|stop|restart|status|force-reload} [daemon]" | ||
196 | exit 1 | ||
197 | ;; | ||
198 | esac | ||
199 | |||
200 | exit 0 | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/quagga.pam b/meta-networking/recipes-protocols/quagga/files/quagga.pam new file mode 100644 index 0000000000..3541a975ae --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/quagga.pam | |||
@@ -0,0 +1,13 @@ | |||
1 | # | ||
2 | # The PAM configuration file for the quagga `vtysh' service | ||
3 | # | ||
4 | |||
5 | # This allows root to change user infomation without being | ||
6 | # prompted for a password | ||
7 | auth sufficient pam_rootok.so | ||
8 | |||
9 | # The standard Unix authentication modules, used with | ||
10 | # NIS (man nsswitch) as well as normal /etc/passwd and | ||
11 | # /etc/shadow entries. | ||
12 | auth include common-auth | ||
13 | |||
diff --git a/meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch b/meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch new file mode 100644 index 0000000000..4b8c9a929b --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/ripd-fix-two-bugs-after-received-SIGHUP.patch | |||
@@ -0,0 +1,50 @@ | |||
1 | ripd: Fix two bugs after received SIGHUP signal | ||
2 | |||
3 | There are two problems for ripd implementation after received | ||
4 | SIGHUP signal: | ||
5 | 1). ripd didn't clean up ifp->connected list before reload | ||
6 | configuration file. | ||
7 | 2). ripd reset ri->split_horizon flag to RIP_NO_SPLIT_HORIZON | ||
8 | which lead to the unnecessary route to be advertised. | ||
9 | |||
10 | Upstream-Status: Submitted [http://patchwork.diac24.net/patch/604/] | ||
11 | |||
12 | Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com> | ||
13 | Signed-off-by: Joe MacDonald <joe@deserted.net> | ||
14 | --- | ||
15 | --- a/ripd/rip_interface.c | ||
16 | +++ b/ripd/rip_interface.c | ||
17 | @@ -500,6 +500,8 @@ | ||
18 | struct listnode *node; | ||
19 | struct interface *ifp; | ||
20 | struct rip_interface *ri; | ||
21 | + struct connected *ifc; | ||
22 | + struct listnode *conn_node, *next; | ||
23 | |||
24 | for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp)) | ||
25 | { | ||
26 | @@ -514,6 +516,13 @@ | ||
27 | thread_cancel (ri->t_wakeup); | ||
28 | ri->t_wakeup = NULL; | ||
29 | } | ||
30 | + | ||
31 | + for (conn_node = listhead (ifp->connected); conn_node; conn_node = next) | ||
32 | + { | ||
33 | + ifc = listgetdata (conn_node); | ||
34 | + next = conn_node->next; | ||
35 | + listnode_delete (ifp->connected, ifc); | ||
36 | + } | ||
37 | } | ||
38 | } | ||
39 | |||
40 | @@ -548,8 +557,8 @@ | ||
41 | ri->key_chain = NULL; | ||
42 | } | ||
43 | |||
44 | - ri->split_horizon = RIP_NO_SPLIT_HORIZON; | ||
45 | - ri->split_horizon_default = RIP_NO_SPLIT_HORIZON; | ||
46 | + ri->split_horizon = RIP_SPLIT_HORIZON; | ||
47 | + ri->split_horizon_default = RIP_SPLIT_HORIZON; | ||
48 | |||
49 | ri->list[RIP_FILTER_IN] = NULL; | ||
50 | ri->list[RIP_FILTER_OUT] = NULL; | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga b/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga new file mode 100644 index 0000000000..cfb896a17b --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/volatiles.03_quagga | |||
@@ -0,0 +1,3 @@ | |||
1 | # <type> <owner> <group> <mode> <path> <linksource> | ||
2 | d quagga quagga 0755 /var/run/quagga none | ||
3 | d quagga quagga 0755 /var/log/quagga none \ No newline at end of file | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/watchquagga.default b/meta-networking/recipes-protocols/quagga/files/watchquagga.default new file mode 100644 index 0000000000..2d601ec97d --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/watchquagga.default | |||
@@ -0,0 +1,12 @@ | |||
1 | # Watchquagga configuration | ||
2 | #watch_daemons="zebra bgpd ospfd ospf6d ripd ripngd" | ||
3 | watch_daemons="zebra" | ||
4 | |||
5 | # To enable restarts when multiple daemons are being used, uncomment this line (but first be sure to edit | ||
6 | # the WATCH_DAEMONS line to reflect the daemons you are actually using): | ||
7 | #watch_options="-Az -b_ -r/etc/init.d/quagga_restart_%s -s/etc/init.d/quagga_start_%s -k/etc/init.d/quagga_stop_%s" | ||
8 | |||
9 | # Since we are using one quagga daemon for now, use the following line. If using | ||
10 | # multiple daemons, comment the line below and uncoment the line mentioned | ||
11 | # above. | ||
12 | watch_options="-z -b_ -r/etc/init.d/quagga_restart_%s" | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/watchquagga.init b/meta-networking/recipes-protocols/quagga/files/watchquagga.init new file mode 100644 index 0000000000..5ddd94a3d6 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/watchquagga.init | |||
@@ -0,0 +1,64 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | ### BEGIN INIT INFO | ||
4 | # Provides: watchquagga | ||
5 | # Required-Start: $local_fs $network $remote_fs $syslog | ||
6 | # Required-Stop: $local_fs $network $remote_fs $syslog | ||
7 | # Default-Start: 2 3 4 5 | ||
8 | # Default-Stop: 0 1 6 | ||
9 | # Short-Description: start and stop the Quagga watchdog | ||
10 | ### END INIT INFO | ||
11 | |||
12 | PATH=/bin:/usr/bin:/sbin:/usr/sbin | ||
13 | |||
14 | # Load configuration | ||
15 | test -f /etc/default/watchquagga && . /etc/default/watchquagga | ||
16 | |||
17 | # Check that there are daemons to be monitored. | ||
18 | [ -z "$watch_daemons" ] && exit 0 | ||
19 | |||
20 | pidfile="/var/run/quagga/watchquagga.pid" | ||
21 | |||
22 | case "$1" in | ||
23 | start) | ||
24 | echo -n "Starting quagga watchdog daemon: watchquagga" | ||
25 | start-stop-daemon --start \ | ||
26 | --pidfile $pidfile \ | ||
27 | --exec /usr/sbin/watchquagga \ | ||
28 | -- -d $watch_options $watch_daemons | ||
29 | echo "." | ||
30 | ;; | ||
31 | |||
32 | stop) | ||
33 | echo -n "Stopping quagga watchdog daemon: watchquagga" | ||
34 | start-stop-daemon --stop --quiet \ | ||
35 | --pidfile $pidfile | ||
36 | echo "." | ||
37 | ;; | ||
38 | |||
39 | status) | ||
40 | echo -n "watchquagga " | ||
41 | res=1 | ||
42 | [ -e $pidfile ] && kill -0 `cat $pidfile` 2> /dev/null | ||
43 | if [ $? -eq 0 ]; then | ||
44 | echo "(pid `cat $pidfile`) is running..." | ||
45 | res=0 | ||
46 | else | ||
47 | echo "is stopped..." | ||
48 | fi | ||
49 | exit $res | ||
50 | ;; | ||
51 | |||
52 | restart|force-reload) | ||
53 | $0 stop $2 | ||
54 | sleep 1 | ||
55 | $0 start $2 | ||
56 | ;; | ||
57 | |||
58 | *) | ||
59 | echo "Usage: /etc/init.d/watchquagga {start|stop|restart|force-reload}" | ||
60 | exit 1 | ||
61 | ;; | ||
62 | esac | ||
63 | |||
64 | exit 0 | ||
diff --git a/meta-networking/recipes-protocols/quagga/files/work-with-new-readline.patch b/meta-networking/recipes-protocols/quagga/files/work-with-new-readline.patch new file mode 100644 index 0000000000..2bd333a70a --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/files/work-with-new-readline.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | From 66df315d2a270a254c613a4d2e72c0ea47f15a71 Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Yang <liezhi.yang@windriver.com> | ||
3 | Date: Thu, 27 Mar 2014 09:35:29 +0000 | ||
4 | Subject: [PATCH] vtysh/vtysh.c: works with new readline | ||
5 | |||
6 | The Function and CPPFunction had been removed by in readline 6.3, use | ||
7 | the new functions to replace them. | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | |||
11 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
12 | --- | ||
13 | vtysh/vtysh.c | 4 ++-- | ||
14 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
15 | |||
16 | diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c | ||
17 | index 431c08e..fdd82fb 100644 | ||
18 | --- a/vtysh/vtysh.c | ||
19 | +++ b/vtysh/vtysh.c | ||
20 | @@ -2212,9 +2212,9 @@ void | ||
21 | vtysh_readline_init (void) | ||
22 | { | ||
23 | /* readline related settings. */ | ||
24 | - rl_bind_key ('?', (Function *) vtysh_rl_describe); | ||
25 | + rl_bind_key ('?', (rl_command_func_t *) vtysh_rl_describe); | ||
26 | rl_completion_entry_function = vtysh_completion_entry_function; | ||
27 | - rl_attempted_completion_function = (CPPFunction *)new_completion; | ||
28 | + rl_attempted_completion_function = (rl_completion_func_t *)new_completion; | ||
29 | /* do not append space after completion. It will be appended | ||
30 | * in new_completion() function explicitly. */ | ||
31 | rl_completion_append_character = '\0'; | ||
32 | -- | ||
33 | 1.8.3.4 | ||
34 | |||
diff --git a/meta-networking/recipes-protocols/quagga/quagga.inc b/meta-networking/recipes-protocols/quagga/quagga.inc new file mode 100644 index 0000000000..60baab8011 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/quagga.inc | |||
@@ -0,0 +1,207 @@ | |||
1 | SUMMARY = "BGP/OSPF/RIP routing daemon" | ||
2 | DESCRIPTION = "Quagga is a routing software suite, providing \ | ||
3 | implementations of OSPFv2, OSPFv3, RIP v1 and v2, RIPv3 and BGPv4 for \ | ||
4 | Unix platforms, particularly FreeBSD, Linux, Solaris and NetBSD. \ | ||
5 | Quagga is a fork of GNU Zebra which was developed by Kunihiro \ | ||
6 | Ishiguro. The Quagga tree aims to build a more involved community \ | ||
7 | around Quagga than the current centralised model of GNU Zebra." | ||
8 | HOMEPAGE = "http://www.nongnu.org/quagga/" | ||
9 | SECTION = "network" | ||
10 | LICENSE = "GPL-2.0 & LGPL-2.0" | ||
11 | DEPENDS = "readline ncurses perl-native" | ||
12 | DEPENDS += "${@base_contains('DISTRO_FEATURES', 'snmp', 'net-snmp', '', d)}" | ||
13 | SNMP_CONF="${@base_contains('DISTRO_FEATURES', 'snmp', '--enable-snmp', '', d)}" | ||
14 | |||
15 | LIC_FILES_CHKSUM = "file://COPYING;md5=8ca43cbc842c2336e835926c2166c28b \ | ||
16 | file://COPYING.LIB;md5=f30a9716ef3762e3467a2f62bf790f0a" | ||
17 | |||
18 | INC_PR = "r2" | ||
19 | |||
20 | # the "ip" command from busybox is not sufficient (flush by protocol flushes all routes) | ||
21 | RDEPENDS_${PN} += "iproute2" | ||
22 | |||
23 | QUAGGASUBDIR = "" | ||
24 | # ${QUAGGASUBDIR} is deal with old versions. Set to "/attic" for old | ||
25 | # versions and leave it empty for recent versions. | ||
26 | SRC_URI = "http://download.savannah.gnu.org/releases/quagga${QUAGGASUBDIR}/quagga-${PV}.tar.gz;name=quagga-${PV} \ | ||
27 | file://fix-for-lib-inpath.patch \ | ||
28 | file://quagga-0.99.17-libcap.patch \ | ||
29 | file://quagga-fix-CVE-2013-6051.patch \ | ||
30 | file://Zebra-sync-zebra-routing-table-with-the-kernel-one.patch \ | ||
31 | file://quagga.init \ | ||
32 | file://quagga.default \ | ||
33 | file://watchquagga.init \ | ||
34 | file://watchquagga.default \ | ||
35 | file://volatiles.03_quagga \ | ||
36 | file://quagga.pam \ | ||
37 | file://ripd-fix-two-bugs-after-received-SIGHUP.patch \ | ||
38 | file://quagga-Avoid-duplicate-connected-address.patch \ | ||
39 | " | ||
40 | |||
41 | MIRRORS += "http://download.savannah.gnu.org/releases/ http://download-mirror.savannah.gnu.org/releases/ \n" | ||
42 | |||
43 | PACKAGECONFIG ??= "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" | ||
44 | PACKAGECONFIG[cap] = "--enable-capabilities,--disable-capabilities,libcap" | ||
45 | PACKAGECONFIG[pam] = "--with-libpam, --without-libpam, libpam" | ||
46 | |||
47 | inherit autotools update-rc.d useradd | ||
48 | |||
49 | EXTRA_OECONF = "--sysconfdir=${sysconfdir}/quagga \ | ||
50 | --localstatedir=${localstatedir}/run/quagga \ | ||
51 | --enable-exampledir=${docdir}/quagga/examples/ \ | ||
52 | --enable-vtysh \ | ||
53 | --enable-isisd \ | ||
54 | --enable-watchquagga \ | ||
55 | --enable-ospf-te \ | ||
56 | --enable-opaque-lsa \ | ||
57 | --enable-ipv6 \ | ||
58 | --enable-ospfclient=yes \ | ||
59 | --enable-multipath=64 \ | ||
60 | --enable-user=quagga \ | ||
61 | --enable-group=quagga \ | ||
62 | --enable-vty-group=quaggavty \ | ||
63 | --enable-configfile-mask=0640 \ | ||
64 | --enable-logfile-mask=0640 \ | ||
65 | --enable-rtadv \ | ||
66 | --enable-linux24-tcp-md5 \ | ||
67 | ap_cv_cc_pie=no \ | ||
68 | ${SNMP_CONF}" | ||
69 | |||
70 | do_install () { | ||
71 | # Install init script and default settings | ||
72 | install -m 0755 -d ${D}${sysconfdir}/default ${D}${sysconfdir}/init.d \ | ||
73 | ${D}${sysconfdir}/quagga ${D}${sysconfdir}/default/volatiles | ||
74 | install -m 0644 ${WORKDIR}/quagga.default ${D}${sysconfdir}/default/quagga | ||
75 | install -m 0644 ${WORKDIR}/watchquagga.default ${D}${sysconfdir}/default/watchquagga | ||
76 | install -m 0755 ${WORKDIR}/quagga.init ${D}${sysconfdir}/init.d/quagga | ||
77 | install -m 0755 ${WORKDIR}/watchquagga.init ${D}${sysconfdir}/init.d/watchquagga | ||
78 | install -m 0644 ${WORKDIR}/volatiles.03_quagga ${D}${sysconfdir}/default/volatiles/volatiles.03_quagga | ||
79 | |||
80 | # Install sample configurations for the daemons | ||
81 | for f in bgpd vtysh babeld isisd ospfd ripngd zebra ripd ospf6d; do | ||
82 | install -m 0640 ${S}/$f/$f.conf.sample ${D}${sysconfdir}/quagga/$f.conf.sample | ||
83 | done | ||
84 | |||
85 | for f in bgpd vtysh babeld isisd ospfd ripngd zebra ripd ospf6d; do | ||
86 | touch ${D}${sysconfdir}/quagga/$f.conf | ||
87 | done | ||
88 | chown quagga:quaggavty ${D}${sysconfdir}/quagga | ||
89 | chown quagga:quagga ${D}${sysconfdir}/quagga/*.conf | ||
90 | chmod 750 ${D}${sysconfdir}/quagga | ||
91 | chmod 640 ${D}${sysconfdir}/quagga/*.conf | ||
92 | |||
93 | # Install quagga | ||
94 | oe_runmake install DESTDIR=${D} prefix=${prefix} \ | ||
95 | sbindir=${sbindir} \ | ||
96 | sysconfdir=${sysconfdir}/quagga \ | ||
97 | localstatedir=${localstatedir}/run/quagga | ||
98 | |||
99 | # Fix hardcoded paths | ||
100 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/* | ||
101 | sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/quagga | ||
102 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/* ${D}${sysconfdir}/default/watchquagga | ||
103 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/* ${D}${sysconfdir}/default/volatiles/volatiles.03_quagga | ||
104 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${sbindir}:${base_bindir}:${bindir}!' ${D}${sysconfdir}/init.d/* | ||
105 | |||
106 | # Remove generated info dir file, it doesn't belong in the generated | ||
107 | # package. | ||
108 | rm -f ${D}${infodir}/dir | ||
109 | |||
110 | # For PAM | ||
111 | for feature in ${DISTRO_FEATURES}; do | ||
112 | if [ "$feature" = "pam" ]; then | ||
113 | install -D -m 644 ${WORKDIR}/quagga.pam ${D}/${sysconfdir}/pam.d/quagga | ||
114 | break | ||
115 | fi | ||
116 | done | ||
117 | |||
118 | } | ||
119 | |||
120 | # Split into a main package and separate per-protocol packages | ||
121 | PACKAGE_BEFORE_PN = "${PN}-ospfd ${PN}-ospf6d ${PN}-babeld ${PN}-bgpd \ | ||
122 | ${PN}-ripd ${PN}-ripngd ${PN}-isisd \ | ||
123 | ${PN}-ospfclient ${PN}-watchquagga" | ||
124 | |||
125 | FILES_${PN}-ospfd = "${sbindir}/ospfd ${libdir}/libospf.so.*" | ||
126 | FILES_${PN}-ospf6d = "${sbindir}/ospf6d" | ||
127 | FILES_${PN}-babeld = "${sbindir}/babeld" | ||
128 | FILES_${PN}-bgpd = "${sbindir}/bgpd" | ||
129 | FILES_${PN}-ripd = "${sbindir}/ripd" | ||
130 | FILES_${PN}-ripngd = "${sbindir}/ripngd" | ||
131 | FILES_${PN}-isisd = "${sbindir}/isisd" | ||
132 | FILES_${PN}-ospfclient = "${sbindir}/ospfclient ${libdir}/libospfapiclient.so.*" | ||
133 | FILES_${PN}-watchquagga = "${sbindir}/watchquagga ${sysconfdir}/default/watchquagga \ | ||
134 | ${sysconfdir}/init.d/watchquagga" | ||
135 | |||
136 | # Indicate that the default files are configuration files | ||
137 | CONFFILES_${PN} = "${sysconfdir}/default/quagga \ | ||
138 | ${sysconfdir}/quagga/bgpd.conf \ | ||
139 | ${sysconfdir}/quagga/vtysh.conf \ | ||
140 | ${sysconfdir}/quagga/babeld.conf \ | ||
141 | ${sysconfdir}/quagga/isisd.conf \ | ||
142 | ${sysconfdir}/quagga/ospfd.conf \ | ||
143 | ${sysconfdir}/quagga/ripngd.conf \ | ||
144 | ${sysconfdir}/quagga/zebra.conf \ | ||
145 | ${sysconfdir}/quagga/ripd.conf \ | ||
146 | ${sysconfdir}/quagga/ospf6d.conf \ | ||
147 | " | ||
148 | CONFFILES_${PN}-watchquagga = "${sysconfdir}/default/watchquagga" | ||
149 | |||
150 | # Stop the names being rewritten due to the internal shared libraries | ||
151 | DEBIAN_NOAUTONAME_${PN}-ospfd = "1" | ||
152 | DEBIAN_NOAUTONAME_${PN}-ospfclient = "1" | ||
153 | |||
154 | # the "ip" command from busybox is not sufficient (flush by protocol flushes all routes) | ||
155 | RDEPENDS_${PN} += "iproute2" | ||
156 | |||
157 | # Main init script starts all deamons | ||
158 | # Seperate init script for watchquagga | ||
159 | INITSCRIPT_PACKAGES = "${PN} ${PN}-watchquagga" | ||
160 | INITSCRIPT_NAME_${PN} = "quagga" | ||
161 | INITSCRIPT_PARAMS_${PN} = "defaults 15 85" | ||
162 | INITSCRIPT_NAME_${PN}-watchquagga = "watchquagga" | ||
163 | INITSCRIPT_PARAMS_${PN}-watchquagga = "defaults 90 10" | ||
164 | |||
165 | # Add quagga's user and group | ||
166 | USERADD_PACKAGES = "${PN}" | ||
167 | GROUPADD_PARAM_${PN} = "--system quagga ; --system quaggavty" | ||
168 | USERADD_PARAM_${PN} = "--system --home ${localstatedir}/run/quagga/ -M -g quagga --shell /bin/false quagga" | ||
169 | |||
170 | pkg_postinst_${PN} () { | ||
171 | if [ -z "$D" ] && [ -e /etc/init.d/populate-volatile.sh ] ; then | ||
172 | ${sysconfdir}/init.d/populate-volatile.sh update | ||
173 | fi | ||
174 | } | ||
175 | |||
176 | # Stop apps before uninstall | ||
177 | pkg_prerm_${PN} () { | ||
178 | ${sysconfdir}/init.d/quagga stop | ||
179 | } | ||
180 | |||
181 | pkg_prerm_${PN}-ospfd () { | ||
182 | ${sysconfdir}/init.d/quagga stop ospfd | ||
183 | } | ||
184 | |||
185 | pkg_prerm_${PN}-ospf6d () { | ||
186 | ${sysconfdir}/init.d/quagga stop ospf6d | ||
187 | } | ||
188 | |||
189 | pkg_prerm_${PN}-babeld () { | ||
190 | ${sysconfdir}/init.d/quagga stop babeld | ||
191 | } | ||
192 | |||
193 | pkg_prerm_${PN}-bgpd () { | ||
194 | ${sysconfdir}/init.d/quagga stop bgpd | ||
195 | } | ||
196 | |||
197 | pkg_prerm_${PN}-ripd () { | ||
198 | ${sysconfdir}/init.d/quagga stop ripd | ||
199 | } | ||
200 | |||
201 | pkg_prerm_${PN}-ripngd () { | ||
202 | ${sysconfdir}/init.d/quagga stop ripngd | ||
203 | } | ||
204 | |||
205 | pkg_prerm_${PN}-isisd () { | ||
206 | ${sysconfdir}/init.d/quagga stop isisd | ||
207 | } | ||
diff --git a/meta-networking/recipes-protocols/quagga/quagga_0.99.21.bb b/meta-networking/recipes-protocols/quagga/quagga_0.99.21.bb new file mode 100644 index 0000000000..0988b70eb0 --- /dev/null +++ b/meta-networking/recipes-protocols/quagga/quagga_0.99.21.bb | |||
@@ -0,0 +1,15 @@ | |||
1 | require quagga.inc | ||
2 | |||
3 | PR = "${INC_PR}.0" | ||
4 | |||
5 | SRC_URI += "file://0001-doc-fix-makeinfo-errors-and-one-warning.patch \ | ||
6 | file://lingering-IP-address-after-deletion-BZ-486.patch \ | ||
7 | file://build-fix-extract.pl-for-cross-compilation.patch \ | ||
8 | file://babel-close-the-stdout-stderr-as-in-other-daemons.patch \ | ||
9 | file://work-with-new-readline.patch \ | ||
10 | " | ||
11 | |||
12 | SRC_URI[quagga-0.99.21.md5sum] = "99840adbe57047c90dfba6b6ed9aec7f" | ||
13 | SRC_URI[quagga-0.99.21.sha256sum] = "9b8aea9026b4771a28e254a66cbd854723bcd0d71eebd0201d11838d4eb392ee" | ||
14 | |||
15 | QUAGGASUBDIR = "" | ||
diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/configure_in_cross.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/configure_in_cross.patch new file mode 100644 index 0000000000..1896759427 --- /dev/null +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/configure_in_cross.patch | |||
@@ -0,0 +1,142 @@ | |||
1 | Update the configure script to cross-compiling with OE. This hard-codes | ||
2 | a few target paths, reworks a few tests to be more friendly for cross | ||
3 | and drops other tests. | ||
4 | |||
5 | Upstream-Status: Inappropriate [build system specific changes] | ||
6 | |||
7 | Index: src/configure.in | ||
8 | =================================================================== | ||
9 | --- rp-pppoe-3.8.orig/src/configure.in 2006-04-03 00:29:42.000000000 +1000 | ||
10 | +++ rp-pppoe-3.8/src/configure.in 2007-06-07 22:19:36.000000000 +1000 | ||
11 | @@ -5,6 +5,13 @@ | ||
12 | dnl pppd directory for kernel-mode PPPoE | ||
13 | PPPD_DIR=ppp-2.4.1.pppoe2 | ||
14 | |||
15 | +dnl hard code some paths | ||
16 | +PPPD=/usr/sbin/pppd | ||
17 | +ID=/usr/bin/id | ||
18 | +ECHO=/bin/echo | ||
19 | +AC_ARG_VAR(PPPD) | ||
20 | +AC_ARG_VAR(ID) | ||
21 | + | ||
22 | AC_CONFIG_HEADER(config.h) | ||
23 | |||
24 | AC_PREFIX_DEFAULT(/usr) | ||
25 | @@ -44,7 +51,7 @@ | ||
26 | AC_MSG_RESULT($ac_cv_struct_sockaddr_ll) | ||
27 | |||
28 | if test "$ac_cv_struct_sockaddr_ll" = yes ; then | ||
29 | -AC_DEFINE(HAVE_STRUCT_SOCKADDR_LL) | ||
30 | +AC_DEFINE([HAVE_STRUCT_SOCKADDR_LL], [], [Have struct SOCKADDR_LL]) | ||
31 | fi | ||
32 | |||
33 | dnl Check for N_HDLC line discipline | ||
34 | @@ -55,7 +62,7 @@ | ||
35 | ac_cv_n_hdlc=no) | ||
36 | AC_MSG_RESULT($ac_cv_n_hdlc) | ||
37 | if test "$ac_cv_n_hdlc" = yes ; then | ||
38 | -AC_DEFINE(HAVE_N_HDLC) | ||
39 | +AC_DEFINE([HAVE_N_HDLC], [], [Have N_HDLC]) | ||
40 | fi | ||
41 | |||
42 | AC_ARG_ENABLE(plugin, [ --enable-plugin=pppd_src_path build pppd plugin], ac_cv_pluginpath=$enableval, ac_cv_pluginpath=no) | ||
43 | @@ -100,13 +107,13 @@ | ||
44 | if test "$ac_cv_header_linux_if_pppox_h" = yes ; then | ||
45 | if test "$ac_cv_pluginpath" != no ; then | ||
46 | LINUX_KERNELMODE_PLUGIN=rp-pppoe.so | ||
47 | - AC_DEFINE(HAVE_LINUX_KERNEL_PPPOE) | ||
48 | + AC_DEFINE([HAVE_LINUX_KERNEL_PPPOE], [], [Have kernel PPPoE]) | ||
49 | PPPD_INCDIR=$ac_cv_pluginpath | ||
50 | fi | ||
51 | fi | ||
52 | |||
53 | if test "$ac_cv_debugging" = "yes" ; then | ||
54 | - AC_DEFINE(DEBUGGING_ENABLED) | ||
55 | + AC_DEFINE([DEBUGGING_ENABLED], [], [Debugging enabled]) | ||
56 | fi | ||
57 | |||
58 | AC_SUBST(LINUX_KERNELMODE_PLUGIN) | ||
59 | @@ -131,15 +138,8 @@ | ||
60 | AC_CHECK_SIZEOF(unsigned int) | ||
61 | AC_CHECK_SIZEOF(unsigned long) | ||
62 | |||
63 | -dnl Check for location of pppd | ||
64 | -AC_PATH_PROG(PPPD, pppd, NOTFOUND, $PATH:/sbin:/usr/sbin:/usr/local/sbin) | ||
65 | -AC_PATH_PROG(ECHO, echo, echo) | ||
66 | - | ||
67 | -dnl Check for setsid (probably Linux-specific) | ||
68 | -AC_PATH_PROG(SETSID, setsid, "", $PATH:/sbin:/usr/sbin:/usr/local/sbin) | ||
69 | - | ||
70 | dnl Check for an "id" which accepts "-u" option -- hack for Solaris. | ||
71 | -AC_PATH_PROG(ID, id, "", /usr/xpg4/bin:$PATH) | ||
72 | +dnl AC_PATH_PROG(ID, id, "", /usr/xpg4/bin:$PATH) | ||
73 | |||
74 | dnl Check for Linux-specific kernel support for PPPoE | ||
75 | AC_MSG_CHECKING(for Linux 2.4.X kernel-mode PPPoE support) | ||
76 | @@ -183,44 +183,8 @@ | ||
77 | CFLAGS="$CFLAGS -Wall -Wstrict-prototypes -ansi" | ||
78 | fi | ||
79 | |||
80 | -dnl If we couldn't find pppd, die | ||
81 | -if test "$PPPD" = "NOTFOUND"; then | ||
82 | - AC_MSG_WARN([*** Oops! I couldn't find pppd, the PPP daemon anywhere.]) | ||
83 | - AC_MSG_WARN([*** You must install pppd, version 2.3.10 or later.]) | ||
84 | - AC_MSG_WARN([*** I will keep going, but it may not work.]) | ||
85 | - PPPD=pppd | ||
86 | -fi | ||
87 | - | ||
88 | -dnl Figure out pppd version. 2.3.7 to 2.3.9 -- issue warning. Less than | ||
89 | -dnl 2.3.7 -- stop | ||
90 | - | ||
91 | -PPPD_VERSION=`$PPPD --version 2>&1 | awk ' /version/ {print $NF}'` | ||
92 | - | ||
93 | -case "$PPPD_VERSION" in | ||
94 | -1.*|2.0.*|2.1.*|2.2.*|2.3.0|2.3.1|2.3.2|2.3.3|2.3.4|2.3.5|2.3.6) | ||
95 | - AC_MSG_WARN([*** Oops! Your version of pppd is $PPPD_VERSION, which is too old.]) | ||
96 | - AC_MSG_WARN([*** You need at least 2.3.7 (2.3.10 or newer recommended.]) | ||
97 | - AC_MSG_WARN([*** I will keep going, but it may not work.]) | ||
98 | - ;; | ||
99 | - | ||
100 | -2.3.7|2.3.8|2.3.9) | ||
101 | - AC_MSG_WARN([*** Warning. Your version of pppd is $PPPD_VERSION. You will]) | ||
102 | - AC_MSG_WARN([*** not be able to use connect-on-demand. Upgrade to pppd]) | ||
103 | - AC_MSG_WARN([*** 2.3.10 or newer if you need connect-on-demand.]) | ||
104 | - ;; | ||
105 | - | ||
106 | -2*|3*|4*|5*|6*|7*|8*|9*) | ||
107 | - ;; | ||
108 | - | ||
109 | -*) | ||
110 | - AC_MSG_WARN([*** Oops. I cannot figure out what version of pppd you have.]) | ||
111 | - AC_MSG_WARN([*** All I got back was '$PPPD_VERSION']) | ||
112 | - AC_MSG_WARN([*** I will keep going, but it may not work.]) | ||
113 | - ;; | ||
114 | -esac | ||
115 | - | ||
116 | dnl Figure out packing order of structures | ||
117 | -AC_MSG_CHECKING([packing order of bit fields]) | ||
118 | +AC_CACHE_CHECK([packing order of bit fields],rpppoe_cv_pack_bitfields,[ | ||
119 | AC_TRY_RUN([ | ||
120 | union foo { | ||
121 | struct bar { | ||
122 | @@ -245,10 +209,11 @@ | ||
123 | } | ||
124 | }], rpppoe_cv_pack_bitfields=normal, rpppoe_cv_pack_bitfields=rev, | ||
125 | $ECHO "no defaults for cross-compiling"; exit 0) | ||
126 | +]) | ||
127 | |||
128 | if test "$rpppoe_cv_pack_bitfields" = "rev" ; then | ||
129 | AC_MSG_RESULT(reversed) | ||
130 | - AC_DEFINE(PACK_BITFIELDS_REVERSED) | ||
131 | + AC_DEFINE([PACK_BITFIELDS_REVERSED], [], [Reversed bitfields]) | ||
132 | else | ||
133 | AC_MSG_RESULT(normal) | ||
134 | fi | ||
135 | @@ -312,6 +277,7 @@ | ||
136 | AC_SUBST(RDYNAMIC) | ||
137 | AC_SUBST(LIBEVENT) | ||
138 | AC_SUBST(ECHO) | ||
139 | +AC_SUBST(HAVE_STRUCT_SOCKADDR_LL) | ||
140 | |||
141 | datadir_evaluated=`eval echo $datadir` | ||
142 | AC_SUBST(datadir_evaluated) | ||
diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/discard-use-of-dnl-in-Makefile.am.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/discard-use-of-dnl-in-Makefile.am.patch new file mode 100644 index 0000000000..8b7886485a --- /dev/null +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/discard-use-of-dnl-in-Makefile.am.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | From 611c9fe719c5aa264a2ad2eb920cf4522ae2ddec Mon Sep 17 00:00:00 2001 | ||
2 | From: Ting Liu <b28495@freescale.com> | ||
3 | Date: Tue, 12 Jun 2012 14:26:16 -0400 | ||
4 | Subject: [PATCH] discard use of dnl in Makefile.am | ||
5 | |||
6 | Since Makefile.am is not processed by m4, but by automake, 'dnl' does | ||
7 | not introduce a comment. | ||
8 | |||
9 | Signed-off-by: Ting Liu <b28495@freescale.com> | ||
10 | --- | ||
11 | Makefile.am | 2 +- | ||
12 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
13 | |||
14 | diff --git a/Makefile.am b/Makefile.am | ||
15 | index eff6977..3091c33 100644 | ||
16 | --- a/Makefile.am | ||
17 | +++ b/Makefile.am | ||
18 | @@ -1,5 +1,5 @@ | ||
19 | PACKAGE = rp-pppoe | ||
20 | VERSION = 3.8 | ||
21 | |||
22 | -dnl AM_CFLAGS = -Wall -DDEBUG | ||
23 | +##dnl AM_CFLAGS = -Wall -DDEBUG | ||
24 | SUBDIRS = src | ||
25 | -- | ||
26 | 1.7.6.5 | ||
27 | |||
diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/dont-swallow-errors.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/dont-swallow-errors.patch new file mode 100644 index 0000000000..c7fc9cfacc --- /dev/null +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/dont-swallow-errors.patch | |||
@@ -0,0 +1,15 @@ | |||
1 | Further fixup to the configure scripts to not swallow errors | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | --- a/src/configure.in.org 2008-01-14 21:08:38.000000000 +0200 | ||
6 | +++ a/src/configure.in 2008-01-14 21:20:09.000000000 +0200 | ||
7 | @@ -208,7 +208,7 @@ | ||
8 | return 2; | ||
9 | } | ||
10 | }], rpppoe_cv_pack_bitfields=normal, rpppoe_cv_pack_bitfields=rev, | ||
11 | -$ECHO "no defaults for cross-compiling"; exit 0) | ||
12 | +$ECHO "no defaults for cross-compiling"; exit 1) | ||
13 | ]) | ||
14 | |||
15 | if test "$rpppoe_cv_pack_bitfields" = "rev" ; then | ||
diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/pppoe-server.default b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/pppoe-server.default new file mode 100644 index 0000000000..996d57f3cf --- /dev/null +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/pppoe-server.default | |||
@@ -0,0 +1,22 @@ | |||
1 | # PPPoE Server options | ||
2 | |||
3 | # Maximum segment size, not used for in kernel PPPoE | ||
4 | #MSS=1412 | ||
5 | |||
6 | # Device(s) - Space seperated list of devices to listen on | ||
7 | #DEVICES="eth1" | ||
8 | |||
9 | # Local IP | ||
10 | #LOCAL_IP=10.0.0.1 | ||
11 | |||
12 | # Starting remote IP | ||
13 | #REMOTE_IP=10.67.15.1 | ||
14 | |||
15 | # Service name | ||
16 | #SERVICE_NAME="acme" | ||
17 | |||
18 | # Maximum number of sessions, default is 16 | ||
19 | #MAX_SESSIONS=64 | ||
20 | |||
21 | # Access concentrator name, default is the hostname | ||
22 | #ACCESS_CONCENTRATOR_NAME="pppoe-rtr-1" | ||
diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/pppoe-server.init b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/pppoe-server.init new file mode 100755 index 0000000000..21afe0be39 --- /dev/null +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/pppoe-server.init | |||
@@ -0,0 +1,59 @@ | |||
1 | #! /bin/sh | ||
2 | |||
3 | test -f /usr/sbin/pppoe-server || exit 0 | ||
4 | test -f /etc/default/pppoe-server && . /etc/default/pppoe-server | ||
5 | |||
6 | case $1 in | ||
7 | start) | ||
8 | OPTIONS="" | ||
9 | if [ -n "$MSS" ]; then | ||
10 | OPTIONS="$OPTIONS -m $MSS" | ||
11 | fi | ||
12 | if [ -n "$DEVICES" ]; then | ||
13 | for i in $DEVICES; do | ||
14 | OPTIONS="$OPTIONS -I $i" | ||
15 | done | ||
16 | fi | ||
17 | if [ -n "$LOCAL_IP" ]; then | ||
18 | OPTIONS="$OPTIONS -L $LOCAL_IP" | ||
19 | fi | ||
20 | if [ -n "$REMOTE_IP" ]; then | ||
21 | OPTIONS="$OPTIONS -R $REMOTE_IP" | ||
22 | fi | ||
23 | if [ -n "$SERVICE_NAME" ]; then | ||
24 | OPTIONS="$OPTIONS -S $SERVICE_NAME" | ||
25 | fi | ||
26 | if [ -n "$MAX_SESSIONS" ]; then | ||
27 | OPTIONS="$OPTIONS -N $MAX_SESSIONS" | ||
28 | fi | ||
29 | if [ -n "$ACCESS_CONCENTRATOR_NAME" ]; then | ||
30 | OPTIONS="$OPTIONS -C $ACCESS_CONCENTRATOR_NAME" | ||
31 | fi | ||
32 | echo -n "Starting PPPoE server: pppoe-server" | ||
33 | start-stop-daemon --start --quiet --exec /usr/sbin/pppoe-server -- $OPTIONS | ||
34 | echo "." | ||
35 | ;; | ||
36 | stop) | ||
37 | echo -n "Stopping PPPoE server: pppoe-server" | ||
38 | start-stop-daemon --stop --quiet --exec /usr/sbin/pppoe-server -- $OPTIONS | ||
39 | echo "." | ||
40 | ;; | ||
41 | status) | ||
42 | pid=$(pidof pppoe-server) | ||
43 | if [ -n "$pid" ] ; then | ||
44 | echo "Running with pid $pid" | ||
45 | else | ||
46 | echo "Not running" | ||
47 | fi | ||
48 | ;; | ||
49 | restart|force-reload) | ||
50 | $0 stop | ||
51 | $0 start | ||
52 | ;; | ||
53 | *) | ||
54 | echo "Usage: /etc/init.d/pppoe-server {start|stop|restart|force-reload}" | ||
55 | exit 1 | ||
56 | ;; | ||
57 | esac | ||
58 | |||
59 | exit 0 | ||
diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/pppoe-src-restrictions.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/pppoe-src-restrictions.patch new file mode 100644 index 0000000000..bcf4d1164d --- /dev/null +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/pppoe-src-restrictions.patch | |||
@@ -0,0 +1,20 @@ | |||
1 | Relax restrictions on the PPPoE src address, as per debian bug | ||
2 | 293811: | ||
3 | |||
4 | http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=293811 | ||
5 | |||
6 | Upstream-Status: Inappropriate [Backport from Debian] | ||
7 | |||
8 | --- rp-pppoe-3.8.orig/src/discovery.c | ||
9 | +++ rp-pppoe-3.8/src/discovery.c | ||
10 | @@ -376,8 +376,8 @@ | ||
11 | if (!packetIsForMe(conn, &packet)) continue; | ||
12 | |||
13 | if (packet.code == CODE_PADO) { | ||
14 | - if (NOT_UNICAST(packet.ethHdr.h_source)) { | ||
15 | - printErr("Ignoring PADO packet from non-unicast MAC address"); | ||
16 | + if (BROADCAST(packet.ethHdr.h_source)) { | ||
17 | + printErr("Ignoring broadcast PADO packet"); | ||
18 | continue; | ||
19 | } | ||
20 | parsePacket(&packet, parsePADOTags, &pc); | ||
diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/top-autoconf.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/top-autoconf.patch new file mode 100644 index 0000000000..4fe73d0171 --- /dev/null +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/top-autoconf.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | The autoconf stuff is all in a subdirectory, which is rather annoying | ||
2 | as OE expects patches to be applied and autoconf stuff to be done in | ||
3 | S. This adds enough autoconf at the top level to allow it to be | ||
4 | called there - all it does is run a sub autoconf stuff in the src | ||
5 | directory. | ||
6 | |||
7 | Upstream-Status: Inappropriate [build system specific change] | ||
8 | |||
9 | Index: rp-pppoe-3.8/Makefile.am | ||
10 | =================================================================== | ||
11 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
12 | +++ rp-pppoe-3.8/Makefile.am 2007-06-08 15:58:16.000000000 +1000 | ||
13 | @@ -0,0 +1,5 @@ | ||
14 | +PACKAGE = rp-pppoe | ||
15 | +VERSION = 3.8 | ||
16 | + | ||
17 | +dnl AM_CFLAGS = -Wall -DDEBUG | ||
18 | +SUBDIRS = src | ||
19 | Index: rp-pppoe-3.8/configure.in | ||
20 | =================================================================== | ||
21 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
22 | +++ rp-pppoe-3.8/configure.in 2007-06-08 15:58:16.000000000 +1000 | ||
23 | @@ -0,0 +1,4 @@ | ||
24 | +AC_INIT(src/pppoe.c) | ||
25 | +AM_INIT_AUTOMAKE([rp-pppoe], [3.8]) | ||
26 | +AC_CONFIG_SUBDIRS(src) | ||
27 | +AC_OUTPUT(Makefile) | ||
diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/update-config.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/update-config.patch new file mode 100644 index 0000000000..42a3bc62c8 --- /dev/null +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/update-config.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | Set the timeout to 0 since we don't want pppoe to try reconnecting, | ||
2 | we want whatever is calling it to reconnect. Lots of odd things | ||
3 | happen when you have pppoe retrying itself. | ||
4 | |||
5 | The path for the plugin is wrong, it's now part of ppp and is in a | ||
6 | ppp's plugin lib directory. If no path is specified then that's where | ||
7 | ppp looks, so that's what we do here. | ||
8 | |||
9 | Upstream-Status: Inappropriate [configuration] | ||
10 | |||
11 | Index: rp-pppoe-3.8/configs/pppoe.conf | ||
12 | =================================================================== | ||
13 | --- rp-pppoe-3.8.orig/configs/pppoe.conf 2006-04-03 00:29:41.000000000 +1000 | ||
14 | +++ rp-pppoe-3.8/configs/pppoe.conf 2007-06-08 16:02:47.000000000 +1000 | ||
15 | @@ -66,7 +66,7 @@ | ||
16 | # to connect forever after pppoe-start is called. Otherwise, it will | ||
17 | # give out after CONNECT_TIMEOUT seconds and will not attempt to | ||
18 | # connect again, making it impossible to reach. | ||
19 | -CONNECT_TIMEOUT=30 | ||
20 | +CONNECT_TIMEOUT=0 | ||
21 | |||
22 | # How often in seconds pppoe-start polls to check if link is up | ||
23 | CONNECT_POLL=2 | ||
24 | @@ -115,7 +115,7 @@ | ||
25 | FIREWALL=NONE | ||
26 | |||
27 | # Linux kernel-mode plugin for pppd. If you want to try the kernel-mode | ||
28 | -# plugin, use LINUX_PLUGIN=/etc/ppp/plugins/rp-pppoe.so | ||
29 | +# plugin, use LINUX_PLUGIN=rp-pppoe.so | ||
30 | LINUX_PLUGIN= | ||
31 | |||
32 | # Any extra arguments to pass to pppoe. Normally, use a blank string | ||
diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/use-ldflags.patch b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/use-ldflags.patch new file mode 100644 index 0000000000..95f629298b --- /dev/null +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe-3.8/use-ldflags.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | Make the Makefile obey LDFLAGS. | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | --- a/src/Makefile.in 2006-04-02 18:29:42.000000000 +0400 | ||
6 | +++ b/src/Makefile.in 2010-04-16 17:51:31.000000000 +0400 | ||
7 | @@ -67,16 +67,16 @@ all: $(TARGETS) | ||
8 | @echo "Type 'make install' as root to install the software." | ||
9 | |||
10 | pppoe-sniff: pppoe-sniff.o if.o common.o debug.o | ||
11 | - @CC@ -o pppoe-sniff pppoe-sniff.o if.o common.o debug.o | ||
12 | + @CC@ -o pppoe-sniff pppoe-sniff.o if.o common.o debug.o $(LDFLAGS) | ||
13 | |||
14 | pppoe-server: pppoe-server.o if.o debug.o common.o md5.o libevent/libevent.a @PPPOE_SERVER_DEPS@ | ||
15 | - @CC@ -o pppoe-server @RDYNAMIC@ pppoe-server.o if.o debug.o common.o md5.o $(PPPOE_SERVER_LIBS) -Llibevent -levent | ||
16 | + @CC@ -o pppoe-server @RDYNAMIC@ pppoe-server.o if.o debug.o common.o md5.o $(PPPOE_SERVER_LIBS) -Llibevent -levent $(LDFLAGS) | ||
17 | |||
18 | pppoe: pppoe.o if.o debug.o common.o ppp.o discovery.o | ||
19 | - @CC@ -o pppoe pppoe.o if.o debug.o common.o ppp.o discovery.o | ||
20 | + @CC@ -o pppoe pppoe.o if.o debug.o common.o ppp.o discovery.o $(LDFLAGS) | ||
21 | |||
22 | pppoe-relay: relay.o if.o debug.o common.o | ||
23 | - @CC@ -o pppoe-relay relay.o if.o debug.o common.o | ||
24 | + @CC@ -o pppoe-relay relay.o if.o debug.o common.o $(LDFLAGS) | ||
25 | |||
26 | pppoe.o: pppoe.c pppoe.h | ||
27 | @CC@ $(CFLAGS) '-DVERSION="$(VERSION)"' -c -o pppoe.o pppoe.c | ||
diff --git a/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe_3.8.bb b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe_3.8.bb new file mode 100644 index 0000000000..90a8f4dd91 --- /dev/null +++ b/meta-networking/recipes-protocols/rp-pppoe/rp-pppoe_3.8.bb | |||
@@ -0,0 +1,58 @@ | |||
1 | SUMMARY = "A user-mode PPPoE client and server suite for Linux" | ||
2 | HOMEPAGE = "http://www.roaringpenguin.com/products/pppoe" | ||
3 | SECTION = "console/network" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://doc/LICENSE;md5=a194eaefae2be54ee3221339b10d0581" | ||
6 | |||
7 | PR = "r10" | ||
8 | |||
9 | SRC_URI = "http://www.roaringpenguin.com/files/download/${BP}.tar.gz \ | ||
10 | file://top-autoconf.patch \ | ||
11 | file://configure_in_cross.patch \ | ||
12 | file://pppoe-src-restrictions.patch \ | ||
13 | file://update-config.patch \ | ||
14 | file://dont-swallow-errors.patch \ | ||
15 | file://discard-use-of-dnl-in-Makefile.am.patch \ | ||
16 | file://use-ldflags.patch \ | ||
17 | file://pppoe-server.default \ | ||
18 | file://pppoe-server.init" | ||
19 | |||
20 | SRC_URI[md5sum] = "0e32760f498f9cde44081ee6aafc823b" | ||
21 | SRC_URI[sha256sum] = "d916e9cfe1e62395f63a5361936fa855f6d0f0a37dc7227b394cdb725f553479" | ||
22 | |||
23 | inherit autotools update-rc.d | ||
24 | |||
25 | do_install() { | ||
26 | # Install init script and default settings | ||
27 | install -m 0755 -d ${D}${sysconfdir}/default ${D}${sysconfdir}/init.d | ||
28 | install -m 0644 ${WORKDIR}/pppoe-server.default ${D}${sysconfdir}/default/pppoe-server | ||
29 | install -m 0755 ${WORKDIR}/pppoe-server.init ${D}${sysconfdir}/init.d/pppoe-server | ||
30 | # Install | ||
31 | oe_runmake -C ${S} RPM_INSTALL_ROOT=${D} docdir=${docdir} install | ||
32 | chmod 4755 ${D}${sbindir}/pppoe | ||
33 | } | ||
34 | |||
35 | # Insert server package before main package | ||
36 | PACKAGES = "${PN}-dbg ${PN}-server ${PN}-relay ${PN}-sniff ${PN} ${PN}-doc" | ||
37 | |||
38 | FILES_${PN}-server = "${sysconfdir}/default/pppoe-server \ | ||
39 | ${sysconfdir}/init.d/pppoe-server \ | ||
40 | ${sbindir}/pppoe-server \ | ||
41 | ${sysconfdir}/ppp/pppoe-server-options" | ||
42 | FILES_${PN}-relay = "${sbindir}/pppoe-relay" | ||
43 | FILES_${PN}-sniff = "${sbindir}/pppoe-sniff" | ||
44 | |||
45 | CONFFILES_${PN} = "${sysconfdir}/ppp/pppoe.conf \ | ||
46 | ${sysconfdir}/ppp/firewall-standalone \ | ||
47 | ${sysconfdir}/ppp/firewall-masq" | ||
48 | CONFFILES_${PN}-server = "${sysconfdir}/ppp/pppoe-server-options \ | ||
49 | ${sysconfdir}/default/pppoe-server" | ||
50 | |||
51 | INITSCRIPT_PACKAGES = "${PN}-server" | ||
52 | INITSCRIPT_NAME_${PN}-server = "pppoe-server" | ||
53 | INITSCRIPT_PARAMS_${PN}-server = "defaults 92 8" | ||
54 | |||
55 | RDEPENDS_${PN} = "ppp" | ||
56 | RDEPENDS_${PN}-server = "${PN}" | ||
57 | RRECOMMENDS_${PN} = "ppp-oe" | ||
58 | |||
diff --git a/meta-networking/recipes-protocols/xl2tpd/xl2tpd.inc b/meta-networking/recipes-protocols/xl2tpd/xl2tpd.inc new file mode 100644 index 0000000000..f4ea2b8266 --- /dev/null +++ b/meta-networking/recipes-protocols/xl2tpd/xl2tpd.inc | |||
@@ -0,0 +1,40 @@ | |||
1 | SUMMARY = "Xelerance version of the Layer 2 Tunneling Protocol (L2TP) daemon" | ||
2 | HOMEPAGE = "http://www.xelerance.com/software/xl2tpd/" | ||
3 | SECTION = "network" | ||
4 | DEPENDS = "ppp virtual/kernel" | ||
5 | |||
6 | LICENSE = "GPLv2" | ||
7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=0636e73ff0215e8d672dc4c32c317bb3" | ||
8 | |||
9 | INC_PR = "r0" | ||
10 | |||
11 | SRC_URI = "git://github.com/xelerance/xl2tpd.git" | ||
12 | |||
13 | S = "${WORKDIR}/git" | ||
14 | |||
15 | inherit update-rc.d | ||
16 | |||
17 | do_compile () { | ||
18 | oe_runmake CFLAGS="${CFLAGS} -DLINUX" LDFLAGS="${LDFLAGS}" PREFIX="${prefix}" KERNELSRC=${STAGING_KERNEL_DIR} all | ||
19 | } | ||
20 | |||
21 | do_install () { | ||
22 | oe_runmake PREFIX="${D}${prefix}" install | ||
23 | |||
24 | install -d ${D}${sysconfdir}/init.d | ||
25 | touch ${D}${sysconfdir}/xl2tpd.conf | ||
26 | install -m 0755 debian/xl2tpd.init ${D}${sysconfdir}/init.d/xl2tpd | ||
27 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/xl2tpd | ||
28 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/xl2tpd | ||
29 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/xl2tpd | ||
30 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${sysconfdir}/init.d/xl2tpd | ||
31 | |||
32 | install -d ${D}${sysconfdir}/default | ||
33 | install -m 0644 debian/xl2tpd.default ${D}${sysconfdir}/default/xl2tpd | ||
34 | } | ||
35 | |||
36 | CONFFILES_${PN} += "${sysconfdir}/xl2tpd.conf ${sysconfdir}/default/xl2tpd" | ||
37 | |||
38 | INITSCRIPT_PACKAGES = "${PN}" | ||
39 | INITSCRIPT_NAME_${PN} = "xl2tpd" | ||
40 | |||
diff --git a/meta-networking/recipes-protocols/xl2tpd/xl2tpd_git.bb b/meta-networking/recipes-protocols/xl2tpd/xl2tpd_git.bb new file mode 100644 index 0000000000..bd084aa009 --- /dev/null +++ b/meta-networking/recipes-protocols/xl2tpd/xl2tpd_git.bb | |||
@@ -0,0 +1,5 @@ | |||
1 | require xl2tpd.inc | ||
2 | PR = "${INC_PR}.0" | ||
3 | |||
4 | SRCREV = "df7e30eb199fc5710faa83866381aea18b66e60c" | ||
5 | |||
diff --git a/meta-networking/recipes-protocols/zeroconf/zeroconf/compilefix.patch b/meta-networking/recipes-protocols/zeroconf/zeroconf/compilefix.patch new file mode 100644 index 0000000000..328e574a9e --- /dev/null +++ b/meta-networking/recipes-protocols/zeroconf/zeroconf/compilefix.patch | |||
@@ -0,0 +1,19 @@ | |||
1 | | zeroconf.c: In function 'main': | ||
2 | | zeroconf.c:145: error: 'PATH_MAX' undeclared (first use in this function) | ||
3 | |||
4 | RP - 4/9/09 | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Index: zeroconf-0.9/zeroconf.c | ||
9 | =================================================================== | ||
10 | --- zeroconf-0.9.orig/zeroconf.c 2009-09-04 10:05:25.000000000 +0100 | ||
11 | +++ zeroconf-0.9/zeroconf.c 2009-09-04 10:05:42.000000000 +0100 | ||
12 | @@ -33,6 +33,7 @@ | ||
13 | #include <net/if_arp.h> | ||
14 | #include <sys/time.h> | ||
15 | #include <signal.h> | ||
16 | +#include <limits.h> | ||
17 | |||
18 | #include "delay.h" | ||
19 | |||
diff --git a/meta-networking/recipes-protocols/zeroconf/zeroconf/debian-zeroconf b/meta-networking/recipes-protocols/zeroconf/zeroconf/debian-zeroconf new file mode 100644 index 0000000000..0c9d15ba12 --- /dev/null +++ b/meta-networking/recipes-protocols/zeroconf/zeroconf/debian-zeroconf | |||
@@ -0,0 +1,51 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if [ ! -x /usr/sbin/zeroconf ]; then | ||
4 | exit 0 | ||
5 | fi | ||
6 | |||
7 | # IPv4 link-local addresses (zeroconf) are | ||
8 | # only applicable on the 'inet' address family | ||
9 | [ "X$ADDRFAM" != "Xinet" ] && exit 0 | ||
10 | |||
11 | # However there are some methods where it doesn't | ||
12 | # make any sense to configure an IPv4LL address | ||
13 | |||
14 | # not on loopback | ||
15 | [ "X$METHOD" = "Xloopback" ] && exit 0 | ||
16 | |||
17 | # not on ppp or wvdial either | ||
18 | [ "X$METHOD" = "Xppp" ] && exit 0 | ||
19 | [ "X$METHOD" = "Xwvdial" ] && exit 0 | ||
20 | |||
21 | # The administrator may have blacklisted interfaces | ||
22 | # or only want zeroconf in a fallback situation | ||
23 | [ -f /etc/default/zeroconf ] && | ||
24 | . /etc/default/zeroconf | ||
25 | |||
26 | [ -n "$DISABLE" ] && exit 0 | ||
27 | |||
28 | for BLACK in $IFBLACKLIST; do | ||
29 | case $IFACE in | ||
30 | $BLACK) | ||
31 | exit 0 | ||
32 | ;; | ||
33 | esac | ||
34 | done | ||
35 | |||
36 | # should we only allocate an address if we do not already have one? | ||
37 | if [ -n "$FALLBACK" ]; then | ||
38 | /sbin/ip addr show $IFACE scope global | grep -q "inet" | ||
39 | IP=$? | ||
40 | if [ $IP -eq 0 ]; then | ||
41 | /sbin/ip route add 169.254.0.0/16 dev $IFACE | ||
42 | exit 0 | ||
43 | fi | ||
44 | fi | ||
45 | |||
46 | # otherwise, run if we aren't already going | ||
47 | if [ ! -r /var/run/zeroconf.$IFACE.pid ]; then | ||
48 | /usr/sbin/zeroconf -i $IFACE | ||
49 | fi | ||
50 | |||
51 | exit 0 | ||
diff --git a/meta-networking/recipes-protocols/zeroconf/zeroconf/zeroconf-default b/meta-networking/recipes-protocols/zeroconf/zeroconf/zeroconf-default new file mode 100644 index 0000000000..cc07b275f1 --- /dev/null +++ b/meta-networking/recipes-protocols/zeroconf/zeroconf/zeroconf-default | |||
@@ -0,0 +1,17 @@ | |||
1 | # Default for zeroconf | ||
2 | |||
3 | # disable zeroconf | ||
4 | # If you want to disable zeroconf completely, uncomment the following line | ||
5 | # this may be useful if you are debugging zeroconf or starting it manually | ||
6 | #DISABLE=yes | ||
7 | |||
8 | # black-listed interfaces | ||
9 | # Interfaces which you never wish to have zeroconf run on should | ||
10 | # be listed here. e.g. "eth2 wlan1" in a space seperated string | ||
11 | IFBLACKLIST="" | ||
12 | |||
13 | # fallback only | ||
14 | # If you would only like a link-local address if you were unable to | ||
15 | # obtain an address via DHCP then uncomment the following line | ||
16 | #FALLBACK=yes | ||
17 | |||
diff --git a/meta-networking/recipes-protocols/zeroconf/zeroconf_0.9.bb b/meta-networking/recipes-protocols/zeroconf/zeroconf_0.9.bb new file mode 100644 index 0000000000..9307263c7b --- /dev/null +++ b/meta-networking/recipes-protocols/zeroconf/zeroconf_0.9.bb | |||
@@ -0,0 +1,34 @@ | |||
1 | SUMMARY = "IPv4 link-local address allocator" | ||
2 | DESCRIPTION = "Zeroconf is a program that is used to claim IPv4 \ | ||
3 | link-local addresses. IPv4 link-local addresses are useful when setting \ | ||
4 | up ad-hoc networking between devices without the involvement of a either \ | ||
5 | a DHCP server or network administrator. \ | ||
6 | These addresses are allocated from the 169.254.0.0/16 address range and \ | ||
7 | are normally attached to each Ethernet device in your computer. \ | ||
8 | Addresses are assigned randomly by each host and, in case of collision, \ | ||
9 | both hosts (are supposed to) renumber." | ||
10 | AUTHOR = "Anand Kumria <wildfire@progsoc.uts.edu.au>" | ||
11 | HOMEPAGE = "http://www.progsoc.org/~wildfire/zeroconf/" | ||
12 | LICENSE = "GPLv2+" | ||
13 | LIC_FILES_CHKSUM = "file://COPYING;md5=4325afd396febcb659c36b49533135d4 \ | ||
14 | file://zeroconf.c;beginline=1;endline=13;md5=a5bada96e1e34b08eb7446b28e2630b2" | ||
15 | SECTION = "net" | ||
16 | |||
17 | PR = "r1" | ||
18 | |||
19 | SRC_URI = "http://www.progsoc.org/~wildfire/zeroconf/download/${BPN}-${PV}.tar.gz \ | ||
20 | file://compilefix.patch \ | ||
21 | file://zeroconf-default \ | ||
22 | file://debian-zeroconf" | ||
23 | |||
24 | SRC_URI[md5sum] = "bdafb16b008ebb5633e4e581f77821d2" | ||
25 | SRC_URI[sha256sum] = "a8c74df127753e2310fa1e072f3c9ca44a404bb0bbce9cfec7a84c6dff8bec7b" | ||
26 | |||
27 | do_install () { | ||
28 | install -d ${D}${sbindir} | ||
29 | install -d ${D}${sysconfdir}/network/if-up.d | ||
30 | install -d ${D}${sysconfdir}/default | ||
31 | install -c -m 755 ${S}/zeroconf ${D}${sbindir}/zeroconf | ||
32 | install -c -m 755 ${WORKDIR}/debian-zeroconf ${D}${sysconfdir}/network/if-up.d/zeroconf | ||
33 | install -c ${WORKDIR}/zeroconf-default ${D}${sysconfdir}/default/zeroconf | ||
34 | } | ||
diff --git a/meta-networking/recipes-support/aoetools/aoetools_34.bb b/meta-networking/recipes-support/aoetools/aoetools_34.bb new file mode 100644 index 0000000000..1557de96fb --- /dev/null +++ b/meta-networking/recipes-support/aoetools/aoetools_34.bb | |||
@@ -0,0 +1,24 @@ | |||
1 | SUMMARY = "ATA over Ethernet Tools" | ||
2 | DESCRIPTION = " \ | ||
3 | The aoetools are programs for users of the ATA over Ethernet (AoE)network \ | ||
4 | storage protocol, a simple protocol for using storage over anethernet LAN. \ | ||
5 | The vblade program (storage target) exports a blockdevice using AoE. \ | ||
6 | " | ||
7 | HOMEPAGE = "http://sourceforge.net/projects/${BPN}" | ||
8 | SECTION = "console/network" | ||
9 | LICENSE = "GPLv2" | ||
10 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
11 | RRECOMMENDS_${PN} = "kernel-module-aoe" | ||
12 | |||
13 | |||
14 | SRC_URI = "http://sourceforge.net/projects/${BPN}/files/${BPN}/${PV}/${BPN}-${PV}.tar.gz" | ||
15 | SRC_URI[md5sum] = "cde7f7cedc7cd9938a5ebfd009dd3ec0" | ||
16 | SRC_URI[sha256sum] = "fd6c57244e9458d7cbe7a0171295ddee4d8cdcae291e40d6acbc641df7296d85" | ||
17 | |||
18 | # EXTRA_OEMAKE is typically: -e MAKEFLAGS= | ||
19 | # the -e causes problems as CFLAGS is modified in the Makefile. | ||
20 | EXTRA_OEMAKE = "" | ||
21 | |||
22 | do_install() { | ||
23 | oe_runmake DESTDIR=${D} install | ||
24 | } | ||
diff --git a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-arpt-get-target-fix.patch b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-arpt-get-target-fix.patch new file mode 100644 index 0000000000..0875344feb --- /dev/null +++ b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-arpt-get-target-fix.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | arptables: fix the redefinition of 'arpt_get_target' | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | This function is already defined as a static inline function in | ||
6 | include/linux/netfilter_arp/arp_tables.h, once GCC uses -O0, the | ||
7 | inline will not work, and the redefinition error will happen | ||
8 | |||
9 | Signed-off-by: Aws Ismail <aws.ismail@windriver.com> | ||
10 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
11 | |||
12 | diff --git a/libarptc/libarptc_incl.c b/libarptc/libarptc_incl.c | ||
13 | index 35736db..addd3f9 100644 | ||
14 | --- a/libarptc/libarptc_incl.c | ||
15 | +++ b/libarptc/libarptc_incl.c | ||
16 | @@ -11,14 +11,6 @@ | ||
17 | /* (C)1999 Paul ``Rusty'' Russell - Placed under the GNU GPL (See | ||
18 | COPYING for details). */ | ||
19 | |||
20 | -#ifndef __OPTIMIZE__ | ||
21 | -STRUCT_ENTRY_TARGET * | ||
22 | -GET_TARGET(STRUCT_ENTRY *e) | ||
23 | -{ | ||
24 | - return (void *)e + e->target_offset; | ||
25 | -} | ||
26 | -#endif | ||
27 | - | ||
28 | static int sockfd = -1; | ||
29 | static void *arptc_fn = NULL; | ||
30 | |||
diff --git a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-compile-install.patch b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-compile-install.patch new file mode 100644 index 0000000000..80e9804724 --- /dev/null +++ b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-compile-install.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | Index: arptables-v0.0.3-4/Makefile | ||
2 | =================================================================== | ||
3 | --- arptables-v0.0.3-4.orig/Makefile 2010-03-08 18:49:28.000000000 +0300 | ||
4 | +++ arptables-v0.0.3-4/Makefile 2010-03-22 15:52:56.000000000 +0300 | ||
5 | @@ -6,12 +6,11 @@ | ||
6 | LIBDIR:=$(PREFIX)/lib | ||
7 | BINDIR:=$(PREFIX)/sbin | ||
8 | MANDIR:=$(PREFIX)/man | ||
9 | -INITDIR:=/etc/rc.d/init.d | ||
10 | +INITDIR:=/etc/init.d | ||
11 | SYSCONFIGDIR:=/etc/sysconfig | ||
12 | DESTDIR:= | ||
13 | |||
14 | -COPT_FLAGS:=-O2 | ||
15 | -CFLAGS:=$(COPT_FLAGS) -Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\" #-g -DDEBUG #-pg # -DARPTC_DEBUG | ||
16 | +ARPCFLAGS:=-Wall -Wunused -I$(KERNEL_DIR)/include/ -Iinclude/ -DARPTABLES_VERSION=\"$(ARPTABLES_VERSION)\" | ||
17 | |||
18 | ifndef ARPT_LIBDIR | ||
19 | ARPT_LIBDIR:=$(LIBDIR)/arptables | ||
20 | @@ -22,16 +21,16 @@ | ||
21 | all: arptables | ||
22 | |||
23 | arptables.o: arptables.c | ||
24 | - $(CC) $(CFLAGS) -c -o $@ $< | ||
25 | + $(CC) $(CFLAGS) $(ARPCFLAGS) -c -o $@ $< | ||
26 | |||
27 | arptables-standalone.o: arptables-standalone.c | ||
28 | - $(CC) $(CFLAGS) -c -o $@ $< | ||
29 | + $(CC) $(CFLAGS) $(ARPCFLAGS) -c -o $@ $< | ||
30 | |||
31 | libarptc/libarptc.o: libarptc/libarptc.c libarptc/libarptc_incl.c | ||
32 | - $(CC) $(CFLAGS) -c -o $@ $< | ||
33 | + $(CC) $(CFLAGS) $(ARPCFLAGS) -c -o $@ $< | ||
34 | |||
35 | arptables: arptables-standalone.o arptables.o libarptc/libarptc.o $(EXT_OBJS) | ||
36 | - $(CC) $(CFLAGS) -o $@ $^ | ||
37 | + $(CC) $(LDFLAGS) $(CFLAGS) $(ARPCFLAGS) -o $@ $^ | ||
38 | |||
39 | $(DESTDIR)$(MANDIR)/man8/arptables.8: arptables.8 | ||
40 | mkdir -p $(@D) | ||
41 | @@ -50,6 +49,7 @@ | ||
42 | cat arptables-restore | sed 's/__EXEC_PATH__/$(tmp1)/g' > arptables-restore_ | ||
43 | install -m 0755 -o root -g root arptables-restore_ $(DESTDIR)$(BINDIR)/arptables-restore | ||
44 | cat arptables.sysv | sed 's/__EXEC_PATH__/$(tmp1)/g' | sed 's/__SYSCONFIG__/$(tmp2)/g' > arptables.sysv_ | ||
45 | + install -d $(DESTDIR)$(INITDIR) | ||
46 | if test -d $(DESTDIR)$(INITDIR); then install -m 0755 -o root -g root arptables.sysv_ $(DESTDIR)$(INITDIR)/arptables; fi | ||
47 | rm -f arptables-save_ arptables-restore_ arptables.sysv_ | ||
48 | |||
49 | Index: arptables-v0.0.3-4/extensions/Makefile | ||
50 | =================================================================== | ||
51 | --- arptables-v0.0.3-4.orig/extensions/Makefile 2010-03-08 18:49:28.000000000 +0300 | ||
52 | +++ arptables-v0.0.3-4/extensions/Makefile 2010-03-22 15:52:38.000000000 +0300 | ||
53 | @@ -4,4 +4,7 @@ | ||
54 | EXT_OBJS+=$(foreach T,$(EXT_FUNC), extensions/arpt_$(T).o) | ||
55 | |||
56 | extensions/ebt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h | ||
57 | - $(CC) $(CFLAGS) $(PROGSPECS) -c -o $@ $< | ||
58 | + $(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $< | ||
59 | + | ||
60 | +extensions/arpt_%.o: extensions/arpt_%.c include/arptables.h include/arptables_common.h | ||
61 | + $(CC) $(CFLAGS) $(ARPCFLAGS) $(PROGSPECS) -c -o $@ $< | ||
diff --git a/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-init-busybox.patch b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-init-busybox.patch new file mode 100644 index 0000000000..24956c4ca9 --- /dev/null +++ b/meta-networking/recipes-support/arptables/arptables-0.0.3-4/arptables-init-busybox.patch | |||
@@ -0,0 +1,77 @@ | |||
1 | Index: arptables-v0.0.3-4/arptables.sysv | ||
2 | =================================================================== | ||
3 | --- arptables-v0.0.3-4.orig/arptables.sysv 2010-03-22 16:28:03.000000000 +0300 | ||
4 | +++ arptables-v0.0.3-4/arptables.sysv 2010-03-22 16:27:51.000000000 +0300 | ||
5 | @@ -12,10 +12,10 @@ | ||
6 | # config: __SYSCONFIG__/arptables | ||
7 | |||
8 | source /etc/init.d/functions | ||
9 | -source /etc/sysconfig/network | ||
10 | +# source /etc/sysconfig/network | ||
11 | |||
12 | # Check that networking is up. | ||
13 | -[ ${NETWORKING} = "no" ] && exit 0 | ||
14 | +# [ ${NETWORKING} = "no" ] && exit 0 | ||
15 | |||
16 | [ -x __EXEC_PATH__/arptables ] || exit 1 | ||
17 | [ -x __EXEC_PATH__/arptables-save ] || exit 1 | ||
18 | @@ -28,32 +28,30 @@ | ||
19 | desc="Arp filtering" | ||
20 | |||
21 | start() { | ||
22 | - echo -n $"Starting $desc ($prog): " | ||
23 | + echo -n "Starting $desc ($prog): " | ||
24 | __EXEC_PATH__/arptables-restore < __SYSCONFIG__/arptables || RETVAL=1 | ||
25 | |||
26 | if [ $RETVAL -eq 0 ]; then | ||
27 | - success "$prog startup" | ||
28 | - rm -f /var/lock/subsys/$prog | ||
29 | + echo "$prog ok" | ||
30 | + touch /var/lock/subsys/$prog | ||
31 | else | ||
32 | - failure "$prog startup" | ||
33 | + echo "$prog failed" | ||
34 | fi | ||
35 | |||
36 | - echo | ||
37 | return $RETVAL | ||
38 | } | ||
39 | |||
40 | stop() { | ||
41 | - echo -n $"Stopping $desc ($prog): " | ||
42 | + echo -n "Stopping $desc ($prog): " | ||
43 | __EXEC_PATH__/arptables-restore < /dev/null || RETVAL=1 | ||
44 | |||
45 | if [ $RETVAL -eq 0 ]; then | ||
46 | - success "$prog shutdown" | ||
47 | - rm -f %{_localstatedir}/lock/subsys/$prog | ||
48 | + echo "$prog stopped" | ||
49 | + rm -f /var/lock/subsys/$prog | ||
50 | else | ||
51 | - failure "$prog shutdown" | ||
52 | + echo "$prog failed to stop" | ||
53 | fi | ||
54 | |||
55 | - echo | ||
56 | return $RETVAL | ||
57 | } | ||
58 | |||
59 | @@ -63,15 +61,14 @@ | ||
60 | } | ||
61 | |||
62 | save() { | ||
63 | - echo -n $"Saving $desc ($prog): " | ||
64 | + echo -n "Saving $desc ($prog): " | ||
65 | __EXEC_PATH__/arptables-save > __SYSCONFIG__/arptables || RETVAL=1 | ||
66 | |||
67 | if [ $RETVAL -eq 0 ]; then | ||
68 | - success "$prog saved" | ||
69 | + echo "$prog saved" | ||
70 | else | ||
71 | - failure "$prog saved" | ||
72 | + echo "$prog is not saved" | ||
73 | fi | ||
74 | - echo | ||
75 | } | ||
76 | |||
77 | case "$1" in | ||
diff --git a/meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb b/meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb new file mode 100644 index 0000000000..74f81b554a --- /dev/null +++ b/meta-networking/recipes-support/arptables/arptables_0.0.3-4.bb | |||
@@ -0,0 +1,33 @@ | |||
1 | SUMMARY = "Administration tool for arp packet filtering" | ||
2 | PRIORITY = "optional" | ||
3 | LICENSE = "GPL-2.0" | ||
4 | SECTION = "console/network" | ||
5 | |||
6 | PR = "r2" | ||
7 | |||
8 | RDEPENDS_${PN} += "perl" | ||
9 | |||
10 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/GPL-2.0;md5=801f80980d171dd6425610833a22dbe6" | ||
11 | SRC_URI = " \ | ||
12 | ${SOURCEFORGE_MIRROR}/ebtables/arptables-v${PV}.tar.gz;name=arptables \ | ||
13 | file://arptables-compile-install.patch \ | ||
14 | file://arptables-init-busybox.patch \ | ||
15 | file://arptables-arpt-get-target-fix.patch \ | ||
16 | " | ||
17 | SRC_URI[arptables.md5sum] = "1d4ab05761f063b0751645d8f2b8f8e5" | ||
18 | SRC_URI[arptables.sha256sum] = "e529fd465c67d69ad335299a043516e6b38cdcd337a5ed21718413e96073f928" | ||
19 | |||
20 | S = "${WORKDIR}/arptables-v${PV}" | ||
21 | |||
22 | do_compile () { | ||
23 | oe_runmake | ||
24 | } | ||
25 | |||
26 | # the install target is not multi-job safe, but it doesn't do much | ||
27 | # so we just install serially | ||
28 | # | ||
29 | PARALLEL_MAKEINST = "-j1" | ||
30 | |||
31 | fakeroot do_install () { | ||
32 | oe_runmake 'BINDIR=${sbindir}' 'MANDIR=${mandir}/' 'DESTDIR=${D}' install | ||
33 | } | ||
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils.inc b/meta-networking/recipes-support/bridge-utils/bridge-utils.inc new file mode 100644 index 0000000000..feeba74350 --- /dev/null +++ b/meta-networking/recipes-support/bridge-utils/bridge-utils.inc | |||
@@ -0,0 +1,28 @@ | |||
1 | SUMMARY = "Tools for ethernet bridging" | ||
2 | HOMEPAGE = "http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge" | ||
3 | SECTION = "console/network" | ||
4 | LICENSE = "GPLv2" | ||
5 | |||
6 | DEPENDS = "sysfsutils" | ||
7 | |||
8 | SRC_URI = "${SOURCEFORGE_MIRROR}/bridge/bridge-utils-${PV}.tar.gz \ | ||
9 | file://bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch \ | ||
10 | file://bridge-utils-1.5-fix-error-message-for-incorrect-command.patch \ | ||
11 | file://bridge-utils-1.5-fix-incorrect-command-in-manual.patch \ | ||
12 | " | ||
13 | |||
14 | inherit autotools-brokensep update-alternatives | ||
15 | |||
16 | ALTERNATIVE_${PN} = "brctl" | ||
17 | ALTERNATIVE_PRIORITY[brctl] = "100" | ||
18 | ALTERNATIVE_LINK_NAME[brctl] = "${sbindir}/brctl" | ||
19 | |||
20 | EXTRA_OECONF = "--with-linux-headers=${STAGING_INCDIR}" | ||
21 | |||
22 | do_install_append () { | ||
23 | install -d ${D}/${datadir}/bridge-utils | ||
24 | install -d ${D}/${sysconfdir}/network/if-pre-up.d | ||
25 | install -d ${D}/${sysconfdir}/network/if-post-down.d | ||
26 | } | ||
27 | |||
28 | RRECOMMENDS_${PN} = "kernel-module-bridge" | ||
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch new file mode 100644 index 0000000000..d00af9c159 --- /dev/null +++ b/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch | |||
@@ -0,0 +1,87 @@ | |||
1 | Upstream-status: BackPort [http://pkgs.fedoraproject.org/cgit/bridge-utils.git/diff/bridge-utils-1.5-check-error-returns-from-write-to-sysfs.patch?id=b0d10717fd7cebf5d85eed3f941b409fa0384f08] | ||
2 | |||
3 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
4 | |||
5 | From bb9970a9df95837e39d680021b1f73d231e85406 Mon Sep 17 00:00:00 2001 | ||
6 | From: Stephen Hemminger <shemminger@vyatta.com> | ||
7 | Date: Tue, 3 May 2011 09:52:43 -0700 | ||
8 | Subject: [PATCH 3/3] Check error returns from write to sysfs | ||
9 | |||
10 | Add helper function to check write to sysfs files. | ||
11 | |||
12 | Signed-off-by: Petr Sabata <contyk@redhat.com> | ||
13 | --- | ||
14 | libbridge/libbridge_devif.c | 37 +++++++++++++++++++++++-------------- | ||
15 | 1 files changed, 23 insertions(+), 14 deletions(-) | ||
16 | |||
17 | diff --git a/libbridge/libbridge_devif.c b/libbridge/libbridge_devif.c | ||
18 | index aa8bc36..1e83925 100644 | ||
19 | --- a/libbridge/libbridge_devif.c | ||
20 | +++ b/libbridge/libbridge_devif.c | ||
21 | @@ -280,25 +280,38 @@ fallback: | ||
22 | return old_get_port_info(brname, port, info); | ||
23 | } | ||
24 | |||
25 | +static int set_sysfs(const char *path, unsigned long value) | ||
26 | +{ | ||
27 | + int fd, ret = 0, cc; | ||
28 | + char buf[32]; | ||
29 | + | ||
30 | + fd = open(path, O_WRONLY); | ||
31 | + if (fd < 0) | ||
32 | + return -1; | ||
33 | + | ||
34 | + cc = snprintf(buf, sizeof(buf), "%lu\n", value); | ||
35 | + if (write(fd, buf, cc) < 0) | ||
36 | + ret = -1; | ||
37 | + close(fd); | ||
38 | + | ||
39 | + return ret; | ||
40 | +} | ||
41 | + | ||
42 | |||
43 | static int br_set(const char *bridge, const char *name, | ||
44 | unsigned long value, unsigned long oldcode) | ||
45 | { | ||
46 | int ret; | ||
47 | char path[SYSFS_PATH_MAX]; | ||
48 | - FILE *f; | ||
49 | |||
50 | - snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/%s", bridge, name); | ||
51 | + snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/bridge/%s", | ||
52 | + bridge, name); | ||
53 | |||
54 | - f = fopen(path, "w"); | ||
55 | - if (f) { | ||
56 | - ret = fprintf(f, "%ld\n", value); | ||
57 | - fclose(f); | ||
58 | - } else { | ||
59 | + if ((ret = set_sysfs(path, value)) < 0) { | ||
60 | /* fallback to old ioctl */ | ||
61 | struct ifreq ifr; | ||
62 | unsigned long args[4] = { oldcode, value, 0, 0 }; | ||
63 | - | ||
64 | + | ||
65 | strncpy(ifr.ifr_name, bridge, IFNAMSIZ); | ||
66 | ifr.ifr_data = (char *) &args; | ||
67 | ret = ioctl(br_socket_fd, SIOCDEVPRIVATE, &ifr); | ||
68 | @@ -348,14 +361,10 @@ static int port_set(const char *bridge, const char *ifname, | ||
69 | { | ||
70 | int ret; | ||
71 | char path[SYSFS_PATH_MAX]; | ||
72 | - FILE *f; | ||
73 | |||
74 | snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/brport/%s", ifname, name); | ||
75 | - f = fopen(path, "w"); | ||
76 | - if (f) { | ||
77 | - ret = fprintf(f, "%ld\n", value); | ||
78 | - fclose(f); | ||
79 | - } else { | ||
80 | + | ||
81 | + if ((ret = set_sysfs(path, value)) < 0) { | ||
82 | int index = get_portno(bridge, ifname); | ||
83 | |||
84 | if (index < 0) | ||
85 | -- | ||
86 | 1.7.5.2 | ||
87 | |||
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch new file mode 100644 index 0000000000..2d0494e533 --- /dev/null +++ b/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | Upstream-status: BackPort [http://pkgs.fedoraproject.org/cgit/bridge-utils.git/diff/bridge-utils-1.5-fix-error-message-for-incorrect-command.patch?id=b0d10717fd7cebf5d85eed3f941b409fa0384f08] | ||
2 | |||
3 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
4 | |||
5 | From c7ed0996ef58b497d3d30be802ab5ae6c37099b5 Mon Sep 17 00:00:00 2001 | ||
6 | From: Stephen Hemminger <shemminger@vyatta.com> | ||
7 | Date: Tue, 3 May 2011 09:49:57 -0700 | ||
8 | Subject: [PATCH 2/3] Fix error message for incorrect command | ||
9 | |||
10 | Debian bug 406907 | ||
11 | Error message was refering to incorrect command argument. | ||
12 | |||
13 | Signed-off-by: Petr Sabata <contyk@redhat.com> | ||
14 | --- | ||
15 | brctl/brctl.c | 2 +- | ||
16 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
17 | |||
18 | diff --git a/brctl/brctl.c b/brctl/brctl.c | ||
19 | index 454b8dd..46ca352 100644 | ||
20 | --- a/brctl/brctl.c | ||
21 | +++ b/brctl/brctl.c | ||
22 | @@ -69,7 +69,7 @@ int main(int argc, char *const* argv) | ||
23 | argc -= optind; | ||
24 | argv += optind; | ||
25 | if ((cmd = command_lookup(*argv)) == NULL) { | ||
26 | - fprintf(stderr, "never heard of command [%s]\n", argv[1]); | ||
27 | + fprintf(stderr, "never heard of command [%s]\n", *argv); | ||
28 | goto help; | ||
29 | } | ||
30 | |||
31 | -- | ||
32 | 1.7.5.2 | ||
33 | |||
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-incorrect-command-in-manual.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-incorrect-command-in-manual.patch new file mode 100644 index 0000000000..6f6d6d4235 --- /dev/null +++ b/meta-networking/recipes-support/bridge-utils/bridge-utils/bridge-utils-1.5-fix-incorrect-command-in-manual.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | Upstream-status: BackPort [http://pkgs.fedoraproject.org/cgit/bridge-utils.git/diff/bridge-utils-1.5-fix-incorrect-command-in-manual.patch?id=b0d10717fd7cebf5d85eed3f941b409fa0384f08] | ||
2 | |||
3 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
4 | |||
5 | From 8ef7b77562b636efcbd8b759eb324d6c069200f2 Mon Sep 17 00:00:00 2001 | ||
6 | From: Stephen Hemminger <shemminger@vyatta.com> | ||
7 | Date: Tue, 3 May 2011 09:48:40 -0700 | ||
8 | Subject: [PATCH 1/3] Fix incorrect command in manual | ||
9 | |||
10 | Command is "setageing" not "setageingtime"; fix man page. | ||
11 | Debian bug report. | ||
12 | |||
13 | Signed-off-by: Petr Sabata <contyk@redhat.com> | ||
14 | --- | ||
15 | doc/brctl.8 | 2 +- | ||
16 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
17 | |||
18 | diff --git a/doc/brctl.8 b/doc/brctl.8 | ||
19 | index d904047..771f323 100644 | ||
20 | --- a/doc/brctl.8 | ||
21 | +++ b/doc/brctl.8 | ||
22 | @@ -89,7 +89,7 @@ data. Machines can move to other ports, network cards can be replaced | ||
23 | .B brctl showmacs <brname> | ||
24 | shows a list of learned MAC addresses for this bridge. | ||
25 | |||
26 | -.B brctl setageingtime <brname> <time> | ||
27 | +.B brctl setageing <brname> <time> | ||
28 | sets the ethernet (MAC) address ageing time, in seconds. After <time> | ||
29 | seconds of not having seen a frame coming from a certain address, the | ||
30 | bridge will time out (delete) that address from the Forwarding | ||
31 | -- | ||
32 | 1.7.5.2 | ||
33 | |||
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils/kernel-headers.patch b/meta-networking/recipes-support/bridge-utils/bridge-utils/kernel-headers.patch new file mode 100644 index 0000000000..de36f0598b --- /dev/null +++ b/meta-networking/recipes-support/bridge-utils/bridge-utils/kernel-headers.patch | |||
@@ -0,0 +1,22 @@ | |||
1 | include missing kernel header | ||
2 | |||
3 | Fixes errors like | ||
4 | |||
5 | | /b/kraj/jlinux-next/poky/build/tmp-eglibc/sysroots/re-64b/usr/include/linux/if_bridge.h:172:20: error: field 'ip6' has incomplete type | ||
6 | | In file included from ../libbridge/libbridge.h:24:0, | ||
7 | |||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | Upstream-Status: Pending | ||
10 | |||
11 | Index: bridge-utils-1.5/libbridge/libbridge.h | ||
12 | =================================================================== | ||
13 | --- bridge-utils-1.5.orig/libbridge/libbridge.h 2011-03-28 17:52:54.000000000 -0700 | ||
14 | +++ bridge-utils-1.5/libbridge/libbridge.h 2013-03-04 21:16:25.781188309 -0800 | ||
15 | @@ -20,6 +20,7 @@ | ||
16 | #define _LIBBRIDGE_H | ||
17 | |||
18 | #include <sys/socket.h> | ||
19 | +#include <linux/in6.h> | ||
20 | #include <linux/if.h> | ||
21 | #include <linux/if_bridge.h> | ||
22 | |||
diff --git a/meta-networking/recipes-support/bridge-utils/bridge-utils_1.5.bb b/meta-networking/recipes-support/bridge-utils/bridge-utils_1.5.bb new file mode 100644 index 0000000000..04f863b223 --- /dev/null +++ b/meta-networking/recipes-support/bridge-utils/bridge-utils_1.5.bb | |||
@@ -0,0 +1,11 @@ | |||
1 | require bridge-utils.inc | ||
2 | |||
3 | SRC_URI += "file://kernel-headers.patch" | ||
4 | |||
5 | PARALLEL_MAKE = "" | ||
6 | |||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=f9d20a453221a1b7e32ae84694da2c37" | ||
8 | |||
9 | SRC_URI[md5sum] = "ec7b381160b340648dede58c31bb2238" | ||
10 | SRC_URI[sha256sum] = "42f9e5fb8f6c52e63a98a43b81bd281c227c529f194913e1c51ec48a393b6688" | ||
11 | |||
diff --git a/meta-networking/recipes-support/cifs/cifs-utils_git.bb b/meta-networking/recipes-support/cifs/cifs-utils_git.bb new file mode 100644 index 0000000000..2b7a0dd66c --- /dev/null +++ b/meta-networking/recipes-support/cifs/cifs-utils_git.bb | |||
@@ -0,0 +1,30 @@ | |||
1 | DESCRIPTION = "A a package of utilities for doing and managing mounts of the Linux CIFS filesystem." | ||
2 | HOMEPAGE = "http://wiki.samba.org/index.php/LinuxCIFS_utils" | ||
3 | |||
4 | LICENSE = "GPLv3 & LGPLv3" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" | ||
6 | |||
7 | PV = "5.9" | ||
8 | PR = "r1" | ||
9 | |||
10 | SRCREV = "353d491dcb5d69d31434abeb962c8e9a49c36867" | ||
11 | SRC_URI = "git://git.samba.org/cifs-utils.git" | ||
12 | |||
13 | S = "${WORKDIR}/git" | ||
14 | |||
15 | PACKAGECONFIG ??= "" | ||
16 | PACKAGECONFIG[cap] = "--with-libcap,--without-libcap,libcap" | ||
17 | # when enabled, it creates ${bindir}/cifscreds and --ignore-fail-on-non-empty in do_install_append is needed | ||
18 | PACKAGECONFIG[cifscreds] = "--enable-cifscreds,--disable-cifscreds,keyutils" | ||
19 | # when enabled, it creates ${sbindir}/cifs.upcall and --ignore-fail-on-non-empty in do_install_append is needed | ||
20 | PACKAGECONFIG[cifsupcall] = "--enable-cifsupcall,--disable-cifsupcall,krb5 talloc keyutils" | ||
21 | |||
22 | inherit autotools pkgconfig | ||
23 | |||
24 | do_install_append() { | ||
25 | # Remove empty /usr/bin and /usr/sbin directories since the mount helper | ||
26 | # is installed to /sbin | ||
27 | rmdir --ignore-fail-on-non-empty ${D}${bindir} ${D}${sbindir} | ||
28 | } | ||
29 | |||
30 | RRECOMMENDS_${PN} = "kernel-module-cifs" | ||
diff --git a/meta-networking/recipes-support/curlpp/curlpp/pkgconfig_fix.patch b/meta-networking/recipes-support/curlpp/curlpp/pkgconfig_fix.patch new file mode 100644 index 0000000000..ad73c00885 --- /dev/null +++ b/meta-networking/recipes-support/curlpp/curlpp/pkgconfig_fix.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | Upstream-Status: Inappropriate [packaging] | ||
2 | |||
3 | |||
4 | Index: curl-7.20.0/libcurl.pc.in | ||
5 | =================================================================== | ||
6 | --- curl-7.20.0.orig/libcurl.pc.in 2009-11-17 18:11:07.000000000 +0000 | ||
7 | +++ curl-7.20.0/libcurl.pc.in 2010-03-25 12:13:26.814051066 +0000 | ||
8 | @@ -35,6 +35,7 @@ | ||
9 | URL: http://curl.haxx.se/ | ||
10 | Description: Library to transfer files with ftp, http, etc. | ||
11 | Version: @CURLVERSION@ | ||
12 | -Libs: -L${libdir} -lcurl @LIBS@ | ||
13 | -Libs.private: @LIBCURL_LIBS@ @LIBS@ | ||
14 | +Requires.private: @GNUTLS_REQUIRED@ | ||
15 | +Libs: -L${libdir} -lcurl | ||
16 | +Libs.private: -ldl -lz | ||
17 | Cflags: -I${includedir} | ||
18 | Index: curl-7.20.0/configure.ac | ||
19 | =================================================================== | ||
20 | --- curl-7.20.0.orig/configure.ac 2010-02-04 21:41:46.000000000 +0000 | ||
21 | +++ curl-7.20.0/configure.ac 2010-03-25 12:12:18.673129001 +0000 | ||
22 | @@ -1668,6 +1668,7 @@ | ||
23 | AC_SUBST(USE_GNUTLS, [1]) | ||
24 | GNUTLS_ENABLED=1 | ||
25 | USE_GNUTLS="yes" | ||
26 | + GNUTLS_REQUIRED="gnutls" | ||
27 | curl_ssl_msg="enabled (GnuTLS)" | ||
28 | ], | ||
29 | [ | ||
30 | @@ -1696,6 +1697,8 @@ | ||
31 | |||
32 | fi dnl OPENSSL != 1 | ||
33 | |||
34 | +AC_SUBST(GNUTLS_REQUIRED) | ||
35 | + | ||
36 | dnl ---------------------------------------------------- | ||
37 | dnl NSS. Only check if GnuTLS and OpenSSL are not enabled | ||
38 | dnl ---------------------------------------------------- | ||
diff --git a/meta-networking/recipes-support/curlpp/curlpp_0.7.3.bb b/meta-networking/recipes-support/curlpp/curlpp_0.7.3.bb new file mode 100644 index 0000000000..c21734377d --- /dev/null +++ b/meta-networking/recipes-support/curlpp/curlpp_0.7.3.bb | |||
@@ -0,0 +1,87 @@ | |||
1 | SUMMARY = "C++ library for client-side URL transfers" | ||
2 | HOMEPAGE = "http://code.google.com/p/curlpp/" | ||
3 | SECTION = "console/network" | ||
4 | LICENSE = "MIT" | ||
5 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
6 | |||
7 | DEPENDS = "curl boost" | ||
8 | DEPENDS_class-native = "curl-native" | ||
9 | |||
10 | SRC_URI = "http://curlpp.googlecode.com/files/curlpp-${PV}.tar.gz \ | ||
11 | " | ||
12 | |||
13 | SRC_URI[md5sum] = "ccc3d30d4b3b5d2cdbed635898c29485" | ||
14 | SRC_URI[sha256sum] = "e3f9427b27c5bddf898d383d45c0d3d5397e2056ff935d9a5cdaef6a9a653bd5" | ||
15 | |||
16 | inherit autotools pkgconfig binconfig | ||
17 | |||
18 | EXTRA_OECONF = "--prefix=${STAGING_DIR} \ | ||
19 | --with-boost=${STAGING_DIR} \ | ||
20 | " | ||
21 | |||
22 | do_install() { | ||
23 | install -d ${D}/${includedir}/curlpp | ||
24 | cp -r include/curlpp/* ${D}${includedir}/curlpp | ||
25 | |||
26 | install -d ${D}${includedir}/utilspp | ||
27 | cp -r include/utilspp/* ${D}${includedir}/utilspp | ||
28 | |||
29 | install -d ${D}/${libdir} | ||
30 | install -m 664 src/curlpp/.libs/libcurlpp.a ${D}/${libdir} | ||
31 | install -m 664 src/curlpp/.libs/libcurlpp.lai ${D}/${libdir}/libcurlpp.la | ||
32 | |||
33 | install -m 775 src/curlpp/.libs/libcurlpp.so.0.0.2 ${D}/${libdir} | ||
34 | |||
35 | install -m 664 src/utilspp/.libs/libutilspp.a ${D}/${libdir} | ||
36 | install -m 664 src/utilspp/.libs/libutilspp.lai ${D}/${libdir}/libutilspp.la | ||
37 | |||
38 | install -m 664 src/utilspp/.libs/libutilspp.so.0.0.0 ${D}/${libdir} | ||
39 | |||
40 | install -d ${D}/${libdir}/pkgconfig | ||
41 | install -m 664 curlpp.pc ${D}/${libdir}/pkgconfig | ||
42 | |||
43 | install -d ${D}/${bindir} | ||
44 | install -m 755 curlpp-config ${D}/${bindir} | ||
45 | |||
46 | install -d ${D}/${includedir}/curlpp | ||
47 | install -d ${D}/${includedir}/curlpp/internal | ||
48 | install -d ${D}/${includedir}/utilspp | ||
49 | install -d ${D}/${includedir}/utilspp/functor | ||
50 | install -d ${D}/${includedir}/utilspp/singleton | ||
51 | |||
52 | install -m 664 include/curlpp/config* ${D}/${includedir}/curlpp | ||
53 | install -m 664 include/curlpp/*.h* ${D}/${includedir}/curlpp | ||
54 | install -m 664 include/curlpp/*.inl ${D}/${includedir}/curlpp | ||
55 | |||
56 | install -m 664 include/curlpp/internal/*.h* ${D}/${includedir}/curlpp/internal | ||
57 | install -m 664 include/curlpp/internal/*.inl ${D}/${includedir}/curlpp/internal | ||
58 | |||
59 | install -m 664 include/utilspp/*.h* ${D}/${includedir}/utilspp | ||
60 | install -m 664 include/utilspp/*.inl ${D}/${includedir}/utilspp | ||
61 | |||
62 | install -m 664 include/utilspp/functor/*.h* ${D}/${includedir}/utilspp/functor | ||
63 | install -m 664 include/utilspp/singleton/*.h* ${D}/${includedir}/utilspp/singleton | ||
64 | install -m 664 include/utilspp/singleton/*.inl ${D}/${includedir}/utilspp/singleton | ||
65 | install -m 755 curlpp-config ${D}/${bindir} | ||
66 | } | ||
67 | |||
68 | pkg_postinst_${PN}() { | ||
69 | ln -sf libcurlpp.so.0.0.2 /usr/lib/libcurlpp.so.0 | ||
70 | ln -sf libcurlpp.so.0.0.2 /usr/lib/libcurlpp.so | ||
71 | ln -sf libutilspp.so.0.0.0 /usr/lib/libutilspp.so.0 | ||
72 | ln -sf libutilspp.so.0.0.0 /usr/lib/libutilspp.so | ||
73 | } | ||
74 | |||
75 | PACKAGES =+ "libcurlpp libcurlpp-dev libcurlpp-staticdev" | ||
76 | |||
77 | FILES_lib${BPN} = "${libdir}/lib*.so.* \ | ||
78 | " | ||
79 | |||
80 | FILES_lib${BPN}-dev = "${includedir} \ | ||
81 | ${libdir}/lib*.la \ | ||
82 | ${libdir}/pkgconfig \ | ||
83 | ${bindir}/*-config" | ||
84 | |||
85 | FILES_lib${BPN}-staticdev = "${libdir}/lib*.a" | ||
86 | |||
87 | BBCLASSEXTEND = "native nativesdk" | ||
diff --git a/meta-networking/recipes-support/dnsmasq/dnsmasq.inc b/meta-networking/recipes-support/dnsmasq/dnsmasq.inc new file mode 100644 index 0000000000..e57ab727eb --- /dev/null +++ b/meta-networking/recipes-support/dnsmasq/dnsmasq.inc | |||
@@ -0,0 +1,56 @@ | |||
1 | SUMMARY = "Lightweight, easy to configure DNS forwarder and DHCP server" | ||
2 | HOMEPAGE = "http://www.thekelleys.org.uk/dnsmasq/doc.html" | ||
3 | SECTION = "console/network" | ||
4 | # GPLv3 was added in version 2.41 as license option | ||
5 | LICENSE = "GPLv2 | GPLv3" | ||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \ | ||
7 | file://COPYING-v3;md5=d32239bcb673463ab874e80d47fae504" | ||
8 | |||
9 | #at least versions 2.15 and prior are moved to the archive folder on the server | ||
10 | SRC_URI = "http://www.thekelleys.org.uk/dnsmasq/${@['archive/', ''][float(d.getVar('PV',1).split('.')[1]) > 15]}dnsmasq-${PV}.tar.gz;name=dnsmasq-${PV} \ | ||
11 | file://init \ | ||
12 | file://dnsmasq.conf \ | ||
13 | file://dnsmasq.service \ | ||
14 | " | ||
15 | |||
16 | inherit update-rc.d systemd | ||
17 | |||
18 | INITSCRIPT_NAME = "dnsmasq" | ||
19 | INITSCRIPT_PARAMS = "defaults" | ||
20 | |||
21 | PACKAGECONFIG ??= "" | ||
22 | PACKAGECONFIG[dbus] = "COPTS=-DHAVE_DBUS,,dbus" | ||
23 | EXTRA_OEMAKE = "${EXTRA_OECONF}" | ||
24 | |||
25 | do_compile_append() { | ||
26 | # build dhcp_release | ||
27 | cd ${S}/contrib/wrt | ||
28 | oe_runmake | ||
29 | } | ||
30 | |||
31 | do_install () { | ||
32 | oe_runmake "PREFIX=${D}${prefix}" \ | ||
33 | "BINDIR=${D}${bindir}" \ | ||
34 | "MANDIR=${D}${mandir}" \ | ||
35 | install | ||
36 | install -d ${D}${sysconfdir}/ ${D}${sysconfdir}/init.d ${D}${sysconfdir}/dnsmasq.d | ||
37 | install -m 644 ${WORKDIR}/dnsmasq.conf ${D}${sysconfdir}/ | ||
38 | install -m 755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/dnsmasq | ||
39 | |||
40 | install -d ${D}${systemd_unitdir}/system | ||
41 | install -m 0644 ${WORKDIR}/dnsmasq.service ${D}${systemd_unitdir}/system | ||
42 | |||
43 | install -m 0755 ${S}/contrib/wrt/dhcp_release ${D}${bindir} | ||
44 | |||
45 | if [ "${@base_contains('PACKAGECONFIG', 'dbus', 'dbus', '', d)}" != "" ]; then | ||
46 | install -d ${D}${sysconfdir}/dbus-1/system.d | ||
47 | install -m 644 dbus/dnsmasq.conf ${D}${sysconfdir}/dbus-1/system.d/ | ||
48 | fi | ||
49 | } | ||
50 | |||
51 | CONFFILES_${PN} = "${sysconfdir}/dnsmasq.conf" | ||
52 | |||
53 | RPROVIDES_${PN} += "${PN}-systemd" | ||
54 | RREPLACES_${PN} += "${PN}-systemd" | ||
55 | RCONFLICTS_${PN} += "${PN}-systemd" | ||
56 | SYSTEMD_SERVICE_${PN} = "dnsmasq.service" | ||
diff --git a/meta-networking/recipes-support/dnsmasq/dnsmasq_2.68.bb b/meta-networking/recipes-support/dnsmasq/dnsmasq_2.68.bb new file mode 100644 index 0000000000..b1bef7a161 --- /dev/null +++ b/meta-networking/recipes-support/dnsmasq/dnsmasq_2.68.bb | |||
@@ -0,0 +1,4 @@ | |||
1 | require dnsmasq.inc | ||
2 | |||
3 | SRC_URI[dnsmasq-2.68.md5sum] = "6f8351ca0901f248efdb81532778d2ef" | ||
4 | SRC_URI[dnsmasq-2.68.sha256sum] = "402019d61f53f1ccc04cc6218719fd3b158ea3fca9a83ab55471f981a2097c2f" | ||
diff --git a/meta-networking/recipes-support/dnsmasq/files/dnsmasq.conf b/meta-networking/recipes-support/dnsmasq/files/dnsmasq.conf new file mode 100755 index 0000000000..1a198a3791 --- /dev/null +++ b/meta-networking/recipes-support/dnsmasq/files/dnsmasq.conf | |||
@@ -0,0 +1,293 @@ | |||
1 | # Configuration file for dnsmasq. | ||
2 | # | ||
3 | # Format is one option per line, legal options are the same | ||
4 | # as the long options legal on the command line. See | ||
5 | # "/usr/sbin/dnsmasq --help" or "man 8 dnsmasq" for details. | ||
6 | |||
7 | # Change these lines if you want dnsmasq to serve MX records. | ||
8 | # Only one of mx-host and mx-target need be set, the other defaults | ||
9 | # to the name of the host running dnsmasq. | ||
10 | #mx-host= | ||
11 | #mx-target= | ||
12 | #selfmx | ||
13 | #localmx | ||
14 | |||
15 | # The following two options make you a better netizen, since they | ||
16 | # tell dnsmasq to filter out queries which the public DNS cannot | ||
17 | # answer, and which load the servers (especially the root servers) | ||
18 | # uneccessarily. If you have a dial-on-demand link they also stop | ||
19 | # these requests from bringing up the link uneccessarily. | ||
20 | |||
21 | # Never forward plain names (with a dot or domain part) | ||
22 | domain-needed | ||
23 | # Never forward addresses in the non-routed address spaces. | ||
24 | bogus-priv | ||
25 | |||
26 | |||
27 | # Uncomment this to filter useless windows-originated DNS requests | ||
28 | # which can trigger dial-on-demand links needlessly. | ||
29 | # Note that (amongst other things) this blocks all SRV requests, | ||
30 | # so don't use it if you use eg Kerberos. | ||
31 | #filterwin2k | ||
32 | |||
33 | # Change this line if you want dns to get its upstream servers from | ||
34 | # somewhere other that /etc/resolv.conf | ||
35 | #resolv-file= | ||
36 | |||
37 | # By default, dnsmasq will send queries to any of the upstream | ||
38 | # servers it knows about and tries to favour servers to are known | ||
39 | # to be up. Uncommenting this forces dnsmasq to try each query | ||
40 | # with each server strictly in the order they appear in | ||
41 | # /etc/resolv.conf | ||
42 | #strict-order | ||
43 | |||
44 | # If you don't want dnsmasq to read /etc/resolv.conf or any other | ||
45 | # file, getting its servers for this file instead (see below), then | ||
46 | # uncomment this | ||
47 | #no-resolv | ||
48 | |||
49 | # If you don't want dnsmasq to poll /etc/resolv.conf or other resolv | ||
50 | # files for changes and re-read them then uncomment this. | ||
51 | #no-poll | ||
52 | |||
53 | # Add other name servers here, with domain specs if they are for | ||
54 | # non-public domains. | ||
55 | #server=/localnet/192.168.0.1 | ||
56 | |||
57 | # Add local-only domains here, queries in these domains are answered | ||
58 | # from /etc/hosts or DHCP only. | ||
59 | #local=/localnet/ | ||
60 | |||
61 | # Add domains which you want to force to an IP address here. | ||
62 | # The example below send any host in doubleclick.net to a local | ||
63 | # webserver. | ||
64 | #address=/doubleclick.net/127.0.0.1 | ||
65 | |||
66 | # You no longer (as of version 1.7) need to set these to enable | ||
67 | # dnsmasq to read /etc/ppp/resolv.conf since dnsmasq now uses the | ||
68 | # "dip" group to achieve this. | ||
69 | #user= | ||
70 | #group= | ||
71 | |||
72 | # If you want dnsmasq to listen for requests only on specified interfaces | ||
73 | # (and the loopback) give the name of the interface (eg eth0) here. | ||
74 | # Repeat the line for more than one interface. | ||
75 | #interface= | ||
76 | # Or you can specify which interface _not_ to listen on | ||
77 | #except-interface= | ||
78 | # Or which to listen on by address (remember to include 127.0.0.1 if | ||
79 | # you use this.) | ||
80 | #listen-address= | ||
81 | |||
82 | # On systems which support it, dnsmasq binds the wildcard address, | ||
83 | # even when it is listening on only some interfaces. It then discards | ||
84 | # requests that it shouldn't reply to. This has the advantage of | ||
85 | # working even when interfaces come and go and change address. If you | ||
86 | # want dnsmasq to really bind only the interfaces it is listening on, | ||
87 | # uncomment this option. About the only time you may need this is when | ||
88 | # running another nameserver on the same machine. | ||
89 | #bind-interfaces | ||
90 | |||
91 | # If you don't want dnsmasq to read /etc/hosts, uncomment the | ||
92 | # following line. | ||
93 | #no-hosts | ||
94 | # or if you want it to read another file, as well as /etc/hosts, use | ||
95 | # this. | ||
96 | #addn-hosts=/etc/banner_add_hosts | ||
97 | |||
98 | # Set this (and domain: see below) if you want to have a domain | ||
99 | # automatically added to simple names in a hosts-file. | ||
100 | #expand-hosts | ||
101 | |||
102 | # Set the domain for dnsmasq. this is optional, but if it is set, it | ||
103 | # does the following things. | ||
104 | # 1) Allows DHCP hosts to have fully qualified domain names, as long | ||
105 | # as the domain part matches this setting. | ||
106 | # 2) Sets the "domain" DHCP option thereby potentially setting the | ||
107 | # domain of all systems configured by DHCP | ||
108 | # 3) Provides the domain part for "expand-hosts" | ||
109 | #domain=thekelleys.org.uk | ||
110 | |||
111 | # Uncomment this to enable the integrated DHCP server, you need | ||
112 | # to supply the range of addresses available for lease and optionally | ||
113 | # a lease time. If you have more than one network, you will need to | ||
114 | # repeat this for each network on which you want to supply DHCP | ||
115 | # service. | ||
116 | #dhcp-range=192.168.0.50,192.168.0.150,12h | ||
117 | dhcp-range=10.0.0.10,10.0.0.200,2h | ||
118 | |||
119 | # This is an example of a DHCP range where the netmask is given. This | ||
120 | # is needed for networks we reach the dnsmasq DHCP server via a relay | ||
121 | # agent. If you don't know what a DHCP relay agent is, you probably | ||
122 | # don't need to worry about this. | ||
123 | #dhcp-range=192.168.0.50,192.168.0.150,255.255.255.0,12h | ||
124 | |||
125 | # This is an example of a DHCP range with a network-id, so that | ||
126 | # some DHCP options may be set only for this network. | ||
127 | #dhcp-range=red,192.168.0.50,192.168.0.150 | ||
128 | |||
129 | # Supply parameters for specified hosts using DHCP. There are lots | ||
130 | # of valid alternatives, so we will give examples of each. Note that | ||
131 | # IP addresses DO NOT have to be in the range given above, they just | ||
132 | # need to be on the same network. The order of the parameters in these | ||
133 | # do not matter, it's permissble to give name,adddress and MAC in any order | ||
134 | |||
135 | # Always allocate the host with ethernet address 11:22:33:44:55:66 | ||
136 | # The IP address 192.168.0.60 | ||
137 | #dhcp-host=11:22:33:44:55:66,192.168.0.60 | ||
138 | |||
139 | # Always set the name of the host with hardware address | ||
140 | # 11:22:33:44:55:66 to be "fred" | ||
141 | #dhcp-host=11:22:33:44:55:66,fred | ||
142 | |||
143 | # Always give the host with ethernet address 11:22:33:44:55:66 | ||
144 | # the name fred and IP address 192.168.0.60 and lease time 45 minutes | ||
145 | #dhcp-host=11:22:33:44:55:66,fred,192.168.0.60,45m | ||
146 | |||
147 | # Give the machine which says it's name is "bert" IP address | ||
148 | # 192.168.0.70 and an infinite lease | ||
149 | #dhcp-host=bert,192.168.0.70,infinite | ||
150 | |||
151 | # Always give the host with client identifier 01:02:02:04 | ||
152 | # the IP address 192.168.0.60 | ||
153 | #dhcp-host=id:01:02:02:04,192.168.0.60 | ||
154 | |||
155 | # Always give the host with client identifier "marjorie" | ||
156 | # the IP address 192.168.0.60 | ||
157 | #dhcp-host=id:marjorie,192.168.0.60 | ||
158 | |||
159 | # Enable the address given for "judge" in /etc/hosts | ||
160 | # to be given to a machine presenting the name "judge" when | ||
161 | # it asks for a DHCP lease. | ||
162 | #dhcp-host=judge | ||
163 | |||
164 | # Never offer DHCP service to a machine whose ethernet | ||
165 | # address is 11:22:33:44:55:66 | ||
166 | #dhcp-host=11:22:33:44:55:66,ignore | ||
167 | |||
168 | # Ignore any client-id presented by the machine with ethernet | ||
169 | # address 11:22:33:44:55:66. This is useful to prevent a machine | ||
170 | # being treated differently when running under different OS's or | ||
171 | # between PXE boot and OS boot. | ||
172 | #dhcp-host=11:22:33:44:55:66,id:* | ||
173 | |||
174 | # Send extra options which are tagged as "red" to | ||
175 | # the machine with ethernet address 11:22:33:44:55:66 | ||
176 | #dhcp-host=11:22:33:44:55:66,net:red | ||
177 | |||
178 | # Send extra options which are tagged as "red" to any machine whose | ||
179 | # DHCP vendorclass string includes the substring "Linux" | ||
180 | #dhcp-vendorclass=red,Linux | ||
181 | |||
182 | # Send extra options which are tagged as "red" to any machine one | ||
183 | # of whose DHCP userclass strings includes the substring "accounts" | ||
184 | #dhcp-userclass=red,accounts | ||
185 | |||
186 | # If this line is uncommented, dnsmasq will read /etc/ethers and act | ||
187 | # on the ethernet-address/IP pairs found there just as if they had | ||
188 | # been given as --dhcp-host options. Useful if you keep | ||
189 | # MAC-address/host mappings there for other purposes. | ||
190 | #read-ethers | ||
191 | |||
192 | # Send options to hosts which ask for a DHCP lease. | ||
193 | # See RFC 2132 for details of available options. | ||
194 | # Note that all the common settings, such as netmask and | ||
195 | # broadcast address, DNS server and default route, are given | ||
196 | # sane defaults by dnsmasq. You very likely will not need any | ||
197 | # any dhcp-options. If you use Windows clients and Samba, there | ||
198 | # are some options which are recommended, they are detailed at the | ||
199 | # end of this section. | ||
200 | # For reference, the common options are: | ||
201 | # subnet mask - 1 | ||
202 | # default router - 3 | ||
203 | # DNS server - 6 | ||
204 | # broadcast address - 28 | ||
205 | |||
206 | # Set the NTP time server addresses to 192.168.0.4 and 10.10.0.5 | ||
207 | #dhcp-option=42,192.168.0.4,10.10.0.5 | ||
208 | |||
209 | # Set the NTP time server address to be the same machine as | ||
210 | # is running dnsmasq | ||
211 | #dhcp-option=42,0.0.0.0 | ||
212 | |||
213 | # Set the NIS domain name to "welly" | ||
214 | #dhcp-option=40,welly | ||
215 | |||
216 | # Set the default time-to-live to 50 | ||
217 | #dhcp-option=23,50 | ||
218 | |||
219 | # Set the "all subnets are local" flag | ||
220 | #dhcp-option=27,1 | ||
221 | |||
222 | # Send the etherboot magic flag and then etherboot options (a string). | ||
223 | #dhcp-option=128,e4:45:74:68:00:00 | ||
224 | #dhcp-option=129,NIC=eepro100 | ||
225 | |||
226 | # Specify an option which will only be sent to the "red" network | ||
227 | # (see dhcp-range for the declaration of the "red" network) | ||
228 | #dhcp-option=red,42,192.168.1.1 | ||
229 | |||
230 | # The following DHCP options set up dnsmasq in the same way as is specified | ||
231 | # for the ISC dhcpcd in | ||
232 | # http://www.samba.org/samba/ftp/docs/textdocs/DHCP-Server-Configuration.txt | ||
233 | # adapted for a typical dnsmasq installation where the host running | ||
234 | # dnsmasq is also the host running samba. | ||
235 | # you may want to uncomment them if you use Windows clients and Samba. | ||
236 | #dhcp-option=19,0 # option ip-forwarding off | ||
237 | #dhcp-option=44,0.0.0.0 # set netbios-over-TCP/IP nameserver(s) aka WINS server(s) | ||
238 | #dhcp-option=45,0.0.0.0 # netbios datagram distribution server | ||
239 | #dhcp-option=46,8 # netbios node type | ||
240 | #dhcp-option=47 # empty netbios scope. | ||
241 | |||
242 | |||
243 | # Set the boot filename and tftpd server name and address | ||
244 | # for BOOTP. You will only need this is you want to | ||
245 | # boot machines over the network. | ||
246 | #dhcp-boot=/var/ftpd/pxelinux.0,boothost,192.168.0.3 | ||
247 | |||
248 | # Set the limit on DHCP leases, the default is 150 | ||
249 | #dhcp-lease-max=150 | ||
250 | |||
251 | # The DHCP server needs somewhere on disk to keep its lease database. | ||
252 | # This defaults to a sane location, but if you want to change it, use | ||
253 | # the line below. | ||
254 | #dhcp-leasefile=/var/lib/misc/dnsmasq.leases | ||
255 | |||
256 | # Set the cachesize here. | ||
257 | #cache-size=150 | ||
258 | |||
259 | # If you want to disable negative caching, uncomment this. | ||
260 | #no-negcache | ||
261 | |||
262 | # Normally responses which come form /etc/hosts and the DHCP lease | ||
263 | # file have Time-To-Live set as zero, which conventionally means | ||
264 | # do not cache further. If you are happy to trade lower load on the | ||
265 | # server for potentially stale date, you can set a time-to-live (in | ||
266 | # seconds) here. | ||
267 | #local-ttl= | ||
268 | |||
269 | # If you want dnsmasq to detect attempts by Verisign to send queries | ||
270 | # to unregistered .com and .net hosts to its sitefinder service and | ||
271 | # have dnsmasq instead return the correct NXDOMAIN response, uncomment | ||
272 | # this line. You can add similar lines to do the same for other | ||
273 | # registries which have implemented wildcard A records. | ||
274 | #bogus-nxdomain=64.94.110.11 | ||
275 | |||
276 | # If you want to fix up DNS results from upstream servers, use the | ||
277 | # alias option. This only works for IPv4. | ||
278 | # This alias makes a result of 1.2.3.4 appear as 5.6.7.8 | ||
279 | #alias=1.2.3.4,5.6.7.8 | ||
280 | # and this maps 1.2.3.x to 5.6.7.x | ||
281 | #alias=1.2.3.0,5.6.7.0,255.255.255.0 | ||
282 | |||
283 | # For debugging purposes, log each DNS query as it passes through | ||
284 | # dnsmasq. | ||
285 | #log-queries | ||
286 | |||
287 | # Include a another lot of configuration options. | ||
288 | #conf-file=/etc/dnsmasq.more.conf | ||
289 | |||
290 | |||
291 | |||
292 | |||
293 | |||
diff --git a/meta-networking/recipes-support/dnsmasq/files/dnsmasq.service b/meta-networking/recipes-support/dnsmasq/files/dnsmasq.service new file mode 100644 index 0000000000..549e15e2b2 --- /dev/null +++ b/meta-networking/recipes-support/dnsmasq/files/dnsmasq.service | |||
@@ -0,0 +1,13 @@ | |||
1 | [Unit] | ||
2 | Description=DNS forwarder and DHCP server | ||
3 | After=network.target | ||
4 | |||
5 | [Service] | ||
6 | Type=forking | ||
7 | PIDFile=/run/dnsmasq.pid | ||
8 | ExecStart=/usr/bin/dnsmasq -x /run/dnsmasq.pid | ||
9 | ExecReload=/bin/kill -HUP $(/bin/cat /run/dnsmasq.pid) | ||
10 | |||
11 | [Install] | ||
12 | WantedBy=multi-user.target | ||
13 | |||
diff --git a/meta-networking/recipes-support/dnsmasq/files/init b/meta-networking/recipes-support/dnsmasq/files/init new file mode 100644 index 0000000000..d1aa9e517d --- /dev/null +++ b/meta-networking/recipes-support/dnsmasq/files/init | |||
@@ -0,0 +1,52 @@ | |||
1 | #!/bin/sh | ||
2 | DAEMON=/usr/bin/dnsmasq | ||
3 | NAME=dnsmasq | ||
4 | DESC="DNS forwarder and DHCP server" | ||
5 | ARGS="-7 /etc/dnsmasq.d" | ||
6 | |||
7 | test -f $DAEMON || exit 0 | ||
8 | |||
9 | set -e | ||
10 | |||
11 | case "$1" in | ||
12 | start) | ||
13 | echo -n "starting $DESC: $NAME... " | ||
14 | test -d /var/lib/misc/ || mkdir /var/lib/misc/ | ||
15 | start-stop-daemon -S -x $DAEMON -- $ARGS | ||
16 | echo "done." | ||
17 | ;; | ||
18 | stop) | ||
19 | echo -n "stopping $DESC: $NAME... " | ||
20 | start-stop-daemon -K -x $DAEMON | ||
21 | echo "done." | ||
22 | ;; | ||
23 | status) | ||
24 | echo -n "dnsmasq " | ||
25 | start-stop-daemon -q -K -t -x $DAEMON | ||
26 | RET=$? | ||
27 | if [ "$RET" = "0" ]; then | ||
28 | PID=`cat /var/run/dnsmasq.pid` | ||
29 | echo "($PID) is running" | ||
30 | else | ||
31 | echo "is not running" | ||
32 | exit $RET | ||
33 | fi | ||
34 | ;; | ||
35 | restart) | ||
36 | echo "restarting $DESC: $NAME... " | ||
37 | $0 stop | ||
38 | $0 start | ||
39 | echo "done." | ||
40 | ;; | ||
41 | reload) | ||
42 | echo -n "reloading $DESC: $NAME... " | ||
43 | killall -HUP $(basename ${DAEMON}) | ||
44 | echo "done." | ||
45 | ;; | ||
46 | *) | ||
47 | echo "Usage: $0 {start|stop|status|restart|reload}" | ||
48 | exit 1 | ||
49 | ;; | ||
50 | esac | ||
51 | |||
52 | exit 0 | ||
diff --git a/meta-networking/recipes-support/dovecot/dovecot/0001-configure.ac-convert-AC_TRY_RUN-to-AC_TRY_LINK-state.patch b/meta-networking/recipes-support/dovecot/dovecot/0001-configure.ac-convert-AC_TRY_RUN-to-AC_TRY_LINK-state.patch new file mode 100644 index 0000000000..6f5c279be2 --- /dev/null +++ b/meta-networking/recipes-support/dovecot/dovecot/0001-configure.ac-convert-AC_TRY_RUN-to-AC_TRY_LINK-state.patch | |||
@@ -0,0 +1,91 @@ | |||
1 | From 483f120603ada8db680085e3f462396da937e036 Mon Sep 17 00:00:00 2001 | ||
2 | From: Koen Kooi <koen@dominion.thruhere.net> | ||
3 | Date: Wed, 8 Jan 2014 09:30:36 +0100 | ||
4 | Subject: [PATCH] configure.ac: convert AC_TRY_RUN to AC_TRY_LINK statements | ||
5 | |||
6 | This is not completely safe, but it's the least invasive fix. | ||
7 | |||
8 | Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> | ||
9 | Upstream-status: Inappropriate | ||
10 | --- | ||
11 | configure.ac | 23 +++++++---------------- | ||
12 | 1 file changed, 7 insertions(+), 16 deletions(-) | ||
13 | |||
14 | diff --git a/configure.ac b/configure.ac | ||
15 | index 95984bb..dff1f87 100644 | ||
16 | --- a/configure.ac | ||
17 | +++ b/configure.ac | ||
18 | @@ -499,13 +499,10 @@ have_ioloop=no | ||
19 | |||
20 | if test "$ioloop" = "best" || test "$ioloop" = "epoll"; then | ||
21 | AC_CACHE_CHECK([whether we can use epoll],i_cv_epoll_works,[ | ||
22 | - AC_TRY_RUN([ | ||
23 | + AC_TRY_LINK([ | ||
24 | #include <sys/epoll.h> | ||
25 | - | ||
26 | - int main() | ||
27 | - { | ||
28 | - return epoll_create(5) < 1; | ||
29 | - } | ||
30 | + ], [ | ||
31 | + epoll_create(5) < 1; | ||
32 | ], [ | ||
33 | i_cv_epoll_works=yes | ||
34 | ], [ | ||
35 | @@ -551,15 +548,13 @@ have_notify=none | ||
36 | if test "$notify" = "" || test "$notify" = "inotify" ; then | ||
37 | dnl * inotify? | ||
38 | AC_CACHE_CHECK([whether we can use inotify],i_cv_inotify_works,[ | ||
39 | - AC_TRY_RUN([ | ||
40 | + AC_TRY_LINK([ | ||
41 | #define _GNU_SOURCE | ||
42 | #include <sys/ioctl.h> | ||
43 | #include <fcntl.h> | ||
44 | #include <sys/inotify.h> | ||
45 | #include <stdio.h> | ||
46 | - | ||
47 | - int main() | ||
48 | - { | ||
49 | + ], [ | ||
50 | int wd, fd; | ||
51 | char * fn = "/tmp"; | ||
52 | |||
53 | @@ -581,8 +576,6 @@ if test "$notify" = "" || test "$notify" = "inotify" ; then | ||
54 | inotify_rm_watch (fd, wd); | ||
55 | |||
56 | close (fd); | ||
57 | - return 0; | ||
58 | - } | ||
59 | ], [ | ||
60 | i_cv_inotify_works=yes | ||
61 | ], [ | ||
62 | @@ -670,7 +663,7 @@ fi | ||
63 | dnl * Old glibcs have broken posix_fallocate(). Make sure not to use it. | ||
64 | dnl * It may also be broken in AIX. | ||
65 | AC_CACHE_CHECK([whether posix_fallocate() works],i_cv_posix_fallocate_works,[ | ||
66 | - AC_TRY_RUN([ | ||
67 | + AC_TRY_LINK([ | ||
68 | #define _XOPEN_SOURCE 600 | ||
69 | #include <stdio.h> | ||
70 | #include <stdlib.h> | ||
71 | @@ -679,7 +672,7 @@ AC_CACHE_CHECK([whether posix_fallocate() works],i_cv_posix_fallocate_works,[ | ||
72 | #if defined(__GLIBC__) && (__GLIBC__ < 2 || __GLIBC_MINOR__ < 7) | ||
73 | possibly broken posix_fallocate | ||
74 | #endif | ||
75 | - int main() { | ||
76 | + ], [ | ||
77 | int fd = creat("conftest.temp", 0600); | ||
78 | int ret; | ||
79 | if (fd == -1) { | ||
80 | @@ -688,8 +681,6 @@ AC_CACHE_CHECK([whether posix_fallocate() works],i_cv_posix_fallocate_works,[ | ||
81 | } | ||
82 | ret = posix_fallocate(fd, 1024, 1024) < 0 ? 1 : 0; | ||
83 | unlink("conftest.temp"); | ||
84 | - return ret; | ||
85 | - } | ||
86 | ], [ | ||
87 | i_cv_posix_fallocate_works=yes | ||
88 | ], [ | ||
89 | -- | ||
90 | 1.8.4.2 | ||
91 | |||
diff --git a/meta-networking/recipes-support/dovecot/dovecot_2.2.10.bb b/meta-networking/recipes-support/dovecot/dovecot_2.2.10.bb new file mode 100644 index 0000000000..8528536511 --- /dev/null +++ b/meta-networking/recipes-support/dovecot/dovecot_2.2.10.bb | |||
@@ -0,0 +1,44 @@ | |||
1 | SUMMARY = "Dovecot is an open source IMAP and POP3 email server" | ||
2 | DESCRIPTION = "Dovecot is an open source IMAP and POP3 email server for Linux/UNIX-like systems, written with security primarily in mind. Dovecot is an excellent choice for both small and large installations. It's fast, simple to set up, requires no special administration and it uses very little memory." | ||
3 | |||
4 | LICENSE = "LGPLv2.1 & MIT" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=a981379bd0f1c362f8d1d21515e5b30b" | ||
6 | |||
7 | SRC_URI = "http://dovecot.org/releases/2.2/dovecot-${PV}.tar.gz \ | ||
8 | file://0001-configure.ac-convert-AC_TRY_RUN-to-AC_TRY_LINK-state.patch \ | ||
9 | " | ||
10 | SRC_URI[md5sum] = "037e9c9e07d9dbff54dcff09f280fc8c" | ||
11 | SRC_URI[sha256sum] = "75592483d40dc4f76cc3b41af40caa4be80478946a699d46846d5d03e4d2e09b" | ||
12 | |||
13 | DEPENDS = "openssl xz zlib bzip2 libcap" | ||
14 | |||
15 | inherit autotools | ||
16 | |||
17 | PACKAGECONFIG ??= " \ | ||
18 | ${@base_contains('DISTRO_FEATURES', 'ldap', 'ldap', '', d)} \ | ||
19 | ${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \ | ||
20 | " | ||
21 | |||
22 | PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam," | ||
23 | PACKAGECONFIG[ldap] = "--with-ldap=plugin,--without-ldap,openldap," | ||
24 | |||
25 | # From native build in armv7a-hf/eglibc | ||
26 | CACHED_CONFIGUREVARS += "i_cv_signed_size_t=no \ | ||
27 | i_cv_gmtime_max_time_t=32 \ | ||
28 | i_cv_signed_time_t=yes \ | ||
29 | i_cv_mmap_plays_with_write=yes \ | ||
30 | i_cv_fd_passing=yes \ | ||
31 | i_cv_c99_vsnprintf=yes \ | ||
32 | lib_cv___va_copy=yes \ | ||
33 | lib_cv_va_copy=yes \ | ||
34 | lib_cv_va_val_copy=yes \ | ||
35 | " | ||
36 | |||
37 | # hardcode epoll() to avoid running unsafe tests | ||
38 | # BSD needs kqueue and uclibc poll() | ||
39 | EXTRA_OECONF = " --with-ioloop=epoll" | ||
40 | |||
41 | FILES_${PN}-staticdev += "${libdir}/dovecot/*/*.a" | ||
42 | FILES_${PN}-dev += "${libdir}/dovecot/*.so" | ||
43 | FILES_${PN}-dbg += "${libdir}/dovecot/*/.debug" | ||
44 | |||
diff --git a/meta-networking/recipes-support/fetchmail/fetchmail_6.3.26.bb b/meta-networking/recipes-support/fetchmail/fetchmail_6.3.26.bb new file mode 100644 index 0000000000..a45f74699e --- /dev/null +++ b/meta-networking/recipes-support/fetchmail/fetchmail_6.3.26.bb | |||
@@ -0,0 +1,18 @@ | |||
1 | SUMMARY = "Fetchmail retrieves mail from remote mail servers and forwards it via SMTP" | ||
2 | DESCRIPTION = "Fetchmail is a full-featured, robust, well-documented remote-mail retrieval and forwarding utility intended to be used over on-demand TCP/IP links (such as SLIP or PPP connections). It supports every remote-mail protocol now in use on the Internet: POP2, POP3, RPOP, APOP, KPOP, all flavors of IMAP, ETRN, and ODMR. It can even support IPv6 and IPSEC." | ||
3 | |||
4 | LICENSE = "GPLv2 & MIT" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=fbb509e0303f5ded1cbfc0cc8705f28c" | ||
6 | |||
7 | DEPENDS = "openssl" | ||
8 | |||
9 | SRC_URI = "http://download.berlios.de/fetchmail/fetchmail-${PV}.tar.xz" | ||
10 | SRC_URI[md5sum] = "61b66faad044afa26e142bb1791aa2b3" | ||
11 | SRC_URI[sha256sum] = "79b4c54cdbaf02c1a9a691d9948fcb1a77a1591a813e904283a8b614b757e850" | ||
12 | |||
13 | inherit autotools gettext python-dir pythonnative | ||
14 | |||
15 | EXTRA_OECONF = "--with-ssl=${STAGING_DIR_HOST}${prefix}" | ||
16 | |||
17 | PACKAGES =+ "fetchmail-python" | ||
18 | FILES_fetchmail-python = "${libdir}/${PYTHON_DIR}/*" | ||
diff --git a/meta-networking/recipes-support/fping/fping_3.5.bb b/meta-networking/recipes-support/fping/fping_3.5.bb new file mode 100644 index 0000000000..fe8893405e --- /dev/null +++ b/meta-networking/recipes-support/fping/fping_3.5.bb | |||
@@ -0,0 +1,25 @@ | |||
1 | SUMMARY = "sends ICMP ECHO_REQUEST packets to network hosts" | ||
2 | DESCRIPTION = "fping is a ping like program which uses the Internet Control \ | ||
3 | Message Protocol (ICMP) echo request to determine if a target host is \ | ||
4 | responding. fping differs from ping in that you can specify any number of \ | ||
5 | targets on the command line, or specify a file containing the lists of \ | ||
6 | targets to ping. Instead of sending to one target until it times out or \ | ||
7 | replies, fping will send out a ping packet and move on to the next target \ | ||
8 | in a round-robin fashion." | ||
9 | HOMEPAGE = "http://www.fping.org/" | ||
10 | SECTION = "console/tools" | ||
11 | LICENSE = "BSD" | ||
12 | LIC_FILES_CHKSUM = "file://COPYING;md5=09d77789fe32be35acde9637a5ee39b1" | ||
13 | |||
14 | SRC_URI = "http://www.fping.org/dist/fping-${PV}.tar.gz" | ||
15 | SRC_URI[md5sum] = "2e17cb655aa4eb59b5a4a38a89e746ed" | ||
16 | SRC_URI[sha256sum] = "09b8960e235341bae6000085d38106357eae656a79e0119bd27e816c9003656a" | ||
17 | |||
18 | S = "${WORKDIR}/fping-${PV}" | ||
19 | |||
20 | inherit autotools | ||
21 | |||
22 | EXTRA_OECONF = "--enable-ipv4" | ||
23 | |||
24 | PACKAGECONFIG ?= "${@base_contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}" | ||
25 | PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," | ||
diff --git a/meta-networking/recipes-support/iftop/iftop_1.0pre2.bb b/meta-networking/recipes-support/iftop/iftop_1.0pre2.bb new file mode 100644 index 0000000000..73f2d85a22 --- /dev/null +++ b/meta-networking/recipes-support/iftop/iftop_1.0pre2.bb | |||
@@ -0,0 +1,14 @@ | |||
1 | SUMMARY = "iftop does for network usage what top(1) does for CPU usage" | ||
2 | HOMEPAGE = "http://www.ex-parrot.com/pdw/iftop/" | ||
3 | |||
4 | DEPENDS = "libpcap ncurses" | ||
5 | |||
6 | LICENSE = "GPLv2" | ||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
8 | |||
9 | SRC_URI = "http://www.ex-parrot.com/pdw/iftop/download/iftop-${PV}.tar.gz" | ||
10 | SRC_URI[md5sum] = "fef521a49ec0122458d02c64212af3c5" | ||
11 | SRC_URI[sha256sum] = "1b193037bb3019afae88cd94c87468aac4b045d81ab816ed8d2f489716b14027" | ||
12 | |||
13 | inherit autotools | ||
14 | |||
diff --git a/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0001-Fix-warning-with-gcc-4.8.patch b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0001-Fix-warning-with-gcc-4.8.patch new file mode 100644 index 0000000000..61f39d1961 --- /dev/null +++ b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0001-Fix-warning-with-gcc-4.8.patch | |||
@@ -0,0 +1,36 @@ | |||
1 | From fc230d5ded73fe4049aa586eacbe4098aeff912f Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Barker <paul@paulbarker.me.uk> | ||
3 | Date: Wed, 12 Jun 2013 17:39:06 +0100 | ||
4 | Subject: [PATCH] Fix warning with gcc 4.8. | ||
5 | |||
6 | The line "memset(pair, 0, sizeof(pair));" was causing the following warning: | ||
7 | |||
8 | error: argument to 'sizeof' in 'memset' call is the same expression as | ||
9 | the destination; did you mean to dereference | ||
10 | |||
11 | Compiling with -Werror (as specified in configure.ac) was causing this warning | ||
12 | to become an error. The line itself is not needed as memory is allocated via | ||
13 | calloc which performs zero initialization. Therefore, the line is removed to fix | ||
14 | the warning and does not need replacing anything. | ||
15 | --- | ||
16 | src/racoon/ipsec_doi.c | 1 - | ||
17 | 1 file changed, 1 deletion(-) | ||
18 | |||
19 | Upstream-Status: Accepted | ||
20 | (in CVS HEAD and 0_8-stable, expected to be present in next release) | ||
21 | |||
22 | diff --git a/src/racoon/ipsec_doi.c b/src/racoon/ipsec_doi.c | ||
23 | index 2b48d49..4e9d3a8 100644 | ||
24 | --- a/src/racoon/ipsec_doi.c | ||
25 | +++ b/src/racoon/ipsec_doi.c | ||
26 | @@ -1183,7 +1183,6 @@ get_proppair_and_doi_sit(sa, mode, doitype, sittype) | ||
27 | "failed to get buffer.\n"); | ||
28 | goto bad; | ||
29 | } | ||
30 | - memset(pair, 0, sizeof(pair)); | ||
31 | |||
32 | bp = (caddr_t)(sab + 1); | ||
33 | tlen = sa->l - sizeof(*sab); | ||
34 | -- | ||
35 | 1.8.3 | ||
36 | |||
diff --git a/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0002-Don-t-link-against-libfl.patch b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0002-Don-t-link-against-libfl.patch new file mode 100644 index 0000000000..13e9d73fc4 --- /dev/null +++ b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/0002-Don-t-link-against-libfl.patch | |||
@@ -0,0 +1,87 @@ | |||
1 | From e48b9097dce7bc2bfbb9e9c542124d3b5cebab39 Mon Sep 17 00:00:00 2001 | ||
2 | From: Paul Barker <paul@paulbarker.me.uk> | ||
3 | Date: Wed, 5 Mar 2014 13:39:14 +0000 | ||
4 | Subject: [PATCH] Don't link against libfl | ||
5 | |||
6 | We can remove all references to yywrap by adding "%option noyywrap" statements | ||
7 | to each flex source file that doesn't override yywrap. After this, we no longer | ||
8 | need to link against libfl and so no longer get errors about undefined | ||
9 | references to yylex. | ||
10 | |||
11 | Signed-off-by: Paul Barker <paul@paulbarker.me.uk> | ||
12 | Upstream-status: Submitted 2014-03-11 | ||
13 | see http://sourceforge.net/p/ipsec-tools/mailman/ipsec-tools-devel/thread/CANyK_8ewmxGA3vBVJW6s1APXPmxPR%2BDFWZ61EL8pCt288aKQ6w%40mail.gmail.com/#msg32088797 | ||
14 | --- | ||
15 | src/libipsec/Makefile.am | 1 - | ||
16 | src/racoon/Makefile.am | 2 +- | ||
17 | src/racoon/cftoken.l | 2 ++ | ||
18 | src/setkey/Makefile.am | 1 - | ||
19 | src/setkey/token.l | 2 ++ | ||
20 | 5 files changed, 5 insertions(+), 3 deletions(-) | ||
21 | |||
22 | diff --git a/src/libipsec/Makefile.am b/src/libipsec/Makefile.am | ||
23 | index 6a4e3b3..df1e106 100644 | ||
24 | --- a/src/libipsec/Makefile.am | ||
25 | +++ b/src/libipsec/Makefile.am | ||
26 | @@ -26,7 +26,6 @@ libipsec_la_SOURCES = \ | ||
27 | # version is current:revision:age. | ||
28 | # See: http://www.gnu.org/manual/libtool-1.4.2/html_chapter/libtool_6.html#SEC32 | ||
29 | libipsec_la_LDFLAGS = -version-info 0:1:0 | ||
30 | -libipsec_la_LIBADD = $(LEXLIB) | ||
31 | |||
32 | noinst_HEADERS = ipsec_strerror.h | ||
33 | |||
34 | diff --git a/src/racoon/Makefile.am b/src/racoon/Makefile.am | ||
35 | index dbaded9..0662957 100644 | ||
36 | --- a/src/racoon/Makefile.am | ||
37 | +++ b/src/racoon/Makefile.am | ||
38 | @@ -38,7 +38,7 @@ racoon_SOURCES = \ | ||
39 | cftoken.l cfparse.y prsa_tok.l prsa_par.y | ||
40 | EXTRA_racoon_SOURCES = isakmp_xauth.c isakmp_cfg.c isakmp_unity.c throttle.c \ | ||
41 | isakmp_frag.c nattraversal.c security.c $(MISSING_ALGOS) | ||
42 | -racoon_LDADD = $(CRYPTOBJS) $(HYBRID_OBJS) $(NATT_OBJS) $(FRAG_OBJS) $(LEXLIB) \ | ||
43 | +racoon_LDADD = $(CRYPTOBJS) $(HYBRID_OBJS) $(NATT_OBJS) $(FRAG_OBJS) \ | ||
44 | $(SECCTX_OBJS) vmbuf.o sockmisc.o misc.o ../libipsec/libipsec.la | ||
45 | racoon_DEPENDENCIES = \ | ||
46 | $(CRYPTOBJS) $(HYBRID_OBJS) $(NATT_OBJS) $(FRAG_OBJS) $(SECCTX_OBJS) \ | ||
47 | diff --git a/src/racoon/cftoken.l b/src/racoon/cftoken.l | ||
48 | index 490242c..1701922 100644 | ||
49 | --- a/src/racoon/cftoken.l | ||
50 | +++ b/src/racoon/cftoken.l | ||
51 | @@ -106,6 +106,8 @@ static int incstackp = 0; | ||
52 | static int yy_first_time = 1; | ||
53 | %} | ||
54 | |||
55 | +%option noyywrap | ||
56 | + | ||
57 | /* common seciton */ | ||
58 | nl \n | ||
59 | ws [ \t]+ | ||
60 | diff --git a/src/setkey/Makefile.am b/src/setkey/Makefile.am | ||
61 | index 746c1f1..389e6cf 100644 | ||
62 | --- a/src/setkey/Makefile.am | ||
63 | +++ b/src/setkey/Makefile.am | ||
64 | @@ -13,7 +13,6 @@ setkey_SOURCES = \ | ||
65 | |||
66 | setkey_LDFLAGS = ../libipsec/libipsec.la | ||
67 | setkey_DEPENDENCIES = ../libipsec/libipsec.la | ||
68 | -setkey_LDADD = $(LEXLIB) | ||
69 | |||
70 | noinst_HEADERS = vchar.h extern.h | ||
71 | man8_MANS = setkey.8 | ||
72 | diff --git a/src/setkey/token.l b/src/setkey/token.l | ||
73 | index ad3d843..eb23b76 100644 | ||
74 | --- a/src/setkey/token.l | ||
75 | +++ b/src/setkey/token.l | ||
76 | @@ -88,6 +88,8 @@ | ||
77 | #endif | ||
78 | %} | ||
79 | |||
80 | +%option noyywrap | ||
81 | + | ||
82 | /* common section */ | ||
83 | nl \n | ||
84 | ws [ \t]+ | ||
85 | -- | ||
86 | 1.9.0 | ||
87 | |||
diff --git a/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoonctl-build-fix.patch b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoonctl-build-fix.patch new file mode 100644 index 0000000000..eb8fa3e160 --- /dev/null +++ b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/racoonctl-build-fix.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | diff -rupN ipsec-tools-0.8.1.old/src/racoon/Makefile.am ipsec-tools-0.8.1/src/racoon/Makefile.am | ||
2 | --- ipsec-tools-0.8.1.old/src/racoon/Makefile.am 2014-03-05 12:16:52.907101044 +0100 | ||
3 | +++ ipsec-tools-0.8.1/src/racoon/Makefile.am 2014-03-05 12:17:10.946320064 +0100 | ||
4 | @@ -44,7 +44,17 @@ racoon_DEPENDENCIES = \ | ||
5 | $(CRYPTOBJS) $(HYBRID_OBJS) $(NATT_OBJS) $(FRAG_OBJS) $(SECCTX_OBJS) \ | ||
6 | vmbuf.o sockmisc.o misc.o | ||
7 | |||
8 | -racoonctl_SOURCES = racoonctl.c str2val.c | ||
9 | +racoonctl_SOURCES = \ | ||
10 | + session.c isakmp.c handler.c \ | ||
11 | + isakmp_ident.c isakmp_agg.c isakmp_base.c \ | ||
12 | + isakmp_quick.c isakmp_inf.c isakmp_newg.c \ | ||
13 | + gssapi.c dnssec.c getcertsbyname.c privsep.c \ | ||
14 | + pfkey.c admin.c evt.c ipsec_doi.c oakley.c grabmyaddr.c vendorid.c \ | ||
15 | + policy.c localconf.c remoteconf.c crypto_openssl.c algorithm.c \ | ||
16 | + proposal.c sainfo.c strnames.c \ | ||
17 | + plog.c logger.c schedule.c str2val.c \ | ||
18 | + safefile.c backupsa.c genlist.c rsalist.c \ | ||
19 | + cftoken.l cfparse.y prsa_tok.l prsa_par.y racoonctl.c | ||
20 | racoonctl_LDADD = libracoon.la ../libipsec/libipsec.la | ||
21 | |||
22 | libracoon_la_SOURCES = kmpstat.c vmbuf.c sockmisc.c misc.c | ||
23 | diff -rupN ipsec-tools-0.8.1.old/src/racoon/racoonctl.c ipsec-tools-0.8.1/src/racoon/racoonctl.c | ||
24 | --- ipsec-tools-0.8.1.old/src/racoon/racoonctl.c 2014-03-05 12:16:52.915100698 +0100 | ||
25 | +++ ipsec-tools-0.8.1/src/racoon/racoonctl.c 2014-03-05 12:17:17.906018754 +0100 | ||
26 | @@ -247,6 +247,9 @@ usage() | ||
27 | #error "Incompatible racoonctl interface" | ||
28 | #endif | ||
29 | |||
30 | +int f_local = 0; /* local test mode. behave like a wall. */ | ||
31 | +int dump_config =0; | ||
32 | + | ||
33 | int | ||
34 | main(ac, av) | ||
35 | int ac; | ||
diff --git a/meta-networking/recipes-support/ipsec-tools/ipsec-tools/with-flexdir.patch b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/with-flexdir.patch new file mode 100644 index 0000000000..da1169218a --- /dev/null +++ b/meta-networking/recipes-support/ipsec-tools/ipsec-tools/with-flexdir.patch | |||
@@ -0,0 +1,14 @@ | |||
1 | --- ipsec-tools-0.8.1.old/configure.ac 2014-03-04 16:24:57.431207664 +0100 | ||
2 | +++ ipsec-tools-0.8.1/configure.ac 2014-03-04 16:26:00.372461304 +0100 | ||
3 | @@ -171,9 +171,9 @@ if test $with_readline != "no"; then | ||
4 | fi | ||
5 | |||
6 | |||
7 | -AC_MSG_CHECKING(if --with-flex option is specified) | ||
8 | +AC_MSG_CHECKING(if --with-flexdir option is specified) | ||
9 | AC_ARG_WITH(flexdir, | ||
10 | - [AC_HELP_STRING([--with-flex], [use directiory (default: no)])], | ||
11 | + [AC_HELP_STRING([--with-flexdir], [use directory (default: no)])], | ||
12 | [flexdir="$withval"]) | ||
13 | AC_MSG_RESULT(${flexdir-dirdefault}) | ||
14 | |||
diff --git a/meta-networking/recipes-support/ipsec-tools/ipsec-tools_0.8.1.bb b/meta-networking/recipes-support/ipsec-tools/ipsec-tools_0.8.1.bb new file mode 100644 index 0000000000..b94404122d --- /dev/null +++ b/meta-networking/recipes-support/ipsec-tools/ipsec-tools_0.8.1.bb | |||
@@ -0,0 +1,57 @@ | |||
1 | DESCRIPTION = "IPsec-Tools is a port of KAME's IPsec utilities to the \ | ||
2 | Linux-2.6 IPsec implementation." | ||
3 | HOMEPAGE = "http://ipsec-tools.sourceforge.net/" | ||
4 | SECTION = "console/network" | ||
5 | LICENSE = "BSD" | ||
6 | LIC_FILES_CHKSUM = "file://src/libipsec/pfkey.c;beginline=6;endline=31;md5=bc9b7ff40beff19fe6bc6aef26bd2b24" | ||
7 | |||
8 | DEPENDS = "virtual/kernel openssl readline flex-native bison-native" | ||
9 | |||
10 | SRC_URI = "ftp://ftp.netbsd.org/pub/NetBSD/misc/ipsec-tools/0.8/ipsec-tools-${PV}.tar.bz2 \ | ||
11 | file://0001-Fix-warning-with-gcc-4.8.patch \ | ||
12 | file://0002-Don-t-link-against-libfl.patch \ | ||
13 | file://racoonctl-build-fix.patch \ | ||
14 | file://with-flexdir.patch \ | ||
15 | " | ||
16 | SRC_URI[md5sum] = "d38b39f291ba2962387c3232e7335dd8" | ||
17 | SRC_URI[sha256sum] = "fa4a95bb36842f001b84c4e7a1bb727e3ee06147edbc830a881d63abe8153dd4" | ||
18 | |||
19 | inherit autotools | ||
20 | |||
21 | # Options: | ||
22 | # --enable-adminport enable admin port | ||
23 | # --enable-rc5 enable RC5 encryption (patented) | ||
24 | # --enable-idea enable IDEA encryption (patented) | ||
25 | # --enable-gssapi enable GSS-API authentication | ||
26 | # --enable-hybrid enable hybrid, both mode-cfg and xauth support | ||
27 | # --enable-frag enable IKE fragmentation payload support | ||
28 | # --enable-stats enable statistics logging function | ||
29 | # --enable-dpd enable dead peer detection | ||
30 | # --enable-samode-unspec enable to use unspecified a mode of SA | ||
31 | # --disable-ipv6 disable ipv6 support | ||
32 | # --enable-natt enable NAT-Traversal (yes/no/kernel) | ||
33 | # --enable-natt-versions=list list of supported NAT-T versions delimited by coma. | ||
34 | # --with-kernel-headers=/lib/modules/<uname>/build/include | ||
35 | # where your Linux Kernel headers are installed | ||
36 | # --with-readline support readline input (yes by default) | ||
37 | # --with-flex use directiory (default: no) | ||
38 | # --with-flexlib=<LIB> specify flex library. | ||
39 | # --with-openssl=DIR specify OpenSSL directory | ||
40 | # --with-libradius=DIR specify libradius path (like/usr/pkg) | ||
41 | # --with-libpam=DIR specify libpam path (like/usr/pkg) | ||
42 | # | ||
43 | # Note: if you give it the actual kernel headers it won't build, it actually | ||
44 | # needs to point at the linux-libc-headers version of the kernel headers. | ||
45 | # | ||
46 | EXTRA_OECONF = "--with-kernel-headers=${STAGING_INCDIR} \ | ||
47 | --with-readline \ | ||
48 | --with-openssl=${STAGING_LIBDIR}/.. \ | ||
49 | --without-libradius \ | ||
50 | --without-libpam \ | ||
51 | --disable-security-context \ | ||
52 | --enable-shared \ | ||
53 | ${@base_contains('DISTRO_FEATURES', 'ipv6', '--enable-ipv6=yes', '', d)}" | ||
54 | |||
55 | # See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=530527 | ||
56 | CFLAGS += "-fno-strict-aliasing" | ||
57 | |||
diff --git a/meta-networking/recipes-support/libmemcached/files/crosscompile.patch b/meta-networking/recipes-support/libmemcached/files/crosscompile.patch new file mode 100644 index 0000000000..63511bff5f --- /dev/null +++ b/meta-networking/recipes-support/libmemcached/files/crosscompile.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | libmemcached/backtrace.cc | 3 ++- | ||
2 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
3 | |||
4 | --- libmemcached-1.0.15.orig/libmemcached/backtrace.cc | ||
5 | +++ libmemcached-1.0.15/libmemcached/backtrace.cc | ||
6 | @@ -75,10 +75,11 @@ void custom_backtrace(void) | ||
7 | { | ||
8 | for (int x= 0; x < stack_frames; x++) | ||
9 | { | ||
10 | bool was_demangled= false; | ||
11 | |||
12 | +#if USE_DEMANGLE == 1 | ||
13 | if (USE_DEMANGLE) | ||
14 | { | ||
15 | #ifdef HAVE_DLFCN_H | ||
16 | Dl_info dlinfo; | ||
17 | if (dladdr(backtrace_buffer[x], &dlinfo)) | ||
18 | @@ -107,11 +108,11 @@ void custom_backtrace(void) | ||
19 | dlinfo.dli_fname); | ||
20 | } | ||
21 | } | ||
22 | #endif | ||
23 | } | ||
24 | - | ||
25 | +#endif | ||
26 | if (was_demangled == false) | ||
27 | { | ||
28 | fprintf(stderr, "?%d %p in %s\n", x, backtrace_buffer[x], symbollist[x]); | ||
29 | } | ||
30 | } | ||
diff --git a/meta-networking/recipes-support/libmemcached/libmemcached.inc b/meta-networking/recipes-support/libmemcached/libmemcached.inc new file mode 100644 index 0000000000..50ef4d6062 --- /dev/null +++ b/meta-networking/recipes-support/libmemcached/libmemcached.inc | |||
@@ -0,0 +1,13 @@ | |||
1 | DESCRIPTION = "open source C/C++ client library and tools for the memcached server" | ||
2 | DEPENDS = "libevent util-linux" | ||
3 | LICENSE = "BSD" | ||
4 | LIC_FILES_CHKSUM = "file://COPYING;md5=865490941c91ba790f0ea78dec93bd60" | ||
5 | |||
6 | SRC_URI = "http://launchpad.net/libmemcached/1.0/${PV}/+download/libmemcached-${PV}.tar.gz" | ||
7 | |||
8 | TARGET_LDFLAGS += "-luuid" | ||
9 | |||
10 | PACKAGECONFIG ??= "" | ||
11 | PACKAGECONFIG[sasl] = "--enable-sasl,--disable-sasl,cyrus-sasl" | ||
12 | |||
13 | inherit autotools gettext pkgconfig | ||
diff --git a/meta-networking/recipes-support/libmemcached/libmemcached_1.0.15.bb b/meta-networking/recipes-support/libmemcached/libmemcached_1.0.15.bb new file mode 100644 index 0000000000..18232b4ceb --- /dev/null +++ b/meta-networking/recipes-support/libmemcached/libmemcached_1.0.15.bb | |||
@@ -0,0 +1,6 @@ | |||
1 | require libmemcached.inc | ||
2 | |||
3 | SRC_URI += "file://crosscompile.patch" | ||
4 | |||
5 | SRC_URI[md5sum] = "616297a1aedefc52b3f6922eda5d559a" | ||
6 | SRC_URI[sha256sum] = "dd7e9560029835bddf761a5b4c2339d9e5c7374558659b6c11b2c95e7d3a4325" | ||
diff --git a/meta-networking/recipes-support/libmemcached/libmemcached_1.0.7.bb b/meta-networking/recipes-support/libmemcached/libmemcached_1.0.7.bb new file mode 100644 index 0000000000..cdf8415ff7 --- /dev/null +++ b/meta-networking/recipes-support/libmemcached/libmemcached_1.0.7.bb | |||
@@ -0,0 +1,4 @@ | |||
1 | require libmemcached.inc | ||
2 | |||
3 | SRC_URI[md5sum] = "d59a462a92d296f76bff2d9bc72b2516" | ||
4 | SRC_URI[sha256sum] = "3efa86c9733eaad55d7119cb16769424e2aa6c22b3392e8f973946fce6678d81" | ||
diff --git a/meta-networking/recipes-support/lowpan-tools/lowpan-tools/no-help2man.patch b/meta-networking/recipes-support/lowpan-tools/lowpan-tools/no-help2man.patch new file mode 100644 index 0000000000..9ecd707b41 --- /dev/null +++ b/meta-networking/recipes-support/lowpan-tools/lowpan-tools/no-help2man.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | Disable building manpages so that make install doesn't fail due to lack of help2man | ||
2 | |||
3 | Upstream-Status: Inappropriate [config] | ||
4 | |||
5 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
6 | |||
7 | diff --git a/src/Makefile.am b/src/Makefile.am | ||
8 | index 46c4017..d6ed312 100644 | ||
9 | --- a/src/Makefile.am | ||
10 | +++ b/src/Makefile.am | ||
11 | @@ -9,11 +9,6 @@ izcoordinator_DESC = "simple coordinator for IEEE 802.15.4 network" | ||
12 | iz_DESC = "configure an IEEE 802.15.4 interface" | ||
13 | izchat_DESC = "simple chat program using IEEE 802.15.4" | ||
14 | |||
15 | -if MANPAGES | ||
16 | -dist_man_MANS = $(manpages) | ||
17 | -endif | ||
18 | -EXTRA_DIST = $(manpages) | ||
19 | - | ||
20 | izattach_SOURCES = serial.c | ||
21 | |||
22 | iz_SOURCES = iz.c iz-common.c iz-mac.c iz-phy.c | ||
23 | @@ -27,18 +22,6 @@ izcoordinator_LDADD = ../addrdb/libaddrdb.la $(LDADD) $(NL_LIBS) $(LEXLIB) | ||
24 | iz_CFLAGS = $(AM_CFLAGS) $(NL_CFLAGS) -D_GNU_SOURCE | ||
25 | iz_LDADD = $(LDADD) $(NL_LIBS) | ||
26 | |||
27 | -izattach.8: $(izattach_SOURCES) $(top_srcdir)/configure.ac | ||
28 | - -$(HELP2MAN) -o $@ -s 8 -N -n $(izattach_DESC) $(builddir)/izattach | ||
29 | - | ||
30 | -izcoordinator.8: $(izcoordinator_SOURCES) $(top_srcdir)/configure.ac | ||
31 | - -$(HELP2MAN) -o $@ -s 8 -N -n $(izcoordinator_DESC) $(builddir)/izcoordinator | ||
32 | - | ||
33 | -iz.8: $(iz_SOURCES) $(top_srcdir)/configure.ac | ||
34 | - -$(HELP2MAN) -o $@ -s 8 -N -n $(iz_DESC) $(builddir)/iz | ||
35 | - | ||
36 | -izchat.1: $(izchat_SOURCES) $(top_srcdir)/configure.ac | ||
37 | - -$(HELP2MAN) -o $@ -s 1 -N -n $(izchat_DESC) $(builddir)/izchat | ||
38 | - | ||
39 | install-data-hook: | ||
40 | $(mkinstalldirs) $(DESTDIR)`dirname $(leasefile)` | ||
41 | $(mkinstalldirs) $(DESTDIR)`dirname $(pidfile)` | ||
diff --git a/meta-networking/recipes-support/lowpan-tools/lowpan-tools_git.bb b/meta-networking/recipes-support/lowpan-tools/lowpan-tools_git.bb new file mode 100644 index 0000000000..5fc0de3151 --- /dev/null +++ b/meta-networking/recipes-support/lowpan-tools/lowpan-tools_git.bb | |||
@@ -0,0 +1,28 @@ | |||
1 | SUMMARY = "Utilities for managing the Linux LoWPAN stack" | ||
2 | DESCRIPTION = "This is a set of utils to manage the Linux LoWPAN stack. \ | ||
3 | The LoWPAN stack aims for IEEE 802.15.4-2003 (and for lesser extent IEEE 802.15.4-2006) compatibility." | ||
4 | |||
5 | LICENSE = "GPLv2" | ||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" | ||
7 | |||
8 | DEPENDS = "libnl python" | ||
9 | |||
10 | PV = "0.3+git${SRCPV}" | ||
11 | SRC_URI = "git://linux-zigbee.git.sourceforge.net/gitroot/linux-zigbee/linux-zigbee \ | ||
12 | file://no-help2man.patch" | ||
13 | SRCREV = "a1d9615adde6d1a568813c24a128273ed755af04" | ||
14 | |||
15 | S = "${WORKDIR}/git" | ||
16 | |||
17 | inherit autotools python-dir | ||
18 | |||
19 | CACHED_CONFIGUREVARS += "am_cv_python_pythondir=${PYTHON_SITEPACKAGES_DIR}/lowpan-tools" | ||
20 | |||
21 | do_install_append() { | ||
22 | rmdir ${D}${localstatedir}/run | ||
23 | } | ||
24 | |||
25 | FILES_${PN}-dbg += "${libexecdir}/lowpan-tools/.debug/" | ||
26 | |||
27 | PACKAGES =+ "${PN}-python" | ||
28 | FILES_${PN}-python = "${libdir}/python*" | ||
diff --git a/meta-networking/recipes-support/macchanger/macchanger_1.5.0.bb b/meta-networking/recipes-support/macchanger/macchanger_1.5.0.bb new file mode 100644 index 0000000000..b97e9d1fc5 --- /dev/null +++ b/meta-networking/recipes-support/macchanger/macchanger_1.5.0.bb | |||
@@ -0,0 +1,24 @@ | |||
1 | SUMMARY = "Tool to view/change network interface MAC addresses" | ||
2 | DESCRIPTION = "A GNU/Linux utility for viewing/manipulating the MAC address of network interfaces." | ||
3 | HOMEPAGE = "http://www.alobbs.com/macchanger" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
6 | |||
7 | |||
8 | SRC_URI = "${GNU_MIRROR}/macchanger/${BPN}-${PV}.tar.gz" | ||
9 | |||
10 | SRC_URI[md5sum] = "79b7cdaeca3d8ebafa764c4b0dd03ab7" | ||
11 | SRC_URI[sha256sum] = "d44bfa27cb29c5a718627cb3ef3aa42eb5130426545eb2031120826cd73fa8fe" | ||
12 | |||
13 | FILES_${PN} = " \ | ||
14 | ${bindir}/${BPN} \ | ||
15 | ${datadir}/${BPN}/wireless.list \ | ||
16 | ${datadir}/${BPN}/OUI.list \ | ||
17 | " | ||
18 | |||
19 | FILES_${PN}-doc = " \ | ||
20 | ${datadir}/info \ | ||
21 | ${datadir}/man \ | ||
22 | " | ||
23 | |||
24 | inherit autotools | ||
diff --git a/meta-networking/recipes-support/memcached/memcached_1.4.15.bb b/meta-networking/recipes-support/memcached/memcached_1.4.15.bb new file mode 100644 index 0000000000..016eaeb6e5 --- /dev/null +++ b/meta-networking/recipes-support/memcached/memcached_1.4.15.bb | |||
@@ -0,0 +1,15 @@ | |||
1 | DESCRIPTION = "Free & open source, high-performance, distributed memory object \ | ||
2 | caching system, generic in nature, but intended for use in speeding up dynamic \ | ||
3 | web applications by alleviating database load." | ||
4 | HOMEPAGE = "http://memcached.org/" | ||
5 | LICENSE = "BSD" | ||
6 | LIC_FILES_CHKSUM = "file://COPYING;md5=7e5ded7363d335e1bb18013ca08046ff" | ||
7 | |||
8 | SRC_URI = "http://memcached.googlecode.com/files/memcached-${PV}.tar.gz" | ||
9 | |||
10 | SRC_URI[md5sum] = "36ea966f5a29655be1746bf4949f7f69" | ||
11 | SRC_URI[sha256sum] = "169721ab7a7531add6ae9f6b14b6b5641725fe0b1f0bdf5c3a4327725901e2b4" | ||
12 | |||
13 | DEPENDS = "libevent" | ||
14 | |||
15 | inherit autotools | ||
diff --git a/meta-networking/recipes-support/mtr/files/no-gtk.patch b/meta-networking/recipes-support/mtr/files/no-gtk.patch new file mode 100644 index 0000000000..0dbeb7a297 --- /dev/null +++ b/meta-networking/recipes-support/mtr/files/no-gtk.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | Disable gtk check that breaks with current autotools | ||
2 | |||
3 | Ideally we would have a proper fix for this and send that upstream instead. | ||
4 | |||
5 | Upstream-Status: Pending | ||
6 | |||
7 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
8 | |||
9 | diff --git a/configure.in b/configure.in | ||
10 | index 8474543..5118565 100644 | ||
11 | --- a/configure.in | ||
12 | +++ b/configure.in | ||
13 | @@ -48,16 +48,8 @@ AC_ARG_ENABLE(ipv6, | ||
14 | [ --disable-ipv6 Do not enable IPv6], | ||
15 | WANTS_IPV6=$enableval, WANTS_IPV6=yes) | ||
16 | |||
17 | -if test "x$WANTS_GTK" = "xyes"; then | ||
18 | - AM_PATH_GTK_2_0(2.6.0, CFLAGS="$CFLAGS $GTK_CFLAGS" | ||
19 | - LIBS="$LIBS $GTK_LIBS -lm", | ||
20 | - AC_MSG_WARN(Building without GTK2 display support) | ||
21 | - AC_DEFINE(NO_GTK, 1, [Define if you don't have the GTK+ libraries available.]) | ||
22 | - GTK_OBJ="") | ||
23 | -else | ||
24 | - AC_DEFINE(NO_GTK) | ||
25 | - GTK_OBJ="" | ||
26 | -fi | ||
27 | +AC_DEFINE(NO_GTK, 1, [Define if you don't have the GTK+ libraries available.]) | ||
28 | +GTK_OBJ="" | ||
29 | |||
30 | AC_CHECK_FUNC(socket, , | ||
31 | AC_CHECK_LIB(socket, socket, , AC_MSG_ERROR(No socket library found))) | ||
diff --git a/meta-networking/recipes-support/mtr/mtr_0.82.bb b/meta-networking/recipes-support/mtr/mtr_0.82.bb new file mode 100644 index 0000000000..3a9394874e --- /dev/null +++ b/meta-networking/recipes-support/mtr/mtr_0.82.bb | |||
@@ -0,0 +1,19 @@ | |||
1 | SUMMARY = "Combined traceroute and ping utility" | ||
2 | DESCRIPTION = "mtr combines the functionality of the 'traceroute' and 'ping' programs in a single network diagnostic tool." | ||
3 | HOMEPAGE = "http://www.bitwizard.nl/mtr/" | ||
4 | DEPENDS = "ncurses" | ||
5 | |||
6 | LICENSE = "GPLv2" | ||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \ | ||
8 | file://mtr.c;beginline=5;endline=16;md5=56e390ced194aff352eefab404883057" | ||
9 | |||
10 | SRC_URI = "ftp://ftp.bitwizard.nl/mtr/mtr-${PV}.tar.gz \ | ||
11 | file://no-gtk.patch" | ||
12 | |||
13 | SRC_URI[md5sum] = "10601ea543fda3e51545c4bce195b64c" | ||
14 | SRC_URI[sha256sum] = "f3b457c9623ae03565688a7ffd49d4843a5e2505ccaf3ba8d9fbd86e3ce9b6a0" | ||
15 | |||
16 | inherit autotools | ||
17 | |||
18 | EXTRA_OECONF = "--without-gtk" | ||
19 | |||
diff --git a/meta-networking/recipes-support/ndisc6/ndisc6_1.0.2.bb b/meta-networking/recipes-support/ndisc6/ndisc6_1.0.2.bb new file mode 100644 index 0000000000..066aac2c0b --- /dev/null +++ b/meta-networking/recipes-support/ndisc6/ndisc6_1.0.2.bb | |||
@@ -0,0 +1,58 @@ | |||
1 | SECTION = "console/network" | ||
2 | DESCRIPTION = "This package includes some useful diagnostics tools for \ | ||
3 | IPv6 networks, including ndisc6, rdisc6, tcptraceroute6 and traceroute6." | ||
4 | SECTION = "console/network" | ||
5 | HOMEPAGE = "http://www.remlab.net/ndisc6/" | ||
6 | LICENSE = "GPL-2.0" | ||
7 | |||
8 | # The tcptraceroute6 and tracert6 commands depend on rltraceroute6 to | ||
9 | # perform the actual trace operation. | ||
10 | RDEPENDS_${PN}-tcptraceroute6 = "${PN}-rltraceroute6" | ||
11 | RDEPENDS_${PN}-tracert6 = "${PN}-rltraceroute6" | ||
12 | |||
13 | SRC_URI = "http://www.remlab.net/files/ndisc6/ndisc6-${PV}.tar.bz2 \ | ||
14 | " | ||
15 | SRC_URI[md5sum] = "50cb4c19606cf6ff2b7388e71832f579" | ||
16 | SRC_URI[sha256sum] = "6acec8a0cb9efa3ac98456f46c3016aeec0598b0c7557c95242b5228ad62ca7a" | ||
17 | |||
18 | LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe" | ||
19 | |||
20 | inherit autotools gettext | ||
21 | |||
22 | ALLOW_EMPTY_${PN} = "1" | ||
23 | |||
24 | # Split into seperate packages since we normal don't want them all | ||
25 | # The main package is left empty and therefore not created. | ||
26 | PACKAGES += "${PN}-ndisc6 ${PN}-tcpspray6 ${PN}-rdisc6 \ | ||
27 | ${PN}-tcptraceroute6 ${PN}-rltraceroute6 \ | ||
28 | ${PN}-tracert6 ${PN}-rdnssd ${PN}-misc" | ||
29 | FILES_${PN} = "" | ||
30 | FILES_${PN}-ndisc6 = "${bindir}/ndisc6" | ||
31 | FILES_${PN}-tcpspray6 = "${bindir}/tcpspray6" | ||
32 | FILES_${PN}-rdisc6 = "${bindir}/rdisc6" | ||
33 | FILES_${PN}-tcptraceroute6 = "${bindir}/tcptraceroute6" | ||
34 | FILES_${PN}-rltraceroute6 = "${bindir}/rltraceroute6" | ||
35 | FILES_${PN}-tracert6 = "${bindir}/tracert6" | ||
36 | FILES_${PN}-rdnssd = "${sbindir}/rdnssd ${sysconfdir}/rdnssd" | ||
37 | FILES_${PN}-misc = "${bindir}/dnssort ${bindir}/name2addr ${bindir}/tcpspray ${bindir}/addr2name" | ||
38 | |||
39 | DESCRIPTION_${PN}-ndisc6 = "ICMPv6 Neighbor Discovery tool. \ | ||
40 | Performs IPv6 neighbor discovery in userland. Replaces arping from the \ | ||
41 | IPv4 world." | ||
42 | DESCRIPTION_${PN}-rdisc6 = "ICMPv6 Router Discovery tool. \ | ||
43 | Queries IPv6 routers on the network for advertised prefixes. Can be used \ | ||
44 | to detect rogue IPv6 routers, monitor legitimate IPv6 routers." | ||
45 | DESCRITPION_${PN}-tcpspray6 = "Performs bandwidth measurements of TCP \ | ||
46 | sessions between the local system and a remote echo server in either IPv6 \ | ||
47 | or IPv4." | ||
48 | |||
49 | DESCRITPION_${PN}-rdnssd = "Daemon to autoconfigure the list of DNS \ | ||
50 | servers through slateless IPv6 autoconfiguration." | ||
51 | |||
52 | do_install_append () { | ||
53 | rm -rf ${D}${localstatedir} | ||
54 | # Enable SUID bit for applications that need it | ||
55 | chmod 4555 ${D}${bindir}/rltraceroute6 | ||
56 | chmod 4555 ${D}${bindir}/ndisc6 | ||
57 | chmod 4555 ${D}${bindir}/rdisc6 | ||
58 | } | ||
diff --git a/meta-networking/recipes-support/netcat/netcat-openbsd_1.105.bb b/meta-networking/recipes-support/netcat/netcat-openbsd_1.105.bb new file mode 100644 index 0000000000..4474e1d093 --- /dev/null +++ b/meta-networking/recipes-support/netcat/netcat-openbsd_1.105.bb | |||
@@ -0,0 +1,31 @@ | |||
1 | require netcat.inc | ||
2 | SUMMARY = "OpenBSD Netcat" | ||
3 | HOMEPAGE = "http://ftp.debian.org" | ||
4 | LICENSE = "BSD-3-Clause" | ||
5 | |||
6 | DEPENDS += "glib-2.0 libbsd" | ||
7 | |||
8 | SRC_URI = "${DEBIAN_MIRROR}/main/n/netcat-openbsd/netcat-openbsd_${PV}.orig.tar.gz;name=netcat \ | ||
9 | ${DEBIAN_MIRROR}/main/n/netcat-openbsd/netcat-openbsd_${PV}-7.debian.tar.gz;name=netcat-patch" | ||
10 | |||
11 | SRC_URI[netcat.md5sum] = "7e67b22f1ad41a1b7effbb59ff28fca1" | ||
12 | SRC_URI[netcat.sha256sum] = "40653fe66c1516876b61b07e093d826e2a5463c5d994f1b7e6ce328f3edb211e" | ||
13 | SRC_URI[netcat-patch.md5sum] = "e914f8eb7eda5c75c679dd77787ac76b" | ||
14 | SRC_URI[netcat-patch.sha256sum] = "eee759327ffea293e81d0dde67921b7fcfcad279ffd7a2c9d037bbc8f882b363" | ||
15 | |||
16 | S = "${WORKDIR}/${BPN}-${PV}" | ||
17 | |||
18 | do_configure[noexec] = "1" | ||
19 | |||
20 | do_compile() { | ||
21 | cd ${S} | ||
22 | while read line; do patch -p1 < ${WORKDIR}/debian/patches/$line; done < ${WORKDIR}/debian/patches/series | ||
23 | pkgrel=4 | ||
24 | oe_runmake CFLAGS="$CFLAGS -DDEBIAN_VERSION=\"\\\"${pkgrel}\\\"\"" | ||
25 | } | ||
26 | |||
27 | do_install() { | ||
28 | install -d ${D}${bindir} | ||
29 | install -m 755 ${S}/nc ${D}${bindir}/nc.${BPN} | ||
30 | } | ||
31 | ALTERNATIVE_PRIORITY = "50" | ||
diff --git a/meta-networking/recipes-support/netcat/netcat.inc b/meta-networking/recipes-support/netcat/netcat.inc new file mode 100644 index 0000000000..6c815d97e6 --- /dev/null +++ b/meta-networking/recipes-support/netcat/netcat.inc | |||
@@ -0,0 +1,5 @@ | |||
1 | SECTION = "console/network" | ||
2 | inherit update-alternatives gettext | ||
3 | |||
4 | ALTERNATIVE_${PN} = "nc" | ||
5 | |||
diff --git a/meta-networking/recipes-support/netcat/netcat/make-netcat_flag_count_work.patch b/meta-networking/recipes-support/netcat/netcat/make-netcat_flag_count_work.patch new file mode 100644 index 0000000000..dd1938a991 --- /dev/null +++ b/meta-networking/recipes-support/netcat/netcat/make-netcat_flag_count_work.patch | |||
@@ -0,0 +1,34 @@ | |||
1 | Make netcat_flag_count() return positive value | ||
2 | |||
3 | C language has 3 distinct char types: | ||
4 | char | ||
5 | unsigned char | ||
6 | signed char | ||
7 | A char has the same range of values as signed char on X86, | ||
8 | but same as unsigned char on PPC which made netcat_flag_count | ||
9 | return a negative value, now we force variable c as signed char | ||
10 | to make netcat_flag_count return positive value. | ||
11 | |||
12 | Upstream-Status: Pending | ||
13 | |||
14 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
15 | --- | ||
16 | src/flagset.c | 2 +- | ||
17 | 1 files changed, 1 insertions(+), 1 deletions(-) | ||
18 | |||
19 | diff --git a/src/flagset.c b/src/flagset.c | ||
20 | index 442b634..54ac898 100644 | ||
21 | --- a/src/flagset.c | ||
22 | +++ b/src/flagset.c | ||
23 | @@ -134,7 +134,7 @@ unsigned short netcat_flag_next(unsigned short port) | ||
24 | |||
25 | int netcat_flag_count(void) | ||
26 | { | ||
27 | - register char c; | ||
28 | + register signed char c; | ||
29 | register int i; | ||
30 | int ret = 0; | ||
31 | |||
32 | -- | ||
33 | 1.7.5.4 | ||
34 | |||
diff --git a/meta-networking/recipes-support/netcat/netcat/netcat-locale_h.patch b/meta-networking/recipes-support/netcat/netcat/netcat-locale_h.patch new file mode 100644 index 0000000000..5cbcb08e8a --- /dev/null +++ b/meta-networking/recipes-support/netcat/netcat/netcat-locale_h.patch | |||
@@ -0,0 +1,25 @@ | |||
1 | Apparently somewhere along the line HAVE_LOCALE_H was changed to | ||
2 | HAVE_LC_MESSAGES. Adjust netcat to match. | ||
3 | |||
4 | Upstream-Status: Pending | ||
5 | |||
6 | Signed-off-by: Mark Hatle <mark.hatle@windriver.com> | ||
7 | |||
8 | Index: netcat-0.7.1/src/intl.h | ||
9 | =================================================================== | ||
10 | --- netcat-0.7.1.orig/src/intl.h | ||
11 | +++ netcat-0.7.1/src/intl.h | ||
12 | @@ -25,11 +25,11 @@ | ||
13 | #ifdef ENABLE_NLS | ||
14 | #include <libintl.h> | ||
15 | |||
16 | -#ifdef HAVE_LOCALE_H | ||
17 | +#if defined(HAVE_LC_MESSAGES) || defined(HAVE_LOCALE_H) | ||
18 | #include <locale.h> | ||
19 | #else | ||
20 | #error You must have locale.h in your system | ||
21 | -#endif /* HAVE_LOCALE_H */ | ||
22 | +#endif /* HAVE_LC_MESSAGES || HAVE_LOCALE_H */ | ||
23 | |||
24 | /* Our dear (and very common) gettext macros */ | ||
25 | #define _(String) gettext(String) | ||
diff --git a/meta-networking/recipes-support/netcat/netcat/obsolete_autoconf_macros.patch b/meta-networking/recipes-support/netcat/netcat/obsolete_autoconf_macros.patch new file mode 100644 index 0000000000..9b0ed58d66 --- /dev/null +++ b/meta-networking/recipes-support/netcat/netcat/obsolete_autoconf_macros.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | Replace obsoleted AM_CONFIG_HEADER flagged by autoconf 2.69 | ||
2 | locale.h check was picked from old gettext macros but with new aclocal | ||
3 | it picks the right 0.18 gettext.m4 and does not get the check | ||
4 | therefore we explicitly add it to configure.ac | ||
5 | |||
6 | Upstream-Status: Pending | ||
7 | |||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | |||
10 | Index: netcat-0.7.1/configure.ac | ||
11 | =================================================================== | ||
12 | --- netcat-0.7.1.orig/configure.ac 2013-01-18 01:30:01.928069739 -0800 | ||
13 | +++ netcat-0.7.1/configure.ac 2013-01-18 01:32:50.568073009 -0800 | ||
14 | @@ -26,8 +26,7 @@ | ||
15 | AC_PREREQ(2.53) | ||
16 | |||
17 | dnl without this order in this file, automake will be confused! | ||
18 | -AM_CONFIG_HEADER(config.h) | ||
19 | - | ||
20 | +AC_CONFIG_HEADERS(config.h) | ||
21 | dnl check for programs. first the c compiler. | ||
22 | AC_PROG_CC | ||
23 | AC_PROG_CPP | ||
24 | @@ -56,7 +55,7 @@ | ||
25 | AC_LBL_LIBRARY_NET | ||
26 | |||
27 | dnl Fortunately we have Solaris... | ||
28 | -AC_CHECK_HEADERS(sys/sockio.h) | ||
29 | +AC_CHECK_HEADERS(sys/sockio.h locale.h) | ||
30 | |||
31 | AC_CHECK_FUNCS(srandom random) | ||
32 | if test $ac_cv_func_srandom = no; then | ||
diff --git a/meta-networking/recipes-support/netcat/netcat_0.7.1.bb b/meta-networking/recipes-support/netcat/netcat_0.7.1.bb new file mode 100644 index 0000000000..8710c36462 --- /dev/null +++ b/meta-networking/recipes-support/netcat/netcat_0.7.1.bb | |||
@@ -0,0 +1,24 @@ | |||
1 | require netcat.inc | ||
2 | SUMMARY = "GNU Netcat" | ||
3 | HOMEPAGE = "http://netcat.sourceforge.net" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
6 | |||
7 | PR = "r3" | ||
8 | |||
9 | SRC_URI = "${SOURCEFORGE_MIRROR}/netcat/netcat-${PV}.tar.bz2 \ | ||
10 | file://obsolete_autoconf_macros.patch \ | ||
11 | file://netcat-locale_h.patch \ | ||
12 | file://make-netcat_flag_count_work.patch \ | ||
13 | " | ||
14 | |||
15 | SRC_URI[md5sum] = "0a29eff1736ddb5effd0b1ec1f6fe0ef" | ||
16 | SRC_URI[sha256sum] = "b55af0bbdf5acc02d1eb6ab18da2acd77a400bafd074489003f3df09676332bb" | ||
17 | |||
18 | inherit autotools | ||
19 | |||
20 | do_install_append() { | ||
21 | install -d ${D}${bindir} | ||
22 | mv ${D}${bindir}/nc ${D}${bindir}/nc.${BPN} | ||
23 | } | ||
24 | ALTERNATIVE_PRIORITY = "100" | ||
diff --git a/meta-networking/recipes-support/netcf/gnulib_git.bb b/meta-networking/recipes-support/netcf/gnulib_git.bb new file mode 100644 index 0000000000..1da6c83ede --- /dev/null +++ b/meta-networking/recipes-support/netcf/gnulib_git.bb | |||
@@ -0,0 +1,32 @@ | |||
1 | SUMMARY = "The GNU portability library" | ||
2 | DESCRIPTION = "A collection of software subroutines which are designed to \ | ||
3 | be usable on many operating systems. The goal of the project \ | ||
4 | is to make it easy for free software authors to make their \ | ||
5 | software run on many operating systems. Since source is designed \ | ||
6 | to be copied from gnulib, it is not a library per-se, as much \ | ||
7 | as a collection of portable idioms to be used in other projects." | ||
8 | |||
9 | HOMEPAGE = "http://www.gnu.org/software/gnulib/" | ||
10 | SECTION = "libs" | ||
11 | LICENSE = "LGPLv2+" | ||
12 | |||
13 | LIC_FILES_CHKSUM = "file://COPYING;md5=e4cf3810f33a067ea7ccd2cd889fed21" | ||
14 | SRCREV = "24379a9217fa4bd62685795aaaa010fd90ced9e3" | ||
15 | SRC_URI = "git://git.sv.gnu.org/gnulib;protocol=git \ | ||
16 | " | ||
17 | S = "${WORKDIR}/git" | ||
18 | |||
19 | do_install () { | ||
20 | cd ${S} | ||
21 | git checkout master | ||
22 | git clone ${S} ${D}/${datadir}/gnulib | ||
23 | } | ||
24 | |||
25 | do_patch[noexec] = "1" | ||
26 | do_configure[noexec] = "1" | ||
27 | do_compile[noexec] = "1" | ||
28 | do_package[noexec] = "1" | ||
29 | do_packagedata[noexec] = "1" | ||
30 | do_package_write_ipk[noexec] = "1" | ||
31 | do_package_write_deb[noexec] = "1" | ||
32 | do_package_write_rpm[noexec] = "1" | ||
diff --git a/meta-networking/recipes-support/netcf/netcf_git.bb b/meta-networking/recipes-support/netcf/netcf_git.bb new file mode 100644 index 0000000000..6c36ce8482 --- /dev/null +++ b/meta-networking/recipes-support/netcf/netcf_git.bb | |||
@@ -0,0 +1,27 @@ | |||
1 | SUMMARY = "netcf" | ||
2 | DESCRIPTION = "netcf is a cross-platform network configuration library." | ||
3 | HOMEPAGE = "https://fedorahosted.org/netcf/" | ||
4 | SECTION = "console/tools" | ||
5 | LICENSE = "LGPLv2.1" | ||
6 | |||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=bbb461211a33b134d42ed5ee802b37ff" | ||
8 | |||
9 | SRCREV = "b8a19dc860b38c97c42115d8a559b78853452a4b" | ||
10 | PV = "0.2.3+git${SRCPV}" | ||
11 | |||
12 | SRC_URI = "git://git.fedorahosted.org/netcf.git;protocol=git \ | ||
13 | " | ||
14 | |||
15 | DEPENDS += "augeas libnl libxslt libxml2 gnulib" | ||
16 | |||
17 | S = "${WORKDIR}/git" | ||
18 | |||
19 | inherit gettext autotools | ||
20 | |||
21 | EXTRA_OECONF_append_class-target = " --with-driver=redhat" | ||
22 | do_configure_prepend() { | ||
23 | cd ${S} | ||
24 | rm -f .gitmodules | ||
25 | ./bootstrap --gnulib-srcdir=${STAGING_DATADIR}/gnulib | ||
26 | } | ||
27 | |||
diff --git a/meta-networking/recipes-support/netperf/files/cpu_set.patch b/meta-networking/recipes-support/netperf/files/cpu_set.patch new file mode 100644 index 0000000000..434b790499 --- /dev/null +++ b/meta-networking/recipes-support/netperf/files/cpu_set.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | Subject: [PATCH] netperf: fix CPU_SETSIZE to build with eglibc | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com> | ||
6 | --- | ||
7 | src/netlib.c | 7 ++++++- | ||
8 | 1 files changed, 6 insertions(+), 1 deletions(-) | ||
9 | |||
10 | diff --git a/src/netlib.c b/src/netlib.c | ||
11 | index 206e002..e33aae6 100644 | ||
12 | --- a/src/netlib.c | ||
13 | +++ b/src/netlib.c | ||
14 | @@ -2265,7 +2265,12 @@ bind_to_specific_processor(int processor_affinity, int use_cpu_map) | ||
15 | fall-back on what we had before, which is to use just the size of | ||
16 | an unsigned long. raj 2006-09-14 */ | ||
17 | |||
18 | -#if defined(__CPU_SETSIZE) | ||
19 | +#if defined(CPU_SETSIZE) | ||
20 | +#define NETPERF_CPU_SETSIZE CPU_SETSIZE | ||
21 | +#define NETPERF_CPU_SET(cpu, cpusetp) CPU_SET(cpu, cpusetp) | ||
22 | +#define NETPERF_CPU_ZERO(cpusetp) CPU_ZERO (cpusetp) | ||
23 | + typedef cpu_set_t netperf_cpu_set_t; | ||
24 | +#elif defined(__CPU_SETSIZE) | ||
25 | #define NETPERF_CPU_SETSIZE __CPU_SETSIZE | ||
26 | #if defined(__CPU_SET_S) | ||
27 | #define NETPERF_CPU_SET(cpu, cpusetp) __CPU_SET_S(cpu, sizeof (cpu_set_t), cpusetp) | ||
28 | -- | ||
29 | 1.7.1.1 | ||
30 | |||
diff --git a/meta-networking/recipes-support/netperf/files/init b/meta-networking/recipes-support/netperf/files/init new file mode 100644 index 0000000000..8ba2a63731 --- /dev/null +++ b/meta-networking/recipes-support/netperf/files/init | |||
@@ -0,0 +1,62 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # | ||
4 | # Written by Miquel van Smoorenburg <miquels@cistron.nl>. | ||
5 | # Modified for Debian GNU/Linux by Ian Murdock <imurdock@gnu.org>. | ||
6 | # Modified for Debian by Christoph Lameter <clameter@debian.org> | ||
7 | # Modified for openembedded by Bruno Randolf <bruno.randolf@4g-systems.biz> | ||
8 | |||
9 | ### BEGIN INIT INFO | ||
10 | # Provides: netperf | ||
11 | # Required-Start: $remote_fs $local_fs $time | ||
12 | # Required-Stop: $remote_fs $local_fs $time | ||
13 | # Should-Start: $network $named | ||
14 | # Should-Stop: $network $named | ||
15 | # Default-Start: 2 3 4 5 | ||
16 | # Default-Stop: 0 1 6 | ||
17 | # Short-Description: network benchmark | ||
18 | ### END INIT INFO | ||
19 | |||
20 | PATH=/bin:/usr/bin:/sbin:/usr/sbin | ||
21 | DAEMON=/usr/sbin/netserver | ||
22 | |||
23 | test -f $DAEMON || exit 0 | ||
24 | |||
25 | case "$1" in | ||
26 | start) | ||
27 | echo -n "Starting network benchmark server: netserver" | ||
28 | start-stop-daemon -S -x $DAEMON > /dev/null 2>&1 | ||
29 | echo "." | ||
30 | ;; | ||
31 | stop) | ||
32 | echo -n "Stopping network benchmark server: netserver" | ||
33 | start-stop-daemon -K -x $DAEMON | ||
34 | echo "." | ||
35 | ;; | ||
36 | #reload) | ||
37 | # | ||
38 | # If the daemon can reload its config files on the fly | ||
39 | # for example by sending it SIGHUP, do it here. | ||
40 | # | ||
41 | # If the daemon responds to changes in its config file | ||
42 | # directly anyway, make this a do-nothing entry. | ||
43 | # | ||
44 | # start-stop-daemon --stop --signal 1 --verbose --exec $DAEMON | ||
45 | # ;; | ||
46 | restart|force-reload) | ||
47 | # | ||
48 | # If the "reload" option is implemented, move the "force-reload" | ||
49 | # option to the "reload" entry above. If not, "force-reload" is | ||
50 | # just the same as "restart". | ||
51 | # | ||
52 | start-stop-daemon -K -x $DAEMON | ||
53 | sleep 1 | ||
54 | start-stop-daemon -S -x $DAEMON | ||
55 | ;; | ||
56 | *) | ||
57 | echo "Usage: /etc/init.d/netperf {start|stop|restart|force-reload}" | ||
58 | exit 1 | ||
59 | ;; | ||
60 | esac | ||
61 | |||
62 | exit 0 | ||
diff --git a/meta-networking/recipes-support/netperf/files/vfork.patch b/meta-networking/recipes-support/netperf/files/vfork.patch new file mode 100644 index 0000000000..eff98bfdee --- /dev/null +++ b/meta-networking/recipes-support/netperf/files/vfork.patch | |||
@@ -0,0 +1,58 @@ | |||
1 | Subject: [PATCH] netperf: fix vfork/fork | ||
2 | |||
3 | Upstream-Status: Pending | ||
4 | |||
5 | Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com> | ||
6 | --- | ||
7 | src/netserver.c | 12 ++++++++++-- | ||
8 | 1 files changed, 10 insertions(+), 2 deletions(-) | ||
9 | |||
10 | diff --git a/src/netserver.c b/src/netserver.c | ||
11 | index 379a106..f6a8b09 100644 | ||
12 | --- a/src/netserver.c | ||
13 | +++ b/src/netserver.c | ||
14 | @@ -1020,7 +1020,7 @@ process_requests() | ||
15 | void | ||
16 | spawn_child() { | ||
17 | |||
18 | -#if defined(HAVE_FORK) | ||
19 | +#if defined(HAVE_FORK) || defined(HAVE_VFORK) | ||
20 | |||
21 | if (debug) { | ||
22 | fprintf(where, | ||
23 | @@ -1038,7 +1038,11 @@ spawn_child() { | ||
24 | |||
25 | signal(SIGCLD,SIG_IGN); | ||
26 | |||
27 | +#if defined(HAVE_FORK) | ||
28 | switch (fork()) { | ||
29 | +#else | ||
30 | + switch (vfork()) { | ||
31 | +#endif | ||
32 | case -1: | ||
33 | fprintf(where, | ||
34 | "%s: fork() error %s (errno %d)\n", | ||
35 | @@ -1405,7 +1409,7 @@ scan_netserver_args(int argc, char *argv[]) { | ||
36 | |||
37 | void | ||
38 | daemonize() { | ||
39 | -#if defined(HAVE_FORK) | ||
40 | +#if defined(HAVE_FORK) || defined(HAVE_VFORK) | ||
41 | |||
42 | if (debug) { | ||
43 | fprintf(where, | ||
44 | @@ -1419,7 +1423,11 @@ daemonize() { | ||
45 | fflush(stdout); | ||
46 | fflush(stderr); | ||
47 | |||
48 | +#if defined(HAVE_FORK) | ||
49 | switch (fork()) { | ||
50 | +#else | ||
51 | + switch (vfork()) { | ||
52 | +#endif | ||
53 | case -1: | ||
54 | fprintf(stderr, | ||
55 | "%s: fork() error %s (errno %d)\n", | ||
56 | -- | ||
57 | 1.7.1.1 | ||
58 | |||
diff --git a/meta-networking/recipes-support/netperf/netperf_2.6.0.bb b/meta-networking/recipes-support/netperf/netperf_2.6.0.bb new file mode 100644 index 0000000000..7124b02e3f --- /dev/null +++ b/meta-networking/recipes-support/netperf/netperf_2.6.0.bb | |||
@@ -0,0 +1,61 @@ | |||
1 | SUMMARY = "A networking benchmarking tool" | ||
2 | DESCRIPTION = "Network performance benchmark including tests for TCP, UDP, sockets, ATM and more." | ||
3 | SECTION = "console/network" | ||
4 | HOMEPAGE = "http://www.netperf.org/" | ||
5 | LICENSE = "netperf" | ||
6 | LICENSE_FLAGS = "non-commercial" | ||
7 | |||
8 | |||
9 | SRC_URI="ftp://ftp.netperf.org/netperf/netperf-${PV}.tar.bz2 \ | ||
10 | file://cpu_set.patch \ | ||
11 | file://vfork.patch \ | ||
12 | file://init" | ||
13 | SRC_URI[md5sum] = "9654ffdfd4c4f2c93ce3733cd9ed9236" | ||
14 | SRC_URI[sha256sum] = "cd8dac710d4273d29f70e8dbd09353a6362ac58a11926e0822233c0cb230323a" | ||
15 | |||
16 | LIC_FILES_CHKSUM = "file://COPYING;md5=a0ab17253e7a3f318da85382c7d5d5d6" | ||
17 | |||
18 | inherit update-rc.d autotools | ||
19 | |||
20 | S = "${WORKDIR}/netperf-${PV}" | ||
21 | |||
22 | # cpu_set.patch plus _GNU_SOURCE makes src/netlib.c compile with CPU_ macros | ||
23 | CFLAGS_append = " -DDO_UNIX -DDO_IPV6 -D_GNU_SOURCE" | ||
24 | |||
25 | # set the "_FILE_OFFSET_BITS" preprocessor symbol to 64 to support files | ||
26 | # larger than 2GB | ||
27 | CFLAGS_append = "${@base_contains('DISTRO_FEATURES', 'largefile', \ | ||
28 | ' -D_FILE_OFFSET_BITS=64', '', d)}" | ||
29 | |||
30 | # autotools.bbclass attends to include m4 files with path depth <= 2 by | ||
31 | # "find ${S} -maxdepth 2 -name \*.m4", so move m4 files from m4/m4. | ||
32 | do_configure_prepend() { | ||
33 | test -d ${S}/m4/m4 && mv -f ${S}/m4/m4 ${S}/m4-files | ||
34 | } | ||
35 | |||
36 | do_install() { | ||
37 | sed -e 's#/usr/sbin/#${sbindir}/#g' -i ${WORKDIR}/init | ||
38 | |||
39 | install -d ${D}${sbindir} ${D}${bindir} ${D}${sysconfdir}/init.d | ||
40 | install -m 4755 src/netperf ${D}${bindir} | ||
41 | install -m 4755 src/netserver ${D}${sbindir} | ||
42 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/netperf | ||
43 | |||
44 | # man | ||
45 | install -d ${D}${mandir}/man1/ | ||
46 | install -m 0644 ${S}/doc/netserver.man ${D}${mandir}/man1/netserver.1 | ||
47 | install -m 0644 ${S}/doc/netperf.man ${D}${mandir}/man1/netperf.1 | ||
48 | |||
49 | # move scripts to examples directory | ||
50 | install -d ${D}${docdir}/netperf/examples | ||
51 | install -m 0644 ${S}/doc/examples/*_script ${D}${docdir}/netperf/examples/ | ||
52 | |||
53 | # docs .. | ||
54 | install -m 0644 ${S}/COPYING ${D}${docdir}/netperf | ||
55 | install -m 0644 ${S}/Release_Notes ${D}${docdir}/netperf | ||
56 | install -m 0644 ${S}/README ${D}${docdir}/netperf | ||
57 | install -m 0644 ${S}/doc/netperf_old.ps ${D}${docdir}/netperf | ||
58 | } | ||
59 | |||
60 | INITSCRIPT_NAME="netperf" | ||
61 | INITSCRIPT_PARAMS="defaults" | ||
diff --git a/meta-networking/recipes-support/nis/files/libdl.patch b/meta-networking/recipes-support/nis/files/libdl.patch new file mode 100644 index 0000000000..605af319f9 --- /dev/null +++ b/meta-networking/recipes-support/nis/files/libdl.patch | |||
@@ -0,0 +1,12 @@ | |||
1 | --- pwdutils-2.6/configure.in.orig 2005-04-19 20:22:36.603052192 -0700 | ||
2 | +++ pwdutils-2.6/configure.in 2005-04-19 21:09:45.308023672 -0700 | ||
3 | @@ -178,6 +178,9 @@ | ||
4 | AC_CHECK_LIB(ldap, main, LDAP_LIBS="-lldap $LDAP_LIBS" found_ldap_lib=yes,,$LDAP_LIBS) | ||
5 | fi | ||
6 | |||
7 | + dnl this always needs dl | ||
8 | + AC_CHECK_LIB(dl, dlopen, LDAP_LIBS="$LDAP_LIBS -ldl") | ||
9 | + | ||
10 | if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape5 \); then | ||
11 | AC_CHECK_LIB(ldap50, main, LDAP_LIBS="-lldap50 -lssldap50 -lssl3 -lnss3 -lnspr4 -lprldap50 -lplc4 -lplds4" found_ldap_lib=yes need_pthread=true,, -lpthread) | ||
12 | fi | ||
diff --git a/meta-networking/recipes-support/nis/files/no-selinux.patch b/meta-networking/recipes-support/nis/files/no-selinux.patch new file mode 100644 index 0000000000..71da3e3931 --- /dev/null +++ b/meta-networking/recipes-support/nis/files/no-selinux.patch | |||
@@ -0,0 +1,16 @@ | |||
1 | --- pwdutils-2.6/lib/copy_xattr.c.orig 2005-04-16 17:15:52.916660880 -0700 | ||
2 | +++ pwdutils-2.6/lib/copy_xattr.c 2005-04-16 17:18:10.345768480 -0700 | ||
3 | @@ -127,8 +127,11 @@ | ||
4 | |||
5 | if (lsetxattr (to, name, value, size, 0) != 0) | ||
6 | { | ||
7 | - if (strcmp (name, "security.selinux") == 0 && | ||
8 | - is_selinux_enabled() == 0) | ||
9 | + if (strcmp (name, "security.selinux") == 0 | ||
10 | +#if defined(WITH_SELINUX) | ||
11 | + && is_selinux_enabled() == 0 | ||
12 | +#endif | ||
13 | + ) | ||
14 | fprintf (stderr, | ||
15 | _("SELinux not enabled, ignore attribute %s for `%s'.\n"), | ||
16 | name, to); | ||
diff --git a/meta-networking/recipes-support/nis/files/ypbind-yocto.init b/meta-networking/recipes-support/nis/files/ypbind-yocto.init new file mode 100644 index 0000000000..5f50a530e7 --- /dev/null +++ b/meta-networking/recipes-support/nis/files/ypbind-yocto.init | |||
@@ -0,0 +1,99 @@ | |||
1 | #! /bin/sh | ||
2 | # Copyright (c) 2004 Author: Thorsten Kukuk <kukuk@suse.de> | ||
3 | # | ||
4 | # /etc/init.d/ypbind | ||
5 | # | ||
6 | # and symbolic its link | ||
7 | # | ||
8 | # /usr/sbin/rcypbind | ||
9 | # | ||
10 | # System startup script for the ypbind daemon | ||
11 | # | ||
12 | ### BEGIN INIT INFO | ||
13 | # Provides: ypbind | ||
14 | # Required-Start: $remote_fs $portmap | ||
15 | # Should-Start: ypserv slpd | ||
16 | # Required-Stop: portmap | ||
17 | # Default-Start: 3 5 | ||
18 | # Default-Stop: 0 1 2 6 | ||
19 | # Short-Description: Start ypbind (necessary for a NIS client) | ||
20 | # Description: ypbind finds the server for NIS domains and maintains | ||
21 | # the NIS binding information. | ||
22 | ### END INIT INFO | ||
23 | |||
24 | YPBIND_BIN=/usr/sbin/ypbind | ||
25 | pidfile=/var/run/ypbind.pid | ||
26 | |||
27 | [ -f /etc/default/ypbind ] && . /etc/default/ypbind | ||
28 | |||
29 | case "$1" in | ||
30 | start) | ||
31 | echo -n "Starting ypbind" | ||
32 | ## If the domainname is not set, skip starting of ypbind | ||
33 | ## and return with "program not configured" | ||
34 | /bin/ypdomainname &> /dev/null | ||
35 | if [ $? -ne 0 -o -z "`/bin/ypdomainname 2>/dev/null`" ]; then | ||
36 | if [ -f /etc/defaultdomain ]; then | ||
37 | XDOMAINNAME=`cat /etc/defaultdomain` | ||
38 | /bin/ypdomainname "$XDOMAINNAME" | ||
39 | fi | ||
40 | /bin/ypdomainname &> /dev/null | ||
41 | if [ $? -ne 0 -o -z "`/bin/ypdomainname 2>/dev/null`" ]; then | ||
42 | # Tell the user this has skipped | ||
43 | echo -n " . . . . . . . . . . No domainname set" | ||
44 | # service is not configured | ||
45 | exit 1 | ||
46 | fi | ||
47 | fi | ||
48 | |||
49 | ## If we don't have a /etc/yp.conf file, skip starting of | ||
50 | ## ypbind and return with "program not configured" | ||
51 | ## if you add the -broadcast Option later, comment this out. | ||
52 | if [ ! -f /etc/yp.conf -a "$YPBIND_BROADCAST" != "yes" ] ; then | ||
53 | # Tell the user this has skipped | ||
54 | echo -n " . . . . . . . . . . ${attn}/etc/yp.conf not found${norm}" | ||
55 | # service is not configured | ||
56 | exit 1 | ||
57 | fi | ||
58 | |||
59 | # evaluate the OPTIONS for ypbind-mt | ||
60 | OPTIONS="" | ||
61 | test "$YPBIND_LOCAL_ONLY" = "yes" && OPTIONS="-local-only $OPTIONS" | ||
62 | test "$YPBIND_BROADCAST" = "yes" && OPTIONS="-broadcast $OPTIONS" | ||
63 | test "$YPBIND_BROKEN_SERVER" = "yes" && OPTIONS="-broken-server $OPTIONS" | ||
64 | |||
65 | start-stop-daemon --start --quiet --pidfile $pidfile --exec $YPBIND_BIN -- $YPBIND_OPTIONS $OPTIONS | ||
66 | if [ $? -eq 0 ]; then | ||
67 | notfound=1 | ||
68 | for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15; do | ||
69 | ypwhich &>/dev/null && { notfound=0 ; break; }; | ||
70 | echo -n " ." | ||
71 | sleep 1; | ||
72 | done | ||
73 | if [ $notfound -eq 1 ]; then | ||
74 | echo -n " ${warn}No NIS server found${norm}"; | ||
75 | fi | ||
76 | else | ||
77 | exit 1 | ||
78 | fi | ||
79 | ;; | ||
80 | stop) | ||
81 | echo -n "Shutting down ypbind" | ||
82 | start-stop-daemon --stop --quiet --pidfile $pidfile | ||
83 | # Remove static data, else glibc will continue to use NIS | ||
84 | rm -f /var/yp/binding/* /var/run/ypbind.pid | ||
85 | ;; | ||
86 | restart) | ||
87 | $0 stop | ||
88 | sleep 1 | ||
89 | $0 start | ||
90 | ;; | ||
91 | reload | force-reload) | ||
92 | echo -n "Reload service ypbind" | ||
93 | start-stop-daemon --stop --quiet --signal 1 --pidfile $pidfile | ||
94 | ;; | ||
95 | *) | ||
96 | echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}" | ||
97 | exit 1 | ||
98 | ;; | ||
99 | esac | ||
diff --git a/meta-networking/recipes-support/nis/nis.inc b/meta-networking/recipes-support/nis/nis.inc new file mode 100644 index 0000000000..075d2756d9 --- /dev/null +++ b/meta-networking/recipes-support/nis/nis.inc | |||
@@ -0,0 +1,31 @@ | |||
1 | # This include file contains global definitions for the | ||
2 | # various NIS packages. | ||
3 | # | ||
4 | # These packages will only function correctly with glibc - | ||
5 | # the rpcsvc functionality is not present in uclibc | ||
6 | DESCRIPTION = "NIS Server and Tools" | ||
7 | HOMEPAGE = "http://www.linux-nis.org/nis/" | ||
8 | SECTION = "console/network" | ||
9 | LICENSE = "GPL-2.0" | ||
10 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f" | ||
11 | |||
12 | inherit autotools gettext pkgconfig | ||
13 | |||
14 | # install is broken because src/Makefile heroically adds '-s' | ||
15 | # to the install flags - passing -s to the build /usr/bin/install! | ||
16 | # install-strip gets it right but installs ypbind -m <default>, | ||
17 | # not -m 555. In an OE build this is not, so far as I can see, | ||
18 | # a security problem (and this fix to the build problem is *much* | ||
19 | # easier and more maintainable.) | ||
20 | do_install() { | ||
21 | oe_runmake 'DESTDIR=${D}' install-strip | ||
22 | } | ||
23 | |||
24 | # An attempt to build on uclibc will fail, causing annoyance, | ||
25 | # so force the package to be skipped here (this will cause a | ||
26 | # 'nothing provides' error) | ||
27 | python () { | ||
28 | os = bb.data.getVar("TARGET_OS", d, 1) | ||
29 | if os == "linux-uclibc": | ||
30 | raise bb.parse.SkipPackage("NIS functionality requires rpcsvc/yp.h, uClibC does not provide this") | ||
31 | } | ||
diff --git a/meta-networking/recipes-support/nis/yp-tools/domainname.service b/meta-networking/recipes-support/nis/yp-tools/domainname.service new file mode 100644 index 0000000000..21aa92cb36 --- /dev/null +++ b/meta-networking/recipes-support/nis/yp-tools/domainname.service | |||
@@ -0,0 +1,12 @@ | |||
1 | [Unit] | ||
2 | Description=NIS Domainname | ||
3 | |||
4 | [Service] | ||
5 | Type=oneshot | ||
6 | EnvironmentFile=/etc/nisdomainname | ||
7 | ExecStart=/usr/bin/domainname $NISDOMAINNAME | ||
8 | RemainAfterExit=true | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=multi-user.target | ||
12 | |||
diff --git a/meta-networking/recipes-support/nis/yp-tools_2.12.bb b/meta-networking/recipes-support/nis/yp-tools_2.12.bb new file mode 100644 index 0000000000..0017845508 --- /dev/null +++ b/meta-networking/recipes-support/nis/yp-tools_2.12.bb | |||
@@ -0,0 +1,31 @@ | |||
1 | # This package builds tools to manage NIS | ||
2 | # The source package is utils/net/NIS/yp-tools | ||
3 | # | ||
4 | PR = "r3" | ||
5 | DESCRIPTION="\ | ||
6 | Network Information Service tools. \ | ||
7 | This package contains ypcat, ypmatch, ypset, \ | ||
8 | ypwhich, yppasswd, domainname, nisdomainname \ | ||
9 | and ypdomainname." | ||
10 | |||
11 | require nis.inc | ||
12 | SRC_URI = "http://www.linux-nis.org/download/yp-tools/${BP}.tar.bz2 \ | ||
13 | file://domainname.service \ | ||
14 | " | ||
15 | |||
16 | SRC_URI[md5sum] = "ce1e06d86caa285fa8cd76fdf103f51e" | ||
17 | SRC_URI[sha256sum] = "6ae8321666eea7837da343eea90ea30273fb74943ad111d5a4befd2afb252063" | ||
18 | |||
19 | CACHED_CONFIGUREVARS += "ac_cv_prog_STRIP=/bin/true" | ||
20 | |||
21 | inherit systemd | ||
22 | |||
23 | RPROVIDES_${PN} += "${PN}-systemd" | ||
24 | RREPLACES_${PN} += "${PN}-systemd" | ||
25 | RCONFLICTS_${PN} += "${PN}-systemd" | ||
26 | SYSTEMD_SERVICE_${PN} = "domainname.service" | ||
27 | |||
28 | do_install_append() { | ||
29 | install -d ${D}${systemd_unitdir}/system | ||
30 | install -m 0644 ${WORKDIR}/domainname.service ${D}${systemd_unitdir}/system | ||
31 | } | ||
diff --git a/meta-networking/recipes-support/nis/ypbind-mt/ypbind.service b/meta-networking/recipes-support/nis/ypbind-mt/ypbind.service new file mode 100644 index 0000000000..1f8df42af5 --- /dev/null +++ b/meta-networking/recipes-support/nis/ypbind-mt/ypbind.service | |||
@@ -0,0 +1,14 @@ | |||
1 | [Unit] | ||
2 | Description=YP Bind | ||
3 | Requires=domainname.service | ||
4 | After=domainname.service network.target | ||
5 | Before=systemd-user-sessions.service | ||
6 | |||
7 | [Service] | ||
8 | Type=forking | ||
9 | PIDFile=/var/run/ypbind.pid | ||
10 | ExecStart=/usr/sbin/ypbind | ||
11 | |||
12 | [Install] | ||
13 | WantedBy=multi-user.target | ||
14 | |||
diff --git a/meta-networking/recipes-support/nis/ypbind-mt_1.36.bb b/meta-networking/recipes-support/nis/ypbind-mt_1.36.bb new file mode 100644 index 0000000000..35ef16a89a --- /dev/null +++ b/meta-networking/recipes-support/nis/ypbind-mt_1.36.bb | |||
@@ -0,0 +1,52 @@ | |||
1 | # This package builds the NIS ypbind daemon | ||
2 | # The source package is utils/net/NIS/ypbind-mt | ||
3 | # | ||
4 | PR = "r3" | ||
5 | DESCRIPTION="\ | ||
6 | Multithreaded NIS bind service (ypbind-mt). \ | ||
7 | ypbind-mt is a complete new implementation of a NIS \ | ||
8 | binding daemon for Linux. It has the following \ | ||
9 | features. Supports ypbind protocol V1 and V2. \ | ||
10 | Uses threads for better response. Supports multiple \ | ||
11 | domain bindings. Supports /var/yp/binding/* file \ | ||
12 | for Linux libc 4/5 and glibc 2.x. Supports a list \ | ||
13 | of known secure NIS server (/etc/yp.conf) Binds to \ | ||
14 | the server which answered as first." | ||
15 | HOMEPAGE="http://www.linux-nis.org/nis/ypbind-mt/index.html" | ||
16 | |||
17 | require nis.inc | ||
18 | |||
19 | LIC_FILES_CHKSUM = "file://COPYING;md5=082c9a0886c7c3db1bc862b5b62ffe08" | ||
20 | |||
21 | SRC_URI = "http://www.linux-nis.org/download/ypbind-mt/${BP}.tar.bz2 \ | ||
22 | file://ypbind-yocto.init \ | ||
23 | file://ypbind.service \ | ||
24 | " | ||
25 | SRC_URI[md5sum] = "135834db97d78ff6d79fdee2810b4056" | ||
26 | SRC_URI[sha256sum] = "0eff76c1849f4b38ea1a60280d8397c4240369c641fe5402ce57edf1a90958c7" | ||
27 | |||
28 | # ypbind-mt now provides all the functionality of ypbind | ||
29 | # and is used in place of it. | ||
30 | PROVIDES += "ypbind" | ||
31 | |||
32 | CACHED_CONFIGUREVARS = "ac_cv_prog_STRIP=/bin/true" | ||
33 | |||
34 | do_install_append () { | ||
35 | install -d ${D}${sysconfdir}/init.d | ||
36 | install -d ${D}${sysconfdir}/rcS.d | ||
37 | |||
38 | install -m 0755 ${WORKDIR}/ypbind-yocto.init ${D}${sysconfdir}/init.d/ypbind | ||
39 | |||
40 | # TODO, use update-rc.d | ||
41 | ln -s ../init.d/ypbind ${D}${sysconfdir}/rcS.d/S44ypbind | ||
42 | |||
43 | install -d ${D}${systemd_unitdir}/system | ||
44 | install -m 0644 ${WORKDIR}/ypbind.service ${D}${systemd_unitdir}/system | ||
45 | } | ||
46 | |||
47 | inherit systemd | ||
48 | |||
49 | RPROVIDES_${PN} += "${PN}-systemd" | ||
50 | RREPLACES_${PN} += "${PN}-systemd" | ||
51 | RCONFLICTS_${PN} += "${PN}-systemd" | ||
52 | SYSTEMD_SERVICE_${PN} = "ypbind.service" | ||
diff --git a/meta-networking/recipes-support/ntp/files/ntp-4.2.4_p6-nano.patch b/meta-networking/recipes-support/ntp/files/ntp-4.2.4_p6-nano.patch new file mode 100644 index 0000000000..cb1e2f7341 --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/ntp-4.2.4_p6-nano.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | --- a/include/ntp_syscall.h.orig 2009-05-19 16:44:55.048156467 -0400 | ||
2 | +++ b/include/ntp_syscall.h 2009-05-19 16:46:19.293323686 -0400 | ||
3 | @@ -14,6 +14,14 @@ | ||
4 | # include <sys/timex.h> | ||
5 | #endif | ||
6 | |||
7 | +#if defined(ADJ_NANO) && !defined(MOD_NANO) | ||
8 | +#define MOD_NANO ADJ_NANO | ||
9 | +#endif | ||
10 | + | ||
11 | +#if defined(ADJ_TAI) && !defined(MOD_TAI) | ||
12 | +#define MOD_TAI ADJ_TAI | ||
13 | +#endif | ||
14 | + | ||
15 | #ifndef NTP_SYSCALLS_LIBC | ||
16 | #ifdef NTP_SYSCALLS_STD | ||
17 | # define ntp_adjtime(t) syscall(SYS_ntp_adjtime, (t)) | ||
diff --git a/meta-networking/recipes-support/ntp/files/ntp.conf b/meta-networking/recipes-support/ntp/files/ntp.conf new file mode 100644 index 0000000000..875b7ebc1d --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/ntp.conf | |||
@@ -0,0 +1,17 @@ | |||
1 | # This is the most basic ntp configuration file | ||
2 | # The driftfile must remain in a place specific to this | ||
3 | # machine - it records the machine specific clock error | ||
4 | driftfile /etc/ntp.drift | ||
5 | # This should be a server that is close (in IP terms) | ||
6 | # to the machine. Add other servers as required. | ||
7 | # Unless you un-comment the line below ntpd will sync | ||
8 | # only against the local system clock. | ||
9 | # | ||
10 | # server time.server.example.com | ||
11 | # | ||
12 | # Using local hardware clock as fallback | ||
13 | # Disable this when using ntpd -q -g -x as ntpdate or it will sync to itself | ||
14 | server 127.127.1.0 | ||
15 | fudge 127.127.1.0 stratum 14 | ||
16 | # Defining a default security setting | ||
17 | restrict default | ||
diff --git a/meta-networking/recipes-support/ntp/files/ntpd b/meta-networking/recipes-support/ntp/files/ntpd new file mode 100755 index 0000000000..a62b8ce691 --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/ntpd | |||
@@ -0,0 +1,64 @@ | |||
1 | #! /bin/sh | ||
2 | # | ||
3 | PATH=/sbin:/bin:/usr/bin:/usr/sbin | ||
4 | |||
5 | # ntpd init.d script for ntpdc from ntp.isc.org | ||
6 | test -x /usr/sbin/ntpd -a -r /etc/ntp.conf || exit 0 | ||
7 | # rcS contains TICKADJ | ||
8 | test -r /etc/default/rcS && . /etc/default/rcS | ||
9 | |||
10 | # Functions to do individual actions | ||
11 | settick(){ | ||
12 | # If TICKADJ is set we *must* adjust it before we start, because the | ||
13 | # driftfile relies on the correct setting | ||
14 | test -n "$TICKADJ" -a -x /usr/sbin/tickadj && { | ||
15 | echo -n "Setting tick to $TICKADJ: " | ||
16 | /usr/sbin/tickadj "$TICKADJ" | ||
17 | echo "done" | ||
18 | } | ||
19 | } | ||
20 | startdaemon(){ | ||
21 | # The -g option allows ntpd to step the time to correct it just | ||
22 | # once. The daemon will exit if the clock drifts too much after | ||
23 | # this. If ntpd seems to disappear after a while assume TICKADJ | ||
24 | # above is set to a totally incorrect value. | ||
25 | echo -n "Starting ntpd: " | ||
26 | start-stop-daemon --start -x /usr/sbin/ntpd -- -u ntp:ntp -p /var/run/ntp.pid "$@" | ||
27 | echo "done" | ||
28 | } | ||
29 | stopdaemon(){ | ||
30 | echo -n "Stopping ntpd: " | ||
31 | start-stop-daemon --stop -p /var/run/ntp.pid | ||
32 | echo "done" | ||
33 | } | ||
34 | |||
35 | case "$1" in | ||
36 | start) | ||
37 | settick | ||
38 | startdaemon -g | ||
39 | ;; | ||
40 | stop) | ||
41 | stopdaemon | ||
42 | ;; | ||
43 | force-reload) | ||
44 | stopdaemon | ||
45 | settick | ||
46 | startdaemon -g | ||
47 | ;; | ||
48 | restart) | ||
49 | # Don't reset the tick here | ||
50 | stopdaemon | ||
51 | startdaemon -g | ||
52 | ;; | ||
53 | reload) | ||
54 | # Must do this by hand, but don't do -g | ||
55 | stopdaemon | ||
56 | startdaemon | ||
57 | ;; | ||
58 | *) | ||
59 | echo "Usage: ntpd { start | stop | restart | reload }" >&2 | ||
60 | exit 1 | ||
61 | ;; | ||
62 | esac | ||
63 | |||
64 | exit 0 | ||
diff --git a/meta-networking/recipes-support/ntp/files/ntpdate b/meta-networking/recipes-support/ntp/files/ntpdate new file mode 100755 index 0000000000..17b64d1335 --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/ntpdate | |||
@@ -0,0 +1,54 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | PATH=/sbin:/bin:/usr/bin:/usr/sbin | ||
4 | |||
5 | test -x /usr/sbin/ntpdate || exit 0 | ||
6 | |||
7 | if test -f /etc/default/ntpdate ; then | ||
8 | . /etc/default/ntpdate | ||
9 | fi | ||
10 | |||
11 | if [ "$NTPSERVERS" = "" ] ; then | ||
12 | if [ "$METHOD" = "" -a "$1" != "silent" ] ; then | ||
13 | echo "Please set NTPSERVERS in /etc/default/ntpdate" | ||
14 | exit 1 | ||
15 | else | ||
16 | exit 0 | ||
17 | fi | ||
18 | fi | ||
19 | |||
20 | # This is a heuristic: The idea is that if a static interface is brought | ||
21 | # up, that is a major event, and we can put in some extra effort to fix | ||
22 | # the system time. Feel free to change this, especially if you regularly | ||
23 | # bring up new network interfaces. | ||
24 | if [ "$METHOD" = static ]; then | ||
25 | OPTS="-b" | ||
26 | fi | ||
27 | |||
28 | if [ "$METHOD" = loopback ]; then | ||
29 | exit 0 | ||
30 | fi | ||
31 | |||
32 | ( | ||
33 | |||
34 | LOCKFILE=/var/lock/ntpdate | ||
35 | |||
36 | # Avoid running more than one at a time | ||
37 | if [ -x /usr/bin/lockfile-create ]; then | ||
38 | lockfile-create $LOCKFILE | ||
39 | lockfile-touch $LOCKFILE & | ||
40 | LOCKTOUCHPID="$!" | ||
41 | fi | ||
42 | |||
43 | if /usr/sbin/ntpdate -s $OPTS $NTPSERVERS 2>/dev/null; then | ||
44 | if [ "$UPDATE_HWCLOCK" = "yes" ]; then | ||
45 | hwclock --systohc || : | ||
46 | fi | ||
47 | fi | ||
48 | |||
49 | if [ -x /usr/bin/lockfile-create ] ; then | ||
50 | kill $LOCKTOUCHPID | ||
51 | lockfile-remove $LOCKFILE | ||
52 | fi | ||
53 | |||
54 | ) & | ||
diff --git a/meta-networking/recipes-support/ntp/files/ntpdate.default b/meta-networking/recipes-support/ntp/files/ntpdate.default new file mode 100644 index 0000000000..486b6e07d3 --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/ntpdate.default | |||
@@ -0,0 +1,7 @@ | |||
1 | # Configuration script used by ntpdate-sync script | ||
2 | |||
3 | NTPSERVERS="" | ||
4 | |||
5 | # Set to "yes" to write time to hardware clock on success | ||
6 | UPDATE_HWCLOCK="no" | ||
7 | |||
diff --git a/meta-networking/recipes-support/ntp/files/openssl-check.patch b/meta-networking/recipes-support/ntp/files/openssl-check.patch new file mode 100644 index 0000000000..8b4a6733cd --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/openssl-check.patch | |||
@@ -0,0 +1,59 @@ | |||
1 | Hack OpenSSL check to work when libssl and libcrypto aren't in same dir | ||
2 | |||
3 | Upstream-Status: Inappropriate [config] | ||
4 | |||
5 | Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> | ||
6 | --- | ||
7 | configure | 4 ++-- | ||
8 | m4/ntp_openssl.m4 | 4 ++-- | ||
9 | sntp/configure | 4 ++-- | ||
10 | 3 files changed, 6 insertions(+), 6 deletions(-) | ||
11 | |||
12 | diff --git a/configure b/configure | ||
13 | index aae2c01..6a3c15e 100755 | ||
14 | --- a/configure | ||
15 | +++ b/configure | ||
16 | @@ -22868,8 +22868,8 @@ case "$ans" in | ||
17 | test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break | ||
18 | ;; | ||
19 | *) | ||
20 | - test -f $i/libcrypto.so -a -f $i/libssl.so && break | ||
21 | - test -f $i/libcrypto.a -a -f $i/libssl.a && break | ||
22 | + test -f $i/libssl.so && break | ||
23 | + test -f $i/libssl.a && break | ||
24 | ;; | ||
25 | esac | ||
26 | done | ||
27 | diff --git a/m4/ntp_openssl.m4 b/m4/ntp_openssl.m4 | ||
28 | index 7d9f477..67bdd55 100644 | ||
29 | --- a/m4/ntp_openssl.m4 | ||
30 | +++ b/m4/ntp_openssl.m4 | ||
31 | @@ -41,8 +41,8 @@ case "$ans" in | ||
32 | test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break | ||
33 | ;; | ||
34 | *) | ||
35 | - test -f $i/libcrypto.so -a -f $i/libssl.so && break | ||
36 | - test -f $i/libcrypto.a -a -f $i/libssl.a && break | ||
37 | + test -f $i/libssl.so && break | ||
38 | + test -f $i/libssl.a && break | ||
39 | ;; | ||
40 | esac | ||
41 | done | ||
42 | diff --git a/sntp/configure b/sntp/configure | ||
43 | index 7782c29..55e82d9 100755 | ||
44 | --- a/sntp/configure | ||
45 | +++ b/sntp/configure | ||
46 | @@ -14810,8 +14810,8 @@ case "$ans" in | ||
47 | test -f $i/libcrypto.dylib -a -f $i/libssl.dylib && break | ||
48 | ;; | ||
49 | *) | ||
50 | - test -f $i/libcrypto.so -a -f $i/libssl.so && break | ||
51 | - test -f $i/libcrypto.a -a -f $i/libssl.a && break | ||
52 | + test -f $i/libssl.so && break | ||
53 | + test -f $i/libssl.a && break | ||
54 | ;; | ||
55 | esac | ||
56 | done | ||
57 | -- | ||
58 | 1.7.1 | ||
59 | |||
diff --git a/meta-networking/recipes-support/ntp/files/tickadj.c.patch b/meta-networking/recipes-support/ntp/files/tickadj.c.patch new file mode 100644 index 0000000000..9ef9de9e1f --- /dev/null +++ b/meta-networking/recipes-support/ntp/files/tickadj.c.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | Index: ntp-4.2.2p3-r0/ntp-4.2.2p3/util/tickadj.c | ||
2 | =================================================================== | ||
3 | --- ntp-4.2.2p3/util/tickadj.c 2004-02-25 06:58:33.000000000 +0100 | ||
4 | +++ ntp-4.2.2p3/util/tickadj.c 2007-07-07 01:00:54.000000000 +0200 | ||
5 | @@ -21,7 +21,8 @@ | ||
6 | # include <unistd.h> | ||
7 | #endif /* HAVE_UNISTD_H */ | ||
8 | |||
9 | -#ifdef HAVE___ADJTIMEX /* Linux */ | ||
10 | +/* proper handling here has been moved to upstream ntp bugzilla */ | ||
11 | +#ifdef linux | ||
12 | |||
13 | #include <sys/timex.h> | ||
14 | struct timex txc; | ||
15 | @@ -91,7 +92,7 @@ | ||
16 | } | ||
17 | |||
18 | if (!errflg) { | ||
19 | - if (__adjtimex(&txc) < 0) | ||
20 | + if (adjtimex(&txc) < 0) | ||
21 | perror("adjtimex"); | ||
22 | else if (!quiet) | ||
23 | printf("tick = %ld\ntick_adj = %d\n", | ||
24 | @@ -146,7 +147,7 @@ | ||
25 | #endif | ||
26 | } | ||
27 | |||
28 | - if (__adjtimex(&txc) < 0) | ||
29 | + if (adjtimex(&txc) < 0) | ||
30 | { | ||
31 | perror("adjtimex"); | ||
32 | } | ||
diff --git a/meta-networking/recipes-support/ntp/ntp.inc b/meta-networking/recipes-support/ntp/ntp.inc new file mode 100644 index 0000000000..49f9901e1e --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp.inc | |||
@@ -0,0 +1,137 @@ | |||
1 | SUMMARY = "Network Time Protocol daemon and utilities" | ||
2 | DESCRIPTION = "The Network Time Protocol (NTP) is used to \ | ||
3 | synchronize the time of a computer client or server to \ | ||
4 | another server or reference time source, such as a radio \ | ||
5 | or satellite receiver or modem." | ||
6 | HOMEPAGE = "http://support.ntp.org" | ||
7 | SECTION = "console/network" | ||
8 | LICENSE = "NTP" | ||
9 | LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=fea4b50c33b18c2194b4b1c9ca512670" | ||
10 | |||
11 | INC_PR = "r6" | ||
12 | |||
13 | SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.gz \ | ||
14 | file://tickadj.c.patch \ | ||
15 | file://ntp-4.2.4_p6-nano.patch \ | ||
16 | file://openssl-check.patch \ | ||
17 | file://ntpd \ | ||
18 | file://ntp.conf \ | ||
19 | file://ntpdate \ | ||
20 | file://ntpdate.default \ | ||
21 | file://ntpdate.service \ | ||
22 | file://ntpd.service \ | ||
23 | file://sntp.service \ | ||
24 | file://sntp \ | ||
25 | file://ntpd.list \ | ||
26 | " | ||
27 | |||
28 | inherit autotools update-rc.d useradd systemd | ||
29 | |||
30 | # The ac_cv_header_readline_history is to stop ntpdc depending on either | ||
31 | # readline or curses | ||
32 | EXTRA_OECONF += "--with-net-snmp-config=no --without-ntpsnmpd ac_cv_header_readline_history_h=no --with-binsubdir=sbin" | ||
33 | CFLAGS_append = " -DPTYS_ARE_GETPT -DPTYS_ARE_SEARCHED" | ||
34 | |||
35 | USERADD_PACKAGES = "${PN}" | ||
36 | USERADD_PARAM_${PN} = "--system --home-dir /var/lib/ntp \ | ||
37 | --shell /bin/false --user-group ntp" | ||
38 | |||
39 | PACKAGECONFIG ??= "cap" | ||
40 | PACKAGECONFIG[openssl] = "--with-openssl-libdir=${STAGING_LIBDIR} \ | ||
41 | --with-openssl-incdir=${STAGING_INCDIR} \ | ||
42 | --with-crypto, \ | ||
43 | --without-openssl --without-crypto, \ | ||
44 | openssl" | ||
45 | PACKAGECONFIG[cap] = "--enable-linuxcaps,--disable-linuxcaps,libcap" | ||
46 | PACKAGECONFIG[readline] = "--with-lineeditlibs,--without-lineeditlibs,readline" | ||
47 | |||
48 | do_install_append() { | ||
49 | install -d ${D}${sysconfdir}/init.d | ||
50 | install -m 644 ${WORKDIR}/ntp.conf ${D}${sysconfdir} | ||
51 | install -m 755 ${WORKDIR}/ntpd ${D}${sysconfdir}/init.d | ||
52 | install -d ${D}${bindir} | ||
53 | install -m 755 ${WORKDIR}/ntpdate ${D}${bindir}/ntpdate-sync | ||
54 | |||
55 | # Fix hardcoded paths in scripts | ||
56 | sed -i 's!/usr/sbin/!${sbindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync | ||
57 | sed -i 's!/usr/bin/!${bindir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync | ||
58 | sed -i 's!/etc/!${sysconfdir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync | ||
59 | sed -i 's!/var/!${localstatedir}/!g' ${D}${sysconfdir}/init.d/ntpd ${D}${bindir}/ntpdate-sync | ||
60 | sed -i 's!^PATH=.*!PATH=${base_sbindir}:${base_bindir}:${sbindir}:${bindir}!' ${D}${bindir}/ntpdate-sync | ||
61 | sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/ntptrace | ||
62 | sed -i '/use/i use warnings;' ${D}${sbindir}/ntptrace | ||
63 | sed -i '1s,#!.*perl -w,#! ${bindir}/env perl,' ${D}${sbindir}/ntp-wait | ||
64 | sed -i '/use/i use warnings;' ${D}${sbindir}/ntp-wait | ||
65 | |||
66 | install -d ${D}/${sysconfdir}/default | ||
67 | install -m 644 ${WORKDIR}/ntpdate.default ${D}${sysconfdir}/default/ntpdate | ||
68 | install -m 0644 ${WORKDIR}/sntp ${D}${sysconfdir}/default/ | ||
69 | |||
70 | install -d ${D}/${sysconfdir}/network/if-up.d | ||
71 | ln -s ${bindir}/ntpdate-sync ${D}/${sysconfdir}/network/if-up.d | ||
72 | |||
73 | install -d ${D}${systemd_unitdir}/system | ||
74 | install -m 0644 ${WORKDIR}/ntpdate.service ${D}${systemd_unitdir}/system/ | ||
75 | install -m 0644 ${WORKDIR}/ntpd.service ${D}${systemd_unitdir}/system/ | ||
76 | install -m 0644 ${WORKDIR}/sntp.service ${D}${systemd_unitdir}/system/ | ||
77 | |||
78 | install -d ${D}${systemd_unitdir}/ntp-units.d | ||
79 | install -m 0644 ${WORKDIR}/ntpd.list ${D}${systemd_unitdir}/ntp-units.d/60-ntpd.list | ||
80 | } | ||
81 | |||
82 | PACKAGES += "ntpdate sntp ${PN}-tickadj ${PN}-utils" | ||
83 | # NOTE: you don't need ntpdate, use "ntpd -q -g -x" | ||
84 | |||
85 | # ntp originally includes tickadj. It's split off for inclusion in small firmware images on platforms | ||
86 | # with wonky clocks (e.g. OpenSlug) | ||
87 | RDEPENDS_${PN} = "${PN}-tickadj" | ||
88 | # Handle move from bin to utils package | ||
89 | RPROVIDES_${PN}-utils = "${PN}-bin" | ||
90 | RREPLACES_${PN}-utils = "${PN}-bin" | ||
91 | RCONFLICTS_${PN}-utils = "${PN}-bin" | ||
92 | |||
93 | SYSTEMD_PACKAGES = "${PN} ntpdate sntp" | ||
94 | SYSTEMD_SERVICE_${PN} = "ntpd.service" | ||
95 | SYSTEMD_SERVICE_ntpdate = "ntpdate.service" | ||
96 | SYSTEMD_SERVICE_sntp = "sntp.service" | ||
97 | |||
98 | RPROVIDES_${PN} += "${PN}-systemd" | ||
99 | RREPLACES_${PN} += "${PN}-systemd" | ||
100 | RCONFLICTS_${PN} += "${PN}-systemd" | ||
101 | |||
102 | RPROVIDES_ntpdate += "ntpdate-systemd" | ||
103 | RREPLACES_ntpdate += "ntpdate-systemd" | ||
104 | RCONFLICTS_ntpdate += "ntpdate-systemd" | ||
105 | |||
106 | RSUGGESTS_${PN} = "iana-etc" | ||
107 | |||
108 | FILES_${PN} = "${sbindir}/ntpd ${sysconfdir}/ntp.conf ${sysconfdir}/init.d/ntpd ${libdir} \ | ||
109 | ${systemd_unitdir}/ntp-units.d/60-ntpd.list \ | ||
110 | " | ||
111 | FILES_${PN}-tickadj = "${sbindir}/tickadj" | ||
112 | FILES_${PN}-utils = "${sbindir}" | ||
113 | FILES_ntpdate = "${sbindir}/ntpdate \ | ||
114 | ${sysconfdir}/network/if-up.d/ntpdate-sync \ | ||
115 | ${bindir}/ntpdate-sync \ | ||
116 | ${sysconfdir}/default/ntpdate \ | ||
117 | ${systemd_unitdir}/system/ntpdate.service \ | ||
118 | " | ||
119 | FILES_sntp = "${sbindir}/sntp \ | ||
120 | ${sysconfdir}/default/sntp \ | ||
121 | " | ||
122 | |||
123 | CONFFILES_${PN} = "${sysconfdir}/ntp.conf" | ||
124 | CONFFILES_ntpdate = "${sysconfdir}/default/ntpdate" | ||
125 | |||
126 | INITSCRIPT_NAME = "ntpd" | ||
127 | # No dependencies, so just go in at the standard level (20) | ||
128 | INITSCRIPT_PARAMS = "defaults" | ||
129 | |||
130 | pkg_postinst_ntpdate() { | ||
131 | if ! grep -q -s ntpdate $D/var/spool/cron/root; then | ||
132 | echo "adding crontab" | ||
133 | test -d $D/var/spool/cron || mkdir -p $D/var/spool/cron | ||
134 | echo "30 * * * * ${bindir}/ntpdate-sync silent" >> $D/var/spool/cron/root | ||
135 | fi | ||
136 | } | ||
137 | |||
diff --git a/meta-networking/recipes-support/ntp/ntp/ntpd.list b/meta-networking/recipes-support/ntp/ntp/ntpd.list new file mode 100644 index 0000000000..d1fe6b7e28 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp/ntpd.list | |||
@@ -0,0 +1 @@ | |||
ntpd.service | |||
diff --git a/meta-networking/recipes-support/ntp/ntp/ntpd.service b/meta-networking/recipes-support/ntp/ntp/ntpd.service new file mode 100644 index 0000000000..b7c4268646 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp/ntpd.service | |||
@@ -0,0 +1,11 @@ | |||
1 | [Unit] | ||
2 | Description=Network Time Service | ||
3 | After=network.target | ||
4 | |||
5 | [Service] | ||
6 | Type=forking | ||
7 | PIDFile=/run/ntpd.pid | ||
8 | ExecStart=/usr/sbin/ntpd -p /run/ntpd.pid -g | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-support/ntp/ntp/ntpdate.service b/meta-networking/recipes-support/ntp/ntp/ntpdate.service new file mode 100644 index 0000000000..10cbd70f99 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp/ntpdate.service | |||
@@ -0,0 +1,11 @@ | |||
1 | [Unit] | ||
2 | Description=Network Time Service (one-shot ntpdate mode) | ||
3 | Before=ntpd.service | ||
4 | |||
5 | [Service] | ||
6 | Type=oneshot | ||
7 | ExecStart=/usr/bin/ntpdate-sync silent | ||
8 | RemainAfterExit=yes | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-support/ntp/ntp/sntp b/meta-networking/recipes-support/ntp/ntp/sntp new file mode 100644 index 0000000000..f8c5895b74 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp/sntp | |||
@@ -0,0 +1 @@ | |||
NTPSERVER="ntpserver.example.org" | |||
diff --git a/meta-networking/recipes-support/ntp/ntp/sntp.service b/meta-networking/recipes-support/ntp/ntp/sntp.service new file mode 100644 index 0000000000..4898b8a709 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp/sntp.service | |||
@@ -0,0 +1,11 @@ | |||
1 | [Unit] | ||
2 | Description=Simple Network Time Service Client | ||
3 | After=network.target | ||
4 | |||
5 | [Service] | ||
6 | Type=oneshot | ||
7 | EnvironmentFile=-/etc/default/sntp | ||
8 | ExecStart=/usr/sbin/sntp -s $NTPSERVER | ||
9 | |||
10 | [Install] | ||
11 | WantedBy=multi-user.target | ||
diff --git a/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bb b/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bb new file mode 100644 index 0000000000..588a1b03c9 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp_4.2.6p5.bb | |||
@@ -0,0 +1,6 @@ | |||
1 | require ntp.inc | ||
2 | |||
3 | PR = "${INC_PR}.0" | ||
4 | |||
5 | SRC_URI[md5sum] = "00df80a84ec9528fcfb09498075525bc" | ||
6 | SRC_URI[sha256sum] = "d6ab8371f9d31e594eb6922823d5ccd03dcc4e9d84b0e23ea25ac1405432f91c" | ||
diff --git a/meta-networking/recipes-support/nuttcp/nuttcp_7.2.1.bb b/meta-networking/recipes-support/nuttcp/nuttcp_7.2.1.bb new file mode 100644 index 0000000000..b931d04702 --- /dev/null +++ b/meta-networking/recipes-support/nuttcp/nuttcp_7.2.1.bb | |||
@@ -0,0 +1,29 @@ | |||
1 | # Copyright (C) 2013 Khem Raj <raj.khem@gmail.com> | ||
2 | # Released under the MIT license (see COPYING.MIT for the terms) | ||
3 | |||
4 | SUMMARY = "network performance measurement tool" | ||
5 | DESCRIPTION = "nuttcp is a network performance measurement tool intended for use by network \ | ||
6 | and system managers. Its most basic usage is to determine the raw TCP (or UDP) \ | ||
7 | network layer throughput by transferring memory buffers from a source system \ | ||
8 | across an interconnecting network to a destination system, either transferring \ | ||
9 | data for a specified time interval, or alternatively transferring a specified \ | ||
10 | number of bytes." | ||
11 | HOMEPAGE = "http://www.nuttcp.net/nuttcp/Welcome%20Page.html" | ||
12 | LICENSE = "GPL-2.0" | ||
13 | SECTION = "net" | ||
14 | LIC_FILES_CHKSUM = "file://nuttcp-${PV}.c;beginline=4;endline=30;md5=ae7045c3c3616092e07d87f04ba0d960" | ||
15 | |||
16 | SRC_URI = "http://lcp.nrl.navy.mil/nuttcp/beta/nuttcp-${PV}.c" | ||
17 | SRC_URI[md5sum] = "1ebf4a08bad2a295a8155f02995e8754" | ||
18 | SRC_URI[sha256sum] = "c6e33810ccce67260f8d5d627f60e429d44f532365c58ed5673d035e2a59c4db" | ||
19 | |||
20 | S = "${WORKDIR}" | ||
21 | |||
22 | do_compile () { | ||
23 | ${CC} ${CFLAGS} -o nuttcp nuttcp-${PV}.c | ||
24 | } | ||
25 | |||
26 | do_install () { | ||
27 | install -d ${D}${bindir} | ||
28 | install -m 0755 nuttcp ${D}${bindir} | ||
29 | } | ||
diff --git a/meta-networking/recipes-support/openvpn/openvpn/openvpn b/meta-networking/recipes-support/openvpn/openvpn/openvpn new file mode 100755 index 0000000000..a3cd6a2f49 --- /dev/null +++ b/meta-networking/recipes-support/openvpn/openvpn/openvpn | |||
@@ -0,0 +1,104 @@ | |||
1 | #!/bin/sh -e | ||
2 | # | ||
3 | # Original version by Robert Leslie | ||
4 | # <rob@mars.org>, edited by iwj and cs | ||
5 | # Modified for openvpn by Alberto Gonzalez Iniesta <agi@agi.as> | ||
6 | # Modified for restarting / starting / stopping single tunnels by Richard Mueller <mueller@teamix.net> | ||
7 | |||
8 | test $DEBIAN_SCRIPT_DEBUG && set -v -x | ||
9 | |||
10 | DAEMON=/usr/sbin/openvpn | ||
11 | CONFIG_DIR=/etc/openvpn | ||
12 | test -x $DAEMON || exit 0 | ||
13 | test -d $CONFIG_DIR || exit 0 | ||
14 | |||
15 | start_vpn () { | ||
16 | modprobe tun >/dev/null 2>&1 || true | ||
17 | $DAEMON --daemon --writepid /var/run/openvpn.$NAME.pid \ | ||
18 | --config $CONFIG_DIR/$NAME.conf --cd $CONFIG_DIR || echo -n " FAILED->" | ||
19 | echo -n " $NAME" | ||
20 | } | ||
21 | stop_vpn () { | ||
22 | kill `cat $PIDFILE` || true | ||
23 | rm $PIDFILE | ||
24 | } | ||
25 | |||
26 | case "$1" in | ||
27 | start) | ||
28 | echo -n "Starting openvpn:" | ||
29 | |||
30 | if test -z $2 ; then | ||
31 | for CONFIG in `cd $CONFIG_DIR; ls *.conf 2> /dev/null`; do | ||
32 | NAME=${CONFIG%%.conf} | ||
33 | start_vpn | ||
34 | done | ||
35 | else | ||
36 | if test -e $CONFIG_DIR/$2.conf ; then | ||
37 | NAME=$2 | ||
38 | start_vpn | ||
39 | else | ||
40 | echo -n " No such VPN: $2" | ||
41 | fi | ||
42 | fi | ||
43 | echo "." | ||
44 | |||
45 | ;; | ||
46 | stop) | ||
47 | echo -n "Stopping openvpn:" | ||
48 | |||
49 | if test -z $2 ; then | ||
50 | for PIDFILE in `ls /var/run/openvpn.*.pid 2> /dev/null`; do | ||
51 | NAME=`echo $PIDFILE | cut -c18-` | ||
52 | NAME=${NAME%%.pid} | ||
53 | stop_vpn | ||
54 | echo -n " $NAME" | ||
55 | done | ||
56 | else | ||
57 | if test -e /var/run/openvpn.$2.pid ; then | ||
58 | PIDFILE=`ls /var/run/openvpn.$2.pid 2> /dev/null` | ||
59 | NAME=`echo $PIDFILE | cut -c18-` | ||
60 | NAME=${NAME%%.pid} | ||
61 | stop_vpn | ||
62 | echo -n " $NAME" | ||
63 | else | ||
64 | echo -n " No such VPN: $2" | ||
65 | fi | ||
66 | fi | ||
67 | echo "." | ||
68 | ;; | ||
69 | # We only 'reload' for running VPNs. New ones will only start with 'start' or 'restart'. | ||
70 | reload|force-reload) | ||
71 | echo -n "Reloading openvpn:" | ||
72 | for PIDFILE in `ls /var/run/openvpn.*.pid 2> /dev/null`; do | ||
73 | NAME=`echo $PIDFILE | cut -c18-` | ||
74 | NAME=${NAME%%.pid} | ||
75 | # If openvpn if running under a different user than root we'll need to restart | ||
76 | if egrep '^( |\t)*user' $CONFIG_DIR/$NAME.conf > /dev/null 2>&1 ; then | ||
77 | stop_vpn | ||
78 | sleep 1 | ||
79 | start_vpn | ||
80 | echo -n "(restarted)" | ||
81 | else | ||
82 | kill -HUP `cat $PIDFILE` || true | ||
83 | # start-stop-daemon --stop --signal HUP --quiet --oknodo \ | ||
84 | # --exec $DAEMON --pidfile $PIDFILE | ||
85 | echo -n " $NAME" | ||
86 | fi | ||
87 | done | ||
88 | echo "." | ||
89 | ;; | ||
90 | |||
91 | restart) | ||
92 | $0 stop $2 | ||
93 | sleep 1 | ||
94 | $0 start $2 | ||
95 | ;; | ||
96 | *) | ||
97 | echo "Usage: $0 {start|stop|reload|restart|force-reload}" >&2 | ||
98 | exit 1 | ||
99 | ;; | ||
100 | esac | ||
101 | |||
102 | exit 0 | ||
103 | |||
104 | # vim:set ai et sts=2 sw=2 tw=0: | ||
diff --git a/meta-networking/recipes-support/openvpn/openvpn_2.1.3.bb b/meta-networking/recipes-support/openvpn/openvpn_2.1.3.bb new file mode 100644 index 0000000000..9ef0fbf0b5 --- /dev/null +++ b/meta-networking/recipes-support/openvpn/openvpn_2.1.3.bb | |||
@@ -0,0 +1,27 @@ | |||
1 | SUMMARY = "A full-featured SSL VPN solution via tun device" | ||
2 | HOMEPAGE = "http://openvpn.sourceforge.net" | ||
3 | SECTION = "console/network" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=5aac200199fde47501876cba7263cb0c" | ||
6 | DEPENDS = "lzo openssl" | ||
7 | |||
8 | inherit autotools | ||
9 | |||
10 | SRC_URI = "http://openvpn.net/release/openvpn-${PV}.tar.gz \ | ||
11 | file://openvpn" | ||
12 | |||
13 | SRC_URI[md5sum] = "7486d3e270ba4b033e311d3e022a0ad7" | ||
14 | SRC_URI[sha256sum] = "5185181df2e6043bd667377bc92e36ea5a5bd7600af209654f109b6403ca5b36" | ||
15 | |||
16 | CFLAGS += "-fno-inline" | ||
17 | |||
18 | # I want openvpn to be able to read password from file (hrw) | ||
19 | EXTRA_OECONF += "--enable-password-save" | ||
20 | |||
21 | do_install_append() { | ||
22 | install -d ${D}/${sysconfdir}/init.d | ||
23 | install -d ${D}/${sysconfdir}/openvpn | ||
24 | install -m 755 ${WORKDIR}/openvpn ${D}/${sysconfdir}/init.d | ||
25 | } | ||
26 | |||
27 | RRECOMMENDS_${PN} = "kernel-module-tun" | ||
diff --git a/meta-networking/recipes-support/strongswan/files/fix-funtion-parameter.patch b/meta-networking/recipes-support/strongswan/files/fix-funtion-parameter.patch new file mode 100644 index 0000000000..da96983e6d --- /dev/null +++ b/meta-networking/recipes-support/strongswan/files/fix-funtion-parameter.patch | |||
@@ -0,0 +1,98 @@ | |||
1 | fix the function parameter | ||
2 | |||
3 | Upstream-Status: pending | ||
4 | |||
5 | Original openssl_diffie_hellman_create has three parameters, but | ||
6 | it is reassigned a function pointer which has one parameter, and | ||
7 | is called with one parameter, which will lead to segment fault | ||
8 | on PPC, Now we simply correct the number of parameters. | ||
9 | |||
10 | #0 0x484d4aa0 in __GI_raise (sig=6) | ||
11 | at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 | ||
12 | #1 0x484d9930 in __GI_abort () at abort.c:91 | ||
13 | #2 0x10002064 in segv_handler (signal=11) at charon.c:224 | ||
14 | #3 <signal handler called> | ||
15 | #4 0x48d89630 in openssl_diffie_hellman_create (group=MODP_1024_BIT, g=..., | ||
16 | p=<error reading variable: Cannot access memory at address 0x0>) | ||
17 | at openssl_diffie_hellman.c:143 | ||
18 | #5 0x482c54f8 in create_dh (this=0x11ac6e68, group=MODP_1024_BIT) | ||
19 | at crypto/crypto_factory.c:358 | ||
20 | #6 0x48375884 in create_dh (this=<optimized out>, group=<optimized out>) | ||
21 | at sa/keymat.c:132 | ||
22 | #7 0x483843b8 in process_payloads (this=0x51400a78, message=<optimized | ||
23 | out>) | ||
24 | at sa/tasks/ike_init.c:200 | ||
25 | #8 0x483844d0 in process_r (this=0x51400a78, message=0x51500778) | ||
26 | at sa/tasks/ike_init.c:319 | ||
27 | #9 0x48374c9c in process_request (message=0x51500778, this=0x51400d20) | ||
28 | at sa/task_manager.c:870 | ||
29 | #10 process_message (this=0x51400d20, msg=0x51500778) at | ||
30 | sa/task_manager.c:925 | ||
31 | #11 0x4836c378 in process_message (this=0x514005f0, message=0x51500778) | ||
32 | at sa/ike_sa.c:1317 | ||
33 | #12 0x48362270 in execute (this=0x515008d0) | ||
34 | at processing/jobs/process_message_job.c:74 | ||
35 | |||
36 | Signed-off-by: Roy.Li <rongqing.li@windriver.com> | ||
37 | --- | ||
38 | src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c | 8 +++++++- | ||
39 | src/libstrongswan/plugins/openssl/openssl_diffie_hellman.h | 4 +++- | ||
40 | src/libstrongswan/plugins/openssl/openssl_plugin.c | 1 + | ||
41 | 3 files changed, 11 insertions(+), 2 deletions(-) | ||
42 | |||
43 | diff --git a/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c b/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c | ||
44 | index ff33824..bd21446 100644 | ||
45 | --- a/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c | ||
46 | +++ b/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.c | ||
47 | @@ -142,7 +142,7 @@ METHOD(diffie_hellman_t, destroy, void, | ||
48 | /* | ||
49 | * Described in header. | ||
50 | */ | ||
51 | -openssl_diffie_hellman_t *openssl_diffie_hellman_create( | ||
52 | +openssl_diffie_hellman_t *openssl_diffie_hellman_create_custom( | ||
53 | diffie_hellman_group_t group, chunk_t g, chunk_t p) | ||
54 | { | ||
55 | private_openssl_diffie_hellman_t *this; | ||
56 | @@ -197,5 +197,11 @@ openssl_diffie_hellman_t *openssl_diffie_hellman_create( | ||
57 | |||
58 | return &this->public; | ||
59 | } | ||
60 | +openssl_diffie_hellman_t *openssl_diffie_hellman_create( diffie_hellman_group_t group) | ||
61 | +{ | ||
62 | + chunk_t g; | ||
63 | + chunk_t p; | ||
64 | + openssl_diffie_hellman_create_custom(group, g, p); | ||
65 | +} | ||
66 | |||
67 | #endif /* OPENSSL_NO_DH */ | ||
68 | diff --git a/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.h b/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.h | ||
69 | index 53dc59c..eb69eaa 100644 | ||
70 | --- a/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.h | ||
71 | +++ b/src/libstrongswan/plugins/openssl/openssl_diffie_hellman.h | ||
72 | @@ -44,8 +44,10 @@ struct openssl_diffie_hellman_t { | ||
73 | * @param p custom prime, if MODP_CUSTOM | ||
74 | * @return openssl_diffie_hellman_t object, NULL if not supported | ||
75 | */ | ||
76 | -openssl_diffie_hellman_t *openssl_diffie_hellman_create( | ||
77 | +openssl_diffie_hellman_t *openssl_diffie_hellman_create_custom( | ||
78 | diffie_hellman_group_t group, chunk_t g, chunk_t p); | ||
79 | +openssl_diffie_hellman_t *openssl_diffie_hellman_create( | ||
80 | + diffie_hellman_group_t group); | ||
81 | |||
82 | #endif /** OPENSSL_DIFFIE_HELLMAN_H_ @}*/ | ||
83 | |||
84 | diff --git a/src/libstrongswan/plugins/openssl/openssl_plugin.c b/src/libstrongswan/plugins/openssl/openssl_plugin.c | ||
85 | index ff25086..c76873d 100644 | ||
86 | --- a/src/libstrongswan/plugins/openssl/openssl_plugin.c | ||
87 | +++ b/src/libstrongswan/plugins/openssl/openssl_plugin.c | ||
88 | @@ -388,6 +388,7 @@ METHOD(plugin_t, get_features, int, | ||
89 | PLUGIN_PROVIDE(DH, MODP_1024_BIT), | ||
90 | PLUGIN_PROVIDE(DH, MODP_1024_160), | ||
91 | PLUGIN_PROVIDE(DH, MODP_768_BIT), | ||
92 | + PLUGIN_REGISTER(DH, openssl_diffie_hellman_create_custom), | ||
93 | PLUGIN_PROVIDE(DH, MODP_CUSTOM), | ||
94 | #endif | ||
95 | #ifndef OPENSSL_NO_RSA | ||
96 | -- | ||
97 | 1.8.3 | ||
98 | |||
diff --git a/meta-networking/recipes-support/strongswan/strongswan_5.1.1.bb b/meta-networking/recipes-support/strongswan/strongswan_5.1.1.bb new file mode 100644 index 0000000000..a2a2333d63 --- /dev/null +++ b/meta-networking/recipes-support/strongswan/strongswan_5.1.1.bb | |||
@@ -0,0 +1,45 @@ | |||
1 | DESCRIPTION = "strongSwan is an OpenSource IPsec implementation for the \ | ||
2 | Linux operating system." | ||
3 | SUMMARY = "strongSwan is an OpenSource IPsec implementation" | ||
4 | HOMEPAGE = "http://www.strongswan.org" | ||
5 | SECTION = "console/network" | ||
6 | LICENSE = "GPLv2" | ||
7 | LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" | ||
8 | DEPENDS = "gmp openssl flex-native flex bison-native" | ||
9 | |||
10 | SRC_URI = "http://download.strongswan.org/strongswan-${PV}.tar.bz2 \ | ||
11 | file://fix-funtion-parameter.patch \ | ||
12 | " | ||
13 | |||
14 | SRC_URI[md5sum] = "e3af3d493d22286be3cd794533a8966a" | ||
15 | SRC_URI[sha256sum] = "fbf2a668221fc4a36a34bdeac2dfeda25b96f572d551df022585177953622406" | ||
16 | |||
17 | EXTRA_OECONF = "--enable-gmp \ | ||
18 | --enable-openssl \ | ||
19 | --without-lib-prefix \ | ||
20 | " | ||
21 | |||
22 | EXTRA_OECONF += "${@base_contains('DISTRO_FEATURES', 'systemd', '--with-systemdsystemunitdir=${systemd_unitdir}/system/', '--without-systemdsystemunitdir', d)}" | ||
23 | |||
24 | PACKAGECONFIG ??= "sqlite3 curl \ | ||
25 | ${@base_contains('DISTRO_FEATURES', 'ldap', 'ldap', '', d)} \ | ||
26 | " | ||
27 | PACKAGECONFIG[sqlite3] = "--enable-sqlite,--disable-sqlite,sqlite3," | ||
28 | PACKAGECONFIG[ldap] = "--enable-ldap,--disable-ldap,openldap," | ||
29 | PACKAGECONFIG[curl] = "--enable-curl,--disable-curl,curl," | ||
30 | PACKAGECONFIG[soup] = "--enable-soup,--disable-soup,libsoup-2.4," | ||
31 | PACKAGECONFIG[mysql] = "--enable-mysql,--disable-mysql,mysql5," | ||
32 | |||
33 | inherit autotools systemd | ||
34 | |||
35 | RRECOMMENDS_${PN} = "kernel-module-ipsec" | ||
36 | |||
37 | FILES_${PN} += "${libdir}/ipsec/lib*${SOLIBS} ${libdir}/ipsec/plugins/*.so" | ||
38 | FILES_${PN}-dbg += "${libdir}/ipsec/.debug ${libdir}/ipsec/plugins/.debug ${libexecdir}/ipsec/.debug" | ||
39 | FILES_${PN}-dev += "${libdir}/ipsec/lib*${SOLIBSDEV} ${libdir}/ipsec/*.la ${libdir}/ipsec/plugins/*.la" | ||
40 | FILES_${PN}-staticdev += "${libdir}/ipsec/*.a ${libdir}/ipsec/plugins/*.a" | ||
41 | |||
42 | RPROVIDES_${PN} += "${PN}-systemd" | ||
43 | RREPLACES_${PN} += "${PN}-systemd" | ||
44 | RCONFLICTS_${PN} += "${PN}-systemd" | ||
45 | SYSTEMD_SERVICE_${PN} = "${BPN}.service" | ||
diff --git a/meta-networking/recipes-support/stunnel/stunnel_4.56.bb b/meta-networking/recipes-support/stunnel/stunnel_4.56.bb new file mode 100644 index 0000000000..938f043a9d --- /dev/null +++ b/meta-networking/recipes-support/stunnel/stunnel_4.56.bb | |||
@@ -0,0 +1,15 @@ | |||
1 | SUMMARY = "Program for providing universal TLS/SSL tunneling service" | ||
2 | DESCRIPTION = "SSL encryption wrapper between remote client and local (inetd-startable) or remote server." | ||
3 | SECTION = "net" | ||
4 | LICENSE = "GPLv2" | ||
5 | LIC_FILES_CHKSUM = "file://COPYING;md5=f41ebed8571077706fee0b860c4d6666" | ||
6 | DEPENDS = "openssl" | ||
7 | |||
8 | SRC_URI = "https://www.stunnel.org/downloads/archive/4.x/${BP}.tar.gz" | ||
9 | |||
10 | SRC_URI[md5sum] = "ac4c4a30bd7a55b6687cbd62d864054c" | ||
11 | SRC_URI[sha256sum] = "9cae2cfbe26d87443398ce50d7d5db54e5ea363889d5d2ec8d2778a01c871293" | ||
12 | |||
13 | inherit autotools | ||
14 | |||
15 | EXTRA_OECONF += "--with-ssl='${STAGING_EXECPREFIXDIR}' --disable-fips" | ||
diff --git a/meta-networking/recipes-support/tcpdump/tcpdump-4.3.0/0001-minimal-IEEE802.15.4-allowed.patch b/meta-networking/recipes-support/tcpdump/tcpdump-4.3.0/0001-minimal-IEEE802.15.4-allowed.patch new file mode 100644 index 0000000000..9d3d60d4d7 --- /dev/null +++ b/meta-networking/recipes-support/tcpdump/tcpdump-4.3.0/0001-minimal-IEEE802.15.4-allowed.patch | |||
@@ -0,0 +1,22 @@ | |||
1 | From: Sergey Lapin <slapin@slind.org> | ||
2 | Date: Wed, 28 Jan 2009 16:34:15 +0300 | ||
3 | Subject: [PATCH] minimal IEEE802.15.4 allowed | ||
4 | |||
5 | --- | ||
6 | tcpdump.c | 3 +++ | ||
7 | 1 files changed, 3 insertions(+), 0 deletions(-) | ||
8 | |||
9 | diff --git a/tcpdump.c b/tcpdump.c | ||
10 | index 06683af..fbc944c 100644 | ||
11 | --- a/tcpdump.c | ||
12 | +++ b/tcpdump.c | ||
13 | @@ -282,6 +282,9 @@ static struct printer printers[] = { | ||
14 | #ifdef DLT_MFR | ||
15 | { mfr_if_print, DLT_MFR }, | ||
16 | #endif | ||
17 | +#ifdef DLT_IEEE802_15_4 | ||
18 | + { raw_if_print, DLT_IEEE802_15_4 }, | ||
19 | +#endif | ||
20 | #if defined(DLT_BLUETOOTH_HCI_H4_WITH_PHDR) && defined(HAVE_PCAP_BLUETOOTH_H) | ||
21 | { bt_if_print, DLT_BLUETOOTH_HCI_H4_WITH_PHDR}, | ||
22 | #endif | ||
diff --git a/meta-networking/recipes-support/tcpdump/tcpdump-4.3.0/configure.patch b/meta-networking/recipes-support/tcpdump/tcpdump-4.3.0/configure.patch new file mode 100644 index 0000000000..3697420fd3 --- /dev/null +++ b/meta-networking/recipes-support/tcpdump/tcpdump-4.3.0/configure.patch | |||
@@ -0,0 +1,29 @@ | |||
1 | --- | ||
2 | aclocal.m4 | 1 - | ||
3 | configure.in | 1 + | ||
4 | 2 files changed, 1 insertions(+), 1 deletions(-) | ||
5 | |||
6 | diff --git a/aclocal.m4 b/aclocal.m4 | ||
7 | index 40b5866..0c662b0 100644 | ||
8 | --- a/aclocal.m4 | ||
9 | +++ b/aclocal.m4 | ||
10 | @@ -40,7 +40,6 @@ dnl | ||
11 | AC_DEFUN(AC_LBL_C_INIT_BEFORE_CC, | ||
12 | [AC_PREREQ(2.50) | ||
13 | AC_BEFORE([$0], [AC_LBL_C_INIT]) | ||
14 | - AC_BEFORE([$0], [AC_PROG_CC]) | ||
15 | AC_BEFORE([$0], [AC_LBL_FIXINCLUDES]) | ||
16 | AC_BEFORE([$0], [AC_LBL_DEVEL]) | ||
17 | AC_ARG_WITH(gcc, [ --without-gcc don't use gcc]) | ||
18 | diff --git a/configure.in b/configure.in | ||
19 | index 11257c9..7f9591c 100644 | ||
20 | --- a/configure.in | ||
21 | +++ b/configure.in | ||
22 | @@ -19,6 +19,7 @@ AC_REVISION($Revision: 1.204 $) | ||
23 | AC_PREREQ(2.50) | ||
24 | AC_INIT(tcpdump.c) | ||
25 | |||
26 | +AC_PROG_CC | ||
27 | AC_CANONICAL_HOST | ||
28 | |||
29 | AC_LBL_C_INIT_BEFORE_CC(V_CCOPT, V_INCLS) | ||
diff --git a/meta-networking/recipes-support/tcpdump/tcpdump-4.3.0/ipv6-cross.patch b/meta-networking/recipes-support/tcpdump/tcpdump-4.3.0/ipv6-cross.patch new file mode 100644 index 0000000000..7eba2c5a6d --- /dev/null +++ b/meta-networking/recipes-support/tcpdump/tcpdump-4.3.0/ipv6-cross.patch | |||
@@ -0,0 +1,41 @@ | |||
1 | --- | ||
2 | configure.in | 12 ++++++++---- | ||
3 | 1 files changed, 8 insertions(+), 4 deletions(-) | ||
4 | |||
5 | diff --git a/configure.in b/configure.in | ||
6 | index eb3e5e8..11257c9 100644 | ||
7 | --- a/configure.in | ||
8 | +++ b/configure.in | ||
9 | @@ -181,8 +181,9 @@ yes) AC_MSG_RESULT(yes) | ||
10 | ipv6=no | ||
11 | ;; | ||
12 | esac ], | ||
13 | - | ||
14 | - AC_TRY_RUN([ /* AF_INET6 available check */ | ||
15 | +[ | ||
16 | + if test x"$cross_compiling" != "xyes"; then | ||
17 | + AC_TRY_RUN([ /* AF_INET6 avalable check */ | ||
18 | #include <sys/types.h> | ||
19 | #include <sys/socket.h> | ||
20 | main() | ||
21 | @@ -201,7 +202,10 @@ main() | ||
22 | ipv6=no], | ||
23 | [ AC_MSG_RESULT(no) | ||
24 | ipv6=no] | ||
25 | -)) | ||
26 | + ) | ||
27 | +else | ||
28 | + AC_MSG_FAILURE([Unable to check for ipv6 when crosscompiling, please specify.]) | ||
29 | +fi]) | ||
30 | |||
31 | ipv6type=unknown | ||
32 | ipv6lib=none | ||
33 | @@ -316,7 +320,7 @@ if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then | ||
34 | fi | ||
35 | |||
36 | |||
37 | -if test "$ipv6" = "yes"; then | ||
38 | +if test x"$cross_compiling" != "xyes" -a "$ipv6" = "yes"; then | ||
39 | # | ||
40 | # XXX - on Tru64 UNIX 5.1, there is no "getaddrinfo()" | ||
41 | # function in libc; there are "ngetaddrinfo()" and | ||
diff --git a/meta-networking/recipes-support/tcpdump/tcpdump-4.3.0/tcpdump_configure_no_-O2.patch b/meta-networking/recipes-support/tcpdump/tcpdump-4.3.0/tcpdump_configure_no_-O2.patch new file mode 100644 index 0000000000..7929da5b1f --- /dev/null +++ b/meta-networking/recipes-support/tcpdump/tcpdump-4.3.0/tcpdump_configure_no_-O2.patch | |||
@@ -0,0 +1,42 @@ | |||
1 | --- | ||
2 | configure | 8 ++++---- | ||
3 | 1 files changed, 4 insertions(+), 4 deletions(-) | ||
4 | |||
5 | diff --git a/configure b/configure | ||
6 | index cb51d19..73d51af 100755 | ||
7 | --- a/configure | ||
8 | +++ b/configure | ||
9 | @@ -2691,13 +2691,13 @@ if test "$ac_test_CFLAGS" = set; then | ||
10 | CFLAGS=$ac_save_CFLAGS | ||
11 | elif test $ac_cv_prog_cc_g = yes; then | ||
12 | if test "$GCC" = yes; then | ||
13 | - CFLAGS="-g -O2" | ||
14 | + CFLAGS="-g" | ||
15 | else | ||
16 | CFLAGS="-g" | ||
17 | fi | ||
18 | else | ||
19 | if test "$GCC" = yes; then | ||
20 | - CFLAGS="-O2" | ||
21 | + CFLAGS="" | ||
22 | else | ||
23 | CFLAGS= | ||
24 | fi | ||
25 | @@ -2830,7 +2830,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu | ||
26 | if test "$GCC" = yes ; then | ||
27 | if test "$SHLICC2" = yes ; then | ||
28 | ac_cv_lbl_gcc_vers=2 | ||
29 | - V_CCOPT="-O2" | ||
30 | + V_CCOPT="" | ||
31 | else | ||
32 | { echo "$as_me:$LINENO: checking gcc version" >&5 | ||
33 | echo $ECHO_N "checking gcc version... $ECHO_C" >&6; } | ||
34 | @@ -2847,7 +2847,7 @@ fi | ||
35 | { echo "$as_me:$LINENO: result: $ac_cv_lbl_gcc_vers" >&5 | ||
36 | echo "${ECHO_T}$ac_cv_lbl_gcc_vers" >&6; } | ||
37 | if test $ac_cv_lbl_gcc_vers -gt 1 ; then | ||
38 | - V_CCOPT="-O2" | ||
39 | + V_CCOPT="" | ||
40 | fi | ||
41 | fi | ||
42 | else | ||
diff --git a/meta-networking/recipes-support/tcpdump/tcpdump_4.3.0.bb b/meta-networking/recipes-support/tcpdump/tcpdump_4.3.0.bb new file mode 100644 index 0000000000..0d88990abf --- /dev/null +++ b/meta-networking/recipes-support/tcpdump/tcpdump_4.3.0.bb | |||
@@ -0,0 +1,43 @@ | |||
1 | SUMMARY = "A sophisticated network protocol analyzer" | ||
2 | HOMEPAGE = "http://www.tcpdump.org/" | ||
3 | LICENSE = "BSD" | ||
4 | LIC_FILES_CHKSUM = "file://LICENSE;md5=1d4b0366557951c84a94fabe3529f867" | ||
5 | SECTION = "console/network" | ||
6 | DEPENDS = "libpcap" | ||
7 | |||
8 | SRC_URI = " \ | ||
9 | http://www.tcpdump.org/release/tcpdump-${PV}.tar.gz \ | ||
10 | file://tcpdump_configure_no_-O2.patch \ | ||
11 | file://0001-minimal-IEEE802.15.4-allowed.patch \ | ||
12 | file://ipv6-cross.patch \ | ||
13 | file://configure.patch \ | ||
14 | " | ||
15 | SRC_URI[md5sum] = "a3fe4d30ac85ff5467c889ff46b7e1e8" | ||
16 | SRC_URI[sha256sum] = "efd08b610210d39977ec3175fa82dad9fbd33587930081be2a905a712dba4286" | ||
17 | |||
18 | inherit autotools-brokensep | ||
19 | CACHED_CONFIGUREVARS = "ac_cv_linux_vers=${ac_cv_linux_vers=2}" | ||
20 | |||
21 | EXTRA_OECONF = "--without-crypto \ | ||
22 | ${@base_contains('DISTRO_FEATURES', 'ipv6', '--enable-ipv6', '--disable-ipv6', d)}" | ||
23 | |||
24 | EXTRA_AUTORECONF += " -I m4" | ||
25 | |||
26 | do_configure_prepend() { | ||
27 | mkdir -p ${S}/m4 | ||
28 | if [ -f aclocal.m4 ]; then | ||
29 | mv aclocal.m4 ${S}/m4 | ||
30 | fi | ||
31 | # AC_CHECK_LIB(dlpi.. was looking to host /lib | ||
32 | sed -i 's:-L/lib::g' ./configure.in | ||
33 | } | ||
34 | do_configure_append() { | ||
35 | sed -i 's:-L/usr/lib::' ./Makefile | ||
36 | sed -i 's:-Wl,-rpath,${STAGING_LIBDIR}::' ./Makefile | ||
37 | sed -i 's:-I/usr/include::' ./Makefile | ||
38 | } | ||
39 | |||
40 | do_install_append() { | ||
41 | # tcpdump 4.0.0 installs a copy to /usr/sbin/tcpdump.4.0.0 | ||
42 | rm -f ${D}${sbindir}/tcpdump.${PV} | ||
43 | } | ||
diff --git a/meta-networking/recipes-support/tcpreplay/files/tcpreplay-3.4.4-cross-compile.patch b/meta-networking/recipes-support/tcpreplay/files/tcpreplay-3.4.4-cross-compile.patch new file mode 100755 index 0000000000..a856b1809a --- /dev/null +++ b/meta-networking/recipes-support/tcpreplay/files/tcpreplay-3.4.4-cross-compile.patch | |||
@@ -0,0 +1,92 @@ | |||
1 | Uptream-Status: Pending | ||
2 | |||
3 | Signed-off-by: Zongchun Yu <Zongchun.Yu@freescale.com> | ||
4 | |||
5 | --- a/configure.ac | ||
6 | +++ b/configure.ac | ||
7 | @@ -402,7 +402,6 @@ | ||
8 | |||
9 | dnl 0.9.6 (which is still thinks it is 0.9.5 due to a bug) introduces an important | ||
10 | dnl fix for OSX. See: http://tcpreplay.synfin.net/trac/ticket/167 | ||
11 | -libpcap_version_096=no | ||
12 | AC_RUN_IFELSE(AC_LANG_PROGRAM([[ | ||
13 | #include <string.h> | ||
14 | #include <stdlib.h> | ||
15 | @@ -419,11 +418,12 @@ | ||
16 | exit(0); | ||
17 | |||
18 | exit(1); | ||
19 | -]]), [ | ||
20 | - libpcap_version_096=yes | ||
21 | -]) | ||
22 | +]]), | ||
23 | + [libpcap_version_096=yes], | ||
24 | + [libpcap_version_096=no], | ||
25 | + [libpcap_version_096=yes] | ||
26 | +) | ||
27 | |||
28 | -libpcap_ver8=no | ||
29 | AC_RUN_IFELSE(AC_LANG_PROGRAM([[ | ||
30 | #include <string.h> | ||
31 | #include <stdlib.h> | ||
32 | @@ -444,13 +444,12 @@ | ||
33 | exit(0); | ||
34 | |||
35 | exit(1); | ||
36 | -]]), [ | ||
37 | - libpcap_ver8=yes | ||
38 | -], [ | ||
39 | - libpcap_ver8=no | ||
40 | -]) | ||
41 | +]]), | ||
42 | + [libpcap_ver8=yes], | ||
43 | + [libpcap_ver8=no], | ||
44 | + [libpcap_ver8=yes] | ||
45 | +) | ||
46 | |||
47 | -libpcap_ver7=no | ||
48 | AC_RUN_IFELSE(AC_LANG_PROGRAM([[ | ||
49 | #include <string.h> | ||
50 | #include <stdlib.h> | ||
51 | @@ -469,11 +468,11 @@ | ||
52 | exit(0); | ||
53 | |||
54 | exit(1); | ||
55 | -]]), [ | ||
56 | - libpcap_ver7=yes | ||
57 | -], [ | ||
58 | - libpcap_ver7=no | ||
59 | -]) | ||
60 | +]]), | ||
61 | + [libpcap_ver7=yes], | ||
62 | + [libpcap_ver7=no], | ||
63 | + [libpcap_ver7=yes] | ||
64 | +) | ||
65 | |||
66 | if test x$libpcap_ver8 = xyes ; then | ||
67 | AC_MSG_RESULT(>= 0.8.0) | ||
68 | @@ -761,8 +760,8 @@ | ||
69 | |||
70 | have_bpf=no | ||
71 | dnl Check for BSD's BPF | ||
72 | -AC_MSG_CHECKING(for BPF device sending support) | ||
73 | -AC_TRY_RUN([ | ||
74 | +AC_CACHE_CHECK([for BPF device sending support], ac_cv_have_bpf, | ||
75 | +[AC_TRY_RUN([ | ||
76 | #include <stdio.h> | ||
77 | #include <stdlib.h> | ||
78 | #include <sys/types.h> | ||
79 | @@ -796,8 +795,11 @@ | ||
80 | [Do we have BPF device support?]) | ||
81 | AC_MSG_RESULT(yes) | ||
82 | have_bpf=yes | ||
83 | -],[ | ||
84 | - AC_MSG_RESULT(no) | ||
85 | +], | ||
86 | +[AC_MSG_RESULT(no)], | ||
87 | +[AC_MSG_ERROR([cross-compiling, | ||
88 | + presetting ac_cv_have_bpf=(yes|no) will help])] | ||
89 | +) | ||
90 | ]) | ||
91 | |||
92 | |||
diff --git a/meta-networking/recipes-support/tcpreplay/files/tcpreplay-3.4.4-fix-unable-to-link-libpcap-issue.patch b/meta-networking/recipes-support/tcpreplay/files/tcpreplay-3.4.4-fix-unable-to-link-libpcap-issue.patch new file mode 100644 index 0000000000..5f36c68c9b --- /dev/null +++ b/meta-networking/recipes-support/tcpreplay/files/tcpreplay-3.4.4-fix-unable-to-link-libpcap-issue.patch | |||
@@ -0,0 +1,17 @@ | |||
1 | Uptream-Status: Pending | ||
2 | |||
3 | Signed-off-by: Zongchun Yu <Zongchun.Yu@freescale.com> | ||
4 | |||
5 | Index: tcpreplay-3.4.4/configure.ac | ||
6 | =================================================================== | ||
7 | --- tcpreplay-3.4.4.orig/configure.ac | ||
8 | +++ tcpreplay-3.4.4/configure.ac | ||
9 | @@ -389,7 +389,7 @@ CFLAGS="$CFLAGS -I$LPCAPINCDIR" | ||
10 | AC_SEARCH_LIBS([pcap_close], [pcap], | ||
11 | LPCAPLIB="$LIBS", | ||
12 | AC_ERROR([Unable to link libpcap in ${foundpcap}]), | ||
13 | - -lnl) | ||
14 | + -lnl-3) | ||
15 | |||
16 | AC_SUBST(LPCAPINC) | ||
17 | AC_SUBST(LPCAPLIB) | ||
diff --git a/meta-networking/recipes-support/tcpreplay/files/tcpreplay-3.4.4-no-bfp-support.patch b/meta-networking/recipes-support/tcpreplay/files/tcpreplay-3.4.4-no-bfp-support.patch new file mode 100644 index 0000000000..3c11c922bd --- /dev/null +++ b/meta-networking/recipes-support/tcpreplay/files/tcpreplay-3.4.4-no-bfp-support.patch | |||
@@ -0,0 +1,15 @@ | |||
1 | Uptream-Status: Pending | ||
2 | |||
3 | Signed-off-by: Zongchun Yu <Zongchun.Yu@freescale.com> | ||
4 | |||
5 | --- a/configure.ac | ||
6 | +++ b/configure.ac | ||
7 | @@ -758,6 +758,8 @@ | ||
8 | AC_MSG_RESULT(no) | ||
9 | ]) | ||
10 | |||
11 | +ac_cv_have_bpf=no | ||
12 | + | ||
13 | have_bpf=no | ||
14 | dnl Check for BSD's BPF | ||
15 | AC_CACHE_CHECK([for BPF device sending support], ac_cv_have_bpf, | ||
diff --git a/meta-networking/recipes-support/tcpreplay/tcpreplay_3.4.4.bb b/meta-networking/recipes-support/tcpreplay/tcpreplay_3.4.4.bb new file mode 100644 index 0000000000..d211888826 --- /dev/null +++ b/meta-networking/recipes-support/tcpreplay/tcpreplay_3.4.4.bb | |||
@@ -0,0 +1,22 @@ | |||
1 | SUMMARY = "Use previously captured traffic to test network devices" | ||
2 | |||
3 | HOMEPAGE = "http://tcpreplay.synfin.net/" | ||
4 | SECTION = "console/network" | ||
5 | |||
6 | LICENSE = "GPLv3" | ||
7 | LIC_FILES_CHKSUM = "file://docs/LICENSE;md5=c33cccf72cc1603e8a72a84811ae3ac8" | ||
8 | |||
9 | SRC_URI = "http://prdownloads.sourceforge.net/tcpreplay/${PV}/tcpreplay-${PV}.tar.gz \ | ||
10 | file://tcpreplay-3.4.4-cross-compile.patch \ | ||
11 | file://tcpreplay-3.4.4-no-bfp-support.patch \ | ||
12 | file://tcpreplay-3.4.4-fix-unable-to-link-libpcap-issue.patch \ | ||
13 | " | ||
14 | SRC_URI[md5sum] = "22725feb9b2590809f9350308ec65180" | ||
15 | SRC_URI[sha256sum] = "7a809c58ddec86407fd6e5597ac883d7874a19bea81d716bb2b1c6e3b0e7b58f" | ||
16 | |||
17 | DEPENDS = "libpcap" | ||
18 | |||
19 | EXTRA_OECONF += "--with-libpcap=${STAGING_DIR_HOST}/usr" | ||
20 | |||
21 | inherit siteinfo autotools | ||
22 | |||
diff --git a/meta-networking/recipes-support/traceroute/traceroute/filter-out-the-patches-from-subdirs.patch b/meta-networking/recipes-support/traceroute/traceroute/filter-out-the-patches-from-subdirs.patch new file mode 100644 index 0000000000..2c030b55dd --- /dev/null +++ b/meta-networking/recipes-support/traceroute/traceroute/filter-out-the-patches-from-subdirs.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From e273e0ebc753645555909bcc4874c72458b17891 Mon Sep 17 00:00:00 2001 | ||
2 | From: Robert Yang <liezhi.yang@windriver.com> | ||
3 | Date: Fri, 17 Jan 2014 03:17:44 -0500 | ||
4 | Subject: [PATCH] Make.rules: filter-out the patches from subdirs | ||
5 | |||
6 | The $(subdirs) contains all the dirs under the ${B}, and this one: | ||
7 | |||
8 | do_unpack[cleandirs] = "${S}/patches" | ||
9 | |||
10 | will create a "patches" dir, then there will be compile errors, filter | ||
11 | out the patches will fix the problem. | ||
12 | |||
13 | Note: poky doesn't have this problem since it separates the ${S} and | ||
14 | ${B} | ||
15 | |||
16 | Upstream-Status: Inappropriate [OE specific] | ||
17 | |||
18 | Signed-off-by: Robert Yang <liezhi.yang@windriver.com> | ||
19 | --- | ||
20 | Make.rules | 4 ++-- | ||
21 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
22 | |||
23 | diff --git a/Make.rules b/Make.rules | ||
24 | index b077cd5..0bfce2d 100644 | ||
25 | --- a/Make.rules | ||
26 | +++ b/Make.rules | ||
27 | @@ -97,7 +97,7 @@ endif | ||
28 | subdirs := $(filter-out $(SKIPDIRS), $(subdirs)) | ||
29 | endif | ||
30 | |||
31 | -install install-%: subdirs := $(filter-out $(SKIPINSTALL), $(subdirs)) | ||
32 | +install install-%: subdirs := $(filter-out $(SKIPINSTALL) patches, $(subdirs)) | ||
33 | |||
34 | |||
35 | override MAKE += srcdir=$(srcdir) subdirs="$(subdirs)" shared=$(shared) | ||
36 | @@ -106,7 +106,7 @@ override MAKE += srcdir=$(srcdir) subdirs="$(subdirs)" shared=$(shared) | ||
37 | INCLUDEDIRS := $(filter $(INCLUDEDIRS), $(subdirs)) | ||
38 | LIBDIRS := $(filter $(LIBDIRS), $(subdirs)) | ||
39 | MODDIRS := $(filter $(MODDIRS), $(subdirs)) | ||
40 | -EXEDIRS := $(filter-out $(INCLUDEDIRS) $(LIBDIRS) $(MODDIRS), $(subdirs)) | ||
41 | +EXEDIRS := $(filter-out $(INCLUDEDIRS) $(LIBDIRS) $(MODDIRS) patches, $(subdirs)) | ||
42 | MODUSERS := $(filter $(MODUSERS), $(subdirs)) | ||
43 | SBINUSERS := $(filter $(SBINUSERS), $(subdirs)) | ||
44 | |||
45 | -- | ||
46 | 1.7.10.4 | ||
47 | |||
diff --git a/meta-networking/recipes-support/traceroute/traceroute_2.0.18.bb b/meta-networking/recipes-support/traceroute/traceroute_2.0.18.bb new file mode 100644 index 0000000000..236bd12c30 --- /dev/null +++ b/meta-networking/recipes-support/traceroute/traceroute_2.0.18.bb | |||
@@ -0,0 +1,44 @@ | |||
1 | SUMMARY = "A new modern implementation of traceroute(8) utility for Linux systems" | ||
2 | DESCRIPTION = "The traceroute utility displays the route used by IP packets on \ | ||
3 | their way to a specified network (or Internet) host. Traceroute displays \ | ||
4 | the IP number and host name (if possible) of the machines along the \ | ||
5 | route taken by the packets. Traceroute is used as a network debugging \ | ||
6 | tool. If you're having network connectivity problems, traceroute will \ | ||
7 | show you where the trouble is coming from along the route." | ||
8 | SECTION = "console/network" | ||
9 | HOMEPAGE = "http://traceroute.sourceforge.net/" | ||
10 | LICENSE = "GPL-2.0 LGPL-2.1" | ||
11 | LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \ | ||
12 | file://COPYING.LIB;md5=bbb461211a33b134d42ed5ee802b37ff" | ||
13 | |||
14 | PR = "r1" | ||
15 | |||
16 | inherit update-alternatives | ||
17 | |||
18 | SRC_URI = "${SOURCEFORGE_MIRROR}/traceroute/traceroute/traceroute-2.0.18/traceroute-2.0.18.tar.gz \ | ||
19 | file://filter-out-the-patches-from-subdirs.patch \ | ||
20 | " | ||
21 | |||
22 | SRC_URI[md5sum] = "b7254149b7f081cce07f4b9e065ba5ef" | ||
23 | SRC_URI[sha256sum] = "5994a88520927fefe3c9754aaf1e02b4d0f3f8fb1f521a68fa86215c3fcab9ef" | ||
24 | |||
25 | do_compile() { | ||
26 | export LDFLAGS="${TARGET_LDFLAGS} -L${S}/libsupp" | ||
27 | oe_runmake "env=yes" | ||
28 | } | ||
29 | |||
30 | do_install() { | ||
31 | install -d ${D}${bindir} | ||
32 | install -m755 ${BPN}/${BPN} ${D}${bindir} | ||
33 | |||
34 | install -m755 wrappers/tcptraceroute ${D}${bindir} | ||
35 | |||
36 | install -d ${D}${mandir} | ||
37 | install -p -m644 ${BPN}/${BPN}.8 ${D}${mandir} | ||
38 | ln -s ${BPN}.8 ${D}${mandir}/${BPN}6.8 | ||
39 | ln -s ${BPN}.8 ${D}${mandir}/tcptraceroute.8 | ||
40 | |||
41 | } | ||
42 | |||
43 | ALTERNATIVE_${PN} = "traceroute" | ||
44 | ALTERNATIVE_LINK_NAME[traceroute] = "${bindir}/traceroute" | ||
diff --git a/meta-networking/recipes-support/tunctl/tunctl.inc b/meta-networking/recipes-support/tunctl/tunctl.inc new file mode 100644 index 0000000000..e95cfa523d --- /dev/null +++ b/meta-networking/recipes-support/tunctl/tunctl.inc | |||
@@ -0,0 +1,15 @@ | |||
1 | SUMMARY = "Tool for controlling the Linux TUN/TAP driver" | ||
2 | SECTION = "net" | ||
3 | LICENSE = "GPLv2" | ||
4 | LIC_FILES_CHKSUM = "file://tunctl.c;beginline=1;endline=4;md5=ff3a09996bc5fff6bc5d4e0b4c28f999" | ||
5 | |||
6 | SRC_URI = "${SOURCEFORGE_MIRROR}/tunctl/tunctl-${PV}.tar.gz" | ||
7 | |||
8 | do_compile() { | ||
9 | oe_runmake tunctl | ||
10 | } | ||
11 | |||
12 | do_install() { | ||
13 | install -d ${D}/${sbindir} | ||
14 | install -m 755 tunctl ${D}/${sbindir} | ||
15 | } | ||
diff --git a/meta-networking/recipes-support/tunctl/tunctl_1.5.bb b/meta-networking/recipes-support/tunctl/tunctl_1.5.bb new file mode 100644 index 0000000000..dd265612f3 --- /dev/null +++ b/meta-networking/recipes-support/tunctl/tunctl_1.5.bb | |||
@@ -0,0 +1,4 @@ | |||
1 | require tunctl.inc | ||
2 | |||
3 | SRC_URI[md5sum] = "fdbedc263b3e85bb0e087cd567414607" | ||
4 | SRC_URI[sha256sum] = "aa2a6c4cc6bfacb11e0d9f62334a6638a0d435475c61230116f00b6af8b14fff" | ||