NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: bin/53553: gpt biosboot forcibly prepends /usr/mdec to any other paht
The following reply was made to PR bin/53553; it has been noted by GNATS.
From: eric%cirr.com@localhost (Eric Schnoebelen)
To: gnats-bugs%NetBSD.org@localhost
Cc: gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
Subject: Re: bin/53553: gpt biosboot forcibly prepends /usr/mdec to any other paht
Date: Fri, 31 Aug 2018 11:28:52 -0500
John Nemeth writes:
- On Aug 25, 10:20pm, eric%cirr.com@localhost wrote:
- } >Number: 53553
- } >Category: bin
- } >Synopsis: gpt biosboot forcibly prepends /usr/mdec to any othe=
r paht
- } >Description:
- } Attempting to use a gpt(8) biosboot subcommand with a file
- } in any location other than /usr/mdec gets /usr/mdec forcibly
- } prepended to the path.
- =
- The code is:
- =
- if (bootpath =3D=3D NULL)
- bp =3D strdup(DEFAULT_BOOTDIR "/" DEFAULT_BOOTCODE);
- else if (*bootpath =3D=3D '/')
- bp =3D strdup(bootpath);
- else {
- if (asprintf(&bp, "%s/%s", DEFAULT_BOOTDIR, bootpath) <=
0)
- bp =3D NULL;
- }
- =
- It would be easy enough to change the second part to see if the
- path starts with "." which is a common way of stopping the prepending
- of a default path. I'm undecided if it should check for "/" anywhere
- in the path. However, if that's what people think is best, I'm
- willing to make either change. I checked the installboot source
- to see what it does, and it just uses the path as given. I think
- adding a default path makes it somewhat more convenient to use.
After a few days reflection, I would be happy if the current
mechanisms were documented on the gpt(8) manual page.
Given the lack of documentation there, and the first error when
trying an unanchored path, I followed the common practice of
prepending './' to try and anchor do the current directory.
=46rom my perspective, either choice would be sufficent to remove
the frustration I experienced. However, the second might bring it into
line with a large number of other tools. =
Thanks,
Eric
Home |
Main Index |
Thread Index |
Old Index