From 4dcf39ab51efec5eedaa9abce111b035952d0548 Mon Sep 17 00:00:00 2001
From: Eric Covener <covener@apache.org>
Date: Mon, 1 Dec 2025 12:06:46 +0000
Subject: [PATCH] Merge r1930164 from trunk:

don't use request notes for suexec

also, stop accepting the obscure "note" option in
RequestHeader, it is only documented/described as being
meant for Header (output filter).




git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1930168 13f79535-47bb-0310-9956-ffa450edef68
---
 modules/mappers/mod_userdir.c  | 4 ++--
 modules/metadata/mod_headers.c | 6 +++++-
 2 files changed, 7 insertions(+), 3 deletions(-)

Index: apache2-2.4.29/modules/mappers/mod_userdir.c
===================================================================
--- apache2-2.4.29.orig/modules/mappers/mod_userdir.c	2026-05-20 18:25:55.970998710 +0100
+++ apache2-2.4.29/modules/mappers/mod_userdir.c	2026-05-20 18:25:55.955998678 +0100
@@ -334,7 +334,7 @@
                 r->finfo = statbuf;
 
             /* For use in the get_suexec_identity phase */
-            apr_table_setn(r->notes, "mod_userdir_user", user);
+            ap_set_module_config(r->request_config, &userdir_module, (void *)user);
 
             return OK;
         }
@@ -348,7 +348,7 @@
 {
     ap_unix_identity_t *ugid = NULL;
 #if APR_HAS_USER
-    const char *username = apr_table_get(r->notes, "mod_userdir_user");
+    const char *username = (const char*) ap_get_module_config(r->request_config, &userdir_module);
 
     if (username == NULL) {
         return NULL;
Index: apache2-2.4.29/modules/metadata/mod_headers.c
===================================================================
--- apache2-2.4.29.orig/modules/metadata/mod_headers.c	2026-05-20 18:25:55.970998710 +0100
+++ apache2-2.4.29/modules/metadata/mod_headers.c	2026-05-20 18:25:55.956998681 +0100
@@ -464,8 +464,12 @@
         new->action = hdr_edit;
     else if (!strcasecmp(action, "edit*"))
         new->action = hdr_edit_r;
-    else if (!strcasecmp(action, "note"))
+    else if (!strcasecmp(action, "note")) {
+        if (cmd->info == &hdr_in) {
+            return "RequestHeader does not support the 'note' action";
+        }
         new->action = hdr_note;
+    }
     else
         return "first argument must be 'add', 'set', 'setifempty', 'append', 'merge', "
                "'unset', 'echo', 'note', 'edit', or 'edit*'.";
