1 /*
2 ** System header files used by all modules
3 */
4 #include <unistd.h>
5 #include <stdio.h>
6 #include <stdlib.h>
7 #include <ctype.h>
8 #include <string.h>
9 #include <stdarg.h>
10 #include <sqlite3.h>
11 #include <assert.h>
12 #if defined(__linux__) || defined(__sun__)
13 #include <crypt.h>
14 #endif
15 
16 /*
17 ** Standard colors.  These colors can also be changed using a stylesheet.
18 */
19 
20 /* A blue border and background.  Used for the title bar and for dates
21 ** in a timeline.
22 */
23 #define BORDER1       "#a0b5f4"      /* Stylesheet class: border1 */
24 #define BG1           "#d0d9f4"      /* Stylesheet class: bkgnd1 */
25 
26 /* A red border and background.  Use for releases in the timeline.
27 */
28 #define BORDER2       "#ec9898"      /* Stylesheet class: border2 */
29 #define BG2           "#f7c0c0"      /* Stylesheet class: bkgnd2 */
30 
31 /* A gray background.  Used for column headers in the Wiki Table of Contents
32 ** and to highlight ticket properties.
33 */
34 #define BG3           "#d0d0d0"      /* Stylesheet class: bkgnd3 */
35 
36 /* A light-gray background.  Used for title bar, menus, and rlog alternation
37 */
38 #define BG4           "#f0f0f0"      /* Stylesheet class: bkgnd4 */
39 
40 /* A deeper gray background.  Used for branches
41 */
42 #define BG5           "#dddddd"      /* Stylesheet class: bkgnd5 */
43 
44 /* Default HTML page header */
45 #define HEADER "<html>\n" \
46                "<head>\n" \
47                "<link rel=\"alternate\" type=\"application/rss+xml\"\n" \
48                "   title=\"%N Timeline Feed\" href=\"%B/timeline.rss\">\n" \
49                "<link rel=\"index\" title=\"Index\" href=\"%B/index\">\n" \
50                "<link rel=\"search\" title=\"Search\" href=\"%B/search\">\n" \
51                "<link rel=\"help\" title=\"Help\"\n" \
52                "   href=\"%B/wiki?p=CvstracDocumentation\">\n" \
53                "<title>%N: %T</title>\n</head>\n" \
54                "<body bgcolor=\"white\">"
55 
56 /* Default HTML page footer */
57 #define FOOTER "<div id=\"footer\"><small><small>\n" \
58                "<a href=\"about\">CVSTrac version %V</a>\n" \
59                "</small></small></div>\n" \
60                "</body></html>\n"
61 
62 /* In the timeline, check-in messages are truncated at the first space
63 ** that is more than MX_CKIN_MSG from the beginning, or at the first
64 ** paragraph break that is more than MN_CKIN_MSG from the beginning.
65 */
66 #define MN_CKIN_MSG   100
67 #define MX_CKIN_MSG   300
68 
69 /* Maximum number of seconds for any HTTP or CGI handler to live. This
70 ** prevents denials of service caused by bad queries, endless loops, or
71 ** other possibilties.
72 */
73 #define MX_CHILD_LIFETIME 300
74 
75 /* If defined, causes the query_authorizer() function to return SQLITE_DENY on
76 ** invalid calls rather than just SQLITE_IGNORE. This is not recommended for
77 ** production use since it's basically a denial of service waiting to happen,
78 ** but CVSTrac developers _should_ enable it to catch incorrect use of
79 ** db_query calls (i.e. using them for something other than SELECT).
80 */
81 /* #define USE_STRICT_AUTHORIZER 1 */
82 
83 /* Unset the following to disable internationalization code. */
84 #ifndef CVSTRAC_I18N
85 # define CVSTRAC_I18N 1
86 #endif
87 
88 #if CVSTRAC_I18N
89 # include <locale.h>
90 # include <langinfo.h>
91 #endif
92 #ifndef CODESET
93 # undef CVSTRAC_I18N
94 # define CVSTRAC_I18N 0
95 #endif
96