mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-23 22:41:10 +01:00
ldconfig(8): check for no-args command line after options are parsed
Default action for ldconfig is specified as -R AKA 'append', and for no-args (without options changing default actions), ldconfig should append empty list of directories to current list. But because the check was done before options were parsed out, presence of any option turned off default rescan. As result, innocently-looked commands like `ldconfig -v' were interpreted as setting directory hints list to one specified on the command line, i.e. empty. Reported by: https://github.com/mesonbuild/meson/issues/9592 Reviewed by: emaste Tested by: jbeich Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D33058
This commit is contained in:
parent
af91158706
commit
3ede04c78c
@ -90,9 +90,7 @@ main(int argc, char **argv)
|
||||
hints_file = _PATH_ELF32_HINTS;
|
||||
else
|
||||
hints_file = _PATH_ELF_HINTS;
|
||||
if (argc == 1)
|
||||
rescan = true;
|
||||
else while((c = getopt(argc, argv, "Rf:imrsv")) != -1) {
|
||||
while((c = getopt(argc, argv, "Rf:imrsv")) != -1) {
|
||||
switch (c) {
|
||||
case 'R':
|
||||
rescan = true;
|
||||
@ -121,11 +119,14 @@ main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (justread)
|
||||
if (justread) {
|
||||
list_elf_hints(hints_file);
|
||||
else
|
||||
} else {
|
||||
if (argc == optind)
|
||||
rescan = true;
|
||||
update_elf_hints(hints_file, argc - optind,
|
||||
argv + optind, merge || rescan);
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user