Skip to content

gnulib-update.sh: avoid /tmp - #181

Merged
twaugh merged 1 commit into
0.4.xfrom
gnulib-update-tmp-0.4.x
Oct 22, 2026
Merged

twaugh merged 1 commit into
0.4.xfrom
gnulib-update-tmp-0.4.x

Conversation

@twaugh

@twaugh twaugh commented Oct 22, 2026

Copy link
Copy Markdown
Owner

gnulib-update.sh cloned gnulib into the predictable path /tmp/gnulib-update and then executed gnulib-tool from it. On a multi-user system another user could pre-create that directory with their own gnulib-tool; the failed git clone did not stop the script, so the attacker's gnulib-tool would run, with the trailing rm -rf removing the evidence.

Clone into gnulib-tmp/ inside the source tree instead, fail hard on errors (set -e), and clean up on exit (trap). Also add gnulib-tmp/ to .gitignore.

Reported by Solar Designer in dc88e96 (comment).

Cloning into a predictable path in /tmp let another user on a
multi-user system pre-create that directory with their own
gnulib-tool, which would then be executed (the failed clone did not
stop the script, and the rm -rf afterwards removed the evidence).

Clone into gnulib-tmp/ inside the source tree instead, fail hard on
errors, and clean up on exit.

Assisted-by: GLM 5.3
@codecov

codecov Bot commented Oct 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.60%. Comparing base (e68fdd3) to head (9c05cd3).

Additional details and impacted files
@@           Coverage Diff           @@
##            0.4.x     #181   +/-   ##
=======================================
  Coverage   83.60%   83.60%           
=======================================
  Files           5        5           
  Lines        4215     4215           
  Branches     1006     1006           
=======================================
  Hits         3524     3524           
  Misses        691      691           
Flag Coverage Δ
unittests 83.60% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@twaugh
twaugh merged commit f4a7c5c into 0.4.x Oct 22, 2026
7 checks passed
@twaugh
twaugh deleted the gnulib-update-tmp-0.4.x branch October 22, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant