Fossil SCM

Do not log the base URL in the CONFIG table when running "fossil ui".

drh 2021-07-07 13:12 trunk
Commit a965221ab24876b0a91da0f78e9abce3bb7737c1cd4d385ca7d7c170a76b8098
1 file changed +14 -1
+14 -1
--- src/main.c
+++ src/main.c
@@ -1403,11 +1403,24 @@
14031403
g.zTop = &g.zBaseURL[7+strlen(z)];
14041404
g.zHttpsURL = mprintf("https://%s%.*s", z, i, zCur);
14051405
}
14061406
fossil_free(z);
14071407
}
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 ){
14091422
int nBase = (int)strlen(g.zBaseURL);
14101423
char *zBase = g.zBaseURL;
14111424
if( g.nExtraURL>0 && g.nExtraURL<nBase-6 ){
14121425
zBase = fossil_strndup(g.zBaseURL, nBase - g.nExtraURL);
14131426
}
14141427
--- 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

Keyboard Shortcuts

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