0

I download magento security patch and install in my site

domain.com/patch.php

Below i mention patch.php file

<?php
    print("<PRE>");
    passthru("/bin/bash PATCH_SUPEE-6788_CE_1.9.0.1_v1-2015-10-26-11-46-45.sh");
    print("</PRE>");
    echo "Done";
?>

After that i got this

Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

patching file .htaccess
Hunk #1 FAILED at 207.
1 out of 1 hunk FAILED -- saving rejects to file .htaccess.rej
can't find file to patch at input line 38
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git .htaccess.sample .htaccess.sample
|index b8821af..383313a 100644
|--- .htaccess.sample
|+++ .htaccess.sample
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
1 out of 1 hunk ignored
patching file app/code/core/Mage/Admin/Model/Block.php
patching file app/code/core/Mage/Admin/Model/Resource/Block.php
patching file app/code/core/Mage/Admin/Model/Resource/Block/Collection.php
patching file app/code/core/Mage/Admin/Model/Resource/Variable.php
patching file app/code/core/Mage/Admin/Model/Resource/Variable/Collection.php
patching file app/code/core/Mage/Admin/Model/Variable.php
patching file app/code/core/Mage/Admin/etc/config.xml
patching file app/code/core/Mage/Admin/sql/admin_setup/upgrade-1.6.1.1-1.6.1.2.php
patching file app/code/core/Mage/Adminhtml/Block/Permissions/Block.php
patching file app/code/core/Mage/Adminhtml/Block/Permissions/Block/Edit.php
patching file app/code/core/Mage/Adminhtml/Block/Permissions/Block/Edit/Form.php
patching file app/code/core/Mage/Adminhtml/Block/Permissions/Block/Grid.php
patching file app/code/core/Mage/Adminhtml/Block/Permissions/Variable.php
patching file app/code/core/Mage/Adminhtml/Block/Permissions/Variable/Edit.php
patching file app/code/core/Mage/Adminhtml/Block/Permissions/Variable/Edit/Form.php
patching file app/code/core/Mage/Adminhtml/Block/Permissions/Variable/Grid.php
patching file app/code/core/Mage/Adminhtml/controllers/Permissions/BlockController.php
patching file app/code/core/Mage/Adminhtml/controllers/Permissions/VariableController.php
patching file app/code/core/Mage/Adminhtml/etc/adminhtml.xml
patching file app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php
patching file app/code/core/Mage/Core/Controller/Request/Http.php
Hunk #1 succeeded at 291 (offset -7 lines).
patching file app/code/core/Mage/Core/Controller/Varien/Router/Admin.php
Hunk #1 FAILED at 131.
1 out of 1 hunk FAILED -- saving rejects to file app/code/core/Mage/Core/Controller/Varien/Router/Admin.php.rej
patching file app/code/core/Mage/Core/Helper/UnserializeArray.php
patching file app/code/core/Mage/Core/Model/Email/Template/Filter.php
patching file app/code/core/Mage/Core/Model/Resource/Setup.php
patching file app/code/core/Mage/Core/etc/config.xml
patching file app/code/core/Mage/Core/etc/system.xml
patching file app/code/core/Mage/Customer/Block/Account/Changeforgotten.php
patching file app/code/core/Mage/Customer/Block/Account/Resetpassword.php
patching file app/code/core/Mage/Customer/controllers/AccountController.php
Hunk #1 succeeded at 36 with fuzz 1 (offset 3 lines).
Hunk #2 succeeded at 78 (offset 3 lines).
Hunk #3 succeeded at 276 (offset 9 lines).
Hunk #4 succeeded at 313 (offset 9 lines).
Hunk #5 succeeded at 389 (offset 9 lines).
Hunk #6 succeeded at 397 (offset 9 lines).
Hunk #7 succeeded at 764 (offset 9 lines).
Hunk #8 succeeded at 807 (offset 9 lines).
Hunk #9 succeeded at 838 (offset 9 lines).
Hunk #10 succeeded at 848 (offset 9 lines).
Hunk #11 succeeded at 1033 (offset 9 lines).
patching file app/code/core/Mage/Downloadable/Model/Product/Type.php
patching file app/code/core/Mage/Eav/Model/Resource/Attribute/Collection.php
patching file app/code/core/Mage/Sales/Model/Resource/Order/Item/Collection.php
patching file app/code/core/Mage/Sales/controllers/DownloadController.php
patching file app/code/core/Mage/SalesRule/Model/Resource/Coupon/Collection.php
patching file app/code/core/Zend/Soap/Server.php
patching file app/code/core/Zend/Xml/Exception.php
patching file app/code/core/Zend/Xml/Security.php
patching file app/code/core/Zend/XmlRpc/Request.php
patching file app/code/core/Zend/XmlRpc/Response.php
patching file app/design/adminhtml/default/default/layout/admin.xml
patching file app/design/frontend/base/default/layout/customer.xml
patching file app/design/frontend/base/default/template/customer/form/register.phtml
patching file app/design/frontend/base/default/template/customer/form/resetforgottenpassword.phtml
patching file app/design/frontend/base/default/template/page/js/cookie.phtml
patching file app/design/frontend/base/default/template/persistent/customer/form/register.phtml
patching file app/design/frontend/default/iphone/layout/customer.xml
patching file app/design/frontend/default/modern/layout/customer.xml
patching file app/design/frontend/rwd/default/layout/customer.xml
patching file app/design/frontend/rwd/default/template/customer/form/resetforgottenpassword.phtml
patching file app/design/frontend/rwd/default/template/persistent/customer/form/register.phtml
patching file cron.php
patching file errors/processor.php
Hunk #1 succeeded at 463 with fuzz 2.
patching file lib/Unserialize/Parser.php
patching file lib/Unserialize/Reader/Arr.php
patching file lib/Unserialize/Reader/ArrKey.php
patching file lib/Unserialize/Reader/ArrValue.php
patching file lib/Unserialize/Reader/Bool.php
patching file lib/Unserialize/Reader/Dbl.php
patching file lib/Unserialize/Reader/Int.php
patching file lib/Unserialize/Reader/Str.php
patching file lib/Varien/Data/Collection/Db.php
Done

But i don't know what it's can anyone explain security patch applied or not

I am using Magento 1.9.0.1

0

The patch is failing because of a modified .htaccess file and a missing .htaccess.sample file

patching file .htaccess     <==== This failed to apply
Hunk #1 FAILED at 207.
1 out of 1 hunk FAILED -- saving rejects to file .htaccess.rej
can't find file to patch at input line 38
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git .htaccess.sample .htaccess.sample <==== This is missing
|index b8821af..383313a 100644
|--- .htaccess.sample
|+++ .htaccess.sample
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
1 out of 1 hunk ignored

This can be recovered from by backing up your .htaccess file to somewhere safe, downloading the full installation archive for your version (1.9.0.1), extracting these two files and uploading them to the server you are trying to patch.

You will need to merge the changes between your previous .htaccess file and the patched .htaccess file

======

The next issue

And SUPEE-5994 needs to be installed before running this patch install. The file app/code/core/Mage/Core/Controller/Varien/Router/Admin.php does not exist until SUPEE-5994 creates it. The SUPEE-5994 patch seems to have been applied because the file exists, but the file was not created properly. I'm guessing that it was downloaded from elsewhere and uploaded to the site.

patching file app/code/core/Mage/Core/Controller/Varien/Router/Admin.php
Hunk #1 FAILED at 131.
1 out of 1 hunk FAILED -- saving rejects to file app/code/core/Mage/Core/Controller/Varien/Router/Admin.php.rej

And SUPEE-5994 install can be problematic, for more information => Error after successful SUPEE-5994 install

Once you have the .htaccess and .htaccess.sample files in place and the SUPEE-5994 patched file returned to what its original state should have been, then you can try running SUPEE-6788

USUAL WARNINGS APPLY ON NOT RUNNING THIS ON YOUR LIVE SITE FIRST

  • I got this message Checking if patch can be applied/reverted successfully... Patch was applied/reverted successfully. Done – Magento 2 Oct 29 '15 at 16:46
  • which means sucessfully done right – Magento 2 Oct 29 '15 at 16:47
  • I've learned to never trust those messages, applied/reverted successfully means it barfed on one item and reverted everything back to what it was before the patch was applied (another definition of successfully done right that Magento loves to hit you with). The next thing is to read a few file patch sections in the patch file, check to see if the file dates changed and check that the changes really were made in the appropriate file. Or, if you are running version control like git, run a check to make sure that there are file changes referencing the file headings in the patch. – Fiasco Labs Oct 30 '15 at 2:21
0

Most files are patched, but if you look closely:

patching file app/code/core/Mage/Core/Controller/Varien/Router/Admin.php Hunk #1 FAILED at 131. 1 out of 1 hunk FAILED -- saving rejects to file app/code/core/Mage/Core/Controller/Varien/Router/Admin.php.rej

Before doing anything else : please backup your whole site (especially when patching or changing code).

Maybe this could help you: Patch without SSH 6788 (be sure to download correct version). Unzip it and replace files (files patch couldn't patch) on your server.

PS. That patch should work (and it worked on all sites). So: backup first.

  • 1
    "Most files are patched" - wrong. If the patch fails to patch any file, nothing changes. – Fabian Schmengler Oct 29 '15 at 16:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.