2

This question already has an answer here:

I am experiencing issues patching the new SUPEE 10266 on a fresh Magento 1.9.1.1.

Getting the following error. Not sure if this is the correct place to report it.

Patching a fresh 1.9.1.1 with all previous related patches applied.

sh PATCH_SUPEE-10266_CE_1.9.1.1_v1.sh 
Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git app/code/core/Enterprise/CustomerSegment/controllers/Adminhtml/CustomersegmentController.php app/code/core/Enterprise/CustomerSegment/controllers/Adminhtml/CustomersegmentController.php
|index d44ecac..36d3f39 100644
|--- app/code/core/Enterprise/CustomerSegment/controllers/Adminhtml/CustomersegmentController.php
|+++ app/code/core/Enterprise/CustomerSegment/controllers/Adminhtml/CustomersegmentController.php
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
1 out of 1 hunk ignored
checking file app/code/core/Mage/Admin/Model/Session.php
checking file app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Websites.php
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored
checking file app/code/core/Mage/Adminhtml/Block/Notification/Grid/Renderer/Notice.php
checking file app/code/core/Mage/Adminhtml/Block/Notification/Window.php
Reversed (or previously applied) patch detected!  Assume -R? [n] 
Apply anyway? [n] 
Skipping patch.
1 out of 1 hunk ignored
checking file app/code/core/Mage/Adminhtml/Block/Widget/Form/Container.php
checking file app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Options.php
Hunk #1 FAILED at 49.
1 out of 1 hunk FAILED
checking file app/code/core/Mage/Adminhtml/Controller/Action.php
Hunk #1 succeeded at 51 (offset 8 lines).
Hunk #2 succeeded at 169 (offset 8 lines).
Hunk #3 succeeded at 186 (offset 8 lines).
Hunk #4 succeeded at 407 with fuzz 2 (offset -37 lines).
checking file app/code/core/Mage/Adminhtml/controllers/CustomerController.php
checking file app/code/core/Mage/Adminhtml/controllers/Newsletter/QueueController.php
Hunk #1 succeeded at 63 with fuzz 2.
checking file app/code/core/Mage/Adminhtml/controllers/Newsletter/TemplateController.php
checking file app/code/core/Mage/Checkout/controllers/CartController.php
Hunk #1 FAILED at 236.
Hunk #2 succeeded at 683 with fuzz 2 (offset 262 lines).
1 out of 2 hunks FAILED
checking file app/code/core/Mage/Rss/Helper/Data.php
Hunk #1 FAILED at 34.
Hunk #2 FAILED at 60.
2 out of 2 hunks FAILED
checking file app/code/core/Mage/Sales/Model/Mysql4/Order/Item/Collection.php
Hunk #1 FAILED at 121.
1 out of 1 hunk FAILED
checking file app/code/core/Zend/Serializer/Adapter/PhpCode.php
checking file app/design/adminhtml/default/default/template/catalog/product/edit/options/type/file.phtml
Hunk #1 FAILED at 31.
1 out of 1 hunk FAILED
checking file app/design/adminhtml/default/default/template/customer/tab/view.phtml
checking file app/design/adminhtml/default/default/template/login.phtml
Hunk #1 FAILED at 55.
1 out of 1 hunk FAILED
checking file app/design/adminhtml/default/default/template/notification/toolbar.phtml
Hunk #1 FAILED at 80.
1 out of 1 hunk FAILED
checking file app/design/adminhtml/default/default/template/sales/order/view/history.phtml
checking file app/design/adminhtml/default/default/template/sales/order/view/info.phtml
Hunk #1 succeeded at 130 (offset 1 line).
checking file app/design/install/default/default/template/install/create_admin.phtml
checking file downloader/template/login.phtml
Hunk #1 succeeded at 35 (offset 1 line).

marked as duplicate by Jai, Manoj Deswal, Prince Patel, Priyank, Amit Bera Dec 5 '17 at 14:54

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Often new patches depend on previous ones so make sure that all previous patches are already installed. Another possibility is that your magento core files are overwritten – Luke Sep 15 '17 at 12:19
  • All previous patches has been applied. – dhojgaard Sep 15 '17 at 12:20
6

Magento uploaded wrong version of patch. This is Enterprise Edition Patch, just look at this:

|diff --git app/code/core/Enterprise/CustomerSegment

Patch, tried to find EE module.

  • Guess you are right – dhojgaard Sep 15 '17 at 13:34
1

Just so you know, the day the patch was released, Magento uploaded the wrong version of the patch for CE 1.9.1.1 . As you can see from the console, it has references to Enterprise files. This patch you downloaded is actually the patch for EE 1.9.1.1 (not CE).

Magento reuploaded the right patch since so I suggest you download the patch again and give it another try.

0

Your patch failed at checking file app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Options.php this file

This file also modified by SUPEE-7405

So make sure you already applied SUPEE-7405 ,SUPEE-8788, SUPEE-9767 and SUPEE-9652 before this patch

OR you have manually modified this file

in that case revert this file from fresh magento installation and apply this patch

and reapply your changes

Note: Modifying core file is not good practice always rewrite core files

  • As i write i am patching a vanilla Magento just downloaded and installed and patched with all relevant patches including SUPEE-7405,8788,9767 and 9652. And of course i have not modified the core file. I am thinking the patch is corrupted. – dhojgaard Sep 15 '17 at 13:32
  • I just got news that magento 1.9.3.5 missing three major patches please wait for 1.9.3.6 – Murtuza Zabuawala Sep 15 '17 at 13:34
  • 1.9.3.6. is out as of yesterday evening. – Icon Sep 15 '17 at 14:58
0

Fixed for Magento CE 1.9.1.1

Open .sh file and find app/code/core/Mage/Core/Model/File/Validator/Image.php

Replace code line 454-472:

OLD CODE

    diff --git app/code/core/Mage/Core/Model/File/Validator/Image.php app/code/core/Mage/Core/Model/File/Validator/Image.php
index 7f7b9d0..8a28da2 100644
--- app/code/core/Mage/Core/Model/File/Validator/Image.php
+++ app/code/core/Mage/Core/Model/File/Validator/Image.php
@@ -90,7 +90,13 @@ class Mage_Core_Model_File_Validator_Image
         $fileInfo = getimagesize($filePath);
         if (is_array($fileInfo) and isset($fileInfo[2])) {
             if ($this->isImageType($fileInfo[2])) {
-                return null;
+                /**
+                 * if 'general/reprocess_images/active' false then skip image reprocessing.
+                 * NOTE: If you turn off images reprocessing, then your upload images process may cause security risks.
+                 */
+                if (!Mage::getStoreConfigFlag('general/reprocess_images/active')) {
+                    return null;
+                }
             }
         }
         throw Mage::exception('Mage_Core', Mage::helper('core')->__('Invalid MIME type.'));

Replace with

diff --git app/code/core/Mage/Core/Model/File/Validator/Image.php app/code/core/Mage/Core/Model/File/Validator/Image.php
index 9d57202..6a939c3 100644
--- app/code/core/Mage/Core/Model/File/Validator/Image.php
+++ app/code/core/Mage/Core/Model/File/Validator/Image.php
@@ -91,6 +91,13 @@ class Mage_Core_Model_File_Validator_Image
         list($imageWidth, $imageHeight, $fileType) = getimagesize($filePath);
         if ($fileType) {
             if ($this->isImageType($fileType)) {
+                /**
+                 * if 'general/reprocess_images/active' false then skip image reprocessing.
+                 * NOTE: If you turn off images reprocessing, then your upload images process may cause security risks.
+                 */
+                if (!Mage::getStoreConfigFlag('general/reprocess_images/active')) {
+                    return null;
+                }
                 //replace tmp image with re-sampled copy to exclude images with malicious data
                 $image = imagecreatefromstring(file_get_contents($filePath));
                 if ($image !== false) {

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