summaryrefslogtreecommitdiffhomepage
path: root/runsc/fsgofer
diff options
context:
space:
mode:
authorRobert Tonic <btonic@users.noreply.github.com>2019-09-24 18:24:10 -0400
committerRobert Tonic <btonic@users.noreply.github.com>2019-09-24 18:24:10 -0400
commit7810b30983ec4d3a706df01163c29814cd21d6ca (patch)
tree1019008f5c8cc637dd764cd2b4f072e1b5d15e4e /runsc/fsgofer
parente975184bc50944e82a6bf5f4c57bbe970933fdc5 (diff)
Refactor command line options and remove the allowed terminology for uds
Diffstat (limited to 'runsc/fsgofer')
-rw-r--r--runsc/fsgofer/fsgofer.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/runsc/fsgofer/fsgofer.go b/runsc/fsgofer/fsgofer.go
index 357d712c6..507d52b50 100644
--- a/runsc/fsgofer/fsgofer.go
+++ b/runsc/fsgofer/fsgofer.go
@@ -87,8 +87,8 @@ type Config struct {
// PanicOnWrite panics on attempts to write to RO mounts.
PanicOnWrite bool
- // HostUDSAllowed signals whether the gofer can mount a host's UDS.
- HostUDSAllowed bool
+ // HostUDS signals whether the gofer can mount a host's UDS.
+ HostUDS bool
}
type attachPoint struct {
@@ -143,7 +143,7 @@ func (a *attachPoint) Attach() (p9.File, error) {
switch fmtStat := stat.Mode & syscall.S_IFMT; fmtStat {
case syscall.S_IFSOCK:
// Check to see if the CLI option has been set to allow the UDS mount.
- if !a.conf.HostUDSAllowed {
+ if !a.conf.HostUDS {
return nil, errors.New("host UDS support is disabled")
}
@@ -1059,6 +1059,10 @@ func (l *localFile) Flush() error {
// Connect implements p9.File.
func (l *localFile) Connect(p9.ConnectFlags) (*fd.FD, error) {
+ // Check to see if the CLI option has been set to allow the UDS mount.
+ if !l.attachPoint.conf.HostUDS {
+ return nil, errors.New("host UDS support is disabled")
+ }
return fd.DialUnix(l.hostPath)
}