[BUG] TMPDIR not quoted in init-plex-chown/run script

Open Beginner friendly
#458 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
92/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
docker, shell

Research direction

Open root/etc/s6-overlay/s6-rc.d/init-plex-chown/run and compare the unquoted TMPDIR use on line 8 with the quoted use on line 6. Verify the script with a TMPDIR path containing spaces; done means mkdir handles that path correctly without creating incorrect directories.

Written by the indexing model from the issue text.

Description

no-issue-activity

Current Behavior

In root/etc/s6-overlay/s6-rc.d/init-plex-chown/run, line 8 uses mkdir -p ${TMPDIR} without quoting the variable. While the default value (/run/plex-temp) doesn't contain spaces, if a user sets TMPDIR to a path with spaces, the mkdir command will fail or create the wrong directory.

Expected Behavior

TMPDIR should be quoted consistently, like it is on line 6 where rm -rf "${TMPDIR}" is used.

Steps To Reproduce

  1. Set TMPDIR=/path with spaces/plex-temp in docker create/run command
  2. Start the container
  3. The mkdir -p command will fail or create incorrect directories

Environment

  • OS: Any
  • How docker service was installed: Any
  • CPU architecture: x86-64 or arm64
  • Docker creation: Any docker create/run command with TMPDIR containing spaces

Container logs

N/A - this is a code quality issue

Dominant language
Dockerfile
Stars
1.4k
Forks
228
PR merge metrics
No merged PRs in 30d

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.

More from linuxserver/docker-plex

All issues in linuxserver/docker-plex

Similar issues

More DevOps issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.