Skip to content

Commit 5315b66

Browse files
committed
Issue #30
1 parent 47fd69f commit 5315b66

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

netshare/drivers/cifs.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func (c cifsDriver) Mount(r volume.Request) volume.Response {
7070
return volume.Response{Err: err.Error()}
7171
}
7272

73-
if err := c.mountVolume(source, hostdir, c.getCreds(host)); err != nil {
73+
if err := c.mountVolume(r.Name, source, hostdir, c.getCreds(host)); err != nil {
7474
return volume.Response{Err: err.Error()}
7575
}
7676
c.mountm.Add(r.Name, hostdir)
@@ -127,7 +127,7 @@ func (c cifsDriver) parseHost(r volume.Request) string {
127127
return name
128128
}
129129

130-
func (s cifsDriver) mountVolume(source, dest string, creds *cifsCreds) error {
130+
func (s cifsDriver) mountVolume(name, source, dest string, creds *cifsCreds) error {
131131
var opts bytes.Buffer
132132

133133
opts.WriteString("-o ")
@@ -136,8 +136,8 @@ func (s cifsDriver) mountVolume(source, dest string, creds *cifsCreds) error {
136136
var domain = creds.domain
137137
var security = creds.security
138138

139-
if s.mountm.HasOptions(dest) {
140-
mopts := s.mountm.GetOptions(dest)
139+
if s.mountm.HasOptions(name) {
140+
mopts := s.mountm.GetOptions(name)
141141
if v, found := mopts[UsernameOpt]; found {
142142
user = v
143143
}
@@ -173,7 +173,7 @@ func (s cifsDriver) mountVolume(source, dest string, creds *cifsCreds) error {
173173

174174
opts.WriteString(fmt.Sprintf("%s %s", source, dest))
175175
cmd := fmt.Sprintf("mount -t cifs %s", opts.String())
176-
log.Debugf("Executing: %s\n", strings.Replace(cmd, pass, "", 1))
176+
log.Debugf("Executing: %s\n", strings.Replace(cmd, "password="+pass, "password=****", 1))
177177
return run(cmd)
178178
}
179179

netshare/drivers/driver.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@ func (v volumeDriver) Create(r volume.Request) volume.Response {
2828

2929
log.Debugf("Create volume -> name: %s, %v", r.Name, r.Options)
3030

31-
// TODO - check for share option
32-
// TODO - refactor to use name instead of key
33-
3431
dest := mountpoint(v.root, r.Name)
3532
if err := createDest(dest); err != nil {
3633
return volume.Response{Err: err.Error()}

0 commit comments

Comments
 (0)