try to connect with empty auth data if no Xauthority file

This commit is contained in:
sidorares 2011-08-02 14:12:30 +10:00
parent d2a56871d2
commit bf2c603be7

View file

@ -67,7 +67,15 @@ module.exports = function( display, host, cb )
}
fs.readFile(XAuthorityFile, function (err, data) {
if (err) throw err;
if (err)
{
if (err.code == 'ENOENT')
{
cb('','');
return;
}
throw err;
}
var auth = parseXauth(data);
for (cookieNum in auth)
@ -79,8 +87,8 @@ module.exports = function( display, host, cb )
return;
}
}
throw 'No auth cookie matching display=' + display + ' and host=' + host;
// throw 'No auth cookie matching display=' + display + ' and host=' + host;
cb( '', '' );
});
}
}