rtld: fixes for handling of the grouped options
Do not terminate scanning group when 'd' is encountered. The 'b' option must be last in the group, same as 'f'. Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D39544
This commit is contained in:
parent
71883128e5
commit
7cdfe51f30
@ -6029,13 +6029,16 @@ parse_args(char* argv[], int argc, bool *use_pathp, int *fdp,
|
|||||||
_rtld_error("Both -b and -f specified");
|
_rtld_error("Both -b and -f specified");
|
||||||
rtld_die();
|
rtld_die();
|
||||||
}
|
}
|
||||||
|
if (j != arglen - 1) {
|
||||||
|
_rtld_error("Invalid options: %s", arg);
|
||||||
|
rtld_die();
|
||||||
|
}
|
||||||
i++;
|
i++;
|
||||||
*argv0 = argv[i];
|
*argv0 = argv[i];
|
||||||
seen_b = true;
|
seen_b = true;
|
||||||
break;
|
break;
|
||||||
} else if (opt == 'd') {
|
} else if (opt == 'd') {
|
||||||
*dir_ignore = true;
|
*dir_ignore = true;
|
||||||
break;
|
|
||||||
} else if (opt == 'f') {
|
} else if (opt == 'f') {
|
||||||
if (seen_b) {
|
if (seen_b) {
|
||||||
_rtld_error("Both -b and -f specified");
|
_rtld_error("Both -b and -f specified");
|
||||||
@ -6050,7 +6053,8 @@ parse_args(char* argv[], int argc, bool *use_pathp, int *fdp,
|
|||||||
* name but the descriptor is what
|
* name but the descriptor is what
|
||||||
* will actually be executed).
|
* will actually be executed).
|
||||||
*
|
*
|
||||||
* -f must be the last option in, e.g., -abcf.
|
* -f must be the last option in the
|
||||||
|
* group, e.g., -abcf <fd>.
|
||||||
*/
|
*/
|
||||||
if (j != arglen - 1) {
|
if (j != arglen - 1) {
|
||||||
_rtld_error("Invalid options: %s", arg);
|
_rtld_error("Invalid options: %s", arg);
|
||||||
|
Loading…
Reference in New Issue
Block a user