Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch csrf-defense-enhancement Excluding Merge-Ins
This is equivalent to a diff from 8ff63db2 to fc5b49e9
2023-09-18
| ||
20:43 | Merge the CSRF-defense enhancements into trunk. ... (check-in: 920ace17 user: drh tags: trunk) | |
17:13 | Omit the SameSite=strict specifier for the login cookie, since that prevents users from clicking a hyperlink on an email notification and then going directly to the relevant page and getting logged in. ... (Closed-Leaf check-in: fc5b49e9 user: drh tags: csrf-defense-enhancement) | |
15:36 | Set the "SameSite=strict" value on cookies (used for authentication) as a further defense-in-depth against CSRF attacks. ... (check-in: bc643c32 user: drh tags: csrf-defense-enhancement) | |
13:18 | Try to simplify and rationalize the defenses against cross-site request forgery attacks. A hodgepodge of techniques have been used in the past. This changes attempts to make everything work more alike and to centralize CSRF defenses for easier auditing. ... (check-in: 88a402fe user: drh tags: csrf-defense-enhancement) | |
2023-09-14
| ||
08:25 | Add the ability for 'branch list' to filter the branches that have/have not been merged into the current branch. ... (check-in: 8ff63db2 user: danield tags: trunk) | |
08:04 | Update the built-in SQLite to version 3.43.1. ... (check-in: 1fea5c2c user: danield tags: trunk) | |
2023-06-14
| ||
14:37 | Add the ability for 'branch list' to filter the branches that have/have not been merged into the current branch, per forum request. ... (Closed-Leaf check-in: d6ddd5bc user: danield tags: branch-list-merged-unmerged) | |
Changes to src/alerts.c.
︙ | |||
1543 1544 1545 1546 1547 1548 1549 | 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 | - + | register_page(); return; } style_set_current_feature("alerts"); alert_submenu_common(); needCaptcha = !login_is_individual(); if( P("submit") |
︙ | |||
1854 1855 1856 1857 1858 1859 1860 | 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 | - + | } if( sid==0 ){ db_commit_transaction(); cgi_redirect("subscribe"); /*NOTREACHED*/ } alert_submenu_common(); |
︙ | |||
1916 1917 1918 1919 1920 1921 1922 | 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 | - + | db_unprotect(PROTECT_READONLY); db_multi_exec( "UPDATE subscriber SET lastContact=now()/86400" " WHERE subscriberId=%d", sid ); db_protect_pop(); } |
︙ | |||
2267 2268 2269 2270 2271 2272 2273 | 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 | - + | return; } style_set_current_feature("alerts"); zEAddr = PD("e",""); dx = atoi(PD("dx","0")); |
︙ | |||
3298 3299 3300 3301 3302 3303 3304 | 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 | - + | style_finish_page(); return; } if( P("submit")!=0 && P("subject")!=0 && P("msg")!=0 && P("from")!=0 |
︙ | |||
3475 3476 3477 3478 3479 3480 3481 | 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 | - + | style_set_current_feature("alerts"); if( fossil_strcmp(P("name"),"test1")==0 ){ /* Visit the /announce/test1 page to see the CGI variables */ zAction = "announce/test1"; @ <p style='border: 1px solid black; padding: 1ex;'> cgi_print_all(0, 0, 0); @ </p> |
︙ | |||
3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 | 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 | + | @ <a href="https://fossil-scm.org/fossil/doc/trunk/www/alerts.md">set up</a> @ for this repository.</p> return; } style_header("Send Announcement"); @ <form method="POST" action="%R/%s(zAction)"> login_insert_csrf_secret(); @ <table class="subscribe"> if( g.perm.Admin ){ int aa = PB("aa"); int all = PB("all"); int aMod = PB("mods"); const char *aack = aa ? "checked" : ""; const char *allck = all ? "checked" : ""; |
︙ |
Changes to src/builtin.c.
︙ | |||
664 665 666 667 668 669 670 | 664 665 666 667 668 669 670 671 672 673 674 675 676 677 | - - - - - - - - | CX("};\n"/* fossil.config */); CX("window.fossil.user = {"); CX("name: %!j,", (g.zLogin&&*g.zLogin) ? g.zLogin : "guest"); CX("isAdmin: %s", (g.perm.Admin || g.perm.Setup) ? "true" : "false"); CX("};\n"/*fossil.user*/); CX("if(fossil.config.skin.isDark) " "document.body.classList.add('fossil-dark-style');\n"); |
︙ |
Changes to src/cgi.c.
︙ | |||
312 313 314 315 316 317 318 | 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 | - + - - + - | if( zPath[0]==0 ) zPath = "/"; } if( g.zBaseURL!=0 && fossil_strncmp(g.zBaseURL, "https:", 6)==0 ){ zSecure = " secure;"; } if( lifetime!=0 ){ blob_appendf(&extraHeader, |
︙ | |||
698 699 700 701 702 703 704 705 706 707 | 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 | + + + + + + + + + + - - + + + + + + + + + + + + - - + + + - + - - - - - - + + + + + + + + + + + + + + + - - - + + + - - - - + - - - - - + + | zRef = P("HTTP_REFERER"); if( zRef==0 ) return 0; nBase = (int)strlen(g.zBaseURL); if( fossil_strncmp(g.zBaseURL,zRef,nBase)!=0 ) return 0; if( zRef[nBase]!=0 && zRef[nBase]!='/' ) return 0; return 1; } /* ** Return true if the current CGI request is a POST request */ static int cgi_is_post_request(void){ const char *zMethod = P("REQUEST_METHOD"); if( zMethod==0 ) return 0; if( strcmp(zMethod,"POST")!=0 ) return 0; return 1; } /* ** Return true if the current request appears to be safe from a |
︙ |
Changes to src/event.c.
︙ | |||
466 467 468 469 470 471 472 | 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 | - + - | " AND tagxref.tagid=tag.tagid" " AND tag.tagname GLOB 'sym-*'", rid ); } } zETime = db_text(0, "SELECT coalesce(datetime(%Q),datetime('now'))", zETime); |
︙ |
Changes to src/forum.c.
︙ | |||
895 896 897 898 899 900 901 902 903 904 905 906 907 908 | 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 | + | @ </label> @ <input type="hidden" name="trustuser" value="%h(pManifest->zUser)"> } }else if( bSameUser ){ /* Allow users to delete (reject) their own pending posts. */ @ <input type="submit" name="reject" value="Delete"> } login_insert_csrf_secret(); @ </form> if( bSelect && forumpost_may_close() && iClosed>=0 ){ int iHead = forumpost_head_rid(p->fpid); @ <form method="post" \ @ action='%R/forumpost_%s(iClosed > 0 ? "reopen" : "close")'> login_insert_csrf_secret(); @ <input type="hidden" name="fpid" value="%z(rid_to_uuid(iHead))" /> |
︙ | |||
1421 1422 1423 1424 1425 1426 1427 | 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 | - + | int fpid; login_check_credentials(); if( forumpost_may_close()==0 ){ login_needed(g.anon.Admin); return; } |
︙ | |||
1537 1538 1539 1540 1541 1542 1543 | 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 | - + + | const char *zContent = PDT("content",""); login_check_credentials(); if( !g.perm.WrForum ){ login_needed(g.anon.WrForum); return; } |
︙ | |||
1609 1610 1611 1612 1613 1614 1615 | 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 | - + | if( P("cancel") ){ cgi_redirectf("%R/forumpost/%S",zFpid); return; } bPreview = P("preview")!=0; bReply = P("reply")!=0; iClosed = forum_rid_is_closed(fpid, 1); |
︙ | |||
1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 | 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 | + | style_header("Delete %s", zTitle ? "Post" : "Reply"); @ <h1>Original Post:</h1> forum_render(pPost->zThreadTitle, pPost->zMimetype, pPost->zWiki, "forumEdit", 1); @ <h1>Change Into:</h1> forum_render(zTitle, zMimetype, zContent,"forumEdit", 1); @ <form action="%R/forume2" method="POST"> login_insert_csrf_secret(); @ <input type="hidden" name="fpid" value="%h(P("fpid"))"> @ <input type="hidden" name="nullout" value="1"> @ <input type="hidden" name="mimetype" value="%h(zMimetype)"> @ <input type="hidden" name="content" value="%h(zContent)"> if( zTitle ){ @ <input aria-label="Title" type="hidden" name="title" value="%h(zTitle)"> } |
︙ | |||
1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 | 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 | + | "forumEdit", 1); if( bPreview ){ @ <h2>Preview of Edited Post:</h2> forum_render(zTitle, zMimetype, zContent,"forumEdit", 1); } @ <h2>Revised Message:</h2> @ <form action="%R/forume2" method="POST"> login_insert_csrf_secret(); @ <input type="hidden" name="fpid" value="%h(P("fpid"))"> @ <input type="hidden" name="edit" value="1"> forum_from_line(); forum_post_widget(zTitle, zMimetype, zContent); }else{ /* Reply */ char *zDisplayName; |
︙ | |||
1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 | 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 | + | @ <input type="submit" name="cancel" value="Cancel"> if( (bPreview && !whitespace_only(zContent)) || isDelete ){ if( !iClosed || g.perm.Admin ) { @ <input type="submit" name="submit" value="Submit"> } } forum_render_debug_options(); login_insert_csrf_secret(); @ </form> forum_emit_js(); style_finish_page(); } /* ** WEBPAGE: setup_forum |
︙ | |||
1840 1841 1842 1843 1844 1845 1846 | 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 | - + - | }else{ @ %d(nRows) moderator(s) } } @ <h2>Settings</h2> @ <p>Configuration settings specific to the forum.</p> |
︙ |
Changes to src/info.c.
︙ | |||
3211 3212 3213 3214 3215 3216 3217 | 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 | - + - | zNewColorFlag = P("newclr") ? " checked" : ""; zNewTagFlag = P("newtag") ? " checked" : ""; zNewTag = PDT("tagname",""); zNewBrFlag = P("newbr") ? " checked" : ""; zNewBranch = PDT("brname",""); zCloseFlag = P("close") ? " checked" : ""; zHideFlag = P("hide") ? " checked" : ""; |
︙ | |||
3298 3299 3300 3301 3302 3303 3304 | 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 | - | @ </blockquote> @ <hr> blob_reset(&suffix); } @ <p>Make changes to attributes of check-in @ [%z(href("%R/ci/%!S",zUuid))%s(zUuid)</a>]:</p> form_begin(0, "%R/ci_edit"); |
︙ |
Changes to src/interwiki.c.
︙ | |||
312 313 314 315 316 317 318 | 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 | - + | char *zErr = 0; login_check_credentials(); if( !g.perm.Read && !g.perm.RdWiki && ~g.perm.RdTkt ){ login_needed(0); return; } |
︙ |
Changes to src/login.c.
︙ | |||
47 48 49 50 51 52 53 54 55 56 57 58 59 60 | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | + + + + + + + + + + + + + + + | # include <windows.h> /* for Sleep */ # if defined(__MINGW32__) || defined(_MSC_VER) # define sleep Sleep /* windows does not have sleep, but Sleep */ # endif #endif #include <time.h> /* ** Compute an appropriate Anti-CSRF token into g.zCsrfToken[]. */ static void login_create_csrf_secret(const char *zSeed){ unsigned char zResult[20]; int i; sha1sum_binary(zSeed, zResult); for(i=0; i<sizeof(g.zCsrfToken)-1; i++){ g.zCsrfToken[i] = "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789-/"[zResult[i]%64]; } g.zCsrfToken[i] = 0; } /* ** Return the login-group name. Or return 0 if this repository is ** not a member of a login-group. */ const char *login_group_name(void){ static const char *zGroup = 0; |
︙ | |||
581 582 583 584 585 586 587 | 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 | - + + | fossil_redirect_to_https_if_needed(1); sqlite3_create_function(g.db, "constant_time_cmp", 2, SQLITE_UTF8, 0, constant_time_cmp_function, 0, 0); zUsername = P("u"); zPasswd = P("p"); anonFlag = g.zLogin==0 && PB("anon"); /* Handle log-out requests */ |
︙ | |||
1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 | 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 | + - + + + + | zIpAddr = PD("REMOTE_ADDR","nil"); if( ( cgi_is_loopback(zIpAddr) || (g.fSshClient & CGI_SSH_CLIENT)!=0 ) && g.useLocalauth && db_get_int("localauth",0)==0 && P("HTTPS")==0 ){ char *zSeed; if( g.localOpen ) zLogin = db_lget("default-user",0); if( zLogin!=0 ){ uid = db_int(0, "SELECT uid FROM user WHERE login=%Q", zLogin); }else{ uid = db_int(0, "SELECT uid FROM user WHERE cap LIKE '%%s%%'"); } g.zLogin = db_text("?", "SELECT login FROM user WHERE uid=%d", uid); zCap = "sxy"; g.noPswd = 1; g.isHuman = 1; |
︙ | |||
1351 1352 1353 1354 1355 1356 1357 | 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 | - + | */ uid = login_find_user(zUser, zHash); if( uid==0 && login_transfer_credentials(zUser,zArg,zHash) ){ uid = login_find_user(zUser, zHash); if( uid ) record_login_attempt(zUser, zIpAddr, 1); } } |
︙ | |||
1401 1402 1403 1404 1405 1406 1407 | 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 | - + | if( uid==0 ){ uid = db_int(0, "SELECT uid FROM user WHERE login='nobody'"); if( uid==0 ){ /* If there is no user "nobody", then make one up - with no privileges */ uid = -1; zCap = ""; } |
︙ | |||
1803 1804 1805 1806 1807 1808 1809 | 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 | - - - - - - - - - - - - - - - - | ** While rendering a form, call this routine to add the Anti-CSRF token ** as a hidden element of the form. */ void login_insert_csrf_secret(void){ @ <input type="hidden" name="csrf" value="%s(g.zCsrfToken)"> } |
︙ | |||
1976 1977 1978 1979 1980 1981 1982 | 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 | - + | zUserID = PDT("u",""); zPasswd = PDT("p",""); zConfirm = PDT("cp",""); zEAddr = PDT("ea",""); zDName = PDT("dn",""); /* Verify user imputs */ |
︙ | |||
2254 2255 2256 2257 2258 2259 2260 | 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 | - + | @ with the project administrator. style_finish_page(); return; } zEAddr = PDT("ea",""); /* Verify user imputs */ |
︙ |
Changes to src/main.c.
︙ | |||
254 255 256 257 258 259 260 | 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | - - + + + + + + | #ifdef FOSSIL_ENABLE_TCL /* all Tcl related context necessary for integration */ struct TclContext tcl; #endif /* For defense against Cross-site Request Forgery attacks */ |
︙ |
Changes to src/report.c.
︙ | |||
469 470 471 472 473 474 475 | 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 | - + - - + | z = P("s"); zSQL = z ? trim_string(z) : 0; zClrKey = trim_string(PD("k","")); zDesc = trim_string(PD("d","")); zMimetype = P("m"); zTag = P("x"); report_update_reportfmt_table(); |
︙ | |||
512 513 514 515 516 517 518 | 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 | - + - | } if( zErr==0 && db_exists("SELECT 1 FROM reportfmt WHERE title=%Q and rn<>%d", zTitle, rn) ){ zErr = mprintf("There is already another report named \"%h\"", zTitle); } |
︙ |
Changes to src/security_audit.c.
︙ | |||
793 794 795 796 797 798 799 | 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 | - + + | @ the "fossil http" or "fossil server" commands then add @ a command-line option "--errorlog <i>FILENAME</i>" to that @ command. @ </ol> style_finish_page(); return; } |
︙ |
Changes to src/setup.c.
︙ | |||
200 201 202 203 204 205 206 | 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 | - + - | const char *zQ = P(zQParm); int iVal = db_get_boolean(zVar, dfltVal); if( zQ==0 && !disabled && P("submit") ){ zQ = "off"; } if( zQ ){ int iQ = fossil_strcmp(zQ,"on")==0 || atoi(zQ); |
︙ | |||
235 236 237 238 239 240 241 | 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 | - + - | const char *zVar, /* The corresponding row in the CONFIG table */ const char *zQParm, /* The query parameter */ const char *zDflt, /* Default value if CONFIG table entry does not exist */ int disabled /* 1 if disabled */ ){ const char *zVal = db_get(zVar, zDflt); const char *zQ = P(zQParm); |
︙ | |||
268 269 270 271 272 273 274 | 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | - + - | const char *zVar, /* The corresponding row in the CONFIG table */ const char *zQP, /* The query parameter */ const char *zDflt, /* Default value if CONFIG table entry does not exist */ int disabled /* 1 if the textarea should not be editable */ ){ const char *z = db_get(zVar, zDflt); const char *zQ = P(zQP); |
︙ | |||
307 308 309 310 311 312 313 | 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 | - + - | const char *zDflt, /* Default value if CONFIG table entry does not exist */ int nChoice, /* Number of choices */ const char *const *azChoice /* Choices in pairs (VAR value, Display) */ ){ const char *z = db_get(zVar, zDflt); const char *zQ = P(zQP); int i; |
︙ | |||
1456 1457 1458 1459 1460 1461 1462 | 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 | - + | void setup_adunit(void){ login_check_credentials(); if( !g.perm.Admin ){ login_needed(0); return; } db_begin_transaction(); |
︙ | |||
1558 1559 1560 1561 1562 1563 1564 | 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 | - + | } login_check_credentials(); if( !g.perm.Admin ){ login_needed(0); return; } db_begin_transaction(); |
︙ | |||
1767 1768 1769 1770 1771 1772 1773 | 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 | - + | int go = P("go")!=0; login_check_credentials(); if( !g.perm.Setup ){ login_needed(0); return; } add_content_sql_commands(g.db); |
︙ | |||
1820 1821 1822 1823 1824 1825 1826 | 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 | - + - | "SELECT sql FROM repository.sqlite_schema" " WHERE sql IS NOT NULL ORDER BY name"); go = 1; }else if( P("tablelist") ){ zQ = sqlite3_mprintf("SELECT*FROM pragma_table_list ORDER BY schema, name"); go = 1; } |
︙ | |||
1911 1912 1913 1914 1915 1916 1917 | 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 | - + - - + - | } style_set_current_feature("setup"); style_header("Raw TH1 Commands"); @ <p><b>Caution:</b> There are no restrictions on the TH1 that can be @ run by this page. If Tcl integration was enabled at compile-time and @ the "tcl" setting is enabled, Tcl commands may be run as well.</p> @ |
︙ | |||
2127 2128 2129 2130 2131 2132 2133 | 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 | - + | */ static void setup_update_url_alias( Blob *pSql, const char *zOldName, const char *zNewName, const char *zValue ){ |
︙ | |||
2171 2172 2173 2174 2175 2176 2177 | 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 | - + - | login_check_credentials(); if( !g.perm.Admin ){ login_needed(0); return; } style_set_current_feature("setup"); style_header("URL Alias Configuration"); |
︙ |
Changes to src/setupuser.c.
︙ | |||
340 341 342 343 344 345 346 | 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | - + | if( P("can") ){ /* User pressed the cancel button */ cgi_redirect(cgi_referer("setup_ulist")); return; } /* Check for requests to delete the user */ |
︙ | |||
384 385 386 387 388 389 390 | 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 | - + | if( !cgi_all("login","info","pw","apply") ){ /* need all of the above properties to make a change. Since one or ** more are missing, no-op */ }else if( higherUser ){ /* An Admin (a) user cannot edit a Superuser (s) */ }else if( zDeleteVerify!=0 ){ /* Need to verify a delete request */ |
︙ | |||
438 439 440 441 442 443 444 | 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 | - + | @ a different user.</span> @ @ <p><a href="setup_uedit?id=%d(uid)&referer=%T(zRef)"> @ [Bummer]</a></p> style_finish_page(); return; } |
︙ |
Changes to src/sha1.c.
︙ | |||
390 391 392 393 394 395 396 397 398 399 400 401 402 403 | 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 | + + + + + + + + + + + + + | blob_zero(pCksum); } blob_resize(pCksum, 40); SHA1Final(zResult, &ctx); DigestToBase16(zResult, blob_buffer(pCksum)); return 0; } /* ** Compute a binary SHA1 checksum of a zero-terminated string. The ** result is stored in zOut, which is a buffer that must be at least ** 20 bytes in size. */ void sha1sum_binary(const char *zIn, unsigned char *zOut){ SHA1Context ctx; SHA1Init(&ctx); SHA1Update(&ctx, (unsigned const char*)zIn, strlen(zIn)); SHA1Final(zOut, &ctx); } /* ** Compute the SHA1 checksum of a zero-terminated string. The ** result is held in memory obtained from mprintf(). */ char *sha1sum(const char *zIn){ SHA1Context ctx; |
︙ |
Changes to src/shun.c.
︙ | |||
96 97 98 99 100 101 102 | 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | - + - | canonical16(p, nUuid); p += nUuid+1; } } zUuid = zCanonical; } style_header("Shunned Artifacts"); |
︙ | |||
125 126 127 128 129 130 131 | 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 | - + - | } @ will no longer be shunned. But they may not exist in the repository. @ It may be necessary to rebuild the repository using the @ <b>fossil rebuild</b> command-line before the artifact content @ can pulled in from other repositories.</p> } } |
︙ |
Changes to src/skins.c.
︙ | |||
529 530 531 532 533 534 535 | 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 | - + | zCurrent = getSkin(0); for(i=0; i<count(aBuiltinSkin); i++){ aBuiltinSkin[i].zSQL = getSkin(aBuiltinSkin[i].zLabel); } style_set_current_feature("skins"); |
︙ | |||
626 627 628 629 630 631 632 633 634 635 636 637 638 639 | 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 | + | if( fossil_strcmp(aBuiltinSkin[i].zSQL, zCurrent)==0 ){ @ (Currently In Use) seenCurrent = 1; }else{ @ <form action="%R/setup_skin_admin" method="post"> @ <input type="hidden" name="sn" value="%h(z)"> @ <input type="submit" name="load" value="Install"> login_insert_csrf_secret(); if( pAltSkin==&aBuiltinSkin[i] ){ @ (Current override) } @ </form> } @ </tr> } |
︙ | |||
650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 | 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 | + + + | if( once ){ once = 0; @ <tr><td colspan=4><h2>Skins saved as "skin:*' entries \ @ in the CONFIG table:</h2></td></tr> } @ <tr><td>%d(i).<td>%h(zN)<td> <td> @ <form action="%R/setup_skin_admin" method="post"> login_insert_csrf_secret(); if( fossil_strcmp(zV, zCurrent)==0 ){ @ (Currently In Use) seenCurrent = 1; }else{ @ <input type="submit" name="load" value="Install"> @ <input type="submit" name="del1" value="Delete"> } @ <input type="submit" name="rename" value="Rename"> @ <input type="hidden" name="sn" value="%h(zN)"> @ </form></tr> } db_finalize(&q); if( !seenCurrent ){ i++; @ <tr><td colspan=4><h2>Current skin in css/header/footer/details entries \ @ in the CONFIG table:</h2></td></tr> @ <tr><td>%d(i).<td><i>Current</i><td> <td> @ <form action="%R/setup_skin_admin" method="post"> @ <input type="submit" name="save" value="Backup"> login_insert_csrf_secret(); @ </form> } db_prepare(&q, "SELECT DISTINCT substr(name, 1, 6) FROM config" " WHERE name GLOB 'draft[1-9]-*'" " ORDER BY name" ); once = 1; while( db_step(&q)==SQLITE_ROW ){ const char *zN = db_column_text(&q, 0); i++; if( once ){ once = 0; @ <tr><td colspan=4><h2>Draft skins stored as "draft[1-9]-*' entries \ @ in the CONFIG table:</h2></td></tr> } @ <tr><td>%d(i).<td>%h(zN)<td> <td> @ <form action="%R/setup_skin_admin" method="post"> login_insert_csrf_secret(); @ <input type="submit" name="draftdel" value="Delete"> @ <input type="hidden" name="name" value="%h(zN)"> @ </form></tr> } db_finalize(&q); @ </table> |
︙ | |||
834 835 836 837 838 839 840 | 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 864 865 866 867 868 869 870 871 | - + - + + + | zFile = aSkinAttr[ii].zFile; zDraft = mprintf("draft%d", iSkin); zTitle = mprintf("%s for Draft%d", aSkinAttr[ii].zTitle, iSkin); zBasis = PD("basis","current"); zDflt = skin_file_content(zBasis, zFile); zOrig = db_get_mprintf(zDflt, "draft%d-%s",iSkin,zFile); zContent = PD(zFile,zOrig); |
︙ | |||
1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 | 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 | + | @ <option value='%d(i)' selected>draft%d(i)</option> }else{ @ <option value='%d(i)'>draft%d(i)</option> } } @ </select> @ </p> @ </form> @ @ <a name='step2'></a> @ <h1>Step 2: Authenticate</h1> @ if( isSetup ){ @ <p>As an administrator, you can make any edits you like to this or @ any other skin. You can also authorize other users to edit this |
︙ |
Changes to src/style.c.
︙ | |||
257 258 259 260 261 262 263 264 265 266 267 268 269 270 | 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 | + | if( g.perm.Hyperlink ){ @ <form method="POST" action="%z(zLink)" %s(zOtherArgs)> }else{ needHrefJs = 1; @ <form method="POST" data-action='%s(zLink)' action='%R/login' \ @ %s(zOtherArgs)> } login_insert_csrf_secret(); } /* ** Add a new element to the submenu */ void style_submenu_element( const char *zLabel, |
︙ | |||
1457 1458 1459 1460 1461 1462 1463 | 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 | - + + + + + + + + + + + + + + + + + + + + | @ anonymous-adds = %s(find_anon_capabilities(zCap))<br> } @ g.zRepositoryName = %h(g.zRepositoryName)<br> @ load_average() = %f(load_average())<br> #ifndef _WIN32 @ RSS = %.2f(fossil_rss()/1000000.0) MB</br> #endif |
︙ |
Changes to src/th_main.c.
︙ | |||
603 604 605 606 607 608 609 | 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 | - + + + | int argc, const char **argv, int *argl ){ if( argc!=1 ){ return Th_WrongNumArgs(interp, "verifyCsrf"); } |
︙ |
Changes to src/tkt.c.
︙ | |||
898 899 900 901 902 903 904 | 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 | - + + + + | char *zDate, *aUsed; const char *zUuid; int i; int nJ = 0, rc = TH_OK; Blob tktchng, cksum; int needMod; |
︙ | |||
1013 1014 1015 1016 1017 1018 1019 | 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 | - | if( g.thTrace ) Th_Trace("BEGIN_TKTNEW<br>\n", -1); ticket_init(); initializeVariablesFromCGI(); getAllTicketFields(); initializeVariablesFromDb(); if( g.zPath[0]=='d' ) showAllFields(); form_begin(0, "%R/%s", g.zPath); |
︙ | |||
1103 1104 1105 1106 1107 1108 1109 | 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 | - | ticket_init(); getAllTicketFields(); initializeVariablesFromCGI(); initializeVariablesFromDb(); if( g.zPath[0]=='d' ) showAllFields(); form_begin(0, "%R/%s", g.zPath); @ <input type="hidden" name="name" value="%s(zName)"> |
︙ |
Changes to src/tktsetup.c.
︙ | |||
133 134 135 136 137 138 139 | 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 | - + - - + - | isSubmit = P("submit")!=0; z = P("x"); if( z==0 ){ z = db_get(zDbField, zDfltValue); } style_set_current_feature("tktsetup"); style_header("Edit %s", zTitle); |
︙ |
Changes to src/wiki.c.
︙ | |||
1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 | 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 | + - | return; } zMimetype = wiki_filter_mimetypes(pWiki->zMimetype) /* see https://fossil-scm.org/forum/forumpost/0acfdaac80 */; } if( !isSandbox && P("submit")!=0 && P("r")!=0 && P("u")!=0 && (goodCaptcha = captcha_is_correct(0)) && cgi_csrf_safe(2) ){ char *zDate; Blob cksum; Blob body; Blob wiki; blob_zero(&body); |
︙ | |||
1693 1694 1695 1696 1697 1698 1699 | 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 | - | safe_html_context(DOCSRC_WIKI); wiki_render_by_mimetype(&preview, zMimetype); @ <hr> blob_reset(&preview); } zUser = PD("u", g.zLogin); form_begin(0, "%R/wikiappend"); |
︙ |
Changes to src/xfersetup.c.
︙ | |||
116 117 118 119 120 121 122 | 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 | - + - - + - | isSubmit = P("submit")!=0; z = P("x"); if( z==0 ){ z = db_get(zDbField, zDfltValue); } style_set_current_feature("xfersetup"); style_header("Edit %s", zTitle); |
︙ |