Skip to content
  • Michal Srb's avatar
    Merge only entries with equal dpy and protoname. · 06a21f7c
    Michal Srb authored and Alan Coopersmith's avatar Alan Coopersmith committed
    Merging two lists, or adding entry a into list acts unexpectedly if the list
    contains FamilyWild or entry with an empty display numbers. For example:
    
      > xauth list
      #ffff#6f70656e737573652d74756d626c6577656564#:  MIT-MAGIC-COOKIE-1  1500d80327733252cc42ba469138a259
    
      > xauth add test/unix:2 MIT-MAGIC-COOKIE-1 aabbccddeeff00112233445566778899
      > xauth list
      test/unix:2  MIT-MAGIC-COOKIE-1  aabbccddeeff00112233445566778899
    
    This is because merge_entries compares entries using `match_auth`, which
    follows the same rules as XauGetBestAuthByAddr. Following these rules is good
    when filtering the output of `xauth list`, but for merging we should compare
    for equality. It used to be done that way before commit 1555fff4
    
    . That commit
    changed it to improve the `xauth list` behavior, but did not seem consider the
    impact on merge.
    
    Signed-off-by: default avatarAlan Coopersmith <alan.coopersmith@oracle.com>
    06a21f7c