From 1fac2c4937dae665d2f85628f861e8f4bdda4da8 Mon Sep 17 00:00:00 2001 From: "Andrew G. Morgan" Date: Tue, 13 Nov 2001 05:07:24 +0000 Subject: Relevant BUGIDs: 476986 Purpose of commit: new feature, cleanup Commit summary: --------------- patch from Nalin to support '+hostname' as equivalent to 'hostname'. fixed compiler warning by working out when to include header file. --- modules/pam_rhosts/pam_rhosts_auth.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'modules/pam_rhosts') diff --git a/modules/pam_rhosts/pam_rhosts_auth.c b/modules/pam_rhosts/pam_rhosts_auth.c index b633a529..7ee77f1d 100644 --- a/modules/pam_rhosts/pam_rhosts_auth.c +++ b/modules/pam_rhosts/pam_rhosts_auth.c @@ -38,7 +38,7 @@ * SUCH DAMAGE. */ -#define _BSD_SOURCE +#include #define USER_RHOSTS_FILE "/.rhosts" /* prefixed by user's home dir */ @@ -46,9 +46,9 @@ #include #endif -#ifdef NEED_FSUID_H +#ifdef HAVE_SYS_FSUID_H #include -#endif /* NEED_FSUID_H */ +#endif /* HAVE_SYS_FSUID_H */ #include #include @@ -282,8 +282,12 @@ __icheckhost (pam_handle_t *pamh, struct _options *opts, U32 raddr return (1); /* asking for trouble, but ok.. */ /* If not promiscuous: handle as negative */ return (-1); + } else if (strncmp("+",lhost,1) == 0) { + /* '+hostname' is supposed to be equivalent to 'hostname' */ + lhost++; } + /* Try for raw ip address first. */ if (isdigit(*lhost) && (long)(laddr = inet_addr(lhost)) != -1) return (negate*(! (raddr ^ laddr))); -- cgit v1.2.3