laruence / taint

Taint is a PHP extension, used for detecting XSS codes
Other
611 stars 128 forks source link

Windows PHP-SDK PECL Build Error: Could not find rc file because of credit string that contain "<" & ">" #23

Closed HorseLuke closed 9 years ago

HorseLuke commented 9 years ago

Abstract(English)

Credit string has email string surrounded by "<" AND ">". When nmake executing Microsoft Windows Resource Compiler(rc), these will break the command and rc will return 0x1, saying "The System Could Not Find The File Specified". The whole compile process will fail, nmake output "fatal error U1077".

Not sure whether the bug should be assigned to PHP-SDK or taint extension.


(中文)问题详述

Taint的Credit部分含有"<"以及">"字符。按照官方PHP-SDK和教程(https://wiki.php.net/internals/windows/stepbystepbuild )进行PECL编译时,nmake执行到Microsoft Windows Resource Compiler(rc)阶段,会出现命令行被截断现象,导致返回0x1,报“系统找不到指定的文件。”。整个编译过程失败,nmake报 "fatal error U1077"。

这个bug,不知道应该是属于PHP-SDK的bug还是taint扩展的Credit属性写得有问题。

编译环境

Windows XP SP3 x86 Windows SDK 6.1 Visual C++ Express 2008 SP1

待编译内容

PHP 5.3.29 NTS VC9 x86 PHP Taint 1.2.2 For PHP 5.3.29 NTS VC9 x86 (https://pecl.php.net/package/taint)

重现步骤

1、按照官方PHP-SDK和教程(https://wiki.php.net/internals/windows/stepbystepbuild )中的“Adding PECL extensions”进行PECL编译。但configure命令行换成:

configure --disable-all --enable-cli --enable-cgi --enable-taint=shared

2、执行nmake

预期结果

编译成功

故障结果

rc返回0x1,报“系统找不到指定的文件。”。整个编译过程失败,nmake报 "fatal error U1077"。

   正在创建库 Release\php5.lib 和对象 Release\php5.exp
        rc /n /fo Release\php_taint.dll.res /d FILE_DESCRIPTION="\"taint\"" /d F
ILE_NAME="\"php_taint.dll\"" /d URL="\"http://pecl.php.net/taint\"" /d INTERNAL_
NAME="\"TAINT extension\"" /d EXT_FILE_VERSION=1,2,2 /d EXT_VERSION="\"1.2.2\""
/d THANKS_GUYS="\"Thanks to Xinchen Hui <laruence@php.net>\"" win32\build\templa
te.rc
系统找不到指定的文件。
NMAKE : fatal error U1077: “rc”: 返回代码“0x1”
Stop.

当前缓解/变通方法

configure完毕后,修改Makefile和Makefile.objects,把THANKS_GUYS=内的"<"以及">"分别换成“(”和“)”。

laruence commented 9 years ago

没搞明白, 这个THANKS_GUYS是哪里来的..

HorseLuke commented 9 years ago

@laruence ,是configure阶段生成Makefile和Makefile.objects时候,读取CREDITS文件自动生成的

laruence commented 9 years ago

好的吧...那你就先这么弄着把, 我来问问weltling:

@weltling , the reporter said, if I write "" in CREDITS, then windows build system will gengerate a constant names THANKS_GUYES, which will result windows build error with " fatal error U1077: “rc”: return “0x1"". change < to ( fixed it.

is that a knew issue? or ?

thanks

laruence commented 9 years ago

@HorseLuke @weltling confirm this is a knew issue, so I remove the email address in CREDITS, thanks for reporting :)