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

« back to all changes in this revision

Viewing changes to unix/xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.c

  • 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
/* $XFree86: xc/programs/Xserver/hw/xfree86/int10/xf86x86emu.c,v 1.13 2002/09/16 18:06:09 eich Exp $ */
 
2
/*
 
3
 *                   XFree86 int10 module
 
4
 *   execute BIOS int 10h calls in x86 real mode environment
 
5
 *                 Copyright 1999 Egbert Eich
 
6
 */
 
7
#include <x86emu.h>
 
8
#include "xf86.h"
 
9
#include "xf86_ansic.h"
 
10
#include "compiler.h"
 
11
#include "xf86_OSproc.h"
 
12
#include "xf86Pci.h"
 
13
#include "xf86_libc.h"
 
14
#define _INT10_PRIVATE
 
15
#include "xf86int10.h"
 
16
#include "int10Defines.h"
 
17
 
 
18
#define M _X86EMU_env
 
19
 
 
20
static void
 
21
x86emu_do_int(int num)
 
22
{
 
23
    Int10Current->num = num;
 
24
 
 
25
    if (!int_handler(Int10Current)) {
 
26
        X86EMU_halt_sys();
 
27
    }
 
28
}
 
29
 
 
30
void
 
31
xf86ExecX86int10(xf86Int10InfoPtr pInt)
 
32
{
 
33
    int sig = setup_int(pInt);
 
34
 
 
35
    if (sig < 0)
 
36
        return;
 
37
 
 
38
    if (int_handler(pInt)) {
 
39
        X86EMU_exec();
 
40
    }
 
41
 
 
42
    finish_int(pInt, sig);
 
43
}
 
44
 
 
45
Bool
 
46
xf86Int10ExecSetup(xf86Int10InfoPtr pInt)
 
47
{
 
48
    int i;
 
49
    X86EMU_intrFuncs intFuncs[256];
 
50
    X86EMU_pioFuncs pioFuncs = {
 
51
        (&x_inb),
 
52
        (&x_inw),
 
53
        (&x_inl),
 
54
        (&x_outb),
 
55
        (&x_outw),
 
56
        (&x_outl)
 
57
    };
 
58
 
 
59
    X86EMU_memFuncs memFuncs = {
 
60
        (&Mem_rb),
 
61
        (&Mem_rw),
 
62
        (&Mem_rl),
 
63
        (&Mem_wb),
 
64
        (&Mem_ww),
 
65
        (&Mem_wl)
 
66
    };
 
67
 
 
68
    X86EMU_setupMemFuncs(&memFuncs);
 
69
 
 
70
    pInt->cpuRegs = &M;
 
71
    M.mem_base = 0;
 
72
    M.mem_size = 1024*1024 + 1024;
 
73
    X86EMU_setupPioFuncs(&pioFuncs);
 
74
 
 
75
    for (i=0;i<256;i++)
 
76
        intFuncs[i] = x86emu_do_int;
 
77
    X86EMU_setupIntrFuncs(intFuncs);
 
78
    return TRUE;
 
79
}
 
80
 
 
81
void
 
82
printk(const char *fmt, ...)
 
83
{
 
84
    va_list argptr;
 
85
    va_start(argptr, fmt);
 
86
    VErrorF(fmt, argptr);
 
87
    va_end(argptr);
 
88
}