Annotation of /trunk/tigervnc/patches/tigervnc-0.0.90-cookie.patch
Parent Directory | Revision Log
Revision 817 -
(hide annotations)
(download)
Tue May 19 18:16:42 2009 UTC (15 years, 4 months ago) by niro
File size: 1063 byte(s)
Tue May 19 18:16:42 2009 UTC (15 years, 4 months ago) by niro
File size: 1063 byte(s)
-files for tigervnc
1 | niro | 817 | --- vnc-4_1-unixsrc/unix/vncserver.cookie 2005-02-23 12:28:18.000000000 +0000 |
2 | +++ vnc-4_1-unixsrc/unix/vncserver 2005-03-03 22:04:28.000000000 +0000 | ||
3 | @@ -116,18 +116,12 @@ | ||
4 | $desktopLog = "$vncUserDir/$host:$displayNumber.log"; | ||
5 | unlink($desktopLog); | ||
6 | |||
7 | -# Make an X server cookie - use as the seed the sum of the current time, our | ||
8 | -# PID and part of the encrypted form of the password. Ideally we'd use | ||
9 | -# /dev/urandom, but that's only available on Linux. | ||
10 | - | ||
11 | -srand(time+$$+unpack("L",`cat $vncUserDir/passwd`)); | ||
12 | -$cookie = ""; | ||
13 | -for (1..16) { | ||
14 | - $cookie .= sprintf("%02x", int(rand(256)) % 256); | ||
15 | -} | ||
16 | - | ||
17 | -system("xauth -f $xauthorityFile add $host:$displayNumber . $cookie"); | ||
18 | -system("xauth -f $xauthorityFile add $host/unix:$displayNumber . $cookie"); | ||
19 | +# Make an X server cookie - use mcookie | ||
20 | +$cookie = `/usr/bin/mcookie`; | ||
21 | +open (XAUTH, "|xauth -f $xauthorityFile source -"); | ||
22 | +print XAUTH "add $host:$displayNumber . $cookie\n"; | ||
23 | +print XAUTH "add $host/unix:$displayNumber . $cookie\n"; | ||
24 | +close XAUTH; | ||
25 | |||
26 | if ($opt{'-name'}) { | ||
27 | $desktopName = $opt{'-name'}; |