| | @@ -813,10 +813,11 @@ |
| 813 | 813 | ** this page. |
| 814 | 814 | ** |
| 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 | +** y=0x08 Show POST requests from a different origin |
| 818 | 819 | ** y=0x40 Show other uncategorized messages |
| 819 | 820 | ** |
| 820 | 821 | ** If y is omitted or is zero, a count of the various message types is |
| 821 | 822 | ** shown. |
| 822 | 823 | */ |
| | @@ -823,18 +824,19 @@ |
| 823 | 824 | void errorlog_page(void){ |
| 824 | 825 | i64 szFile; |
| 825 | 826 | FILE *in; |
| 826 | 827 | char *zLog; |
| 827 | 828 | const char *zType = P("y"); |
| 828 | | - static const int eAllTypes = 0x47; |
| 829 | + static const int eAllTypes = 0x4f; |
| 829 | 830 | long eType = 0; |
| 830 | 831 | int bOutput = 0; |
| 831 | 832 | int prevWasTime = 0; |
| 832 | 833 | int nHack = 0; |
| 833 | 834 | int nPanic = 0; |
| 834 | 835 | int nOther = 0; |
| 835 | 836 | int nHang = 0; |
| 837 | + int nXPost = 0; |
| 836 | 838 | char z[10000]; |
| 837 | 839 | char zTime[10000]; |
| 838 | 840 | |
| 839 | 841 | login_check_credentials(); |
| 840 | 842 | if( !g.perm.Admin ){ |
| | @@ -901,10 +903,13 @@ |
| 901 | 903 | @ <li>Panics and assertion faults |
| 902 | 904 | } |
| 903 | 905 | if( eType & 0x04 ){ |
| 904 | 906 | @ <li>Hung backoffice processes |
| 905 | 907 | } |
| 908 | + if( eType & 0x08 ){ |
| 909 | + @ <li>POST requests from different origin |
| 910 | + } |
| 906 | 911 | if( eType & 0x40 ){ |
| 907 | 912 | @ <li>Other uncategorized messages |
| 908 | 913 | } |
| 909 | 914 | @ </ul> |
| 910 | 915 | } |
| | @@ -923,11 +928,16 @@ |
| 923 | 928 | nPanic++; |
| 924 | 929 | }else |
| 925 | 930 | if( sqlite3_strglob("warning: backoffice process * still *",z)==0 ){ |
| 926 | 931 | bOutput = (eType & 0x04)!=0; |
| 927 | 932 | nHang++; |
| 928 | | - }else{ |
| 933 | + }else |
| 934 | + if( sqlite3_strglob("warning: POST from different origin*",z)==0 ){ |
| 935 | + bOutput = (eType & 0x08)!=0; |
| 936 | + nXPost++; |
| 937 | + }else |
| 938 | + { |
| 929 | 939 | bOutput = (eType & 0x40)!=0; |
| 930 | 940 | nOther++; |
| 931 | 941 | } |
| 932 | 942 | if( bOutput ){ |
| 933 | 943 | @ %h(zTime)\ |
| | @@ -948,40 +958,36 @@ |
| 948 | 958 | fclose(in); |
| 949 | 959 | if( eType ){ |
| 950 | 960 | @ </pre> |
| 951 | 961 | } |
| 952 | 962 | if( eType==0 ){ |
| 953 | | - int nNonHack = nPanic+nHang+nOther; |
| 954 | | - int nTotal = nNonHack + nHack; |
| 963 | + int nNonHack = nPanic + nHang + nOther; |
| 964 | + int nTotal = nNonHack + nHack + nXPost; |
| 955 | 965 | @ <p><table border="a" cellspacing="0" cellpadding="5"> |
| 956 | | - @ <tr><td align="right">%d(nPanic)</td> |
| 957 | 966 | if( nPanic>0 ){ |
| 967 | + @ <tr><td align="right">%d(nPanic)</td> |
| 958 | 968 | @ <td><a href="./errorlog?y=2">Panics</a></td> |
| 959 | | - } else { |
| 960 | | - @ <td>Panics</td> |
| 961 | 969 | } |
| 962 | | - @ <tr><td align="right">%d(nHack)</td> |
| 963 | 970 | if( nHack>0 ){ |
| 971 | + @ <tr><td align="right">%d(nHack)</td> |
| 964 | 972 | @ <td><a href="./errorlog?y=1">Hack Attempts</a></td> |
| 965 | | - if( nNonHack ){ |
| 966 | | - @ <tr><td align="right">%d(nNonHack)</td> |
| 967 | | - @ <td><a href="%R/errorlog?y=70">Other than hack attempts</a></td> |
| 968 | | - } |
| 969 | | - }else{ |
| 970 | | - @ <td>Hack Attempts</td> |
| 971 | | - } |
| 972 | | - @ <tr><td align="right">%d(nHang)</td> |
| 973 | | - if( nHang>0 ){ |
| 974 | | - @ <td><a href="./errorlog?y=4/">Hung Backoffice</a></td> |
| 975 | | - }else{ |
| 976 | | - @ <td>Hung Backoffice</td> |
| 977 | | - } |
| 978 | | - @ <tr><td align="right">%d(nHang)</td> |
| 979 | | - if( nOther>0 ){ |
| 980 | | - @ <td><a href="./errorlog?y=64/">Other</a></td> |
| 981 | | - }else{ |
| 982 | | - @ <td>Other</td> |
| 973 | + } |
| 974 | + if( nHang>0 ){ |
| 975 | + @ <tr><td align="right">%d(nHang)</td> |
| 976 | + @ <td><a href="./errorlog?y=4/">Hung Backoffice</a></td> |
| 977 | + } |
| 978 | + if( nXPost>0 ){ |
| 979 | + @ <tr><td align="right">%d(nXPost)</td> |
| 980 | + @ <td><a href="./errorlog?y=8/">POSTs from different origin</a></td> |
| 981 | + } |
| 982 | + if( nOther>0 ){ |
| 983 | + @ <tr><td align="right">%d(nOther)</td> |
| 984 | + @ <td><a href="./errorlog?y=64/">Other</a></td> |
| 985 | + } |
| 986 | + if( nHack+nXPost>0 && nNonHack>0 ){ |
| 987 | + @ <tr><td align="right">%d(nNonHack)</td> |
| 988 | + @ <td><a href="%R/errorlog?y=70">Other than hack attempts</a></td> |
| 983 | 989 | } |
| 984 | 990 | @ <tr><td align="right">%d(nTotal)</td> |
| 985 | 991 | if( nTotal>0 ){ |
| 986 | 992 | @ <td><a href="./errorlog">All Messages</a></td> |
| 987 | 993 | }else{ |
| 988 | 994 | |