|
|
$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"; |