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

Bug#338290: marked as done (xorg-x11: limited functionality on GNU/kFreeBSD (problem with unix sockets))



Your message dated Mon, 16 Oct 2006 06:02:12 -0700
with message-id <E1GZS6e-0001T6-RY@spohr.debian.org>
and subject line Bug#338290: fixed in xtrans 1.0.1-3
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--- Begin Message ---
Package: xorg-x11
Version: 6.8.2.dfsg.1-10
Tags: patch

Hi,

this bug started as 
http://lists.alioth.debian.org/pipermail/glibc-bsd-devel/2005-November/000628.html

On debian/kFreeBSD is not defined HasBSD44Sockets.
It shouldn't be problem because FreeBSD kernel 5.4 and 6.0 
tries to be compatible with older (BSD43) source code
and at least in connect(), bind() ignores value in the field sun_len.
It uses only the value addrlen from function in system call.

Unfortunately, we are hitted by computing the whole name length as
namelen = strlen(sockname.sun_path) + sizeof(sockname.sun_family);
instead of portable
namelen = strlen(sockname.sun_path) + offsetof(struct sockaddr_un, sun_path);

Therefore, it is sufficient to correct calculation with sun_path in 
whole xorg-x11. Moreover, it is mainly correct, only 2 files need fix.

ok      programs/xdm/prngc.c
ok      programs/xdm/xdmcp.c
ok      programs/xdm/netaddr.c
patch   lib/dps/csconndi.c
patch   lib/xtrans/Xtranssock.c
ok      lib/xtrans/Xtranstli.c
ok      lib/xtrans/Xtranslcl.c
ok      lib/xtrans/Xtransutil.c
ok      extras/Mesa/src/glx/mini/miniglx_events.c       

Submitted also upstream in 
https://bugs.freedesktop.org/show_bug.cgi?id=4982

The enclosed patch adds debian/patches/freebsd/004_gnu-kbsd_sock_un.diff
and inserts it in debian/patches/series.
Could you please apply it.
Thanks in advance

			Petr


The patch have been tested:

---------- Forwarded message ----------
Date: Wed, 9 Nov 2005 03:37:01 +0000
From: Brian M. Carlson <sandals@crustytoothpaste.ath.cx>

> I converted my patch into appropriate form.
> Can you please test it ?

It works, very nicely.  A couple caveats: if you rebuild, you must reinstall 
at least all of the binary packages with the fixed version, otherwise, it 
doesn't work.  Also, after installing the fixed version, I'd consider 
restarting, otherwise it can't connect.  Other than that, no problem.  BTW, I 
don't think these problems are specific to your patch, just that X is finicky 
like that.  You have my vote to submit.

-- 
Brian M. Carlson <sandals@crustytoothpaste.ath.cx>
Running on GNU/kFreeBSD; i686-pc-kfreebsd-gnu
Support alternative kernels in Debian!
diff -u xorg-x11-6.8.2.dfsg.1/debian/patches/series xorg-x11-6.8.2.dfsg.1/debian/patches/series
--- xorg-x11-6.8.2.dfsg.1/debian/patches/series
+++ xorg-x11-6.8.2.dfsg.1/debian/patches/series
@@ -149,6 +149,7 @@
 freebsd/001_gnu-kbsd.diff -p0
 freebsd/002_gnu-kbsd_wacom.diff -p0
 freebsd/003_gnu-kbsd_sessreg.diff -p0
+freebsd/004_gnu-kbsd_sock_un.diff -p0
 debian/900_debian_config.diff -p0
 debian/902_debian_startx_manpage.diff -p0
 debian/903_debian_system.twmrc.diff -p0
--- xorg-x11-6.8.2.dfsg.1.orig/debian/patches/freebsd/004_gnu-kbsd_sock_un.diff
+++ xorg-x11-6.8.2.dfsg.1/debian/patches/freebsd/004_gnu-kbsd_sock_un.diff
@@ -0,0 +1,44 @@
+Index: xc/lib/dps/csconndi.c
+===================================================================
+--- xc/lib/dps/csconndi.c.orig	2005-02-28 17:35:18.000000000 +0000
++++ xc/lib/dps/csconndi.c	2005-11-08 08:21:30.000000000 +0000
+@@ -506,7 +506,7 @@
+     sprintf (unaddr.sun_path, "%s_%d", CSDPS_UNIX_PATH, port);
+ 
+     addr = (struct sockaddr *) &unaddr;
+-    addrlen = strlen(unaddr.sun_path) + sizeof(unaddr.sun_family);
++    addrlen = strlen(unaddr.sun_path) + offsetof(struct sockaddr_un, sun_path);
+ 
+     /*
+      * Open the network connection.
+Index: xc/lib/xtrans/Xtranssock.c
+===================================================================
+--- xc/lib/xtrans/Xtranssock.c.orig	2005-11-08 08:20:49.000000000 +0000
++++ xc/lib/xtrans/Xtranssock.c	2005-11-08 08:21:30.000000000 +0000
+@@ -1096,7 +1096,7 @@
+     sockname.sun_len = strlen(sockname.sun_path);
+     namelen = SUN_LEN(&sockname);
+ #else
+-    namelen = strlen(sockname.sun_path) + sizeof(sockname.sun_family);
++    namelen = strlen(sockname.sun_path) + offsetof(struct sockaddr_un, sun_path);
+ #endif
+ 
+     unlink (sockname.sun_path);
+@@ -1979,7 +1979,7 @@
+     sockname.sun_len = strlen (sockname.sun_path);
+     namelen = SUN_LEN (&sockname);
+ #else
+-    namelen = strlen (sockname.sun_path) + sizeof (sockname.sun_family);
++    namelen = strlen (sockname.sun_path) + offsetof(struct sockaddr_un, sun_path);
+ #endif
+ 
+ 
+@@ -1993,7 +1993,7 @@
+ 	return TRANS_CONNECT_FAILED;
+     }
+     old_namelen = strlen (old_sockname.sun_path) +
+-	sizeof (old_sockname.sun_family);
++    	offsetof(struct sockaddr_un, sun_path);
+ #endif
+ 
+ 

--- End Message ---
--- Begin Message ---
Source: xtrans
Source-Version: 1.0.1-3

We believe that the bug you reported is fixed in the latest version of
xtrans, which is due to be installed in the Debian FTP archive:

xtrans-dev_1.0.1-3_all.deb
  to pool/main/x/xtrans/xtrans-dev_1.0.1-3_all.deb
xtrans_1.0.1-3.diff.gz
  to pool/main/x/xtrans/xtrans_1.0.1-3.diff.gz
xtrans_1.0.1-3.dsc
  to pool/main/x/xtrans/xtrans_1.0.1-3.dsc



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 338290@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Drew Parsons <dparsons@debian.org> (supplier of updated xtrans package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Mon, 16 Oct 2006 22:39:05 +1000
Source: xtrans
Binary: xtrans-dev
Architecture: source all
Version: 1.0.1-3
Distribution: unstable
Urgency: low
Maintainer: Debian X Strike Force <debian-x@lists.debian.org>
Changed-By: Drew Parsons <dparsons@debian.org>
Description: 
 xtrans-dev - X transport library (development files)
Closes: 338290
Changes: 
 xtrans (1.0.1-3) unstable; urgency=low
 .
   * Include patch 02_sunlen_nonbsd_sock.patch from upstream (see
     upstream bug #4982). Follows on from 02_gnu-kbsd_sock_un.diff.
     Closes: #338290.
Files: 
 66f153348e62e9babcf720d1ffcd48af 750 x11 optional xtrans_1.0.1-3.dsc
 4b902e3027fa850f02792f01e798ef7f 19113 x11 optional xtrans_1.0.1-3.diff.gz
 b31f5cd4f0a4f8e7d1ae29efcfa8f322 59030 x11 optional xtrans-dev_1.0.1-3_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFFM3+hts5wQWQSTkoRAoSfAKCV1DSsJjuv1FMokhHE/bgZaQ4+FACfRMJJ
u1ZVPuyLgbpHSPSY+Bk7I9Q=
=5+pK
-----END PGP SIGNATURE-----


--- End Message ---

Reply to: