tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bootstrap: invalid characters in path



> On Sep 17, 2019, at 7:35 PM, Brook Milligan <brook%nmsu.edu@localhost> wrote:
> 
> 
>> On Sep 17, 2019, at 12:44 PM, Roland Illig <roland.illig%gmx.de@localhost> wrote:
>> 
>> Am September 17, 2019 6:21:34 PM UTC schrieb Brook Milligan <brook%nmsu.edu@localhost>:
>>> I am trying an unprivileged install of pkgsrc on a system where my home
>>> directory follows the pattern "user%organization.name@localhost".  Of course, the
>>> bootstrap script complains about the "@" in the path and quits.
>>> 
>>> Is this an important character to keep out of the mix?  Would it be
>>> acceptable in include it in this list of valid characters?
>> 
>> I think that a single @ will not cause any problems, as well as a single dot. Therefore it should be safe to allow these characters.
>> 
>> There might be strange side effects in a few packages if a path contained @prefix@ or "..". But that's not the case, and both the regular expression "." and the shell glob "." match the character ".", therefore it should work.
> 
> This patch allows my bootstrap to proceed and I have built a smallish number (~100) of packages just fine.
> 
> Cheers,
> Brook
> 
> --- bootstrap/bootstrap.orig    2019-09-16 10:55:50.664479123 -0600
> +++ bootstrap/bootstrap 2019-09-17 12:22:57.431172977 -0600
> @@ -353,7 +353,7 @@
> {
>        case "$1" in
>        "")     ;; # the default value will be used.
> -       *[!-A-Za-z0-9_./]*)
> +       *[!-A-Za-z0-9_./@]*)
>                die "ERROR: Invalid characters in path $1 (from $2)." ;;
>        */)     die "ERROR: The argument to $2 must not end in /." ;;
>        *//* | */. | */./* | */.. | */../*)
> 
> 

It turns out this is more complicated.  Yes, the patch allows the bootstrap to work and many packages no doubt will compile just fine.

However, it turns out that makeinfo complains with the following:

	Possible unintended interpolation of @XXX in string at (eval 12) line 1.

It seems that the command line, perhaps $0, is being interpolated by perl [1].  In the end, this may be a bug in gtexinfo, but the only uses of $0 that I see are as an argument to fileparse().  Thoughts?

In any case, it is probably premature to allow an '@' in the valid path for bootstrap.  I would, however, appreciate suggestions on addressing the makeinfo issue so that it would be possible.

Thanks.

Cheers,
Brook

[1] https://perlmaven.com/quoted-interpolated-and-escaped-strings-in-perl


Home | Main Index | Thread Index | Old Index