TFTP URIs are intrinsically problematic, since: - TFTP servers may use either normal slashes or backslashes as a directory separator, - TFTP servers allow filenames to be specified using relative paths (with no initial directory separator), - TFTP filenames present in a DHCP filename field may use special characters such as "?" or "#" that prevent parsing as a generic URI. As of commit 7667536 ("[uri] Refactor URI parsing and formatting"), we have directly constructed TFTP URIs from DHCP next-server and filename pairs, avoiding the generic URI parser. This eliminated the problems related to special characters, but indirectly made it impossible to parse a "tftp://..." URI string into a TFTP URI with a non-absolute path. Re-introduce the convention of requiring an extra slash in a "tftp://..." URI string in order to specify a TFTP URI with an initial slash in the filename. For example: tftp://192.168.0.1/boot/pxelinux.0 => RRQ "boot/pxelinux.0" tftp://192.168.0.1//boot/pxelinux.0 => RRQ "/boot/pxelinux.0" This is ugly, but there seems to be no other sensible way to provide the ability to specify all possible TFTP filenames. A side-effect of this change is that format_uri() will no longer add a spurious initial "/" when formatting a relative URI string. This improves the console output when fetching an image specified via a relative URI. Signed-off-by: Michael Brown <mcb30@ipxe.org>tags/v1.20.1
|
|
||
368 |
|
368 |
|
369 |
|
369 |
|
370 |
|
370 |
|
371 |
|
|
|
|
371 |
|
|
372 |
|
372 |
|
373 |
|
373 |
|
374 |
|
374 |
|
|
|
||
459 |
|
459 |
|
460 |
|
460 |
|
461 |
|
461 |
|
462 |
|
|
|
463 |
|
462 |
|
464 |
|
463 |
|
465 |
|
464 |
|
|
|
||
486 |
|
485 |
|
487 |
|
486 |
|
488 |
|
487 |
|
489 |
|
|
|
490 |
|
|
|
491 |
|
488 |
|
492 |
|
489 |
|
493 |
|
490 |
|
|
|
||
714 |
|
711 |
|
715 |
|
712 |
|
716 |
|
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 |
|
|
717 |
|
763 |
|
718 |
|
764 |
|
719 |
|
765 |
|
|
|
||
727 |
|
773 |
|
728 |
|
774 |
|
729 |
|
775 |
|
730 |
|
|
|
731 |
|
|
|
732 |
|
|
|
733 |
|
|
|
734 |
|
776 |
|
735 |
|
777 |
|
736 |
|
778 |
|
|
|
||
748 |
|
790 |
|
749 |
|
791 |
|
750 |
|
792 |
|
751 |
|
|
|
752 |
|
|
|
753 |
|
|
|
754 |
|
|
|
755 |
|
|
|
756 |
|
|
|
757 |
|
|
|
758 |
|
|
|
759 |
|
|
|
760 |
|
|
|
761 |
|
|
|
762 |
|
|
|
763 |
|
|
|
|
793 |
|
|
764 |
|
794 |
|
|
|
||
325 |
|
325 |
|
326 |
|
326 |
|
327 |
|
327 |
|
328 |
|
|
|
|
328 |
|
|
329 |
|
329 |
|
330 |
|
330 |
|
331 |
|
331 |
|
|
|
||
1067 |
|
1067 |
|
1068 |
|
1068 |
|
1069 |
|
1069 |
|
|
1070 |
|
|
|
1071 |
|
|
1070 |
|
1072 |
|
1071 |
|
1073 |
|
1072 |
|
1074 |
|
|
|
||
713 |
|
713 |
|
714 |
|
714 |
|
715 |
|
715 |
|
716 |
|
|
|
|
716 |
|
|
717 |
|
717 |
|
718 |
|
|
|
|
718 |
|
|
719 |
|
719 |
|
720 |
|
720 |
|
721 |
|
721 |
|
|
|
||
731 |
|
731 |
|
732 |
|
732 |
|
733 |
|
733 |
|
734 |
|
|
|
|
734 |
|
|
735 |
|
735 |
|
736 |
|
736 |
|
737 |
|
737 |
|
|
|
||
749 |
|
749 |
|
750 |
|
750 |
|
751 |
|
751 |
|
752 |
|
|
|
|
752 |
|
|
753 |
|
753 |
|
754 |
|
754 |
|
755 |
|
755 |
|
|
|
||
769 |
|
769 |
|
770 |
|
770 |
|
771 |
|
771 |
|
772 |
|
|
|
|
772 |
|
|
773 |
|
773 |
|
774 |
|
|
|
|
774 |
|
|
775 |
|
775 |
|
776 |
|
776 |
|
777 |
|
777 |
|