Skip to content

Commit 6b9091b

Browse files
Merge pull request #121956 from rewanthtammana/patch-1
Fixed `remotePath` in mount_windows.go Kubernetes-commit: 35bed806dc7d568d2b98883fed05836fadf9621a
2 parents cb89fc5 + 32d72db commit 6b9091b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mount_windows.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func (mounter *Mounter) MountSensitive(source string, target string, fstype stri
164164
// return (output, error)
165165
func newSMBMapping(username, password, remotepath string) (string, error) {
166166
if username == "" || password == "" || remotepath == "" {
167-
return "", fmt.Errorf("invalid parameter(username: %s, password: %s, remoteapth: %s)", username, sensitiveOptionsRemoved, remotepath)
167+
return "", fmt.Errorf("invalid parameter(username: %s, password: %s, remotepath: %s)", username, sensitiveOptionsRemoved, remotepath)
168168
}
169169

170170
// use PowerShell Environment Variables to store user input string to prevent command line injection
@@ -193,8 +193,8 @@ func isSMBMappingExist(remotepath string) bool {
193193
// check whether remotepath is valid
194194
// return (true, nil) if remotepath is valid
195195
func isValidPath(remotepath string) (bool, error) {
196-
cmd := exec.Command("powershell", "/c", `Test-Path $Env:remoteapth`)
197-
cmd.Env = append(os.Environ(), fmt.Sprintf("remoteapth=%s", remotepath))
196+
cmd := exec.Command("powershell", "/c", `Test-Path $Env:remotepath`)
197+
cmd.Env = append(os.Environ(), fmt.Sprintf("remotepath=%s", remotepath))
198198
output, err := cmd.CombinedOutput()
199199
if err != nil {
200200
return false, fmt.Errorf("returned output: %s, error: %v", string(output), err)

0 commit comments

Comments
 (0)