[phpMyAdmin/el5] - Reworked spec file and enabled the documentation file viewers - Backported patch for stripslashes
Robert Scheck
robert at fedoraproject.org
Tue Jul 26 20:02:55 UTC 2011
commit 420eec5931496ed333406caf7258903711bd8cd9
Author: Robert Scheck <robert at fedoraproject.org>
Date: Tue Jul 26 22:02:37 2011 +0200
- Reworked spec file and enabled the documentation file viewers
- Backported patch for stripslashes with magic_quotes_gpc (#725123)
phpMyAdmin-2.11.11.3-magic-quotes.patch | 17 ++++++
phpMyAdmin.htaccess | 21 +++++--
phpMyAdmin.spec | 92 ++++++++++++++++---------------
3 files changed, 79 insertions(+), 51 deletions(-)
---
diff --git a/phpMyAdmin-2.11.11.3-magic-quotes.patch b/phpMyAdmin-2.11.11.3-magic-quotes.patch
new file mode 100644
index 0000000..f45554c
--- /dev/null
+++ b/phpMyAdmin-2.11.11.3-magic-quotes.patch
@@ -0,0 +1,17 @@
+Patch by Robert Scheck <robert at fedoraproject.org> for phpMyAdmin >= 2.11.11.3, which backports the fix
+to really enable stripslashes if magic_quotes_gpc is enabled in the PHP configuration file. For further
+information, please have a look to: https://bugzilla.redhat.com/show_bug.cgi?id=725123
+
+--- phpMyAdmin-2.11.11.3/libraries/common.inc.php 2011-02-11 18:47:43.000000000 +0100
++++ phpMyAdmin-2.11.11.3/libraries/common.inc.php.magic-quotes 2011-07-26 20:08:17.000000000 +0200
+@@ -231,9 +231,7 @@
+ // end check if a subform is submitted
+
+ // remove quotes added by php
+-// (get_magic_quotes_gpc() is deprecated in PHP 5.3, but compare with 5.2.99
+-// to be able to test with 5.3.0-dev)
+-if (function_exists('get_magic_quotes_gpc') && -1 == version_compare(PHP_VERSION, '5.2.99') && get_magic_quotes_gpc()) {
++if (function_exists('get_magic_quotes_gpc') && get_magic_quotes_gpc()) {
+ PMA_arrayWalkRecursive($_GET, 'stripslashes', true);
+ PMA_arrayWalkRecursive($_POST, 'stripslashes', true);
+ PMA_arrayWalkRecursive($_COOKIE, 'stripslashes', true);
diff --git a/phpMyAdmin.htaccess b/phpMyAdmin.htaccess
index 0d57efc..ef9ed4f 100644
--- a/phpMyAdmin.htaccess
+++ b/phpMyAdmin.htaccess
@@ -7,17 +7,25 @@
Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin
+
<Directory /usr/share/phpMyAdmin/>
- order deny,allow
- deny from all
- allow from 127.0.0.1
- allow from ::1
+ Order Deny,Allow
+ Deny from All
+ Allow from 127.0.0.1
+ Allow from ::1
+</Directory>
+
+<Directory /usr/share/phpMyAdmin/scripts/>
+ Order Deny,Allow
+ Deny from All
+ Allow from 127.0.0.1
+ Allow from ::1
</Directory>
# This directory does not require access over HTTP - taken from the original
# phpMyAdmin upstream tarball
#
-<Directory /usr/share/phpMyAdmin/libraries>
+<Directory /usr/share/phpMyAdmin/libraries/>
Order Deny,Allow
Deny from All
Allow from None
@@ -27,8 +35,7 @@ Alias /phpmyadmin /usr/share/phpMyAdmin
# filtering SQL etc. This may break your mod_security implementation.
#
#<IfModule mod_security.c>
-# <Directory /usr/share/phpMyAdmin>
+# <Directory /usr/share/phpMyAdmin/>
# SecRuleInheritance Off
# </Directory>
#</IfModule>
-
diff --git a/phpMyAdmin.spec b/phpMyAdmin.spec
index 91cbc79..58e49e2 100644
--- a/phpMyAdmin.spec
+++ b/phpMyAdmin.spec
@@ -1,62 +1,66 @@
-Name: phpMyAdmin
-Version: 2.11.11.3
-Release: 1%{?dist}
-Summary: Web based MySQL browser written in php
-
-Group: Applications/Internet
-License: GPLv2+
-URL: http://www.phpmyadmin.net/
-Source0: http://downloads.sourceforge.net/sourceforge/%{name}/%{name}-%{version}-all-languages.tar.bz2
-Source1: phpMyAdmin-config.inc.php
-Source2: phpMyAdmin.htaccess
-Patch0: phpMyAdmin-2.11.9.6-blowfish.patch
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildArch: noarch
-
-Requires: webserver
-Requires: php >= 4.1.0
-Requires: php-mysql >= 4.1.0
-Requires: php-mbstring >= 4.1.0
-Requires: php-mcrypt >= 4.1.0
-Provides: phpmyadmin
+Summary: Handle the administration of MySQL over the World Wide Web
+Name: phpMyAdmin
+Version: 2.11.11.3
+Release: 2%{?dist}
+License: GPLv2+
+Group: Applications/Internet
+URL: http://www.phpmyadmin.net/
+Source0: http://downloads.sourceforge.net/sourceforge/%{name}/%{name}-%{version}-all-languages.tar.bz2
+Source1: phpMyAdmin-config.inc.php
+Source2: phpMyAdmin.htaccess
+Patch0: phpMyAdmin-2.11.9.6-blowfish.patch
+Patch1: phpMyAdmin-2.11.11.3-magic-quotes.patch
+Requires: webserver, php >= 4.1.0, php-mysql >= 4.1.0, php-mcrypt >= 4.1.0
+Requires: php-mbstring >= 4.1.0, php-gd >= 4.1.0
+Provides: phpmyadmin = %{version}-%{release}
+BuildArch: noarch
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%description
phpMyAdmin is a tool written in PHP intended to handle the administration of
-MySQL over the Web. Currently it can create and drop databases,
-create/drop/alter tables, delete/edit/add fields, execute any SQL statement,
-manage keys on fields, manage privileges,export data into various formats and
-is available in 50 languages
+MySQL over the World Wide Web. Most frequently used operations are supported
+by the user interface (managing databases, tables, fields, relations, indexes,
+users, permissions), while you still have the ability to directly execute any
+SQL statement.
%prep
-%setup -qn phpMyAdmin-%{version}-all-languages
+%setup -q -n %{name}-%{version}-all-languages
%patch0 -p1
+%patch1 -p1
+
+# Setup several viewers
+sed -e "/'ChangeLog'/s at ChangeLog@%{_datadir}/doc/%{name}-%{version}/ChangeLog@" -i changelog.php
+sed -e "/'LICENSE'/s at LICENSE@%{_datadir}/doc/%{name}-%{version}/LICENSE@" -i license.php
+sed -e "/'README'/s at README@%{_datadir}/doc/%{name}-%{version}/README@" -i readme.php
+
+%build
%install
-rm -rf %{buildroot}
-%{__mkdir} -p %{buildroot}/%{_datadir}/%{name}
-%{__mkdir} -p %{buildroot}/%{_sysconfdir}/httpd/conf.d/
-%{__mkdir} -p %{buildroot}/%{_sysconfdir}/%{name}
-%{__cp} -ad ./* %{buildroot}/%{_datadir}/%{name}
-%{__cp} %{SOURCE2} %{buildroot}/%{_sysconfdir}/httpd/conf.d/phpMyAdmin.conf
-%{__cp} %{SOURCE1} %{buildroot}/%{_sysconfdir}/%{name}/config.inc.php
-ln -s %{_sysconfdir}/%{name}/config.inc.php %{buildroot}/%{_datadir}/%{name}/config.inc.php
-
-%{__rm} -f %{buildroot}/%{_datadir}/%{name}/*txt
-%{__rm} -f %{buildroot}/%{_datadir}/%{name}/[IRLT]*
-%{__rm} -f %{buildroot}/%{_datadir}/%{name}/CREDITS
-%{__rm} -f %{buildroot}/%{_datadir}/%{name}/libraries/.htaccess
+rm -rf $RPM_BUILD_ROOT
+mkdir -p $RPM_BUILD_ROOT{%{_datadir}/%{name},%{_sysconfdir}/{httpd/conf.d,%{name}}}
+cp -ad * $RPM_BUILD_ROOT%{_datadir}/%{name}
+install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/httpd/conf.d/%{name}.conf
+install -p -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/%{name}/config.inc.php
+ln -s ../../..%{_sysconfdir}/%{name}/config.inc.php $RPM_BUILD_ROOT%{_datadir}/%{name}/config.inc.php
+
+rm -f $RPM_BUILD_ROOT%{_datadir}/%{name}/{[CIRLT]*,*txt,libraries/.htaccess}
%clean
-rm -rf %{buildroot}
+rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
-%doc INSTALL README LICENSE CREDITS TODO Documentation.txt
-%{_datadir}/%{name}
-%config(noreplace) %{_sysconfdir}/httpd/conf.d/phpMyAdmin.conf
-%config(noreplace) %{_sysconfdir}/%{name}
+%doc ChangeLog README LICENSE CREDITS TODO Documentation.txt
+%{_datadir}/%{name}/
+%dir %{_sysconfdir}/%{name}/
+%config(noreplace) %{_sysconfdir}/%{name}/config.inc.php
+%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
%changelog
+* Tue Jul 26 2011 Robert Scheck <robert at fedoraproject.org> 2.11.11.3-2
+- Reworked spec file and enabled the documentation file viewers
+- Backported patch for stripslashes with magic_quotes_gpc (#725123)
+
* Sun Feb 13 2011 Robert Scheck <robert at fedoraproject.org> 2.11.11.3-1
- Upstream released 2.11.11.3
More information about the scm-commits
mailing list