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

« back to all changes in this revision

Viewing changes to unix/xc/lib/XIE/errors.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: errors.c,v 1.6 2001/02/09 02:03:41 xorgcvs Exp $ */
 
2
 
 
3
/*
 
4
 
 
5
Copyright 1993, 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/errors.c,v 3.5 2001/12/14 19:54:33 dawes Exp $ */
 
31
 
 
32
#define NEED_EVENTS     /* so XErrorEvent will get pulled in */
 
33
 
 
34
#include "XIElibint.h"
 
35
 
 
36
 
 
37
Bool
 
38
_XieFloError (
 
39
        Display         *display,
 
40
        XErrorEvent     *host,
 
41
        xError          *wire)
 
42
{
 
43
    XieFloAccessError   *flo_host_error = (XieFloAccessError *) host;
 
44
    xieFloAccessErr     *flo_wire_error = (xieFloAccessErr *) wire;
 
45
 
 
46
    /*
 
47
     * All flo errors have this basic info.
 
48
     */
 
49
 
 
50
/*  these are assigned by Xlib already
 
51
    flo_host_error->error_code     = flo_wire_error->code;
 
52
    flo_host_error->flo_id         = flo_wire_error->floID;
 
53
    flo_host_error->minor_code     = flo_wire_error->minorOpcode;
 
54
    flo_host_error->request_code   = flo_wire_error->majorOpcode;
 
55
*/
 
56
    flo_host_error->flo_error_code = flo_wire_error->floErrorCode;
 
57
    flo_host_error->name_space     = flo_wire_error->nameSpace;
 
58
    flo_host_error->phototag       = flo_wire_error->phototag;
 
59
    flo_host_error->elem_type      = flo_wire_error->type;
 
60
 
 
61
 
 
62
    /*
 
63
     * Now handle the particularites of each flo error.
 
64
     */
 
65
 
 
66
    switch (((xieFloAccessErr *) wire)->floErrorCode)
 
67
    {
 
68
    case xieErrNoFloAccess:
 
69
    case xieErrNoFloAlloc:
 
70
    case xieErrNoFloElement:
 
71
    case xieErrNoFloID:
 
72
    case xieErrNoFloMatch:
 
73
    case xieErrNoFloSource:
 
74
    case xieErrNoFloImplementation:
 
75
 
 
76
        break;
 
77
 
 
78
    case xieErrNoFloColormap:
 
79
    case xieErrNoFloColorList:
 
80
    case xieErrNoFloDrawable:
 
81
    case xieErrNoFloGC:
 
82
    case xieErrNoFloLUT:
 
83
    case xieErrNoFloPhotomap:
 
84
    case xieErrNoFloROI:
 
85
 
 
86
    {
 
87
        XieFloResourceError     *host_error = (XieFloResourceError *) host;
 
88
        xieFloResourceErr       *wire_error = (xieFloResourceErr *) wire;
 
89
 
 
90
        host_error->resource_id = wire_error->resourceID;
 
91
        break;
 
92
    }
 
93
 
 
94
    case xieErrNoFloDomain:
 
95
    {
 
96
        XieFloDomainError       *host_error = (XieFloDomainError *) host;
 
97
        xieFloDomainErr         *wire_error = (xieFloDomainErr *) wire;
 
98
 
 
99
        host_error->domain_src = wire_error->domainSrc;
 
100
        break;
 
101
    }
 
102
 
 
103
    case xieErrNoFloOperator:
 
104
    {
 
105
        XieFloOperatorError     *host_error = (XieFloOperatorError *) host;
 
106
        xieFloOperatorErr       *wire_error = (xieFloOperatorErr *) wire;
 
107
 
 
108
        host_error->operator = wire_error->operator;
 
109
        break;
 
110
    }
 
111
 
 
112
    case xieErrNoFloTechnique:
 
113
    {
 
114
        XieFloTechniqueError    *host_error = (XieFloTechniqueError *) host;
 
115
        xieFloTechniqueErr      *wire_error = (xieFloTechniqueErr *) wire;
 
116
 
 
117
        host_error->technique_number = wire_error->techniqueNumber;
 
118
        host_error->num_tech_params  = wire_error->lenTechParams;
 
119
        host_error->tech_group = wire_error->techniqueGroup;
 
120
        break;
 
121
    }
 
122
 
 
123
    case xieErrNoFloValue:
 
124
    {
 
125
        XieFloValueError        *host_error = (XieFloValueError *) host;
 
126
        xieFloValueErr          *wire_error = (xieFloValueErr *) wire;
 
127
 
 
128
        host_error->bad_value = wire_error->badValue;
 
129
        break;
 
130
    }
 
131
 
 
132
    default:
 
133
        return (False);
 
134
    }
 
135
 
 
136
    return (True);
 
137
}