Bug 92198 - [NEW PORT] security/pecl-filter PHP extension for safely dealing with input parameters
Summary: [NEW PORT] security/pecl-filter PHP extension for safely dealing with input p...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Renato Botelho
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-23 13:20 UTC by Alexander Zhuravlev
Modified: 2006-01-24 17:10 UTC (History)
1 user (show)

See Also:


Attachments
pecl-filter.shar (1.90 KB, text/plain)
2006-01-23 13:20 UTC, Alexander Zhuravlev
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Zhuravlev 2006-01-23 13:20:01 UTC
	
	The patch provided below contains PHP PECL extension for safely dealing with input parameters (pecl-filter)
Comment 1 Renato Botelho freebsd_committer freebsd_triage 2006-01-23 18:10:34 UTC
Responsible Changed
From-To: freebsd-ports-bugs->garga

I'll take it.
Comment 2 Renato Botelho freebsd_committer freebsd_triage 2006-01-24 11:32:58 UTC
It doesn't build fine on FreeBSD 6-STABLE:

checking for re2c... exit 0;
checking for gawk... no
checking for mawk... no
checking for nawk... nawk
checking whether to enable input filter support... yes, shared
checking pcre install prefix... /usr/local
./configure.lineno: 3833: Syntax error: word unexpected (expecting ")")
===>  Script "configure" failed unexpectedly.
Please report the problem to zaa@zaa.pp.ru [maintainer] and attach the
"/work/a/ports/security/pecl-filter/work/filter-0.9.4/config.log"
including
the output of the failure of your make command. Also, it might be a
good idea
to provide an overview of all packages installed on your system
(e.g. an `ls
/var/db/pkg`).
*** Error code 1

Could you please take a look at this?
-- 
Renato Botelho <garga @ FreeBSD.org>
               <freebsd @ galle.com.br>
GnuPG Key: http://www.FreeBSD.org/~garga/pubkey.asc
Comment 3 Renato Botelho freebsd_committer freebsd_triage 2006-01-24 11:34:13 UTC
State Changed
From-To: open->feedback

Ask for submitter fix.
Comment 4 Alexander Zhuravlev 2006-01-24 12:36:16 UTC
On Tue, Jan 24, 2006 at 09:32:58AM -0200, Renato Botelho wrote:
> It doesn't build fine on FreeBSD 6-STABLE:
> 
> checking for re2c... exit 0;
> checking for gawk... no
> checking for mawk... no
> checking for nawk... nawk
> checking whether to enable input filter support... yes, shared
> checking pcre install prefix... /usr/local
> ./configure.lineno: 3833: Syntax error: word unexpected (expecting ")")
> ===>  Script "configure" failed unexpectedly.
> Please report the problem to zaa@zaa.pp.ru [maintainer] and attach the
> "/work/a/ports/security/pecl-filter/work/filter-0.9.4/config.log"
> including
> the output of the failure of your make command. Also, it might be a
> good idea
> to provide an overview of all packages installed on your system
> (e.g. an `ls
> /var/db/pkg`).
> *** Error code 1
> 
> Could you please take a look at this?

I'm sorry, but I failed to reproduce the issue on FreeBSD 6.0-STABLE
with PHP 5.1.1

wave:...security/pecl-filter# uname -a
FreeBSD wave.zaa.local 6.0-STABLE FreeBSD 6.0-STABLE #14: Wed Jan 18
23:53:14 MSK 2006     root@wave.zaa.local:/usr/obj/usr/src/sys/WAVE
i386

wave:...security/pecl-filter# php -v
PHP 5.1.1 (cli) (built: Dec 21 2005 00:59:01)
Copyright (c) 1997-2005 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2005 Zend Technologies

wave:...security/pecl-filter# make configure
===>  Extracting for pecl-filter-0.9.4
=> MD5 Checksum OK for PECL/filter-0.9.4.tgz.
=> SHA256 Checksum OK for PECL/filter-0.9.4.tgz.
===>  Patching for pecl-filter-0.9.4
===>   pecl-filter-0.9.4 depends on executable: phpize - found
===>   pecl-filter-0.9.4 depends on file: /usr/local/bin/autoconf259 -
found
===>   pecl-filter-0.9.4 depends on shared library: pcre - found
===>  PHPizing for pecl-filter-0.9.4
Configuring for:
PHP Api Version:         20041225
Zend Module Api No:      20050922
Zend Extension Api No:   220051025
===>  Configuring for pecl-filter-0.9.4
configure: WARNING: you should use --build, --host, --target
checking for egrep... grep -E
checking for a sed that does not truncate output... /usr/bin/sed
checking for i386-portbld-freebsd6.0-gcc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ANSI C... none needed
checking whether cc understands -c and -o together... yes
checking if compiler supports -R... yes
checking build system type... i386-portbld-freebsd6.0
checking host system type... i386-portbld-freebsd6.0
checking target system type... i386-portbld-freebsd6.0
checking for PHP prefix... /usr/local
checking for PHP includes... -I/usr/local/include/php
-I/usr/local/include/php/main -I/usr/local/include/php/TSRM
-I/usr/local/include/php/Zend -I/usr/local/include/php/ext
checking for PHP extension directory... /usr/local/lib/php/20050922
checking for PHP installed headers prefix... /usr/local/include/php
checking for re2c... no
configure: WARNING: You will need re2c 0.98 or later if you want to
regenerate PHP parsers.
checking for gawk... no
checking for nawk... nawk
checking if nawk is broken... no
checking whether to enable input filter support... yes, shared
checking pcre install prefix... /usr/local
checking how to run the C preprocessor... cc -E
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... nm
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
ecking for i386-portbld-freebsd6.0-g++... c++
checking whether we are using the GNU C++ compiler... yes
checking whether c++ accepts -g... yes
checking how to run the C++ preprocessor... c++ -E
checking the maximum length of command line arguments... (cached) 262144
checking command to parse nm output from cc object... ok
checking for objdir... .libs
checking for i386-portbld-freebsd6.0-ar... no
checking for ar... ar
checking for i386-portbld-freebsd6.0-ranlib... no
checking for ranlib... ranlib
checking for i386-portbld-freebsd6.0-strip... no
checking for strip... strip
checking if cc static flag  works... yes
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld) supports shared
libraries... yes
checking whether -lc should be explicitly linked in... yes
checking dynamic linker characteristics... freebsd6.0 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
checking whether the c++ linker (/usr/bin/ld) supports shared
libraries... yes
checking for c++ option to produce PIC... -fPIC
checking if c++ PIC flag -fPIC works... yes
checking if c++ supports -c -o file.o... yes
checking whether the c++ linker (/usr/bin/ld) supports shared
libraries... yes
checking dynamic linker characteristics... freebsd6.0 ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
configure: creating ./config.status
config.status: creating config.h


Can you please show me your output of the following commands (you may
send it to my email address only) 

uname -a
pkg_info | grep autoconf
pkg_info | grep automake
pkg_info | grep libtool
php -v

and please attach contents of 
/work/a/ports/security/pecl-filter/work/filter-0.9.4/config.log
/work/a/ports/security/pecl-filter/work/filter-0.9.4/configure.lineno

files. 

Thank you.
-- 
Alexander Zhuravlev
Comment 5 Alexander Zhuravlev 2006-01-24 15:38:04 UTC
On Tue, Jan 24, 2006 at 09:32:58AM -0200, Renato Botelho wrote:
> It doesn't build fine on FreeBSD 6-STABLE:
> 
> checking for re2c... exit 0;
> checking for gawk... no
> checking for mawk... no
> checking for nawk... nawk
> checking whether to enable input filter support... yes, shared
> checking pcre install prefix... /usr/local
> ./configure.lineno: 3833: Syntax error: word unexpected (expecting ")")
> ===>  Script "configure" failed unexpectedly.
> Please report the problem to zaa@zaa.pp.ru [maintainer] and attach the
> "/work/a/ports/security/pecl-filter/work/filter-0.9.4/config.log"
> including
> the output of the failure of your make command. Also, it might be a
> good idea
> to provide an overview of all packages installed on your system
> (e.g. an `ls
> /var/db/pkg`).
> *** Error code 1
> 
> Could you please take a look at this?

Author of the extension clarified that the package requires PHP 5.x.x

New shar archive is provided below. 


# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	pecl-filter/
#	pecl-filter/pkg-descr
#	pecl-filter/distinfo
#	pecl-filter/Makefile
#
echo c - pecl-filter/
mkdir -p pecl-filter/ > /dev/null 2>&1
echo x - pecl-filter/pkg-descr
sed 's/^X//' >pecl-filter/pkg-descr << 'END-of-pecl-filter/pkg-descr'
XWe all know that you should always check input variables, but PHP does not
Xoffer really good functionality for doing this in a safe way.
XThe Input Filter extension is meant to address this issue by implementing
Xa set of filters and mechanisms that users can use to safely access their
Xinput data.
X
XWWW: http://pecl.php.net/package/filter
END-of-pecl-filter/pkg-descr
echo x - pecl-filter/distinfo
sed 's/^X//' >pecl-filter/distinfo << 'END-of-pecl-filter/distinfo'
XMD5 (PECL/filter-0.9.4.tgz) = bd1e15d31d89776f80e192f0828a46a8
XSHA256 (PECL/filter-0.9.4.tgz) = 8fa653b5aec6560ca93be29c70fd4956c88ff4e6c542895e9fdca9b838641793
XSIZE (PECL/filter-0.9.4.tgz) = 13586
END-of-pecl-filter/distinfo
echo x - pecl-filter/Makefile
sed 's/^X//' >pecl-filter/Makefile << 'END-of-pecl-filter/Makefile'
X# Ports collection makefile for:  pecl-filter
X# Date created:			  2006-01-23
X# Whom:				  Alexander Zhuravlev <zaa@zaa.pp.ru>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	filter
XDISTVERSION=	0.9.4
XCATEGORIES=	security
XMASTER_SITES=	http://pecl.php.net/get/
XPKGNAMEPREFIX=	pecl-
XEXTRACT_SUFX=	.tgz
XDIST_SUBDIR=	PECL
X
XMAINTAINER=	zaa@zaa.pp.ru
XCOMMENT=	PHP extension for safely dealing with input parameters
X
XLIB_DEPENDS+=	pcre:${PORTSDIR}/devel/pcre
X
XUSE_PHP=	yes
XUSE_PHPIZE=	yes
XUSE_PHPEXT=	yes
XDEFAULT_PHP_VER=5
XPHP_MODNAME=	filter
X
XCONFIGURE_ARGS+=	--with-pcre-dir=${LOCALBASE}
X
X.include <bsd.port.pre.mk>
X
X.if ${PHP_VER} == 4
XIGNORE=		requires PHP 5
X.endif
X
X.include <bsd.port.post.mk>
END-of-pecl-filter/Makefile
exit

-- 
Alexander Zhuravlev
Comment 6 Renato Botelho freebsd_committer freebsd_triage 2006-01-24 17:10:04 UTC
State Changed
From-To: feedback->closed

New port added. Thanks!