mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 21:12:26 +01:00
WL#4189 Wrap the check for socket path length in eval
This commit is contained in:
parent
7e0869b9f1
commit
4174c68595
1 changed files with 14 additions and 6 deletions
|
@ -102,14 +102,22 @@ sub check_socket_path_length {
|
||||||
|
|
||||||
require IO::Socket::UNIX;
|
require IO::Socket::UNIX;
|
||||||
|
|
||||||
my $sock = new IO::Socket::UNIX
|
my $sock;
|
||||||
(
|
eval {
|
||||||
Local => $path,
|
$sock= new IO::Socket::UNIX
|
||||||
Listen => 1,
|
(
|
||||||
);
|
Local => $path,
|
||||||
|
Listen => 1,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
if ($@)
|
||||||
|
{
|
||||||
|
print $@, '\n';
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
if (!defined $sock){
|
if (!defined $sock){
|
||||||
# Could not create a UNIX domain socket
|
# Could not create a UNIX domain socket
|
||||||
return 0; # Ok, will not be used by mysqld either
|
return 3;
|
||||||
}
|
}
|
||||||
if ($path ne $sock->hostpath()){
|
if ($path ne $sock->hostpath()){
|
||||||
# Path was truncated
|
# Path was truncated
|
||||||
|
|
Loading…
Reference in a new issue