summaryrefslogtreecommitdiff
path: root/Documentation/sphinx/kernel_include.py
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2025-09-01 15:21:22 +0200
committerJonathan Corbet <corbet@lwn.net>2025-09-01 07:33:59 -0600
commit118e54633ca894748f300c0f582f4ae1b6254f8d (patch)
tree7467c1d5add922e9b87fe952a5c31b7328681c74 /Documentation/sphinx/kernel_include.py
parent8dbb1779ae22e5cd84d807b7023d29791f892a02 (diff)
docs: kernel_include.py: drop some old behavior
The old behavior is not using anymore, so let's drop it. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Link: https://lore.kernel.org/r/00cdf3cbe2481aac875c543ded14b5eacfe071ec.1756732363.git.mchehab+huawei@kernel.org
Diffstat (limited to 'Documentation/sphinx/kernel_include.py')
-rwxr-xr-xDocumentation/sphinx/kernel_include.py17
1 files 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 -