Bug 194086 - [patch] net/GeoIP: geoipupdate.sh still don't update file atomically
Summary: [patch] net/GeoIP: geoipupdate.sh still don't update file atomically
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Adam Weinberger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-02 07:05 UTC by Yasuhito FUTATSUKI
Modified: 2014-10-13 01:32 UTC (History)
0 users

See Also:
freebsd-bug-report-yf: maintainer-feedback? (adamw)


Attachments
patch to fix problem, create temp dir on same device (503 bytes, text/plain)
2014-10-02 07:05 UTC, Yasuhito FUTATSUKI
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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