X11 making bogus Xauthority entries?
X11 making bogus Xauthority entries?
- Subject: X11 making bogus Xauthority entries?
- From: Frank Henigman <email@hidden>
- Date: Thu, 24 Feb 2005 12:06:38 -0800
There's something odd about the entries that get put in my .Xauthority
file when I start X11. Looking with "xauth list" everything seems ok:
imac1.local/unix:0 MIT-MAGIC-COOKIE-1 c73009e221f67f93e2ddfc7ef2d17dda
imac1.my.domain:0 MIT-MAGIC-COOKIE-1 c73009e221f67f93e2ddfc7ef2d17dda
localhost:0 MIT-MAGIC-COOKIE-1 c73009e221f67f93e2ddfc7ef2d17dda
But access is denied when DISPLAY is set to either imac.my.domain:0
or localhost:0. Only ":0" works. I wrote a little program (attached
below) to examine the file using the Xau library. Its output is:
X authority file = "/home/frank/.Xauthority"
family = 256
address (11) = 105.109.97.99 "imac1.local"
number = "0"
name = "MIT-MAGIC-COOKIE-1"
data (16) = "c73009e221f67f93e2ddfc7ef2d17dda"
family = 0
address (16) = 142.58.35.41 "(142):#)(0)(0)(0)(0)(0)(0)(0)(0)(16)(2)(0)(0)"
number = "0"
name = "MIT-MAGIC-COOKIE-1"
data (16) = "c73009e221f67f93e2ddfc7ef2d17dda"
family = 0
address (16) = 127.0.0.1 "(127)(0)(0)(1)(0)(0)(0)(0)(0)(0)(0)(0)(16)(2)(0)(0)"
number = "0"
name = "MIT-MAGIC-COOKIE-1"
data (16) = "c73009e221f67f93e2ddfc7ef2d17dda"
Here we see twelve bytes follow the ip addresses in the "family = 0"
entries. Entries made by xauth don't have them - they look like this:
family = 0
address (4) = 142.58.35.41 "(142):#)"
number = "0"
name = "MIT-MAGIC-COOKIE-1"
data (16) = "c73009e221f67f93e2ddfc7ef2d17dda"
and they work. With this entry I can connect when DISPLAY is "imac1:0"
Has anyone else seen this? I'm going to file this as a bug with
Apple if no one offers an explanation for this behavior. Thanks.
I'm using the latest versions of OS X and X11 available at this date.
All updates have been applied.
-------------- auth.c ----------------------------------------------------
/*
gcc auth.c -L/usr/X11R6/lib -lXau
*/
#include <stdio.h>
#include <X11/Xauth.h>
int main( int argc, char *argv[] ) {
char *f = XauFileName();
Xauth *a;
FILE *h;
char *c;
int l;
printf( "X authority file = \"%s\"\n\n", f );
h = fopen( f, "r" );
while ( a = XauReadAuth( h ) ) {
printf( "family = %d\n", a->family );
c = a->address; l = a->address_length;
printf( "address (%d) =", l );
if ( l >= 4 ) {
printf( " %hhu.%hhu.%hhu.%hhu", c[0], c[1], c[2], c[3] );
}
printf( " \"" );
for ( ; c < a->address + l; ++c ) {
printf( isprint( *c ) ? "%c" : "(%hhu)", *c );
}
printf( "\"\n" );
printf( "number = \"%.*s\"\n", a->number_length, a->number );
printf( "name = \"%.*s\"\n", a->name_length, a->name );
c = a->data; l = a->data_length;
printf( "data (%d) = \"", l );
while ( c < a->data + l ) printf( "hhx", *c++ );
printf( "\"\n\n" );
}
return 0;
}
_______________________________________________
Do not post admin requests to the list. They will be ignored.
X11-users mailing list (email@hidden)
This email sent to email@hidden