Public bug reported:

With live-build 3.0~a57-1ubuntu49.1 on Noble, /usr/bin/lb tries to load
some environment variables from config/environment and
config/environment.binary

    ENV=""

    for _FILE in config/environment config/environment.binary
    do
        if [ -e "${_FILE}" ]
        then
            ENV="${ENV} $(grep -v '^#' ${_FILE})"
        fi
    done

Then it executes

    LB=1 ${ENV} exec "${SCRIPT}" "${@}"

The intention is that ${ENV} here will expand to FOO=BAR etc. and
thereby populate the environment when executing the script. But the
shell doesn't allow you to do this; it will interpret ${ENV} as a
command name. Here's a minimal demonstration:

    $ sh -c 'FOO="A=B"; ${FOO} /usr/bin/env'
    sh: 1: A=B: not found

The upstream Debian version does it correctly:

    exec /usr/bin/env ${ENV} "${SCRIPT}" ${GLOBAL_ARGS} "${@}"

Fixed here: https://salsa.debian.org/live-team/live-
build/-/commit/8b1f9f0131a96cf2a6b3764de5140e13a3adb3eb

** Affects: live-build (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2122622

Title:
  Loading environment before executing script is broken

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/live-build/+bug/2122622/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to