fix: Make error catch for strconv in UIDs less explicit
This commit is contained in:
@@ -83,21 +83,13 @@ func (f *FileSystem) mknode(dir bool, name string, perm os.FileMode) error {
|
|||||||
uid, err := strconv.Atoi(usr.Uid)
|
uid, err := strconv.Atoi(usr.Uid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Some OSes like i.e. Windows don't support numeric UIDs, so use 0 instead
|
// Some OSes like i.e. Windows don't support numeric UIDs, so use 0 instead
|
||||||
if err == strconv.ErrSyntax {
|
uid = 0
|
||||||
uid = 0
|
|
||||||
} else {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gid, err := strconv.Atoi(usr.Gid)
|
gid, err := strconv.Atoi(usr.Gid)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// Some OSes like i.e. Windows don't support numeric GIDs, so use 0 instead
|
// Some OSes like i.e. Windows don't support numeric GIDs, so use 0 instead
|
||||||
if err == strconv.ErrSyntax {
|
gid = 0
|
||||||
gid = 0
|
|
||||||
} else {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
groups, err := usr.GroupIds()
|
groups, err := usr.GroupIds()
|
||||||
|
|||||||
Reference in New Issue
Block a user