Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch config-sync Excluding Merge-Ins
This is equivalent to a diff from e17fc71319 to 940faaa37e
|
2011-04-27
| ||
| 02:10 | Merge in the config-sync changes. This is a major schema change and definitely requires a "fossil rebuild". Note that the schema upgrade is irreversible and so you should be certain you want to continue with the new schema before you upgrade. ... (check-in: 1654456ef5 user: drh tags: trunk) | |
| 02:05 | Fix an issue with the --legacy option to configuration pull. ... (Closed-Leaf check-in: 940faaa37e user: drh tags: config-sync) | |
| 01:40 | Fix an out-of-order local variable declaration. Ticket [a659e233cd79a0d]. ... (check-in: 7b45d101dd user: drh tags: config-sync) | |
|
2011-04-26
| ||
| 00:45 | Begin implementing the protocol changes for configuration sync. ... (check-in: f99e3fa9e6 user: drh tags: config-sync) | |
|
2011-04-25
| ||
| 22:23 | Change the definition of a "Leaf" to be any node that has no children of any kind (merge or non-merge) in the same branch. A "rebuild" or a "fossil leaves --recompute" is required to recompute the LEAF table after upgrading to this version. ... (check-in: e17fc71319 user: drh tags: trunk) | |
| 20:26 | Add hyperlink to the annotation of a file in the object description header. ... (check-in: 030a048697 user: drh tags: trunk) | |
Changes to src/checkin.c.
| ︙ | |||
274 275 276 277 278 279 280 281 282 283 | 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | + + - - |
void clean_cmd(void){
int allFlag;
int dotfilesFlag;
const char *zIgnoreFlag;
Blob path, repo;
Stmt q;
int n;
Glob *pIgnore;
allFlag = find_option("force","f",0)!=0;
dotfilesFlag = find_option("dotfiles",0,0)!=0;
zIgnoreFlag = find_option("ignore",0,1);
|
| ︙ |
Changes to src/clone.c.
| ︙ | |||
62 63 64 65 66 67 68 | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | - - - - + + + + |
url_parse(g.argv[2]);
if( g.urlIsFile ){
file_copy(g.urlName, g.argv[3]);
db_close(1);
db_open_repository(g.argv[3]);
db_record_repository_filename(g.argv[3]);
db_multi_exec(
|
| ︙ | |||
90 91 92 93 94 95 96 | 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | - - + + |
db_record_repository_filename(g.argv[3]);
db_initial_setup(0, zDefaultUser, 0);
user_select();
db_set("content-schema", CONTENT_SCHEMA, 0);
db_set("aux-schema", AUX_SCHEMA, 0);
db_set("last-sync-url", g.argv[2], 0);
db_multi_exec(
|
| ︙ |
Changes to src/configure.c.
1 2 3 4 5 6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | - + | /* ** Copyright (c) 2008 D. Richard Hipp ** ** This program is free software; you can redistribute it and/or ** modify it under the terms of the Simplified BSD License (also ** known as the "2-Clause License" or "FreeBSD License".) |
| ︙ | |||
25 26 27 28 29 30 31 | 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | - - - - - - + + + + + + - + + + + - - - - - - - + + + + + + + | #include <assert.h> #if INTERFACE /* ** Configuration transfers occur in groups. These are the allowed ** groupings: */ |
| ︙ | |||
104 105 106 107 108 109 110 | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 | + - - - - - + + + + + + + + + + + + + + + + + + + + + + + - + |
** Return name of first configuration property matching the given mask.
*/
const char *configure_first_name(int iMask){
iConfig = 0;
return configure_next_name(iMask);
}
const char *configure_next_name(int iMask){
if( iMask & CONFIGSET_OLDFORMAT ){
|
| ︙ | |||
198 199 200 201 202 203 204 | 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 | - - + + - - - - + + + + + - - + + - + - + - + |
db_finalize(&q);
}
}
/*
** Two SQL functions:
**
|
| ︙ | |||
259 260 261 262 263 264 265 | 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | - - + + + + - + - + - + - + - + - + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + |
@ cap TEXT, -- Capabilities of this user
@ cookie TEXT, -- WWW login cookie
@ ipaddr TEXT, -- IP address for which cookie is valid
@ cexpire DATETIME, -- Time when cookie expires
@ info TEXT, -- contact information
@ photo BLOB -- JPEG image of this user
@ );
|
| ︙ | |||
342 343 344 345 346 347 348 | 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 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 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 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 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 | - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - + + + + + + + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + - + - + + - - - - - + + + + + + - + + - - - - + + + - - - - - - - - - - - - - + - - - | ** SQL that is evaluated. Note that the raw SQL in CONTENT might not ** insert directly into the target table but might instead use a proxy ** table like _fer_reportfmt or _xfer_user. Such tables must be created ** ahead of time using configure_prepare_to_receive(). Then after multiple ** calls to this routine, configure_finalize_receive() to transfer the ** information received into the true target table. */ |
| ︙ | |||
473 474 475 476 477 478 479 | 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 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 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 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 872 873 874 875 876 877 | - + + + + - + + + - - + + + - + + + - - + + + + + + + + + + + - - - + + + + + + - + + + + + + + + + + - + + + + + - + - + - + | ** the current configuration. Existing values take priority over ** values read from FILENAME. ** ** %fossil configuration pull AREA ?URL? ** ** Pull and install the configuration from a different server ** identified by URL. If no URL is specified, then the default |
| ︙ |
Changes to src/db.c.
| ︙ | |||
32 33 34 35 36 37 38 39 40 41 42 43 44 45 | 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 | + | #if ! defined(_WIN32) # include <pwd.h> #endif #include <sqlite3.h> #include <sys/types.h> #include <sys/stat.h> #include <unistd.h> #include <time.h> #include "db.h" #if INTERFACE /* ** An single SQL statement is represented as an instance of the following ** structure. */ |
| ︙ | |||
604 605 606 607 608 609 610 611 612 613 614 615 616 617 | 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 | + + + + + + + + + + + + + |
db_err(sqlite3_errmsg(db));
}
}
va_end(ap);
sqlite3_exec(db, "COMMIT", 0, 0, 0);
sqlite3_close(db);
}
/*
** Function to return the number of seconds since 1970. This is
** the same as strftime('%s','now') but is more compact.
*/
static void db_now_function(
sqlite3_context *context,
int argc,
sqlite3_value **argv
){
sqlite3_result_int64(context, time(0));
}
/*
** Open a database file. Return a pointer to the new database
** connection. An error results in process abort.
*/
static sqlite3 *openDatabase(const char *zDbName){
int rc;
|
| ︙ | |||
628 629 630 631 632 633 634 635 636 637 638 639 640 641 | 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 | + |
zVfs
);
if( rc!=SQLITE_OK ){
db_err(sqlite3_errmsg(db));
}
sqlite3_busy_timeout(db, 5000);
sqlite3_wal_autocheckpoint(db, 1); /* Set to checkpoint frequently */
sqlite3_create_function(db, "now", 0, SQLITE_ANY, 0, db_now_function, 0, 0);
return db;
}
/*
** zDbName is the name of a database file. If no other database
** file is open, then open this one. If another database file is
|
| ︙ | |||
1103 1104 1105 1106 1107 1108 1109 | 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 | - - - - + + + + |
Blob hash;
Blob manifest;
db_set("content-schema", CONTENT_SCHEMA, 0);
db_set("aux-schema", AUX_SCHEMA, 0);
if( makeServerCodes ){
db_multi_exec(
|
| ︙ | |||
1293 1294 1295 1296 1297 1298 1299 | 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 | - + + |
zHash[n] = 0;
}else{
sha1sum_step_text(zContent, n);
sha1sum_finish(&out);
sqlite3_snprintf(sizeof(zHash), zHash, "%s", blob_str(&out));
blob_reset(&out);
db_multi_exec(
|
| ︙ | |||
1404 1405 1406 1407 1408 1409 1410 | 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 | - + |
db_begin_transaction();
if( globalFlag ){
db_swap_connections();
db_multi_exec("REPLACE INTO global_config(name,value) VALUES(%Q,%Q)",
zName, zValue);
db_swap_connections();
}else{
|
| ︙ | |||
1463 1464 1465 1466 1467 1468 1469 | 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 | - + |
void db_set_int(const char *zName, int value, int globalFlag){
if( globalFlag ){
db_swap_connections();
db_multi_exec("REPLACE INTO global_config(name,value) VALUES(%Q,%d)",
zName, value);
db_swap_connections();
}else{
|
| ︙ |
Changes to src/login.c.
| ︙ | |||
1255 1256 1257 1258 1259 1260 1261 | 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 | - - + + |
);
db_end_transaction(0);
db_multi_exec("DETACH other");
/* Propagate the changes to all other members of the login-group */
zSql = mprintf(
"BEGIN;"
|
| ︙ |
Changes to src/rebuild.c.
| ︙ | |||
20 21 22 23 24 25 26 | 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | - + + + - + - + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | #include "config.h" #include "rebuild.h" #include <assert.h> #include <dirent.h> #include <errno.h> /* |
| ︙ | |||
254 255 256 257 258 259 260 | 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 | - + |
bag_init(&bagDone);
ttyOutput = doOut;
processCnt = 0;
if (!g.fQuiet) {
percent_complete(0);
}
|
| ︙ | |||
457 458 459 460 461 462 463 | 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 | - - + + |
db_close(1);
db_open_repository(g.zRepositoryName);
}
db_begin_transaction();
ttyOutput = 1;
errCnt = rebuild_db(randomizeFlag, 1, doClustering);
db_multi_exec(
|
| ︙ |
Changes to src/report.c.
| ︙ | |||
358 359 360 361 362 363 364 365 366 367 368 | 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 | + + + + + + - + - - + + |
if( zSQL[0]==0 ){
zErr = "Please supply an SQL query statement";
}else if( (zTitle = trim_string(zTitle))[0]==0 ){
zErr = "Please supply a title";
}else{
zErr = verify_sql_statement(zSQL);
}
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);
}
if( zErr==0 ){
login_verify_csrf_secret();
if( rn>0 ){
db_multi_exec("UPDATE reportfmt SET title=%Q, sqlcode=%Q,"
|
| ︙ |
Changes to src/schema.c.
| ︙ | |||
37 38 39 40 41 42 43 | 37 38 39 40 41 42 43 44 45 46 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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | - - + + - + + - + + + + + + + + + + + - + - + + + - + + + + + - - - - - + + + + + + - + + | /* ** The content tables have a content version number which rarely ** changes. The aux tables have an arbitrary version number (typically ** a date) which can change frequently. When the content schema changes, ** we have to execute special procedures to update the schema. When ** the aux schema changes, all we need to do is rebuild the database. */ |
| ︙ | |||
174 175 176 177 178 179 180 | 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 | - - + + + | @ -- by storing an SHA1 hash of the content. For display, the hash is @ -- mapped back into the original text using this table. @ -- @ -- This table contains sensitive information and should not be shared @ -- with unauthorized users. @ -- @ CREATE TABLE concealed( |
| ︙ | |||
212 213 214 215 216 217 218 | 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | - + - + | @ @ -- Parent/child linkages between checkins @ -- @ CREATE TABLE plink( @ pid INTEGER REFERENCES blob, -- Parent manifest @ cid INTEGER REFERENCES blob, -- Child manifest @ isprim BOOLEAN, -- pid is the primary parent of cid |
| ︙ | |||
317 318 319 320 321 322 323 | 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 | - + - + - + | @ -- @ CREATE TABLE tagxref( @ tagid INTEGER REFERENCES tag, -- The tag that added or removed @ tagtype INTEGER, -- 0:-,cancel 1:+,single 2:*,propagate @ srcid INTEGER REFERENCES blob, -- Artifact of tag. 0 for propagated tags @ origid INTEGER REFERENCES blob, -- check-in holding propagated tag @ value TEXT, -- Value of the tag. Might be NULL. |
| ︙ | |||
441 442 443 444 445 446 447 | 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | - + | @ id INTEGER PRIMARY KEY, -- ID of the checked out file @ vid INTEGER REFERENCES blob, -- The baseline this file is part of. @ chnged INT DEFAULT 0, -- 0:unchnged 1:edited 2:m-chng 3:m-add @ deleted BOOLEAN DEFAULT 0, -- True if deleted @ isexe BOOLEAN, -- True if file should be executable @ rid INTEGER, -- Originally from this repository record @ mrid INTEGER, -- Based on this record due to a merge |
| ︙ |
Changes to src/setup.c.
| ︙ | |||
352 353 354 355 356 357 358 | 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | - - + + - + + |
@
@ <p><a href="setup_uedit?id=%d(uid)">[Bummer]</a></p>
style_footer();
return;
}
login_verify_csrf_secret();
db_multi_exec(
|
| ︙ | |||
1284 1285 1286 1287 1288 1289 1290 | 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 | - - + + - + |
}
db_begin_transaction();
if( P("set")!=0 && zMime && zMime[0] && szImg>0 ){
Blob img;
Stmt ins;
blob_init(&img, aImg, szImg);
db_prepare(&ins,
|
| ︙ |
Changes to src/shun.c.
| ︙ | |||
79 80 81 82 83 84 85 86 | 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | + - + + + + + + + + + + + + + + |
@ be shunned. But it does 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 respositories.</p>
}
}
if( zUuid && P("add") ){
int rid, tagid;
login_verify_csrf_secret();
|
| ︙ |
Changes to src/skins.c.
| ︙ | |||
23 24 25 26 27 28 29 | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | + - + | /* @-comment: // */ /* ** A black-and-white theme with the project title in a bar across the top ** and no logo image. */ static const char zBuiltinSkin1[] = @ REPLACE INTO config(name,mtime,value) |
| ︙ | |||
150 151 152 153 154 155 156 | 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 | - + |
@
@ /* The label/value pairs on (for example) the vinfo page */
@ table.label-value th {
@ vertical-align: top;
@ text-align: right;
@ padding: 0.2ex 2ex;
@ }');
|
| ︙ | |||
202 203 204 205 206 207 208 | 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | - + + + - + |
@ if {[info exists login]} {
@ html "<a href=''$home/login''>Logout</a> "
@ } else {
@ html "<a href=''$home/login''>Login</a> "
@ }
@ </th1></div>
@ ');
|
| ︙ | |||
352 353 354 355 356 357 358 | 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 | - + |
@ /* The label/value pairs on (for example) the ci page */
@ table.label-value th {
@ vertical-align: top;
@ text-align: right;
@ padding: 0.2ex 2ex;
@ }
@ ');
|
| ︙ | |||
403 404 405 406 407 408 409 | 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | - + + + - + |
@ if {[info exists login]} {
@ html "<a href=''$home/login''>Logout</a> "
@ } else {
@ html "<a href=''$home/login''>Login</a> "
@ }
@ </th1></div>
@ ');
|
| ︙ | |||
584 585 586 587 588 589 590 | 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 | - + |
@
@ /* The label/value pairs on (for example) the ci page */
@ table.label-value th {
@ vertical-align: top;
@ text-align: right;
@ padding: 0.2ex 2ex;
@ }');
|
| ︙ | |||
638 639 640 641 642 643 644 | 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 | - + + - + |
@ html "<li><a href=''$home/login''>Logout</a></li>"
@ } else {
@ html "<li><a href=''$home/login''>Login</a></li>"
@ }
@ </th1></ul></div>
@ <div id="container">
@ ');
|
| ︙ | |||
878 879 880 881 882 883 884 | 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 | - + |
@ table.report tr td {
@ padding: 3px 5px;
@ }
@
@ textarea {
@ font-size: 1em;
@ }');
|
| ︙ | |||
932 933 934 935 936 937 938 | 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 | - + |
@ html "<a href=''$home/login''>Logout</a>"
@ } else {
@ html "<a href=''$home/login''>Login</a>"
@ }
@ </th1></ul></div>
@ <div id="container">
@ ');
|
| ︙ | |||
982 983 984 985 986 987 988 | 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 | - + + - + + - + + |
** useDefault==0 or a string for the default skin if useDefault==1.
**
** Memory to hold the returned string is obtained from malloc.
*/
static char *getSkin(int useDefault){
Blob val;
blob_zero(&val);
|
| ︙ | |||
1046 1047 1048 1049 1050 1051 1052 | 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 | - + - + - + |
if( P("save")!=0 && (zName = skinVarName(P("save"),0))!=0 ){
if( db_exists("SELECT 1 FROM config WHERE name=%Q", zName)
|| strcmp(zName, "Default")==0 ){
zErr = mprintf("Skin name \"%h\" already exists. "
"Choose a different name.", P("sn"));
}else{
|
| ︙ |
Changes to src/user.c.
| ︙ | |||
202 203 204 205 206 207 208 | 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | - - + + |
if( g.argc>=6 ){
blob_init(&passwd, g.argv[5], -1);
}else{
prompt_for_password("password: ", &passwd, 1);
}
zPw = sha1_shared_secret(blob_str(&passwd), blob_str(&login), 0);
db_multi_exec(
|
| ︙ | |||
247 248 249 250 251 252 253 | 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 | - + + - - + + |
zPrompt = mprintf("New password for %s: ", g.argv[3]);
prompt_for_password(zPrompt, &pw, 1);
}
if( blob_size(&pw)==0 ){
printf("password unchanged\n");
}else{
char *zSecret = sha1_shared_secret(blob_str(&pw), g.argv[3], 0);
|
| ︙ | |||
338 339 340 341 342 343 344 | 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | - - + + |
g.zLogin = mprintf("%s", db_column_text(&s, 1));
}
db_finalize(&s);
}
if( g.userUid==0 ){
db_multi_exec(
|
| ︙ | |||
362 363 364 365 366 367 368 | 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 | - + |
*/
void user_hash_passwords_cmd(void){
if( g.argc!=3 ) usage("REPOSITORY");
db_open_repository(g.argv[2]);
sqlite3_create_function(g.db, "shared_secret", 2, SQLITE_UTF8, 0,
sha1_shared_secret_sql_function, 0, 0);
db_multi_exec(
|
| ︙ |
Changes to src/xfer.c.
| ︙ | |||
452 453 454 455 456 457 458 | 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 | - + |
db_static_prepare(&q1,
"SELECT uuid, size, content,"
" (SELECT uuid FROM delta, blob"
" WHERE delta.rid=:rid AND delta.srcid=blob.rid)"
" FROM blob"
" WHERE rid=:rid"
" AND size>=0"
|
| ︙ | |||
736 737 738 739 740 741 742 | 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 766 767 768 769 770 771 772 773 774 | - + + + + - + - |
while( db_step(&q)==SQLITE_ROW ){
blob_appendf(pXfer->pOut, "igot %s\n", db_column_text(&q, 0));
}
db_finalize(&q);
}
/*
|
| ︙ | |||
1005 1006 1007 1008 1009 1010 1011 | 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 | - + |
** Check for a valid login. This has to happen before anything else.
** The client can send multiple logins. Permissions are cumulative.
*/
if( blob_eq(&xfer.aToken[0], "login")
&& xfer.nToken==4
){
if( disableLogin ){
|
| ︙ | |||
1027 1028 1029 1030 1031 1032 1033 | 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 | + + + + + + - - + + + |
** Request a configuration value
*/
if( blob_eq(&xfer.aToken[0], "reqconfig")
&& xfer.nToken==2
){
if( g.okRead ){
char *zName = blob_str(&xfer.aToken[1]);
if( zName[0]=='/' ){
/* New style configuration transfer */
int groupMask = configure_name_to_mask(&zName[1], 0);
if( !g.okAdmin ) groupMask &= ~CONFIGSET_USER;
if( !g.okRdAddr ) groupMask &= ~CONFIGSET_ADDR;
configure_send_group(xfer.pOut, groupMask, 0);
|
| ︙ | |||
1050 1051 1052 1053 1054 1055 1056 | 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 | - + |
blob_extract(xfer.pIn, size, &content);
if( !g.okAdmin ){
cgi_reset_content();
@ error not\sauthorized\sto\spush\sconfiguration
nErr++;
break;
}
|
| ︙ | |||
1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 | 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 | + - |
** server in gdb:
**
** gdb fossil
** r test-xfer out.txt
*/
void cmd_test_xfer(void){
int notUsed;
db_find_and_open_repository(0,0);
if( g.argc!=2 && g.argc!=3 ){
usage("?MESSAGEFILE?");
}
|
| ︙ | |||
1329 1330 1331 1332 1333 1334 1335 | 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 | - - + + + + + + - - - - - - + + + + + + + + + |
const char *zName;
zName = configure_first_name(configRcvMask);
while( zName ){
blob_appendf(&send, "reqconfig %s\n", zName);
zName = configure_next_name(configRcvMask);
nCardSent++;
}
|
| ︙ | |||
1645 1646 1647 1648 1649 1650 1651 | 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 | - + + + |
fossil_warning("%b", &xfer.err);
nErr++;
break;
}
blobarray_reset(xfer.aToken, xfer.nToken);
blob_reset(&xfer.line);
}
|
| ︙ |