summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Fritsch <sf@apache.org>2010-12-30 13:00:36 +0000
committerStefan Fritsch <sf@apache.org>2010-12-30 13:00:36 +0000
commitd489f13739874db6aa65d8a9d0b1367aa2942e31 (patch)
treeeeabc6a30ed8cc38657cb19195ebccadd02b0ee5
parent6c6979ede6d856855c854119673ec40f40a7c0c7 (diff)
downloadhttpd-d489f13739874db6aa65d8a9d0b1367aa2942e31.tar.gz
Add mod_rewrite's SCRIPT_USER/SCRIPT_GROUP vars to ap_expr
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1053882 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--docs/manual/expr.html.en4
-rw-r--r--docs/manual/expr.xml4
-rw-r--r--server/util_expr_eval.c16
3 files changed, 24 insertions, 0 deletions
diff --git a/docs/manual/expr.html.en b/docs/manual/expr.html.en
index 919c109fae..e8d91f9c34 100644
--- a/docs/manual/expr.html.en
+++ b/docs/manual/expr.html.en
@@ -143,6 +143,10 @@ listfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>"
<td /></tr>
<tr><td><code>SCRIPT_FILENAME</code></td>
<td>Same as <code>REQUEST_FILENAME</code></td></tr>
+<tr class="odd"><td><code>SCRIPT_USER</code></td>
+ <td>The user name of the owner of the script.</td></tr>
+<tr><td><code>SCRIPT_GROUP</code></td>
+ <td>The group name of the group of the script.</td></tr>
<tr class="odd"><td><code>PATH_INFO</code></td>
<td /></tr>
<tr><td><code>QUERY_STRING</code></td>
diff --git a/docs/manual/expr.xml b/docs/manual/expr.xml
index e3096d7f52..31809be405 100644
--- a/docs/manual/expr.xml
+++ b/docs/manual/expr.xml
@@ -146,6 +146,10 @@ listfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>"
<td></td></tr>
<tr><td><code>SCRIPT_FILENAME</code></td>
<td>Same as <code>REQUEST_FILENAME</code></td></tr>
+ <tr><td><code>SCRIPT_USER</code></td>
+ <td>The user name of the owner of the script.</td></tr>
+ <tr><td><code>SCRIPT_GROUP</code></td>
+ <td>The group name of the group of the script.</td></tr>
<tr><td><code>PATH_INFO</code></td>
<td></td></tr>
<tr><td><code>QUERY_STRING</code></td>
diff --git a/server/util_expr_eval.c b/server/util_expr_eval.c
index ba0df24060..06d0b8fc11 100644
--- a/server/util_expr_eval.c
+++ b/server/util_expr_eval.c
@@ -956,6 +956,8 @@ static const char *request_var_names[] = {
"CONTENT_TYPE", /* 18 */
"HANDLER", /* 19 */
"REQUEST_LOG_ID", /* 20 */
+ "SCRIPT_USER", /* 21 */
+ "SCRIPT_GROUP", /* 22 */
NULL
};
@@ -1010,6 +1012,20 @@ static const char *request_var_fn(ap_expr_eval_ctx_t *ctx, const void *data)
return r->handler;
case 20:
return r->log_id;
+ case 21:
+ {
+ char *result = "";
+ if (r->finfo.valid & APR_FINFO_USER)
+ apr_uid_name_get(&result, r->finfo.user, ctx->p);
+ return result;
+ }
+ case 22:
+ {
+ char *result = "";
+ if (r->finfo.valid & APR_FINFO_USER)
+ apr_gid_name_get(&result, r->finfo.group, ctx->p);
+ return result;
+ }
default:
ap_assert(0);
return NULL;