summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Langasek <vorlon@debian.org>2005-11-06 12:50:43 +0000
committerSteve Langasek <vorlon@debian.org>2005-11-06 12:50:43 +0000
commit8f587b822fa7bc9943ea37e113710a2dd3298237 (patch)
treef44a539d018b307e2a2bf32777ab9b2e21099969
parentff4104776bb51ff936fd1b62ec76d6e03db88d23 (diff)
Relevant BUGIDs: Debian bugs #330458, #330852
Purpose of commit: bugfix Commit summary: --------------- don't treat a missing /etc/environment as a fatal error when attempting to read it, and try to read this file by default; this restores the behavior from Linux-PAM 0.76.
-rw-r--r--ChangeLog7
-rw-r--r--modules/pam_env/pam_env.c16
2 files changed, 18 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index bc7b16f0..578e8ab6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-11-06 Steve Langasek <vorlon@debian.org>
+
+ * modules/pam_env/pam_env.c: don't treat a missing
+ /etc/environment as a fatal error when attempting to read it,
+ and try to read this file by default; this restores the behavior
+ from Linux-PAM 0.76.
+
2005-11-02 Tomas Mraz <t8m@centrum.cz>
* modules/pam_unix/support.c (_unix_getpwnam): Fix typo [#1224807]
diff --git a/modules/pam_env/pam_env.c b/modules/pam_env/pam_env.c
index f3098632..86207e49 100644
--- a/modules/pam_env/pam_env.c
+++ b/modules/pam_env/pam_env.c
@@ -9,7 +9,7 @@
*/
#define DEFAULT_ETC_ENVFILE "/etc/environment"
-#define DEFAULT_READ_ENVFILE 0
+#define DEFAULT_READ_ENVFILE 1
#include "config.h"
@@ -200,7 +200,7 @@ _parse_env_file(pam_handle_t *pamh, int ctrl, const char *env_file)
if ((conf = fopen(file,"r")) == NULL) {
pam_syslog(pamh, LOG_ERR, "Unable to open env file: %s: %m", file);
- return PAM_SERVICE_ERR;
+ return PAM_IGNORE;
}
while (_assemble_line(conf, buffer, BUF_SIZE) > 0) {
@@ -260,7 +260,7 @@ _parse_env_file(pam_handle_t *pamh, int ctrl, const char *env_file)
/* tidy up */
D(("Exit."));
- return (retval != 0 ? PAM_IGNORE : PAM_SUCCESS);
+ return retval;
}
/*
@@ -749,8 +749,11 @@ pam_sm_setcred (pam_handle_t *pamh, int flags UNUSED,
retval = _parse_config_file(pamh, ctrl, conf_file);
- if(readenv && retval == PAM_SUCCESS)
+ if(readenv && retval == PAM_SUCCESS) {
retval = _parse_env_file(pamh, ctrl, env_file);
+ if (retval == PAM_IGNORE)
+ retval = PAM_SUCCESS;
+ }
/* indicate success or failure */
@@ -782,8 +785,11 @@ pam_sm_open_session (pam_handle_t *pamh, int flags UNUSED,
retval = _parse_config_file(pamh, ctrl, conf_file);
- if(readenv && retval == PAM_SUCCESS)
+ if(readenv && retval == PAM_SUCCESS) {
retval = _parse_env_file(pamh, ctrl, env_file);
+ if (retval == PAM_IGNORE)
+ retval = PAM_SUCCESS;
+ }
/* indicate success or failure */