Commit Graph

198 Commits

Author SHA1 Message Date
Antonio Terceiro 4fd2373753 nfs: avoid adding extra newlines to /etc/exports
StringBlockEditor already adds the necessary newlines. That extra
newline was making /etc/exports longer and longer, full of empty lines,
because StringBlockEditor doesn't know about it and does not remove it.
2019-11-17 00:33:08 -03:00
Jeff Bonhag 8a69c1205c
Fixes #10170: Check for modinfo in /sbin (#11178)
Check for modinfo in /sbin if it doesn't appear on the PATH.

If it's not found on the PATH or in /sbin, the command will default back to modinfo so the user sees the error message about adding it to their PATH.
2019-11-06 16:10:24 -05:00
Chris Roberts b12a23273e
Merge pull request #11108 from chrisroberts/macos-catalina
Fix NFS sharing in macOS 10.15 (based on #11105)
2019-10-10 09:20:33 -07:00
Chris Roberts 8f42dbff21 Add a resolve_host_path capability for bsd and darwin hosts
For bsd the resolve_host_path capability is a no-op. For darwin
hosts, if firmlinks are defined on the system, paths will be properly
resolved to real path.
2019-10-08 16:41:48 -07:00
Chris Roberts 2c16c96e57 Update nfs_export cap to use resolve_host_path cap for shared directories
Using the resolve_host_path capability allows hosts to modify the
shared folder directory while keeping the logic contained within
the specific host implementation.
2019-10-08 16:38:52 -07:00
Andy Fowler e288a5b732 `df` -> `/bin/df` to use macOS version
Thanks, @AntonioMeireles!
2019-10-08 13:21:34 -07:00
Andy Fowler ae9c3e28d6 Fix #10961 NFS sharing in macOS 10.15 host
On OS X 10.15, / is read-only and paths inside of /Users (and elsewhere)
are mounted via a "firmlink" (which is a new invention in APFS). These
must be resolved to their full path to be shareable via NFS.

/Users/johnsmith/mycode  =>  /System/Volumes/Data/Users/johnsmith/mycode

We check to see if a path is mounted here with `df`, and prepend it.

Firmlinks are only createable by the OS and this wasn't supposed to be
visible to applications anyway:
https://developer.apple.com/videos/play/wwdc2019/710/?time=481
2019-10-08 13:21:34 -07:00
Dan Čermák a3588c28a8
Update nfs & service daemon names for suse based hosts
- nfs.service got recently removed in openSUSE Tumbleweed and calling service
  restart nfs errors out on Tumbleweed. nfs.service has been an alias to
  nfs-client.target for a very long time and can thus be safely substituted.
- all actively supported versions of openSUSE & SLE are using systemd now
  => no reason not to use systemctl
2019-09-18 23:28:18 +02:00
Brian Cain fc4e03d559
Fixes #10609: Properly set BSD options for /etc/exports
Prior to this commit, the BSD options for the /etc/exports file was not
properly set up in the correct order for a given entry. It was however
fixed for FreeBSD, but never for the original exports template. This
commit fixes that by unifying the BSD and FreeBSD templates.
2019-06-13 11:44:12 -07:00
Renato Aguiar 4de7716ffb Fix NFS capability detection on Void Linux 2019-03-05 10:03:52 -08:00
Chris Roberts f4cb33e954
Merge pull request #10012 from Aloz1/add-host-voidlinux
Add void linux host support
2018-12-19 16:21:52 -08:00
Chris Roberts ac5b45445a Remove use of `system`. Add test coverage. 2018-12-19 12:19:22 -08:00
Chris Roberts ee2072ec53 Automatically answer yes when pruning SMB shares 2018-12-19 08:59:13 -08:00
Chris Roberts 924fb97e8c Only prepare 10 shares per command to prevent exceeding allowed command size
When a large number of shares are defined it may cause the generated
command to exceed the maximum allowed length. To prevent this, only
allow 10 shares to be processed at a time.

Fixes #10483
2018-12-07 12:56:55 -08:00
Chris Roberts c4084a6387 Extract smblist information based on position
Since we are no longer extracting information based on key value due
to localization issues, use start and end locations to extract data.
This prevents errors when extra information is included like Scope.
2018-08-30 10:58:56 -07:00
Chris Roberts 051c7a7823 Fix sudo usage in exports write within linux host cap
Only move new exports file to destination without sudo when the
file has write access and the directory has write access. Always
use sudo when changing file ownership.
2018-08-02 15:13:27 -07:00
Chris Roberts 2096bce36f Remove localization dependency from SMB list generation 2018-07-19 13:40:54 -07:00
Aloz1 b9b9eeac85 Void requires root access to check service status
Service status check was failing because it was not being run as root. This resulted in vagrant thinking the service was not running, hence it would always try to start nfs rather than updating exports.
2018-07-14 15:53:13 +10:00
Aloz1 5e258cbc7c Fixed nfs_start_command. NFS now starts. 2018-07-13 08:08:05 +10:00
Aloz1 98f70d4d7a Add void linux host support 2018-07-12 08:40:33 +10:00
Chris Roberts 10ac204c29 Prevent SMB output from being wrapped 2018-06-12 16:47:47 -07:00
Chris Roberts ee5656da37
Merge pull request #9923 from chrisroberts/f-win-perms
Update SSH key file permissions handling
2018-06-12 16:45:39 -07:00
Chris Roberts e39b3555e6 Disable inherit on key file for parent ACL rules 2018-06-12 16:21:13 -07:00
Chris Roberts ae8e25aabc Include key path flag when calling script 2018-06-12 16:20:49 -07:00
Chris Roberts 16bcc1d874 Include scripts directory when building pathname 2018-06-12 16:20:30 -07:00
Chris Roberts 98c6903e9c Fix path variable name. Return process result. 2018-06-12 11:56:37 -07:00
Chris Roberts a5582eb1c8 Add ssh key permissions set caps to hosts 2018-06-12 10:49:10 -07:00
Chris Roberts ef5eca16d2 Fix SMB information generation when using net share
Adds the final line of output to tests and properly simulates
failure. Fix with type casting to prevent calling methods on
nil and drop the final entry as it's not valid.

Fixes #9806
2018-06-11 12:58:35 -07:00
Chris Roberts 7a4150dc3f Use net.exe to fetch SMB shares when Get-SmbShare is not available
Fixes #9547
2018-05-04 14:07:33 -07:00
Stefan Scherer a01d68b2e0
Call mstsc in WSL 2018-05-02 15:21:47 +02:00
Chris Roberts 40a1d2faf3 Default SMB version to 2.0 for linux guest mounts
Fixes #8959
2018-04-26 08:45:05 -07:00
Josh Soref 1a5ddea9f4 Spelling fixes
* account
* addresses
* administrator
* afterwards
* because
* bridgeable
* capabilities
* capability
* checksum
* configuration
* configuration for
* configure
* criteria
* delimited
* delivered
* derivatives
* description
* detect
* directory
* display
* downloading
* during
* electric
* enabling
* encountered
* equivalent
* executable
* executed
* hashicorp
* hypervisor
* hyphens
* implementation
* incorporate
* inheritance
* initialize
* instance
* instead
* interactions
* invocable
* machine
* maximum
* message
* mounting
* overridden
* overwrite
* paramiko
* preparing
* provides
* provisioning
* recursively
* requested
* resetting
* retryable
* running
* satisfied
* searching
* sometimes
* specified
* successfully
* synced folders
* unauthorized
* underlying
* userprofile
* vagrant
* vagrantfile
* variable
* various
* version
* virtual
* windows
2018-03-14 14:41:04 +00:00
Chris Roberts 5444271268 Move SMB credentials validation into host capability 2018-01-12 16:55:35 -08:00
Lachlan Arthur 01bc2627be Check SMB credentials before using them 2018-01-12 15:46:31 -08:00
Chris Roberts b0fc6a06a1
Merge pull request #9294 from chrisroberts/e-smb
SMB synced folders enhancements
2018-01-12 15:02:08 -08:00
Chris Roberts 0ffec9cd6f Include explicit start to ensure start 2018-01-12 14:25:37 -08:00
Chris Roberts 2f3d165079 Remove version from darwin host custom mount options 2018-01-03 14:41:53 -08:00
Chris Roberts abf74e3757 Expand existing and requested paths prior to comparison 2018-01-03 10:05:05 -08:00
Chris Roberts 3eeff59329 Use custom types and messages for errors 2018-01-02 14:36:28 -08:00
Chris Roberts 30dcd9a7e5 Only add/remove shares on windows when needed 2018-01-02 14:03:54 -08:00
Chris Roberts 24d962eb72 Swap usage of share name and id for consistent behavior 2018-01-02 14:03:34 -08:00
Chris Roberts 98ec1af30e Add smb_start capability for darwin 2018-01-02 11:21:50 -08:00
Chris Roberts 68439f6bac Use sudo for sharing lists on darwin platform
On systems prior to high sierra the sharing binary
requires root user for access, so use sudo to get
full list output and inspect output.
2017-12-21 14:53:55 -08:00
Chris Roberts 88d2b3676f Remove stale comments from helper scripts 2017-12-21 10:19:28 -08:00
Chris Roberts 61bfbade48 Remove raise error logic in windows smb capability 2017-12-21 09:55:19 -08:00
Chris Roberts 81cbdae62a Make powershell error generalized 2017-12-21 09:55:19 -08:00
Chris Roberts f89c6a37f9 Provide namespace to error class 2017-12-21 09:55:19 -08:00
Chris Roberts 00fa50c296 SMB enhancements 2017-12-21 09:55:19 -08:00
Chris Roberts 120722ab08 Update NFS service name usage for linux hosts
Provides simple nfs service name detection via systemd or sys-v. Defaults
are provided if no match is found. Service name is defined via method
allowing derivative guests to only need to provide an updated name.
2017-12-14 08:35:07 -08:00
Chris Roberts 2451c859e8 Merge pull request #8746 from mastersin/alt
Add ALT Linux platforms guest detection and network configuration support (#8745)
2017-09-06 17:49:38 -07:00