]> granicus.if.org Git - shadow/commitdiff
Do not bail out on missing login.defs.
authorDimitri John Ledkov <dimitri.j.ledkov@intel.com>
Fri, 27 Feb 2015 11:23:58 +0000 (11:23 +0000)
committerDimitri John Ledkov <dimitri.j.ledkov@intel.com>
Fri, 27 Feb 2015 17:01:27 +0000 (17:01 +0000)
For most operations tools have compiled-in defaults, and thus can
operate without login.defs present.

lib/getdef.c

index b5f780cad9d4de5b9e97644ac0f1146d685b9599..c2f2dfb4c987257bd1844a3a39d175fe01427e07 100644 (file)
@@ -416,23 +416,26 @@ static void def_load (void)
        FILE *fp;
        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.
         */
        fp = fopen (def_fname, "r");
        if (NULL == fp) {
+               if (errno == ENOENT)
+                       return;
+
                int err = errno;
                SYSLOG ((LOG_CRIT, "cannot open login definitions %s [%s]",
                         def_fname, strerror (err)));
                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.
         */