View | Details | Raw Unified
Collapse All | Expand All

(-) vnc-4_1_2-unixsrc/unix/vncserver.orig (-2 / +18 lines)
 Lines 127-134    Link Here 
$desktopLog = "$vncUserDir/$host:$displayNumber.log";
$desktopLog = "$vncUserDir/$host:$displayNumber.log";
unlink($desktopLog);
unlink($desktopLog);
# Make an X server cookie - use mcookie
# Make an X server cookie
$cookie = `/usr/bin/mcookie`;
#   For FreeBSD, generate it randomly
#   For Linux, use mcookie
if (`/usr/bin/uname` == 'FreeBSD')
{
    srand;
    $cookie = '';
    for (1..16)
    {
        $cookie .= sprintf("%02x", int(rand(256)));
    }
}
else
{
    $cookie = `/usr/bin/mcookie`;
}
# Now use the cookie in the xauth file
open (XAUTH, "|xauth -f $xauthorityFile source -");
open (XAUTH, "|xauth -f $xauthorityFile source -");
print XAUTH "add $host:$displayNumber . $cookie\n";
print XAUTH "add $host:$displayNumber . $cookie\n";
print XAUTH "add $host/unix:$displayNumber . $cookie\n";
print XAUTH "add $host/unix:$displayNumber . $cookie\n";