Commit dfe422d
daemon: recognize hidden request arguments
A normal request to git-daemon is structured as
"command path/to/repo\0host=..\0" and due to a bug introduced in
49ba83f (Add virtualization support to git-daemon, 2006-09-19) we
aren't able to place any extra arguments (separated by NULs) besides the
host otherwise the parsing of those arguments would enter an infinite
loop. This bug was fixed in 73bb33a (daemon: Strictly parse the
"extra arg" part of the command, 2009-06-04) but a check was put in
place to disallow extra arguments so that new clients wouldn't trigger
this bug in older servers.
In order to get around this limitation teach git-daemon to recognize
additional request arguments hidden behind a second NUL byte. Requests
can then be structured like:
"command path/to/repo\0host=..\0\0version=1\0key=value\0". git-daemon
can then parse out the extra arguments and set 'GIT_PROTOCOL'
accordingly.
By placing these extra arguments behind a second NUL byte we can skirt
around both the infinite loop bug in 49ba83f (Add virtualization
support to git-daemon, 2006-09-19) as well as the explicit disallowing
of extra arguments introduced in 73bb33a (daemon: Strictly parse the
"extra arg" part of the command, 2009-06-04) because both of these
versions of git-daemon check for a single NUL byte after the host
argument before terminating the argument parsing.
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent 373d70e commit dfe422d
1 file changed
Lines changed: 62 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
285 | | - | |
| 285 | + | |
286 | 286 | | |
287 | 287 | | |
288 | 288 | | |
| |||
363 | 363 | | |
364 | 364 | | |
365 | 365 | | |
366 | | - | |
| 366 | + | |
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
| |||
422 | 422 | | |
423 | 423 | | |
424 | 424 | | |
425 | | - | |
| 425 | + | |
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
| |||
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
465 | | - | |
| 465 | + | |
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
469 | 469 | | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
470 | 473 | | |
471 | 474 | | |
472 | 475 | | |
473 | | - | |
| 476 | + | |
474 | 477 | | |
475 | 478 | | |
476 | 479 | | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
477 | 483 | | |
478 | 484 | | |
479 | 485 | | |
480 | | - | |
| 486 | + | |
481 | 487 | | |
482 | 488 | | |
483 | 489 | | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
484 | 493 | | |
485 | 494 | | |
486 | 495 | | |
| |||
573 | 582 | | |
574 | 583 | | |
575 | 584 | | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
576 | 588 | | |
577 | | - | |
| 589 | + | |
578 | 590 | | |
579 | 591 | | |
580 | 592 | | |
| |||
602 | 614 | | |
603 | 615 | | |
604 | 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 | + | |
605 | 654 | | |
606 | 655 | | |
607 | 656 | | |
| |||
695 | 744 | | |
696 | 745 | | |
697 | 746 | | |
| 747 | + | |
698 | 748 | | |
699 | 749 | | |
700 | 750 | | |
| |||
716 | 766 | | |
717 | 767 | | |
718 | 768 | | |
| 769 | + | |
719 | 770 | | |
720 | | - | |
| 771 | + | |
721 | 772 | | |
722 | 773 | | |
723 | 774 | | |
| |||
730 | 781 | | |
731 | 782 | | |
732 | 783 | | |
733 | | - | |
| 784 | + | |
734 | 785 | | |
| 786 | + | |
735 | 787 | | |
736 | 788 | | |
737 | 789 | | |
738 | 790 | | |
739 | 791 | | |
| 792 | + | |
740 | 793 | | |
741 | 794 | | |
742 | 795 | | |
| |||
0 commit comments