Add a flags option to sudo_parseln() and a flag to only mach comments

at the beginning of the line.  Use the flag when parsing ldap.conf.
This commit is contained in:
Todd C. Miller
2016-09-01 09:19:20 -06:00
parent 04340eea60
commit 17ad75d50b
8 changed files with 25 additions and 13 deletions

View File

@@ -76,7 +76,7 @@ sudo_read_nss(void)
if ((fp = fopen(_PATH_NSSWITCH_CONF, "r")) == NULL)
goto nomatch;
while (sudo_parseln(&line, &linesize, NULL, fp) != -1) {
while (sudo_parseln(&line, &linesize, NULL, fp, 0) != -1) {
char *cp, *last;
/* Skip blank or comment lines */
@@ -156,7 +156,7 @@ sudo_read_nss(void)
if ((fp = fopen(_PATH_NETSVC_CONF, "r")) == NULL)
goto nomatch;
while (sudo_parseln(&line, &linesize, NULL, fp) != -1) {
while (sudo_parseln(&line, &linesize, NULL, fp, 0) != -1) {
/* Skip blank or comment lines */
if (*(cp = line) == '\0')
continue;