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

« back to all changes in this revision

Viewing changes to unix/xc/lib/Xt/ThreadsI.h

  • 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: ThreadsI.h,v 1.4 2001/02/09 02:03:59 xorgcvs Exp $ */
 
2
 
 
3
/************************************************************
 
4
Copyright 1993 by Sun Microsystems, Inc. Mountain View, CA.
 
5
 
 
6
                    All Rights Reserved
 
7
 
 
8
Permission  to  use,  copy,  modify,  and  distribute   this
 
9
software  and  its documentation for any purpose and without
 
10
fee is hereby granted, provided that the above copyright no-
 
11
tice  appear  in all copies and that both that copyright no-
 
12
tice and this permission notice appear in  supporting  docu-
 
13
mentation,  and  that the name Sun not be used in advertising 
 
14
or publicity pertaining to distribution  of  the software  
 
15
without specific prior written permission. Sun makes no 
 
16
representations about the suitability of this software for 
 
17
any purpose. It is provided "as is" without any express or 
 
18
implied warranty.
 
19
 
 
20
SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO  THIS  SOFTWARE,
 
21
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
 
22
NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE  LI-
 
23
ABLE  FOR  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
 
24
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,  DATA  OR
 
25
PROFITS,  WHETHER  IN  AN  ACTION OF CONTRACT, NEGLIGENCE OR
 
26
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
 
27
THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
28
 
 
29
********************************************************/
 
30
 
 
31
/*
 
32
 
 
33
Copyright 1994, 1998  The Open Group
 
34
 
 
35
Permission to use, copy, modify, distribute, and sell this software and its
 
36
documentation for any purpose is hereby granted without fee, provided that
 
37
the above copyright notice appear in all copies and that both that
 
38
copyright notice and this permission notice appear in supporting
 
39
documentation.
 
40
 
 
41
The above copyright notice and this permission notice shall be included in
 
42
all copies or substantial portions of the Software.
 
43
 
 
44
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
45
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
46
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
 
47
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
 
48
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 
49
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
50
 
 
51
Except as contained in this notice, the name of The Open Group shall not be
 
52
used in advertising or otherwise to promote the sale, use or other dealings
 
53
in this Software without prior written authorization from The Open Group.
 
54
 
 
55
*/
 
56
/* $XFree86: xc/lib/Xt/ThreadsI.h,v 3.5 2001/12/14 19:56:31 dawes Exp $ */
 
57
 
 
58
#ifndef _XtThreadsI_h
 
59
#define _XtThreadsI_h
 
60
 
 
61
#ifdef XTHREADS
 
62
 
 
63
typedef struct _LockRec *LockPtr;
 
64
 
 
65
typedef void (*ThreadAppProc)(
 
66
#if NeedFunctionPrototypes
 
67
    XtAppContext /* app */
 
68
#endif
 
69
);
 
70
 
 
71
typedef void (*ThreadAppYieldLockProc)(
 
72
#if NeedFunctionPrototypes
 
73
    XtAppContext, /* app */
 
74
    Boolean*, /* push_thread */
 
75
    Boolean*, /* pushed_thread */
 
76
    int* /* level */
 
77
#endif
 
78
);
 
79
 
 
80
typedef void (*ThreadAppRestoreLockProc)(
 
81
#if NeedFunctionPrototypes
 
82
    XtAppContext /* app */,
 
83
    int, /* level */
 
84
    Boolean* /* pushed_thread */
 
85
#endif
 
86
);
 
87
 
 
88
extern void (*_XtProcessLock)(
 
89
#if NeedFunctionPrototypes
 
90
    void
 
91
#endif
 
92
);
 
93
 
 
94
extern void (*_XtProcessUnlock)(
 
95
#if NeedFunctionPrototypes
 
96
    void
 
97
#endif
 
98
);
 
99
 
 
100
extern void (*_XtInitAppLock)(
 
101
#if NeedFunctionPrototypes
 
102
    XtAppContext /* app */
 
103
#endif
 
104
);
 
105
 
 
106
#define INIT_APP_LOCK(app) if(_XtInitAppLock) (*_XtInitAppLock)(app)
 
107
#define FREE_APP_LOCK(app) if(app && app->free_lock)(*app->free_lock)(app)
 
108
 
 
109
#define LOCK_PROCESS if(_XtProcessLock)(*_XtProcessLock)()
 
110
#define UNLOCK_PROCESS if(_XtProcessUnlock)(*_XtProcessUnlock)()
 
111
#define LOCK_APP(app) if(app && app->lock)(*app->lock)(app)
 
112
#define UNLOCK_APP(app) if(app && app->unlock)(*app->unlock)(app)
 
113
 
 
114
#define YIELD_APP_LOCK(app,push,pushed,level)\
 
115
         if(app && app->yield_lock) (*app->yield_lock)(app,push,pushed,level)
 
116
#define RESTORE_APP_LOCK(app,level,pushed)\
 
117
         if(app && app->restore_lock) (*app->restore_lock)(app,level,pushed)
 
118
 
 
119
#define WIDGET_TO_APPCON(w) \
 
120
    XtAppContext app = (w && _XtProcessLock ? \
 
121
        XtWidgetToApplicationContext(w) : NULL)
 
122
 
 
123
#define DPY_TO_APPCON(d) \
 
124
    XtAppContext app = (_XtProcessLock ? XtDisplayToApplicationContext(d): 0)
 
125
 
 
126
#else /* defined(XTHREADS) */
 
127
 
 
128
#define LOCK_PROCESS
 
129
#define UNLOCK_PROCESS
 
130
#define LOCK_APP(app)
 
131
#define UNLOCK_APP(app)
 
132
 
 
133
#define INIT_APP_LOCK(app)
 
134
#define FREE_APP_LOCK(app)
 
135
 
 
136
#define WIDGET_TO_APPCON(w)
 
137
#define DPY_TO_APPCON(d)
 
138
 
 
139
#endif /* !defined(XTHREADS) */
 
140
#endif /* _XtThreadsI_h */