diff options
author | Steve Langasek <steve.langasek@ubuntu.com> | 2019-01-03 12:47:05 -0800 |
---|---|---|
committer | Steve Langasek <steve.langasek@ubuntu.com> | 2019-01-03 12:47:05 -0800 |
commit | 4c51da22e068907adb7857d50f5109a467c94d7c (patch) | |
tree | becf5fbae5dfcbe8896355f59042dc8eaefa7f37 /Linux-PAM/modules/pam_env/pam_env.c | |
parent | efd31890b5ed496a5a00c08a262da240e66a4ddc (diff) | |
parent | ab9e8ba11f464fc083fc65a0bc695d60ebc86f3e (diff) | |
download | pam-4c51da22e068907adb7857d50f5109a467c94d7c.tar.gz pam-4c51da22e068907adb7857d50f5109a467c94d7c.tar.bz2 pam-4c51da22e068907adb7857d50f5109a467c94d7c.zip |
New upstream version 0.79
Diffstat (limited to 'Linux-PAM/modules/pam_env/pam_env.c')
-rw-r--r-- | Linux-PAM/modules/pam_env/pam_env.c | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/Linux-PAM/modules/pam_env/pam_env.c b/Linux-PAM/modules/pam_env/pam_env.c index 2b7533d0..a3cf7684 100644 --- a/Linux-PAM/modules/pam_env/pam_env.c +++ b/Linux-PAM/modules/pam_env/pam_env.c @@ -1,7 +1,7 @@ /* pam_mail module */ /* - * $Id: pam_env.c,v 1.1.1.2 2002/09/15 20:08:46 hartmans Exp $ + * $Id: pam_env.c,v 1.5 2004/09/15 12:06:17 kukuk Exp $ * * Written by Dave Kinchlea <kinch@kinch.ark.com> 1997/01/31 * Inspired by Andrew Morgan <morgan@kernel.org>, who also supplied the @@ -13,7 +13,7 @@ #endif #define DEFAULT_ETC_ENVFILE "/etc/environment" -#define DEFAULT_READ_ENVFILE 1 +#define DEFAULT_READ_ENVFILE 0 #include <security/_pam_aconf.h> @@ -165,8 +165,8 @@ static int _parse_config_file(pam_handle_t *pamh, int ctrl, char **conffile) return PAM_IGNORE; } - /* _pam_assemble_line will provide a complete line from the config file, with all - * comments removed and any escaped newlines fixed up + /* _pam_assemble_line will provide a complete line from the config file, + * with all comments removed and any escaped newlines fixed up */ while (( retval = _assemble_line(conf, buffer, BUF_SIZE)) > 0) { @@ -192,12 +192,13 @@ static int _parse_config_file(pam_handle_t *pamh, int ctrl, char **conffile) (void) fclose(conf); /* tidy up */ - _clean_var(var); /* We could have got here prematurely, this is safe though */ + _clean_var(var); /* We could have got here prematurely, + * this is safe though */ _pam_overwrite(*conffile); _pam_drop(*conffile); file = NULL; D(("Exit.")); - return (retval<0?PAM_ABORT:PAM_SUCCESS); + return (retval != 0 ? PAM_ABORT : PAM_SUCCESS); } static int _parse_env_file(pam_handle_t *pamh, int ctrl, char **env_file) @@ -231,7 +232,7 @@ static int _parse_env_file(pam_handle_t *pamh, int ctrl, char **env_file) continue; /* skip over "export " if present so we can be compat with - bash type declerations */ + bash type declarations */ if (strncmp(key, "export ", (size_t) 7) == 0) key += 7; @@ -279,7 +280,7 @@ static int _parse_env_file(pam_handle_t *pamh, int ctrl, char **env_file) _pam_drop(*env_file); file = NULL; D(("Exit.")); - return (retval<0?PAM_IGNORE:PAM_SUCCESS); + return (retval != 0 ? PAM_IGNORE : PAM_SUCCESS); } /* @@ -765,8 +766,8 @@ int pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, retval = _parse_config_file(pamh, ctrl, &conf_file); - if(readenv) - _parse_env_file(pamh, ctrl, &env_file); + if(readenv && retval == PAM_SUCCESS) + retval = _parse_env_file(pamh, ctrl, &env_file); /* indicate success or failure */ @@ -798,8 +799,8 @@ int pam_sm_open_session(pam_handle_t *pamh,int flags,int argc retval = _parse_config_file(pamh, ctrl, &conf_file); - if(readenv) - _parse_env_file(pamh, ctrl, &env_file); + if(readenv && retval == PAM_SUCCESS) + retval = _parse_env_file(pamh, ctrl, &env_file); /* indicate success or failure */ |