aboutsummaryrefslogtreecommitdiffstats
path: root/recipes/inetutils/inetutils-1.8/inetutils-1.8-1002-rshd-detect-__rcmd_errstr-support-in-the-C-lib.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes/inetutils/inetutils-1.8/inetutils-1.8-1002-rshd-detect-__rcmd_errstr-support-in-the-C-lib.patch')
-rw-r--r--recipes/inetutils/inetutils-1.8/inetutils-1.8-1002-rshd-detect-__rcmd_errstr-support-in-the-C-lib.patch57
1 files changed, 57 insertions, 0 deletions
diff --git a/recipes/inetutils/inetutils-1.8/inetutils-1.8-1002-rshd-detect-__rcmd_errstr-support-in-the-C-lib.patch b/recipes/inetutils/inetutils-1.8/inetutils-1.8-1002-rshd-detect-__rcmd_errstr-support-in-the-C-lib.patch
new file mode 100644
index 0000000000..7708c40456
--- /dev/null
+++ b/recipes/inetutils/inetutils-1.8/inetutils-1.8-1002-rshd-detect-__rcmd_errstr-support-in-the-C-lib.patch
@@ -0,0 +1,57 @@
+From 730015f060fe76eee615f361a65eb719cdf22eef Mon Sep 17 00:00:00 2001
+From: Mike Frysinger <vapier at gentoo.org>
+Date: Thu, 18 Nov 2010 22:20:39 -0500
+Subject: [PATCH] rshd: detect __rcmd_errstr support in the C lib
+
+Not all C libraries support __rcmd_errstr, so add a configure test for it.
+
+Signed-off-by: Mike Frysinger <vapier at gentoo.org>
+---
+ configure.ac | 2 +-
+ src/rshd.c | 4 ++++
+ 2 files changed, 5 insertions(+), 1 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index c1ac270..79d655c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -587,7 +587,7 @@ AC_CHECK_FUNCS(cfsetspeed cgetent dirfd fchdir flock \
+ setsid setregid setreuid setresgid setresuid setutent_r \
+ sigaction sigvec strchr setproctitle tcgetattr tzset utimes \
+ utime uname \
+- updwtmp updwtmpx vhangup wait3 wait4 opendir2)
++ updwtmp updwtmpx vhangup wait3 wait4 opendir2 __rcmd_errstr)
+
+ dnl Functions that we will define if necessary.
+ AC_REPLACE_FUNCS(getpass getusershell memcmp memcpy memmove memset \
+diff --git a/src/rshd.c b/src/rshd.c
+index d49facd..9301ef2 100644
+--- a/src/rshd.c
++++ b/src/rshd.c
+@@ -284,7 +284,9 @@ extern char **environ;
+ void
+ doit (int sockfd, struct sockaddr_in *fromp)
+ {
++#ifdef HAVE___RCMD_ERRSTR
+ extern char *__rcmd_errstr; /* syslog hook from libc/net/rcmd.c. */
++#endif
+ struct hostent *hp;
+ struct passwd *pwd;
+ u_short port;
+@@ -757,11 +759,13 @@ doit (int sockfd, struct sockaddr_in *fromp)
+ && (iruserok (fromp->sin_addr.s_addr, pwd->pw_uid == 0,
+ remuser, locuser)) < 0))
+ {
++#ifdef HAVE___RCMD_ERRSTR
+ if (__rcmd_errstr)
+ syslog (LOG_INFO | LOG_AUTH,
+ "%s@%s as %s: permission denied (%s). cmd='%.80s'",
+ remuser, hostname, locuser, __rcmd_errstr, cmdbuf);
+ else
++#endif
+ syslog (LOG_INFO | LOG_AUTH,
+ "%s@%s as %s: permission denied. cmd='%.80s'",
+ remuser, hostname, locuser, cmdbuf);
+--
+1.7.3.2
+