~ubuntu-branches/ubuntu/gutsy/vnc4/gutsy

« back to all changes in this revision

Viewing changes to unix/xc/programs/Xserver/hw/xfree86/XF86Setup/phase3.tcl

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2006-05-15 20:35:17 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060515203517-l4lre1ku942mn26k
Tags: 4.1.1+X4.3.0-10
* Correction of critical security issue. Thanks to Martin Kogler
  <e9925248@student.tuwien.ac.at> that informed me about the issue,
  and provided the patch.
  This flaw was originally found by Steve Wiseman of intelliadmin.com.
* Applied patch from Javier Kohen <jkohen@users.sourceforge.net> that
  inform the user that only 8 first characters of the password will
  actually be used when typing more than 8 characters, closes:
  #355619.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# $XConsortium: phase3.tcl /main/1 1996/09/21 14:17:37 kaleb $
 
2
#
 
3
#
 
4
#
 
5
#
 
6
# $XFree86: xc/programs/Xserver/hw/xfree86/XF86Setup/phase3.tcl,v 3.5 1998/04/05 16:15:51 robin Exp $
 
7
#
 
8
# Copyright 1996 by Joseph V. Moss <joe@XFree86.Org>
 
9
#
 
10
# See the file "LICENSE" for information regarding redistribution terms,
 
11
# and for a DISCLAIMER OF ALL WARRANTIES.
 
12
#
 
13
 
 
14
#
 
15
# Phase III - Commands run after switching back to text mode
 
16
#     - responsible for starting second server
 
17
#
 
18
 
 
19
source $tcl_library/init.tcl
 
20
source $XF86Setup_library/texts/local_text.tcl
 
21
source $XF86Setup_library/setuplib.tcl
 
22
source $XF86Setup_library/carddata.tcl
 
23
source $XF86Setup_library/mondata.tcl
 
24
source $StateFileName
 
25
 
 
26
mesg $messages(phase3.1) info
 
27
sleep 2
 
28
writeXF86Config $Confname-2 -defaultmodes
 
29
 
 
30
set devid [lindex $DeviceIDs 0]
 
31
global Device_$devid
 
32
set server [set Device_${devid}(Server)]
 
33
 
 
34
set ServerPID [start_server $server $Confname-2 ServerOut-2 ]
 
35
 
 
36
if { $ServerPID == -1 } {
 
37
        set msg $messages(phase3.2)
 
38
}
 
39
 
 
40
if { $ServerPID == 0 } {
 
41
        set msg $messages(phase3.3)
 
42
}
 
43
 
 
44
if { $ServerPID < 1 } {
 
45
        mesg "$msg$messages(phase3.4)" okey
 
46
        set Phase2FallBack 1
 
47
        set ServerPID [start_server $server $Confname-1 ServerOut-1Bis]
 
48
        if { $ServerPID < 1 } {
 
49
                mesg $messages(phase3.5) info
 
50
                exit 1
 
51
        }
 
52
}
 
53
 
 
54
if { ![string length [set Device_${devid}(ClockChip)]] } {
 
55
        set fd [open $TmpDir/ServerOut-2 r]
 
56
        set clockrates ""
 
57
        set zerocount 0
 
58
        while {[gets $fd line] >= 0} {
 
59
                if {[regexp {\(.*: clocks: (.*)$} $line dummy clocks]} {
 
60
                        set clocks [string trim [squash_white $clocks]]
 
61
                        foreach clock [split $clocks] {
 
62
                                lappend clockrates $clock
 
63
                                if { $clock < 0.1 } {
 
64
                                        incr zerocount
 
65
                                }
 
66
                        }
 
67
                }
 
68
        }
 
69
        close $fd
 
70
        set clockcount [llength $clockrates]
 
71
        if { $clockcount != 0 && 1.0*$zerocount/$clockcount < 0.25 } {
 
72
                set Device_${devid}(Clocks) $clockrates
 
73
        }
 
74
}
 
75