new package:

- add package grep, we need an full featured grep for upcoming pm-utils
This commit is contained in:
Stephan Raue 2010-05-02 16:18:05 +02:00
parent a51509a2b3
commit e2268d59a6
5 changed files with 66 additions and 0 deletions

View File

@ -55,3 +55,6 @@ USER_PWD="`$ROOT/$TOOLCHAIN/bin/cryptpw $USER_PASSWORD`"
mkdir -p $INSTALL/etc/network mkdir -p $INSTALL/etc/network
cp $PKG_DIR/config/interfaces $INSTALL/etc/network cp $PKG_DIR/config/interfaces $INSTALL/etc/network
# we need an full-featured grep for pm-utils, so we install this :-(
$SCRIPTS/install grep

14
packages/sysutils/grep/build Executable file
View File

@ -0,0 +1,14 @@
#!/bin/sh
. config/options
$SCRIPTS/build toolchain
cd $PKG_BUILD
./configure --host=$TARGET_NAME \
--build=$HOST_NAME \
--prefix=/usr \
--enable-shared \
--disable-static \
make

6
packages/sysutils/grep/install Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
. config/options
mkdir -p $INSTALL/usr/bin
cp -P $PKG_BUILD/src/grep $INSTALL/usr/bin

View File

@ -0,0 +1,42 @@
Hi Nelson,
Thanks for the report.
I debated whether to add an entry to NEWS, but opted not to,
since it is unlikely that anyone will see the result of this fix.
Here's the patch:
From 651d212abe771d2a32db746895ae28dd434527b6 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering <at> redhat.com>
Date: Wed, 7 Apr 2010 13:36:02 +0200
Subject: [PATCH] grep: make kwset's obstack use xmalloc, not malloc
This insidious bug could make grep fail to diagnose a failed malloc,
and then proceed to dereference the resulting NULL pointer.
Note that this bug was unlikely ever to cause real trouble; without
the fix, grep would segfault upon OOM, now it exits with a diagnostic.
* src/kwset.c (malloc) [GREP]: Define without the "(s)" macro
parameter, so that unadorned uses of malloc are also mapped to xmalloc.
One such use is in the expansion of obstack_init.
Report and patch by Nelson H. F. Beebe, in
http://thread.gmane.org/gmane.comp.gnu.grep.bugs/2995
---
src/kwset.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/kwset.c b/src/kwset.c
index 050562e..995be79 100644
--- a/src/kwset.c
+++ b/src/kwset.c
@@ -40,7 +40,7 @@
#ifdef GREP
# include "xalloc.h"
# undef malloc
-# define malloc(s) xmalloc(s)
+# define malloc xmalloc
#endif
#define NCHAR (UCHAR_MAX + 1)
--
1.7.1.rc0.212.gbd88f

View File

@ -0,0 +1 @@
ftp://ftp-stud.fht-esslingen.de/pub/Mirrors/ftp.gnu.org/grep/grep-2.6.3.tar.gz