~ubuntu-branches/ubuntu/breezy/koffice/breezy-security

« back to all changes in this revision

Viewing changes to kexi/3rdparty/kexisql3/src/os_unix.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-10-11 14:49:50 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051011144950-lwpngbifzp8nk0ds
Tags: 1:1.4.1-0ubuntu7
* SECURITY UPDATE: fix heap based buffer overflow in the RTF importer of KWord
* Opening specially crafted RTF files in KWord can cause
  execution of abitrary code.
* Add kubuntu_01_rtfimport_heap_overflow.diff
* References:
  CAN-2005-2971
  CESA-2005-005
  http://www.koffice.org/security/advisory-20051011-1.txt

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
** 2004 May 22
 
3
**
 
4
** The author disclaims copyright to this source code.  In place of
 
5
** a legal notice, here is a blessing:
 
6
**
 
7
**    May you do good and not evil.
 
8
**    May you find forgiveness for yourself and forgive others.
 
9
**    May you share freely, never taking more than you give.
 
10
**
 
11
******************************************************************************
 
12
**
 
13
** This header file defined OS-specific features for Unix.
 
14
*/
 
15
#ifndef _SQLITE_OS_UNIX_H_
 
16
#define _SQLITE_OS_UNIX_H_
 
17
 
 
18
/*
 
19
** Helpful hint:  To get this to compile on HP/UX, add -D_INCLUDE_POSIX_SOURCE
 
20
** to the compiler command line.
 
21
*/
 
22
 
 
23
/*
 
24
** These #defines should enable >2GB file support on Posix if the
 
25
** underlying operating system supports it.  If the OS lacks
 
26
** large file support, or if the OS is windows, these should be no-ops.
 
27
**
 
28
** Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch
 
29
** on the compiler command line.  This is necessary if you are compiling
 
30
** on a recent machine (ex: RedHat 7.2) but you want your code to work
 
31
** on an older machine (ex: RedHat 6.0).  If you compile on RedHat 7.2
 
32
** without this option, LFS is enable.  But LFS does not exist in the kernel
 
33
** in RedHat 6.0, so the code won't work.  Hence, for maximum binary
 
34
** portability you should omit LFS.
 
35
**
 
36
** Similar is true for MacOS.  LFS is only supported on MacOS 9 and later.
 
37
*/
 
38
#ifndef SQLITE_DISABLE_LFS
 
39
# define _LARGE_FILE       1
 
40
# ifndef _FILE_OFFSET_BITS
 
41
#   define _FILE_OFFSET_BITS 64
 
42
# endif
 
43
# define _LARGEFILE_SOURCE 1
 
44
#endif
 
45
 
 
46
/*
 
47
** standard include files.
 
48
*/
 
49
#include <sys/types.h>
 
50
#include <sys/stat.h>
 
51
#include <fcntl.h>
 
52
#include <unistd.h>
 
53
 
 
54
/*
 
55
** The OsFile structure is a operating-system independing representation
 
56
** of an open file handle.  It is defined differently for each architecture.
 
57
**
 
58
** This is the definition for Unix.
 
59
**
 
60
** OsFile.locktype takes one of the values SHARED_LOCK, RESERVED_LOCK,
 
61
** PENDING_LOCK or EXCLUSIVE_LOCK.
 
62
*/
 
63
typedef struct OsFile OsFile;
 
64
struct OsFile {
 
65
  struct Pager *pPager;     /* The pager that owns this OsFile.  Might be 0 */
 
66
  struct openCnt *pOpen;    /* Info about all open fd's on this inode */
 
67
  struct lockInfo *pLock;   /* Info about locks on this inode */
 
68
  int h;                    /* The file descriptor */
 
69
  unsigned char locktype;   /* The type of lock held on this fd */
 
70
  unsigned char isOpen;     /* True if needs to be closed */
 
71
  int dirfd;                /* File descriptor for the directory */
 
72
};
 
73
 
 
74
/*
 
75
** Maximum number of characters in a temporary file name
 
76
*/
 
77
#define SQLITE_TEMPNAME_SIZE 200
 
78
 
 
79
/*
 
80
** Minimum interval supported by sqlite3OsSleep().
 
81
*/
 
82
#if defined(HAVE_USLEEP) && HAVE_USLEEP
 
83
# define SQLITE_MIN_SLEEP_MS 1
 
84
#else
 
85
# define SQLITE_MIN_SLEEP_MS 1000
 
86
#endif
 
87
 
 
88
 
 
89
#endif /* _SQLITE_OS_UNIX_H_ */