Hello community, here is the log from the commit of package rarian checked in at Mon Sep 10 12:58:34 CEST 2007. -------- --- GNOME/rarian/rarian.changes 2007-09-01 06:54:21.000000000 +0200 +++ /mounts/work_src_done/STABLE/rarian/rarian.changes 2007-09-10 06:58:04.161568000 +0200 @@ -1,0 +2,20 @@ +Mon Sep 10 06:57:54 CEST 2007 - hpj@suse.de + +- Amend rarian-0.5.6-eof-crash.patch to prevent a buffer overrun + crash, a file descriptor leak, and a failure the check the + return value from a fopen() call leading to another crash. The + problems appear in the same function as the EOF crash, so I + rolled them into the same patch. +- Rename rarian-0.5.6-eof-crash.patch to + rarian-0.5.6-reg-parse-bugs.patch. + +------------------------------------------------------------------- +Wed Sep 5 00:23:37 CEST 2007 - maw@suse.de + +- Respin rarian-0.5.6-docs-from-desktop-entries.patch, teaching + rarian to look inside help-bundle in addition to help + subdirectories; rename it to + rarian-0.5.6-docs-from-desktop-entries-and-bundles.patch + (#307213). + +------------------------------------------------------------------- Old: ---- rarian-0.5.6-docs-from-desktop-entries.patch rarian-0.5.6-eof-crash.patch New: ---- rarian-0.5.6-docs-from-desktop-entries-and-bundles.patch rarian-0.5.6-reg-parse-bugs.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rarian.spec ++++++ --- /var/tmp/diff_new_pack.A29222/_old 2007-09-10 12:57:50.000000000 +0200 +++ /var/tmp/diff_new_pack.A29222/_new 2007-09-10 12:57:50.000000000 +0200 @@ -14,12 +14,13 @@ BuildRequires: docbook_4 gcc-c++ intltool libxslt-devel perl-XML-Parser pkg-config sgml-skel Summary: Rarian is designed to be a replacement for scrollkeeper. Version: 0.5.6 -Release: 10 +Release: 12 Source0: rarian-%{version}.tar.bz2 Patch0: abuild.patch -Patch1: rarian-0.5.6-eof-crash.patch +Patch1: rarian-0.5.6-reg-parse-bugs.patch Patch2: rarian-0.5.6-identifier-basename-crash.patch -Patch3: rarian-0.5.6-docs-from-desktop-entries.patch +Patch3: rarian-0.5.6-docs-from-desktop-entries-and-bundles.patch +### Patch4: 307213.patch License: GPL v2 or later, LGPL v2 or later Group: Development/Libraries/C and C++ BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -67,6 +68,7 @@ %patch1 -p1 %patch2 -p1 %patch3 -p1 +### %patch4 -p0 %build %configure @@ -100,6 +102,20 @@ %{_libdir}/pkgconfig/*.pc %changelog +* Mon Sep 10 2007 - hpj@suse.de +- Amend rarian-0.5.6-eof-crash.patch to prevent a buffer overrun + crash, a file descriptor leak, and a failure the check the + return value from a fopen() call leading to another crash. The + problems appear in the same function as the EOF crash, so I + rolled them into the same patch. +- Rename rarian-0.5.6-eof-crash.patch to + rarian-0.5.6-reg-parse-bugs.patch. +* Wed Sep 05 2007 - maw@suse.de +- Respin rarian-0.5.6-docs-from-desktop-entries.patch, teaching + rarian to look inside help-bundle in addition to help + subdirectories; rename it to + rarian-0.5.6-docs-from-desktop-entries-and-bundles.patch + (#307213). * Sat Sep 01 2007 - hpj@suse.de - Add rarian-0.5.6-eof-crash.patch (bugs.freedesktop.org #12131). - Add rarian-0.5.6-identifier-basename-crash.patch ++++++ rarian-0.5.6-docs-from-desktop-entries-and-bundles.patch ++++++ Index: rarian-0.5.6/librarian/rarian-main.c =================================================================== --- rarian-0.5.6.orig/librarian/rarian-main.c +++ rarian-0.5.6/librarian/rarian-main.c @@ -223,13 +223,24 @@ past: int_path = rrn_strndup (cur_path, (first_colon-cur_path)); else int_path = strdup (cur_path); - check_path = malloc (sizeof(char)*(strlen(int_path)+6)); - sprintf (check_path, "%s/help", int_path); + + check_path = malloc (sizeof (char) * (strlen (int_path) + 14)); + snprintf (check_path, sizeof (char) * (strlen (int_path) + 14), + "%s/help", int_path); #if ENABLE_OMF_READ process_omf_dir (int_path); #endif process_locale_dirs (check_path); scan_directory (check_path); + + snprintf (check_path, sizeof (char) * (strlen (int_path) + 14), + "%s/applications", int_path); + scan_directory (check_path); + + snprintf (check_path, sizeof (char) * (strlen (int_path) + 14), + "%s/help-bundle", int_path); + scan_directory (check_path); + if (int_path && *int_path) { free (int_path); } @@ -286,7 +297,8 @@ scan_directory (char *dir) sprintf (tmp, "%s/%s", dir, dp->d_name); suffix = strrchr (tmp, '.'); - if (!strcmp (suffix, ".document")) { + if (!strcmp (suffix, ".document") || + !strcmp (suffix, ".desktop")) { process_file (tmp); } else if (!strcmp (suffix, ".section")) { process_section (tmp); Index: rarian-0.5.6/librarian/rarian-reg-full.c =================================================================== --- rarian-0.5.6.orig/librarian/rarian-reg-full.c +++ rarian-0.5.6/librarian/rarian-reg-full.c @@ -101,7 +101,8 @@ rrn_reg_parse_file_full (char *filename) if (!real || real[0] == '\n' || real[0] == '#') { /* Black Line or comment. Ignore. */ } else if (real[0] == '[') { - if (!strncmp (real, "[Document]", 10)) { + if (!strncmp (real, "[Document]", 10) || + !strncmp (real, "[Desktop Entry]", 15)) { mode = 0; if (sect) { @@ -151,7 +152,7 @@ rrn_reg_parse_file_full (char *filename) } } - if (!reg->name || !reg->uri || !reg->type || !reg->categories ) { + if (!reg->name || !reg->uri || !reg->categories ) { rrn_reg_free_full (reg); reg = NULL; } @@ -271,6 +272,9 @@ process_categories_full (char *cat_strin int i; do { semi = strchr (current_break, ';'); + if (!semi) + semi = strchr (current_break, '|'); + if (result) { tmp = malloc (sizeof (char *)*ncats); for (i=0; i< ncats; i++) { @@ -636,9 +640,20 @@ process_path_full (RrnRegFull *reg) */ return; } - /* Otherwise, promote to file: URI scheme, reusing the prefix vble */ - prefix = malloc (sizeof (char) * (strlen(entry->text)+6)); - sprintf (prefix, "file:%s", entry->text); + + if (entry->text [0] == '/') { + /* If it's an absolute path, promote to file: URI scheme, + * reusing the prefix vble */ + prefix = malloc (sizeof (char) * (strlen(entry->text) + 8)); + snprintf (prefix, sizeof (char) * (strlen (entry->text) + 8), + "file://%s", entry->text); + } else { + /* Else, use the ghelp: URI scheme */ + prefix = malloc (sizeof (char) * (strlen (entry->text) + 7)); + snprintf (prefix, sizeof (char) * (strlen (entry->text) + 7), + "ghelp:%s", entry->text); + } + free (entry->text); entry->text = prefix; entry = entry->next; Index: rarian-0.5.6/librarian/rarian-reg-utils.c =================================================================== --- rarian-0.5.6.orig/librarian/rarian-reg-utils.c +++ rarian-0.5.6/librarian/rarian-reg-utils.c @@ -117,7 +117,8 @@ rrn_reg_parse_file (char *filename) if (!real || real[0] == '\n' || real[0] == '#') { /* Black Line or comment. Ignore. */ } else if (real[0] == '[') { - if (!strncmp (real, "[Document]", 10)) { + if (!strncmp (real, "[Document]", 10) || + !strncmp (real, "[Desktop Entry]", 15)) { mode = 0; if (sect) { @@ -167,7 +168,7 @@ rrn_reg_parse_file (char *filename) } } - if (!reg->name || !reg->uri || !reg->type || !reg->categories ) { + if (!reg->name || !reg->uri || !reg->categories ) { rrn_reg_free (reg); reg = NULL; } @@ -311,6 +312,9 @@ process_categories (char *cat_string) int i; do { semi = strchr (current_break, ';'); + if (!semi) + semi = strchr (current_break, '|'); + if (result) { tmp = malloc (sizeof (char *)*ncats); for (i=0; i< ncats; i++) { @@ -736,10 +740,22 @@ process_path (RrnReg *reg) */ return; } - /* Otherwise, promote to file: URI scheme, reusing the prefix vble */ - prefix = malloc (sizeof (char) * (strlen(reg->uri)+8)); - sprintf (prefix, "file://%s", reg->uri); + + if (reg->uri [0] == '/') { + /* If it's an absolute path, promote to file: URI scheme, + * reusing the prefix vble */ + prefix = malloc (sizeof (char) * (strlen (reg->uri) + 8)); + snprintf (prefix, sizeof (char) * (strlen (reg->uri) + 8), + "file://%s", reg->uri); + } else { + /* Else, use the ghelp: URI scheme */ + prefix = malloc (sizeof (char) * (strlen (reg->uri) + 7)); + snprintf (prefix, sizeof (char) * (strlen (reg->uri) + 7), + "ghelp:%s", reg->uri); + } + free (reg->uri); + reg->uri = prefix; while (child) { process_section_path (reg->uri, child); ++++++ rarian-0.5.6-reg-parse-bugs.patch ++++++ diff -upr rarian-0.5.6-pre/librarian/rarian-reg-utils.c rarian-0.5.6-post/librarian/rarian-reg-utils.c --- rarian-0.5.6-pre/librarian/rarian-reg-utils.c 2007-07-31 12:16:06.000000000 -0500 +++ rarian-0.5.6-post/librarian/rarian-reg-utils.c 2007-09-09 21:35:30.000000000 -0500 @@ -89,6 +89,10 @@ rrn_reg_parse_file (char *filename) } file = fopen (filename, "r"); + if (!file) { + rrn_reg_free (reg); + return NULL; + } buf = malloc (sizeof (char) * 1024); while (fgets (buf, 1023, file)) { @@ -97,13 +101,18 @@ rrn_reg_parse_file (char *filename) char *tmp; char *result = NULL; tmp = strdup (buf); - buf = fgets (buf, 1023, file); - result = malloc (sizeof (char) * (strlen(tmp)+strlen(buf)+2)); + if (fgets (buf, 1023, file)) { + result = malloc (sizeof (char) * 2048); strcpy (result, tmp); strcat (result, buf); free (tmp); free (buf); - buf = result; + buf = result; + } else { + free (buf); + buf = realloc (tmp, sizeof (char) * 1024); + break; + } } real = buf; while (*real && isspace(*real) && *real != '\n') { @@ -152,6 +161,8 @@ rrn_reg_parse_file (char *filename) } } free (buf); + fclose (file); + if (sect) { if (rrn_reg_add_sect (reg, sect) == 1) { sect->prev = NULL; @@ -224,6 +235,7 @@ rrn_reg_parse_file (char *filename) free (tmp); free (tmp2); } + return reg; } ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de