Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Omit the /paniclog, /hacklog, and /logsummary pages. All those capabilities are now combined into the /errorlog page. |
|---|---|
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
2304fb87ac93f4fc700f25722454e4d9 |
| User & Date: | drh 2025-03-17 11:38:29.501 |
Context
|
2025-03-17
| ||
| 11:40 | Remove an unused variable in the previous check-in. check-in: d23912f089 user: drh tags: trunk | |
| 11:38 | Omit the /paniclog, /hacklog, and /logsummary pages. All those capabilities are now combined into the /errorlog page. check-in: 2304fb87ac user: drh tags: trunk | |
|
2025-03-16
| ||
| 22:49 | Improved help for the "test-which" command, explaining why it is retained even though we now have a "which" command without the "test-" prefix. check-in: b3f270ffd6 user: drh tags: trunk | |
Changes
Changes to src/security_audit.c.
| ︙ | ︙ | |||
802 803 804 805 806 807 808 |
@ <blockquote><pre>
@ errorlog: <i>FILENAME</i>
@ </pre></blockquote>
blob_reset(&fullname);
}
}
| < < < < < > > > > > > > > > > > > > > > > > > > > > > > > > > | < > | 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 |
@ <blockquote><pre>
@ errorlog: <i>FILENAME</i>
@ </pre></blockquote>
blob_reset(&fullname);
}
}
/*
** WEBPAGE: errorlog
**
** Show the content of the error log. Only the administrator can view
** this page.
**
** y=0x01 Show only hack attempts
** y=0x02 Show only panics and assertion faults
** y=0x04 Show hung backoffice processes
** y=0x40 Show other uncategorized messages
**
** If y is omitted or is zero, a count of the various message types is
** shown.
*/
void errorlog_page(void){
i64 szFile;
FILE *in;
char *zLog;
int hasType = 0;
const char *zType = P("y");
static const int eAllTypes = 0x47;
long eType = 0;
int bOutput = 0;
int prevWasTime = 0;
int nHack = 0;
int nPanic = 0;
int nOther = 0;
int nHang = 0;
char z[10000];
char zTime[10000];
login_check_credentials();
if( !g.perm.Admin ){
login_needed(0);
return;
}
if( zType ){
eType = strtol(zType,0,0) & eAllTypes;
}
style_header("Server Error Log");
style_submenu_element("Test", "%R/test-warning");
style_submenu_element("Refresh", "%R/errorlog");
style_submenu_element("Download", "%R/errorlog?download");
style_submenu_element("Truncate", "%R/errorlog?truncate");
style_submenu_element("Log-Menu", "%R/setup-logmenu");
if( eType ){
style_submenu_element("Summary", "%R/errorlog");
}
if( g.zErrlog==0 || fossil_strcmp(g.zErrlog,"-")==0 ){
no_error_log_available();
style_finish_page();
return;
}
if( P("truncate1") && cgi_csrf_safe(2) ){
|
| ︙ | ︙ | |||
859 860 861 862 863 864 865 |
@ </form>
style_finish_page();
return;
}
zLog = file_canonical_name_dup(g.zErrlog);
@ <p>The server error log at "%h(zLog)" is %,lld(szFile) bytes in size.
fossil_free(zLog);
| < < | | > | < | | > | < | < | | < > | < | > > | | < < < < < < < < < < < < < | > > < < < < < < < | < < < < < < < < < < < < < < < < < < | > > > > | > > > > > > > > > > | | < > | < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | < | | < < < < < < < < < < | < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | | | | | | | | | > > > > | | | | > > > > > > > > > | > | | | > | 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 |
@ </form>
style_finish_page();
return;
}
zLog = file_canonical_name_dup(g.zErrlog);
@ <p>The server error log at "%h(zLog)" is %,lld(szFile) bytes in size.
fossil_free(zLog);
in = fossil_fopen(g.zErrlog, "rb");
if( in==0 ){
@ <p class='generalError'>Unable to open that file for reading!</p>
style_finish_page();
return;
}
if( eType==0 ){
/* will do a summary */
}else if( (eType&eAllTypes)!=eAllTypes ){
@ Only the following types of messages displayed:
@ <ul>
if( eType & 0x01 ){
@ <li>Hack attempts
}
if( eType & 0x02 ){
@ <li>Panics and assertion faults
}
if( eType & 0x04 ){
@ <li>Hung backoffice processes
}
if( eType & 0x40 ){
@ <li>Other uncategorized messages
}
@ </ul>
}
@ <hr>
if( eType ){
@ <pre>
}
while( fgets(z, sizeof(z), in) ){
if( prevWasTime ){
if( strncmp(z,"possible hack attempt - 418 ", 27)==0 ){
bOutput = (eType & 0x01)!=0;
nHack++;
}else
if( (strncmp(z,"panic: ", 7)==0 || strstr(z," assertion fault ")!=0) ){
bOutput = (eType & 0x02)!=0;
nPanic++;
}else
if( sqlite3_strglob("warning: backoffice process * still *",z)==0 ){
bOutput = (eType & 0x04)!=0;
nHang++;
}else{
bOutput = (eType & 0x40)!=0;
nOther++;
}
if( bOutput ){
@ %h(zTime)\
}
}
if( strncmp(z, "--------", 8)==0 ){
size_t n = strlen(z);
memcpy(zTime, z, n+1);
prevWasTime = 1;
bOutput = 0;
}else{
prevWasTime = 0;
}
if( bOutput && eType ){
@ %h(z)\
}
}
fclose(in);
if( eType ){
@ </pre>
}
if( eType==0 ){
int nNonHack = nPanic+nHang+nOther;
int nTotal = nNonHack + nHack;
@ <p><table border="a" cellspacing="0" cellpadding="5">
@ <tr><td align="right">%d(nPanic)</td>
if( nPanic>0 ){
@ <td><a href="./errorlog?y=2">Panics</a></td>
} else {
@ <td>Panics</td>
}
@ <tr><td align="right">%d(nHack)</td>
if( nHack>0 ){
@ <td><a href="./errorlog?y=1">Hack Attempts</a></td>
if( nNonHack ){
@ <tr><td align="right">%d(nNonHack)</td>
@ <td><a href="%R/errorlog?y=70">Other than hack attempts</a></td>
}
}else{
@ <td>Hack Attempts</td>
}
@ <tr><td align="right">%d(nHang)</td>
if( nHang>0 ){
@ <td><a href="./errorlog?y=4/">Hung Backoffice</a></td>
}else{
@ <td>Hung Backoffice</td>
}
@ <tr><td align="right">%d(nHang)</td>
if( nOther>0 ){
@ <td><a href="./errorlog?y=64/">Other</a></td>
}else{
@ <td>Other</td>
}
@ <tr><td align="right">%d(nTotal)</td>
@ <td><a href="./errorlog">All Messages</a></td>
@ </table>
}
style_finish_page();
}
|
Changes to src/setup.c.
| ︙ | ︙ | |||
262 263 264 265 266 267 268 |
blob_appendf(&desc,"In this repository, the error log is the file "
"named \"%s\".", g.zErrlog);
bErrLog = 1;
}
setup_menu_entry("Error Log", bErrLog ? "errorlog" : 0, blob_str(&desc));
blob_reset(&desc);
| < < < < < < < < < < < < < < < < < < < < | 262 263 264 265 266 267 268 269 270 271 272 273 274 275 |
blob_appendf(&desc,"In this repository, the error log is the file "
"named \"%s\".", g.zErrlog);
bErrLog = 1;
}
setup_menu_entry("Error Log", bErrLog ? "errorlog" : 0, blob_str(&desc));
blob_reset(&desc);
@ </table>
style_finish_page();
}
/*
** Generate a checkbox for an attribute.
*/
|
| ︙ | ︙ |