Use 32-bit integer for NFS fsuid for older kernels [GH-1127]

This commit is contained in:
Mitchell Hashimoto 2013-07-17 23:34:47 -04:00
parent 04afd11fd1
commit a0543d7c7c
2 changed files with 6 additions and 6 deletions

View File

@ -8,6 +8,8 @@ BUG FIXES:
- NFS exports with improper casing on Mac OS X work properly. [GH-1202] - NFS exports with improper casing on Mac OS X work properly. [GH-1202]
- Shared folders overriding '/vagrant' in multi-VM environments no - Shared folders overriding '/vagrant' in multi-VM environments no
longer all just use the last value. [GH-1935] longer all just use the last value. [GH-1935]
- NFS export fsid's are now 32-bit integers, rather than UUIDs. This
lets NFS exports work with Linux kernels older than 2.6.20. [GH-1127]
## 1.2.4 (July 16, 2013) ## 1.2.4 (July 16, 2013)

View File

@ -1,6 +1,6 @@
require 'digest/md5'
require 'fileutils' require 'fileutils'
require 'pathname' require 'pathname'
require 'zlib'
require "log4r" require "log4r"
@ -95,11 +95,9 @@ module Vagrant
opts[:map_gid] = prepare_permission(:gid, opts) opts[:map_gid] = prepare_permission(:gid, opts)
opts[:nfs_version] ||= 3 opts[:nfs_version] ||= 3
# The poor man's UUID. An MD5 hash here is sufficient since # We use a CRC32 to generate a 32-bit checksum so that the
# we need a 32 character "uuid" to represent the filesystem # fsid is compatible with both old and new kernels.
# of an export. Hashing the host path is safe because two of opts[:uuid] = Zlib.crc32(opts[:hostpath]).to_s
# the same host path will hash to the same fsid.
opts[:uuid] = Digest::MD5.hexdigest(opts[:hostpath])
end end
# Prepares the UID/GID settings for a single folder. # Prepares the UID/GID settings for a single folder.