From 169e8b8f8bafaa617ee2fb7333e05c99ce335f2b Mon Sep 17 00:00:00 2001 From: Matthew Penner Date: Sun, 29 Nov 2020 13:48:15 -0700 Subject: [PATCH] Fix chmod endpoint mode value --- router/router_server_files.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/router/router_server_files.go b/router/router_server_files.go index b044784..419e66b 100644 --- a/router/router_server_files.go +++ b/router/router_server_files.go @@ -400,12 +400,12 @@ func postServerChmodFile(c *gin.Context) { case <-ctx.Done(): return ctx.Err() default: - mode, err := strconv.ParseUint(p.Mode, 10, 32) + mode, err := strconv.ParseUint(p.Mode, 8, 32) if err != nil { return err } - if err := s.Filesystem().Chmod(path.Join(data.Root, p.File), os.FileMode(uint32(mode))); err != nil { + if err := s.Filesystem().Chmod(path.Join(data.Root, p.File), os.FileMode(mode)); err != nil { // Return nil if the error is an is not exists. // NOTE: os.IsNotExist() does not work if the error is wrapped. if errors.Is(err, os.ErrNotExist) {