xhost: /etc/X*.hosts

Pat Kane pekane52 at gmail.com
Thu Oct 7 11:44:38 PDT 2010


I see this in  os/access.c  from the current git tree:
...
 #if defined WIN32 && defined __MINGW32__
 #define ETC_HOST_PREFIX "X"
 #else
 #define ETC_HOST_PREFIX "/etc/X"
 #endif
 #define ETC_HOST_SUFFIX ".hosts"
    fnamelen = strlen(ETC_HOST_PREFIX) + strlen(ETC_HOST_SUFFIX) +
		strlen(display) + 1;
    if (fnamelen > sizeof(fname))
	FatalError("Display name `%s' is too long\n", display);
    snprintf(fname, sizeof(fname), ETC_HOST_PREFIX "%s" ETC_HOST_SUFFIX,
	     display);

    if ((fd = fopen (fname, "r")) != 0)
...
so it appears to be hard code.

On Thu, Oct 7, 2010 at 1:37 PM, Jeremy Huddleston <jeremyhu at apple.com> wrote:
>
> On Oct 7, 2010, at 11:27, Pat Kane wrote:
>
>> Try:
>>     man Xserver | grep /etc/X
>> on my Ubuntu system it gives:
>>
>> /etc/Xn.hosts                 Initial access control list for display  number n
>
> Ok, so then is that another instance that needs to be changed to __sysconfdir__ as well, or is it hard coded to /etc somewhere?
>
>
>>
>> On Thu, Oct 7, 2010 at 1:19 PM, Jeremy Huddleston <jeremyhu at apple.com> wrote:
>>> This was reported to me and I thought I should pass it along...
>>>
>>> xhost(1) has:
>>>
>>> FILES
>>>       /etc/X*.hosts
>>>
>>> but looking through xhost.c, I'm not sure what it's referring to...
>>>
>>> so do we
>>>
>>> 1) Remove it?
>>>
>>> 2) Change the /etc/ to something else like __sysconfdir__ and explain what these files are for?
>>>
>>>
>>> _______________________________________________
>>> xorg-devel at lists.x.org: X.Org development
>>> Archives: http://lists.x.org/archives/xorg-devel
>>> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>>>
>> _______________________________________________
>> xorg-devel at lists.x.org: X.Org development
>> Archives: http://lists.x.org/archives/xorg-devel
>> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>
>


More information about the xorg-devel mailing list