mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-08 23:28:39 +03:00
committed by
Nicola Murino
parent
cc9db96257
commit
2e6497ea17
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"net"
|
||||
"os"
|
||||
"path"
|
||||
@@ -679,7 +680,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 > math.MaxInt32 {
|
||||
return -1
|
||||
}
|
||||
return u.UID
|
||||
@@ -687,7 +688,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 > math.MaxInt32 {
|
||||
return -1
|
||||
}
|
||||
return u.GID
|
||||
|
||||
Reference in New Issue
Block a user