diff --git a/dataprovider/user.go b/dataprovider/user.go index 090200bdc33608d91d284171667fe3a3f08a4db2..155d65a2db0091bcf18cbb69cde908354e1d1541 100644 --- a/dataprovider/user.go +++ b/dataprovider/user.go @@ -4,6 +4,7 @@ import ( "encoding/json" "errors" "fmt" + "math" "net" "os" "path" @@ -821,7 +822,7 @@ func (u *User) GetFsConfigAsJSON() ([]byte, error) { // GetUID returns a validate uid, suitable for use with os.Chown func (u *User) GetUID() int { - if u.UID <= 0 || u.UID > 65535 { + if u.UID <= 0 || u.UID > int(math.Pow(2, 31))-1 { return -1 } return u.UID @@ -829,7 +830,7 @@ func (u *User) GetUID() int { // GetGID returns a validate gid, suitable for use with os.Chown func (u *User) GetGID() int { - if u.GID <= 0 || u.GID > 65535 { + if u.GID <= 0 || u.GID > int(math.Pow(2, 31))-1 { return -1 } return u.GID diff --git a/httpd/schema/openapi.yaml b/httpd/schema/openapi.yaml index 970571954c428fe31925c940392a3c8ba4a69919..9e3883c21886087873d0ac6483faaa42ca769057 100644 --- a/httpd/schema/openapi.yaml +++ b/httpd/schema/openapi.yaml @@ -1742,13 +1742,13 @@ components: type: integer format: int32 minimum: 0 - maximum: 65535 + maximum: 2147483647 description: 'if you run SFTPGo as root user, the created files and directories will be assigned to this uid. 0 means no change, the owner will be the user that runs SFTPGo. Ignored on windows' gid: type: integer format: int32 minimum: 0 - maximum: 65535 + maximum: 2147483647 description: 'if you run SFTPGo as root user, the created files and directories will be assigned to this gid. 0 means no change, the group will be the one of the user that runs SFTPGo. Ignored on windows' max_sessions: type: integer diff --git a/templates/user.html b/templates/user.html index 5af9449c5c25afabaa2b14e8d055390715372070..8058c131cf39f0b54a67c7b8c79826cf008a56d6 100644 --- a/templates/user.html +++ b/templates/user.html @@ -264,13 +264,13 @@