我想应用这个生成的补丁,但patch
命令要求我输入文件路径名:
administrator@server:~$ diff -Nau /etc/php/8.1/fpm/pool.d/www.conf /etc/php/8.1/fpm/pool.d/www.NEW.conf > ~/php8.1-fpm-www.conf.patch
administrator@server:~$ sudo patch -p0 < ~/php8.1-fpm-www.conf.patch
Ignoring potentially dangerous file name /etc/php/8.1/fpm/pool.d/www.conf
Ignoring potentially dangerous file name /etc/php/8.1/fpm/pool.d/www.NEW.conf
cant find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|--- /etc/php/8.1/fpm/pool.d/www.conf 2022-09-15 13:30:49.000000000 +0200
|+++ /etc/php/8.1/fpm/pool.d/www.NEW.conf 2022-11-07 16:40:35.555078608 +0100
--------------------------
File to patch: ^C
administrator@server:~$
您需要剥离第一个组件 ,
/
并从根目录开始:GNU
patch
认为从当前目录(或由 给出的目录-d
)开始的文件名在树之外的补丁内容是不安全的(参见CVE-2010-4651)。最好使用相对路径,我建议尽可能减少路径,因为它允许补丁在不同的上下文中使用——在你的情况下,我实际上会完全跳过目录: