mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-04-28 14:18:27 +00:00
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>
58 lines
2.0 KiB
Diff
58 lines
2.0 KiB
Diff
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
|
|
|