diff options
Diffstat (limited to 'lib/libpam/pam_setenv.c')
-rw-r--r-- | lib/libpam/pam_setenv.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libpam/pam_setenv.c b/lib/libpam/pam_setenv.c index 070a185e6019..3c2209c1c0dd 100644 --- a/lib/libpam/pam_setenv.c +++ b/lib/libpam/pam_setenv.c @@ -32,13 +32,14 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: pam_setenv.c 648 2013-03-05 17:54:27Z des $ + * $Id: pam_setenv.c 914 2017-01-21 15:15:29Z des $ */ #ifdef HAVE_CONFIG_H # include "config.h" #endif +#include <errno.h> #include <stdlib.h> #include <stdio.h> #include <string.h> @@ -65,12 +66,12 @@ pam_setenv(pam_handle_t *pamh, int r; ENTER(); - if (pamh == NULL) - RETURNC(PAM_SYSTEM_ERR); /* sanity checks */ - if (name == NULL || value == NULL || strchr(name, '=') != NULL) + if (*name == '\0' || strchr(name, '=') != NULL) { + errno = EINVAL; RETURNC(PAM_SYSTEM_ERR); + } /* is it already there? */ if (!overwrite && openpam_findenv(pamh, name, strlen(name)) >= 0) |