Fossil SCM

Show the OpenSSL version and the SERVER_SOFTWARE to administrators on the /stat page.

drh 2022-05-11 11:50 trunk
Commit bb09ff84ae8a2982a2c109749841aebf0f80538c7eb8d9e921a0fd9305deef1c
2 files changed +14 +8
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -1178,5 +1178,19 @@
11781178
wellknown_notfound:
11791179
fossil_free(zPath);
11801180
webpage_notfound_error(0);
11811181
return;
11821182
}
1183
+
1184
+/*
1185
+** Return the OpenSSL version number being used. Space to hold
1186
+** this name is obtained from fossil_malloc() and should be
1187
+** freed by the caller.
1188
+*/
1189
+char *fossil_openssl_version(void){
1190
+#if defined(FOSSIL_ENABLE_SSL)
1191
+ return mprintf("%s (0x%09x)\n",
1192
+ SSLeay_version(SSLEAY_VERSION), OPENSSL_VERSION_NUMBER);
1193
+#else
1194
+ return mprintf("none");
1195
+#endif
1196
+}
11831197
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -1178,5 +1178,19 @@
1178 wellknown_notfound:
1179 fossil_free(zPath);
1180 webpage_notfound_error(0);
1181 return;
1182 }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1183
--- src/http_ssl.c
+++ src/http_ssl.c
@@ -1178,5 +1178,19 @@
1178 wellknown_notfound:
1179 fossil_free(zPath);
1180 webpage_notfound_error(0);
1181 return;
1182 }
1183
1184 /*
1185 ** Return the OpenSSL version number being used. Space to hold
1186 ** this name is obtained from fossil_malloc() and should be
1187 ** freed by the caller.
1188 */
1189 char *fossil_openssl_version(void){
1190 #if defined(FOSSIL_ENABLE_SSL)
1191 return mprintf("%s (0x%09x)\n",
1192 SSLeay_version(SSLEAY_VERSION), OPENSSL_VERSION_NUMBER);
1193 #else
1194 return mprintf("none");
1195 #endif
1196 }
1197
+8
--- src/stat.c
+++ src/stat.c
@@ -280,10 +280,18 @@
280280
@ (%h(RELEASE_VERSION)) <a href='version?verbose'>(details)</a>
281281
@ </td></tr>
282282
@ <tr><th>SQLite&nbsp;Version:</th><td>%.19s(sqlite3_sourceid())
283283
@ [%.10s(&sqlite3_sourceid()[20])] (%s(sqlite3_libversion()))
284284
@ <a href='version?verbose'>(details)</a></td></tr>
285
+ if( g.perm.Admin ){
286
+ const char *zCgi = P("SERVER_SOFTWARE");
287
+ @ <tr><th>OpenSSL&nbsp;Version:</th>
288
+ @ <td>%z(fossil_openssl_version())</td></tr>
289
+ if( zCgi ){
290
+ @ <tr><th>Web&nbsp;Server:</th><td>%s(zCgi)</td></tr>
291
+ }
292
+ }
285293
if( g.eHashPolicy!=HPOLICY_AUTO ){
286294
@ <tr><th>Schema&nbsp;Version:</th><td>%h(g.zAuxSchema),
287295
@ %s(hpolicy_name())</td></tr>
288296
}else{
289297
@ <tr><th>Schema&nbsp;Version:</th><td>%h(g.zAuxSchema)</td></tr>
290298
--- src/stat.c
+++ src/stat.c
@@ -280,10 +280,18 @@
280 @ (%h(RELEASE_VERSION)) <a href='version?verbose'>(details)</a>
281 @ </td></tr>
282 @ <tr><th>SQLite&nbsp;Version:</th><td>%.19s(sqlite3_sourceid())
283 @ [%.10s(&sqlite3_sourceid()[20])] (%s(sqlite3_libversion()))
284 @ <a href='version?verbose'>(details)</a></td></tr>
 
 
 
 
 
 
 
 
285 if( g.eHashPolicy!=HPOLICY_AUTO ){
286 @ <tr><th>Schema&nbsp;Version:</th><td>%h(g.zAuxSchema),
287 @ %s(hpolicy_name())</td></tr>
288 }else{
289 @ <tr><th>Schema&nbsp;Version:</th><td>%h(g.zAuxSchema)</td></tr>
290
--- src/stat.c
+++ src/stat.c
@@ -280,10 +280,18 @@
280 @ (%h(RELEASE_VERSION)) <a href='version?verbose'>(details)</a>
281 @ </td></tr>
282 @ <tr><th>SQLite&nbsp;Version:</th><td>%.19s(sqlite3_sourceid())
283 @ [%.10s(&sqlite3_sourceid()[20])] (%s(sqlite3_libversion()))
284 @ <a href='version?verbose'>(details)</a></td></tr>
285 if( g.perm.Admin ){
286 const char *zCgi = P("SERVER_SOFTWARE");
287 @ <tr><th>OpenSSL&nbsp;Version:</th>
288 @ <td>%z(fossil_openssl_version())</td></tr>
289 if( zCgi ){
290 @ <tr><th>Web&nbsp;Server:</th><td>%s(zCgi)</td></tr>
291 }
292 }
293 if( g.eHashPolicy!=HPOLICY_AUTO ){
294 @ <tr><th>Schema&nbsp;Version:</th><td>%h(g.zAuxSchema),
295 @ %s(hpolicy_name())</td></tr>
296 }else{
297 @ <tr><th>Schema&nbsp;Version:</th><td>%h(g.zAuxSchema)</td></tr>
298

Keyboard Shortcuts

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