commit:     943ddb0c02896f2d507593971b04c24f52acb7d1
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Wed Aug  6 07:05:46 2025 +0000
Commit:     Kerin Millar <kfm <AT> plushkava <DOT> net>
CommitDate: Wed Aug  6 07:05:46 2025 +0000
URL:        https://gitweb.gentoo.org/proj/locale-gen.git/commit/?id=943ddb0c

Require either a null string or an absolute path for --prefix

The --prefix option is only intended for use by the sys-libs/glibc
ebuild, which is expected to pass either the value of ED or EROOT. For
the --prefix option-argument to specify something other than either a
null string or an absolute path would imply that something has gone
catastrophically wrong. Reject the option-argument in that case.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>

 locale-gen | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/locale-gen b/locale-gen
index 8ee16e9..c4887c4 100755
--- a/locale-gen
+++ b/locale-gen
@@ -176,6 +176,8 @@ sub parse_opts ($known_prefix, @args) {
        # Validate the options and option-arguments.
        if ($opt{'all'} && exists $opt{'config'}) {
                die "$PROGRAM: The --all and --config options are mutually 
exclusive\n";
+       } elsif (length $opt{'prefix'} && $opt{'prefix'} !~ m/^\//) {
+               die "$PROGRAM: The --prefix option must specify either a null 
string or an absolute path\n";
        }
 
        # Assign values for unspecified options that need them.

Reply via email to