Fossil SCM
Javascript-enabled hyperlinks now initially point to a honeypot, rather than to nothing.
Commit
2d14b6c4dc19ac774d0cae8722ee05e56e94f22d
Parent
e065d5b7f193b88…
1 file changed
+12
-2
+12
-2
| --- src/style.c | ||
| +++ src/style.c | ||
| @@ -112,11 +112,11 @@ | ||
| 112 | 112 | if( nHref>=nHrefAlloc ){ |
| 113 | 113 | nHrefAlloc = nHrefAlloc*2 + 10; |
| 114 | 114 | aHref = fossil_realloc(aHref, nHrefAlloc*sizeof(aHref[0])); |
| 115 | 115 | } |
| 116 | 116 | aHref[nHref++] = zUrl; |
| 117 | - return mprintf("<a %s id='a%d'>", zExtra, nHref); | |
| 117 | + return mprintf("<a %s id='a%d' href='%R/honeypot'>", zExtra, nHref); | |
| 118 | 118 | } |
| 119 | 119 | char *href(const char *zFormat, ...){ |
| 120 | 120 | char *zUrl; |
| 121 | 121 | va_list ap; |
| 122 | 122 | va_start(ap, zFormat); |
| @@ -130,11 +130,11 @@ | ||
| 130 | 130 | if( nHref>=nHrefAlloc ){ |
| 131 | 131 | nHrefAlloc = nHrefAlloc*2 + 10; |
| 132 | 132 | aHref = fossil_realloc(aHref, nHrefAlloc*sizeof(aHref[0])); |
| 133 | 133 | } |
| 134 | 134 | aHref[nHref++] = zUrl; |
| 135 | - return mprintf("<a id='a%d'>", nHref); | |
| 135 | + return mprintf("<a id='a%d' href='%R/honeypot'>", nHref); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | /* |
| 139 | 139 | ** Generate <form method="post" action=ARG>. The ARG value is inserted |
| 140 | 140 | ** by javascript. |
| @@ -1193,5 +1193,15 @@ | ||
| 1193 | 1193 | const char *zRedir = P("redirect"); |
| 1194 | 1194 | if( zRedir ) cgi_redirect(zRedir); |
| 1195 | 1195 | } |
| 1196 | 1196 | style_footer(); |
| 1197 | 1197 | } |
| 1198 | + | |
| 1199 | +/* | |
| 1200 | +** This page is a honeypot for spiders and bots. | |
| 1201 | +** | |
| 1202 | +** WEBPAGE: honeypot | |
| 1203 | +*/ | |
| 1204 | +void honeypot_page(void){ | |
| 1205 | + cgi_set_status(403, "Forbidden"); | |
| 1206 | + @ <p>Access by spiders and robots is forbidden</p> | |
| 1207 | +} | |
| 1198 | 1208 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -112,11 +112,11 @@ | |
| 112 | if( nHref>=nHrefAlloc ){ |
| 113 | nHrefAlloc = nHrefAlloc*2 + 10; |
| 114 | aHref = fossil_realloc(aHref, nHrefAlloc*sizeof(aHref[0])); |
| 115 | } |
| 116 | aHref[nHref++] = zUrl; |
| 117 | return mprintf("<a %s id='a%d'>", zExtra, nHref); |
| 118 | } |
| 119 | char *href(const char *zFormat, ...){ |
| 120 | char *zUrl; |
| 121 | va_list ap; |
| 122 | va_start(ap, zFormat); |
| @@ -130,11 +130,11 @@ | |
| 130 | if( nHref>=nHrefAlloc ){ |
| 131 | nHrefAlloc = nHrefAlloc*2 + 10; |
| 132 | aHref = fossil_realloc(aHref, nHrefAlloc*sizeof(aHref[0])); |
| 133 | } |
| 134 | aHref[nHref++] = zUrl; |
| 135 | return mprintf("<a id='a%d'>", nHref); |
| 136 | } |
| 137 | |
| 138 | /* |
| 139 | ** Generate <form method="post" action=ARG>. The ARG value is inserted |
| 140 | ** by javascript. |
| @@ -1193,5 +1193,15 @@ | |
| 1193 | const char *zRedir = P("redirect"); |
| 1194 | if( zRedir ) cgi_redirect(zRedir); |
| 1195 | } |
| 1196 | style_footer(); |
| 1197 | } |
| 1198 |
| --- src/style.c | |
| +++ src/style.c | |
| @@ -112,11 +112,11 @@ | |
| 112 | if( nHref>=nHrefAlloc ){ |
| 113 | nHrefAlloc = nHrefAlloc*2 + 10; |
| 114 | aHref = fossil_realloc(aHref, nHrefAlloc*sizeof(aHref[0])); |
| 115 | } |
| 116 | aHref[nHref++] = zUrl; |
| 117 | return mprintf("<a %s id='a%d' href='%R/honeypot'>", zExtra, nHref); |
| 118 | } |
| 119 | char *href(const char *zFormat, ...){ |
| 120 | char *zUrl; |
| 121 | va_list ap; |
| 122 | va_start(ap, zFormat); |
| @@ -130,11 +130,11 @@ | |
| 130 | if( nHref>=nHrefAlloc ){ |
| 131 | nHrefAlloc = nHrefAlloc*2 + 10; |
| 132 | aHref = fossil_realloc(aHref, nHrefAlloc*sizeof(aHref[0])); |
| 133 | } |
| 134 | aHref[nHref++] = zUrl; |
| 135 | return mprintf("<a id='a%d' href='%R/honeypot'>", nHref); |
| 136 | } |
| 137 | |
| 138 | /* |
| 139 | ** Generate <form method="post" action=ARG>. The ARG value is inserted |
| 140 | ** by javascript. |
| @@ -1193,5 +1193,15 @@ | |
| 1193 | const char *zRedir = P("redirect"); |
| 1194 | if( zRedir ) cgi_redirect(zRedir); |
| 1195 | } |
| 1196 | style_footer(); |
| 1197 | } |
| 1198 | |
| 1199 | /* |
| 1200 | ** This page is a honeypot for spiders and bots. |
| 1201 | ** |
| 1202 | ** WEBPAGE: honeypot |
| 1203 | */ |
| 1204 | void honeypot_page(void){ |
| 1205 | cgi_set_status(403, "Forbidden"); |
| 1206 | @ <p>Access by spiders and robots is forbidden</p> |
| 1207 | } |
| 1208 |