summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-connectivity
diff options
context:
space:
mode:
authorZhenhua Luo <b19537@freescale.com>2011-12-21 06:01:40 +0000
committerKoen Kooi <koen@dominion.thruhere.net>2011-12-22 08:49:16 +0100
commit8b08e151645d19d2940b6f83c7626087f4ac874f (patch)
treebe2e1eca239868bb7860e565301a424363a37f84 /meta-oe/recipes-connectivity
parent7fa09da36cf9711f9fcfee04380682b9abc526fa (diff)
downloadmeta-openembedded-8b08e151645d19d2940b6f83c7626087f4ac874f.tar.gz
ietutils: add version 1.0
The GNU inetutils are a collection of common networking utilities and servers including ftp, ftpd, rcp, rexec, rlogin, rlogind, rsh, rshd, syslog, syslogd, talk, talkd, telnet, telnetd, tftp, tftpd, and uucpd. Signed-off-by: Zhenhua Luo <b19537@freescale.com> Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
Diffstat (limited to 'meta-oe/recipes-connectivity')
-rw-r--r--meta-oe/recipes-connectivity/inetutils/inetutils-1.8/fix-disable-ipv6.patch58
-rw-r--r--meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch27
-rw-r--r--meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-0002-argp-fix-program_invocation_name-detection.patch51
-rw-r--r--meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-0003-wchar.patch12
-rw-r--r--meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-1001-ftp-rename-ruserpass-to-avoid-C-library-collision.patch58
-rw-r--r--meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-1002-rshd-detect-__rcmd_errstr-support-in-the-C-lib.patch57
-rw-r--r--meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-1003-use-daemon-from-the-C-library-when-possible.patch42
-rw-r--r--meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-1004-detect-fork-support.patch54
-rw-r--r--meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-1005-ftpd-add-daemon-D-nommu-support.patch109
-rw-r--r--meta-oe/recipes-connectivity/inetutils/inetutils_1.8.bb65
10 files changed, 533 insertions, 0 deletions
diff --git a/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/fix-disable-ipv6.patch b/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/fix-disable-ipv6.patch
new file mode 100644
index 000000000..75d51a1b0
--- /dev/null
+++ b/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/fix-disable-ipv6.patch
@@ -0,0 +1,58 @@
1Upstream: http://www.mail-archive.com/bug-inetutils@gnu.org/msg02103.html
2
3diff -ur inetutils-1.8.orig/ping/ping_common.h inetutils-1.8/ping/ping_common.h
4--- inetutils-1.8.orig/ping/ping_common.h 2010-05-15 20:55:47.000000000 +0930
5+++ inetutils-1.8/ping/ping_common.h 2010-12-01 12:19:08.000000000 +1030
6@@ -17,10 +17,14 @@
7 You should have received a copy of the GNU General Public License
8 along with this program. If not, see `http://www.gnu.org/licenses/'. */
9
10+#include <config.h>
11+
12 #include <netinet/in_systm.h>
13 #include <netinet/in.h>
14 #include <netinet/ip.h>
15+#ifdef HAVE_IPV6
16 #include <netinet/icmp6.h>
17+#endif
18 #include <icmp.h>
19 #include <error.h>
20 #include <progname.h>
21@@ -66,13 +70,19 @@
22 (t).tv_usec = ((i)%PING_PRECISION)*(1000000/PING_PRECISION) ;\
23 } while (0)
24
25+#ifdef HAVE_IPV6
26 /* Not sure about this step*/
27 #define _PING_BUFLEN(p, USE_IPV6) ((USE_IPV6)? ((p)->ping_datalen + sizeof (struct icmp6_hdr)) : \
28 ((p)->ping_datalen + sizeof (icmphdr_t)))
29+#else
30+#define _PING_BUFLEN(p, USE_IPV6) ((p)->ping_datalen + sizeof (icmphdr_t))
31+#endif
32
33+#ifdef HAVE_IPV6
34 typedef int (*ping_efp6) (int code, void *closure, struct sockaddr_in6 * dest,
35 struct sockaddr_in6 * from, struct icmp6_hdr * icmp,
36 int datalen);
37+#endif
38
39 typedef int (*ping_efp) (int code,
40 void *closure,
41@@ -81,13 +91,17 @@
42 struct ip * ip, icmphdr_t * icmp, int datalen);
43
44 union event {
45+#ifdef HAVE_IPV6
46 ping_efp6 handler6;
47+#endif
48 ping_efp handler;
49 };
50
51 union ping_address {
52 struct sockaddr_in ping_sockaddr;
53+#ifdef HAVE_IPV6
54 struct sockaddr_in6 ping_sockaddr6;
55+#endif
56 };
57
58 typedef struct ping_data PING;
diff --git a/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch b/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch
new file mode 100644
index 000000000..d328f1336
--- /dev/null
+++ b/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch
@@ -0,0 +1,27 @@
1From 552a7d64ad4a7188a9b7cd89933ae7caf7ebfe90 Mon Sep 17 00:00:00 2001
2From: Mike Frysinger <vapier at gentoo.org>
3Date: Thu, 18 Nov 2010 16:59:14 -0500
4Subject: [PATCH gnulib] printf-parse: pull in features.h for __GLIBC__
5
6Signed-off-by: Mike Frysinger <vapier at gentoo.org>
7---
8 lib/printf-parse.h | 3 +++
9 1 files changed, 3 insertions(+), 0 deletions(-)
10
11diff --git a/lib/printf-parse.h b/lib/printf-parse.h
12index 67a4a2a..3bd6152 100644
13--- a/lib/printf-parse.h
14+++ b/lib/printf-parse.h
15@@ -25,6 +25,9 @@
16
17 #include "printf-args.h"
18
19+#ifdef HAVE_FEATURES_H
20+# include <features.h> /* for __GLIBC__ */
21+#endif
22
23 /* Flags */
24 #define FLAG_GROUP 1 /* ' flag */
25--
261.7.3.2
27
diff --git a/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-0002-argp-fix-program_invocation_name-detection.patch b/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-0002-argp-fix-program_invocation_name-detection.patch
new file mode 100644
index 000000000..6861f2110
--- /dev/null
+++ b/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-0002-argp-fix-program_invocation_name-detection.patch
@@ -0,0 +1,51 @@
1From 93dbd3319232613ff8f5f3f08bf5f57b21980ef1 Mon Sep 17 00:00:00 2001
2From: Mike Frysinger <vapier at gentoo.org>
3Date: Thu, 18 Nov 2010 17:14:21 -0500
4Subject: [PATCH gnulib] argp: fix program_invocation_name detection
5
6The current program_invocation_name symbol detection fails if the argp.h
7header is missing. So check for the header first before detecting if the
8symbol exists.
9
10Signed-off-by: Mike Frysinger <vapier at gentoo.org>
11---
12 m4/argp.m4 | 15 +++++++++++++--
13 1 files changed, 13 insertions(+), 2 deletions(-)
14
15diff --git a/m4/argp.m4 b/m4/argp.m4
16index d3ca5ba..efa562c 100644
17--- a/m4/argp.m4
18+++ b/m4/argp.m4
19@@ -31,8 +31,14 @@ AC_DEFUN([gl_ARGP],
20 # are defined elsewhere. It is improbable that only one of them will
21 # be defined and other not, I prefer to stay on the safe side and to
22 # test each one separately.
23+ AC_CHECK_HEADERS_ONCE([argp.h])
24 AC_MSG_CHECKING([whether program_invocation_name is defined])
25- AC_TRY_LINK([#include <argp.h>],
26+ AC_TRY_LINK([
27+#include <errno.h>
28+#ifdef HAVE_ARGP_H
29+# include <argp.h>
30+#endif
31+],
32 [ program_invocation_name = "test"; ],
33 [ AC_DEFINE([HAVE_PROGRAM_INVOCATION_NAME], [1],
34 [Define if program_invocation_name is defined])
35@@ -40,7 +46,12 @@ AC_DEFUN([gl_ARGP],
36 [ AC_MSG_RESULT([no])] )
37
38 AC_MSG_CHECKING([whether program_invocation_short_name is defined])
39- AC_TRY_LINK([#include <argp.h>],
40+ AC_TRY_LINK([
41+#include <errno.h>
42+#ifdef HAVE_ARGP_H
43+# include <argp.h>
44+#endif
45+],
46 [ program_invocation_short_name = "test"; ],
47 [ AC_DEFINE([HAVE_PROGRAM_INVOCATION_SHORT_NAME], [1],
48 [Define if program_invocation_short_name is defined])
49--
501.7.3.2
51
diff --git a/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-0003-wchar.patch b/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-0003-wchar.patch
new file mode 100644
index 000000000..21635a762
--- /dev/null
+++ b/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-0003-wchar.patch
@@ -0,0 +1,12 @@
1--- inetutils-1.8/lib/wchar.in.h
2+++ inetutils-1.8/lib/wchar.in.h
3@@ -70,6 +70,9 @@
4 /* The include_next requires a split double-inclusion guard. */
5 #if @HAVE_WCHAR_H@
6 # @INCLUDE_NEXT@ @NEXT_WCHAR_H@
7+#else
8+# include <stddef.h>
9+# define MB_CUR_MAX 1
10 #endif
11
12 #undef _GL_ALREADY_INCLUDING_WCHAR_H
diff --git a/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-1001-ftp-rename-ruserpass-to-avoid-C-library-collision.patch b/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-1001-ftp-rename-ruserpass-to-avoid-C-library-collision.patch
new file mode 100644
index 000000000..a6e366da7
--- /dev/null
+++ b/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-1001-ftp-rename-ruserpass-to-avoid-C-library-collision.patch
@@ -0,0 +1,58 @@
1From 4f890adb39b52bc43c578966071625004988e3b8 Mon Sep 17 00:00:00 2001
2From: Mike Frysinger <vapier at gentoo.org>
3Date: Thu, 18 Nov 2010 22:11:48 -0500
4Subject: [PATCH] ftp: rename ruserpass to avoid C library collision
5
6The C library itself defines a "ruserpass" function. When linking
7statically, it is possible to hit a symbol collision linker error.
8So rename the local ftp version to "remote_userpass".
9
10Signed-off-by: Mike Frysinger <vapier at gentoo.org>
11---
12 ftp/extern.h | 2 +-
13 ftp/ftp.c | 2 +-
14 ftp/ruserpass.c | 2 +-
15 3 files changed, 3 insertions(+), 3 deletions(-)
16
17diff --git a/ftp/extern.h b/ftp/extern.h
18index 8cdb8aa..037cb61 100644
19--- a/ftp/extern.h
20+++ b/ftp/extern.h
21@@ -119,7 +119,7 @@ void reset (int, char **);
22 void restart (int, char **);
23 void rmthelp (int, char **);
24 void rmtstatus (int, char **);
25-int ruserpass (char *, char **, char **, char **);
26+int remote_userpass (char *, char **, char **, char **);
27 void sendrequest (char *, char *, char *, int);
28 void setascii (int, char **);
29 void setbell (int, char **);
30diff --git a/ftp/ftp.c b/ftp/ftp.c
31index c20ba41..95675cc 100644
32--- a/ftp/ftp.c
33+++ b/ftp/ftp.c
34@@ -251,7 +251,7 @@ login (char *host)
35 int n, aflag = 0;
36
37 user = pass = acct = 0;
38- if (ruserpass (host, &user, &pass, &acct) < 0)
39+ if (remote_userpass (host, &user, &pass, &acct) < 0)
40 {
41 code = -1;
42 return (0);
43diff --git a/ftp/ruserpass.c b/ftp/ruserpass.c
44index 8572b95..c08fbc0 100644
45--- a/ftp/ruserpass.c
46+++ b/ftp/ruserpass.c
47@@ -111,7 +111,7 @@ static struct toktab
48 };
49
50 int
51-ruserpass (char *host, char **aname, char **apass, char **aacct)
52+remote_userpass (char *host, char **aname, char **apass, char **aacct)
53 {
54 char *hdir, buf[BUFSIZ], *tmp;
55 char *myname = 0, *mydomain;
56--
571.7.3.2
58
diff --git a/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-1002-rshd-detect-__rcmd_errstr-support-in-the-C-lib.patch b/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-1002-rshd-detect-__rcmd_errstr-support-in-the-C-lib.patch
new file mode 100644
index 000000000..7708c4045
--- /dev/null
+++ b/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-1002-rshd-detect-__rcmd_errstr-support-in-the-C-lib.patch
@@ -0,0 +1,57 @@
1From 730015f060fe76eee615f361a65eb719cdf22eef Mon Sep 17 00:00:00 2001
2From: Mike Frysinger <vapier at gentoo.org>
3Date: Thu, 18 Nov 2010 22:20:39 -0500
4Subject: [PATCH] rshd: detect __rcmd_errstr support in the C lib
5
6Not all C libraries support __rcmd_errstr, so add a configure test for it.
7
8Signed-off-by: Mike Frysinger <vapier at gentoo.org>
9---
10 configure.ac | 2 +-
11 src/rshd.c | 4 ++++
12 2 files changed, 5 insertions(+), 1 deletions(-)
13
14diff --git a/configure.ac b/configure.ac
15index c1ac270..79d655c 100644
16--- a/configure.ac
17+++ b/configure.ac
18@@ -587,7 +587,7 @@ AC_CHECK_FUNCS(cfsetspeed cgetent dirfd fchdir flock \
19 setsid setregid setreuid setresgid setresuid setutent_r \
20 sigaction sigvec strchr setproctitle tcgetattr tzset utimes \
21 utime uname \
22- updwtmp updwtmpx vhangup wait3 wait4 opendir2)
23+ updwtmp updwtmpx vhangup wait3 wait4 opendir2 __rcmd_errstr)
24
25 dnl Functions that we will define if necessary.
26 AC_REPLACE_FUNCS(getpass getusershell memcmp memcpy memmove memset \
27diff --git a/src/rshd.c b/src/rshd.c
28index d49facd..9301ef2 100644
29--- a/src/rshd.c
30+++ b/src/rshd.c
31@@ -284,7 +284,9 @@ extern char **environ;
32 void
33 doit (int sockfd, struct sockaddr_in *fromp)
34 {
35+#ifdef HAVE___RCMD_ERRSTR
36 extern char *__rcmd_errstr; /* syslog hook from libc/net/rcmd.c. */
37+#endif
38 struct hostent *hp;
39 struct passwd *pwd;
40 u_short port;
41@@ -757,11 +759,13 @@ doit (int sockfd, struct sockaddr_in *fromp)
42 && (iruserok (fromp->sin_addr.s_addr, pwd->pw_uid == 0,
43 remuser, locuser)) < 0))
44 {
45+#ifdef HAVE___RCMD_ERRSTR
46 if (__rcmd_errstr)
47 syslog (LOG_INFO | LOG_AUTH,
48 "%s@%s as %s: permission denied (%s). cmd='%.80s'",
49 remuser, hostname, locuser, __rcmd_errstr, cmdbuf);
50 else
51+#endif
52 syslog (LOG_INFO | LOG_AUTH,
53 "%s@%s as %s: permission denied. cmd='%.80s'",
54 remuser, hostname, locuser, cmdbuf);
55--
561.7.3.2
57
diff --git a/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-1003-use-daemon-from-the-C-library-when-possible.patch b/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-1003-use-daemon-from-the-C-library-when-possible.patch
new file mode 100644
index 000000000..8575c102e
--- /dev/null
+++ b/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-1003-use-daemon-from-the-C-library-when-possible.patch
@@ -0,0 +1,42 @@
1From 3b9f64c6a668849b37b884a7826885c70b95787b Mon Sep 17 00:00:00 2001
2From: Mike Frysinger <vapier at gentoo.org>
3Date: Thu, 18 Nov 2010 22:24:06 -0500
4Subject: [PATCH] use daemon from the C library when possible
5
6Signed-off-by: Mike Frysinger <vapier at gentoo.org>
7---
8 configure.ac | 2 +-
9 libinetutils/daemon.c | 2 ++
10 2 files changed, 3 insertions(+), 1 deletions(-)
11
12diff --git a/configure.ac b/configure.ac
13index 79d655c..25cc3db 100644
14--- a/configure.ac
15+++ b/configure.ac
16@@ -579,7 +579,7 @@ AC_FUNC_MMAP
17 AC_FUNC_MALLOC
18 AC_FUNC_REALLOC
19
20-AC_CHECK_FUNCS(bcopy bcmp bzero cfsetspeed cgetent dirfd fchdir flock \
21+AC_CHECK_FUNCS(bcopy bcmp bzero cfsetspeed cgetent daemon dirfd fchdir flock \
22 fpathconf ftruncate \
23 getcwd getmsg getspnam initgroups initsetproctitle killpg \
24 mkstemp ptsname \
25diff --git a/libinetutils/daemon.c b/libinetutils/daemon.c
26index 2156af4..9beb255 100644
27--- a/libinetutils/daemon.c
28+++ b/libinetutils/daemon.c
29@@ -197,8 +197,10 @@ waitdaemon (int nochdir, int noclose, int maxwait)
30 return ppid;
31 }
32
33+#ifndef HAVE_DAEMON
34 int
35 daemon (int nochdir, int noclose)
36 {
37 return (waitdaemon (nochdir, noclose, 0) == -1) ? -1 : 0;
38 }
39+#endif
40--
411.7.3.2
42
diff --git a/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-1004-detect-fork-support.patch b/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-1004-detect-fork-support.patch
new file mode 100644
index 000000000..fc9d72670
--- /dev/null
+++ b/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-1004-detect-fork-support.patch
@@ -0,0 +1,54 @@
1From 0acaed0d4b2bf9495e71ec4c898733bed2a86be0 Mon Sep 17 00:00:00 2001
2From: Mike Frysinger <vapier at gentoo.org>
3Date: Thu, 18 Nov 2010 22:27:55 -0500
4Subject: [PATCH] detect fork() support
5
6Linux/nommu systems cannot support a fork(), so add a configure test for
7it so apps can pick that or vfork().
8
9Signed-off-by: Mike Frysinger <vapier at gentoo.org>
10---
11 configure.ac | 2 +-
12 libinetutils/libinetutils.h | 9 +++++++++
13 2 files changed, 10 insertions(+), 1 deletions(-)
14
15diff --git a/configure.ac b/configure.ac
16index 25cc3db..98196f4 100644
17--- a/configure.ac
18+++ b/configure.ac
19@@ -580,7 +580,7 @@ AC_FUNC_MALLOC
20 AC_FUNC_REALLOC
21
22 AC_CHECK_FUNCS(bcopy bcmp bzero cfsetspeed cgetent daemon dirfd fchdir flock \
23- fpathconf ftruncate \
24+ fork fpathconf ftruncate \
25 getcwd getmsg getspnam initgroups initsetproctitle killpg \
26 mkstemp ptsname \
27 setegid seteuid setpgid \
28diff --git a/libinetutils/libinetutils.h b/libinetutils/libinetutils.h
29index 19bbde5..86365b0 100644
30--- a/libinetutils/libinetutils.h
31+++ b/libinetutils/libinetutils.h
32@@ -17,6 +17,8 @@
33 You should have received a copy of the GNU General Public License
34 along with this program. If not, see `http://www.gnu.org/licenses/'. */
35
36+#include <config.h>
37+
38 #include "argp-version-etc.h"
39
40 void utmp_init (char *line, char *user, char *id);
41@@ -32,3 +34,10 @@ extern const char *default_program_authors[];
42 #define iu_argp_init(name, authors) \
43 argp_program_bug_address = "<" PACKAGE_BUGREPORT ">"; \
44 argp_version_setup (name, authors);
45+
46+#ifdef HAVE_FORK
47+# define fork_exit(s) exit(s)
48+#else
49+# define fork() vfork()
50+# define fork_exit(s) _exit(s)
51+#endif
52--
531.7.3.2
54
diff --git a/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-1005-ftpd-add-daemon-D-nommu-support.patch b/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-1005-ftpd-add-daemon-D-nommu-support.patch
new file mode 100644
index 000000000..844905b9a
--- /dev/null
+++ b/meta-oe/recipes-connectivity/inetutils/inetutils-1.8/inetutils-1.8-1005-ftpd-add-daemon-D-nommu-support.patch
@@ -0,0 +1,109 @@
1From 1dee55b90d2971859377156e6210efdfdf1bac84 Mon Sep 17 00:00:00 2001
2From: Mike Frysinger <vapier at gentoo.org>
3Date: Fri, 19 Nov 2010 20:26:48 -0500
4Subject: [PATCH] ftpd: add daemon (-D) nommu support
5
6The current daemon design of ftpd is to:
7 - loop in server_mode() waiting for a connection
8 - fork a child and return to main() to process like inetd
9 - have parent continue looping in server_mode()
10
11On a nommu system where we can only vfork(), the child returning
12from server_mode() corrupts the stack and messes up the the parent.
13So rather than having the child return, exec a new ftpd process in
14the normal inetd mode. This also fixes the problem in nommu where
15a vfork-ed child pauses the parent until it either exits or execs
16something.
17
18Signed-off-by: Mike Frysinger <vapier at gentoo.org>
19---
20 ftpd/extern.h | 3 ++-
21 ftpd/ftpd.c | 17 ++++++++++++++---
22 ftpd/server_mode.c | 9 ++++++++-
23 3 files changed, 24 insertions(+), 5 deletions(-)
24
25diff --git a/ftpd/extern.h b/ftpd/extern.h
26index 2483fe6..81182e0 100644
27--- a/ftpd/extern.h
28+++ b/ftpd/extern.h
29@@ -110,7 +110,8 @@ extern char tmpline[];
30 extern off_t restart_point;
31
32 /* Exported from server_mode.c. */
33-extern int server_mode (const char *pidfile, struct sockaddr_in *phis_addr);
34+extern int server_mode (const char *pidfile, struct sockaddr_in *phis_addr,
35+ char *argv[]);
36
37 /* Credential for the request. */
38 struct credentials
39diff --git a/ftpd/ftpd.c b/ftpd/ftpd.c
40index aed74e6..c5c4c90 100644
41--- a/ftpd/ftpd.c
42+++ b/ftpd/ftpd.c
43@@ -424,8 +424,7 @@ main (int argc, char *argv[], char **envp)
44 argp_parse (&argp, argc, argv, 0, &index, NULL);
45
46 /* Bail out, wrong usage */
47- argc -= index;
48- if (argc != 0)
49+ if (argc - index != 0)
50 error (1, 0, "surplus arguments; try `%s --help' for more info",
51 program_name);
52
53@@ -438,7 +437,19 @@ main (int argc, char *argv[], char **envp)
54 fd = accept(). tcpd is check if compile with the support */
55 if (daemon_mode)
56 {
57- if (server_mode (pid_file, &his_addr) < 0)
58+#ifndef HAVE_FORK
59+ /* Shift out the daemon option in subforks */
60+ int i;
61+ for (i = 0; i < argc; ++i)
62+ if (strcmp (argv[i], "-D") == 0)
63+ {
64+ int j;
65+ for (j = i; j < argc; ++j)
66+ argv[j] = argv[j + 1];
67+ argv[--argc] = NULL;
68+ }
69+#endif
70+ if (server_mode (pid_file, &his_addr, argv) < 0)
71 exit (1);
72 }
73 else
74diff --git a/ftpd/server_mode.c b/ftpd/server_mode.c
75index 3d3a498..605e13e 100644
76--- a/ftpd/server_mode.c
77+++ b/ftpd/server_mode.c
78@@ -37,6 +37,8 @@
79 # include <tcpd.h>
80 #endif
81
82+#include <libinetutils.h>
83+
84 static void reapchild (int);
85
86 #define DEFPORT 21
87@@ -92,7 +94,7 @@ reapchild (int signo ARG_UNUSED)
88 }
89
90 int
91-server_mode (const char *pidfile, struct sockaddr_in *phis_addr)
92+server_mode (const char *pidfile, struct sockaddr_in *phis_addr, char *argv[])
93 {
94 int ctl_sock, fd;
95 struct servent *sv;
96@@ -176,5 +178,10 @@ server_mode (const char *pidfile, struct sockaddr_in *phis_addr)
97 if (!check_host ((struct sockaddr *) phis_addr))
98 return -1;
99 #endif
100+
101+#ifndef HAVE_FORK
102+ _exit(execvp(argv[0], argv));
103+#endif
104+
105 return fd;
106 }
107--
1081.7.3.2
109
diff --git a/meta-oe/recipes-connectivity/inetutils/inetutils_1.8.bb b/meta-oe/recipes-connectivity/inetutils/inetutils_1.8.bb
new file mode 100644
index 000000000..ce0df82db
--- /dev/null
+++ b/meta-oe/recipes-connectivity/inetutils/inetutils_1.8.bb
@@ -0,0 +1,65 @@
1DESCRIPTION = "The GNU inetutils are a collection of common \
2networking utilities and servers including ftp, ftpd, rcp, \
3rexec, rlogin, rlogind, rsh, rshd, syslog, syslogd, talk, \
4talkd, telnet, telnetd, tftp, tftpd, and uucpd."
5SECTION = "libs"
6DEPENDS = "ncurses"
7LICENSE = "GPLv3"
8
9LIC_FILES_CHKSUM = "file://COPYING;md5=adefda309052235aa5d1e99ce7557010"
10
11SRC_URI = "${GNU_MIRROR}/inetutils/inetutils-${PV}.tar.gz \
12 file://inetutils-1.8-0001-printf-parse-pull-in-features.h-for-__GLIBC__.patch \
13 file://inetutils-1.8-0002-argp-fix-program_invocation_name-detection.patch \
14 file://inetutils-1.8-0003-wchar.patch \
15 file://inetutils-1.8-1001-ftp-rename-ruserpass-to-avoid-C-library-collision.patch \
16 file://inetutils-1.8-1002-rshd-detect-__rcmd_errstr-support-in-the-C-lib.patch \
17 file://inetutils-1.8-1003-use-daemon-from-the-C-library-when-possible.patch \
18 file://inetutils-1.8-1004-detect-fork-support.patch \
19 file://inetutils-1.8-1005-ftpd-add-daemon-D-nommu-support.patch \
20 file://fix-disable-ipv6.patch \
21"
22SRC_URI[md5sum] = "ad8fdcdf1797b9ca258264a6b04e48fd"
23SRC_URI[sha256sum] = "c8500baee04b9ea408c9e65e24ad7f5b41e7d96d42fb1d29abf25b52b68311c7"
24
25inherit autotools gettext
26
27noipv6="${@base_contains('DISTRO_FEATURES', 'ipv6', '', '--disable-ipv6 gl_cv_socket_ipv6=no', d)}"
28EXTRA_OECONF = "--with-ncurses-include-dir=${STAGING_INCDIR} \
29 --with-path-procnet-dev=/proc/net/dev \
30 ${noipv6} \
31 "
32
33do_configure_prepend () {
34 export HELP2MAN='true'
35 cp ${STAGING_DATADIR_NATIVE}/gettext/config.rpath ${S}/build-aux/config.rpath
36 rm -f ${S}/glob/configure*
37}
38
39do_install () {
40 autotools_do_install
41 install -d ${D}${base_sbindir} ${D}${base_bindir}
42 mv ${D}${bindir}/tftp ${D}${bindir}/tftp.${PN}
43 mv ${D}${bindir}/telnet ${D}${bindir}/telnet.${PN}
44 mv ${D}${bindir}/logger ${D}${bindir}/logger.${PN}
45 mv ${D}${bindir}/traceroute ${D}${bindir}/traceroute.${PN}
46 mv ${D}${bindir}/hostname ${D}${base_bindir}/hostname.${PN}
47 mv ${D}${bindir}/ifconfig ${D}${base_sbindir}/ifconfig.${PN}
48}
49
50pkg_postinst_${PN} () {
51 update-alternatives --install ${bindir}/tftp tftp tftp.${PN} 100
52 update-alternatives --install ${bindir}/telnet telnet telnet.${PN} 100
53 update-alternatives --install ${bindir}/logger logger logger.${PN} 100
54 update-alternatives --install ${bindir}/traceroute traceroute traceroute.${PN} 100
55 update-alternatives --install ${base_bindir}/hostname hostname hostname.${PN} 100
56 update-alternatives --install ${base_sbindir}/ifconfig ifconfig ifconfig.${PN} 100
57}
58
59pkg_prerm_${PN} () {
60 update-alternatives --remove tftp tftp.${PN}
61 update-alternatives --remove telnet telnet.${PN}
62 update-alternatives --remove logger logger.${PN}
63 update-alternatives --remove traceroute traceroute.${PN}
64 update-alternatives --remove ifconfig ifconfig.${PN}
65}