[PATCH libXau] XauGet*AuthByAddr: add new variants which allow passing an explicit authorization file path.

Alan Coopersmith alan.coopersmith at oracle.com
Sun Feb 17 21:26:44 UTC 2019


On 10/23/14 02:26 AM, Hans de Goede wrote:
> Hi,
> 
> On 10/20/2014 02:19 PM, Laércio de Sousa wrote:
>> It will allow extending functions like Xlib's XOpenDislay() or XCB's xcb_connect()
>> to allow passing an explicit authorization file path (they already allow passing
>> an explicit display number). This can be useful in exceptional cases where
>> XAUTHORITY environment variable is not set at the time a X11 client is launched.
>> Currently, a X11 client that needs to connect to a display with a given
>> authorization file needs to set XAUTHORITY itself (if not yet set) before connecting.
>>
>> Signed-off-by: Laércio de Sousa <laerciosousa at sme-mogidascruzes.sp.gov.br>
> 
> Code looks good to me and is:
> 
> Acked-by: Hans de Goede <hdegoede at redhat.com>
> 
> I think this should get a second look by someone more familiar with the Xau code
> though, so I'll leave merging this up to someone else.

Cleaning out old patch queues I found no one had ever followed up on this,
so I tried to apply it, but it doesn't build because XauGetAuthByAddrWithFile
ends up using "auth_file" as both the char * argument, and as a FILE * variable:


AuGetAddr.c: In function ‘XauGetAuthByAddrWithFile’:
AuGetAddr.c:59:14: error: ‘auth_file’ redeclared as different kind of symbol
      FILE    *auth_file;
               ^~~~~~~~~
AuGetAddr.c:37:15: note: previous definition of ‘auth_file’ was here
  _Xconst char* auth_file,
                ^~~~~~~~~
AuGetAddr.c:63:39: warning: pointer type mismatch in conditional expression
      auth_name = auth_file ? auth_file : XauFileName ();
                                        ^
AuGetAddr.c: In function ‘XauGetAuthByAddr’:
AuGetAddr.c:136:1: error: control reaches end of non-void function 
[-Werror=return-type]
  }
  ^
cc1: some warnings being treated as errors


-- 
	-Alan Coopersmith-               alan.coopersmith at oracle.com
	 Oracle Solaris Engineering - https://blogs.oracle.com/alanc


More information about the xorg-devel mailing list