Bug 194086

Summary: [patch] net/GeoIP: geoipupdate.sh still don't update file atomically
Product: Ports & Packages Reporter: Yasuhito FUTATSUKI <freebsd-bug-report-yf>
Component: Individual Port(s)Assignee: Adam Weinberger <adamw>
Status: Closed FIXED    
Severity: Affects Many People Flags: freebsd-bug-report-yf: maintainer-feedback? (adamw)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch to fix problem, create temp dir on same device none

Description Yasuhito FUTATSUKI 2014-10-02 07:05:46 UTC
Created attachment 147901 [details]
patch to fix problem, create temp dir on same device

geoipupdate.sh don't update GeoIP.dat and GeoIPv6.dat atomically when $TEMPDIR and %%DATADIR%% are not on the same device.

mv(1) first try to rename(2), which is atomically replace the file, but
if failed becase of cross devices, then copy file without any lock mechanism.
It is why working file should be placed under the same directory.
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-10-02 07:05:46 UTC
Auto-assigned to maintainer adamw@FreeBSD.org
Comment 2 Adam Weinberger freebsd_committer freebsd_triage 2014-10-13 01:31:48 UTC
Committed, thanks!
Comment 3 commit-hook freebsd_committer freebsd_triage 2014-10-13 01:32:17 UTC
A commit references this bug:

Author: adamw
Date: Mon Oct 13 01:31:29 UTC 2014
New revision: 370750
URL: https://svnweb.freebsd.org/changeset/ports/370750

Log:
  Create the temporary directory within DATADIR, to ensure they're created
  on the same device as their destination.

  While here, use USES=autoreconf, and remove the @dirrm.

  PR:		194086
  Submitted by:	Yasuhito FUTATSUKI

Changes:
  head/net/GeoIP/Makefile
  head/net/GeoIP/files/geoipupdate.sh.in
  head/net/GeoIP/pkg-plist