Xauthority is missing the display number












2














When I run on my local machine (Ubuntu 18.10) xauth list the output is not showing the display number:



$ xauth list
c7h/unix: MIT-MAGIC-COOKIE-1 37bb744d95232b4e29aea1320b0a0e2d
#ffff#633768#: MIT-MAGIC-COOKIE-1 37bb744d95232b4e29aea1320b0a0e2d


My env $DISPLAY variable contains the value :1:



$ echo $DISPLAY
:1


So I was expecting to see 1 after c7h/unix::



c7h/unix:1  MIT-MAGIC-COOKIE-1  37bb744d95232b4e29aea1320b0a0e2d


The value is also missing if I manually parse the file inside the env variable $XAUTHORITY with Python:



if filename is None:
filename = os.environ.get('XAUTHORITY')

if filename is None:
try:
filename = os.path.join(os.environ['HOME'], '.Xauthority')
except KeyError:
raise XConnectionError("$HOME not set, can't find ~/.Xauthority")

try:
xaf = open(filename, 'rb')
raw = xaf.read()
xaf.close()
except IOError as err:
raise XConnectionError("Can't read ~/.Xauthority: %s" % err[1])
return

n = 0
entries =
try:
while n < len(raw):
family, = struct.unpack('>H', raw[n:n + 2])
n = n + 2

length, = struct.unpack('>H', raw[n:n + 2])
n = n + length + 2
addr = raw[n - length: n]

length, = struct.unpack('>H', raw[n:n + 2])
n = n + length + 2
num = raw[n - length: n]

length, = struct.unpack('>H', raw[n:n + 2])
n = n + length + 2
name = raw[n - length: n]

length, = struct.unpack('>H', raw[n:n + 2])
n = n + length + 2
data = raw[n - length: n]

if len(data) != length:
break

entries.append((family, addr.decode('utf-8'), num.decode('utf-8'), name.decode('utf-8'), data))


How can I figure out which of the auth is the one associated with the value reported by $DISPLAY?










share|improve this question
























  • @grawity I'm using Ubuntu 18.10. Standard installation with GDM and Gnome Shell.
    – Roberto Leinardi
    2 days ago










  • Your second cookie also looks not quite right. What happens when you xauth extract some_file :1 and then xauth -f some_file list? If you get the first line again, I don't understand what's happening. If you get a different line, my guess would be "auth file corrupt; remove it, log out, log in, see if it gets better".
    – dirkt
    2 days ago










  • Unfortunately the result is exactly the same as the $XAUTHORITY one.
    – Roberto Leinardi
    2 days ago
















2














When I run on my local machine (Ubuntu 18.10) xauth list the output is not showing the display number:



$ xauth list
c7h/unix: MIT-MAGIC-COOKIE-1 37bb744d95232b4e29aea1320b0a0e2d
#ffff#633768#: MIT-MAGIC-COOKIE-1 37bb744d95232b4e29aea1320b0a0e2d


My env $DISPLAY variable contains the value :1:



$ echo $DISPLAY
:1


So I was expecting to see 1 after c7h/unix::



c7h/unix:1  MIT-MAGIC-COOKIE-1  37bb744d95232b4e29aea1320b0a0e2d


The value is also missing if I manually parse the file inside the env variable $XAUTHORITY with Python:



if filename is None:
filename = os.environ.get('XAUTHORITY')

if filename is None:
try:
filename = os.path.join(os.environ['HOME'], '.Xauthority')
except KeyError:
raise XConnectionError("$HOME not set, can't find ~/.Xauthority")

try:
xaf = open(filename, 'rb')
raw = xaf.read()
xaf.close()
except IOError as err:
raise XConnectionError("Can't read ~/.Xauthority: %s" % err[1])
return

n = 0
entries =
try:
while n < len(raw):
family, = struct.unpack('>H', raw[n:n + 2])
n = n + 2

length, = struct.unpack('>H', raw[n:n + 2])
n = n + length + 2
addr = raw[n - length: n]

length, = struct.unpack('>H', raw[n:n + 2])
n = n + length + 2
num = raw[n - length: n]

length, = struct.unpack('>H', raw[n:n + 2])
n = n + length + 2
name = raw[n - length: n]

length, = struct.unpack('>H', raw[n:n + 2])
n = n + length + 2
data = raw[n - length: n]

if len(data) != length:
break

entries.append((family, addr.decode('utf-8'), num.decode('utf-8'), name.decode('utf-8'), data))


How can I figure out which of the auth is the one associated with the value reported by $DISPLAY?










share|improve this question
























  • @grawity I'm using Ubuntu 18.10. Standard installation with GDM and Gnome Shell.
    – Roberto Leinardi
    2 days ago










  • Your second cookie also looks not quite right. What happens when you xauth extract some_file :1 and then xauth -f some_file list? If you get the first line again, I don't understand what's happening. If you get a different line, my guess would be "auth file corrupt; remove it, log out, log in, see if it gets better".
    – dirkt
    2 days ago










  • Unfortunately the result is exactly the same as the $XAUTHORITY one.
    – Roberto Leinardi
    2 days ago














2












2








2







When I run on my local machine (Ubuntu 18.10) xauth list the output is not showing the display number:



$ xauth list
c7h/unix: MIT-MAGIC-COOKIE-1 37bb744d95232b4e29aea1320b0a0e2d
#ffff#633768#: MIT-MAGIC-COOKIE-1 37bb744d95232b4e29aea1320b0a0e2d


My env $DISPLAY variable contains the value :1:



$ echo $DISPLAY
:1


So I was expecting to see 1 after c7h/unix::



c7h/unix:1  MIT-MAGIC-COOKIE-1  37bb744d95232b4e29aea1320b0a0e2d


The value is also missing if I manually parse the file inside the env variable $XAUTHORITY with Python:



if filename is None:
filename = os.environ.get('XAUTHORITY')

if filename is None:
try:
filename = os.path.join(os.environ['HOME'], '.Xauthority')
except KeyError:
raise XConnectionError("$HOME not set, can't find ~/.Xauthority")

try:
xaf = open(filename, 'rb')
raw = xaf.read()
xaf.close()
except IOError as err:
raise XConnectionError("Can't read ~/.Xauthority: %s" % err[1])
return

n = 0
entries =
try:
while n < len(raw):
family, = struct.unpack('>H', raw[n:n + 2])
n = n + 2

length, = struct.unpack('>H', raw[n:n + 2])
n = n + length + 2
addr = raw[n - length: n]

length, = struct.unpack('>H', raw[n:n + 2])
n = n + length + 2
num = raw[n - length: n]

length, = struct.unpack('>H', raw[n:n + 2])
n = n + length + 2
name = raw[n - length: n]

length, = struct.unpack('>H', raw[n:n + 2])
n = n + length + 2
data = raw[n - length: n]

if len(data) != length:
break

entries.append((family, addr.decode('utf-8'), num.decode('utf-8'), name.decode('utf-8'), data))


How can I figure out which of the auth is the one associated with the value reported by $DISPLAY?










share|improve this question















When I run on my local machine (Ubuntu 18.10) xauth list the output is not showing the display number:



$ xauth list
c7h/unix: MIT-MAGIC-COOKIE-1 37bb744d95232b4e29aea1320b0a0e2d
#ffff#633768#: MIT-MAGIC-COOKIE-1 37bb744d95232b4e29aea1320b0a0e2d


My env $DISPLAY variable contains the value :1:



$ echo $DISPLAY
:1


So I was expecting to see 1 after c7h/unix::



c7h/unix:1  MIT-MAGIC-COOKIE-1  37bb744d95232b4e29aea1320b0a0e2d


The value is also missing if I manually parse the file inside the env variable $XAUTHORITY with Python:



if filename is None:
filename = os.environ.get('XAUTHORITY')

if filename is None:
try:
filename = os.path.join(os.environ['HOME'], '.Xauthority')
except KeyError:
raise XConnectionError("$HOME not set, can't find ~/.Xauthority")

try:
xaf = open(filename, 'rb')
raw = xaf.read()
xaf.close()
except IOError as err:
raise XConnectionError("Can't read ~/.Xauthority: %s" % err[1])
return

n = 0
entries =
try:
while n < len(raw):
family, = struct.unpack('>H', raw[n:n + 2])
n = n + 2

length, = struct.unpack('>H', raw[n:n + 2])
n = n + length + 2
addr = raw[n - length: n]

length, = struct.unpack('>H', raw[n:n + 2])
n = n + length + 2
num = raw[n - length: n]

length, = struct.unpack('>H', raw[n:n + 2])
n = n + length + 2
name = raw[n - length: n]

length, = struct.unpack('>H', raw[n:n + 2])
n = n + length + 2
data = raw[n - length: n]

if len(data) != length:
break

entries.append((family, addr.decode('utf-8'), num.decode('utf-8'), name.decode('utf-8'), data))


How can I figure out which of the auth is the one associated with the value reported by $DISPLAY?







linux xorg xauth






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 2 days ago







Roberto Leinardi

















asked 2 days ago









Roberto LeinardiRoberto Leinardi

1214




1214












  • @grawity I'm using Ubuntu 18.10. Standard installation with GDM and Gnome Shell.
    – Roberto Leinardi
    2 days ago










  • Your second cookie also looks not quite right. What happens when you xauth extract some_file :1 and then xauth -f some_file list? If you get the first line again, I don't understand what's happening. If you get a different line, my guess would be "auth file corrupt; remove it, log out, log in, see if it gets better".
    – dirkt
    2 days ago










  • Unfortunately the result is exactly the same as the $XAUTHORITY one.
    – Roberto Leinardi
    2 days ago


















  • @grawity I'm using Ubuntu 18.10. Standard installation with GDM and Gnome Shell.
    – Roberto Leinardi
    2 days ago










  • Your second cookie also looks not quite right. What happens when you xauth extract some_file :1 and then xauth -f some_file list? If you get the first line again, I don't understand what's happening. If you get a different line, my guess would be "auth file corrupt; remove it, log out, log in, see if it gets better".
    – dirkt
    2 days ago










  • Unfortunately the result is exactly the same as the $XAUTHORITY one.
    – Roberto Leinardi
    2 days ago
















@grawity I'm using Ubuntu 18.10. Standard installation with GDM and Gnome Shell.
– Roberto Leinardi
2 days ago




@grawity I'm using Ubuntu 18.10. Standard installation with GDM and Gnome Shell.
– Roberto Leinardi
2 days ago












Your second cookie also looks not quite right. What happens when you xauth extract some_file :1 and then xauth -f some_file list? If you get the first line again, I don't understand what's happening. If you get a different line, my guess would be "auth file corrupt; remove it, log out, log in, see if it gets better".
– dirkt
2 days ago




Your second cookie also looks not quite right. What happens when you xauth extract some_file :1 and then xauth -f some_file list? If you get the first line again, I don't understand what's happening. If you get a different line, my guess would be "auth file corrupt; remove it, log out, log in, see if it gets better".
– dirkt
2 days ago












Unfortunately the result is exactly the same as the $XAUTHORITY one.
– Roberto Leinardi
2 days ago




Unfortunately the result is exactly the same as the $XAUTHORITY one.
– Roberto Leinardi
2 days ago










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1390857%2fxauthority-is-missing-the-display-number%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1390857%2fxauthority-is-missing-the-display-number%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

is 'sed' thread safe

How to make a Squid Proxy server?