Replace IO::Socket::INET with IO::Socket::IP in hook-callback.pl

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Low
    • None
    • Affects Version/s: 8.0.0
    • Component/s: Git Hosting
    • Severity 3 - Minor

      Issue Summary

      Follow up task from BSERV-13507: we would like to update the perl script to create sockets in IPv6 environment for customers running Bitbucket 8.0+ on MacOS. This includes an update to release notes of the version that this releases in.

      In Bitbucket 8.0+ hook-callback.pl has been replaced by a native programme that no longer relies on the Perl script for production environment. But this script is still used in 8.0+ for running on MacOS (which is only supported for evaluations and plugin development).

      We want to update this in a future minor version of Bitbucket along with a corresponding increase in the minimum Perl version required.

      This is reproducible on Data Center: yes

      Steps to Reproduce

      1. see BSERV-13507

      Expected Results

      $BITBUCKET_HOME/bin/git-hooks/hook-callback.pl should be able to create a socket with an IPv6 host address.

      Actual Results

      Trying to clone or push into a repository would fail.

      Workaround

      Suggestion:

      Consider replacing IO::Socket::INET with IO::Socket::IP, which is capable of handling IPv4 and IPv6 addresses, since INET6 has deprecated.

      Original workaround:

      Modify the $BITBUCKET_HOME/bin/git-hooks/hook-callback.pl to use IPv6

      Change the below line on $BITBUCKET_HOME/bin/git-hooks/hook-callback.pl

      my $socket = new IO::Socket::INET
      

      It should be replaced to:

      my $socket = new IO::Socket::INET6
      

      (also added use IO::Socket::INET6; at top of hook-callback.pl)

      Please Note this isn't a permanent setting everytime the Bitbucket service is restarted the hook-callback.pl is regenerated by the Bitbucket so it must be modified every time after the restart.

            Assignee:
            Jemma Zhang
            Reporter:
            Jemma Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: