Postinst is not robust

Bug #32705 reported by Dan
6
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
Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

Fixed in today's upload

Changed in sysvinit:
status: Unconfirmed → Confirmed
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.