Command explanations
The sed commands fix a symlink vulnerability in ed. The ed
executable creates files in /tmp with predictable names. By using
various symlink attacks, it is possible to have ed write to files
it should not, change the permissions of various files, etc.