1
0
mirror of https://github.com/minio/mc.git synced 2025-11-12 01:02:26 +03:00

Always make sure to verify argument validation in checkSyntax**.

Cleanup share-upload.go to be aware of different argument validation.
This commit is contained in:
Harshavardhana
2015-10-10 13:05:14 -07:00
parent f730083872
commit c4b9891c6e
9 changed files with 80 additions and 31 deletions

View File

@@ -81,17 +81,18 @@ func (sl *sortedList) Create(clnt client.Client, id string) *probe.Error {
switch err := content.Err.ToGoError().(type) {
case client.BrokenSymlink:
// FIXME: send the error to caller using channel
errorIf(content.Err.Trace(), fmt.Sprintf("Skipping broken Symlink %s.", err.Path))
errorIf(content.Err.Trace(), fmt.Sprintf("Skipping broken symlink %s.", err.Path))
continue
case client.TooManyLevelsSymlink:
// FIXME: send the error to caller using channel
errorIf(content.Err.Trace(), fmt.Sprintf("Skipping too many levels Symlink %s.", err.Path))
errorIf(content.Err.Trace(), fmt.Sprintf("Skipping too many levels symlink %s.", err.Path))
continue
}
if os.IsNotExist(content.Err.ToGoError()) || os.IsPermission(content.Err.ToGoError()) {
// FIXME: abstract this at fs.go layer
if content.Content != nil {
if content.Content.Type.IsDir() && (content.Content.Type&os.ModeSymlink == os.ModeSymlink) {
errorIf(content.Err.Trace(), fmt.Sprintf("Skipping broken folder symlink %s.", content.Content.Name))
continue
}
errorIf(content.Err.Trace(), fmt.Sprintf("Skipping %s.", content.Content.Name))