Is xauth entry without display number valid?

Keith Packard keithp at keithp.com
Thu Mar 15 18:45:01 UTC 2018


Michal Srb <msrb at suse.com> writes:

> It seems to work, but if I would try to create such file using the xauth
> command, it would not let me. It is also impossible to add any new records with
> display number, because they would get "merged" with those without
> number.

According to comments in AuGetBest.c:

	/*
	 * Match when:
	 *   either family or entry->family are FamilyWild or
	 *    family and entry->family are the same and
	 *     address and entry->address are the same
	 *  and
	 *   either number or entry->number are empty or
	 *    number and entry->number are the same
	 *  and
	 *   either name or entry->name are empty or
	 *    name and entry->name are the same
	 */

This makes it sound like entries with an empty number field are valid
and would match any incoming number.

After a brief read through the xauth sources, it looks like that
shouldn't be merging entries with empty number into entries with any
number, but it also looks like there's no code which sorts entries with
numbers before entries without numbers, and if the non-number entry
occurs first in the file, you'll always match that.

Suggestions on how to go about making this more sane are welcome; it
might be best to just stop trying to use entries without numbers and go
fix applications which are creating them. We could add warnings to
xauth or even Xau, but I'm not sure that would be useful.

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg/attachments/20180315/3082bb76/attachment.sig>


More information about the xorg mailing list