Commit Graph

17 Commits

Author SHA1 Message Date
Mitchell Hashimoto f26293bb06 hosts/linux: sudo to copy back to exports [GH-5957] 2015-07-15 11:04:05 -07:00
Seth Vargo bfbf96c385 Fallback to /tmp if $TMPDIR is not set 2015-07-13 10:40:28 -04:00
William Durand 6ff15fbedb
Being able to edit a file does not mean you can write in its parent directory
Interactive `sed` needs write permission on the file itself. However, it
may create a backup file, which leads to the fact that the directory
where the file is located must be writable as well. That is a side
effect because this directory does not need to be writable.

This patch fixes this side effect by editing the file in `/tmp`, and
replaces it right after.
2015-06-01 10:02:13 +02:00
Si Beaumont 3deed353ae Allow colon in NFS ID regex
Signed-off-by: Si Beaumont <simon.beaumont@citrix.com>
2015-01-20 14:11:42 +00:00
Adam Spiers 6af715b0db silence warnings about unescaped '-' in re char class
Eliminate warnings like this:

vagrant/plugins/hosts/linux/cap/nfs.rb:74: warning: character class has '-' without escape: /^# VAGRANT-BEGIN:( 1000)? ([\.\/A-Za-z0-9-_]+?)$/
2014-10-25 15:38:13 +01:00
Mitchell Hashimoto ea983e32c8 hosts/*: NFS prune regexp matches file paths [GH-3815] 2014-10-24 12:16:53 -07:00
Mitchell Hashimoto cc01f01684 hosts/linux: don't use sudo to write NFS if writable [GH-2643] 2014-10-23 22:25:38 -07:00
Kalman Hazins bb052366f7 Change symbols inside hashes to 1.9 JSON-like syntax 2014-05-22 12:35:12 -04:00
Jon Topper 6ec9e3e279 Linux stuff now tested and working! 2014-05-06 12:24:35 +01:00
Jon Topper 4a4ca74dea Added missing 'sudo' call. 2014-05-06 10:05:53 +01:00
Jon Topper 0da334156b Fix up the Linux host too 2014-05-05 23:56:39 +01:00
Kevin Carmody 17c171559f Update nfs.rb
Make call to exportfs just use the system path.
2014-03-22 21:07:45 +00:00
Russell Jackson a3c94ab910 Fix Linux NFS exports pruning due to bad `sed` expression
The mount id is a file path which will contain forward slashes. A
previous attempt (although notably missing in the Linux host plugin) at
fixing this used `String.gsub` to escape the forward slashes; however,
the solution that eventually made its way into the 1.5 release uses
`Regexp.escape` which doesn't escape forward slashes.

The Ruby `Regexp.escape` method does not escape forward slashes because
they are not RE meta-characters; their special meaning is specific to
sed expressions as delimiters. To avoid the issue entirely, we can use
an alternative delimiter by prefixing the address expression with a
backslash with the desired delimiter character following.

Use control character (ASCII code point `0x01`) as expression delimiter
so it is very unlikely an identifier will have a conflicting character
within it.
2014-03-12 12:25:53 -07:00
Mitchell Hashimoto 7abcea35b8 hosts/linux: escape regular expression for prune NFS exports [GH-2934] 2014-02-24 07:51:06 -08:00
BlackEagle b30eacf94f nfs_apply :: exportfs sometimes leaves exports behind
On my machine i had a case where /etc/exports was updated but the old
exports were still there. This was leading to
"exportfs: duplicated export entries" and eventually leading to nfs
being not available for the box.

changing the command exportfs -r to exportfs -ar seems to address this
issue.

Signed-off-by: BlackEagle <ike.devolder@gmail.com>
2014-01-17 10:54:17 +01:00
Gustavo Gama 262e2c0192 Fix typo 2014-01-15 09:40:41 -02:00
Mitchell Hashimoto a6c7cc481e convert more hosts: arch and linux 2014-01-07 20:53:39 -08:00