return fmt.Errorf("line %d: bad locator %q", lineno, token)
}
- toks := strings.Split(token, ":")
+ toks := strings.SplitN(token, ":", 3)
if len(toks) != 3 {
return fmt.Errorf("line %d: bad file segment %q", lineno, token)
}
if !ok {
return os.ErrNotExist
}
+ if locked[oldinode] {
+ // oldinode cannot become a descendant of itself.
+ return ErrInvalidArgument
+ }
if existing, ok := newdn.inodes[newname]; ok {
// overwriting an existing file or dir
if dn, ok := existing.(*dirnode); ok {