diff options
author | Steve Langasek <vorlon@debian.org> | 2019-01-02 12:24:44 -0800 |
---|---|---|
committer | Steve Langasek <vorlon@debian.org> | 2019-01-02 12:27:24 -0800 |
commit | a6f4ab0bebc76acf85cc0244bd21c1036009c28c (patch) | |
tree | df0d6a57d2b91ab9038e8d7b0d62f28c2daa66db /debian/patches-applied/038_support_hurd | |
parent | 10b6243f4664747e815372070142d6c5853176da (diff) | |
download | pam-a6f4ab0bebc76acf85cc0244bd21c1036009c28c.tar.gz pam-a6f4ab0bebc76acf85cc0244bd21c1036009c28c.tar.bz2 pam-a6f4ab0bebc76acf85cc0244bd21c1036009c28c.zip |
fix-up commit for grafting svn history onto git history
Diffstat (limited to 'debian/patches-applied/038_support_hurd')
-rw-r--r-- | debian/patches-applied/038_support_hurd | 106 |
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 |