From af0308708c9308953542815f9e3a9dce7db09edc Mon Sep 17 00:00:00 2001 From: Steve Langasek Date: Tue, 28 Aug 2007 02:27:17 +0000 Subject: Relevant BUGIDs: Debian bugs #76119, #165066 Purpose of commit: portability Commit summary: --------------- 2007-08-27 Steve Langasek * modules/pam_limits/pam_limits.c: when building on non-Linux systems, give a warning only, not an error; no one seems to remember why this error was here in the first place, but leave something in that might still grab the attention of non-Linux users. Patch from Michal Suchanek . * configure.in, modules/pam_rhosts/pam_rhosts_auth.c: check for the presence of net/if.h before using, required for Hurd compatibility. Patch from Igor Khavkine . * modules/pam_limits/pam_limits.c: conditionalize the use of RLIMIT_AS, which is not present on the Hurd. Patch from Igor Khavkine . * modules/pam_rhosts/pam_rhosts_auth.c: use getline() instead of a static buffer when available; fixes the build on systems without MAXHOSTNAMELEN (i.e., the Hurd). * modules/pam_xauth/pam_xauth.c: make sure PATH_MAX is defined before using it. --- modules/pam_limits/pam_limits.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'modules/pam_limits/pam_limits.c') 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) -- cgit v1.2.3