Contents of /trunk/vnc/patches/vnc-cookie.patch
Parent Directory | Revision Log
Revision 153 -
(show annotations)
(download)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 1063 byte(s)
Tue May 8 20:52:56 2007 UTC (17 years, 4 months ago) by niro
File size: 1063 byte(s)
-import
1 | --- 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'}; |