|
Lines 659-665
Link Here
|
| 659 |
drop_effective_privs (); |
659 |
drop_effective_privs (); |
| 660 |
} |
660 |
} |
| 661 |
/* then the hierarchy */ |
661 |
/* then the hierarchy */ |
| 662 |
sprintf (catname, "%s/cat1", catdir); |
662 |
snprintf (catname, sizeof(catname), "%s/cat1", catdir); |
| 663 |
if (is_directory (catdir) == 1) { |
663 |
if (is_directory (catdir) == 1) { |
| 664 |
int j; |
664 |
int j; |
| 665 |
regain_effective_privs (); |
665 |
regain_effective_privs (); |
|
Lines 668-675
Link Here
|
| 668 |
"creating catdir hierarchy %s ", |
668 |
"creating catdir hierarchy %s ", |
| 669 |
catdir); |
669 |
catdir); |
| 670 |
for (j = 1; j <= 9; j++) { |
670 |
for (j = 1; j <= 9; j++) { |
| 671 |
sprintf (catname, "%s/cat%d", catdir, j); |
671 |
snprintf (catname, sizeof(catname), "%s/cat%d", catdir, j); |
| 672 |
sprintf (manname, "%s/man%d", mandir, j); |
672 |
snprintf (manname, sizeof(manname), "%s/man%d", mandir, j); |
| 673 |
if ((is_directory (manname) == 1) |
673 |
if ((is_directory (manname) == 1) |
| 674 |
&& (is_directory (catname) != 1)) { |
674 |
&& (is_directory (catname) != 1)) { |
| 675 |
if (mkdir (catname, |
675 |
if (mkdir (catname, |
|
Lines 703-708
Link Here
|
| 703 |
char key[50], cont[512]; |
703 |
char key[50], cont[512]; |
| 704 |
int c; |
704 |
int c; |
| 705 |
|
705 |
|
|
|
706 |
memset(key, 0, sizeof(key)); |
| 707 |
memset(cont, 0, sizeof(cont)); |
| 708 |
|
| 706 |
while ((bp = fgets (buf, BUFSIZ, config))) { |
709 |
while ((bp = fgets (buf, BUFSIZ, config))) { |
| 707 |
|
710 |
|
| 708 |
while (isspace (*bp)) |
711 |
while (isspace (*bp)) |
|
Lines 714-726
Link Here
|
| 714 |
continue; /* mach any word starting with NO */ |
717 |
continue; /* mach any word starting with NO */ |
| 715 |
else if (sscanf (bp, "MANBIN %*s") == 1) |
718 |
else if (sscanf (bp, "MANBIN %*s") == 1) |
| 716 |
continue; |
719 |
continue; |
| 717 |
else if (sscanf (bp, "MANDATORY_MANPATH %s", key) == 1) |
720 |
else if (sscanf (bp, "MANDATORY_MANPATH %49s", key) == 1) |
| 718 |
add_mandatory (key); |
721 |
add_mandatory (key); |
| 719 |
else if (sscanf (bp, "MANPATH_MAP %s %s", key, cont) == 2) |
722 |
else if (sscanf (bp, "MANPATH_MAP %49s %511s", key, cont) == 2) |
| 720 |
add_manpath_map (key, cont); |
723 |
add_manpath_map (key, cont); |
| 721 |
else if ((c = sscanf (bp, "MANDB_MAP %s %s", key, cont)) > 0) |
724 |
else if ((c = sscanf (bp, "MANDB_MAP %49s %511s", key, cont)) > 0) |
| 722 |
add_mandb_map (key, cont, c, user); |
725 |
add_mandb_map (key, cont, c, user); |
| 723 |
else if ((c = sscanf (bp, "DEFINE %50s %511[^\n]", |
726 |
else if ((c = sscanf (bp, "DEFINE %49s %511[^\n]", |
| 724 |
key, cont)) > 0) |
727 |
key, cont)) > 0) |
| 725 |
add_def (key, cont, c); |
728 |
add_def (key, cont, c); |
| 726 |
else if (sscanf (bp, "SECTION %511[^\n]", cont) == 1) |
729 |
else if (sscanf (bp, "SECTION %511[^\n]", cont) == 1) |