Fossil SCM
The /errorlog page (Admin access only) now recognizes timeouts and WAL recovery notifications as separate error categories.
Commit
9225f7d3e001d542922dd195d8fc196c86f2720b3df4061471e0e2f90bf5c0cf
Parent
86787eadb7b1403…
1 file changed
+37
-8
+37
-8
| --- src/security_audit.c | ||
| +++ src/security_audit.c | ||
| @@ -837,21 +837,23 @@ | ||
| 837 | 837 | ** y=0x008 Show POST requests from a different origin |
| 838 | 838 | ** y=0x010 Show SQLITE_AUTH and similar |
| 839 | 839 | ** y=0x020 Show SMTP error reports |
| 840 | 840 | ** y=0x040 Show TH1 vulnerability reports |
| 841 | 841 | ** y=0x080 Show SQL errors |
| 842 | -** y=0x800 Show other uncategorized messages | |
| 842 | +** y=0x100 Show timeouts | |
| 843 | +** y=0x200 Show WAL recoveries | |
| 844 | +** y=0x8000 Show other uncategorized messages | |
| 843 | 845 | ** |
| 844 | 846 | ** If y is omitted or is zero, a count of the various message types is |
| 845 | 847 | ** shown. |
| 846 | 848 | */ |
| 847 | 849 | void errorlog_page(void){ |
| 848 | 850 | i64 szFile; |
| 849 | 851 | FILE *in; |
| 850 | 852 | char *zLog; |
| 851 | 853 | const char *zType = P("y"); |
| 852 | - static const int eAllTypes = 0x8ff; | |
| 854 | + static const int eAllTypes = 0x83ff; | |
| 853 | 855 | long eType = 0; |
| 854 | 856 | int bOutput = 0; |
| 855 | 857 | int prevWasTime = 0; |
| 856 | 858 | int nHack = 0; |
| 857 | 859 | int nPanic = 0; |
| @@ -860,10 +862,12 @@ | ||
| 860 | 862 | int nXPost = 0; |
| 861 | 863 | int nAuth = 0; |
| 862 | 864 | int nSmtp = 0; |
| 863 | 865 | int nVuln = 0; |
| 864 | 866 | int nSqlErr = 0; |
| 867 | + int nTimeout = 0; | |
| 868 | + int nRecover = 0; | |
| 865 | 869 | char z[10000]; |
| 866 | 870 | char zTime[10000]; |
| 867 | 871 | |
| 868 | 872 | login_check_credentials(); |
| 869 | 873 | if( !g.perm.Admin ){ |
| @@ -945,11 +949,17 @@ | ||
| 945 | 949 | @ <li>TH1 vulnerabilities |
| 946 | 950 | } |
| 947 | 951 | if( eType & 0x80 ){ |
| 948 | 952 | @ <li>SQL errors |
| 949 | 953 | } |
| 950 | - if( eType & 0x800 ){ | |
| 954 | + if( eType & 0x100 ){ | |
| 955 | + @ <li>Timeouts | |
| 956 | + } | |
| 957 | + if( eType & 0x200 ){ | |
| 958 | + @ <li>WAL recoveries | |
| 959 | + } | |
| 960 | + if( eType & 0x8000 ){ | |
| 951 | 961 | @ <li>Other uncategorized messages |
| 952 | 962 | } |
| 953 | 963 | @ </ul> |
| 954 | 964 | } |
| 955 | 965 | @ <hr> |
| @@ -960,19 +970,30 @@ | ||
| 960 | 970 | if( prevWasTime ){ |
| 961 | 971 | if( strncmp(z,"possible hack attempt - 418 ", 27)==0 ){ |
| 962 | 972 | bOutput = (eType & 0x01)!=0; |
| 963 | 973 | nHack++; |
| 964 | 974 | }else |
| 965 | - if( (strncmp(z,"panic: ", 7)==0 && strncmp(z+7,"Timeout",7)!=0) | |
| 966 | - || strstr(z," assertion fault ")!=0 | |
| 967 | - ){ | |
| 975 | + if( strncmp(z,"panic: ", 7)==0 ){ | |
| 976 | + if( strncmp(z+7,"Timeout",7) ){ | |
| 977 | + bOutput = (eType & 0x100)!=0; | |
| 978 | + nTimeout++; | |
| 979 | + }else{ | |
| 980 | + bOutput = (eType & 0x02)!=0; | |
| 981 | + nPanic++; | |
| 982 | + } | |
| 983 | + }else | |
| 984 | + if( strstr(z,"assertion fault")!=0 ){ | |
| 968 | 985 | bOutput = (eType & 0x02)!=0; |
| 969 | 986 | nPanic++; |
| 970 | 987 | }else |
| 971 | 988 | if( strncmp(z,"SMTP:", 5)==0 ){ |
| 972 | 989 | bOutput = (eType & 0x20)!=0; |
| 973 | 990 | nSmtp++; |
| 991 | + }else | |
| 992 | + if( sqlite3_strglob("warning: SQLITE_NOTICE(283):*",z)==0 ){ | |
| 993 | + bOutput = (eType & 0x200)!=0; | |
| 994 | + nRecover++; | |
| 974 | 995 | }else |
| 975 | 996 | if( sqlite3_strglob("warning: backoffice process * still *",z)==0 ){ |
| 976 | 997 | bOutput = (eType & 0x04)!=0; |
| 977 | 998 | nHang++; |
| 978 | 999 | }else |
| @@ -993,11 +1014,11 @@ | ||
| 993 | 1014 | if( strstr(z,"statement aborts at ") ){ |
| 994 | 1015 | bOutput = (eType & 0x80)!=0; |
| 995 | 1016 | nSqlErr++; |
| 996 | 1017 | }else |
| 997 | 1018 | { |
| 998 | - bOutput = (eType & 0x800)!=0; | |
| 1019 | + bOutput = (eType & 0x8000)!=0; | |
| 999 | 1020 | nOther++; |
| 1000 | 1021 | } |
| 1001 | 1022 | if( bOutput ){ |
| 1002 | 1023 | @ %h(zTime)\ |
| 1003 | 1024 | } |
| @@ -1036,10 +1057,18 @@ | ||
| 1036 | 1057 | } |
| 1037 | 1058 | if( nSqlErr>0 ){ |
| 1038 | 1059 | @ <tr><td align="right">%d(nSqlErr)</td> |
| 1039 | 1060 | @ <td><a href="./errorlog?y=128">SQL Errors</a></td> |
| 1040 | 1061 | } |
| 1062 | + if( nTimeout>0 ){ | |
| 1063 | + @ <tr><td align="right">%d(nTimeout)</td> | |
| 1064 | + @ <td><a href="./errorlog?y=256">Timeouts</a></td> | |
| 1065 | + } | |
| 1066 | + if( nRecover>0 ){ | |
| 1067 | + @ <tr><td align="right">%d(nRecover)</td> | |
| 1068 | + @ <td><a href="./errorlog?y=512">WAL recoveries</a></td> | |
| 1069 | + } | |
| 1041 | 1070 | if( nHang>0 ){ |
| 1042 | 1071 | @ <tr><td align="right">%d(nHang)</td> |
| 1043 | 1072 | @ <td><a href="./errorlog?y=4">Hung Backoffice</a></td> |
| 1044 | 1073 | } |
| 1045 | 1074 | if( nXPost>0 ){ |
| @@ -1054,11 +1083,11 @@ | ||
| 1054 | 1083 | @ <tr><td align="right">%d(nSmtp)</td> |
| 1055 | 1084 | @ <td><a href="./errorlog?y=32">SMTP faults</a></td> |
| 1056 | 1085 | } |
| 1057 | 1086 | if( nOther>0 ){ |
| 1058 | 1087 | @ <tr><td align="right">%d(nOther)</td> |
| 1059 | - @ <td><a href="./errorlog?y=2048">Other</a></td> | |
| 1088 | + @ <td><a href="./errorlog?y=32768">Other</a></td> | |
| 1060 | 1089 | } |
| 1061 | 1090 | @ <tr><td align="right">%d(nTotal)</td> |
| 1062 | 1091 | if( nTotal>0 ){ |
| 1063 | 1092 | @ <td><a href="./errorlog?y=4095">All Messages</a></td> |
| 1064 | 1093 | }else{ |
| 1065 | 1094 |
| --- src/security_audit.c | |
| +++ src/security_audit.c | |
| @@ -837,21 +837,23 @@ | |
| 837 | ** y=0x008 Show POST requests from a different origin |
| 838 | ** y=0x010 Show SQLITE_AUTH and similar |
| 839 | ** y=0x020 Show SMTP error reports |
| 840 | ** y=0x040 Show TH1 vulnerability reports |
| 841 | ** y=0x080 Show SQL errors |
| 842 | ** y=0x800 Show other uncategorized messages |
| 843 | ** |
| 844 | ** If y is omitted or is zero, a count of the various message types is |
| 845 | ** shown. |
| 846 | */ |
| 847 | void errorlog_page(void){ |
| 848 | i64 szFile; |
| 849 | FILE *in; |
| 850 | char *zLog; |
| 851 | const char *zType = P("y"); |
| 852 | static const int eAllTypes = 0x8ff; |
| 853 | long eType = 0; |
| 854 | int bOutput = 0; |
| 855 | int prevWasTime = 0; |
| 856 | int nHack = 0; |
| 857 | int nPanic = 0; |
| @@ -860,10 +862,12 @@ | |
| 860 | int nXPost = 0; |
| 861 | int nAuth = 0; |
| 862 | int nSmtp = 0; |
| 863 | int nVuln = 0; |
| 864 | int nSqlErr = 0; |
| 865 | char z[10000]; |
| 866 | char zTime[10000]; |
| 867 | |
| 868 | login_check_credentials(); |
| 869 | if( !g.perm.Admin ){ |
| @@ -945,11 +949,17 @@ | |
| 945 | @ <li>TH1 vulnerabilities |
| 946 | } |
| 947 | if( eType & 0x80 ){ |
| 948 | @ <li>SQL errors |
| 949 | } |
| 950 | if( eType & 0x800 ){ |
| 951 | @ <li>Other uncategorized messages |
| 952 | } |
| 953 | @ </ul> |
| 954 | } |
| 955 | @ <hr> |
| @@ -960,19 +970,30 @@ | |
| 960 | if( prevWasTime ){ |
| 961 | if( strncmp(z,"possible hack attempt - 418 ", 27)==0 ){ |
| 962 | bOutput = (eType & 0x01)!=0; |
| 963 | nHack++; |
| 964 | }else |
| 965 | if( (strncmp(z,"panic: ", 7)==0 && strncmp(z+7,"Timeout",7)!=0) |
| 966 | || strstr(z," assertion fault ")!=0 |
| 967 | ){ |
| 968 | bOutput = (eType & 0x02)!=0; |
| 969 | nPanic++; |
| 970 | }else |
| 971 | if( strncmp(z,"SMTP:", 5)==0 ){ |
| 972 | bOutput = (eType & 0x20)!=0; |
| 973 | nSmtp++; |
| 974 | }else |
| 975 | if( sqlite3_strglob("warning: backoffice process * still *",z)==0 ){ |
| 976 | bOutput = (eType & 0x04)!=0; |
| 977 | nHang++; |
| 978 | }else |
| @@ -993,11 +1014,11 @@ | |
| 993 | if( strstr(z,"statement aborts at ") ){ |
| 994 | bOutput = (eType & 0x80)!=0; |
| 995 | nSqlErr++; |
| 996 | }else |
| 997 | { |
| 998 | bOutput = (eType & 0x800)!=0; |
| 999 | nOther++; |
| 1000 | } |
| 1001 | if( bOutput ){ |
| 1002 | @ %h(zTime)\ |
| 1003 | } |
| @@ -1036,10 +1057,18 @@ | |
| 1036 | } |
| 1037 | if( nSqlErr>0 ){ |
| 1038 | @ <tr><td align="right">%d(nSqlErr)</td> |
| 1039 | @ <td><a href="./errorlog?y=128">SQL Errors</a></td> |
| 1040 | } |
| 1041 | if( nHang>0 ){ |
| 1042 | @ <tr><td align="right">%d(nHang)</td> |
| 1043 | @ <td><a href="./errorlog?y=4">Hung Backoffice</a></td> |
| 1044 | } |
| 1045 | if( nXPost>0 ){ |
| @@ -1054,11 +1083,11 @@ | |
| 1054 | @ <tr><td align="right">%d(nSmtp)</td> |
| 1055 | @ <td><a href="./errorlog?y=32">SMTP faults</a></td> |
| 1056 | } |
| 1057 | if( nOther>0 ){ |
| 1058 | @ <tr><td align="right">%d(nOther)</td> |
| 1059 | @ <td><a href="./errorlog?y=2048">Other</a></td> |
| 1060 | } |
| 1061 | @ <tr><td align="right">%d(nTotal)</td> |
| 1062 | if( nTotal>0 ){ |
| 1063 | @ <td><a href="./errorlog?y=4095">All Messages</a></td> |
| 1064 | }else{ |
| 1065 |
| --- src/security_audit.c | |
| +++ src/security_audit.c | |
| @@ -837,21 +837,23 @@ | |
| 837 | ** y=0x008 Show POST requests from a different origin |
| 838 | ** y=0x010 Show SQLITE_AUTH and similar |
| 839 | ** y=0x020 Show SMTP error reports |
| 840 | ** y=0x040 Show TH1 vulnerability reports |
| 841 | ** y=0x080 Show SQL errors |
| 842 | ** y=0x100 Show timeouts |
| 843 | ** y=0x200 Show WAL recoveries |
| 844 | ** y=0x8000 Show other uncategorized messages |
| 845 | ** |
| 846 | ** If y is omitted or is zero, a count of the various message types is |
| 847 | ** shown. |
| 848 | */ |
| 849 | void errorlog_page(void){ |
| 850 | i64 szFile; |
| 851 | FILE *in; |
| 852 | char *zLog; |
| 853 | const char *zType = P("y"); |
| 854 | static const int eAllTypes = 0x83ff; |
| 855 | long eType = 0; |
| 856 | int bOutput = 0; |
| 857 | int prevWasTime = 0; |
| 858 | int nHack = 0; |
| 859 | int nPanic = 0; |
| @@ -860,10 +862,12 @@ | |
| 862 | int nXPost = 0; |
| 863 | int nAuth = 0; |
| 864 | int nSmtp = 0; |
| 865 | int nVuln = 0; |
| 866 | int nSqlErr = 0; |
| 867 | int nTimeout = 0; |
| 868 | int nRecover = 0; |
| 869 | char z[10000]; |
| 870 | char zTime[10000]; |
| 871 | |
| 872 | login_check_credentials(); |
| 873 | if( !g.perm.Admin ){ |
| @@ -945,11 +949,17 @@ | |
| 949 | @ <li>TH1 vulnerabilities |
| 950 | } |
| 951 | if( eType & 0x80 ){ |
| 952 | @ <li>SQL errors |
| 953 | } |
| 954 | if( eType & 0x100 ){ |
| 955 | @ <li>Timeouts |
| 956 | } |
| 957 | if( eType & 0x200 ){ |
| 958 | @ <li>WAL recoveries |
| 959 | } |
| 960 | if( eType & 0x8000 ){ |
| 961 | @ <li>Other uncategorized messages |
| 962 | } |
| 963 | @ </ul> |
| 964 | } |
| 965 | @ <hr> |
| @@ -960,19 +970,30 @@ | |
| 970 | if( prevWasTime ){ |
| 971 | if( strncmp(z,"possible hack attempt - 418 ", 27)==0 ){ |
| 972 | bOutput = (eType & 0x01)!=0; |
| 973 | nHack++; |
| 974 | }else |
| 975 | if( strncmp(z,"panic: ", 7)==0 ){ |
| 976 | if( strncmp(z+7,"Timeout",7) ){ |
| 977 | bOutput = (eType & 0x100)!=0; |
| 978 | nTimeout++; |
| 979 | }else{ |
| 980 | bOutput = (eType & 0x02)!=0; |
| 981 | nPanic++; |
| 982 | } |
| 983 | }else |
| 984 | if( strstr(z,"assertion fault")!=0 ){ |
| 985 | bOutput = (eType & 0x02)!=0; |
| 986 | nPanic++; |
| 987 | }else |
| 988 | if( strncmp(z,"SMTP:", 5)==0 ){ |
| 989 | bOutput = (eType & 0x20)!=0; |
| 990 | nSmtp++; |
| 991 | }else |
| 992 | if( sqlite3_strglob("warning: SQLITE_NOTICE(283):*",z)==0 ){ |
| 993 | bOutput = (eType & 0x200)!=0; |
| 994 | nRecover++; |
| 995 | }else |
| 996 | if( sqlite3_strglob("warning: backoffice process * still *",z)==0 ){ |
| 997 | bOutput = (eType & 0x04)!=0; |
| 998 | nHang++; |
| 999 | }else |
| @@ -993,11 +1014,11 @@ | |
| 1014 | if( strstr(z,"statement aborts at ") ){ |
| 1015 | bOutput = (eType & 0x80)!=0; |
| 1016 | nSqlErr++; |
| 1017 | }else |
| 1018 | { |
| 1019 | bOutput = (eType & 0x8000)!=0; |
| 1020 | nOther++; |
| 1021 | } |
| 1022 | if( bOutput ){ |
| 1023 | @ %h(zTime)\ |
| 1024 | } |
| @@ -1036,10 +1057,18 @@ | |
| 1057 | } |
| 1058 | if( nSqlErr>0 ){ |
| 1059 | @ <tr><td align="right">%d(nSqlErr)</td> |
| 1060 | @ <td><a href="./errorlog?y=128">SQL Errors</a></td> |
| 1061 | } |
| 1062 | if( nTimeout>0 ){ |
| 1063 | @ <tr><td align="right">%d(nTimeout)</td> |
| 1064 | @ <td><a href="./errorlog?y=256">Timeouts</a></td> |
| 1065 | } |
| 1066 | if( nRecover>0 ){ |
| 1067 | @ <tr><td align="right">%d(nRecover)</td> |
| 1068 | @ <td><a href="./errorlog?y=512">WAL recoveries</a></td> |
| 1069 | } |
| 1070 | if( nHang>0 ){ |
| 1071 | @ <tr><td align="right">%d(nHang)</td> |
| 1072 | @ <td><a href="./errorlog?y=4">Hung Backoffice</a></td> |
| 1073 | } |
| 1074 | if( nXPost>0 ){ |
| @@ -1054,11 +1083,11 @@ | |
| 1083 | @ <tr><td align="right">%d(nSmtp)</td> |
| 1084 | @ <td><a href="./errorlog?y=32">SMTP faults</a></td> |
| 1085 | } |
| 1086 | if( nOther>0 ){ |
| 1087 | @ <tr><td align="right">%d(nOther)</td> |
| 1088 | @ <td><a href="./errorlog?y=32768">Other</a></td> |
| 1089 | } |
| 1090 | @ <tr><td align="right">%d(nTotal)</td> |
| 1091 | if( nTotal>0 ){ |
| 1092 | @ <td><a href="./errorlog?y=4095">All Messages</a></td> |
| 1093 | }else{ |
| 1094 |