Commit 4174c685 authored by Magnus Svensson's avatar Magnus Svensson
Browse files

WL#4189 Wrap the check for socket path length in eval

parent 7e0869b9
Loading
Loading
Loading
Loading
+14 −6
Original line number Diff line number Diff line
@@ -102,14 +102,22 @@ sub check_socket_path_length {

  require IO::Socket::UNIX;

  my $sock = new IO::Socket::UNIX
  my $sock;
  eval {
    $sock= new IO::Socket::UNIX
      (
       Local => $path,
       Listen => 1,
      );
  };
  if ($@)
  {
    print $@, '\n';
    return 2;
  }
  if (!defined $sock){
    # Could not create a UNIX domain socket
    return 0; # Ok, will not be used by mysqld either    
    return 3;
  }
  if ($path ne $sock->hostpath()){
    # Path was truncated