bug-inetutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: cfg.mk: Add checks for 'caddr_t'.


From: Simon Josefsson
Subject: Re: cfg.mk: Add checks for 'caddr_t'.
Date: Tue, 07 May 2024 09:23:32 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Collin Funk <collin.funk1@gmail.com> writes:

>> I do mostly agree, however there is another concern: frivolious changes
>> like this makes it harder to align code with BSD implementations for
>> auditing and security backports.  I've sporadically coordinated some
>> security fixes with tnftp which seems to be the maintained BSD ftp
>> implementation.  I've noticed they have a bunch of fixes that went into
>> that code over the years that we don't have.  Of course, they likely
>> won't add any of our improvements, but I don't think there is a lot of
>> arguments why we shouldn't continue to import good patches from BSD ftp
>> to GNU ftp.  I have a mental todo to attempt to do a BSD-to-GNU diff on
>> some of these tools, and backport all reasonable improvements they have.
>
> Ah, good point, thanks for mentioning. Do you happen to know off the
> top of your head what programs are still maintained by the BSDs? If
> not I can do some research and make sure to be more careful making
> changes there.

I recall researching this into some note a couple of years ago, but I
cannot find it now -- from the content of my ~/src/ I see checkouts of
the following NetBSD code that I have used to compare things with:
finger, fingerd, ftp, ftpd, libtelnet, telnet, telnetd, tnftp, tnftpd.

> The BSD-to-GNU diff doesn't sound very fun based on the different
> coding styles alone.

Right, which is a reason to consider the value of that compared to the
costs.  It is easy to run 'indent' on both codes before doing the
comparison though, to actually catch what remaining real changes there
are in the code.  There are many interesting patches in NetBSD that we
never merged that you can find this way.

>> For this particular example, they replaced a (caddr_t*) cast to (char*)
>> which I think is just wrong (the type is sockaddr_in and not char*).  So
>> your patch is better.
>
> I'm assuming you mean (caddr_t) to (char *) here?
>
> I think caddr_t is just a pointer type so it would be fine. I don't
> think the standard grantees all pointer types are the same size, but
> in practice they should be.

Right.

/Simon

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]