Skip to content

It doesn't work with debian 9 (stretch) #8

@fabioperrella

Description

@fabioperrella

In debian 9 image, the su command does not send the exported functions to the context of the command running in su, so the suexec command does not work. (if $BRICKS_LINUX == "true").

To simulate in debian 8 (jessie):

$ docker run -it debian:jessie bash

# paste the code below

info() {
    message=$1;
    echo -e "\n\033[32m${message}\033[0m\n";
}
export -f info

useradd -u 1000 -m -d /home/builder builder
su builder -m -c "bash -ec 'type info'"
# info is a function
# info () 
#{ 
#   message=$1;
#    echo -e "\n\033[32m${message}\033[0m\n"
#}

To simulate in debian 9 (strech):

$ docker run -it debian:strech bash

# paste the code below

info() {
    message=$1;
    echo -e "\n\033[32m${message}\033[0m\n";
}
export -f info

useradd -u 1000 -m -d /home/builder builder
su builder -m -c "bash -ec 'type info'"
# bash: line 0: type: info: not found

As an alternative, it is possible to use $BRICKS_LINUX == "false", so all the commands will run with the root user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions