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

« back to all changes in this revision

Viewing changes to unix/xc/lib/XIE/events.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
/* $Xorg: events.c,v 1.4 2001/02/09 02:03:41 xorgcvs Exp $ */
 
2
 
 
3
/*
 
4
 
 
5
Copyright 1993, 1994, 1998  The Open Group
 
6
 
 
7
Permission to use, copy, modify, distribute, and sell this software and its
 
8
documentation for any purpose is hereby granted without fee, provided that
 
9
the above copyright notice appear in all copies and that both that
 
10
copyright notice and this permission notice appear in supporting
 
11
documentation.
 
12
 
 
13
The above copyright notice and this permission notice shall be included
 
14
in all copies or substantial portions of the Software.
 
15
 
 
16
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 
17
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
18
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 
19
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
 
20
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 
21
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 
22
OTHER DEALINGS IN THE SOFTWARE.
 
23
 
 
24
Except as contained in this notice, the name of The Open Group shall
 
25
not be used in advertising or otherwise to promote the sale, use or
 
26
other dealings in this Software without prior written authorization
 
27
from The Open Group.
 
28
 
 
29
*/
 
30
/* $XFree86: xc/lib/XIE/events.c,v 1.5 2001/12/14 19:54:33 dawes Exp $ */
 
31
 
 
32
#define NEED_EVENTS   /* so xEvent will get pulled in */
 
33
#include "XIElibint.h"
 
34
 
 
35
 
 
36
Status
 
37
_XieColorAllocEvent (
 
38
        Display         *display,
 
39
        XEvent          *host,
 
40
        xEvent          *wire)
 
41
{
 
42
    XieColorAllocEvent       *host_event = (XieColorAllocEvent *) host;
 
43
    xieColorAllocEvn         *wire_event = (xieColorAllocEvn *) wire;
 
44
 
 
45
    host_event->type                  = wire_event->event & 0x7f;
 
46
    host_event->serial                = wire_event->sequenceNum;
 
47
    host_event->send_event            = (wire_event->event & 0x80) != 0;
 
48
    host_event->display               = display;
 
49
    host_event->name_space            = wire_event->instanceNameSpace;
 
50
    host_event->time                  = wire_event->time;
 
51
    host_event->flo_id                = wire_event->instanceFloID;
 
52
    host_event->src                   = wire_event->src;
 
53
    host_event->elem_type             = wire_event->type;
 
54
    host_event->color_list            = wire_event->colorList;
 
55
    host_event->color_alloc_technique = wire_event->colorAllocTechnique;
 
56
    host_event->color_alloc_data      = wire_event->data;
 
57
 
 
58
    return (True);
 
59
}
 
60
 
 
61
 
 
62
Status
 
63
_XieDecodeNotifyEvent (
 
64
        Display         *display,
 
65
        XEvent          *host,
 
66
        xEvent          *wire)
 
67
{
 
68
    XieDecodeNotifyEvent     *host_event = (XieDecodeNotifyEvent *) host;
 
69
    xieDecodeNotifyEvn       *wire_event = (xieDecodeNotifyEvn *) wire;
 
70
 
 
71
    host_event->type             = wire_event->event & 0x7f;
 
72
    host_event->serial           = wire_event->sequenceNum;
 
73
    host_event->send_event       = (wire_event->event & 0x80) != 0;
 
74
    host_event->display          = display;
 
75
    host_event->name_space       = wire_event->instanceNameSpace;
 
76
    host_event->time             = wire_event->time;
 
77
    host_event->flo_id           = wire_event->instanceFloID;
 
78
    host_event->src              = wire_event->src;
 
79
    host_event->elem_type        = wire_event->type;
 
80
    host_event->decode_technique = wire_event->decodeTechnique;
 
81
    host_event->aborted          = wire_event->aborted;
 
82
    host_event->band_number      = wire_event->bandNumber;
 
83
    host_event->width            = wire_event->width;
 
84
    host_event->height           = wire_event->height;
 
85
 
 
86
    return (True);
 
87
}
 
88
 
 
89
 
 
90
Status
 
91
_XieExportAvailableEvent (
 
92
        Display         *display,
 
93
        XEvent          *host,
 
94
        xEvent          *wire)
 
95
{
 
96
    XieExportAvailableEvent  *host_event = (XieExportAvailableEvent *) host;
 
97
    xieExportAvailableEvn    *wire_event = (xieExportAvailableEvn *) wire;
 
98
 
 
99
    host_event->type       = wire_event->event & 0x7f;
 
100
    host_event->serial     = wire_event->sequenceNum;
 
101
    host_event->send_event = (wire_event->event & 0x80) != 0;
 
102
    host_event->display    = display;
 
103
    host_event->name_space = wire_event->instanceNameSpace;
 
104
    host_event->time       = wire_event->time;
 
105
    host_event->flo_id     = wire_event->instanceFloID;
 
106
    host_event->src        = wire_event->src;
 
107
    host_event->elem_type  = wire_event->type;
 
108
    host_event->band_number = wire_event->bandNumber;
 
109
    host_event->data[0]    = wire_event->data0;
 
110
    host_event->data[1]    = wire_event->data1;
 
111
    host_event->data[2]    = wire_event->data2;
 
112
 
 
113
    return (True);
 
114
}
 
115
 
 
116
 
 
117
Status
 
118
_XieImportObscuredEvent (
 
119
        Display         *display,
 
120
        XEvent          *host,
 
121
        xEvent          *wire)
 
122
{
 
123
    XieImportObscuredEvent   *host_event = (XieImportObscuredEvent *) host;
 
124
    xieImportObscuredEvn     *wire_event = (xieImportObscuredEvn *) wire;
 
125
 
 
126
    host_event->type       = wire_event->event & 0x7f;
 
127
    host_event->serial     = wire_event->sequenceNum;
 
128
    host_event->send_event = (wire_event->event & 0x80) != 0;
 
129
    host_event->display    = display;
 
130
    host_event->name_space = wire_event->instanceNameSpace;
 
131
    host_event->time       = wire_event->time;
 
132
    host_event->flo_id     = wire_event->instanceFloID;
 
133
    host_event->src        = wire_event->src;
 
134
    host_event->elem_type  = wire_event->type;
 
135
    host_event->window     = wire_event->window;
 
136
    host_event->x          = wire_event->x;
 
137
    host_event->y          = wire_event->y;
 
138
    host_event->width      = wire_event->width;
 
139
    host_event->height     = wire_event->height;
 
140
 
 
141
    return (True);
 
142
}
 
143
 
 
144
 
 
145
Status
 
146
_XiePhotofloDoneEvent (
 
147
        Display         *display,
 
148
        XEvent          *host,
 
149
        xEvent          *wire)
 
150
{
 
151
    XiePhotofloDoneEvent     *host_event = (XiePhotofloDoneEvent *) host;
 
152
    xiePhotofloDoneEvn       *wire_event = (xiePhotofloDoneEvn *) wire;
 
153
 
 
154
    host_event->type       = wire_event->event & 0x7f;
 
155
    host_event->serial     = wire_event->sequenceNum;
 
156
    host_event->send_event = (wire_event->event & 0x80) != 0;
 
157
    host_event->display    = display;
 
158
    host_event->name_space = wire_event->instanceNameSpace;
 
159
    host_event->time       = wire_event->time;
 
160
    host_event->flo_id     = wire_event->instanceFloID;
 
161
    host_event->outcome    = wire_event->outcome;
 
162
 
 
163
    return (True);
 
164
}