summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/pam_limits/pam_limits.c6
-rw-r--r--modules/pam_rhosts/pam_rhosts_auth.c29
-rw-r--r--modules/pam_xauth/pam_xauth.c5
3 files changed, 29 insertions, 11 deletions
diff --git a/modules/pam_limits/pam_limits.c b/modules/pam_limits/pam_limits.c
index a4bc727f..961a7ad0 100644
--- a/modules/pam_limits/pam_limits.c
+++ b/modules/pam_limits/pam_limits.c
@@ -14,7 +14,7 @@
*/
#if !defined(linux) && !defined(__linux)
-#error THIS CODE IS KNOWN TO WORK ONLY ON LINUX !!!
+#warning THIS CODE IS KNOWN TO WORK ONLY ON LINUX !!!
#endif
#include "config.h"
@@ -281,8 +281,10 @@ process_limit (const pam_handle_t *pamh, int source, const char *lim_type,
limit_item = RLIMIT_NOFILE;
else if (strcmp(lim_item, "memlock") == 0)
limit_item = RLIMIT_MEMLOCK;
+#ifdef RLIMIT_AS
else if (strcmp(lim_item, "as") == 0)
limit_item = RLIMIT_AS;
+#endif /*RLIMIT_AS*/
#ifdef RLIMIT_LOCKS
else if (strcmp(lim_item, "locks") == 0)
limit_item = RLIMIT_LOCKS;
@@ -389,7 +391,9 @@ process_limit (const pam_handle_t *pamh, int source, const char *lim_type,
case RLIMIT_CORE:
case RLIMIT_RSS:
case RLIMIT_MEMLOCK:
+#ifdef RLIMIT_AS
case RLIMIT_AS:
+#endif
if (rlimit_value != RLIM_INFINITY)
{
if (rlimit_value >= RLIM_INFINITY/1024)
diff --git a/modules/pam_rhosts/pam_rhosts_auth.c b/modules/pam_rhosts/pam_rhosts_auth.c
index b2248ccb..d50ed478 100644
--- a/modules/pam_rhosts/pam_rhosts_auth.c
+++ b/modules/pam_rhosts/pam_rhosts_auth.c
@@ -64,11 +64,10 @@
#include <sys/fsuid.h>
#endif /* HAVE_SYS_FSUID_H */
#ifdef HAVE_NET_IF_H
-#include <sys/if.h>
+#include <net/if.h>
#endif
#include <sys/types.h>
#include <sys/uio.h>
-#include <net/if.h>
#include <netinet/in.h>
#ifndef MAXDNAME
@@ -294,7 +293,6 @@ __icheckuser (pam_handle_t *pamh, struct _options *opts,
/*
luser is user entry from .rhosts/hosts.equiv file
ruser is user id on remote host
- rhost is the remote host name
*/
const void *user;
@@ -349,11 +347,17 @@ __ivaliduser (pam_handle_t *pamh, struct _options *opts,
register const char *user;
register char *p;
int hcheck, ucheck;
- char buf[MAXHOSTNAMELEN + 128]; /* host + login */
+ int retval = 1;
+#ifdef HAVE_GETLINE
+ char *buf=NULL;
+ int buflen=0;
- buf[sizeof (buf)-1] = '\0'; /* terminate line */
+ while (getline(&buf,&buflen,hostf)) {
+#else
+ char buf[MAXHOSTNAMELEN + 128]; /* host + login */
while (fgets(buf, sizeof(buf), hostf) != NULL) { /* hostf file line */
+#endif
p = buf; /* from beginning of file.. */
/* Skip empty or comment lines */
@@ -402,7 +406,7 @@ __ivaliduser (pam_handle_t *pamh, struct _options *opts,
hcheck=__icheckhost(pamh, opts, raddr, buf, rhost);
if (hcheck<0)
- return(1);
+ break;
if (hcheck) {
/* Then check user part */
@@ -412,18 +416,23 @@ __ivaliduser (pam_handle_t *pamh, struct _options *opts,
ucheck=__icheckuser(pamh, opts, user, ruser);
/* Positive 'host user' match? */
- if (ucheck>0)
- return(0);
+ if (ucheck>0) {
+ retval = 0;
+ break;
+ }
/* Negative 'host -user' match? */
if (ucheck<0)
- return(1);
+ break;
/* Neither, go on looking for match */
}
}
+#ifdef HAVE_GETLINE
+ if(buf)free(buf);
+#endif
- return (1);
+ return retval;
}
/*
diff --git a/modules/pam_xauth/pam_xauth.c b/modules/pam_xauth/pam_xauth.c
index 3772bd06..153210f1 100644
--- a/modules/pam_xauth/pam_xauth.c
+++ b/modules/pam_xauth/pam_xauth.c
@@ -63,6 +63,11 @@
#define XAUTHDEF ".Xauthority"
#define XAUTHTMP ".xauthXXXXXX"
+/* Hurd compatibility */
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
+
/* Possible paths to xauth executable */
static const char * const xauthpaths[] = {
#ifdef PAM_PATH_XAUTH