From a92d7b4517c14092bfcbc325c4909517978ebb0b Mon Sep 17 00:00:00 2001 From: wiz Date: Sat, 6 Jan 2007 22:45:49 +0000 Subject: Update to 15.6: Some security problems have been addressed, and overall stability has improved. There are no new features. (The security problems were already fixed in pkgsrc.) --- devel/cscope/Makefile | 5 +- devel/cscope/distinfo | 30 +++---- devel/cscope/patches/patch-aa | 24 +++--- devel/cscope/patches/patch-ab | 13 --- devel/cscope/patches/patch-ad | 195 ++++++------------------------------------ devel/cscope/patches/patch-ae | 76 +++++----------- devel/cscope/patches/patch-af | 124 ++++----------------------- devel/cscope/patches/patch-ag | 31 +++---- devel/cscope/patches/patch-ah | 101 ++++++++++------------ devel/cscope/patches/patch-ai | 63 +++++++------- devel/cscope/patches/patch-aj | 24 +----- devel/cscope/patches/patch-ak | 22 ++--- devel/cscope/patches/patch-al | 8 +- devel/cscope/patches/patch-ap | 24 ------ 14 files changed, 197 insertions(+), 543 deletions(-) delete mode 100644 devel/cscope/patches/patch-ab delete mode 100644 devel/cscope/patches/patch-ap (limited to 'devel/cscope') diff --git a/devel/cscope/Makefile b/devel/cscope/Makefile index e1e5e8b73f9..78b91377005 100644 --- a/devel/cscope/Makefile +++ b/devel/cscope/Makefile @@ -1,7 +1,6 @@ -# $NetBSD: Makefile,v 1.45 2006/08/24 22:02:02 salo Exp $ +# $NetBSD: Makefile,v 1.46 2007/01/06 22:45:49 wiz Exp $ -DISTNAME= cscope-15.5 -PKGREVISION= 2 +DISTNAME= cscope-15.6 CATEGORIES= devel MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=cscope/} diff --git a/devel/cscope/distinfo b/devel/cscope/distinfo index d0397dfc9ee..45ec95eeded 100644 --- a/devel/cscope/distinfo +++ b/devel/cscope/distinfo @@ -1,21 +1,19 @@ -$NetBSD: distinfo,v 1.15 2006/08/24 22:02:02 salo Exp $ +$NetBSD: distinfo,v 1.16 2007/01/06 22:45:49 wiz Exp $ -SHA1 (cscope-15.5.tar.gz) = 2e8e66735254328399dc50757b270bcc3e9002d3 -RMD160 (cscope-15.5.tar.gz) = 30623f07043abc90d76b384c407abe5813a8a716 -Size (cscope-15.5.tar.gz) = 243793 bytes -SHA1 (patch-aa) = 8c477f12c67ed91b7700cf70209c3a2b64309b15 -SHA1 (patch-ab) = 646512ad53b3f3e7dab607df4c6c3d775587a03c +SHA1 (cscope-15.6.tar.gz) = f5f73dca1f223cf6905c09a7f0e8eb993fa5fd93 +RMD160 (cscope-15.6.tar.gz) = b93238d3c91782d032e028abcfde3c2a7491a9c9 +Size (cscope-15.6.tar.gz) = 391223 bytes +SHA1 (patch-aa) = 40eb37ab0ffdf18830521031b174332bd544f2cb SHA1 (patch-ac) = 40a69af0eb5419de827b490c960803a736040f2c -SHA1 (patch-ad) = 7e0f25b67f3476ac90b7541595649d6a6bf65aa9 -SHA1 (patch-ae) = bf3ec3c4c8a8d245b7fe4745dd114fa4d253b0b9 -SHA1 (patch-af) = 816774a459cd68c6d24dc5bb436146d3e537fb5f -SHA1 (patch-ag) = 1a94f675d2878268af7de488a5f81ae08a855715 -SHA1 (patch-ah) = 4e723e863b85f812e1dc993758b22f50554a4222 -SHA1 (patch-ai) = 19cea85408c7ab98b9b3021cd6af07794dae62f9 -SHA1 (patch-aj) = aab596f780ef213c9198f6d03886140ee7d0bcf8 -SHA1 (patch-ak) = eb61acfd3f265656d5495e7b1a1b3cf6071213c6 -SHA1 (patch-al) = 511ea0dd04b4062fac97bfd01c1a71de44e1c452 +SHA1 (patch-ad) = 83cfd932c20c5860664ebb40ca0d0945da3f2953 +SHA1 (patch-ae) = d02ded0d2fb998450cc725b717f9d60a28191835 +SHA1 (patch-af) = 0cbf2e00612765221b62e57450f41bc69e760687 +SHA1 (patch-ag) = 332297168be35b8448a8f4ee7750698bfebcb726 +SHA1 (patch-ah) = 90c3caf336edde19b56b751bac528cf48e0b2e60 +SHA1 (patch-ai) = 17b4d1be4303b858916f2d01446df4e5a142d08f +SHA1 (patch-aj) = 57a2a0060672ee145f0f55fefd72673cbfbf6b25 +SHA1 (patch-ak) = 74d5395066642792ec3d5ee611b21a7075757ab9 +SHA1 (patch-al) = 76a3a65fe80c7acf7cdf7f78bd4959f102ffdc72 SHA1 (patch-am) = 2c08e2ccf22b3a3852c52d5177c7a08d206c1cdf SHA1 (patch-an) = cef8d1d31a417125c516df403dce228ac92a307c SHA1 (patch-ao) = 05ae43171f04320dc1a213510b0906d3387cf35f -SHA1 (patch-ap) = 7e1af46170ac5304a784d2719b14aae01bd4a659 diff --git a/devel/cscope/patches/patch-aa b/devel/cscope/patches/patch-aa index 7e1c5717e75..04db2463f0f 100644 --- a/devel/cscope/patches/patch-aa +++ b/devel/cscope/patches/patch-aa @@ -1,18 +1,18 @@ -$NetBSD: patch-aa,v 1.11 2006/08/24 22:02:02 salo Exp $ +$NetBSD: patch-aa,v 1.12 2007/01/06 22:45:49 wiz Exp $ ---- src/constants.h.orig 2003-09-04 17:54:02.000000000 +0200 -+++ src/constants.h 2006-08-24 23:49:25.000000000 +0200 +--- src/constants.h.orig 2006-09-30 10:13:00.000000000 +0200 ++++ src/constants.h @@ -68,6 +68,7 @@ #define NUMLEN 5 /* line number length */ #define PATHLEN 250 /* file pathname length */ #define PATLEN 250 /* symbol pattern length */ +#define TEMPSTRING_LEN 8191 /* max strlen() of the global temp string */ + #define TEMPSTRING_LEN 8191 /* max strlen() of the global temp string */ #define REFFILE "cscope.out" /* cross-reference output file */ #define NAMEFILE "cscope.files" /* default list-of-files file */ - #define INVNAME "cscope.in.out" /* inverted index to the database */ -@@ -77,6 +78,13 @@ - - #define STMTMAX 10000 /* maximum source statement length */ +@@ -85,6 +86,13 @@ + #define NUMLEN_STR STRINGIZE(NUMLEN) + #define TEMPSTRING_LEN_STR STRINGIZE(TEMPSTRING_LEN) +#define STR2(x) #x +#define STRINGIZE(x) STR2(x) @@ -24,12 +24,12 @@ $NetBSD: patch-aa,v 1.11 2006/08/24 22:02:02 salo Exp $ /* screen lines */ #define FLDLINE (LINES - FIELDS - 1) /* first input field line */ #define MSGLINE 0 /* message line */ -@@ -95,7 +103,7 @@ +@@ -103,7 +111,7 @@ #define INCLUDES 8 #define FIELDS 9 --#if (BSD || V9) && !__NetBSD__ -+#if (BSD || V9) && !__NetBSD__ && !__APPLE__ - #define TERMINFO 0 /* no terminfo curses */ +-#if (BSD || V9) && !__NetBSD__ && !__FreeBSD__ ++#if (BSD || V9) && !__NetBSD__ && !__FreeBSD__ && !__APPLE__ + # define TERMINFO 0 /* no terminfo curses */ #else - #define TERMINFO 1 + # define TERMINFO 1 diff --git a/devel/cscope/patches/patch-ab b/devel/cscope/patches/patch-ab deleted file mode 100644 index 834daf8ac84..00000000000 --- a/devel/cscope/patches/patch-ab +++ /dev/null @@ -1,13 +0,0 @@ -$NetBSD: patch-ab,v 1.10 2006/03/23 16:09:32 yyamano Exp $ - ---- src/egrep.y.orig 2002-12-11 23:39:10.000000000 +0900 -+++ src/egrep.y -@@ -605,7 +605,7 @@ done: (void) fclose(fptr); - - /* FIXME HBB: should export this to a separate file and use - * AC_REPLACE_FUNCS() */ --#if BSD -+#if !STDC_HEADERS && !defined(HAVE_MEMSET) && !defined(HAVE_MEMORY_H) - /*LINTLIBRARY*/ - /* - * Set an array of n chars starting at sp to the character c. diff --git a/devel/cscope/patches/patch-ad b/devel/cscope/patches/patch-ad index d90da8834bc..e5f4233549c 100644 --- a/devel/cscope/patches/patch-ad +++ b/devel/cscope/patches/patch-ad @@ -1,114 +1,43 @@ -$NetBSD: patch-ad,v 1.5 2005/10/03 15:00:12 wiz Exp $ +$NetBSD: patch-ad,v 1.6 2007/01/06 22:45:49 wiz Exp $ ---- contrib/Makefile.in.orig 2003-09-04 18:51:25.000000000 +0200 +--- contrib/Makefile.in.orig 2006-09-30 17:14:56.000000000 +0200 +++ contrib/Makefile.in -@@ -1,8 +1,8 @@ --# Makefile.in generated by automake 1.7.2 from Makefile.am. -+# Makefile.in generated by automake 1.9.6 from Makefile.am. - # @configure_input@ - --# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 --# Free Software Foundation, Inc. -+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -+# 2003, 2004, 2005 Free Software Foundation, Inc. - # This Makefile.in is free software; the Free Software Foundation - # gives unlimited permission to copy and/or distribute it, - # with or without modifications, as long as this notice is preserved. -@@ -21,7 +21,6 @@ pkgdatadir = $(datadir)/@PACKAGE@ - pkglibdir = $(libdir)/@PACKAGE@ - pkgincludedir = $(includedir)/@PACKAGE@ - top_builddir = .. -- - am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd - INSTALL = @INSTALL@ - install_sh_DATA = $(install_sh) -c -m 644 -@@ -35,7 +34,29 @@ POST_INSTALL = : - NORMAL_UNINSTALL = : - PRE_UNINSTALL = : - POST_UNINSTALL = : -+build_triplet = @build@ - host_triplet = @host@ -+subdir = contrib -+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in -+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -+am__aclocal_m4_deps = $(top_srcdir)/configure.in -+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ -+ $(ACLOCAL_M4) -+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -+CONFIG_HEADER = $(top_builddir)/config.h -+CONFIG_CLEAN_FILES = -+SOURCES = -+DIST_SOURCES = -+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; -+am__vpath_adj = case $$p in \ -+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ -+ *) f=$$p;; \ -+ esac; +@@ -50,6 +50,10 @@ binSCRIPT_INSTALL = $(INSTALL_SCRIPT) + SCRIPTS = $(bin_SCRIPTS) + SOURCES = + DIST_SOURCES = +am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; +am__installdirs = "$(DESTDIR)$(pkgdatadir)" +pkgdataDATA_INSTALL = $(INSTALL_DATA) +DATA = $(pkgdata_DATA) -+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMDEP_FALSE = @AMDEP_FALSE@ - AMDEP_TRUE = @AMDEP_TRUE@ -@@ -99,7 +120,10 @@ ac_ct_STRIP = @ac_ct_STRIP@ - am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ - am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ - am__include = @am__include@ -+am__leading_dot = @am__leading_dot@ - am__quote = @am__quote@ -+am__tar = @am__tar@ -+am__untar = @am__untar@ - bindir = @bindir@ - build = @build@ - build_alias = @build_alias@ -@@ -122,6 +146,7 @@ libdir = @libdir@ - libexecdir = @libexecdir@ - localstatedir = @localstatedir@ - mandir = @mandir@ -+mkdir_p = @mkdir_p@ - oldincludedir = @oldincludedir@ - prefix = @prefix@ - program_transform_name = @program_transform_name@ -@@ -129,18 +154,8 @@ sbindir = @sbindir@ +@@ -148,7 +152,7 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -- -bin_SCRIPTS = ocs -- +pkgdata_DATA = ocs EXTRA_DIST = ocs README xcscope webcscope --subdir = contrib --mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs --CONFIG_HEADER = $(top_builddir)/config.h --CONFIG_CLEAN_FILES = --SCRIPTS = $(bin_SCRIPTS) -- --DIST_SOURCES = --DIST_COMMON = README Makefile.am Makefile.in all: all-am - .SUFFIXES: -@@ -149,37 +164,30 @@ $(srcdir)/Makefile.in: Makefile.am $(t - $(AUTOMAKE) --gnu contrib/Makefile - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) --binSCRIPT_INSTALL = $(INSTALL_SCRIPT) +@@ -182,26 +186,23 @@ $(top_srcdir)/configure: $(am__configur + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + $(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -install-binSCRIPTS: $(bin_SCRIPTS) -+uninstall-info-am: +install-pkgdataDATA: $(pkgdata_DATA) @$(NORMAL_INSTALL) -- $(mkinstalldirs) $(DESTDIR)$(bindir) +- test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)" - @list='$(bin_SCRIPTS)'; for p in $$list; do \ -+ test -z "$(pkgdatadir)" || $(mkinstalldirs) "$(DESTDIR)$(pkgdatadir)" ++ test -z "$(pkgdatadir)" || $(mkdir_p) "$(DESTDIR)$(pkgdatadir)" + @list='$(pkgdata_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ - if test -f $$d$$p; then \ - f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ -- echo " $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f"; \ -- $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f; \ +- echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \ +- $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \ - else :; fi; \ + f=$(am__strip_dir) \ + echo " $(pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \ @@ -120,8 +49,8 @@ $NetBSD: patch-ad,v 1.5 2005/10/03 15:00:12 wiz Exp $ @$(NORMAL_UNINSTALL) - @list='$(bin_SCRIPTS)'; for p in $$list; do \ - f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ -- echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ -- rm -f $(DESTDIR)$(bindir)/$$f; \ +- echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ +- rm -f "$(DESTDIR)$(bindir)/$$f"; \ + @list='$(pkgdata_DATA)'; for p in $$list; do \ + f=$(am__strip_dir) \ + echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \ @@ -131,65 +60,21 @@ $NetBSD: patch-ad,v 1.5 2005/10/03 15:00:12 wiz Exp $ tags: TAGS TAGS: - ctags: CTAGS - CTAGS: - --DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) -- --top_distdir = .. --distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) - - distdir: $(DISTFILES) - @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ -@@ -210,11 +218,11 @@ distdir: $(DISTFILES) +@@ -238,10 +239,10 @@ distdir: $(DISTFILES) done check-am: all-am check: check-am -all-am: Makefile $(SCRIPTS) -- +all-am: Makefile $(DATA) installdirs: -- $(mkinstalldirs) $(DESTDIR)$(bindir) -- +- for dir in "$(DESTDIR)$(bindir)"; do \ +- test -z "$$dir" || $(mkdir_p) "$$dir"; \ + for dir in "$(DESTDIR)$(pkgdatadir)"; do \ -+ test -z "$$dir" || $(mkinstalldirs) "$$dir"; \ -+ done ++ test -z "$$dir" || $(mkdir_p) "$$dir"; \ + done install: install-am install-exec: install-exec-am - install-data: install-data-am -@@ -226,7 +234,7 @@ install-am: all-am - installcheck: installcheck-am - install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ -- INSTALL_STRIP_FLAG=-s \ -+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install - mostlyclean-generic: -@@ -234,7 +242,7 @@ mostlyclean-generic: - clean-generic: - - distclean-generic: -- -rm -f Makefile $(CONFIG_CLEAN_FILES) -+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - - maintainer-clean-generic: - @echo "This command is intended for maintainers to use" -@@ -244,20 +252,22 @@ clean: clean-am - clean-am: clean-generic mostlyclean-am - - distclean: distclean-am -- -+ -rm -f Makefile - distclean-am: clean-am distclean-generic - - dvi: dvi-am - - dvi-am: - -+html: html-am -+ - info: info-am +@@ -285,9 +286,9 @@ info: info-am info-am: @@ -201,35 +86,3 @@ $NetBSD: patch-ad,v 1.5 2005/10/03 15:00:12 wiz Exp $ install-info: install-info-am -@@ -266,7 +276,7 @@ install-man: - installcheck-am: - - maintainer-clean: maintainer-clean-am -- -+ -rm -f Makefile - maintainer-clean-am: distclean-am maintainer-clean-generic - - mostlyclean: mostlyclean-am -@@ -281,16 +291,16 @@ ps: ps-am - - ps-am: - --uninstall-am: uninstall-binSCRIPTS uninstall-info-am -+uninstall-am: uninstall-info-am uninstall-pkgdataDATA - - .PHONY: all all-am check check-am clean clean-generic distclean \ -- distclean-generic distdir dvi dvi-am info info-am install \ -- install-am install-binSCRIPTS install-data install-data-am \ -- install-exec install-exec-am install-info install-info-am \ -- install-man install-strip installcheck installcheck-am \ -+ distclean-generic distdir dvi dvi-am html html-am info info-am \ -+ install install-am install-data install-data-am install-exec \ -+ install-exec-am install-info install-info-am install-man \ -+ install-pkgdataDATA install-strip installcheck installcheck-am \ - installdirs maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-generic pdf pdf-am ps ps-am uninstall \ -- uninstall-am uninstall-binSCRIPTS uninstall-info-am -+ uninstall-am uninstall-info-am uninstall-pkgdataDATA - - # Tell versions [3.59,3.63) of GNU make to not export all variables. - # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/devel/cscope/patches/patch-ae b/devel/cscope/patches/patch-ae index 69dd6758990..d0617df3b56 100644 --- a/devel/cscope/patches/patch-ae +++ b/devel/cscope/patches/patch-ae @@ -1,58 +1,22 @@ -$NetBSD: patch-ae,v 1.9 2006/08/24 22:02:02 salo Exp $ +$NetBSD: patch-ae,v 1.10 2007/01/06 22:45:49 wiz Exp $ ---- src/build.c.orig 2003-03-05 11:43:59.000000000 +0100 -+++ src/build.c 2006-08-24 23:26:31.000000000 +0200 -@@ -115,7 +115,7 @@ +--- src/build.c.orig 2006-09-30 10:13:00.000000000 +0200 ++++ src/build.c +@@ -223,7 +223,7 @@ build(void) + if (strcmp(currentdir, home) == 0) { + strcpy(newdir, "$HOME"); + } else if (strncmp(currentdir, home, strlen(home)) == 0) { +- sprintf(newdir, "$HOME%s", currentdir + strlen(home)); ++ snprintf(newdir, sizeof(newdir), "$HOME%s", currentdir + strlen(home)); + } + /* sort the source file names (needed for rebuilding) */ + qsort(srcfiles, nsrcfiles, sizeof(char *), compare); +@@ -454,7 +454,7 @@ cscope: converting to new symbol databas } - /* see if the name list is the same */ - for (i = 0; i < count; ++i) { -- if (fscanf(oldrefs, "%s", oldname) != 1 || -+ if (! fgets(oldname, sizeof(oldname), oldrefs)|| - strnotequal(oldname, names[i])) { - return(NO); - } -@@ -215,7 +215,7 @@ - (void) strcpy(newdir, "$HOME"); - } - else if (strncmp(currentdir, home, strlen(home)) == 0) { -- (void) sprintf(newdir, "$HOME%s", currentdir + strlen(home)); -+ (void) snprintf(newdir, sizeof(newdir), "$HOME%s", currentdir + strlen(home)); - } - /* sort the source file names (needed for rebuilding) */ - qsort(srcfiles, (unsigned) nsrcfiles, sizeof(char *), compare); -@@ -223,7 +223,7 @@ - /* if there is an old cross-reference and its current directory matches */ - /* or this is an unconditional build */ - if ((oldrefs = vpfopen(reffile, "rb")) != NULL && unconditional == NO && -- fscanf(oldrefs, "cscope %d %s", &fileversion, olddir) == 2 && -+ fscanf(oldrefs, "cscope %d %" PATHLEN_STR "s", &fileversion, olddir) == 2 && - (strcmp(olddir, currentdir) == 0 || /* remain compatible */ - strcmp(olddir, newdir) == 0)) { - /* get the cross-reference file's modification time */ -@@ -292,7 +292,7 @@ - /* see if the list of source files is the same and - none have been changed up to the included files */ - for (i = 0; i < nsrcfiles; ++i) { -- if (fscanf(oldrefs, "%s", oldname) != 1 || -+ if (! fgets(oldname, sizeof(oldname), oldrefs) || - strnotequal(oldname, srcfiles[i]) || - lstat(srcfiles[i], &statstruct) != 0 || - statstruct.st_mtime > reftime) { -@@ -301,7 +301,7 @@ - } - /* the old cross-reference is up-to-date */ - /* so get the list of included files */ -- while (i++ < oldnum && fscanf(oldrefs, "%s", oldname) == 1) { -+ while (i++ < oldnum && fgets(oldname, sizeof(oldname), oldrefs)) { - addsrcfile(oldname); - } - (void) fclose(oldrefs); -@@ -443,7 +443,7 @@ - } - (void) fstat(fileno(postings), &statstruct); - (void) fclose(postings); -- (void) sprintf(sortcommand, "env LC_ALL=C sort -T %s %s", tmpdir, temp1); -+ (void) snprintf(sortcommand, sizeof(sortcommand), "env LC_ALL=C sort -T %s %s", tmpdir, temp1); - if ((postings = mypopen(sortcommand, "r")) == NULL) { - (void) fprintf(stderr, "cscope: cannot open pipe to sort command\n"); - cannotindex(); + fstat(fileno(postings), &statstruct); + fclose(postings); +- sprintf(sortcommand, "env LC_ALL=C sort -T %s %s", tmpdir, temp1); ++ snprintf(sortcommand, sizeof(sortcommand), "env LC_ALL=C sort -T %s %s", tmpdir, temp1); + if ((postings = mypopen(sortcommand, "r")) == NULL) { + fprintf(stderr, "cscope: cannot open pipe to sort command\n"); + cannotindex(); diff --git a/devel/cscope/patches/patch-af b/devel/cscope/patches/patch-af index 637bf525936..890d110192e 100644 --- a/devel/cscope/patches/patch-af +++ b/devel/cscope/patches/patch-af @@ -1,108 +1,20 @@ -$NetBSD: patch-af,v 1.8 2006/08/24 22:02:02 salo Exp $ +$NetBSD: patch-af,v 1.9 2007/01/06 22:45:49 wiz Exp $ ---- src/main.c.orig 2003-08-14 16:36:18.000000000 +0200 -+++ src/main.c 2006-08-24 23:58:29.000000000 +0200 -@@ -103,7 +103,7 @@ char temp1[PATHLEN + 1]; /* temporary fi - char temp2[PATHLEN + 1]; /* temporary file name */ - long totalterms; /* total inverted index terms */ - BOOL trun_syms; /* truncate symbols to 8 characters */ --char tempstring[8192]; /* use this as a buffer, instead of 'yytext', -+char tempstring[TEMPSTRING_LEN + 1]; /* use this as a buffer, instead of 'yytext', - * which had better be left alone */ - char *tmpdir; /* temporary directory */ - -@@ -247,6 +247,11 @@ main(int argc, char **argv) - switch (c) { - case 'f': /* alternate cross-reference file */ - reffile = s; -+ if (strlen(reffile) > sizeof(path) - 1) { -+ posterr("\ -+cscope: reffile too long, cannot be > %d characters\n", sizeof(path) - 1); -+ /* NOTREACHED */ -+ } - (void) strcpy(path, s); - #ifdef SHORT_NAMES_ONLY - /* System V has a 14 character limit */ -@@ -330,9 +335,31 @@ lastarg: +--- src/main.c.orig 2006-09-30 10:13:00.000000000 +0200 ++++ src/main.c +@@ -389,12 +389,12 @@ cscope: Could not create private temp di + * used instead of failing to open a non-existant database in + * the home directory + */ +- sprintf(path, "%s/%s", home, reffile); ++ snprintf(path, sizeof(path), "%s/%s", home, reffile); + if (isuptodate == NO || access(path, READ) == 0) { + reffile = my_strdup(path); +- sprintf(path, "%s/%s", home, invname); ++ snprintf(path, sizeof(path), "%s/%s", home, invname); + invname = my_strdup(path); +- sprintf(path, "%s/%s", home, invpost); ++ snprintf(path, sizeof(path), "%s/%s", home, invpost); + invpost = my_strdup(path); } - - /* create the temporary file names */ -- pid = getpid(); -- (void) sprintf(temp1, "%s/cscope%d.1", tmpdir, pid); -- (void) sprintf(temp2, "%s/cscope%d.2", tmpdir, pid); -+ do { -+ char *tempfile = tempnam(tmpdir, "cscope1"); -+ if (!tempfile) { -+ fputs ("Can't create tempfile\n", stderr); -+ exit (1); -+ } -+ if (strlen(tempfile) >= sizeof(temp1)) { -+ fputs ("TMPDIR path is too long\n", stderr); -+ exit(1); -+ } -+ strncpy (temp1, tempfile, sizeof (temp1)); -+ } while (open (temp1, O_CREAT|O_EXCL|O_WRONLY, 0600) < 0); -+ do { -+ char *tempfile = tempnam(tmpdir, "cscope2"); -+ if (!tempfile) { -+ fputs ("Can't create tempfile\n", stderr); -+ exit (1); -+ } -+ if (strlen(tempfile) >= sizeof(temp2)) { -+ fputs ("TMPDIR path is too long\n", stderr); -+ exit(1); -+ } -+ strncpy (temp2, tempfile, sizeof (temp2)); -+ } while (open (temp2, O_CREAT|O_EXCL|O_WRONLY, 0600) < 0); -+ - - /* if running in the foreground */ - if (signal(SIGINT, SIG_IGN) != SIG_IGN) { -@@ -352,12 +379,12 @@ lastarg: - * used instead of failing to open a non-existant database in - * the home directory - */ -- (void) sprintf(path, "%s/%s", home, reffile); -+ (void) snprintf(path, sizeof(path), "%s/%s", home, reffile); - if (isuptodate == NO || access(path, READ) == 0) { - reffile = stralloc(path); -- (void) sprintf(path, "%s/%s", home, invname); -+ (void) snprintf(path, sizeof(path), "%s/%s", home, invname); - invname = stralloc(path); -- (void) sprintf(path, "%s/%s", home, invpost); -+ (void) snprintf(path, sizeof(path), "%s/%s", home, invpost); - invpost = stralloc(path); - } - } -@@ -467,11 +494,11 @@ lastarg: - || (names = vpfopen(NAMEFILE, "r")) != NULL) { - - /* read any -p option from it */ -- while (fscanf(names, "%s", path) == 1 && *path == '-') { -+ while (fgets(path, sizeof(path), names) != NULL && *path == '-') { - i = path[1]; - s = path + 2; /* for "-Ipath" */ - if (*s == '\0') { /* if "-I path" */ -- (void) fscanf(names, "%s", path); -+ (void) fgets(path, sizeof(path), names); - s = path; - } - switch (i) { -@@ -488,7 +515,7 @@ lastarg: - } - else { - for (i = 0; i < nsrcfiles; ++i) { -- if (fscanf(oldrefs, "%s", path) != 1) { -+ if (!fgets(path, sizeof(path), oldrefs) ) { - posterr("cscope: cannot read source file name from file %s\n", reffile); - myexit(1); - } -@@ -692,7 +719,7 @@ cannotwrite(char *file) - #else - char *msg = mymalloc(50+strlen(file)); - -- (void) sprintf(msg, "Removed file %s because write failed", file); -+ (void) snprintf(msg, sizeof(msg), "Removed file %s because write failed", file); - #endif - - myperror(msg); /* display the reason */ + } diff --git a/devel/cscope/patches/patch-ag b/devel/cscope/patches/patch-ag index a2ff03d9cb8..1822162abcd 100644 --- a/devel/cscope/patches/patch-ag +++ b/devel/cscope/patches/patch-ag @@ -1,22 +1,13 @@ -$NetBSD: patch-ag,v 1.5 2006/08/24 22:02:02 salo Exp $ +$NetBSD: patch-ag,v 1.6 2007/01/06 22:45:49 wiz Exp $ ---- src/command.c.orig 2002-07-29 14:37:49.000000000 +0200 -+++ src/command.c 2006-08-24 23:31:53.000000000 +0200 -@@ -707,7 +707,7 @@ changestring(void) - (void) fprintf(script, "ed - <<\\!\n"); - *oldfile = '\0'; - seekline(1); -- for (i = 0; fscanf(refsfound, "%s%*s%s%*[^\n]", newfile, linenum) == 2; -+ for (i = 0; fscanf(refsfound, "%" PATHLEN_STR "s%*s%" NUMLEN_STR "s%*[^\n]", newfile, linenum) == 2; - ++i) { - /* see if the line is to be changed */ - if (change[i] == YES) { -@@ -718,7 +718,7 @@ changestring(void) +--- src/command.c.orig 2006-09-30 10:13:00.000000000 +0200 ++++ src/command.c +@@ -739,7 +739,7 @@ changestring(void) - /* make sure it can be changed */ - if (access(newfile, WRITE) != 0) { -- (void) sprintf(msg, "Cannot write to file %s", newfile); -+ (void) snprintf(msg, sizeof(msg), "Cannot write to file %s", newfile); - postmsg(msg); - anymarked = NO; - break; + /* make sure it can be changed */ + if (access(newfile, WRITE) != 0) { +- sprintf(msg, "Cannot write to file %s", newfile); ++ snprintf(msg, sizeof(msg), "Cannot write to file %s", newfile); + postmsg(msg); + anymarked = NO; + break; diff --git a/devel/cscope/patches/patch-ah b/devel/cscope/patches/patch-ah index c0d1c16f537..6646e11f72d 100644 --- a/devel/cscope/patches/patch-ah +++ b/devel/cscope/patches/patch-ah @@ -1,35 +1,26 @@ -$NetBSD: patch-ah,v 1.5 2006/08/24 22:02:02 salo Exp $ +$NetBSD: patch-ah,v 1.6 2007/01/06 22:45:49 wiz Exp $ ---- src/dir.c.orig 2003-06-02 12:43:00.000000000 +0200 -+++ src/dir.c 2006-08-24 23:34:52.000000000 +0200 -@@ -138,7 +138,7 @@ sourcedir(char *dirlist) +--- src/dir.c.orig 2006-09-30 10:13:00.000000000 +0200 ++++ src/dir.c +@@ -139,7 +139,7 @@ sourcedir(char *dirlist) - /* compute its path from higher view path source dirs */ - for (i = 1; i < nvpsrcdirs; ++i) { -- (void) sprintf(path, "%.*s/%s", -+ (void) snprintf(path, sizeof(path), "%.*s/%s", - PATHLEN - 2 - dir_len, - srcdirs[i], dir); - addsrcdir(path); -@@ -206,7 +206,7 @@ includedir(char *dirlist) + /* compute its path from higher view path source dirs */ + for (i = 1; i < nvpsrcdirs; ++i) { +- sprintf(path, "%.*s/%s", ++ snprintf(path, sizeof(path), "%.*s/%s", + PATHLEN - 2 - dir_len, + srcdirs[i], dir); + addsrcdir(path); +@@ -207,7 +207,7 @@ includedir(char *dirlist) - /* compute its path from higher view path source dirs */ - for (i = 1; i < nvpsrcdirs; ++i) { -- (void) sprintf(path, "%.*s/%s", -+ (void) snprintf(path, sizeof(path), "%.*s/%s", - PATHLEN - 2 - dir_len, - srcdirs[i], dir); - addincdir(dir, path); -@@ -319,7 +319,7 @@ makefilelist(void) - - /* Parse whitespace-terminated strings in line: */ - point_in_line = line; -- while (sscanf(point_in_line, "%s", path) == 1) { -+ while (sscanf(point_in_line, "%" PATHLEN_STR "s", path) == 1) { - /* Have to store this length --- inviewpath() will - * modify path, later! */ - length_of_name = strlen(path); -@@ -474,8 +474,6 @@ scan_dir(const char *adir, BOOL recurse_ + /* compute its path from higher view path source dirs */ + for (i = 1; i < nvpsrcdirs; ++i) { +- sprintf(path, "%.*s/%s", ++ snprintf(path, sizeof(path), "%.*s/%s", + PATHLEN - 2 - dir_len, + srcdirs[i], dir); + addincdir(dir, path); +@@ -482,8 +482,6 @@ scan_dir(const char *adir, BOOL recurse_ DIR *dirfile; int adir_len = strlen(adir); @@ -38,7 +29,7 @@ $NetBSD: patch-ah,v 1.5 2006/08/24 22:02:02 salo Exp $ if ((dirfile = opendir(adir)) != NULL) { struct dirent *entry; char path[PATHLEN + 1]; -@@ -486,7 +484,7 @@ scan_dir(const char *adir, BOOL recurse_ +@@ -494,7 +492,7 @@ scan_dir(const char *adir, BOOL recurse_ && (strcmp("..",entry->d_name) != 0)) { struct stat buf; @@ -47,29 +38,29 @@ $NetBSD: patch-ah,v 1.5 2006/08/24 22:02:02 salo Exp $ PATHLEN - 2 - adir_len, entry->d_name); -@@ -603,14 +601,14 @@ incfile(char *file, char *type) - for (i = 0; i < nincdirs; ++i) { - - /* don't include the file from two directories */ -- (void) sprintf(name, "%.*s/%s", -+ (void) snprintf(name, sizeof(name), "%.*s/%s", - PATHLEN - 2 - file_len, incnames[i], - file); - if (infilelist(name) == YES) { - break; - } - /* make sure it exists and is readable */ -- (void) sprintf(path, "%.*s/%s", -+ (void) snprintf(path, sizeof(path), "%.*s/%s", - PATHLEN - 2 - file_len, incdirs[i], - file); - if (access(compath(path), READ) == 0) { -@@ -654,7 +652,7 @@ inviewpath(char *file) +@@ -604,14 +602,14 @@ incfile(char *file, char *type) + /* search for the file in the #include directory list */ + for (i = 0; i < nincdirs; ++i) { + /* don't include the file from two directories */ +- sprintf(name, "%.*s/%s", ++ snprintf(name, sizeof(name), "%.*s/%s", + PATHLEN - 2 - file_len, incnames[i], + file); + if (infilelist(name) == YES) { + break; + } + /* make sure it exists and is readable */ +- sprintf(path, "%.*s/%s", ++ sprintf(path, sizeof(path), "%.*s/%s", + PATHLEN - 2 - file_len, incdirs[i], + file); + if (access(compath(path), READ) == 0) { +@@ -659,7 +657,7 @@ inviewpath(char *file) - /* compute its path from higher view path source dirs */ - for (i = 1; i < nvpsrcdirs; ++i) { -- (void) sprintf(path, "%.*s/%s", -+ (void) snprintf(path, sizeof(path), "%.*s/%s", - PATHLEN - 2 - file_len, srcdirs[i], - file); - if (access(compath(path), READ) == 0) { + /* compute its path from higher view path source dirs */ + for (i = 1; i < nvpsrcdirs; ++i) { +- sprintf(path, "%.*s/%s", ++ snprintf(path, sizeof(path), "%.*s/%s", + PATHLEN - 2 - file_len, srcdirs[i], + file); + if (access(compath(path), READ) == 0) { diff --git a/devel/cscope/patches/patch-ai b/devel/cscope/patches/patch-ai index 9f19394ffa7..d2f1f2e4724 100644 --- a/devel/cscope/patches/patch-ai +++ b/devel/cscope/patches/patch-ai @@ -1,47 +1,48 @@ -$NetBSD: patch-ai,v 1.5 2006/08/24 22:02:02 salo Exp $ +$NetBSD: patch-ai,v 1.6 2007/01/06 22:45:49 wiz Exp $ ---- src/display.c.orig 2003-09-04 17:54:02.000000000 +0200 -+++ src/display.c 2006-08-24 23:37:28.000000000 +0200 -@@ -216,7 +216,7 @@ display(void) - disprefs < mdisprefs && screenline <= lastdispline; - ++disprefs, ++screenline) { - /* read the reference line */ -- if (fscanf(refsfound, "%s%s%s %[^\n]", file, function, -+ if (fscanf(refsfound, "%" PATHLEN_STR "s%" PATHLEN_STR "s%" NUMLEN_STR "s %" TEMPSTRING_LEN_STR "[^\n]", file, function, - linenum, tempstring) < 4) { - break; - } -@@ -473,24 +473,24 @@ search(void) +--- src/display.c.orig 2006-09-30 08:13:00.000000000 +0000 ++++ src/display.c +@@ -478,21 +478,25 @@ search(void) /* see if it is empty */ if ((c = getc(refsfound)) == EOF) { if (findresult != NULL) { - (void) sprintf(lastmsg, "Egrep %s in this pattern: %s", -+ (void) snprintf(lastmsg, sizeof(lastmsg), "Egrep %s in this pattern: %s", - findresult, pattern); - } - else if (rc == NOTSYMBOL) { +- findresult, Pattern); +- } else if (rc == NOTSYMBOL) { - (void) sprintf(lastmsg, "This is not a C symbol: %s", -+ (void) snprintf(lastmsg, sizeof(lastmsg), "This is not a C symbol: %s", - pattern); - } - else if (rc == REGCMPERROR) { +- Pattern); +- } else if (rc == REGCMPERROR) { - (void) sprintf(lastmsg, "Error in this regcomp(3) regular expression: %s", +- Pattern); ++ (void) snprintf(lastmsg, sizeof(lastmsg), "Egrep %s in this pattern: %s", ++ findresult, Pattern); ++ } ++ else if (rc == NOTSYMBOL) { ++ (void) snprintf(lastmsg, sizeof(lastmsg), "This is not a C symbol: %s", ++ Pattern); ++ } ++ else if (rc == REGCMPERROR) { + (void) snprintf(lastmsg, sizeof(lastmsg), "Error in this regcomp(3) regular expression: %s", - pattern); ++ Pattern); - } - else if (funcexist == NO) { +- } else if (funcexist == NO) { - (void) sprintf(lastmsg, "Function definition does not exist: %s", -+ (void) snprintf(lastmsg, sizeof(lastmsg), "Function definition does not exist: %s", - pattern); - } - else { +- Pattern); +- } else { - (void) sprintf(lastmsg, "Could not find the %s: %s", +- fields[field].text2, Pattern); ++ } ++ else if (funcexist == NO) { ++ (void) snprintf(lastmsg, sizeof(lastmsg), "Function definition does not exist: %s", ++ Pattern); ++ } ++ else { + (void) snprintf(lastmsg, sizeof(lastmsg), "Could not find the %s: %s", - fields[field].text2, pattern); ++ fields[field].text2, Pattern); } return(NO); -@@ -555,17 +555,17 @@ progress(char *what, long current, long + } +@@ -527,17 +531,17 @@ progress(char *what, long current, long move(MSGLINE, 0); clrtoeol(); addstr(what); @@ -62,7 +63,7 @@ $NetBSD: patch-ai,v 1.5 2006/08/24 22:02:02 salo Exp $ } start = now; -@@ -603,7 +603,7 @@ myperror(char *text) +@@ -575,7 +579,7 @@ myperror(char *text) s = sys_errlist[errno]; } #endif diff --git a/devel/cscope/patches/patch-aj b/devel/cscope/patches/patch-aj index 50ab30ba5bf..62bfdb92630 100644 --- a/devel/cscope/patches/patch-aj +++ b/devel/cscope/patches/patch-aj @@ -1,25 +1,7 @@ -$NetBSD: patch-aj,v 1.3 2006/08/24 22:02:02 salo Exp $ +$NetBSD: patch-aj,v 1.4 2007/01/06 22:45:49 wiz Exp $ ---- src/edit.c.orig 2001-07-18 15:49:01.000000000 +0200 -+++ src/edit.c 2006-08-24 23:39:09.000000000 +0200 -@@ -60,7 +60,7 @@ editref(int i) - seekline(i + topline); - - /* get the file name and line number */ -- if (fscanf(refsfound, "%s%*s%s", file, linenum) == 2) { -+ if (fscanf(refsfound, "%" PATHLEN_STR "s%*s%" NUMLEN_STR "s", file, linenum) == 2) { - edit(file, linenum); /* edit it */ - } - seekline(topline); /* restore the line pointer */ -@@ -83,7 +83,7 @@ editall(void) - seekline(1); - - /* get each file name and line number */ -- while (fscanf(refsfound, "%s%*s%s%*[^\n]", file, linenum) == 2) { -+ while (fscanf(refsfound, "%" PATHLEN_STR "s%*s%" NUMLEN_STR "s%*[^\n]", file, linenum) == 2) { - edit(file, linenum); /* edit it */ - if (editallprompt == YES) { - addstr("Type ^D to stop editing all lines, or any other character to continue: "); +--- src/edit.c.orig 2006-09-30 10:13:00.000000000 +0200 ++++ src/edit.c @@ -105,9 +105,9 @@ edit(char *file, char *linenum) char *s; diff --git a/devel/cscope/patches/patch-ak b/devel/cscope/patches/patch-ak index 0b36c35a9d4..a558b6e11e0 100644 --- a/devel/cscope/patches/patch-ak +++ b/devel/cscope/patches/patch-ak @@ -1,13 +1,13 @@ -$NetBSD: patch-ak,v 1.2 2006/05/29 13:51:20 tron Exp $ +$NetBSD: patch-ak,v 1.3 2007/01/06 22:45:49 wiz Exp $ ---- src/exec.c.orig 2002-07-29 13:37:49.000000000 +0100 -+++ src/exec.c 2006-05-29 14:34:26.000000000 +0100 -@@ -124,7 +124,7 @@ +--- src/exec.c.orig 2006-09-30 10:13:00.000000000 +0200 ++++ src/exec.c +@@ -123,7 +123,7 @@ myexecvp(char *a, char **args) - /* execute the program or shell script */ - (void) execvp(a, args); /* returns only on failure */ -- (void) sprintf(msg, "\nCannot exec %s", a); -+ (void) snprintf(msg, sizeof(msg), "\nCannot exec %s", a); - perror(msg); /* display the reason */ - askforreturn(); /* wait until the user sees the message */ - myexit(1); /* exit the child */ + /* execute the program or shell script */ + execvp(a, args); /* returns only on failure */ +- sprintf(msg, "\nCannot exec %s", a); ++ (void) sprintf(msg, sizeof(msg), "\nCannot exec %s", a); + perror(msg); /* display the reason */ + askforreturn(); /* wait until the user sees the message */ + myexit(1); /* exit the child */ diff --git a/devel/cscope/patches/patch-al b/devel/cscope/patches/patch-al index 4863d55c792..e598a731be0 100644 --- a/devel/cscope/patches/patch-al +++ b/devel/cscope/patches/patch-al @@ -1,8 +1,8 @@ -$NetBSD: patch-al,v 1.2 2006/05/29 13:51:20 tron Exp $ +$NetBSD: patch-al,v 1.3 2007/01/06 22:45:49 wiz Exp $ ---- src/find.c.orig 2003-09-04 16:58:52.000000000 +0100 -+++ src/find.c 2006-05-29 14:34:26.000000000 +0100 -@@ -666,7 +666,7 @@ +--- src/find.c.orig 2006-09-30 10:13:00.000000000 +0200 ++++ src/find.c +@@ -673,7 +673,7 @@ findinit(char *pattern) /* must be an exact match */ /* note: regcomp doesn't recognize ^*keypad$ as a syntax error unless it is given as a single arg */ diff --git a/devel/cscope/patches/patch-ap b/devel/cscope/patches/patch-ap deleted file mode 100644 index d96fffb59f6..00000000000 --- a/devel/cscope/patches/patch-ap +++ /dev/null @@ -1,24 +0,0 @@ -$NetBSD: patch-ap,v 1.1 2006/08/24 22:02:02 salo Exp $ - ---- src/input.c.orig 2001-07-18 15:49:01.000000000 +0200 -+++ src/input.c 2006-08-24 23:44:25.000000000 +0200 -@@ -290,7 +290,7 @@ shellpath(char *out, int limit, char *in - v = logdir(out); - } - /* copy the directory name */ -- if (v != NULL) { -+ if (v != NULL && strlen(v) < (lastchar - out)) { - (void) strcpy(out - 1, v); - out += strlen(v) - 1; - } -@@ -313,8 +313,8 @@ shellpath(char *out, int limit, char *in - } - *s = '\0'; - -- /* get its value */ -- if ((v = getenv(out)) != NULL) { -+ /* get its value, but only it isn't too big */ -+ if ((v = getenv(out)) != NULL && strlen(v) < (lastchar - out)) { - (void) strcpy(out - 1, v); - out += strlen(v) - 1; - } -- cgit v1.2.3