]> granicus.if.org Git - linux-pam/commitdiff
Relevant BUGIDs: 476986
authorAndrew G. Morgan <morgan@kernel.org>
Tue, 13 Nov 2001 05:07:24 +0000 (05:07 +0000)
committerAndrew G. Morgan <morgan@kernel.org>
Tue, 13 Nov 2001 05:07:24 +0000 (05:07 +0000)
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.

CHANGELOG
_pam_aconf.h.in
configure
configure.in
modules/pam_rhosts/pam_rhosts_auth.c

index 89d9989a6f17cceb9965c00eb27c50fb383692a6..288873f9e71686d4e0d329e0588166a41fa53c34 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -49,6 +49,8 @@ bug report - outstanding bugs are listed here:
 0.76: please submit patches for this section with actual code/doc
       patches!
 
+* pam_rhosts: Nalin adds support for '+hostname', and zdd fix
+  compilation warning. (Bug 476986 - agmorgan)
 * pam_motd: Nalin fixed compiler warning. (Bug 476938 - agmorgan)
 * pam_pwdb: Solar Designer pointed out that there was a problem with
   the compatibility support for md5 password hashing. (Bug 460717,
index baa971705ae634b038e8e2b7d6f4ee866085ac80..1b2cea755c31e9e945091691fe08471c4c3caaa8 100644 (file)
@@ -79,4 +79,8 @@
 /* location of the mail spool directory */
 #undef PAM_PATH_MAILDIR
 
+/* where should we include setfsuid's prototype from? If this is not
+   defined, we get it from unistd.h */
+#undef HAVE_SYS_FSUID_H
+
 #endif /* PAM_ACONF_H */
index 813c1e5a204987d86908403c4ba9be6e236909ff..f4b21869f85538469f742d5fdd7ff2d86b371057 100755 (executable)
--- a/configure
+++ b/configure
@@ -2124,7 +2124,7 @@ EOF
 
 fi
 
-for ac_hdr in fcntl.h limits.h malloc.h sys/file.h sys/ioctl.h sys/time.h syslog.h termio.h unistd.h
+for ac_hdr in fcntl.h limits.h malloc.h sys/file.h sys/ioctl.h sys/time.h syslog.h termio.h unistd.h sys/fsuid.h
 do
 ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
index 0227c412e2f55b3d4182b6d7aa2684d06dd25f9e..0f5b8d89677cbdd464f9621aef6fbdb717888a90 100644 (file)
@@ -222,7 +222,7 @@ dnl Checks for header files.
 AC_HEADER_DIRENT
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/file.h sys/ioctl.h sys/time.h syslog.h termio.h unistd.h)
+AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/file.h sys/ioctl.h sys/time.h syslog.h termio.h unistd.h sys/fsuid.h)
 
 dnl Linux wants features.h in some of the source files.
 AC_CHECK_HEADERS(features.h)
index b633a52989d7f6903156ad83f5b17e2e95740d8a..7ee77f1d56453a7d68e8a5c180132c6e4b4a4ad6 100644 (file)
@@ -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)));