Do not bail out on missing login.defs.
For most operations tools have compiled-in defaults, and thus can operate without login.defs present.
This commit is contained in:
15
lib/getdef.c
15
lib/getdef.c
@@ -416,23 +416,26 @@ static void def_load (void)
|
|||||||
FILE *fp;
|
FILE *fp;
|
||||||
char buf[1024], *name, *value, *s;
|
char buf[1024], *name, *value, *s;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Set the initialized flag.
|
||||||
|
* (do it early to prevent recursion in putdef_str())
|
||||||
|
*/
|
||||||
|
def_loaded = true;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Open the configuration definitions file.
|
* Open the configuration definitions file.
|
||||||
*/
|
*/
|
||||||
fp = fopen (def_fname, "r");
|
fp = fopen (def_fname, "r");
|
||||||
if (NULL == fp) {
|
if (NULL == fp) {
|
||||||
|
if (errno == ENOENT)
|
||||||
|
return;
|
||||||
|
|
||||||
int err = errno;
|
int err = errno;
|
||||||
SYSLOG ((LOG_CRIT, "cannot open login definitions %s [%s]",
|
SYSLOG ((LOG_CRIT, "cannot open login definitions %s [%s]",
|
||||||
def_fname, strerror (err)));
|
def_fname, strerror (err)));
|
||||||
exit (EXIT_FAILURE);
|
exit (EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Set the initialized flag.
|
|
||||||
* (do it early to prevent recursion in putdef_str())
|
|
||||||
*/
|
|
||||||
def_loaded = true;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Go through all of the lines in the file.
|
* Go through all of the lines in the file.
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user