2017-05-31 66 views
-1

我試圖修補Nginx的源代碼,但它不斷給我這個錯誤無法修補的nginx源(找不到文件,補丁)

[[email protected] nginx-1.2.6]# patch -p0 < 0004-Accept-variable-name-as-upload_limit_rate-argument.patch 
can't find file to patch at input line 14 
Perhaps you used the wrong -p or --strip option? 
The text leading up to this was: 
-------------------------- 
|From 8f4cad171fe4fed9cbd11a6a10fb4880e49bf9f6 Mon Sep 17 00:00:00 2001 
|From: Valentin Dudouyt <[email protected]> 
|Date: Fri, 12 Feb 2016 11:28:56 +0600 
|Subject: [PATCH] Accept variable name as upload_limit_rate argument 
| 
|--- 
| ngx_http_upload_module.c | 27 +++++++++++++++++---------- 
| 1 file changed, 17 insertions(+), 10 deletions(-) 
| 
|diff --git a/ngx_http_upload_module.c b/ngx_http_upload_module.c 
|index 93ded70..6bd5027 100644 
|--- a/ngx_http_upload_module.c 
|+++ b/ngx_http_upload_module.c 
-------------------------- 
File to patch: 
Skip this patch? [y] 
Skipping patch. 
7 out of 7 hunks ignored 

爲什麼我收到此錯誤

回答

1
  1. 你想補丁文件是nginx模塊的一部分(nginx-upload-module),不是nginx本身的一部分。除非你把它放在那裏,否則它不會存在於nginx源代碼中。

  2. 您嘗試修補的nginx版本很古老。當前版本是1.12; 1.2分支最後在2013年更新(1.2.9),甚至在那裏它缺少了幾個重要的安全發佈。

  3. nginx-upload-module已死亡。項目的最後一次提交是在2008年(9年前!!),並且該模塊與當前版本的nginx不兼容。

+0

謝謝duskwuff發現我的錯誤,我把ngx-http-upload-module放在worng目錄下 –

0

好修補程序中引用的文件不在預期的位置。 對我來說,補丁正在尋找ngx_http_upload_module.c。 -p0通知修補程序在當前工作目錄中查找此文件。

首先你要搞清楚在哪裏打補丁這是應該的文件,然後要麼進入該目錄或調整-p參數