xorg-x11-xtrans-devel/xtrans-1.0.3-avoid-gethostname.patch
Adam Jackson 9ca2cbab69 - xtrans-1.0.3-avoid-gethostname.patch: Don't trust gethostname() output
when building networkIds for AF_UNIX sockets. Fixes application launch
    delays and failures when dhclient changes your hostname from under you.
2007-10-01 19:41:46 +00:00

12 lines
533 B
Diff

diff -up xtrans-1.0.3/Xtransutil.c.jx xtrans-1.0.3/Xtransutil.c
--- xtrans-1.0.3/Xtransutil.c.jx 2006-12-06 11:08:53.000000000 -0500
+++ xtrans-1.0.3/Xtransutil.c 2007-10-01 14:53:43.000000000 -0400
@@ -271,6 +271,7 @@ TRANS(GetMyNetworkId) (XtransConnInfo ci
case AF_UNIX:
{
struct sockaddr_un *saddr = (struct sockaddr_un *) addr;
+ strcpy(hostnamebuf, "unix");
networkId = (char *) xalloc (3 + strlen (transName) +
strlen (hostnamebuf) + strlen (saddr->sun_path));
sprintf (networkId, "%s/%s:%s", transName,