Looking at grub-editenv.c, as Colin said, it does call fsync explicitly
so my theory was wrong.

However, it looks like grub-editenv is still not atomic: If you run
"grub-editenv /boot/grub/grubenv set foo=bar" the first thing it does in
create_env_blk_file() is call fopen( "/boot/grub/grubenv", "wb" )
truncating the actual file, not a temporary version. So if grub-editenv
crashes between the fopen() and the fwrite() ( admittedly only two real
lines of code ) or somehow fopen() succeeds but fwrite() fails, you will
be left with a zero byte file.

Is there a reason why grub-editenv doesn't write to a temporary file?
Would grub-editenv calling grub_util_error() or otherwise crashing
trigger apport?

-- 
invalid: environment block
https://bugs.launchpad.net/bugs/439784
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to