diff options
author | Andrew G. Morgan <morgan@kernel.org> | 2001-11-13 05:07:24 +0000 |
---|---|---|
committer | Andrew G. Morgan <morgan@kernel.org> | 2001-11-13 05:07:24 +0000 |
commit | 1fac2c4937dae665d2f85628f861e8f4bdda4da8 (patch) | |
tree | 1335bf04a85e6997e60644770b537d40d45fdc34 /modules/pam_rhosts/pam_rhosts_auth.c | |
parent | 6c581ef8dbe547cbc2276355803de4bcddee1f42 (diff) | |
download | pam-1fac2c4937dae665d2f85628f861e8f4bdda4da8.tar.gz pam-1fac2c4937dae665d2f85628f861e8f4bdda4da8.tar.bz2 pam-1fac2c4937dae665d2f85628f861e8f4bdda4da8.zip |
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.
Diffstat (limited to 'modules/pam_rhosts/pam_rhosts_auth.c')
-rw-r--r-- | modules/pam_rhosts/pam_rhosts_auth.c | 10 |
1 files changed, 7 insertions, 3 deletions
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 <security/_pam_aconf.h> #define USER_RHOSTS_FILE "/.rhosts" /* prefixed by user's home dir */ @@ -46,9 +46,9 @@ #include <endian.h> #endif -#ifdef NEED_FSUID_H +#ifdef HAVE_SYS_FSUID_H #include <sys/fsuid.h> -#endif /* NEED_FSUID_H */ +#endif /* HAVE_SYS_FSUID_H */ #include <sys/types.h> #include <sys/uio.h> @@ -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))); |