1
0
mirror of https://github.com/dkmstr/openuds.git synced 2025-03-20 06:50:23 +03:00

limited ip size length

This commit is contained in:
Adolfo Gómez García 2023-01-17 12:37:31 +01:00
parent 48cd8240e9
commit e15ba650f9
No known key found for this signature in database
GPG Key ID: DD1ABF20724CDA23

View File

@ -298,8 +298,12 @@ class UserService(UUIDModel): # pylint: disable=too-many-public-methods
Returns:
Nothing
"""
self.src_ip = ip
self.src_hostname = hostname
self.src_ip = ip[:15]
self.src_hostname = hostname[:65]
if(self.src_ip != ip or self.src_hostname != hostname):
logger.info('Truncated connection source data to %s/%s', self.src_ip, self.src_hostname)
self.save(update_fields=['src_ip', 'src_hostname'])
def getConnectionSource(self) -> typing.Tuple[str, str]: