Opened 11 years ago

Closed 11 years ago

#2007 closed defect (fixed)

udhcpc default.script should mv to avoid races

Reported by: atomota Owned by: developers
Priority: normal Milestone:
Component: base system Version:
Keywords: Cc:


In Kamikaze 7.06, /usr/share/udhcpc/default.script is writing /tmp/ by clearing it then echoing to it a line at a time. This will create races with other processes reading it while it is being written. For example, if dnsmasq were to read /tmp/ after it was cleared but before it had been rewritten, it would see an empty file, which is not good.

default.script should be using mv to replace atomically. I've attached a patch which causes default.script to create a new using a temporary name, and mv the file to once it has been completely written so that there are no races.

Attachments (1)

default.script.diff (544 bytes) - added by atomota 11 years ago.

Download all attachments as: .zip

Change History (2)

Changed 11 years ago by atomota

comment:1 Changed 11 years ago by nbd

  • Resolution set to fixed
  • Status changed from new to closed

fixed in [7952]

Add Comment

Modify Ticket

as closed .
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.