After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 623045 - Script-Fu is not IPv6 clean
Script-Fu is not IPv6 clean
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Script-Fu
git master
Other All
: Normal normal
: 2.8
Assigned To: GIMP Bugs
GIMP Bugs
Depends on:
Blocks:
 
 
Reported: 2010-06-28 13:57 UTC by Nils Philippsen
Modified: 2016-03-29 07:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch making Script-Fu logging IPv6 aware (master) (3.53 KB, patch)
2010-06-28 14:23 UTC, Nils Philippsen
needs-work Details | Review
Patch making Script-Fu logging IPv6 aware (gimp-2-6) (3.53 KB, patch)
2010-06-28 14:25 UTC, Nils Philippsen
needs-work Details | Review
Patch making Script-Fu server aware of and use IPv6. (11.58 KB, patch)
2010-06-29 13:54 UTC, Nils Philippsen
none Details | Review

Description Nils Philippsen 2010-06-28 13:57:15 UTC
The script-fu server tries to log addresses of incoming connections, but as it is it only works with IPv4, not IPv6.
Comment 1 Nils Philippsen 2010-06-28 14:00:12 UTC
I'm just working on a patch that uses getnameinfo() (RFC 2553, POSIX.1-2001) instead of inet_ntoa(). See http://people.redhat.com/drepper/userapi-ipv6.html for background.
Comment 2 Nils Philippsen 2010-06-28 14:23:36 UTC
Created attachment 164817 [details] [review]
Patch making Script-Fu logging IPv6 aware (master)
Comment 3 Nils Philippsen 2010-06-28 14:25:05 UTC
Created attachment 164818 [details] [review]
Patch making Script-Fu logging IPv6 aware (gimp-2-6)

The gimp-2-6 branch has configure.in instead of configure.ac, therefore needs a separate patch.
Comment 4 Tor Lillqvist 2010-06-28 14:43:06 UTC
I think you need to test at configure time if getnameinfo() is available, and set a config.h flag. Then fall back to the existing code if there is no getnameinfo().
Comment 5 Nils Philippsen 2010-06-28 15:59:46 UTC
As discussed on IRC, we care about Linux, Windows, OS X, all of which have getnameinfo(). Other Unix platforms shouldn't be problematic (they're unlikely not to conform to POSIX.1-2001 in such an important aspect), I've found that all these have getnameinfo():

- OpenBSD, FreeBSD, NetBSD
- Solaris, AIX, HP/UX
- QNX
- even Minix has it

Since even glib needs getnameinfo() now, I don't think we should cater for the cases where this function is not present. Operating systems where this is the case are either severely out of date or should have other interfaces for name resolving which support IPv6, but I doubt we do anybody a service by falling back to functions which would just treat a sockaddr_in6 as a sockaddr_in and log whatever happens to be in the upper 32bit of the IPv6 address as the address of the client.
Comment 6 Tor Lillqvist 2010-06-29 08:40:04 UTC
OK, I was unnecessarily careful it seems. Fine with me then.
Comment 7 Nils Philippsen 2010-06-29 09:58:09 UTC
Hmm, it seems I didn't spot some other things touching this (the server test script, socket setup). Stay tuned.
Comment 8 Nils Philippsen 2010-06-29 10:00:15 UTC
Review of attachment 164817 [details] [review]:

Doesn't fix the test script and socket setup.
Comment 9 Nils Philippsen 2010-06-29 10:00:48 UTC
Review of attachment 164818 [details] [review]:

Doesn't fix the test script and socket setup.
Comment 10 Nils Philippsen 2010-06-29 13:54:42 UTC
Created attachment 164888 [details] [review]
Patch making Script-Fu server aware of and use IPv6.
Comment 11 Nils Philippsen 2010-06-29 13:58:08 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release.

commit 04538534fc581de0507ef2ec1148853ff1e96dbe
Author: Nils Philippsen <nils@redhat.com>
Date:   Tue Jun 29 15:43:31 2010 +0200

    Bug 623045 - script-fu: make server IPv6 aware
    
    use getnameinfo() instead of inet_ntoa()
    use two sockets for IPv4, IPv6

 configure.ac                          |    8 +-
 plug-ins/script-fu/script-fu-server.c |  141 +++++++++++++++++++++++++-------
 plug-ins/script-fu/servertest.py      |   76 ++++++++++++------
 3 files changed, 166 insertions(+), 59 deletions(-)
Comment 12 Sven Neumann 2010-06-29 19:19:50 UTC
(In reply to comment #3)

> The gimp-2-6 branch has configure.in instead of configure.ac, therefore needs a
> separate patch.

You don't need a separate patch just for this reason. git cherry-pick is smart enough to deal with the changed filename. Actually git doesn't really care about the file that the change was made in. It only looks at the change.
Comment 13 Nils Philippsen 2010-06-30 16:18:25 UTC
(In reply to comment #12)
> You don't need a separate patch just for this reason. git cherry-pick is smart
> enough to deal with the changed filename. Actually git doesn't really care
> about the file that the change was made in. It only looks at the change.

Good to know. It's moot anyway, Mitch meant committing to gimp-2-6 is unnecessary because this code is only seldom used.