chef / chef/chef-cli

embedded/bin should never be in the user's $PATH

Open
#103 40 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Aspect: UX Triage: Confirmed Type: Enhancement
Dominant language
Ruby
Stars
18
Forks
23
Avg merge
5d 17h
Merged PRs (30d)
1

Description

The /opt/chefdk/embedded/bin/ directory should never be in a user's $PATH. It contains executables that can interfere with with the normal working of a users system, such as clear, tput, xz, xml2-config, xslt-config, etc.

According to @lamont-granquist it was never intended to ever be put in the user's $PATH: chef/omnibus-chef#340

However, chef shell-init does add embedded/bin to the path:

$ chef shell-init bash
export PATH="/opt/chefdk/bin:/Users/docwhat/.chefdk/gem/ruby/2.1.0/bin:/opt/chefdk/embedded/bin:/opt/chefdk/bin:..."
export GEM_ROOT="/opt/chefdk/embedded/lib/ruby/gems/2.1.0"
export GEM_HOME="/Users/docwhat/.chefdk/gem/ruby/2.1.0"
export GEM_PATH="/Users/docwhat/.chefdk/gem/ruby/2.1.0:/opt/chefdk/embedded/lib/ruby/gems/2.1.0"

Further, ChefDK is crippled if you don't add embedded/bin to the $PATH

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the chef shell-init entry point and reproduce the Bash output shown in the issue. Trace why /opt/chefdk/embedded/bin is added to PATH, then verify that the generated environment no longer exposes it while ChefDK remains functional without that directory in PATH.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, ruby
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.