Fossil SCM
Break out SMTP faults as a separate category on the Error Log.
Commit
2d3ace5a9fb4de5cd37ce2fdff0012cb438986ddeb3f866d172b7a3a3b453056
Parent
2b96941c4c924e5…
1 file changed
+15
-2
+15
-2
| --- src/security_audit.c | ||
| +++ src/security_audit.c | ||
| @@ -815,10 +815,11 @@ | ||
| 815 | 815 | ** y=0x01 Show only hack attempts |
| 816 | 816 | ** y=0x02 Show only panics and assertion faults |
| 817 | 817 | ** y=0x04 Show hung backoffice processes |
| 818 | 818 | ** y=0x08 Show POST requests from a different origin |
| 819 | 819 | ** y=0x10 Show SQLITE_AUTH and similar |
| 820 | +** y=0x20 Show SMTP error reports | |
| 820 | 821 | ** y=0x40 Show other uncategorized messages |
| 821 | 822 | ** |
| 822 | 823 | ** If y is omitted or is zero, a count of the various message types is |
| 823 | 824 | ** shown. |
| 824 | 825 | */ |
| @@ -825,20 +826,21 @@ | ||
| 825 | 826 | void errorlog_page(void){ |
| 826 | 827 | i64 szFile; |
| 827 | 828 | FILE *in; |
| 828 | 829 | char *zLog; |
| 829 | 830 | const char *zType = P("y"); |
| 830 | - static const int eAllTypes = 0x5f; | |
| 831 | + static const int eAllTypes = 0x7f; | |
| 831 | 832 | long eType = 0; |
| 832 | 833 | int bOutput = 0; |
| 833 | 834 | int prevWasTime = 0; |
| 834 | 835 | int nHack = 0; |
| 835 | 836 | int nPanic = 0; |
| 836 | 837 | int nOther = 0; |
| 837 | 838 | int nHang = 0; |
| 838 | 839 | int nXPost = 0; |
| 839 | 840 | int nAuth = 0; |
| 841 | + int nSmtp = 0; | |
| 840 | 842 | char z[10000]; |
| 841 | 843 | char zTime[10000]; |
| 842 | 844 | |
| 843 | 845 | login_check_credentials(); |
| 844 | 846 | if( !g.perm.Admin ){ |
| @@ -911,10 +913,13 @@ | ||
| 911 | 913 | @ <li>POST requests from different origin |
| 912 | 914 | } |
| 913 | 915 | if( eType & 0x10 ){ |
| 914 | 916 | @ <li>SQLITE_AUTH and similar errors |
| 915 | 917 | } |
| 918 | + if( eType & 0x20 ){ | |
| 919 | + @ <li>SMTP malfunctions | |
| 920 | + } | |
| 916 | 921 | if( eType & 0x40 ){ |
| 917 | 922 | @ <li>Other uncategorized messages |
| 918 | 923 | } |
| 919 | 924 | @ </ul> |
| 920 | 925 | } |
| @@ -929,10 +934,14 @@ | ||
| 929 | 934 | nHack++; |
| 930 | 935 | }else |
| 931 | 936 | if( (strncmp(z,"panic: ", 7)==0 || strstr(z," assertion fault ")!=0) ){ |
| 932 | 937 | bOutput = (eType & 0x02)!=0; |
| 933 | 938 | nPanic++; |
| 939 | + }else | |
| 940 | + if( strncmp(z,"SMTP:", 5)==0 ){ | |
| 941 | + bOutput = (eType & 0x20)!=0; | |
| 942 | + nSmtp++; | |
| 934 | 943 | }else |
| 935 | 944 | if( sqlite3_strglob("warning: backoffice process * still *",z)==0 ){ |
| 936 | 945 | bOutput = (eType & 0x04)!=0; |
| 937 | 946 | nHang++; |
| 938 | 947 | }else |
| @@ -969,11 +978,11 @@ | ||
| 969 | 978 | fclose(in); |
| 970 | 979 | if( eType ){ |
| 971 | 980 | @ </pre> |
| 972 | 981 | } |
| 973 | 982 | if( eType==0 ){ |
| 974 | - int nNonHack = nPanic + nHang + nAuth + nOther; | |
| 983 | + int nNonHack = nPanic + nHang + nAuth + nSmtp + nOther; | |
| 975 | 984 | int nTotal = nNonHack + nHack + nXPost; |
| 976 | 985 | @ <p><table border="a" cellspacing="0" cellpadding="5"> |
| 977 | 986 | if( nPanic>0 ){ |
| 978 | 987 | @ <tr><td align="right">%d(nPanic)</td> |
| 979 | 988 | @ <td><a href="./errorlog?y=2">Panics</a></td> |
| @@ -992,10 +1001,14 @@ | ||
| 992 | 1001 | } |
| 993 | 1002 | if( nAuth>0 ){ |
| 994 | 1003 | @ <tr><td align="right">%d(nAuth)</td> |
| 995 | 1004 | @ <td><a href="./errorlog?y=16">SQLITE_AUTH and similar</a></td> |
| 996 | 1005 | } |
| 1006 | + if( nSmtp>0 ){ | |
| 1007 | + @ <tr><td align="right">%d(nSmtp)</td> | |
| 1008 | + @ <td><a href="./errorlog?y=32">SMTP faults</a></td> | |
| 1009 | + } | |
| 997 | 1010 | if( nOther>0 ){ |
| 998 | 1011 | @ <tr><td align="right">%d(nOther)</td> |
| 999 | 1012 | @ <td><a href="./errorlog?y=64">Other</a></td> |
| 1000 | 1013 | } |
| 1001 | 1014 | @ <tr><td align="right">%d(nTotal)</td> |
| 1002 | 1015 |
| --- src/security_audit.c | |
| +++ src/security_audit.c | |
| @@ -815,10 +815,11 @@ | |
| 815 | ** y=0x01 Show only hack attempts |
| 816 | ** y=0x02 Show only panics and assertion faults |
| 817 | ** y=0x04 Show hung backoffice processes |
| 818 | ** y=0x08 Show POST requests from a different origin |
| 819 | ** y=0x10 Show SQLITE_AUTH and similar |
| 820 | ** y=0x40 Show other uncategorized messages |
| 821 | ** |
| 822 | ** If y is omitted or is zero, a count of the various message types is |
| 823 | ** shown. |
| 824 | */ |
| @@ -825,20 +826,21 @@ | |
| 825 | void errorlog_page(void){ |
| 826 | i64 szFile; |
| 827 | FILE *in; |
| 828 | char *zLog; |
| 829 | const char *zType = P("y"); |
| 830 | static const int eAllTypes = 0x5f; |
| 831 | long eType = 0; |
| 832 | int bOutput = 0; |
| 833 | int prevWasTime = 0; |
| 834 | int nHack = 0; |
| 835 | int nPanic = 0; |
| 836 | int nOther = 0; |
| 837 | int nHang = 0; |
| 838 | int nXPost = 0; |
| 839 | int nAuth = 0; |
| 840 | char z[10000]; |
| 841 | char zTime[10000]; |
| 842 | |
| 843 | login_check_credentials(); |
| 844 | if( !g.perm.Admin ){ |
| @@ -911,10 +913,13 @@ | |
| 911 | @ <li>POST requests from different origin |
| 912 | } |
| 913 | if( eType & 0x10 ){ |
| 914 | @ <li>SQLITE_AUTH and similar errors |
| 915 | } |
| 916 | if( eType & 0x40 ){ |
| 917 | @ <li>Other uncategorized messages |
| 918 | } |
| 919 | @ </ul> |
| 920 | } |
| @@ -929,10 +934,14 @@ | |
| 929 | nHack++; |
| 930 | }else |
| 931 | if( (strncmp(z,"panic: ", 7)==0 || strstr(z," assertion fault ")!=0) ){ |
| 932 | bOutput = (eType & 0x02)!=0; |
| 933 | nPanic++; |
| 934 | }else |
| 935 | if( sqlite3_strglob("warning: backoffice process * still *",z)==0 ){ |
| 936 | bOutput = (eType & 0x04)!=0; |
| 937 | nHang++; |
| 938 | }else |
| @@ -969,11 +978,11 @@ | |
| 969 | fclose(in); |
| 970 | if( eType ){ |
| 971 | @ </pre> |
| 972 | } |
| 973 | if( eType==0 ){ |
| 974 | int nNonHack = nPanic + nHang + nAuth + nOther; |
| 975 | int nTotal = nNonHack + nHack + nXPost; |
| 976 | @ <p><table border="a" cellspacing="0" cellpadding="5"> |
| 977 | if( nPanic>0 ){ |
| 978 | @ <tr><td align="right">%d(nPanic)</td> |
| 979 | @ <td><a href="./errorlog?y=2">Panics</a></td> |
| @@ -992,10 +1001,14 @@ | |
| 992 | } |
| 993 | if( nAuth>0 ){ |
| 994 | @ <tr><td align="right">%d(nAuth)</td> |
| 995 | @ <td><a href="./errorlog?y=16">SQLITE_AUTH and similar</a></td> |
| 996 | } |
| 997 | if( nOther>0 ){ |
| 998 | @ <tr><td align="right">%d(nOther)</td> |
| 999 | @ <td><a href="./errorlog?y=64">Other</a></td> |
| 1000 | } |
| 1001 | @ <tr><td align="right">%d(nTotal)</td> |
| 1002 |
| --- src/security_audit.c | |
| +++ src/security_audit.c | |
| @@ -815,10 +815,11 @@ | |
| 815 | ** y=0x01 Show only hack attempts |
| 816 | ** y=0x02 Show only panics and assertion faults |
| 817 | ** y=0x04 Show hung backoffice processes |
| 818 | ** y=0x08 Show POST requests from a different origin |
| 819 | ** y=0x10 Show SQLITE_AUTH and similar |
| 820 | ** y=0x20 Show SMTP error reports |
| 821 | ** y=0x40 Show other uncategorized messages |
| 822 | ** |
| 823 | ** If y is omitted or is zero, a count of the various message types is |
| 824 | ** shown. |
| 825 | */ |
| @@ -825,20 +826,21 @@ | |
| 826 | void errorlog_page(void){ |
| 827 | i64 szFile; |
| 828 | FILE *in; |
| 829 | char *zLog; |
| 830 | const char *zType = P("y"); |
| 831 | static const int eAllTypes = 0x7f; |
| 832 | long eType = 0; |
| 833 | int bOutput = 0; |
| 834 | int prevWasTime = 0; |
| 835 | int nHack = 0; |
| 836 | int nPanic = 0; |
| 837 | int nOther = 0; |
| 838 | int nHang = 0; |
| 839 | int nXPost = 0; |
| 840 | int nAuth = 0; |
| 841 | int nSmtp = 0; |
| 842 | char z[10000]; |
| 843 | char zTime[10000]; |
| 844 | |
| 845 | login_check_credentials(); |
| 846 | if( !g.perm.Admin ){ |
| @@ -911,10 +913,13 @@ | |
| 913 | @ <li>POST requests from different origin |
| 914 | } |
| 915 | if( eType & 0x10 ){ |
| 916 | @ <li>SQLITE_AUTH and similar errors |
| 917 | } |
| 918 | if( eType & 0x20 ){ |
| 919 | @ <li>SMTP malfunctions |
| 920 | } |
| 921 | if( eType & 0x40 ){ |
| 922 | @ <li>Other uncategorized messages |
| 923 | } |
| 924 | @ </ul> |
| 925 | } |
| @@ -929,10 +934,14 @@ | |
| 934 | nHack++; |
| 935 | }else |
| 936 | if( (strncmp(z,"panic: ", 7)==0 || strstr(z," assertion fault ")!=0) ){ |
| 937 | bOutput = (eType & 0x02)!=0; |
| 938 | nPanic++; |
| 939 | }else |
| 940 | if( strncmp(z,"SMTP:", 5)==0 ){ |
| 941 | bOutput = (eType & 0x20)!=0; |
| 942 | nSmtp++; |
| 943 | }else |
| 944 | if( sqlite3_strglob("warning: backoffice process * still *",z)==0 ){ |
| 945 | bOutput = (eType & 0x04)!=0; |
| 946 | nHang++; |
| 947 | }else |
| @@ -969,11 +978,11 @@ | |
| 978 | fclose(in); |
| 979 | if( eType ){ |
| 980 | @ </pre> |
| 981 | } |
| 982 | if( eType==0 ){ |
| 983 | int nNonHack = nPanic + nHang + nAuth + nSmtp + nOther; |
| 984 | int nTotal = nNonHack + nHack + nXPost; |
| 985 | @ <p><table border="a" cellspacing="0" cellpadding="5"> |
| 986 | if( nPanic>0 ){ |
| 987 | @ <tr><td align="right">%d(nPanic)</td> |
| 988 | @ <td><a href="./errorlog?y=2">Panics</a></td> |
| @@ -992,10 +1001,14 @@ | |
| 1001 | } |
| 1002 | if( nAuth>0 ){ |
| 1003 | @ <tr><td align="right">%d(nAuth)</td> |
| 1004 | @ <td><a href="./errorlog?y=16">SQLITE_AUTH and similar</a></td> |
| 1005 | } |
| 1006 | if( nSmtp>0 ){ |
| 1007 | @ <tr><td align="right">%d(nSmtp)</td> |
| 1008 | @ <td><a href="./errorlog?y=32">SMTP faults</a></td> |
| 1009 | } |
| 1010 | if( nOther>0 ){ |
| 1011 | @ <tr><td align="right">%d(nOther)</td> |
| 1012 | @ <td><a href="./errorlog?y=64">Other</a></td> |
| 1013 | } |
| 1014 | @ <tr><td align="right">%d(nTotal)</td> |
| 1015 |