Fail to start server if detected cross-device mounts. (#4807)

Fixes #4764
This commit is contained in:
Harshavardhana
2017-08-15 15:10:50 -07:00
committed by Dee Koder
parent 3d21119ec8
commit 879cef37a1
10 changed files with 487 additions and 3 deletions

View File

@@ -17,6 +17,7 @@
package cmd
import (
"fmt"
"io"
"os"
pathutil "path"
@@ -360,6 +361,9 @@ func fsRenameFile(sourcePath, destPath string) error {
return traceError(err)
}
if err := os.Rename((sourcePath), (destPath)); err != nil {
if isSysErrCrossDevice(err) {
return traceError(fmt.Errorf("%s (%s)->(%s)", errCrossDeviceLink, sourcePath, destPath))
}
return traceError(err)
}
return nil