mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
lock/server: Check if the lock server itself is skewed back. (#3447)
This commit is contained in:
parent
3fe2d77b70
commit
b28ff50126
@ -58,9 +58,11 @@ func (l *lockServer) removeEntry(name, uid string, lri *[]lockRequesterInfo) boo
|
||||
}
|
||||
|
||||
// Validate lock args.
|
||||
// - validate time stamp.
|
||||
// - validate jwt token.
|
||||
func (l *lockServer) validateLockArgs(args *LockArgs) error {
|
||||
curTime := time.Now().UTC()
|
||||
if curTime.Sub(args.Timestamp) > globalMaxSkewTime {
|
||||
if curTime.Sub(args.Timestamp) > globalMaxSkewTime || args.Timestamp.Sub(curTime) > globalMaxSkewTime {
|
||||
return errServerTimeMismatch
|
||||
}
|
||||
if !isRPCTokenValid(args.Token) {
|
||||
|
Loading…
Reference in New Issue
Block a user