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



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 other 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 == NULL)
-                  bp = strdup(DEFAULT_BOOTDIR "/" DEFAULT_BOOTCODE);
-          else if (*bootpath == '/')
-                  bp = strdup(bootpath);
-          else {
-                  if (asprintf(&bp, "%s/%s", DEFAULT_BOOTDIR, bootpath) < 0)
-                          bp = 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.

From 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