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

« back to all changes in this revision

Viewing changes to unix/xc/lib/font/include/bufio.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: bufio.h,v 1.4 2001/02/09 02:04:04 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/font/include/bufio.h,v 1.7 2001/12/14 19:56:53 dawes Exp $ */
 
31
 
 
32
#ifndef ___BUFIO_H___
 
33
#define ___BUFIO_H___ 1
 
34
 
 
35
#include <X11/Xfuncproto.h>
 
36
 
 
37
#ifdef TEST
 
38
 
 
39
#define xalloc(s)   malloc(s)
 
40
#define xfree(s)    free(s)
 
41
 
 
42
#endif
 
43
 
 
44
#define BUFFILESIZE     8192
 
45
#define BUFFILEEOF      -1
 
46
 
 
47
typedef unsigned char BufChar;
 
48
typedef struct _buffile *BufFilePtr;
 
49
 
 
50
typedef struct _buffile {
 
51
    BufChar *bufp;
 
52
    int     left;
 
53
    int     eof;
 
54
    BufChar buffer[BUFFILESIZE];
 
55
    int     (*input)( BufFilePtr /* f */);
 
56
    int     (*output)( int /* c */, BufFilePtr /* f */);
 
57
    int     (*skip)( BufFilePtr /* f */, int /* count */);
 
58
    int     (*close)( BufFilePtr /* f */, int /* doClose */);
 
59
    char    *private;
 
60
} BufFileRec;
 
61
 
 
62
extern BufFilePtr BufFileCreate (
 
63
    char*,
 
64
    int (*)(BufFilePtr),
 
65
    int (*)(int, BufFilePtr),
 
66
    int (*)(BufFilePtr, int),
 
67
    int (*)(BufFilePtr, int));
 
68
extern BufFilePtr BufFileOpenRead ( int );
 
69
extern BufFilePtr BufFileOpenWrite ( int );
 
70
extern BufFilePtr BufFilePushCompressed ( BufFilePtr );
 
71
#ifdef X_GZIP_FONT_COMPRESSION
 
72
extern BufFilePtr BufFilePushZIP ( BufFilePtr );
 
73
#endif
 
74
extern int BufFileClose ( BufFilePtr, int );
 
75
extern int BufFileFlush ( BufFilePtr, int );
 
76
extern int BufFileRead ( BufFilePtr, char*, int );
 
77
extern int BufFileWrite ( BufFilePtr, char*, int );
 
78
extern void BufFileFree ( BufFilePtr );
 
79
 
 
80
#define BufFileGet(f)   ((f)->left-- ? *(f)->bufp++ : ((f)->eof = (*(f)->input) (f)))
 
81
#define BufFilePut(c,f) (--(f)->left ? *(f)->bufp++ = ((unsigned char)(c)) : (*(f)->output) ((unsigned char)(c),f))
 
82
#define BufFileSkip(f,c)    ((f)->eof = (*(f)->skip) (f, c))
 
83
 
 
84
#ifndef TRUE
 
85
#define TRUE 1
 
86
#endif
 
87
#ifndef FALSE
 
88
#define FALSE 0
 
89
#endif
 
90
 
 
91
#endif /* ___BUFIO_H___ */
 
92