1 diff -urN xc.orig/programs/xfs/difs/charinfo.c xc/programs/xfs/difs/charinfo.c
2 --- xc.orig/programs/xfs/difs/charinfo.c 2004-08-08 14:23:00.000000000 +0200
3 +++ xc/programs/xfs/difs/charinfo.c 2004-08-08 14:42:16.342943816 +0200
5 #define LSBBitLeft(b,c) ((b) >> (c))
6 #define LSBBitRight(b,c) ((b) << (c))
10 if (dst_off == src_off)
12 if (srcbpr == dstbpr && src_left_bytes == dst_left_bytes)
18 /* skip the amount we just filled in */
21 diff -urN xc.orig/programs/xfs/difs/fonts.c xc/programs/xfs/difs/fonts.c
22 --- xc.orig/programs/xfs/difs/fonts.c 2004-08-08 14:23:00.000000000 +0200
23 +++ xc/programs/xfs/difs/fonts.c 2004-08-08 14:41:58.277690152 +0200
28 + * xf86GetPathElem --
29 + * Extract a single element from the font path string starting at
30 + * pnt. The font path element will be returned, and pnt will be
31 + * updated to point to the start of the next element, or set to
32 + * NULL if there are no more.
41 + *pnt = index(*pnt, ',');
50 + * xf86ValidateFontPath --
51 + * Validates the user-specified font path. Each element that
52 + * begins with a '/' is checked to make sure the directory exists.
53 + * If the directory exists, the existence of a file named 'fonts.dir'
54 + * is checked. If either check fails, an error is printed and the
55 + * element is removed from the font path.
57 +#define DIR_FILE "/fonts.dir"
58 +#define CHECK_TYPE(mode, type) ((S_IFMT & (mode)) == (type))
60 +xf86ValidateFontPath(path)
63 + char *tmp_path, *out_pnt, *path_elem, *next, *p1, *dir_elem;
64 + struct stat stat_buf;
68 + tmp_path = (char *)calloc(1,strlen(path)+1);
72 + while (next != NULL) {
73 + path_elem = xf86GetPathElem(&next);
75 + if (*path_elem == '/') {
76 + dir_elem = (char *)calloc(1, strlen(path_elem) + 1);
77 + if ((p1 = strchr(path_elem, ':')) != 0)
79 + /* OS/2 must prepend X11ROOT */
80 + if (*path_elem == '/') {
81 + path_elem = (char*)__XOS2RedirRoot(path_elem);
82 + dir_elem = (char*)calloc(1, strlen(path_elem) + 1);
83 + if (p1 = strchr(path_elem+2, ':'))
85 + dirlen = p1 - path_elem;
87 + dirlen = strlen(path_elem);
88 + strncpy(dir_elem, path_elem, dirlen);
89 + dir_elem[dirlen] = '\0';
90 + flag = stat(dir_elem, &stat_buf);
92 + if (!CHECK_TYPE(stat_buf.st_mode, S_IFDIR))
95 + printf("warning!\n");
96 + ErrorF("Warning: The directory \"%s\" does not exist.\n", dir_elem);
97 + ErrorF(" Entry deleted from font path.\n");
101 + p1 = (char *)malloc(strlen(dir_elem)+strlen(DIR_FILE)+1);
102 + strcpy(p1, dir_elem);
103 + strcat(p1, DIR_FILE);
104 + flag = stat(p1, &stat_buf);
106 + if (!CHECK_TYPE(stat_buf.st_mode, S_IFREG))
112 + ErrorF("Warning: 'fonts.dir' not found (or not valid) in \"%s\".\n",
114 + ErrorF(" Entry deleted from font path.\n");
115 + ErrorF(" (Run 'mkfontdir' on \"%s\").\n", dir_elem);
123 + * Either an OK directory, or a font server name. So add it to
126 + if (out_pnt != tmp_path)
128 + strcat(out_pnt, path_elem);
129 + out_pnt += strlen(path_elem);
135 * note that the font wakeup queue is not refcounted. this is because
136 * an fpe needs to be added when it's inited, and removed when it's finally
137 * freed, in order to handle any data that isn't requested, like FS events.
144 + fixedpath = xf86ValidateFontPath(str);
146 - len = strlen(str) + 1;
147 + len = strlen(fixedpath) + 1;
149 paths = p = (char *) ALLOCATE_LOCAL(len);
154 err = set_font_path_elements(npaths, paths, badpath);
157 DEALLOCATE_LOCAL(paths);
160 diff -urN xc.orig/programs/xfs/difs/main.c xc/programs/xfs/difs/main.c
161 --- xc.orig/programs/xfs/difs/main.c 2004-08-08 14:23:00.000000000 +0200
162 +++ xc/programs/xfs/difs/main.c 2004-08-08 14:42:22.082071336 +0200
164 #include "dispatch.h"
165 #include "extentst.h"
169 char *ConnectionInfo;
172 static Bool create_connection_block(void);
174 char *configfilename;
176 extern Bool drone_server;
178 extern OldListenRec *OldListen;
186 configfilename = DEFAULT_CONFIG_FILE;
187 diff -urN xc.orig/programs/xfs/include/debug.h xc/programs/xfs/include/debug.h
188 --- xc.orig/programs/xfs/include/debug.h 1970-01-01 01:00:00.000000000 +0100
189 +++ xc/programs/xfs/include/debug.h 2004-08-08 14:42:22.082071336 +0200
192 \ Brak znaku nowej linii na koƱcu pliku
193 diff -urN xc.orig/programs/xfs/os/utils.c xc/programs/xfs/os/utils.c
194 --- xc.orig/programs/xfs/os/utils.c 2004-08-08 14:23:00.000000000 +0200
195 +++ xc/programs/xfs/os/utils.c 2004-08-08 14:42:22.084071032 +0200
199 extern char *configfilename;
200 +extern int debug_level;
201 static Bool dropPriv = FALSE; /* whether or not to drop root privileges */
202 #ifdef DEFAULT_DAEMON
203 static Bool becomeDaemon = TRUE; /* whether to become a daemon or not */
208 - fprintf(stderr, "usage: %s [-config config_file] [-port tcp_port] [-droppriv] [-daemon] [-nodaemon] [-user user_name] [-ls listen_socket]\n",
209 + fprintf(stderr, "usage: %s [-config config_file] [-port tcp_port] [-droppriv] [-daemon] [-nodaemon] [-user user_name] [-ls listen_socket] [-d debug_level]\n",
214 ProcessLSoption (argv[++i]);
217 + } else if (!strcmp(argv[i], "-d") || !strcmp(argv[i], "--debug")) {
218 + debug_level = atoi(argv[++i]);
219 } else if (!strcmp(argv[i], "-droppriv")) {
221 } else if (!strcmp(argv[i], "-daemon")) {