33 lines
934 B
Diff
33 lines
934 B
Diff
--- modules/pam_xauth/pam_xauth.c
|
|
+++ modules/pam_xauth/pam_xauth.c 2008/11/04 10:59:23
|
|
@@ -600,6 +600,29 @@
|
|
free (d);
|
|
}
|
|
|
|
+ /* set XAUTHLOCALHOSTNAME to make sure that su - work under gnome */
|
|
+ if (getenv("XAUTHLOCALHOSTNAME") != NULL) {
|
|
+ char *d, *xauthlocalhostname;
|
|
+
|
|
+ xauthlocalhostname = strdup(getenv("XAUTHLOCALHOSTNAME"));
|
|
+
|
|
+ if (asprintf(&d, "XAUTHLOCALHOSTNAME=%s", xauthlocalhostname) < 0)
|
|
+ {
|
|
+ pam_syslog(pamh, LOG_DEBUG, "out of memory");
|
|
+ free(xauthlocalhostname);
|
|
+ xauthlocalhostname = NULL;
|
|
+ retval = PAM_SESSION_ERR;
|
|
+ goto cleanup;
|
|
+ }
|
|
+
|
|
+ if (pam_putenv (pamh, d) != PAM_SUCCESS)
|
|
+ pam_syslog (pamh, LOG_DEBUG,
|
|
+ "can't set environment variable '%s'", d);
|
|
+ free (d);
|
|
+ free(xauthlocalhostname);
|
|
+ xauthlocalhostname = NULL;
|
|
+ }
|
|
+
|
|
/* Merge the cookie we read before into the new file. */
|
|
if (debug) {
|
|
pam_syslog(pamh, LOG_DEBUG,
|