Fossil SCM
Add the FOSSIL_URI environment variable to the CGI extension mechanism.
Commit
7b2b9d6995fffbe236587963efd6350543f5dc0244b5ba0ad37671e5e085ebcd
Parent
115a70b2df921ce…
2 files changed
+2
+4
-1
+2
| --- src/extcgi.c | ||
| +++ src/extcgi.c | ||
| @@ -49,10 +49,11 @@ | ||
| 49 | 49 | "CONTENT_LENGTH", |
| 50 | 50 | "CONTENT_TYPE", |
| 51 | 51 | "DOCUMENT_ROOT", |
| 52 | 52 | "FOSSIL_CAPABILITIES", |
| 53 | 53 | "FOSSIL_REPOSITORY", |
| 54 | + "FOSSIL_URI", | |
| 54 | 55 | "FOSSIL_USER", |
| 55 | 56 | "GATEWAY_INTERFACE", |
| 56 | 57 | "HTTP_ACCEPT", |
| 57 | 58 | /* "HTTP_ACCEPT_ENCODING", // omitted from sub-cgi */ |
| 58 | 59 | "HTTP_COOKIE", |
| @@ -204,10 +205,11 @@ | ||
| 204 | 205 | if( g.zLogin ){ |
| 205 | 206 | cgi_replace_parameter("REMOTE_USER", g.zLogin); |
| 206 | 207 | cgi_set_parameter_nocopy("FOSSIL_USER", g.zLogin, 0); |
| 207 | 208 | } |
| 208 | 209 | cgi_set_parameter_nocopy("FOSSIL_REPOSITORY", g.zRepositoryName, 0); |
| 210 | + cgi_set_parameter_nocopy("FOSSIL_URI", g.zTop, 0); | |
| 209 | 211 | cgi_set_parameter_nocopy("FOSSIL_CAPABILITIES", |
| 210 | 212 | db_text("","SELECT fullcap(cap) FROM user WHERE login=%Q", |
| 211 | 213 | g.zLogin ? g.zLogin : "nobody"), 0); |
| 212 | 214 | cgi_replace_parameter("GATEWAY_INTERFACE","CGI/1.0"); |
| 213 | 215 | for(i=0; i<sizeof(azCgiEnv)/sizeof(azCgiEnv[0]); i++){ |
| 214 | 216 |
| --- src/extcgi.c | |
| +++ src/extcgi.c | |
| @@ -49,10 +49,11 @@ | |
| 49 | "CONTENT_LENGTH", |
| 50 | "CONTENT_TYPE", |
| 51 | "DOCUMENT_ROOT", |
| 52 | "FOSSIL_CAPABILITIES", |
| 53 | "FOSSIL_REPOSITORY", |
| 54 | "FOSSIL_USER", |
| 55 | "GATEWAY_INTERFACE", |
| 56 | "HTTP_ACCEPT", |
| 57 | /* "HTTP_ACCEPT_ENCODING", // omitted from sub-cgi */ |
| 58 | "HTTP_COOKIE", |
| @@ -204,10 +205,11 @@ | |
| 204 | if( g.zLogin ){ |
| 205 | cgi_replace_parameter("REMOTE_USER", g.zLogin); |
| 206 | cgi_set_parameter_nocopy("FOSSIL_USER", g.zLogin, 0); |
| 207 | } |
| 208 | cgi_set_parameter_nocopy("FOSSIL_REPOSITORY", g.zRepositoryName, 0); |
| 209 | cgi_set_parameter_nocopy("FOSSIL_CAPABILITIES", |
| 210 | db_text("","SELECT fullcap(cap) FROM user WHERE login=%Q", |
| 211 | g.zLogin ? g.zLogin : "nobody"), 0); |
| 212 | cgi_replace_parameter("GATEWAY_INTERFACE","CGI/1.0"); |
| 213 | for(i=0; i<sizeof(azCgiEnv)/sizeof(azCgiEnv[0]); i++){ |
| 214 |
| --- src/extcgi.c | |
| +++ src/extcgi.c | |
| @@ -49,10 +49,11 @@ | |
| 49 | "CONTENT_LENGTH", |
| 50 | "CONTENT_TYPE", |
| 51 | "DOCUMENT_ROOT", |
| 52 | "FOSSIL_CAPABILITIES", |
| 53 | "FOSSIL_REPOSITORY", |
| 54 | "FOSSIL_URI", |
| 55 | "FOSSIL_USER", |
| 56 | "GATEWAY_INTERFACE", |
| 57 | "HTTP_ACCEPT", |
| 58 | /* "HTTP_ACCEPT_ENCODING", // omitted from sub-cgi */ |
| 59 | "HTTP_COOKIE", |
| @@ -204,10 +205,11 @@ | |
| 205 | if( g.zLogin ){ |
| 206 | cgi_replace_parameter("REMOTE_USER", g.zLogin); |
| 207 | cgi_set_parameter_nocopy("FOSSIL_USER", g.zLogin, 0); |
| 208 | } |
| 209 | cgi_set_parameter_nocopy("FOSSIL_REPOSITORY", g.zRepositoryName, 0); |
| 210 | cgi_set_parameter_nocopy("FOSSIL_URI", g.zTop, 0); |
| 211 | cgi_set_parameter_nocopy("FOSSIL_CAPABILITIES", |
| 212 | db_text("","SELECT fullcap(cap) FROM user WHERE login=%Q", |
| 213 | g.zLogin ? g.zLogin : "nobody"), 0); |
| 214 | cgi_replace_parameter("GATEWAY_INTERFACE","CGI/1.0"); |
| 215 | for(i=0; i<sizeof(azCgiEnv)/sizeof(azCgiEnv[0]); i++){ |
| 216 |
+4
-1
| --- www/serverext.wiki | ||
| +++ www/serverext.wiki | ||
| @@ -162,19 +162,22 @@ | ||
| 162 | 162 | In addition to the standard CGI environment variables listed above, |
| 163 | 163 | Fossil adds the following: |
| 164 | 164 | |
| 165 | 165 | * FOSSIL_CAPABILITIES |
| 166 | 166 | * FOSSIL_REPOSITORY |
| 167 | + * FOSSIL_URI | |
| 167 | 168 | * FOSSIL_USER |
| 168 | 169 | |
| 169 | 170 | The FOSSIL_USER string is the name of the logged-in user. This variable |
| 170 | 171 | is missing or is an empty string if the user is not logged in. The |
| 171 | 172 | FOSSIL_CAPABILITIES string is a list of |
| 172 | 173 | [/setup_ulist_notes|Fossil capability letters] that |
| 173 | 174 | indicate what permissions the user has on the Fossil repository. |
| 174 | 175 | The FOSSIL_REPOSITORY environment variable gives the filename of the |
| 175 | -Fossil repository that is running. | |
| 176 | +Fossil repository that is running. The FOSSIL_URI variable shows the | |
| 177 | +prefix of the REQUEST_URI that is the Fossil CGI script, or is an | |
| 178 | +empty string if Fossil is being run by some method other than CGI. | |
| 176 | 179 | |
| 177 | 180 | The [https://sqlite.org/src/ext/checklist|checklist application] uses the |
| 178 | 181 | FOSSIL_USER environment variable to determine the name of the user and |
| 179 | 182 | the FOSSIL_CAPABILITIES variable to determine if the user is allowed to |
| 180 | 183 | mark off changes to the checklist. Only users with check-in permission |
| 181 | 184 |
| --- www/serverext.wiki | |
| +++ www/serverext.wiki | |
| @@ -162,19 +162,22 @@ | |
| 162 | In addition to the standard CGI environment variables listed above, |
| 163 | Fossil adds the following: |
| 164 | |
| 165 | * FOSSIL_CAPABILITIES |
| 166 | * FOSSIL_REPOSITORY |
| 167 | * FOSSIL_USER |
| 168 | |
| 169 | The FOSSIL_USER string is the name of the logged-in user. This variable |
| 170 | is missing or is an empty string if the user is not logged in. The |
| 171 | FOSSIL_CAPABILITIES string is a list of |
| 172 | [/setup_ulist_notes|Fossil capability letters] that |
| 173 | indicate what permissions the user has on the Fossil repository. |
| 174 | The FOSSIL_REPOSITORY environment variable gives the filename of the |
| 175 | Fossil repository that is running. |
| 176 | |
| 177 | The [https://sqlite.org/src/ext/checklist|checklist application] uses the |
| 178 | FOSSIL_USER environment variable to determine the name of the user and |
| 179 | the FOSSIL_CAPABILITIES variable to determine if the user is allowed to |
| 180 | mark off changes to the checklist. Only users with check-in permission |
| 181 |
| --- www/serverext.wiki | |
| +++ www/serverext.wiki | |
| @@ -162,19 +162,22 @@ | |
| 162 | In addition to the standard CGI environment variables listed above, |
| 163 | Fossil adds the following: |
| 164 | |
| 165 | * FOSSIL_CAPABILITIES |
| 166 | * FOSSIL_REPOSITORY |
| 167 | * FOSSIL_URI |
| 168 | * FOSSIL_USER |
| 169 | |
| 170 | The FOSSIL_USER string is the name of the logged-in user. This variable |
| 171 | is missing or is an empty string if the user is not logged in. The |
| 172 | FOSSIL_CAPABILITIES string is a list of |
| 173 | [/setup_ulist_notes|Fossil capability letters] that |
| 174 | indicate what permissions the user has on the Fossil repository. |
| 175 | The FOSSIL_REPOSITORY environment variable gives the filename of the |
| 176 | Fossil repository that is running. The FOSSIL_URI variable shows the |
| 177 | prefix of the REQUEST_URI that is the Fossil CGI script, or is an |
| 178 | empty string if Fossil is being run by some method other than CGI. |
| 179 | |
| 180 | The [https://sqlite.org/src/ext/checklist|checklist application] uses the |
| 181 | FOSSIL_USER environment variable to determine the name of the user and |
| 182 | the FOSSIL_CAPABILITIES variable to determine if the user is allowed to |
| 183 | mark off changes to the checklist. Only users with check-in permission |
| 184 |