Modify

Opened 11 years ago

Closed 11 years ago

#2007 closed defect (fixed)

udhcpc default.script should mv resolv.conf.auto to avoid races

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

Description

In Kamikaze 7.06, /usr/share/udhcpc/default.script is writing /tmp/resolv.conf.auto 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/resolv.conf.auto 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 resolv.conf.auto atomically. I've attached a patch which causes default.script to create a new resolv.conf.auto using a temporary name, and mv the file to resolv.conf.auto 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

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


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

 
Note: See TracTickets for help on using tickets.