# minor patch required to compile git 2.26.1 on Oracle Solaris 10 with Oracle Studio

6 messages from 2020-04-19 to 2020-04-23. Participants: Dennis Clarke, Junio C Hamano, Jeff King, Kevin Daudt.
Thread: https://gitlist.dev/t/53255

## Dennis Clarke, 2020-04-19 04:52

Subject: minor patch required to compile git 2.26.1 on Oracle Solaris 10 with Oracle Studio
Message-ID: <6bf94982-71c4-78e9-0f4d-7fa4e485c417@blastwave.org>
URL: https://gitlist.dev/e/6bf94982-71c4-78e9-0f4d-7fa4e485c417%40blastwave.org

```


Very minor patch required :


--- ./compat/inet_ntop.c.orig   Tue Apr 14 01:51:03 2020
+++ ./compat/inet_ntop.c        Sun Apr 19 04:16:39 2020
@@ -168,7 +168,7 @@
   *     Paul Vixie, 1996.
   */
  const char *
-inet_ntop(int af, const void *src, char *dst, size_t size)
+inet_ntop(int af, const void *src, char *dst, unsigned int size)
  {
         switch (af) {
         case AF_INET:
--- ./git-compat-util.h.orig    Tue Apr 14 01:51:03 2020
+++ ./git-compat-util.h Sun Apr 19 03:56:17 2020
@@ -795,7 +795,7 @@
  #endif

  #ifdef NO_INET_NTOP
-const char *inet_ntop(int af, const void *src, char *dst, size_t size);
+const char *inet_ntop(int af, const void *src, char *dst, unsigned int 
size);
  #endif

  #ifdef NO_PTHREADS
#
# exit

That allows compile to proceed beatly with :

alpha$
alpha$ cc -V
cc: Studio 12.6 Sun C 5.15 SunOS_sparc 2017/05/30



-- 
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
GreyBeard and suspenders optional

```

## Junio C Hamano, 2020-04-19 05:35

Subject: Re: minor patch required to compile git 2.26.1 on Oracle Solaris 10 with Oracle Studio
Message-ID: <xmqqzhb8rqa6.fsf@gitster.c.googlers.com>
URL: https://gitlist.dev/e/xmqqzhb8rqa6.fsf%40gitster.c.googlers.com
In-Reply-To: <6bf94982-71c4-78e9-0f4d-7fa4e485c417@blastwave.org>

```
Dennis Clarke <dclarke@blastwave.org> writes:

> Very minor patch required :

But both size_t and unsigned int are wrong types, no?  Shouldn't we
be using socklen_t (and we seem to have autoconf support to figure
out an appropriate socklen_t fallback typedef)?

> --- ./compat/inet_ntop.c.orig   Tue Apr 14 01:51:03 2020
> +++ ./compat/inet_ntop.c        Sun Apr 19 04:16:39 2020
> @@ -168,7 +168,7 @@
>   *     Paul Vixie, 1996.
>   */
>  const char *
> -inet_ntop(int af, const void *src, char *dst, size_t size)
> +inet_ntop(int af, const void *src, char *dst, unsigned int size)
>  {
>         switch (af) {
>         case AF_INET:
> --- ./git-compat-util.h.orig    Tue Apr 14 01:51:03 2020
> +++ ./git-compat-util.h Sun Apr 19 03:56:17 2020
> @@ -795,7 +795,7 @@
>  #endif
>
>  #ifdef NO_INET_NTOP
> -const char *inet_ntop(int af, const void *src, char *dst, size_t size);
> +const char *inet_ntop(int af, const void *src, char *dst, unsigned
> int size);
>  #endif
>
>  #ifdef NO_PTHREADS
> #
> # exit
>
> That allows compile to proceed beatly with :
>
> alpha$
> alpha$ cc -V
> cc: Studio 12.6 Sun C 5.15 SunOS_sparc 2017/05/30

```

## Jeff King, 2020-04-22 08:09

Subject: Re: minor patch required to compile git 2.26.1 on Oracle Solaris 10 with Oracle Studio
Message-ID: <20200422080950.GA464427@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20200422080950.GA464427%40coredump.intra.peff.net
In-Reply-To: <xmqqzhb8rqa6.fsf@gitster.c.googlers.com>

```
On Sat, Apr 18, 2020 at 10:35:45PM -0700, Junio C Hamano wrote:

> Dennis Clarke <dclarke@blastwave.org> writes:
> 
> > Very minor patch required :
> 
> But both size_t and unsigned int are wrong types, no?  Shouldn't we
> be using socklen_t (and we seem to have autoconf support to figure
> out an appropriate socklen_t fallback typedef)?

That is generally the right type according to POSIX, but I think there's
something even more subtle going on. If we're defining our own
inet_ntop(), then the type shouldn't really matter, should it?

Dennis didn't show us the compiler errors, but my suspicion is that it
is complaining because it is seeing the definition of inet_ntop()
already from a system header, and ours does not match.

Which implies that NO_INET_NTOP should not be set in the first place.
I think this is the same issue discussed in:

  https://lore.kernel.org/git/CAH8yC8m3JFvEcfFF3z1rrRnEPK-adHGObmkOhNZiph7QJKUWqA@mail.gmail.com/

with a patch (which needs at least a signoff added) in:

  https://lore.kernel.org/git/CAH8yC8kaWXbN+RYMJnM9em7KKW54+N07JtyS1MZk0qppD=m2BA@mail.gmail.com/

Dennis, does building with:

  make NO_INET_NTOP= NO_INET_PTON=

help?

-Peff

```

## Jeff King, 2020-04-22 08:11

Subject: Re: minor patch required to compile git 2.26.1 on Oracle Solaris 10 with Oracle Studio
Message-ID: <20200422081156.GB464427@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20200422081156.GB464427%40coredump.intra.peff.net
In-Reply-To: <20200422080950.GA464427@coredump.intra.peff.net>

```
On Wed, Apr 22, 2020 at 04:09:50AM -0400, Jeff King wrote:

> Which implies that NO_INET_NTOP should not be set in the first place.
> I think this is the same issue discussed in:
> 
>   https://lore.kernel.org/git/CAH8yC8m3JFvEcfFF3z1rrRnEPK-adHGObmkOhNZiph7QJKUWqA@mail.gmail.com/
> 
> with a patch (which needs at least a signoff added) in:
> 
>   https://lore.kernel.org/git/CAH8yC8kaWXbN+RYMJnM9em7KKW54+N07JtyS1MZk0qppD=m2BA@mail.gmail.com/
> 
> Dennis, does building with:
> 
>   make NO_INET_NTOP= NO_INET_PTON=
> 
> help?

Sorry, I meant to cc Jeffrey Walton from that thread but forgot to.
Doing so now.

-Peff

```

## Dennis Clarke, 2020-04-23 00:09

Subject: Re: minor patch required to compile git 2.26.1 on Oracle Solaris 10 with Oracle Studio
Message-ID: <f0beedfb-b50b-51b9-d996-155e0178a90d@blastwave.org>
URL: https://gitlist.dev/e/f0beedfb-b50b-51b9-d996-155e0178a90d%40blastwave.org
In-Reply-To: <20200422081156.GB464427@coredump.intra.peff.net>

```
On 2020-04-22 04:11, Jeff King wrote:
> On Wed, Apr 22, 2020 at 04:09:50AM -0400, Jeff King wrote:
> 
>> Which implies that NO_INET_NTOP should not be set in the first place.
>> I think this is the same issue discussed in:
>>
>>    https://lore.kernel.org/git/CAH8yC8m3JFvEcfFF3z1rrRnEPK-adHGObmkOhNZiph7QJKUWqA@mail.gmail.com/
>>
>> with a patch (which needs at least a signoff added) in:
>>
>>    https://lore.kernel.org/git/CAH8yC8kaWXbN+RYMJnM9em7KKW54+N07JtyS1MZk0qppD=m2BA@mail.gmail.com/
>>
>> Dennis, does building with:
>>
>>    make NO_INET_NTOP= NO_INET_PTON=
>>

I will give that a try today and see what happens. There seems to be a 
2.26.2 release from yesterday and may as well get that going. What was 
the changelog reason for the bump from 2.26.1 to 2.26.2 ?

Dennis



```

## Kevin Daudt, 2020-04-23 05:41

Subject: Re: minor patch required to compile git 2.26.1 on Oracle Solaris 10 with Oracle Studio
Message-ID: <20200423054139.GA1838755@alpha>
URL: https://gitlist.dev/e/20200423054139.GA1838755%40alpha
In-Reply-To: <f0beedfb-b50b-51b9-d996-155e0178a90d@blastwave.org>

```
On Wed, Apr 22, 2020 at 08:09:46PM -0400, Dennis Clarke wrote:
> On 2020-04-22 04:11, Jeff King wrote:
> > On Wed, Apr 22, 2020 at 04:09:50AM -0400, Jeff King wrote:
> > 
> > > Which implies that NO_INET_NTOP should not be set in the first place.
> > > I think this is the same issue discussed in:
> > > 
> > >    https://lore.kernel.org/git/CAH8yC8m3JFvEcfFF3z1rrRnEPK-adHGObmkOhNZiph7QJKUWqA@mail.gmail.com/
> > > 
> > > with a patch (which needs at least a signoff added) in:
> > > 
> > >    https://lore.kernel.org/git/CAH8yC8kaWXbN+RYMJnM9em7KKW54+N07JtyS1MZk0qppD=m2BA@mail.gmail.com/
> > > 
> > > Dennis, does building with:
> > > 
> > >    make NO_INET_NTOP= NO_INET_PTON=
> > > 
> 
> I will give that a try today and see what happens. There seems to be a
> 2.26.2 release from yesterday and may as well get that going. What was the
> changelog reason for the bump from 2.26.1 to 2.26.2 ?
> 
> Dennis
> 
> 

Hello Dennis,

There was another CVE disclosed:

https://lore.kernel.org/git/xmqq4kterq5s.fsf@gitster.c.googlers.com/

Kind regards, Kevin

```
