aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvorlon <Unknown>2007-08-22 04:17:56 +0000
committervorlon <Unknown>2007-08-22 04:17:56 +0000
commitc7b35cabae4fa6b766d964f4a8a5fd89900ba549 (patch)
tree65c23e6193a8e0d18df1a30bdf749b019c5f2449
parentc66599d3e5c2a84f69c76b37b2c1f3250fea4a35 (diff)
downloadpam-c7b35cabae4fa6b766d964f4a8a5fd89900ba549.tar.gz
pam-c7b35cabae4fa6b766d964f4a8a5fd89900ba549.tar.bz2
pam-c7b35cabae4fa6b766d964f4a8a5fd89900ba549.zip
add new Hurd fixes for pam_xauth
-rw-r--r--changelog3
-rw-r--r--patches-applied/038_support_hurd54
2 files changed, 56 insertions, 1 deletions
diff --git a/changelog b/changelog
index ade2e8f5..835f2c9a 100644
--- a/changelog
+++ b/changelog
@@ -67,7 +67,8 @@ pam (0.99.7.1-2) UNRELEASED; urgency=low
from crack.h; and patch configure.in to use AC_CHECK_HEADERS instead
of AC_CHECK_HEADER, so crack.h is actually included. Also remove
unnecessary string copies, which break on the Hurd due to PATH_MAX.
- * Patch 038: partially merged/superseded upstream
+ * Patch 038: partially merged/superseded upstream; also add new Hurd
+ fixes for pam_xauth.
* Patch 061: partially merged upstream
* Use ${binary:Version} instead of ${Source-Version} in
debian/control.
diff --git a/patches-applied/038_support_hurd b/patches-applied/038_support_hurd
index 43e9166e..b3b02a71 100644
--- a/patches-applied/038_support_hurd
+++ b/patches-applied/038_support_hurd
@@ -86,3 +86,57 @@ Index: Linux-PAM/modules/pam_limits/pam_limits.c
#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
+@@ -35,7 +35,9 @@
+
+ #include "config.h"
+ #include <sys/types.h>
++#ifdef HAVE_SYS_FSUID_H
+ #include <sys/fsuid.h>
++#endif /* HAVE_SYS_FSUID_H */
+ #include <sys/wait.h>
+ #include <errno.h>
+ #include <fnmatch.h>
+@@ -63,6 +65,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
+@@ -221,9 +228,13 @@
+ return PAM_SESSION_ERR;
+ }
+ euid = geteuid();
++#ifdef HAVE_SYS_FSUID_H
+ setfsuid(pwd->pw_uid);
++#endif
+ fp = fopen(path, "r");
++#ifdef HAVE_SYS_FSUID_H
+ setfsuid(euid);
++#endif
+ if (fp != NULL) {
+ char buf[LINE_MAX], *tmp;
+ /* Scan the file for a list of specs of users to "trust". */
+@@ -536,9 +547,13 @@
+
+ /* Generate a new file to hold the data. */
+ euid = geteuid();
++#ifdef HAVE_SYS_FSUID_H
+ setfsuid(tpwd->pw_uid);
++#endif
+ fd = mkstemp(xauthority + strlen(XAUTHENV) + 1);
++#ifdef HAVE_SYS_FSUID_H
+ setfsuid(euid);
++#endif
+ if (fd == -1) {
+ pam_syslog(pamh, LOG_ERR,
+ "error creating temporary file `%s': %m",