Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 367241 - app-shells/bash-4.2_p10 - /bin/sh symlink is not rewritten atomically
Summary: app-shells/bash-4.2_p10 - /bin/sh symlink is not rewritten atomically
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-14 13:33 UTC by Tristan Heaven (RETIRED)
Modified: 2011-05-16 10:43 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
bash-4.2_p10.ebuild.patch (bash-4.2_p10.ebuild.patch,405 bytes, patch)
2011-05-14 13:33 UTC, Tristan Heaven (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tristan Heaven (RETIRED) gentoo-dev 2011-05-14 13:33:04 UTC
Created attachment 273195 [details, diff]
bash-4.2_p10.ebuild.patch

As can be seen with strace, ln -sf removes /bin/sh before rewriting it:

symlink("bash", "/bin/sh")              = -1 EEXIST (File exists)
unlink("/bin/sh")                       = 0
symlink("bash", "/bin/sh")              = 0

Here's a patch which should fix that by moving the new symlink from a temp file.
Comment 1 SpanKY gentoo-dev 2011-05-16 05:45:26 UTC
looks fine, feel free to commit to all the vers in the tree
Comment 2 Tristan Heaven (RETIRED) gentoo-dev 2011-05-16 10:43:31 UTC
Fixed.

'touch -h "${ROOT}"/bin/sh' would be better but I'm not sure it would work everywhere yet.