GNOME Bugzilla – Bug 623045
Script-Fu is not IPv6 clean
Last modified: 2016-03-29 07:40:30 UTC
The script-fu server tries to log addresses of incoming connections, but as it is it only works with IPv4, not IPv6.
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.
Created attachment 164817 [details] [review] Patch making Script-Fu logging IPv6 aware (master)
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.
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().
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.
OK, I was unnecessarily careful it seems. Fine with me then.
Hmm, it seems I didn't spot some other things touching this (the server test script, socket setup). Stay tuned.
Review of attachment 164817 [details] [review]: Doesn't fix the test script and socket setup.
Review of attachment 164818 [details] [review]: Doesn't fix the test script and socket setup.
Created attachment 164888 [details] [review] Patch making Script-Fu server aware of and use IPv6.
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(-)
(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.
(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.