Fossil SCM
Do not log the base URL in the CONFIG table when running "fossil ui".
Commit
a965221ab24876b0a91da0f78e9abce3bb7737c1cd4d385ca7d7c170a76b8098
Parent
71499f138612c09…
1 file changed
+14
-1
+14
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -1403,11 +1403,24 @@ | ||
| 1403 | 1403 | g.zTop = &g.zBaseURL[7+strlen(z)]; |
| 1404 | 1404 | g.zHttpsURL = mprintf("https://%s%.*s", z, i, zCur); |
| 1405 | 1405 | } |
| 1406 | 1406 | fossil_free(z); |
| 1407 | 1407 | } |
| 1408 | - if( db_is_writeable("repository") ){ | |
| 1408 | + | |
| 1409 | + /* Try to record the base URL as a CONFIG table entry with a name | |
| 1410 | + ** of the form: "baseurl:BASE". This keeps a record of how the | |
| 1411 | + ** the repository is used as a server, to help in answering questions | |
| 1412 | + ** like "where is the CGI script that references this repository?" | |
| 1413 | + ** | |
| 1414 | + ** This is just a logging hint. So don't worry if it cannot be done. | |
| 1415 | + ** Don't try this if the repository database is not writable, for | |
| 1416 | + ** example. | |
| 1417 | + ** | |
| 1418 | + ** If g.useLocalauth is set, that (probably) means that we are running | |
| 1419 | + ** "fossil ui" and there is no point in logging those cases either. | |
| 1420 | + */ | |
| 1421 | + if( db_is_writeable("repository") && !g.useLocalauth ){ | |
| 1409 | 1422 | int nBase = (int)strlen(g.zBaseURL); |
| 1410 | 1423 | char *zBase = g.zBaseURL; |
| 1411 | 1424 | if( g.nExtraURL>0 && g.nExtraURL<nBase-6 ){ |
| 1412 | 1425 | zBase = fossil_strndup(g.zBaseURL, nBase - g.nExtraURL); |
| 1413 | 1426 | } |
| 1414 | 1427 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1403,11 +1403,24 @@ | |
| 1403 | g.zTop = &g.zBaseURL[7+strlen(z)]; |
| 1404 | g.zHttpsURL = mprintf("https://%s%.*s", z, i, zCur); |
| 1405 | } |
| 1406 | fossil_free(z); |
| 1407 | } |
| 1408 | if( db_is_writeable("repository") ){ |
| 1409 | int nBase = (int)strlen(g.zBaseURL); |
| 1410 | char *zBase = g.zBaseURL; |
| 1411 | if( g.nExtraURL>0 && g.nExtraURL<nBase-6 ){ |
| 1412 | zBase = fossil_strndup(g.zBaseURL, nBase - g.nExtraURL); |
| 1413 | } |
| 1414 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -1403,11 +1403,24 @@ | |
| 1403 | g.zTop = &g.zBaseURL[7+strlen(z)]; |
| 1404 | g.zHttpsURL = mprintf("https://%s%.*s", z, i, zCur); |
| 1405 | } |
| 1406 | fossil_free(z); |
| 1407 | } |
| 1408 | |
| 1409 | /* Try to record the base URL as a CONFIG table entry with a name |
| 1410 | ** of the form: "baseurl:BASE". This keeps a record of how the |
| 1411 | ** the repository is used as a server, to help in answering questions |
| 1412 | ** like "where is the CGI script that references this repository?" |
| 1413 | ** |
| 1414 | ** This is just a logging hint. So don't worry if it cannot be done. |
| 1415 | ** Don't try this if the repository database is not writable, for |
| 1416 | ** example. |
| 1417 | ** |
| 1418 | ** If g.useLocalauth is set, that (probably) means that we are running |
| 1419 | ** "fossil ui" and there is no point in logging those cases either. |
| 1420 | */ |
| 1421 | if( db_is_writeable("repository") && !g.useLocalauth ){ |
| 1422 | int nBase = (int)strlen(g.zBaseURL); |
| 1423 | char *zBase = g.zBaseURL; |
| 1424 | if( g.nExtraURL>0 && g.nExtraURL<nBase-6 ){ |
| 1425 | zBase = fossil_strndup(g.zBaseURL, nBase - g.nExtraURL); |
| 1426 | } |
| 1427 |