summaryrefslogtreecommitdiff
path: root/modules/pam_umask/pam_umask.c
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@orinoco.thkukuk.de>2013-06-18 16:27:15 +0200
committerThorsten Kukuk <kukuk@orinoco.thkukuk.de>2013-06-18 16:27:15 +0200
commita36df58aa78531a4629f90f732be475e9296a842 (patch)
treedb32d07e9e2304c846047a9f596d509892c1ddc1 /modules/pam_umask/pam_umask.c
parent8c715834cd61f2d50d53f9af85d3bd2f87a26c61 (diff)
Use hash from /etc/login.defs as default if no
other one is specified as argument. * modules/pam_unix/support.c: Add search_key, call from __set_ctrl * modules/pam_unix/support.h: Add define for /etc/login.defs * modules/pam_unix/pam_unix.8.xml: Document new behavior. * modules/pam_umask/pam_umask.c: Add missing NULL pointer check
Diffstat (limited to 'modules/pam_umask/pam_umask.c')
-rw-r--r--modules/pam_umask/pam_umask.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/pam_umask/pam_umask.c b/modules/pam_umask/pam_umask.c
index 6d2ec1ac..863f0387 100644
--- a/modules/pam_umask/pam_umask.c
+++ b/modules/pam_umask/pam_umask.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005, 2006, 2007, 2010 Thorsten Kukuk <kukuk@thkukuk.de>
+ * Copyright (c) 2005, 2006, 2007, 2010, 2013 Thorsten Kukuk <kukuk@thkukuk.de>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -112,6 +112,10 @@ search_key (const char *filename)
{
buflen = BUF_SIZE;
buf = malloc (buflen);
+ if (buf == NULL) {
+ fclose (fp);
+ return NULL;
+ }
}
buf[0] = '\0';
if (fgets (buf, buflen - 1, fp) == NULL)