Skip to content

Commit

Permalink
sys-apps/busybox: Disable standalone shell mode with USE=make-symlinks
Browse files Browse the repository at this point in the history
* Busybox has by default enabled CONFIG_FEATURE_PREFER_APPLETS
  and CONFIG_FEATURE_SH_STANDALONE which means it will
  bypass all PATH lookups and use its builtin applets.
  This is problematic as we sometimes might want to use the
  original program instead of Busybox applets, so let's
  disable those two options when building with USE=make-symlinks.
  This also enables users to disable a builtin by deleting the
  corresponding symlink.

Closes: https://bugs.gentoo.org/729184
Signed-off-by: Jakov Smolic <jakov.smolic@sartura.hr>
  • Loading branch information
jsmolic committed Aug 19, 2021
1 parent 4d67214 commit 979e05f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ src_configure() {
busybox_config_option n FEATURE_VI_REGEX_SEARCH
fi

# Disable standalone shell mode when using make-symlinks, else Busybox calls its
# applets by default without looking up in PATH.
# This also enables users to disable a builtin by deleting the corresponding symlink.
if use make-symlinks; then
busybox_config_option n FEATURE_PREFER_APPLETS
busybox_config_option n FEATURE_SH_STANDALONE
fi

# If these are not set and we are using a uclibc/busybox setup
# all calls to system() will fail.
busybox_config_option y ASH
Expand Down
8 changes: 8 additions & 0 deletions sys-apps/busybox/busybox-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ src_configure() {
busybox_config_option n FEATURE_VI_REGEX_SEARCH
fi

# Disable standalone shell mode when using make-symlinks, else Busybox calls its
# applets by default without looking up in PATH.
# This also enables users to disable a builtin by deleting the corresponding symlink.
if use make-symlinks; then
busybox_config_option n FEATURE_PREFER_APPLETS
busybox_config_option n FEATURE_SH_STANDALONE
fi

# If these are not set and we are using a uclibc/busybox setup
# all calls to system() will fail.
busybox_config_option y ASH
Expand Down

0 comments on commit 979e05f

Please sign in to comment.