Fossil SCM

Get the repolist mechanism working on windows. Make sure repolist is disabled (except for the "ui" command) without the --repolist option.

drh 2015-02-20 15:57 trunk
Commit d976b474e9d0815dd2d4ddb009965cce8a6934ca
+1
--- src/cgi.c
+++ src/cgi.c
@@ -1680,10 +1680,11 @@
16801680
*/
16811681
#define HTTP_SERVER_LOCALHOST 0x0001 /* Bind to 127.0.0.1 only */
16821682
#define HTTP_SERVER_SCGI 0x0002 /* SCGI instead of HTTP */
16831683
#define HTTP_SERVER_HAD_REPOSITORY 0x0004 /* Was the repository open? */
16841684
#define HTTP_SERVER_HAD_CHECKOUT 0x0008 /* Was a checkout open? */
1685
+#define HTTP_SERVER_REPOLIST 0x0010 /* Allow repo listing */
16851686
16861687
#endif /* INTERFACE */
16871688
16881689
/*
16891690
** Maximum number of child processes that we can have running
16901691
--- src/cgi.c
+++ src/cgi.c
@@ -1680,10 +1680,11 @@
1680 */
1681 #define HTTP_SERVER_LOCALHOST 0x0001 /* Bind to 127.0.0.1 only */
1682 #define HTTP_SERVER_SCGI 0x0002 /* SCGI instead of HTTP */
1683 #define HTTP_SERVER_HAD_REPOSITORY 0x0004 /* Was the repository open? */
1684 #define HTTP_SERVER_HAD_CHECKOUT 0x0008 /* Was a checkout open? */
 
1685
1686 #endif /* INTERFACE */
1687
1688 /*
1689 ** Maximum number of child processes that we can have running
1690
--- src/cgi.c
+++ src/cgi.c
@@ -1680,10 +1680,11 @@
1680 */
1681 #define HTTP_SERVER_LOCALHOST 0x0001 /* Bind to 127.0.0.1 only */
1682 #define HTTP_SERVER_SCGI 0x0002 /* SCGI instead of HTTP */
1683 #define HTTP_SERVER_HAD_REPOSITORY 0x0004 /* Was the repository open? */
1684 #define HTTP_SERVER_HAD_CHECKOUT 0x0008 /* Was a checkout open? */
1685 #define HTTP_SERVER_REPOLIST 0x0010 /* Allow repo listing */
1686
1687 #endif /* INTERFACE */
1688
1689 /*
1690 ** Maximum number of child processes that we can have running
1691
+6 -5
--- src/main.c
+++ src/main.c
@@ -1548,11 +1548,13 @@
15481548
15491549
if( szFile<1024 ){
15501550
set_base_url(0);
15511551
if( zNotFound ){
15521552
cgi_redirect(zNotFound);
1553
- }else if( strcmp(zPathInfo,"/")==0 && repo_list_page() ){
1553
+ }else if( strcmp(zPathInfo,"/")==0
1554
+ && allowRepoList
1555
+ && repo_list_page() ){
15541556
/* Will return a list of repositories */
15551557
}else{
15561558
#ifdef FOSSIL_ENABLE_JSON
15571559
if(g.json.isJsonMode){
15581560
json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,1);
@@ -2264,13 +2266,12 @@
22642266
**
22652267
** By default, the "ui" command provides full administrative access without
22662268
** having to log in. This can be disabled by turning off the "localauth"
22672269
** setting. Automatic login for the "server" command is available if the
22682270
** --localauth option is present and the "localauth" setting is off and the
2269
-** connection is from localhost. The optional REPOSITORY argument to "ui"
2270
-** may be a directory and will function as "server" if and only if the
2271
-** --notfound option is used.
2271
+** connection is from localhost. The "ui" command also enables --repolist
2272
+** by default.
22722273
**
22732274
** Options:
22742275
** --baseurl URL Use URL as the base (useful for reverse proxies)
22752276
** --files GLOBLIST Comma-separated list of glob patterns for static files
22762277
** --localauth enable automatic login for requests from localhost
@@ -2337,11 +2338,11 @@
23372338
verify_all_options();
23382339
23392340
if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?");
23402341
isUiCmd = g.argv[1][0]=='u';
23412342
if( isUiCmd ){
2342
- flags |= HTTP_SERVER_LOCALHOST;
2343
+ flags |= HTTP_SERVER_LOCALHOST|HTTP_SERVER_REPOLIST;
23432344
g.useLocalauth = 1;
23442345
allowRepoList = 1;
23452346
}
23462347
find_server_repository(2);
23472348
if( zPort ){
23482349
--- src/main.c
+++ src/main.c
@@ -1548,11 +1548,13 @@
1548
1549 if( szFile<1024 ){
1550 set_base_url(0);
1551 if( zNotFound ){
1552 cgi_redirect(zNotFound);
1553 }else if( strcmp(zPathInfo,"/")==0 && repo_list_page() ){
 
 
1554 /* Will return a list of repositories */
1555 }else{
1556 #ifdef FOSSIL_ENABLE_JSON
1557 if(g.json.isJsonMode){
1558 json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,1);
@@ -2264,13 +2266,12 @@
2264 **
2265 ** By default, the "ui" command provides full administrative access without
2266 ** having to log in. This can be disabled by turning off the "localauth"
2267 ** setting. Automatic login for the "server" command is available if the
2268 ** --localauth option is present and the "localauth" setting is off and the
2269 ** connection is from localhost. The optional REPOSITORY argument to "ui"
2270 ** may be a directory and will function as "server" if and only if the
2271 ** --notfound option is used.
2272 **
2273 ** Options:
2274 ** --baseurl URL Use URL as the base (useful for reverse proxies)
2275 ** --files GLOBLIST Comma-separated list of glob patterns for static files
2276 ** --localauth enable automatic login for requests from localhost
@@ -2337,11 +2338,11 @@
2337 verify_all_options();
2338
2339 if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?");
2340 isUiCmd = g.argv[1][0]=='u';
2341 if( isUiCmd ){
2342 flags |= HTTP_SERVER_LOCALHOST;
2343 g.useLocalauth = 1;
2344 allowRepoList = 1;
2345 }
2346 find_server_repository(2);
2347 if( zPort ){
2348
--- src/main.c
+++ src/main.c
@@ -1548,11 +1548,13 @@
1548
1549 if( szFile<1024 ){
1550 set_base_url(0);
1551 if( zNotFound ){
1552 cgi_redirect(zNotFound);
1553 }else if( strcmp(zPathInfo,"/")==0
1554 && allowRepoList
1555 && repo_list_page() ){
1556 /* Will return a list of repositories */
1557 }else{
1558 #ifdef FOSSIL_ENABLE_JSON
1559 if(g.json.isJsonMode){
1560 json_err(FSL_JSON_E_RESOURCE_NOT_FOUND,NULL,1);
@@ -2264,13 +2266,12 @@
2266 **
2267 ** By default, the "ui" command provides full administrative access without
2268 ** having to log in. This can be disabled by turning off the "localauth"
2269 ** setting. Automatic login for the "server" command is available if the
2270 ** --localauth option is present and the "localauth" setting is off and the
2271 ** connection is from localhost. The "ui" command also enables --repolist
2272 ** by default.
 
2273 **
2274 ** Options:
2275 ** --baseurl URL Use URL as the base (useful for reverse proxies)
2276 ** --files GLOBLIST Comma-separated list of glob patterns for static files
2277 ** --localauth enable automatic login for requests from localhost
@@ -2337,11 +2338,11 @@
2338 verify_all_options();
2339
2340 if( g.argc!=2 && g.argc!=3 ) usage("?REPOSITORY?");
2341 isUiCmd = g.argv[1][0]=='u';
2342 if( isUiCmd ){
2343 flags |= HTTP_SERVER_LOCALHOST|HTTP_SERVER_REPOLIST;
2344 g.useLocalauth = 1;
2345 allowRepoList = 1;
2346 }
2347 find_server_repository(2);
2348 if( zPort ){
2349
--- src/winhttp.c
+++ src/winhttp.c
@@ -260,10 +260,13 @@
260260
blob_appendf(&options, " --files-urlenc %T", zFileGlob);
261261
}
262262
if( g.useLocalauth ){
263263
blob_appendf(&options, " --localauth");
264264
}
265
+ if( flags & HTTP_SERVER_REPOLIST ){
266
+ blob_appendf(&options, " --repolist");
267
+ }
265268
if( WSAStartup(MAKEWORD(1,1), &wd) ){
266269
fossil_fatal("unable to initialize winsock");
267270
}
268271
while( iPort<=mxPort ){
269272
s = socket(AF_INET, SOCK_STREAM, 0);
270273
--- src/winhttp.c
+++ src/winhttp.c
@@ -260,10 +260,13 @@
260 blob_appendf(&options, " --files-urlenc %T", zFileGlob);
261 }
262 if( g.useLocalauth ){
263 blob_appendf(&options, " --localauth");
264 }
 
 
 
265 if( WSAStartup(MAKEWORD(1,1), &wd) ){
266 fossil_fatal("unable to initialize winsock");
267 }
268 while( iPort<=mxPort ){
269 s = socket(AF_INET, SOCK_STREAM, 0);
270
--- src/winhttp.c
+++ src/winhttp.c
@@ -260,10 +260,13 @@
260 blob_appendf(&options, " --files-urlenc %T", zFileGlob);
261 }
262 if( g.useLocalauth ){
263 blob_appendf(&options, " --localauth");
264 }
265 if( flags & HTTP_SERVER_REPOLIST ){
266 blob_appendf(&options, " --repolist");
267 }
268 if( WSAStartup(MAKEWORD(1,1), &wd) ){
269 fossil_fatal("unable to initialize winsock");
270 }
271 while( iPort<=mxPort ){
272 s = socket(AF_INET, SOCK_STREAM, 0);
273

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button