View | Details | Raw Unified | Return to bug 12135
Collapse All | Expand All

(-)scrollkeeper-0.3.14.orig/cl/src/get-cl.c (-6 / +6 lines)
Lines 101-107 Link Here
101
 */
101
 */
102
static char *get_next_free_temp_file_path(char outputprefs)
102
static char *get_next_free_temp_file_path(char outputprefs)
103
{
103
{
104
	char path[PATHLEN], *filename, *user_name, user_dir[PATHLEN];
104
	char path[PATH_MAX], *filename, *user_name, user_dir[PATH_MAX];
105
	int i, num, fd;
105
	int i, num, fd;
106
	struct stat buf;
106
	struct stat buf;
107
	time_t prev;
107
	time_t prev;
Lines 122-133 Link Here
122
		sk_message (outputprefs, SKOUT_DEFAULT, SKOUT_QUIET, "scrollkeeper-get-cl", _("Unable to determine username."));
122
		sk_message (outputprefs, SKOUT_DEFAULT, SKOUT_QUIET, "scrollkeeper-get-cl", _("Unable to determine username."));
123
		exit (EXIT_FAILURE);
123
		exit (EXIT_FAILURE);
124
	}
124
	}
125
	snprintf (user_dir, PATHLEN, "/tmp/scrollkeeper-%s", user_name);
125
	snprintf (user_dir, PATH_MAX, "/tmp/scrollkeeper-%s", user_name);
126
	free (user_name);
126
	free (user_name);
127
	make_local_tmpdir (user_dir, outputprefs);
127
	make_local_tmpdir (user_dir, outputprefs);
128
	
128
	
129
	for(i = 0; i < 5; i++) {
129
	for(i = 0; i < 5; i++) {
130
		snprintf(path, PATHLEN, "%s/contents.%d", user_dir, i);
130
		snprintf(path, PATH_MAX, "%s/contents.%d", user_dir, i);
131
		if (stat(path, &buf) == -1) {
131
		if (stat(path, &buf) == -1) {
132
			if (errno == ENOENT) {
132
			if (errno == ENOENT) {
133
				/* this is an empty slot so use it */
133
				/* this is an empty slot so use it */
Lines 162-170 Link Here
162
		num = 0;
162
		num = 0;
163
	}
163
	}
164
164
165
	filename = malloc(sizeof(char)*PATHLEN);
165
	filename = malloc(sizeof(char)*PATH_MAX);
166
	check_ptr(filename, "scrollkeeper-get-cl");
166
	check_ptr(filename, "scrollkeeper-get-cl");
167
	snprintf(filename, PATHLEN, "%s/contents.%d", user_dir, num);
167
	snprintf(filename, PATH_MAX, "%s/contents.%d", user_dir, num);
168
168
169
	unlink(filename);
169
	unlink(filename);
170
	
170
	
Lines 193-199 Link Here
193
int main(int argc, char **argv)
193
int main(int argc, char **argv)
194
{
194
{
195
    	FILE *config_fid;
195
    	FILE *config_fid;
196
    	char scrollkeeper_dir[PATHLEN], *locale;
196
    	char scrollkeeper_dir[PATH_MAX], *locale;
197
    	char *base_name, *path;
197
    	char *base_name, *path;
198
	xmlDocPtr merged_tree;
198
	xmlDocPtr merged_tree;
199
        char outputprefs=0;
199
        char outputprefs=0;
(-)scrollkeeper-0.3.14.orig/cl/src/scrollkeeper-install.c (-3 / +3 lines)
Lines 41-48 Link Here
41
main (int argc, char *argv[])
41
main (int argc, char *argv[])
42
{
42
{
43
    char *omf_name;
43
    char *omf_name;
44
    char scrollkeeper_dir[PATHLEN];
44
    char scrollkeeper_dir[PATH_MAX];
45
    char scrollkeeper_data_dir[PATHLEN];
45
    char scrollkeeper_data_dir[PATH_MAX];
46
    FILE *fid;
46
    FILE *fid;
47
    char outputprefs=0;
47
    char outputprefs=0;
48
    int i;
48
    int i;
Lines 64-70 Link Here
64
        switch (i)
64
        switch (i)
65
        {
65
        {
66
        case 'p':
66
        case 'p':
67
            strncpy (scrollkeeper_dir, optarg, PATHLEN);
67
            strncpy (scrollkeeper_dir, optarg, PATH_MAX-1);
68
            break;
68
            break;
69
69
70
        case 'v':
70
        case 'v':
(-)scrollkeeper-0.3.14.orig/cl/src/scrollkeeper-uninstall.c (-2 / +2 lines)
Lines 36-42 Link Here
36
int
36
int
37
main (int argc, char *argv[])
37
main (int argc, char *argv[])
38
{
38
{
39
    char *omf_name, scrollkeeper_dir[PATHLEN];
39
    char *omf_name, scrollkeeper_dir[PATH_MAX];
40
    FILE *fid;
40
    FILE *fid;
41
    char outputprefs=0;
41
    char outputprefs=0;
42
    int i;
42
    int i;
Lines 55-61 Link Here
55
        switch (i)
55
        switch (i)
56
        {
56
        {
57
        case 'p':
57
        case 'p':
58
            strncpy (scrollkeeper_dir, optarg, PATHLEN);
58
            strncpy (scrollkeeper_dir, optarg, PATH_MAX-1);
59
	    break;
59
	    break;
60
60
61
        case 'v':
61
        case 'v':
(-)scrollkeeper-0.3.14.orig/cl/src/update.c (-12 / +12 lines)
Lines 31-37 Link Here
31
#include <scrollkeeper.h>
31
#include <scrollkeeper.h>
32
32
33
static char **av;
33
static char **av;
34
static char config_omf_dir[PATHLEN];
34
static char config_omf_dir[PATH_MAX];
35
static xmlExternalEntityLoader defaultEntityLoader = NULL;
35
static xmlExternalEntityLoader defaultEntityLoader = NULL;
36
36
37
static void add_element(char ***elem_tab, int *elem_num, char *elem)
37
static void add_element(char ***elem_tab, int *elem_num, char *elem)
Lines 289-295 Link Here
289
	sep[3] = '\0';
289
	sep[3] = '\0';
290
	
290
	
291
	token = strtok(line, sep);	
291
	token = strtok(line, sep);	
292
	snprintf(name, PATHLEN, "%s", token);
292
	snprintf(name, PATH_MAX, "%s", token);
293
	token = strtok(NULL, sep);
293
	token = strtok(NULL, sep);
294
	token = strtok(NULL, sep);
294
	token = strtok(NULL, sep);
295
	token = strtok(NULL, sep);
295
	token = strtok(NULL, sep);
Lines 334-340 Link Here
334
				ptr[strlen(ptr)-1] = '\0';
334
				ptr[strlen(ptr)-1] = '\0';
335
			}
335
			}
336
			
336
			
337
			strncpy(config_omf_dir, ptr, PATHLEN);
337
			strncpy(config_omf_dir, ptr, PATH_MAX-1);
338
		}			
338
		}			
339
	}
339
	}
340
	
340
	
Lines 344-360 Link Here
344
int main(int argc, char **argv)
344
int main(int argc, char **argv)
345
{
345
{
346
    FILE *fid, *config_fid;
346
    FILE *fid, *config_fid;
347
    char name[PATHLEN];
347
    char name[PATH_MAX];
348
    long t;
348
    long t;
349
    struct stat buf;
349
    struct stat buf;
350
    int line_num = 0, i;
350
    int line_num = 0, i;
351
    char **name_tab = NULL;
351
    char **name_tab = NULL;
352
    char **install_tab = NULL, **uninstall_tab = NULL;
352
    char **install_tab = NULL, **uninstall_tab = NULL;
353
    int install_num = 0, upgrade_num = 0, uninstall_num = 0;
353
    int install_num = 0, upgrade_num = 0, uninstall_num = 0;
354
    char scrollkeeper_dir[PATHLEN], omf_dir[PATHLEN];
354
    char scrollkeeper_dir[PATH_MAX], omf_dir[PATH_MAX];
355
    char **omf_dirs = NULL;
355
    char **omf_dirs = NULL;
356
    char scrollkeeper_docs[PATHLEN];
356
    char scrollkeeper_docs[PATH_MAX];
357
    char scrollkeeper_data_dir[PATHLEN];
357
    char scrollkeeper_data_dir[PATH_MAX];
358
    char **upgrade_tab = NULL;
358
    char **upgrade_tab = NULL;
359
    char *s, **cpp;
359
    char *s, **cpp;
360
    char outputprefs=0;
360
    char outputprefs=0;
Lines 376-386 Link Here
376
	switch (i)
376
	switch (i)
377
	{
377
	{
378
	case 'p':
378
	case 'p':
379
	    strncpy (scrollkeeper_dir, optarg, PATHLEN);
379
	    strncpy (scrollkeeper_dir, optarg, PATH_MAX-1);
380
	    break;
380
	    break;
381
381
382
	case 'o':
382
	case 'o':
383
	    strncpy (omf_dir, optarg, PATHLEN);
383
	    strncpy (omf_dir, optarg, PATH_MAX-1);
384
	    break;
384
	    break;
385
385
386
	case 'v':
386
	case 'v':
Lines 430-440 Link Here
430
    {
430
    {
431
	if ((s = getenv ("OMF_DIR")) != NULL)
431
	if ((s = getenv ("OMF_DIR")) != NULL)
432
	{
432
	{
433
	    strncpy (omf_dir, s, PATHLEN);
433
	    strncpy (omf_dir, s, PATH_MAX-1);
434
	}
434
	}
435
	else if (config_omf_dir[0] != '\0')
435
	else if (config_omf_dir[0] != '\0')
436
	    {
436
	    {
437
		strncpy(omf_dir, config_omf_dir, PATHLEN);
437
		strncpy(omf_dir, config_omf_dir, PATH_MAX-1);
438
	    }
438
	    }
439
	    else
439
	    else
440
	    {
440
	    {
Lines 446-452 Link Here
446
446
447
    omf_dirs = colon_split (omf_dir);
447
    omf_dirs = colon_split (omf_dir);
448
    
448
    
449
    snprintf(scrollkeeper_docs, PATHLEN, "%s/scrollkeeper_docs", scrollkeeper_dir); 
449
    snprintf(scrollkeeper_docs, PATH_MAX, "%s/scrollkeeper_docs", scrollkeeper_dir); 
450
    if (stat(scrollkeeper_docs, &buf) == 0 &&
450
    if (stat(scrollkeeper_docs, &buf) == 0 &&
451
        S_ISREG(buf.st_mode))
451
        S_ISREG(buf.st_mode))
452
    {
452
    {
(-)scrollkeeper-0.3.14.orig/libs/database.c (-18 / +26 lines)
Lines 27-33 Link Here
27
#include <dirent.h>
27
#include <dirent.h>
28
#include <scrollkeeper.h>
28
#include <scrollkeeper.h>
29
29
30
#define PATHLEN		256
31
30
32
31
33
/*
32
/*
Lines 55-61 Link Here
55
 */
54
 */
56
int sk_mkdir_with_parents(char *fullpath, mode_t options, char outputprefs)
55
int sk_mkdir_with_parents(char *fullpath, mode_t options, char outputprefs)
57
{
56
{
58
    char path[1024];
57
    char path[PATH_MAX];
59
    char slash[]="/";
58
    char slash[]="/";
60
    char delim[]="/";
59
    char delim[]="/";
61
    char *token, *pathcopy;
60
    char *token, *pathcopy;
Lines 63-77 Link Here
63
62
64
    pathcopy = strdup(fullpath); /* Copy b/c strtok edits the string it operates on */
63
    pathcopy = strdup(fullpath); /* Copy b/c strtok edits the string it operates on */
65
    path[0] = '\0';              /* Initialize with end of string null character */
64
    path[0] = '\0';              /* Initialize with end of string null character */
66
    if (pathcopy[0] == slash[0]) sprintf(path, "/"); /* preserve any starting slash */
65
    if (pathcopy[0] == slash[0]) strcpy(path, "/"); /* preserve any starting slash */
67
     
66
     
68
    token = strtok (pathcopy, delim);
67
    token = strtok (pathcopy, delim);
69
    delim[0]=slash[0];
68
    delim[0]=slash[0];
70
    while(token != NULL) {
69
    while(token != NULL) {
71
        if (strlen(path) == 0 || ((strlen(path) == 1) && (path[0] == slash[0]))) {
70
        if (strlen(path) == 0 || ((strlen(path) == 1) && (path[0] == slash[0]))) {
72
                sprintf(path, "%s%s", path, token);
71
		strncat(path, token, PATH_MAX - strlen(path) - 1);
73
        } else {
72
        } else {
74
                sprintf(path, "%s/%s", path, token);
73
		strncat(path, "/", PATH_MAX - strlen(path) - 1);
74
		strncat(path, token, PATH_MAX - strlen(path) - 1);
75
        }
75
        }
76
        if (stat(path, &buf) == -1) {
76
        if (stat(path, &buf) == -1) {
77
            if (sk_mkdir(path, options, outputprefs) != 0) {
77
            if (sk_mkdir(path, options, outputprefs) != 0) {
Lines 93-103 Link Here
93
int create_database_directory(char *scrollkeeper_dir, char *scrollkeeper_data_dir, char outputprefs)
93
int create_database_directory(char *scrollkeeper_dir, char *scrollkeeper_data_dir, char outputprefs)
94
{
94
{
95
    DIR *dir;
95
    DIR *dir;
96
    char source_path[PATHLEN], target_path[PATHLEN]; 
96
    char source_path[PATH_MAX], target_path[PATH_MAX]; 
97
    struct dirent *dir_ent;
97
    struct dirent *dir_ent;
98
    struct stat buf;
98
    struct stat buf;
99
    int empty;
99
    int empty;
100
    char *data_dir, dirname[PATHLEN];
100
    char *data_dir, dirname[PATH_MAX];
101
        
101
        
102
    /* check if it's empty */
102
    /* check if it's empty */
103
    
103
    
Lines 109-114 Link Here
109
            return 1;
109
            return 1;
110
        }
110
        }
111
	dir = opendir(scrollkeeper_dir);
111
	dir = opendir(scrollkeeper_dir);
112
	if (dir == NULL) {
113
	    return 1;
114
	}
112
    }
115
    }
113
    
116
    
114
    
117
    
Lines 133-173 Link Here
133
    
136
    
134
    dir = opendir(data_dir);
137
    dir = opendir(data_dir);
135
    
138
    
139
    if (dir == NULL) {
140
	free (data_dir);
141
	return 2;
142
    }
143
    
136
    while((dir_ent = readdir(dir)) != NULL)
144
    while((dir_ent = readdir(dir)) != NULL)
137
    {
145
    {
138
        if (dir_ent->d_name[0] == '.')
146
        if (dir_ent->d_name[0] == '.')
139
	    continue;
147
	    continue;
140
	    
148
	    
141
	snprintf(source_path, PATHLEN, "%s/%s", data_dir, dir_ent->d_name);	
149
	snprintf(source_path, PATH_MAX, "%s/%s", data_dir, dir_ent->d_name);	
142
    
150
    
143
        lstat(source_path, &buf);
151
        lstat(source_path, &buf);
144
    
152
    
145
        if (S_ISDIR(buf.st_mode)) /* copy the directory */
153
        if (S_ISDIR(buf.st_mode)) /* copy the directory */
146
	{
154
	{
147
	    char source_file[PATHLEN], target_file[PATHLEN];
155
	    char source_file[PATH_MAX], target_file[PATH_MAX];
148
	
156
	
149
	    snprintf(dirname, PATHLEN, "%s/%s", scrollkeeper_dir, dir_ent->d_name);
157
	    snprintf(dirname, PATH_MAX, "%s/%s", scrollkeeper_dir, dir_ent->d_name);
150
	    mkdir(dirname, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH|S_IXUSR|S_IXGRP|S_IXOTH);
158
	    mkdir(dirname, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH|S_IXUSR|S_IXGRP|S_IXOTH);
151
	    
159
	    
152
	    snprintf(source_file, PATHLEN, "%s/scrollkeeper_cl.xml", source_path);
160
	    snprintf(source_file, PATH_MAX, "%s/scrollkeeper_cl.xml", source_path);
153
	    snprintf(target_file, PATHLEN, "%s/%s/scrollkeeper_cl.xml", 
161
	    snprintf(target_file, PATH_MAX, "%s/%s/scrollkeeper_cl.xml", 
154
	    		scrollkeeper_dir, dir_ent->d_name);
162
	    		scrollkeeper_dir, dir_ent->d_name);
155
	    copy_file(source_file, target_file);
163
	    copy_file(source_file, target_file);
156
	    snprintf(target_file, PATHLEN, "%s/%s/scrollkeeper_extended_cl.xml", 
164
	    snprintf(target_file, PATH_MAX, "%s/%s/scrollkeeper_extended_cl.xml", 
157
	    		scrollkeeper_dir, dir_ent->d_name);
165
	    		scrollkeeper_dir, dir_ent->d_name);
158
	    copy_file(source_file, target_file);
166
	    copy_file(source_file, target_file);
159
	}
167
	}
160
	else /* link the directory */
168
	else /* link the directory */
161
	{
169
	{
162
	    char *target_locale;
170
	    char *target_locale;
163
	    char aux_path[PATHLEN];
171
	    char aux_path[PATH_MAX];
164
172
165
	    realpath(source_path, aux_path);
173
	    realpath(source_path, aux_path);
166
	    target_locale = strrchr(aux_path, '/');
174
	    target_locale = strrchr(aux_path, '/');
167
	    target_locale++;
175
	    target_locale++;
168
	    	    
176
	    	    
169
	    snprintf(source_path, PATHLEN, "%s/%s", scrollkeeper_dir, dir_ent->d_name);
177
	    snprintf(source_path, PATH_MAX, "%s/%s", scrollkeeper_dir, dir_ent->d_name);
170
	    snprintf(target_path, PATHLEN, "%s", target_locale);
178
	    snprintf(target_path, PATH_MAX, "%s", target_locale);
171
	    	   
179
	    	   
172
	    symlink(target_path, source_path); 
180
	    symlink(target_path, source_path); 
173
	}
181
	}
Lines 178-187 Link Here
178
    
186
    
179
    /* create TOC and index directory */
187
    /* create TOC and index directory */
180
    
188
    
181
    snprintf(dirname, PATHLEN, "%s/TOC", scrollkeeper_dir);
189
    snprintf(dirname, PATH_MAX, "%s/TOC", scrollkeeper_dir);
182
    mkdir(dirname, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH|S_IXUSR|S_IXGRP|S_IXOTH);
190
    mkdir(dirname, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH|S_IXUSR|S_IXGRP|S_IXOTH);
183
191
184
    snprintf(dirname, PATHLEN, "%s/index", scrollkeeper_dir);
192
    snprintf(dirname, PATH_MAX, "%s/index", scrollkeeper_dir);
185
    mkdir(dirname, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH|S_IXUSR|S_IXGRP|S_IXOTH);
193
    mkdir(dirname, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH|S_IXUSR|S_IXGRP|S_IXOTH);
186
    return 0;
194
    return 0;
187
}
195
}
(-)scrollkeeper-0.3.14.orig/libs/extract.c (-4 / +4 lines)
Lines 51-57 Link Here
51
	FILE *res_fid;
51
	FILE *res_fid;
52
	char *doctype;
52
	char *doctype;
53
	char command[1024];
53
	char command[1024];
54
	char temp1[PATHLEN], temp2[PATHLEN], errors[PATHLEN];
54
	char temp1[PATH_MAX], temp2[PATH_MAX], errors[PATH_MAX];
55
	int temp1_fd, temp2_fd, errors_fd;
55
	int temp1_fd, temp2_fd, errors_fd;
56
#endif
56
#endif
57
57
Lines 70-78 Link Here
70
#ifdef SOLARIS
70
#ifdef SOLARIS
71
		doc = docbParseFile(input_file, NULL);
71
		doc = docbParseFile(input_file, NULL);
72
#else
72
#else
73
		snprintf(temp1, PATHLEN, SCROLLKEEPER_STATEDIR "/tmp/scrollkeeper-extract-1.xml.XXXXXX");
73
		snprintf(temp1, PATH_MAX, SCROLLKEEPER_STATEDIR "/tmp/scrollkeeper-extract-1.xml.XXXXXX");
74
		snprintf(temp2, PATHLEN, SCROLLKEEPER_STATEDIR "/tmp/scrollkeeper-extract-2.xml.XXXXXX");
74
		snprintf(temp2, PATH_MAX, SCROLLKEEPER_STATEDIR "/tmp/scrollkeeper-extract-2.xml.XXXXXX");
75
		snprintf(errors, PATHLEN, SCROLLKEEPER_STATEDIR "/tmp/scrollkeeper-extract-errors.XXXXXX");
75
		snprintf(errors, PATH_MAX, SCROLLKEEPER_STATEDIR "/tmp/scrollkeeper-extract-errors.XXXXXX");
76
76
77
		temp1_fd = mkstemp(temp1);
77
		temp1_fd = mkstemp(temp1);
78
		printf ("%s\n", temp1);
78
		printf ("%s\n", temp1);
(-)scrollkeeper-0.3.14.orig/libs/install.c (-17 / +16 lines)
Lines 32-38 Link Here
32
#define _(String) gettext (String)
32
#define _(String) gettext (String)
33
33
34
#define SEP		"|"
34
#define SEP		"|"
35
#define PATHLEN		256
36
35
37
#ifdef SOLARIS
36
#ifdef SOLARIS
38
/*extern char *strtok_r(char *, const char *, char **);*/
37
/*extern char *strtok_r(char *, const char *, char **);*/
Lines 53-64 Link Here
53
        
52
        
54
    dest_dir = malloc (strlen (scrollkeeper_dir) + strlen (locale) + 2);
53
    dest_dir = malloc (strlen (scrollkeeper_dir) + strlen (locale) + 2);
55
    check_ptr(dest_dir, "scrollkeeper-install");
54
    check_ptr(dest_dir, "scrollkeeper-install");
56
    snprintf(dest_dir, PATHLEN, "%s/%s", scrollkeeper_dir, locale);
55
    snprintf(dest_dir, PATH_MAX, "%s/%s", scrollkeeper_dir, locale);
57
    
56
    
58
    if (is_dir(dest_dir))
57
    if (is_dir(dest_dir))
59
    {
58
    {
60
        strncpy(locale_dir, dest_dir, PATHLEN);
59
        strncpy(locale_dir, dest_dir, PATH_MAX-1);
61
	strncpy(locale_name, locale, PATHLEN);
60
	strncpy(locale_name, locale, PATH_MAX-1);
62
	free(dest_dir);
61
	free(dest_dir);
63
	return 1;
62
	return 1;
64
    }
63
    }
Lines 70-80 Link Here
70
    if (ptr != NULL)
69
    if (ptr != NULL)
71
    {
70
    {
72
        *ptr = '\0';
71
        *ptr = '\0';
73
	snprintf(dest_dir, PATHLEN, "%s/%s", scrollkeeper_dir, loc);
72
	snprintf(dest_dir, PATH_MAX, "%s/%s", scrollkeeper_dir, loc);
74
	if (is_dir(dest_dir))
73
	if (is_dir(dest_dir))
75
    	{
74
    	{
76
            strncpy(locale_dir, dest_dir, PATHLEN);
75
            strncpy(locale_dir, dest_dir, PATH_MAX-1);
77
	    strncpy(locale_name, loc, PATHLEN);
76
	    strncpy(locale_name, loc, PATH_MAX-1);
78
	    free(dest_dir);
77
	    free(dest_dir);
79
	    free(loc);
78
	    free(loc);
80
	    return 1;
79
	    return 1;
Lines 85-95 Link Here
85
    if (ptr != NULL)
84
    if (ptr != NULL)
86
    {
85
    {
87
        *ptr = '\0';
86
        *ptr = '\0';
88
	snprintf(dest_dir, PATHLEN, "%s/%s", scrollkeeper_dir, loc);
87
	snprintf(dest_dir, PATH_MAX, "%s/%s", scrollkeeper_dir, loc);
89
	if (is_dir(dest_dir))
88
	if (is_dir(dest_dir))
90
    	{
89
    	{
91
            strncpy(locale_dir, dest_dir, PATHLEN);
90
            strncpy(locale_dir, dest_dir, PATH_MAX);
92
	    strncpy(locale_name, loc, PATHLEN);
91
	    strncpy(locale_name, loc, PATH_MAX);
93
	    free(dest_dir);
92
	    free(dest_dir);
94
	    free(loc);
93
	    free(loc);
95
	    return 1;
94
	    return 1;
Lines 105-111 Link Here
105
{
104
{
106
    xmlDocPtr toc_doc;
105
    xmlDocPtr toc_doc;
107
    FILE *config_fid;
106
    FILE *config_fid;
108
    char command[1024], tocpath[PATHLEN];
107
    char command[1024], tocpath[PATH_MAX];
109
    xmlNodePtr toc_tree;
108
    xmlNodePtr toc_tree;
110
    errorSAXFunc xml_error_handler;
109
    errorSAXFunc xml_error_handler;
111
    warningSAXFunc xml_warning_handler;
110
    warningSAXFunc xml_warning_handler;
Lines 160-170 Link Here
160
    xmlDtdPtr dtd;
159
    xmlDtdPtr dtd;
161
    xmlNodePtr node, omf_node, s_node;
160
    xmlNodePtr node, omf_node, s_node;
162
    char *docpath, *title, *format, str[1024];
161
    char *docpath, *title, *format, str[1024];
163
    char cl_filename[PATHLEN], cl_ext_filename[PATHLEN];
162
    char cl_filename[PATH_MAX], cl_ext_filename[PATH_MAX];
164
    char locale_dir[PATHLEN], locale_name[PATHLEN], *locale, *ptr;
163
    char locale_dir[PATH_MAX], locale_name[PATH_MAX], *locale, *ptr;
165
    int unique_id;
164
    int unique_id;
166
    xmlDocPtr cl_doc, cl_ext_doc;
165
    xmlDocPtr cl_doc, cl_ext_doc;
167
    char scrollkeeper_docs[PATHLEN];
166
    char scrollkeeper_docs[PATH_MAX];
168
    char **stylesheets=NULL, **output_files=NULL, *toc_name;
167
    char **stylesheets=NULL, **output_files=NULL, *toc_name;
169
    char *toc_stylesheet_name, *index_name, *index_stylesheet_name, *uid;
168
    char *toc_stylesheet_name, *index_name, *index_stylesheet_name, *uid;
170
169
Lines 197-203 Link Here
197
    }
196
    }
198
    xmlFreeDtd(dtd);
197
    xmlFreeDtd(dtd);
199
		      	          
198
		      	          
200
    snprintf(scrollkeeper_docs, PATHLEN, "%s/scrollkeeper_docs", scrollkeeper_dir);
199
    snprintf(scrollkeeper_docs, PATH_MAX, "%s/scrollkeeper_docs", scrollkeeper_dir);
201
    
200
    
202
    /* We assume that this file is a concatenation of "resource" tags so
201
    /* We assume that this file is a concatenation of "resource" tags so
203
     * they should start from the top node's children.
202
     * they should start from the top node's children.
Lines 230-237 Link Here
230
	        continue;
229
	        continue;
231
	    }
230
	    }
232
	    xmlFree(locale);
231
	    xmlFree(locale);
233
    	    snprintf(cl_filename, PATHLEN, "%s/scrollkeeper_cl.xml", locale_dir);
232
    	    snprintf(cl_filename, PATH_MAX, "%s/scrollkeeper_cl.xml", locale_dir);
234
	    snprintf(cl_ext_filename, PATHLEN, "%s/scrollkeeper_extended_cl.xml", locale_dir);
233
	    snprintf(cl_ext_filename, PATH_MAX, "%s/scrollkeeper_extended_cl.xml", locale_dir);
235
	    
234
	    
236
	    if (!is_file(cl_filename))
235
	    if (!is_file(cl_filename))
237
	        continue;
236
	        continue;
(-)scrollkeeper-0.3.14.orig/libs/scrollkeeper.h (-1 / +1 lines)
Lines 21-26 Link Here
21
21
22
#include <libxml/tree.h>
22
#include <libxml/tree.h>
23
#include <sys/types.h>
23
#include <sys/types.h>
24
#include <limits.h>
24
25
25
#define _(String) gettext (String)
26
#define _(String) gettext (String)
26
27
Lines 32-38 Link Here
32
#define SCROLLKEEPERLOGFILE "/gnome/head/INSTALL/var/log/scrollkeeper.log"
33
#define SCROLLKEEPERLOGFILE "/gnome/head/INSTALL/var/log/scrollkeeper.log"
33
#define SCROLLKEEPERLOGFILE_ROT "/gnome/head/INSTALL/var/log/scrollkeeper.log.1"
34
#define SCROLLKEEPERLOGFILE_ROT "/gnome/head/INSTALL/var/log/scrollkeeper.log.1"
34
#define SCROLLKEEPER_OMF_DTD "/gnome/head/INSTALL/share/xml/scrollkeeper/dtds/scrollkeeper-omf.dtd"
35
#define SCROLLKEEPER_OMF_DTD "/gnome/head/INSTALL/share/xml/scrollkeeper/dtds/scrollkeeper-omf.dtd"
35
#define PATHLEN		256
36
36
37
/*
37
/*
38
 *
38
 *
(-)scrollkeeper-0.3.14.orig/libs/scrollkeeper.h.in (-1 / +1 lines)
Lines 21-26 Link Here
21
21
22
#include <libxml/tree.h>
22
#include <libxml/tree.h>
23
#include <sys/types.h>
23
#include <sys/types.h>
24
#include <limits.h>
24
25
25
#define _(String) gettext (String)
26
#define _(String) gettext (String)
26
27
Lines 32-38 Link Here
32
#define SCROLLKEEPERLOGFILE "/var/log/scrollkeeper.log"
33
#define SCROLLKEEPERLOGFILE "/var/log/scrollkeeper.log"
33
#define SCROLLKEEPERLOGFILE_ROT "/var/log/scrollkeeper.log.1"
34
#define SCROLLKEEPERLOGFILE_ROT "/var/log/scrollkeeper.log.1"
34
#define SCROLLKEEPER_OMF_DTD "@prefix@/share/xml/scrollkeeper/dtds/scrollkeeper-omf.dtd"
35
#define SCROLLKEEPER_OMF_DTD "@prefix@/share/xml/scrollkeeper/dtds/scrollkeeper-omf.dtd"
35
#define PATHLEN		256
36
36
37
/*
37
/*
38
 *
38
 *
(-)scrollkeeper-0.3.14.orig/libs/uninstall.c (-15 / +14 lines)
Lines 29-35 Link Here
29
29
30
#define _(String) gettext (String)
30
#define _(String) gettext (String)
31
31
32
#define PATHLEN		256
33
32
34
struct IdTab {
33
struct IdTab {
35
    int id;
34
    int id;
Lines 41-56 Link Here
41
40
42
static void remove_tocs_and_index(struct IdTab *tab, int num, char *scrollkeeper_dir)
41
static void remove_tocs_and_index(struct IdTab *tab, int num, char *scrollkeeper_dir)
43
{
42
{
44
    char toc_dir[PATHLEN], toc_file[PATHLEN], index_dir[PATHLEN], index_file[PATHLEN];
43
    char toc_dir[PATH_MAX], toc_file[PATH_MAX], index_dir[PATH_MAX], index_file[PATH_MAX];
45
    int i;
44
    int i;
46
45
47
    snprintf(toc_dir, PATHLEN, "%s/TOC", scrollkeeper_dir);
46
    snprintf(toc_dir, PATH_MAX, "%s/TOC", scrollkeeper_dir);
48
    snprintf(index_dir, PATHLEN, "%s/index", scrollkeeper_dir);
47
    snprintf(index_dir, PATH_MAX, "%s/index", scrollkeeper_dir);
49
        
48
        
50
    for(i = 0; i  < num; i++)
49
    for(i = 0; i  < num; i++)
51
    {
50
    {
52
        snprintf(toc_file, PATHLEN, "%s/%d", toc_dir, tab[i].id);
51
        snprintf(toc_file, PATH_MAX, "%s/%d", toc_dir, tab[i].id);
53
        snprintf(index_file, PATHLEN, "%s/%d", index_dir, tab[i].id);
52
        snprintf(index_file, PATH_MAX, "%s/%d", index_dir, tab[i].id);
54
	unlink(toc_file);
53
	unlink(toc_file);
55
	unlink(index_file);
54
	unlink(index_file);
56
    }
55
    }
Lines 68-74 Link Here
68
static void remove_docs_from_content_list(struct IdTab *id_tab, int id_num, char *scrollkeeper_dir, char outputprefs)
67
static void remove_docs_from_content_list(struct IdTab *id_tab, int id_num, char *scrollkeeper_dir, char outputprefs)
69
{
68
{
70
    int start, end;    
69
    int start, end;    
71
    char cl_filename[PATHLEN], cl_ext_filename[PATHLEN];
70
    char cl_filename[PATH_MAX], cl_ext_filename[PATH_MAX];
72
    xmlDocPtr cl_doc, cl_ext_doc;
71
    xmlDocPtr cl_doc, cl_ext_doc;
73
    
72
    
74
    if (id_tab == NULL)
73
    if (id_tab == NULL)
Lines 87-94 Link Here
87
	if (start >= id_num) 
86
	if (start >= id_num) 
88
	    break;
87
	    break;
89
	    
88
	    
90
	snprintf(cl_filename, PATHLEN, "%s/%s/scrollkeeper_cl.xml", scrollkeeper_dir, id_tab[start].locale);
89
	snprintf(cl_filename, PATH_MAX, "%s/%s/scrollkeeper_cl.xml", scrollkeeper_dir, id_tab[start].locale);
91
	snprintf(cl_ext_filename, PATHLEN, "%s/%s/scrollkeeper_extended_cl.xml", scrollkeeper_dir, 
90
	snprintf(cl_ext_filename, PATH_MAX, "%s/%s/scrollkeeper_extended_cl.xml", scrollkeeper_dir, 
92
			id_tab[start].locale);
91
			id_tab[start].locale);
93
		    
92
		    
94
	cl_doc = xmlParseFile(cl_filename);
93
	cl_doc = xmlParseFile(cl_filename);
Lines 170-180 Link Here
170
	sep[3] = '\0';
169
	sep[3] = '\0';
171
	
170
	
172
	token = strtok(line, sep);	
171
	token = strtok(line, sep);	
173
	snprintf(omf_name, PATHLEN, "%s", token);
172
	snprintf(omf_name, PATH_MAX, "%s", token);
174
	token = strtok(NULL, sep);
173
	token = strtok(NULL, sep);
175
	*id = atoi(token);
174
	*id = atoi(token);
176
	token = strtok(NULL, sep);
175
	token = strtok(NULL, sep);
177
	snprintf(doc_name, PATHLEN, "%s", token);
176
	snprintf(doc_name, PATH_MAX, "%s", token);
178
	token = strtok(NULL, sep);
177
	token = strtok(NULL, sep);
179
	*timestamp = atol(token);
178
	*timestamp = atol(token);
180
	token = strtok(NULL, sep);
179
	token = strtok(NULL, sep);
Lines 190-200 Link Here
190
    int id, count;
189
    int id, count;
191
    struct IdTab *l_id_tab = NULL;
190
    struct IdTab *l_id_tab = NULL;
192
    FILE *fid, *tmp_fid;
191
    FILE *fid, *tmp_fid;
193
    char l_omf_name[PATHLEN], doc_name[PATHLEN], tmp[PATHLEN], locale[32];
192
    char l_omf_name[PATH_MAX], doc_name[PATH_MAX], tmp[PATH_MAX], locale[32];
194
    char scrollkeeper_docs[PATHLEN];
193
    char scrollkeeper_docs[PATH_MAX];
195
    long timestamp;
194
    long timestamp;
196
    
195
    
197
    snprintf(scrollkeeper_docs, PATHLEN, "%s/scrollkeeper_docs", scrollkeeper_dir);
196
    snprintf(scrollkeeper_docs, PATH_MAX, "%s/scrollkeeper_docs", scrollkeeper_dir);
198
            
197
            
199
    fid = fopen(scrollkeeper_docs, "r");
198
    fid = fopen(scrollkeeper_docs, "r");
200
    if (fid == NULL)
199
    if (fid == NULL)
Lines 203-209 Link Here
203
        return;
202
        return;
204
    }
203
    }
205
    
204
    
206
    snprintf(tmp, PATHLEN, "%s.tmp", scrollkeeper_docs);
205
    snprintf(tmp, PATH_MAX, "%s.tmp", scrollkeeper_docs);
207
    
206
    
208
    tmp_fid = fopen(tmp, "w");
207
    tmp_fid = fopen(tmp, "w");
209
    if (tmp_fid == NULL)
208
    if (tmp_fid == NULL)

Return to bug 12135