Postinst is not robust
Bug #32705 reported by
Dan
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sysvinit (Ubuntu) |
Fix Released
|
Medium
|
Scott James Remnant (Canonical) |
Bug Description
The postinst in 2.86.ds1-6ubuntu16 attempts to create /var/lock and /var/run on the parent filesystem of /var. It does this by moving whatever is mounted on /var to /tmp/.var. This fails if /tmp is a softlink to /var/tmp (as on my system), and introduces a possible race condition.
Suggested fix: use a bind mount to access the parent filesystem rather than a move mount. e.g.,
mount --bind / /tmp/.root
mkdir -p /tmp/.root/var/lock /tmp/.root/var/run
umount /tmp/.root
rmdir /tmp/.root
It would be even better to use `tempfile` as the mount point.
Changed in sysvinit: | |
assignee: | nobody → keybuk |
To post a comment you must log in.
Fixed in today's upload