write ubuntu_command file atomically

Bug #1241236 reported by Barry Warsaw
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu system image
Fix Released
High
Barry Warsaw
system-image (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

There's a small window of opportunity for mischief. Let's say something goes wrong while we're writing the ubuntu_command file, and yet the device still gets rebooted. recovery will see the incomplete ubuntu_command file and will apply an incomplete set of commands, which could brick the phone.

The solution is rather easy: write the ubuntu_command file atomically. If a failure occurs during write, then recovery won't see an update. Only once the file is successfully written do we toggle the file in place and reboot.

Tags: client
Barry Warsaw (barry)
tags: added: client
Barry Warsaw (barry)
Changed in ubuntu-system-image:
milestone: none → 2.0
assignee: nobody → Barry Warsaw (barry)
importance: Undecided → High
status: New → In Progress
Barry Warsaw (barry)
Changed in ubuntu-system-image:
status: In Progress → Fix Committed
Barry Warsaw (barry)
Changed in ubuntu-system-image:
status: Fix Committed → Fix Released
Barry Warsaw (barry)
Changed in system-image (Ubuntu):
status: New → 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.