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

« back to all changes in this revision

Viewing changes to unix/xc/programs/xrx/rx/Rx.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: Rx.h,v 1.4 2001/02/09 02:05:58 xorgcvs Exp $ */
 
2
/*
 
3
 
 
4
Copyright 1996, 1998  The Open Group
 
5
 
 
6
Permission to use, copy, modify, distribute, and sell this software and its
 
7
documentation for any purpose is hereby granted without fee, provided that
 
8
the above copyright notice appear in all copies and that both that
 
9
copyright notice and this permission notice appear in supporting
 
10
documentation.
 
11
 
 
12
The above copyright notice and this permission notice shall be included
 
13
in all copies or substantial portions of the Software.
 
14
 
 
15
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 
16
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
 
17
ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT
 
18
SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABIL-
 
19
ITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 
20
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 
21
IN THE SOFTWARE.
 
22
 
 
23
Except as contained in this notice, the name of The Open Group shall
 
24
not be used in advertising or otherwise to promote the sale, use or
 
25
other dealings in this Software without prior written authorization from
 
26
The Open Group.
 
27
 
 
28
*/
 
29
 
 
30
#ifndef _Rx_h
 
31
#define _Rx_h
 
32
 
 
33
/* a fancy Boolean type */
 
34
typedef enum { RxUndef=-1, RxFalse=0, RxTrue=1 } RxBool;
 
35
 
 
36
 
 
37
/* various enums, starting from index 1,
 
38
   with a dummy last value allowing to easily get the size,
 
39
   new values must be inserted before the last one */
 
40
typedef enum { UI=1, Print, LASTService } RxService;
 
41
typedef enum { XUI=1, LASTUIProtocol } RxUIProtocol;
 
42
typedef enum { XPrint=1, LASTPrintProtocol } RxPrintProtocol;
 
43
 
 
44
typedef enum { MitMagicCookie1=1, LASTXAuthentication } RxXAuthentication;
 
45
 
 
46
/* for each of the above enum define the corresponding max array size,
 
47
   counting 1 for NULL terminating */
 
48
#define MAX_SERVICES LASTService
 
49
#define MAX_UIPROTOS LASTUIProtocol
 
50
#define MAX_PRINTPROTOS LASTPrintProtocol
 
51
 
 
52
#define MAX_XAUTHENTICATIONS LASTXAuthentication
 
53
 
 
54
/* RxParams structure,
 
55
   designed so it can handle whatever parameter is defined in an RX document */
 
56
typedef struct {
 
57
    short version;              /* document version number */
 
58
    short revision;             /* document revision number */
 
59
 
 
60
    char *action;               /* URL */
 
61
    RxBool embedded;
 
62
    RxBool auto_start;
 
63
    int width;
 
64
    int height;
 
65
    char *app_group;            /* application group name */
 
66
 
 
67
    /* NULL terminated "lists" */
 
68
    RxService required_services[MAX_SERVICES];
 
69
    RxUIProtocol ui[MAX_UIPROTOS];
 
70
    RxPrintProtocol print[MAX_PRINTPROTOS];
 
71
 
 
72
    /* private params */
 
73
    RxBool x_ui_input_method;
 
74
    char *x_ui_input_method_url;
 
75
 
 
76
    RxBool x_ui_lbx;
 
77
    RxBool x_print_lbx;
 
78
 
 
79
    RxXAuthentication x_auth[MAX_XAUTHENTICATIONS];
 
80
    char *x_auth_data[MAX_XAUTHENTICATIONS];
 
81
 
 
82
    RxXAuthentication x_ui_auth[MAX_XAUTHENTICATIONS];
 
83
    char *x_ui_auth_data[MAX_XAUTHENTICATIONS];
 
84
 
 
85
    RxXAuthentication x_print_auth[MAX_XAUTHENTICATIONS];
 
86
    char *x_print_auth_data[MAX_XAUTHENTICATIONS];
 
87
 
 
88
    RxXAuthentication x_ui_lbx_auth[MAX_XAUTHENTICATIONS];
 
89
    char *x_ui_lbx_auth_data[MAX_XAUTHENTICATIONS];
 
90
 
 
91
    RxXAuthentication x_print_lbx_auth[MAX_XAUTHENTICATIONS];
 
92
    char *x_print_lbx_auth_data[MAX_XAUTHENTICATIONS];
 
93
 
 
94
} RxParams;
 
95
 
 
96
 
 
97
typedef struct {
 
98
    RxBool embedded;
 
99
    int width;
 
100
    int height;
 
101
    char *action;
 
102
    char *ui;                   /* URL */
 
103
    char *print;                /* URL */
 
104
 
 
105
    /* private params */
 
106
    RxBool x_ui_lbx;
 
107
    char *x_ui_lbx_auth;
 
108
    RxBool x_print_lbx;
 
109
    char *x_print_lbx_auth;
 
110
} RxReturnParams;
 
111
 
 
112
 
 
113
/* functions */
 
114
extern int
 
115
RxReadParams(char *stream,
 
116
             char **argn_ret[], char **argv_ret[], int *argc_ret);
 
117
 
 
118
extern void RxInitializeParams(RxParams *params);
 
119
 
 
120
extern int
 
121
RxParseParams(char *argn[], char *argv[], int argc, RxParams *params,
 
122
              int debug);       /* (1/0) */
 
123
 
 
124
extern char *RxBuildRequest(RxReturnParams *params);
 
125
 
 
126
extern int RxFreeParams(RxParams *params);
 
127
extern int RxFreeReturnParams(RxReturnParams *params);
 
128
 
 
129
#endif /* _Rx_h */