mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Jonathan Corbet <corbet@lwn.net>,
	Linux Doc Mailing List <linux-doc@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	Kees Cook <mchehab+huawei@kernel.org>,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] docs: kernel_include.py: drop some old behavior
Date: Mon,  1 Sep 2025 15:21:22 +0200	[thread overview]
Message-ID: <00cdf3cbe2481aac875c543ded14b5eacfe071ec.1756732363.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1756732363.git.mchehab+huawei@kernel.org>

The old behavior is not using anymore, so let's drop it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 Documentation/sphinx/kernel_include.py | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/Documentation/sphinx/kernel_include.py b/Documentation/sphinx/kernel_include.py
index 661ed978bed8..2c4bb8215b4c 100755
--- a/Documentation/sphinx/kernel_include.py
+++ b/Documentation/sphinx/kernel_include.py
@@ -316,11 +316,9 @@ class KernelInclude(Directive):
         env = self.state.document.settings.env
 
         #
-        # The include logic accepts only patches relative to:
-        #   - Kernel source tree
-        #   - Documentation output directory
-        #
-        # The logic does check it to prevent directory traverse
+        # The include logic accepts only patches relative to the
+        # Kernel source tree.  The logic does check it to prevent
+        # directory traverse issues.
         #
 
         srctree = os.path.abspath(os.environ["srctree"])
@@ -331,10 +329,6 @@ class KernelInclude(Directive):
         if os.path.isfile(src_path):
             base = srctree
             path = src_path
-        elif os.path.exists(arg):
-            # Allow patches from output dir
-            base = os.getcwd()
-            path = os.path.abspath(path)
         else:
             raise self.warning(f'File "%s" doesn\'t exist', path)
 
@@ -359,11 +353,6 @@ class KernelInclude(Directive):
 
         env.note_dependency(os.path.abspath(path))
 
-        # HINT: I had to copy&paste the whole Include.run method. I'am not happy
-        # with this, but due to security reasons, the Include.run method does
-        # not allow absolute or relative pathnames pointing to locations *above*
-        # the filesystem tree where the reST document is placed.
-
         if not self.state.document.settings.file_insertion_enabled:
             raise self.warning('"%s" directive disabled.' % self.name)
         source = self.state_machine.input_lines.source(self.lineno -
-- 
2.51.0


      parent reply	other threads:[~2025-09-01 13:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-01 13:21 [PATCH 0/2] kernel_include.py: fix a regression on linux-next Mauro Carvalho Chehab
2025-09-01 13:21 ` [PATCH 1/2] docs: kernel_include.py: fix an issue when O= is used Mauro Carvalho Chehab
2025-09-01 13:21 ` Mauro Carvalho Chehab [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=00cdf3cbe2481aac875c543ded14b5eacfe071ec.1756732363.git.mchehab+huawei@kernel.org \
    --to=mchehab+huawei@kernel.org \
    --cc=corbet@lwn.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®