mirror of
https://github.com/danbulant/node-x11
synced 2026-06-24 09:12:13 +00:00
try to connect with empty auth data if no Xauthority file
This commit is contained in:
parent
d2a56871d2
commit
bf2c603be7
1 changed files with 11 additions and 3 deletions
|
|
@ -67,7 +67,15 @@ module.exports = function( display, host, cb )
|
||||||
}
|
}
|
||||||
fs.readFile(XAuthorityFile, function (err, data) {
|
fs.readFile(XAuthorityFile, function (err, data) {
|
||||||
|
|
||||||
if (err) throw err;
|
if (err)
|
||||||
|
{
|
||||||
|
if (err.code == 'ENOENT')
|
||||||
|
{
|
||||||
|
cb('','');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
|
||||||
var auth = parseXauth(data);
|
var auth = parseXauth(data);
|
||||||
for (cookieNum in auth)
|
for (cookieNum in auth)
|
||||||
|
|
@ -79,8 +87,8 @@ module.exports = function( display, host, cb )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw 'No auth cookie matching display=' + display + ' and host=' + host;
|
// throw 'No auth cookie matching display=' + display + ' and host=' + host;
|
||||||
|
cb( '', '' );
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue