summaryrefslogtreecommitdiff
path: root/debian/patches-applied/038_support_hurd
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches-applied/038_support_hurd')
-rw-r--r--debian/patches-applied/038_support_hurd106
1 files changed, 106 insertions, 0 deletions
diff --git a/debian/patches-applied/038_support_hurd b/debian/patches-applied/038_support_hurd
new file mode 100644
index 00000000..52e04327
--- /dev/null
+++ b/debian/patches-applied/038_support_hurd
@@ -0,0 +1,106 @@
+Prefer using getline() instead of a static buffer; makes pam_rhosts
+portable to Hurd.
+
+Authors: Michal 'hramrach' Suchanek" <hramrach_l@centrum.cz>,
+ Steve Langasek <vorlon@debian.org>
+
+Upstream status: committed to CVS.
+
+Index: Linux-PAM/modules/pam_rhosts/pam_rhosts_auth.c
+===================================================================
+--- Linux-PAM/modules/pam_rhosts/pam_rhosts_auth.c.orig
++++ Linux-PAM/modules/pam_rhosts/pam_rhosts_auth.c
+@@ -293,7 +293,6 @@
+ /*
+ 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;
+
+@@ -348,11 +347,17 @@
+ 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;
++ size_t buflen=0;
+
+- buf[sizeof (buf)-1] = '\0'; /* terminate line */
++ while (getline(&buf,&buflen,hostf) > 0) {
++#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 */
+@@ -401,7 +406,7 @@
+ hcheck=__icheckhost(pamh, opts, raddr, buf, rhost);
+
+ if (hcheck<0)
+- return(1);
++ break;
+
+ if (hcheck) {
+ /* Then check user part */
+@@ -411,18 +416,23 @@
+ 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;
+ }
+
+ /*
+Index: Linux-PAM/modules/pam_limits/pam_limits.c
+===================================================================
+--- Linux-PAM/modules/pam_limits/pam_limits.c.orig
++++ Linux-PAM/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"
+Index: Linux-PAM/modules/pam_xauth/pam_xauth.c
+===================================================================
+--- Linux-PAM/modules/pam_xauth/pam_xauth.c.orig
++++ Linux-PAM/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