1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 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 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 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 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 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 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 389 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 417 418 419 420 421 422 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 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 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 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 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 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 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 1331 1332 1333 1334 1335 1336 1337 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 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 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 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 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 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074
|
commit eb9111e
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 31 13:26:03 2021 +0100
Add missing files into distribution tarball
commit 52518ae
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 31 03:03:39 2021 +0100
mkfs.fat: Read geom_start from sysfs
HDIO_GETGEO which provides start member is not supported for loop block
devices. Also start member is only unsigned long so it cannot be used for
bigger disks. So instead read geom_start from sysfs and store it into long
long type to prevent overflow.
commit ed2062b
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Fri Jan 29 16:40:56 2021 +0100
Autogenerate release date in manpages
commit fca589b
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Fri Jan 29 16:40:20 2021 +0100
Update (C) and maintainers
commit c251412
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Fri Jan 29 16:33:41 2021 +0100
Add TODO comments for checking integer overflow
commit 73003cd
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jan 19 13:28:45 2019 +0100
Replace uint64_t type by unsigned long long type
commit c56ef3d
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jan 19 13:22:05 2019 +0100
Remove useless casting to uint64_t or long long in check_file()
Value of clusters * fs->cluster_size is file size and it always fits into
32bit value. So use just unsigned int type for it.
commit 2e597d6
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jan 19 13:20:16 2019 +0100
Check that file size is not larger than maximal possible size
commit 53d04ff
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jan 19 13:15:25 2019 +0100
Change fat_size type from off_t to unsigned int
Value in fat_size is result of multiplication of two 16bit unsigned values,
therefore it fits into unsigned int.
commit 2f6d8cf
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Fri Jan 29 02:10:58 2021 +0100
testsuite: Add reference images of fsck result tests
This ensures that fsck does not change its behavior and repair filesystems
in the same way. Repaired reference images were generated by dosfstools 4.1
to ensure that they are still same.
commit 5265c64
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Fri Jan 29 02:10:22 2021 +0100
testsuite: Add fsck tests for fat labels
commit 2260f80
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 3 23:22:42 2021 +0100
fsck.fat: Check and fix label
Checks the volume label from the root directory entry that is valid and
matches the label stored in boot sector.
Add new command line option -U which consider lowercase volume label as
invalid and allows only uppercase labels. By default lowercase volume
labels are allowed.
commit 77c3de9
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Tue Jan 14 00:58:21 2020 +0100
Simplify usage of validate_volume_label() function
Use new function dos_string_to_wchar_string() for converting label from DOS
OEM code page to wchar_t* string. Therefore caller does not have to supply
label in both DOS OEM encoding and locale independent wchar_t* string.
commit f89b42d
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Aug 19 18:54:07 2018 +0200
Update warning message about lowercase labels
They are working fine on MS-DOS and Windows systems.
commit 5bbae89
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Aug 15 16:35:48 2018 +0200
charconv: Add functions for converting DOS strings to locale independent wchar_t strings
Use iconv library for it. And as a fallback use internal cp850_table.
commit 3a3c1d3
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Thu Jan 28 10:39:36 2021 +0100
testsuite: Update mkfs-fat32_2_res_sects.xxd test as it is now not aligned due to -a
commit 289fa53
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jan 27 02:03:39 2021 +0100
manpages: End every sentence by a newline
commit 61390f3
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jan 27 02:01:48 2021 +0100
mkfs.fat: Do not align number of sectors when -a was specified
commit 7deb97d
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jan 27 02:00:33 2021 +0100
mkfs.fat: Document that -r and -R specify minimal number (and not exact)
commit 4e06c33
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jan 27 01:58:38 2021 +0100
fsck: Move check_dirty_bits() from boot.c to check.c
commit 738ee98
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 17 16:15:41 2021 +0100
fatlabel: Print warnings on stderr
Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=803391
commit e62e52c
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 17 19:45:26 2021 +0100
fatlabel: Do not call parts of fsck repair procedure
This change adds a new parameter for read_fat() function to indicate a mode
in which filesystem is doing to be used: Read-only, Read-write or Repair.
fsck.fat uses Repair mode and fatlabel either Read-only or Read-write
(which depends on fatlabel operation).
fatlabel cannot repair broken FAT filesystem like fsck.fat. So when trying
to modify FAT label on currupted FAT filesystem rather throw an fatal error
indicating that running fsck.fat is needed.
When fatlabel was called to just read existing FAT label, first FAT table
is corrupted and second FAT table is clean then use second FAT table.
This change also ensures that fatlabel does not print fsck/repair messages
on stdout, which should be used only for printing FAT label.
commit b8c8531
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 17 22:47:18 2021 +0100
testsuite: Add tests for DOS Clean Shutdown bit
commit 82c2111
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 17 20:20:39 2021 +0100
testsuite: Add fsck tests with broken first FAT cluster
Extend also test-fsck script to read additional arguments from .args file.
commit 82e9730
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 17 19:34:10 2021 +0100
fsck.fat: Add code for fixing first FAT cluster
This patch tries to fix infamous fsck.fat error:
Both FATs appear to be corrupt. Giving up.
It just fill again FAT media type and sets other bits to one as it is
required by FAT specification. Similar thing is doing also Windows chkdsk
tool.
In the most cases corrupted first FAT cluster is fatal error which
indicates totally corrupted filesystem impossible to repair. So fixing
first FAT cluster is not done by fsck.fat automatically and needs to be
enabled by a new -F option, which forces usage of specified FAT table
(either clean or corrupted).
commit e579a7d
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Nov 17 01:12:52 2018 +0100
mkfs.fat: Allow to specify disk geometry via new -g option
commit 9443732
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Fri Jan 8 11:49:27 2021 +0100
testsuite: Add mkfs test for 600MB large 4K disk
commit 3300839
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Oct 14 16:19:51 2018 +0200
mkfs.fat: Do not show verbose messages not relevant to selected FAT size
commit 43f0c4e
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Fri Aug 17 14:26:30 2018 +0200
mkfs.fat: Fix text of verbose messages
commit c01f78b
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Tue Aug 14 15:48:50 2018 +0200
mkfs.fat: Fix limits for number of clusters
According to Microsoft FAT specification (fatgen103.doc) disk with at least
4085 clusters and less then 65525 clusters is FAT16.
But Microsoft Windows FAT driver fastfat.sys detects disk with less then
4087 clusters as FAT12. Linux FAT drivers msdos.ko and vfat.ko detect disk
with 4085 clusters (or more) as FAT16, therefore for compatibility reasons
with both systems disallow formatting disks to 4085 or 4086 clusters.
So after this change mkfs.fat disallow to create a FAT16 which would be
misinterpreted as FAT12. Next run of cluster detection algorithm would
choose higher cluster size which decrease number of clusters.
According to specification, FAT32 is detected by at least 65525 clusters,
but Microsoft Windows FAT driver fastfat.sys, Linux FAT drivers msdos.ko
and vfat.ko detect disk as FAT32 when Sectors Per FAT (fat_length) is set
to zero.
commit 404ead8
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Aug 11 20:34:08 2018 +0200
mkfs.fat: Fix calculation of FAT32 cluster size on non 512 bytes sector disks
Previous FAT32 calculation worked correctly only for disks with 512 byte
sectors. New calculation formula is generalized variant of previous one,
but to be sector size independent.
commit e6d2fc7
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Aug 15 15:11:30 2018 +0200
mkfs.fat: Fix printing number of sectors
It is unsigned 32bit number therefore use %u format.
commit b29eb5b
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Aug 15 15:15:06 2018 +0200
mkfs.fat: Align total number of sectors to be multiple of sectors per track
This requirement is needed by DOS systems and also by Linux mtools project.
Without proper alignment, mtools applications refuse to work on such
filesystem.
commit 8c81232
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 10 22:29:48 2021 +0100
testsuite: Add referenceFAT32mbr test data to dist_check_DATA
commit 468aad7
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 10 22:16:49 2021 +0100
manpages: Escape dot in fsck.fat manpage at the beginning of the line
commit 9069ba0
Author: felix <felix.von.s@posteo.de>
Date: Mon Apr 2 22:43:46 2018 +0200
fsck.fat: properly check for valid "." and ".." entries
This change makes fsck.fat check whether "." and ".." entries exist in
all non-root directories as the two very first. If those entries are
occupied by some other file, fsck.fat will offer to move them to some
later slot. "." and ".." entries found in any other slots are treated
as ordinary bad-shortname entries. The test case for this situation has
been enabled and verified to perform as expected.
The function drop_file() was also modified so that it does not mark
dropped file clusters as free. This was necessary because otherwise
dropping too-late "." and ".." entries would delete their containing
directory. If deleted entries' clusters are truly no longer used, they
shall be picked up by a later reclamation stage.
Additionally, subdirs() and check_file() were modified not to check
unused directory entries.
Additionally-fixed-by: Dave Odell <dmo2118@gmail.com>
commit 512141a
Author: C. Masloch <pushbx@ulukai.org>
Date: Sat Oct 24 13:53:08 2020 +0200
fsck.fat: preserve info sector reserved fields
This allows the FSIBOOT stage of lDOS boot32.asm to remain
in the FSINFO sector even when the info entries are reset.
I reviewed several sources to determine whether we are in the right to
assume that the reserved 480 bytes used by FSIBOOT should be preserved
by drivers updating the FSINFO entry fields.
Quoting the document "Microsoft Extensible Firmware Initiative - FAT32
File System Specification - FAT: General Overview of On-Disk Format -
Version 1.03, December 6, 2000" on these bytes:
> [Name] FSI_Reserved1
>
> [Offset (byte)] 4
>
> [Size (bytes)] 480
>
> [Description] This field is currently reserved for future expansion.
> FAT32 format code should always initialize all bytes of this field
> to 0. Bytes in this field must currently never be used.
This specifically states that "FAT32 format code" should zero-initialise
this space. It does not specify that a driver should or should not reset
this space.
The FreeDOS kernel uses a struct [1] that does not include the space
used by FSIBOOT. Its driver's implementation [2] does preserve the
FSIBOOT area. I have verified this in dosemu2; if the FreeDOS kernel
updates the FSINFO sector it preserves this area.
The Linux kernel uses a struct with a "reserved1" member [3] which is
commented as being "Nothing as far as I can tell". If I am reading the
source correctly, its driver [4] also preserves this area when updating
the FSINFO entries.
Testing on MS-DOS version 7.10 (as bundled with MS Windows 98 SE) I
determined that it also preserves the area when updating the FSINFO entries.
The free software RxDOS/lDOS boot loader for FAT32 that I wrote uses
this reserved area to store its FSIBOOT stage, essentially an extension
to the primary boot sector loader. To avoid clashing with Microsoft
loaders which may use some of the reserved sectors, the large reserved
area in the FSINFO sector was selected to hold this stage (if sector
size is <= 512 bytes). If valid, the area starts with a signature [5]
the first four bytes of which form the letters "FSIB"; the subsequent
four bytes specify a protocol version. For example, the current
(non-experimental) version is "FSIBOOT3" [6].
If there is no FSINFO sector or the FSIBOOT signature does not match the
one expected, then the 'I' error code letter ("i"nvalid FS"I"BOOT) is
displayed and the loading is aborted [7]. Prior to this patch, if the
FSINFO entries were invalid (any of the three FSINFO signatures don't
match) and then fsck.fat was used and instructed to correct this, it
would reset the space used by FSIBOOT, rendering the image unbootable
if the lDOS boot32 loader had been installed into the image.
I previously posted a similar patch for mtools to the info-mtools
mailing list [8]. I was approached to check whether dosfstools behaved
as expected. I determined that this patch is needed to fix the corner
case of invalid FSINFO entries with FSIBOOT installed into the sector.
I also patched the lDOS instsect application [9] so it insures that the
FSINFO entries are valid while installing FSIBOOT. With either that
patch to instsect or this patch to dosfstools, FSIBOOT will always be
preserved when running fsck.fat on a file system.
[1]:
https://github.com/FDOS/kernel/blob/6e42bb6d7c6dd304f738cf0d7a2db719598f1b9e/hdr/device.h#L325
[2]:
https://github.com/FDOS/kernel/blob/6e42bb6d7c6dd304f738cf0d7a2db719598f1b9e/kernel/fattab.c#L116
[3]:
https://github.com/torvalds/linux/blob/7cf726a59435301046250c42131554d9ccc566b8/include/uapi/linux/msdos_fs.h#L163
[4]:
https://github.com/torvalds/linux/blob/7cf726a59435301046250c42131554d9ccc566b8/fs/fat/misc.c#L60
[5]: https://hg.ulukai.org/ecm/ldosboot/file/aa15fd7bc58e/boot32.asm#l1164
[6]: https://hg.ulukai.org/ecm/ldosboot/file/aa15fd7bc58e/boot32.asm#l27
[7]: https://hg.ulukai.org/ecm/ldosboot/file/aa15fd7bc58e/boot32.asm#l775
[8]: https://lists.gnu.org/archive/html/info-mtools/2020-10/msg00000.html
[9]: https://hg.ulukai.org/ecm/instsect/rev/eee5dfaa52f6
commit 201665c
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Feb 16 12:33:32 2020 +0100
mkfs.fat: Update --help for -h (hidden sectors)
commit 25da96e
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Feb 16 12:22:04 2020 +0100
mkfs.fat: Relax -D option (BIOS drive number)
Allow to specify also second hard disk (0x81) or second floppy device
(0x01) as -D option = BIOS drive number.
commit bce0940
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Feb 17 18:59:54 2019 +0100
manpages: Update mkfs.fat manpage about FAT32 backup boot sector
commit da36707
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Feb 17 11:48:32 2019 +0100
mkfs.fat: Write FAT32 backup info sector after FAT32 backup boot sector
Write it only in the case when location does not conflict with real/primary
FAT32 info sector and reserved area is big enough.
commit 5b61d9f
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Feb 17 11:01:15 2019 +0100
testsuite: Run fsck test step always even if mkfs test step fails
fsck test step can show more details about badly created image by mkfs.
commit 53bfa1f
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Feb 17 10:56:06 2019 +0100
testsuite: Add test for mkfs.fat with two FAT32 sectors in reserved area
commit 3cca83a
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Feb 17 10:36:33 2019 +0100
mkfs.fat: Fix setting location of FAT32 backup boot sector
For FAT32 if there are only two sectors in reserved area, first must be
boot sector and second must be FAT32 fs info sector. And there would not be
FAT32 backup boot sector as it is optional. FAT32 info sector is for FAT32
media mandatory.
When backup_boot variable is set to zero it means that no FAT32 backup boot
sector is written. Check that FAT32 backup boot sector differs from FAT32
info sector is already there.
Also allow user to specify zero for -b option which disable creating of
FAT32 backup boot sector.
commit c5e35e7
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Feb 17 10:34:24 2019 +0100
mkfs.fat: Put FAT32 info sector number into variable
Also check that it is not same as backup boot sector value.
commit d276ddb
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Feb 17 10:32:08 2019 +0100
mkfs.fat: Rename info_sector buffer variable to info_sector_buffer
Also call free() unconditionally as it does nothing for NULL argument.
commit 5e936c9
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Nov 24 19:45:39 2018 +0100
mkfs.fat: Remove dependency on systemd/udev
There is no need that mkfs.fat depends on systemd. It uses it only for
reading additional information about block device.
This patch replace systemd/udev dependency code by reading those additional
information about block device directly from sysfs.
So no functionality of mkfs.fat is lost or removed.
commit 18a05e7
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jan 5 00:58:41 2020 +0100
manpages: Fix '. SF' file names
commit 7e6d7d3
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Nov 24 18:18:53 2018 +0100
manpages: Fix switching to previous font style
In troff manpage language previous font style is selected by "\fP"
sequence, not by "\fR". "\fR" selects roman font style.
commit ffa5dfa
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Nov 18 21:14:24 2018 +0100
manpages: Fix formatting of bullets
In troff manpage language bullet is written as "\(bu".
commit bc65dd6
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Nov 18 21:10:29 2018 +0100
manpages: Fix formatting of emphases
To emphasize use italic font style instead of putting word into two
apostrophes. Ascii apostrophe in troff manpage language means "right single
quotation mark", therefore putting word into two apostrophes is fully
wrong.
Also arguments and file names should be formatted in italic.
commit 0273989
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Nov 18 21:01:55 2018 +0100
manpages: Fix formatting of hyphens, en and em dashes
In troff manpage language ascii minus is written as "\-", mathematical
minus as "\(mi", hyphen as "-", en-dash as "\(en" and em-dash as "\(em".
commit c85c863
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Oct 21 12:58:19 2018 +0200
manpages: Clarify unit of BLOCK-COUNT
BLOCK-COUNT is always in KiB unit independently of the disk sector size,
FAT sector size or FAT cluster size.
commit 69fcfe5
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Aug 19 16:35:22 2018 +0200
fsck.fat: Check for DOS Clean Shutdown bit
DOS Clean Shutdown bit in first reserved FAT entry is cleared when DOS or
Windows FAT driver mounts a volume and set is back when doing unmount.
Therefore set this bit when clearing FAT dirty bit in boot sector.
commit 68e8e54
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jan 4 14:53:28 2020 +0100
mkfs.fat: Calculate CHS geometry according to SD Card Part 2 File System Specification
Use this CHS calculation when disk geometry is not available. This change
replaces hardcoded 64/32 value by formula based on total number of sectors.
For SD cards with more then 256MB capacity is CHS calculation according to
SD Card Part 2 File System Specification same as CHS calculation for hard
disks via LBA-Assist Translation.
commit 5199d68
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Aug 19 09:57:41 2018 +0200
mkfs.fat: Add a new option --mbr which fills MBR table with one partition
It is needed only for non-removable disks used on Microsoft Windows systems
and only when formatting whole unpartitioned disk.
Also some removable USB flash disks accessed via USB Mass Storage declares
themselves as non-removable and Microsoft Windows systems do not recognize
them without MBR partition table and MBR disk signature.
Because MBR sector and first FAT sector are very similar (starts with
boot code, ends with boot sign 0xAA55) they can live together at one
sector. Moreover location of the MBR partition table overlaps only with the
end of FAT boot code where is just place for the error message, it is
possible to fill (fake) MBR partition table with one partition which refers
to whole disk itself (starts at sector 0 and spans whole disk).
Similar thing is doing mformat (FAT12/16/32 formatting tool) from mtools
project or mkudffs (UDF formatting tool) from udftools project.
commit 9f856b7
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon Jan 27 22:12:38 2020 +0100
charconv: Do not use %lc format modifier for wide char which cannot be converted to multibyte string
commit 032ec02
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Tue Jan 14 00:27:31 2020 +0100
charconv: Fix usage of iconv() for state-dependent encodings
After first main iconv() call set conversion state to the initial state and
store corresponding shift sequence to output buffer via second iconv() call.
commit 4428d7d
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon Jan 13 23:15:22 2020 +0100
charconv: Fix checks for overlong input strings
commit 2779d70
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jan 8 01:03:24 2020 +0100
charconv: Use ICONV_CONST macro to fix compile warnings with GNU libiconv
Macro ICONV_CONST is defined by autoconf and expands either to "const" or
nothing based on what API provides iconv() implementation, either according
to SUSv2 or POSIX.1-2001/POSIX.1-2008.
commit 565d7a2
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jan 8 01:02:16 2020 +0100
charconv: Fix check for return value of iconv
iconv() returns (unsigned) size_t type, so its return value is always
different from (signed) negative -1. To compare with -1 it first needs to
be casted to size_t type.
commit e9b42f5
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jan 8 00:44:27 2020 +0100
charconv: Increase buffer size for output strings in current locale
MSDOS_NAME * 4 does not have to be enough size as iconv in translit mode
can return also 5 bytes per one wide character.
commit 1403c53
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jan 8 00:42:35 2020 +0100
charconv: Fix buffer overflows by specifying output buffer size
commit 917846b
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Tue Jan 7 00:54:15 2020 +0100
charconv: Fix put_char() function
Ensure that this function always print characters according to current
locale. So do not treat characters above 0xA0 as printable when
dos_char_to_printable() cannot process them.
commit 6dc68a8
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Tue Jan 7 00:52:43 2020 +0100
charconv: Fix comment for init_conversion() function
commit 2d6c37d
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Tue Jan 7 00:52:25 2020 +0100
charconv: For internal CP850 conversion add translit table
This CP850 translit table was created by iconv ASCII//TRANSLIT as a 7bit ASCII fallback.
commit 3ccfe29
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Tue Jan 7 00:50:09 2020 +0100
charconv: As a fallback try to use also non-translit iconv conversion
commit 1b72fdf
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon Jan 6 18:30:28 2020 +0100
charconv: Use const for input strings
commit 102aa76
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon Jan 6 18:29:30 2020 +0100
charconv: Rename third argument of local_string_to_dos_string()
Correct name is out_size as it is size of output buffer and not length of string.
commit 49cc12a
Author: Lennart Poettering <lennart@poettering.net>
Date: Mon Aug 3 12:17:12 2020 +0200
mkfs: fsync() the block device before exiting
Let's make sure to sync the block device, before exiting. Otherwise, if
we operate on a loop device and people issue "losetup -d" right after
this command finishes our in-flight writes might never hit the disk.
(This took 4h of my life for me to figure out. The mkfs for all other
file systems I tested appear to synchronize when done, hence fat should
do too.)
commit cc75143
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon Jan 27 22:22:35 2020 +0100
mkfs.fat: Mark struct fat32_fsinfo as packed
commit f8f455b
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon Jan 27 22:25:20 2020 +0100
fatlabel: Update documentation about DOS codepage
commit 3ce32fa
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jan 4 15:27:59 2020 +0100
mkfs.fat: Clarify licensing of the dummy boot sector
Original author H. Peter Anvin allowed to put mkfs.fat boot sector code
into the public domain.
commit 8dc8976
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Fri Feb 14 00:00:27 2020 +0100
manpages: Update documentation about hidden sectors
Fixes #29
commit 17be357
Author: David Gumberg <davidzgumberg@gmail.com>
Date: Sun Oct 13 18:21:57 2019 -0600
Get cross-platform libc6 generically
commit 5e2529e
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon Oct 14 12:21:36 2019 +0200
travis: use if ... fi construction
As single test command has side effect in return value for Travis.
commit 20092b8
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon Oct 14 12:14:07 2019 +0200
travis: Check for fatlabel test errors only for non-static builds
Static builds have broken iconv support which is detected at configure time
as usable. This leads to usage of internal CP850 conversion table as
fallback solution which throws runtime non-fatal error.
commit a4a0d62
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon Oct 14 09:48:43 2019 +0200
tests: Check for stderr errors from fatlabel tests
commit 84a8d1c
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jun 23 12:01:48 2019 +0200
charconv: Update Travis configuration
Use autogen.sh instead of non-working autoreconf and test also
static linked versions and configurations without iconv.
commit b657ede
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Jun 23 10:47:44 2019 +0200
charconv: Add autogen.sh script
AM_ICONV macro depends on gettext installation. Unfortunately autoreconf is
not able to install config.rpath file so do it manually in autogen.sh.
See reported bug:
https://lists.gnu.org/archive/html/bug-gettext/2011-10/msg00012.html
commit 0dec6a7
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jun 22 22:14:31 2019 +0200
charconv: Fix sources for testdevinfo target
testdevinfo does not use any of charconv functions, nor any of mkfs
functions. So do not link charconv/mkfs into testdevinfo.
This fixes linking problems when iconv functions are not present in
standard libraries.
commit 664192e
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jun 22 01:23:54 2019 +0200
charconv: Check return value of all set_dos_codepage() calls
commit 6d49a1f
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jun 22 01:16:44 2019 +0200
charconv: Check presence of iconv
Use autoconf AM_ICONV macro for it. AM_ICONV should handle both cases when
iconv_open is available in external libiconv library or as part of libc
library.
To force compilation of dosfstools without iconv support there is a new
configure option --without-iconv.
commit fa9761f
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jun 22 01:14:37 2019 +0200
charconv: Fix return value from iconv_init_codepage function
commit d74c592
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jun 22 01:12:46 2019 +0200
charconv: Add fallback to internal CP850 table
Static linked version of glibc does not contain iconv with CP850 support.
As CP850 is default code page for all dosfstools programs add own internal
implementation which will be always supported. It would be used only in
case iconv_open() fails.
commit 91978a2
Author: Michael Forney <mforney@mforney.org>
Date: Fri Jun 7 08:48:13 2019 -0700
Use static inline function instead of statement expression
commit e06e759
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jun 5 09:25:52 2019 +0200
Fix Travis CI configuration for powerpc and arm
commit fc55b63
Author: Noé Rubinstein <nrubinstein@aldebaran.com>
Date: Mon Aug 31 15:19:57 2015 +0200
mkfs: document --offset in the man page
commit f473459
Author: Noé Rubinstein <nrubinstein@aldebaran.com>
Date: Thu Jul 2 15:49:06 2015 +0200
Allow specifying an offset in the device file in mkfs
commit 93b4288
Author: Tobias Stoeckmann <stoeckmann@users.noreply.github.com>
Date: Sun Feb 24 20:55:15 2019 +0100
Fix out of boundary read in fsck.fat/fatlabel
Faulty filesystems are able to trigger integer overflows in read_boot which eventually lead to insufficient allocation of memory for the FAT and therefore out of boundary reads.
commit af3e50d
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Aug 12 12:15:45 2018 +0200
device_info: Fix parsing partition number
Ensures that it is always valid number which does not overflow or
underflow.
commit 086e13c
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Aug 12 12:15:21 2018 +0200
mkfs.fat: Fix parsing of block number
Block number must not be negative. It is 32bit so use long long type and
strtoll() function to ensure that converted positive 32bit value would fit
into type.
commit a2b97c9
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Aug 12 12:13:35 2018 +0200
mkfs.fat: Fix validation of numeric command line arguments
Ensures that argument is always valid number which does not overflow or
underflow.
commit 07e63ac
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Aug 12 11:56:32 2018 +0200
mkfs.fat: Fix validation of volume ID
Use same logic as in fatlabel.
commit 425a415
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Aug 11 22:49:37 2018 +0200
fatlabel: Fix validation of volume ID
Standard C function strtoull() does not signal underflow, therefore it
cannot be used for conversion of arbitrary string to integer with detection
of failure.
Instead use function strtoll() and detect underflow (negative value)
manually.
Note that strto* functions skips and ignores leading whitespace characters,
so detects them manually via standard C function isspace().
commit da07aa4
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Jan 19 09:48:25 2019 +0100
Update Travis configuration
* Use both gcc and clang compilers
* Compile with -fwrapv and -fsanitize=address
* Compile in both 32 and 64 modes for x86 systems
* Cross compile for little endian arm and big endian powerpc
* Run cross compiled binaries in qemu
commit a6ec69d
Author: Tobias Stoeckmann <tobias@stoeckmann.org>
Date: Mon Jan 14 22:47:40 2019 +0100
Renamed len to out_size.
As pointed out by pali it makes sense to rename len to out_size
to make explicitly sure by proper naming that this is the actually
available memory size at "out", not the length of a string.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
commit 6080fe2
Author: Tobias Stoeckmann <tobias@stoeckmann.org>
Date: Mon Jan 14 19:36:11 2019 +0100
Fixed off-by-one in local_string_to_dos_string.
The function local_string_to_dos_string is vulnerable to an off-by-one
buffer overflow. In fact, it is triggered in default usage and becomes
visible when compiled with ASAN:
$ CFLAGS="-fsanitize=address" ./configure
$ dd if=/dev/zero of=example.iso bs=1024 seek=64 count=1
$ ./src/mkfs.fat example.iso
mkfs.fat 4.1+git (2017-01-24)
=================================================================
==3857==ERROR: AddressSanitizer: stack-buffer-overflow on address ...
The problem is that the argument "len" to local_string_to_dos_string
stores the length of the output buffer. Yet it can also be used as an
index to store '\0':
If the whole "out" buffer has been written to, bytes_out is 0 and
the assignment in out[len-bytes_out] therefore leads to an off-by-one.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
commit 332fc29
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Nov 18 20:47:29 2018 +0100
Fix memory leaks in read_fat() function
Function read_fat() allocates memory to the user supplied buffer. Therefore
that function needs complement function for releasing allocated memory and
user needs to call if after finish its work.
This patch fixes memory leaks in fsck.fat and fatlabel tools.
Fixes #13
commit 4cfd643
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sat Sep 29 10:08:12 2018 +0200
mkfs.fat: Fix endianity for hidden_sectors
Global variable hidden_sectors is in host byte order.
commit a874650
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Tue Aug 14 21:13:52 2018 +0200
mkfs.fat: Add some workaround for Year 2038 Bug
Check return values of time(), gmtime() and localtime() function which may
fail. Fallback to date/time 1.1.1980 00:00:00 when those functions fail.
For generating volume id, add fallback code based on rand() function.
commit 607fbed
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Tue Aug 14 20:57:27 2018 +0200
fsck.fat: Fix Year 2038 Bug
Do not use time_t type and strftime() function which are affected by the
Year 2038 Bug. Instead parse date/time directly from DOS format which
avoids conversion from DOS to UNIX + conversion from UNIX to string.
commit fb0cc0d
Author: Andreas Bombe <aeb@debian.org>
Date: Tue Aug 14 12:58:58 2018 +0200
Fix gcc sprintf() length warnings
There are two sprintf() calls that receive warnings from current
versions of gcc for possibly overrunning the temporary buffers they're
writing into.
The first one in src/check.c is theoretically safe since strftime()
shouldn't generate such a long string. Reduce the maximum length of the
strftime() string to fix this warning. Also detect strftime() errors
and overwrite the buffer with a message in that case.
The second one in src/boot.c should not be possible and is a limitation
of gcc's detection. It assumes that %02x could write up to 8
characters, even though the arguments are pointers to uint8_t which
can't be more than two characters. Placate gcc by lengthening the
temporary buffer by 12 bytes.
commit ca54953
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon May 7 09:27:16 2018 +0200
mkfs.fat: Add support for --codepage option for label and validate it
commit 40da1b2
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Mon May 7 09:26:42 2018 +0200
fatlabel: Implement proper checks when setting new label
According to Microsoft FAT specification "fatgen103.doc" there are
following restrictions for FAT label stored in root directory:
* DIR_Name[0] may not equal 0x20.
* Lower case characters are not allowed in DIR_Name (what these characters
are is country specific).
* The following characters are not legal in any bytes of DIR_Name:
- Values less than 0x20 except for the special case of 0x05 in
DIR_Name[0]
- 0x22, 0x2A, 0x2B, 0x2C, 0x2E, 0x2F, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F,
0x5B, 0x5C, 0x5D, and 0x7C
And another Microsoft "FAT32 Spec (SDA Contribution).pdf" describe:
* DIR_Name[0] cannot equal 0x20 (in other words, names cannot start with a
space character).
commit 4f953bb
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Jun 11 14:21:17 2018 +0200
Remove long file name when changing short file name
In the current state, long file names are poorly supported and in case
the file got automatically or manually renamed in auto_rename() or
rename_file(), only the short file name would be manipulated.
Only the checksum would be fixed to have the LFN stay valid. This would
cause issues such as the rename being hidden by the unchanged LFN or
duplicate LFNs remaining if they were the cause for a rename.
Change so that existing LFNs are removed for files being renamed.
commit b356cf0
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Jun 11 14:17:03 2018 +0200
Print error message when auto_rename() is called on FAT32 root directory
Use the same error message as rename_file() uses for the same reason
when called on the FAT32 root directory pseudo file rather than silently
ignoring.
commit 8c4122e
Author: felix <felix.von.s@posteo.de>
Date: Mon Jun 11 04:35:35 2018 +0200
Fix allowing changes in SFNs reporting bogus error on FAT32 root directory
The code to permit spaces in short filenames introduced in commit
4d01db7c6 caused the root directory pseudo file to be checked for a bad
name. Since the name for that file is not set (zeroed out), bad_name()
would report an error. Attempting to fix it would do nothing as the
rename functions check for and ignore the root directory.
Fix by checking for the root directory in bad_name().
commit 96e6efd
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Jun 10 03:09:14 2018 +0200
fsck: Fix -S option not being recognized
The call to getopt_long() did not include the -S option, so that it was
not recognized even though its handling was implemented.
commit 4d01db7
Author: felix <felix.von.s@posteo.de>
Date: Mon Apr 2 10:20:10 2018 +0200
fsck.fat: Allow spaces in the middle of SFNs
Also, introduce an -S option (mostly) restoring previous behaviour.
commit c74ca0c
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Mar 7 18:00:15 2018 +0100
manpages: Add section DOS CODEPAGES to fatlabel
Table was extracted from the National Language Support (NLS) API Reference:
https://www.microsoft.com/resources/msdn/goglobal/default.mspx?OS=Windows+7
And filtered by codepages supported by GNU libiconv.
commit b665a93
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Mar 7 17:59:50 2018 +0100
fatlabel: Add support for --codepage option
FAT label in both boot sector and root directory is stored according to
current OEM code page. Microsoft Windows system treat FAT label really in
this way. In most cases OEM code page is just 8bit extension of the
printable ASCII, therefore for ASCII-only labels there is no change.
By default OEM code page 850 is used which contains most of the characters
that are also available in ISO-8859-1. Same default which is used by
fsck.fat and mlabel (from mtools project).
commit 76c0362
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Mar 7 17:58:05 2018 +0100
fsck.fat: Change default DOS codepage to 850
The reason for change is that 850 is more common on Windowes and used by
more regions as 437. Also it contains most of the characters that are also
available in ISO-8859-1. And 850 is also default DOS code page used by
mtools, which is used on Linux.
commit 18ed349
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Mar 7 17:57:23 2018 +0100
Initialize iconv "from codepage" with //TRANSLIT
This would allow to show characters from DOS codepage on systems which
current locale does not support it via transliteration.
For example byte E8 in DOS CP437 (e with a grave accent) does not have
representation in Linux locale Latin2. But it can be shown after
transliteration as simple character "e".
commit 08d743c
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Mar 7 17:57:13 2018 +0100
Initialize only LC_CTYPE locale
LC_ALL is not needed as locale is used just for CODESET. LC_CTYPE is enough
for using nl_langinfo(CODESET).
commit 2112913
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Sun Apr 8 11:37:29 2018 +0200
Add tests for FAT32 labels
These FAT32 images were generated for FAT label test suite in October 2017.
Now fatlabel reports same FAT32 label as MS-DOS 6, 7 and Windows 98, XP, 10.
For more information about test result see email:
https://www.spinics.net/lists/kernel/msg2640891.html
commit bfeedfc
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Thu Nov 9 21:25:05 2017 +0100
mkfs.fat: Correctly process 0xe5 as first character of directory entry
Same as commit 51da71aa9edc36fabf83323282f14e7ee71aa07b but for mkfs.fat.
commit 1b866f4
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Thu Nov 9 21:25:01 2017 +0100
fsck.fat: Handle 0xe5 as first character of directory entry
Same as commit 51da71aa9edc36fabf83323282f14e7ee71aa07b but for fsck.fat.
commit 5b702a7
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Thu Nov 30 00:07:39 2017 +0100
manpages: Add section COMPATIBILITY and BUGS to fatlabel
commit 900edb6
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Thu Nov 30 00:07:22 2017 +0100
fatlabel: Optimize size of the binary
Move implementation of the alloc_rootdir_entry() function from the check.c
to boot.c and do not link unneeded objects files into fatlabel binary.
This would decrease size of the fatlabel binary nearly by half. With -g -O2
size before was about 194131 bytes and after just 104497 bytes.
commit 0901aa8
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Thu Nov 30 00:07:05 2017 +0100
fatlabel: Clear ATTR_VOLUME from directory entry when removing label
Older versions of fatlabel ignored FAT entries with deletion mark 0xE5 and
tried to read labels also from those entries. This fix clear ATTR_VOLUME so
older versions would not try to read label from deleted entry.
commit cb8e674
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Thu Nov 30 00:06:51 2017 +0100
fatlabel: Print label without padding spaces
Every entry in FAT directory is padded with spaces, which are not part of
entry name. Therefore show also label from root FAT directory without those
padding spaces.
commit d822d5b
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Thu Nov 30 00:06:36 2017 +0100
fatlabel: Show only label stored in root directory
MS-DOS 6.22, MS-DOS 7.10, Windows 98, Windows XP and also Windows 10
ignores label stored in boot sector. When label in boot sector is non-empty
and label in root directory is missing then they treat situation as there
is no label for particular disk. So when labels in boot sector and root
directory are out of sync, fatlabel shown different label as those MS-DOS
and Windows systems. To make behavior between DOS, Windows and Linux
consistent, ignores label in boot sector also in fatlabel.
commit c598354
Author: Ashe David Sterkehus <ashe.goulding@gmail.com>
Date: Wed Nov 22 00:20:40 2017 +0900
mkfs: Check volume label given with -n is no longer than 11 characters
Fixes #70
commit 87a8f29
Author: Will Newton <willn@resin.io>
Date: Thu Aug 31 10:42:13 2017 +0100
src/check.c: Fix up mtools created bad dir entries
mtools writes uninitialized data to the case field of some
directory entries. Running fsck.fat on these filesystems
will cause the directory to get deleted which can lead to
data loss. Detect this situation and clear the flag instead.
mtools patch to fix the original issue:
https://lists.gnu.org/archive/html/info-mtools/2014-08/msg00000.html
Signed-off-by: Will Newton <willn@resin.io>
commit fe3ada3
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 15 16:26:01 2017 +0200
manpages: Remove formatting from NAME sections where it doesn't belong
The .SH NAME sections are supposed to contain just "name \- description"
with no bolding on the name.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 0d2d2b2
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 15:17:13 2017 +0200
manpages: Clarify rules for volume labels as implemented
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 86fa0d8
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 15:16:12 2017 +0200
manpages: Make SEE ALSO sections conform to conventions
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 5cdad55
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 03:57:59 2017 +0200
Harmonize unknown command line option handling
Now all binaries will show help and not try to print something like
"unknown option '?'" because '?' is the value getopt_long() returns when
it encounters an unknown option. At this point, getopt_long() has
already printed the problem to stderr so we don't have to.
The default action on getopt_long() return values (neither known option
nor '?') is to report an internal error with the unexpected value.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 34fd8eb
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 03:04:00 2017 +0200
fatlabel: Add new -r, --reset option
This new option removes the label or generates a new serial number if in
volume ID mode.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit e4e346f
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 02:43:03 2017 +0200
fatlabel: Don't access element of argv array that may not exist
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 17dea47
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 02:27:31 2017 +0200
Move generation of serial number into new function generate_volume_id()
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 07f0238
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 02:17:41 2017 +0200
Add remove_label() function
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit ce7e7f9
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 01:42:55 2017 +0200
fatlabel: Refuse empty strings as labels
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 51da71a
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 01:28:32 2017 +0200
Handle 0xe5 as first character of volume label
Directory entries are not allowed to have 0xe5 as the first character as
that is the marker for deleted entries. Instead, these have to be
converted to 0x05 on writing and the other way on reading.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 3a1aac1
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 01:11:05 2017 +0200
Remove leftover handling of split directory entry name
The name field in DIR_ENT used to be split into name and ext. Reading
the volume label from a DIR_ENT used to require merging the contents of
both fields and that handling was still there as reading parts of the
same name field and merging them. Simply read in one go instead.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 04aca69
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 00:54:12 2017 +0200
Terminate volume label search at end of directory
In find_volume_de() there is no point in scanning the directory entries
after the first end of directory marker (name starts with a zero byte).
Simply return 0 if end of directory is encountered.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 747c8f9
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Oct 1 00:46:05 2017 +0200
Avoid returning deleted directory entries as labels
In find_volume_de(), only the attributes were tested to decide whether a
directory entry was a volume label. This could lead to deleted entries
being returned. Check the name for deleted or unallocated marker to
prevent this.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 0a733d8
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jul 5 20:44:00 2017 +0200
fatlabel: Fix erasing label
Empty label needs to be stored as "NO NAME ". Like in mkfs treat label
which starts with character 0xE5 as empty.
commit e1397b9
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Wed Jul 5 20:37:17 2017 +0200
mkfs: Handle -n "" correctly
When user specify empty argument for -n, then it is empty label and needs
to be transformed to NO_NAME. Also treat -n argument which starts with
character 0xE5 as empty because label is stored also in root FAT directory
and such entry is marked as deleted.
Fixes #54
commit 2afb699
Author: Pali Rohár <pali.rohar@gmail.com>
Date: Thu Sep 28 10:13:56 2017 +0200
fatlabel: Fix parsing volume ID
* Do not allow specifying empty argument as volume ID
* Check for errno (as general error) after more specific errors
Fixes #64
commit 7ddcf9b
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Sep 25 01:21:23 2017 +0200
fatlabel: Implement volume ID mode
When given the new -i or --volume-id option, fatlabel will display or
change the volume ID (serial number) instead of the volume label. The ID
is displayed as an 8 digit hexadecimal number, when changing it must
also be given as a hexadecimal number that fits within 32 bits.
Fixes #52
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 20a3e0f
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Sep 25 00:36:33 2017 +0200
Add write_serial() function
write_serial() works like write_boot_label() but sets the volume ID
instead of the volume label in the boot sector.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit d7c9ffa
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Sep 25 00:07:17 2017 +0200
Make fs_open() path argument const char*
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 06c2d11
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Sep 24 22:32:16 2017 +0200
Read volume ID in read_boot()
The DOS_FS struct gets a new 32 bit field "serial" and read_boot() will
now read the volume ID into this field.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit e501243
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Sep 21 15:20:33 2017 +0200
fatlabel: Expand help message by description and options
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 944ffe4
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Sep 21 15:15:54 2017 +0200
fatlabel: Change option parsing to getopt_long()
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 33dd224
Author: Andreas Bombe <aeb@debian.org>
Date: Sat Aug 5 20:02:04 2017 -0400
Warn that -r is useless with FAT32 filesystems
The option -r specifies the root directory size that neither is nor can
be fixed on FAT32. If generating a FAT32 filesystem and this option is
specified, warn the user that it has no effect.
Fixes #43
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit ed9facf
Author: Jakub Wilk <jwilk@jwilk.net>
Date: Tue Jul 11 01:01:20 2017 +0200
Fix signed integer overflow in FSTART
uint16_t was promoted to int, and then left shift could overflow it.
Add explicit cast to uint32_t to avoid undefined behavior.
Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 995d814
Author: Emanuel Czirai <xftroxgpx@gmail.com>
Date: Fri May 5 22:43:54 2017 +0200
add missing \n
To fix this:
```
Starting check/repair pass.
FATs differ but appear to be intact.1) Use first FAT
2) Use second FAT
[12?q]?
```
commit 9d822ba
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Jun 29 20:56:03 2017 +0200
mkfs: List all options with short descriptions in --help message
Make the help message more informative by giving a short description,
simplifying the usage line and giving a short description of every
option. The usage line now also shows the actual executable name instead
of a hardwired 'mkfs.fat'.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 32b3bce
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Jun 28 15:17:33 2017 +0200
mkfs, fsck: Add --variant=TYPE command line option
TYPE can be 'standard' or 'atari' (case insensitive) to select the
desired mode rather than having to toggle with -A.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 6fc9004
Author: Andreas Bombe <aeb@debian.org>
Date: Tue May 30 21:26:44 2017 +0200
manpages: Rework the intro of the mkfs man page
Acknowledge that image files can be used in place of device files.
Remove mentions of "under Linux" since it has been portable for a while.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit bbbd077
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Apr 21 20:47:32 2017 +0200
manpages, configure.ac: Correct description of Atari format selection
The -A option doesn't turn on (or turn off) Atari format selection, it
toggles it with every occurrence. Change wording in the man pages to
reflect that.
Also mention that automatic selection can happen only on 68k Atari Linux
in the man pages and the --enable-atari-check option help in
configure.ac.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 9fa180c
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Apr 6 20:47:11 2017 +0200
Disable legacy check for 68k Atari by default
The code that checked for Atari hardware when compiled for the 68k
architecture is now disabled by default. A new configure option
--enable-atari-check allows enabling it again.
In addition to the the new configure option and the symbol __mc68000__
it also depends on __linux__, since its implementation checks Linux
specific /proc files.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit d0c8900
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Apr 5 20:40:33 2017 +0200
Move all three check_atari() and atari_format definitions to common.c
Now that mkfs is also using common.c, all three identical check_atari()
definitions from mkfs, fsck and fatlabel can be combined in a single
location in common.c
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit a753734
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Apr 5 20:29:20 2017 +0200
mkfs: Link with common.c and use its die() implementation
Now common.c is linked into mkfs and its die() implementation is used
instead of the local implementation. That implementation consisting of a
die() macro and fatal_error() function has been removed.
To reproduce current messages exactly, there is now a program_name
variable in common.c. If it is not NULL, die() will prepend its contents
to the message it prints.
The previous implementation implicitly passed device_name to the
printf() so that die() invocations only needed to put "%s" where they
wanted the device name to appear in the string. These invocations now
have explicit device_name arguments.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit b0d524d
Author: Andreas Bombe <aeb@debian.org>
Date: Tue Apr 4 20:42:02 2017 +0200
fsck.fat.h: Remove extern declarations of interactive and write_immed
These two declarations were forgotten when the variables moved to
common.c.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 2af848f
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Apr 3 20:53:14 2017 +0200
fsck: Switch to getopt_long() option parser and add --help option
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit c0c3141
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Apr 3 20:45:20 2017 +0200
fsck: Pass the exit value to use to usage()
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 112bdc6
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Apr 3 20:41:31 2017 +0200
fsck: Clean up usage() message a little
Bring the usage() help message more in line with common conventions.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 4d2273a
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Mar 31 14:41:42 2017 +0200
mkfs.fat.c: Change misleading comment about FAT32 selection
There was an apparently very old comment in setup_tables() about FAT32
not yet being chosen automatically. If a specific FAT size is not
requested from the command line, establish_params() will previously have
set size_fat to 32 when the filesystem size is at least 512 MiB.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 8585962
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Mar 24 20:40:12 2017 +0100
fsck: Add quit choice to interactive prompts
All prompts now get an additional 'q' choice to explicitly quit fsck.
Selecting 'q' will print a message detailing the situation and ask for
confirmation.
Since the message describing the situation depends on whether fsck is in
immediate-write mode, the variable selecting that is moved to common.c
to make it accessible to the get_choice() function.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit c366076
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Feb 23 21:00:59 2017 +0100
fsck: Make prompts asking for writing changes at end more verbose and clear
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 141b009
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Feb 22 20:07:25 2017 +0100
fsck: Don't ask whether to perform changes in immediate write mode
When all changes have already been written directly, it is useless to
ask whether to commit the changes and probably confusing to the user.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit b2cfd70
Author: Andreas Bombe <aeb@debian.org>
Date: Tue Feb 21 21:36:04 2017 +0100
Remove get_key()
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 0c1c5fc
Author: Andreas Bombe <aeb@debian.org>
Date: Tue Feb 21 21:24:14 2017 +0100
Overhaul interactive prompts
All uses of get_key() are converted to get_choice() and fsck now
disables canonical terminal mode to directly get key presses. It is no
longer required to press enter after typing the choice and it is no
longer possible to enter whole strings where only a character is
expected. The reaction to invalid input should be consistent now (i.e.
always repeat the prompt).
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 91b20bd
Author: Andreas Bombe <aeb@debian.org>
Date: Tue Feb 21 21:14:43 2017 +0100
Add get_choice() function
The get_choice() function is intended to supersede get_key(). It takes
pairs of return values and strings for every choice and a
non-interactive default choice, does the prompting and reading of user
input (if interactive) and returns the value for the selected choice.
Since it needs to know if it runs in interactive mode, the "interactive"
variable has been moved to common.c and removed from fsck.fat.c and
fatlabel.c.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit fd92fab
Author: Andreas Bombe <aeb@debian.org>
Date: Tue Feb 21 14:15:12 2017 +0100
Add get_line() function to read user input in canonical mode
The function will first save the terminal state and enable canonical and
echo mode, display a prompt, call fgets(), then restore previous
terminal mode. This allows it to work correctly regardless of the
current terminal mode.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 0155c9c
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Feb 20 14:09:43 2017 +0100
Add asprintf() wrapper
Make xasprintf() a wrapper that calls asprintf() and terminates if an
error occurs like the alloc() function does for malloc(). The
availability of the non-standard asprintf() call is checked in
configure.ac and xasprintf() uses a local implementation if it isn't.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 09769e6
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Feb 10 14:06:40 2017 +0100
Fix printf format specifier for printing label
Fix a mistake introduced in the last commit where a field width instead
of precision was given for rendering a fixed length string (without null
termination).
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 08cf67b
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Jan 26 21:31:03 2017 +0100
Turn label in struct DOS_FS into char array from pointer
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 32eff6f
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Jan 26 21:27:19 2017 +0100
Append +git to version number
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 820c2f9 (tag: v4.1)
Author: Andreas Bombe <aeb@debian.org>
Date: Tue Jan 24 13:10:23 2017 +0100
Releasing version 4.1
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit cad2c17
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Jan 23 03:10:56 2017 +0100
fatlabel: Make sure printf style patterns in label are not expanded
Writing a label to an unlabeled filesystem involves creating a root
directory entry to contain the label. For this, the
alloc_rootdir_entry() function used for creating new directory nodes for
recovered orphan cluster chains is reused. However, this expects the
filename to be a printf style pattern to generate a unique name.
If the filesystem is unlabeled and the new label contains a printf
specifier other than %d or similar, the attempted expansion of the
pattern might crash fatlabel.
Change alloc_rootdir_entry() to take an additional argument gen_name and
only expand the name if its value is true.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 77371e2
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Nov 4 13:10:58 2016 +0100
testsuite: Add missing fsck test files to dist_check_DATA
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit d6df1d4
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Nov 3 20:03:25 2016 +0100
testsuite: Test for bad characters in file names
The FAT16 test image contains four files with three errors. One has a
space in the name, one a space in the extension and one contains '>' in
the name.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 307966c
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Sep 18 00:11:43 2016 +0200
fsck: Fix reporting of length to truncate with shared clusters
When files share clusters and one of the two files has been selected to
truncate fsck reports which file has been selected and the length to
which it will be truncated. All code paths erronously printed the length
of the file that was not going to be truncated, leading to possible user
confusion.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit b33424e
Author: Andreas Bombe <aeb@debian.org>
Date: Sat Sep 17 23:34:07 2016 +0200
testsuite: Test for files sharing clusters
The FAT32 test image contains three files. One shares a cluster with the
root directory and the other two share clusters among themselves.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit db5ec04
Author: Andreas Bombe <aeb@debian.org>
Date: Sat Sep 17 22:41:07 2016 +0200
testsuite: Run fsck in test-mkfs
Now the test-mkfs script also runs fsck on the created image to test its
basic operation. The test fails if fsck reports seeing an error.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 4ac17ae
Author: Andreas Bombe <aeb@debian.org>
Date: Sat Sep 17 22:25:06 2016 +0200
Fix FAT32 FSInfo signature checking
In commit 7444694 the definition of struct info_sector was corrected to
match the FSInfo sector specification. The initialization was adapted,
but other places were missed. All runs of fsck would then incorrectly
report a signature error on the FSInfo sector.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit e883d07
Author: Nico Roeser <nico@n1c0.de>
Date: Fri Sep 16 20:05:08 2016 +0200
mkfs: Bring back ability to set sector size.
This had accidently been broken when the code was overhauled, resulting
in unconditionally setting the sector size when devinfo detected it.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 4ef83db
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Sep 16 03:32:12 2016 +0200
Request minimum automake version 1.11 and add workaround for <1.13
Before automake 1.13, parallel-tests wasn't the default set it
explicitly in the automake options list. The parallel test harness was
introduced in 1.11 therefore that is the minimum now.
However, the AM_TESTS_ENVIRONMENT variable was only starting to work in
1.13, so there is now a version check and a conditional assignment to
TESTS_ENVIRONMENT (which should be for user setting only) in case
automake is 1.11 or 1.12.
Without it, the fact of xxd being found is not passed to the test
scripts which then skip all tests due to perceived lack of xxd.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 6a8c8b7
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Sep 16 01:45:17 2016 +0200
Add missing autoreconf step to Travis CI configuration
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 54f7aef
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Sep 16 01:39:08 2016 +0200
Add configuration for the Travis CI build service
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 5421752
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Sep 14 20:37:57 2016 +0200
Check and fix printf style arguments to die() and pdie()
Add the "format" gcc style attribute to the declarations of die() and
pdie() so that the compiler knows how to check their arguments for
correctness.
Fix all problematic calls detected by this.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 83e5ec5
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Sep 14 03:38:08 2016 +0200
Make some implicit integer conversions safer
Coverity reports a few places where signed or short integers are
promoted to int and then extended to long which might cause unintended
sign extension. Given the context (being sector sizes and similar) the
values should never actually reach unsafe values, but this patch cleans
it up anyway.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit ff5e718
Author: Andreas Bombe <aeb@debian.org>
Date: Tue Sep 13 20:25:34 2016 +0200
mkfs: Remove redundant unreachable warning message
At some point the check for too many clusters for user requested FAT16
was moved a few lines above. The original location can only be reached
when the cluster count is too low for FAT16 which means the too many
clusters message can not be triggered there.
Found through the dead code detection of Coverity Scan.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit e359a33
Author: Andreas Bombe <aeb@debian.org>
Date: Tue Sep 13 20:12:21 2016 +0200
Fix octal character parsing in file_cvt()
Apparently the octal code parsing got rewritten into a loop at some
point while the rest of the code was not removed. It was impossible to
specify an octal character code without the function returning an error.
This affected the -u and -d options for fsck.
Found through the dead code detection of Coverity Scan.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit ccd0a9d
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Sep 12 20:21:53 2016 +0200
testsuite: Test for circular cluster chain
The test image contains a file four clusters in length where the third
cluster has been modified to point back to the second cluster.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit fab40f8
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Sep 12 19:51:10 2016 +0200
Fix truncation logic in circular chain check
When scanning for circular chains, the first FAT entry that appeared a
second time in a chain should cause the previous cluster to be the
termination of the chain.
To that end, test_file() keeps variables to point to the previous
cluster and the current number of clusters. When the -t option is given,
all clusters are checked to be readable and skipped (variables not
updates) in test_file() when they are not.
The problem was that the variables were updated only when the read check
succeeded. If the -t option is not given, that check does not happen and
the variables keep their initial value. The circular chain fix would
then always truncate to zero length and fail to update the free cluster
count, requiring a second fsck run.
Fix by updating these variables unconditionally when -t option is not
given.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 8394ceb
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Sep 12 14:39:11 2016 +0200
testsuite: Test for too long cluster chain
The test image contains a file marked as 7 bytes in length (just a small
part of 1 cluster) in the directory entry that has 2 clusters assigned
to it in the FAT.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 7444694
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Sep 7 21:09:41 2016 +0200
Fix definition and initialization of fsinfo sector
Change the definition of the fsinfo struct to be more in line with the
official definition, in particular make the trailing signature field 32
bit instead of 16 bit. During initialization in init_fsinfo(), first
clear the whole struct to zero before setting fields, to make sure
reserved fields are zeroed.
Fixes #33.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit f78cb68
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Sep 7 20:45:29 2016 +0200
Add fsck testsuite
Add the framework for a fsck testsuite and a few tests, including a test
for the yet unimplemented check for misordered dot/dotdot directory
entries.
The test driver runs fsck twice on a given image and fails the test if
the first run does not detect an error or the second run still detects
an error.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 7667295
Author: Andreas Bombe <aeb@debian.org>
Date: Tue May 31 03:32:42 2016 +0200
Add testsuite foundations
Add testsuite on the basis of the automake framework. As a start, three
tests for basic mkfs functionality compare mkfs generated images against
references images.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit f881195
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Sep 7 03:48:16 2016 +0200
Append +git to version number in configure.ac
Don't let dosfstools compiled from git with additional commits show the
exact release version number.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 8788615
Author: Álvaro Fernández Rojas <noltari@gmail.com>
Date: Thu Jun 30 08:43:50 2016 +0200
Add config.guess and config.sub to gitignore
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 39ab842
Author: Álvaro Fernández Rojas <noltari@gmail.com>
Date: Thu Jun 30 08:41:51 2016 +0200
Use autoconf to look for OS X endian include.
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 69ac2b0
Author: Alessio Sergi <al3hex@gmail.com>
Date: Fri May 6 18:18:18 2016 +0200
src/device_info.c: Fix undefined PATH_MAX under musl
In musl libc, PATH_MAX is defined in <limits.h>.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 744db84
Author: Lars Wendler <polynomial-c@gentoo.org>
Date: Tue May 10 09:47:57 2016 +0200
Don't link to udev via LDFLAGS. There's LDADD for such a task.
See also:
https://www.gnu.org/software/automake/manual/html_node/Linking.html
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 1e76e57
Author: Andreas Bombe <aeb@debian.org>
Date: Wed May 11 03:44:58 2016 +0200
mkfs: Default to 64/32 heads/sectors for targets smaller than 512 MB
This may put defaults in certain use cases a little bit more in line
with the old defaults in versions up to 3.0.28. It has mostly aesthetic
value in most cases.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 786e66e (tag: v4.0)
Author: Andreas Bombe <aeb@debian.org>
Date: Fri May 6 03:19:07 2016 +0200
Releasing version 4.0.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit a79ff90
Author: Andreas Bombe <aeb@debian.org>
Date: Fri May 6 02:34:42 2016 +0200
src/Makefile.am: Fix CPPFLAGS for VPATH builds
The -I flag to add the blkdev subdir to the include search path is now
relative to $(srcdir) to allow VPATH builds to work. Additionally move
the -I flag from the mkfs_fat and testdevinfo CFLAGS to CPPFLAGS where
it actually belongs.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit e8eff14
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Apr 27 21:38:37 2016 +0200
read_boot(): Handle excessive FAT size specifications
The variable used for storing the FAT size (in bytes) was an unsigned
int. Since the size in sectors read from the BPB was not sufficiently
checked, this could end up being zero after multiplying it with the
sector size while some offsets still stayed excessive. Ultimately it
would cause segfaults when accessing FAT entries for which no memory
was allocated.
Make it more robust by changing the types used to store FAT size to
off_t and abort if there is no room for data clusters. Additionally
check that FAT size is not specified as zero.
Fixes #25 and fixes #26.
Reported-by: Hanno Böck
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 016800e
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Apr 27 14:16:53 2016 +0200
Use variable total_fat_entries in read_boot() for readability
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit a6478d8
Author: Álvaro Fernández Rojas <noltari@gmail.com>
Date: Fri Apr 8 12:20:46 2016 +0200
Add missing iconv library for OS X
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit ce67dc6
Author: Álvaro Fernández Rojas <noltari@gmail.com>
Date: Fri Apr 8 12:20:27 2016 +0200
Add endian support for OS X
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 08f3869
Author: Joel Holdsworth <joel.holdsworth@vcatechnology.com>
Date: Thu Mar 10 00:53:07 2016 +0000
Configure option to disable building with libudev
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit ed4e47b
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Feb 22 03:47:14 2016 +0100
Remove use of PATH_MAX in path_name()
The length of a file path on the checked filesystem has no relation to
the maximum path length of the system fsck is running on. So replace it
with a constant of our own.
As a bonus this will not fail compilation on a system without PATH_MAX.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit b1a38ab
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Feb 17 21:04:35 2016 +0100
Add preliminary entry for release 4.0 to NEWS
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 4ad3e9e
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Feb 17 21:02:06 2016 +0100
Adjust ridiculous source indentation in io.c
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit b96acb2
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Feb 17 20:51:53 2016 +0100
Document ./configure --enable-compat-symlinks in README
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit de39c5c
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Feb 17 15:16:27 2016 +0100
Add include paths.h in the HAVE_DECL_GETMNTENT case
_PATH_MOUNTED is now used for getmntent() in place of MOUNTED because
the latter was marked as a deprecated alias in glibc's mntent.h. The
mntent.h of musl libc does not include the _PATH_MOUNTED however. Fix
this by including paths.h alongside mntent.h
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 86c7acd
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Feb 17 15:06:56 2016 +0100
man fsck: Document the -c option
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit ef9a73c
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Feb 15 02:10:57 2016 +0100
Add NEWS file with changes of the last two releases
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit bda6551
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Feb 12 03:56:16 2016 +0100
Make filesystem mounted check portable
A new function is_device_mounted() in device_info.c is now used by
check_mount() in mkfs.fat.c. It contains the getmntent() using code
used before in check_mount() and now an alternative using getmntinfo()
as found on the BSDs.
In case neither function is available, is_device_mounted() defaults to
reporting that the device isn't mounted.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 4b8c9cc
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Feb 12 01:57:33 2016 +0100
Make use of endian.h portable to BSD
The endian.h found on Linux and the BSDs appear to be compatible, but
they are found in different locations. Add tests in configure.ac and a
new endian_compat.h file that has the logic to include the correct
files.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit d7665f2
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Feb 10 21:30:06 2016 +0100
Fix format string in check_file() (%lu → %llu)
The cluster chain length printing needs a 64 bit calculation, so we can
just use unsigned long long instead of uint64_t and use the format
string %llu.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 6225e59
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Feb 5 14:39:00 2016 +0100
blkdev.c: Prevent unused parameter warnings in fallback code
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 34cdded
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Feb 5 14:36:14 2016 +0100
blkdev_get_size(): Remove unused variable ch
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 5571d29
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Feb 10 03:22:19 2016 +0100
Reinstate alignment of FAT32 structures to cluster size
This reverts commits 17c956cb9 and d63e0d627 where the alignment was
removed because it created problems with a device that refused to read
the aligned filesystem. The option -a is already provided to disable
alignment in order to handle such cases.
This change brings it back in line with FAT12/16 where alignment wasn't
disabled and brings consistency with the current command line options,
where only the option to disable alignment exists but no opposite option
to enable it.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 2c71ace
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Feb 3 03:38:33 2016 +0100
Makefile.am: Add historic documentation to distribution
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit bcbae63
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Feb 3 02:38:24 2016 +0100
src/Makefile.am: Add forgotten msdos_fs.h to mkfs_fat_SOURCES
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 19d1a13
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Feb 3 02:34:51 2016 +0100
Remove sys/ioctl.h and linux/fd.h include from io.c
These weren't used anymore and the linux/fd.h include would
gratuitously cause compilation to fail on non-Linux environments.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit f691660
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Feb 3 02:31:00 2016 +0100
Reinstate some #include <sys/types.h>
These shouldn't have been removed in commit 245d0cce5. Put them back for
correctness even though the definitions were pulled in implicitly.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 51afd41
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Jan 27 21:38:29 2016 +0100
src/Makefile.am: Put all header files in appropriate _SOURCES variables
With the headers missing the dist targets of the automake generated
Makefiles would not include them and make the resulting dist
unbuildable.
Also combine sources collections into common variables for
deduplication.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit bf6f142
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Jan 27 15:28:42 2016 +0100
mkfs man: Note that sector sizes > 4096 are non-standard
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit ea96c32
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Jan 25 21:30:23 2016 +0100
mkfs: Improve parsing of bad blocks file
The bad blocks file that can be given to mkfs via the -l option had a
very simplistic design. It failed to notice it was parsing an empty
line and would report errors for that.
Replace it with a more robust version that ignores empty lines as well
as leading and trailing white space. Additionally it produces meaningful
error messages.
GitHub: Fixes #17
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit dfb5bea
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Jan 25 02:47:12 2016 +0100
mkfs: Limit filesystem size on targets that are too large
For FAT filesystems, the number of sectors has to fit into a 32 bit
variable. Previously this was not checked possibly causing invalid
filesystems to be generated.
Now there is a check for that case which will limit the number of
sectors if needed and print a warning that disk space will be left
unused in that case.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit fc0343f
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Jan 22 21:29:20 2016 +0100
mkfs: Improved bounds checking in mark_FAT_sector()/mark_FAT_cluster()
In mark_FAT_sector() the sector number itself is now checked against
limits instead of the computed cluster number. Even with sector number
before the start of the data area, the cluster number may be valid for
the first cluster due to dividing by the cluster size.
Both functions now check for upper limits and should prevent writing
past the valid end of the FAT.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 9211c8a
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Jan 15 02:17:16 2016 +0100
mkfs: Fix offset error in FAT12/16 bad cluster marking
The root directory wasn't factored in to the calculation of the data
area start sector. On FAT32 the root directory is in the data area, but
for FAT12 and FAT16 it is a reserved space before the start of the data
area.
On FAT12 and FAT16, this resulted in the wrong clusters being marked
during bad blocks mapping, whether from check_blocks() or from reading
the user supplied bad blocks file.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 0627a62
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Jan 15 01:59:59 2016 +0100
mkfs: Fix off-by-2 error in bad cluster marking
mark_FAT_sector(), which has the mark_sector_bad() macro as its sole
user, computed the cluster number corresponding to the sector by taking
its offset from the first data sector and dividing by sectors per
cluster.
What it missed was that the first data cluster is number 2 and not 0.
This meant all marks were off by 2 and when the first two clusters are
supposed to be marked, it would overwrite the reserved cluster values
and create an invalid filesystem.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 2dca9aa
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Jan 14 14:43:00 2016 +0100
.gitignore: Add .dirstamp
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 6a966fb
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Jan 14 14:38:53 2016 +0100
mkfs: Reword non-standard sector size warning
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit bebc9ac
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Dec 30 15:10:35 2015 +0100
Clean up includes in mkfs.fat.c
Moving the device probing out into device_info.c removed the need for a
number of includes in mkfs.fat.c. Remove them and add a define for
BLOCK_SIZE, which was the only thing used from linux/fs.h.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 12a1d46
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Nov 29 01:59:10 2015 +0100
Don't use pointer to first member when more of the struct gets copied
Where a fs_write() of "first 13 bytes of directory entry" is intended,
actually use pointer to directory entry structure instead of the 11
byte name field at the beginning.
This does not change how the code works, it is just a clean up.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit d38bd2d
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Nov 29 00:44:48 2015 +0100
Remove name/extension split in directory entry structures
Both the DIR_ENT structure in fsck.fat.h and the msdos_dir_entry in
msdos_fs.h - these represent the on disk format of directory entries -
had the name field split into name[8] followed by ext[3].
By far the most operations on name are on the full name including
extension and they treated the name field as an 11 byte array. This is
an array overflow that worked because the structs have the attribute
packed and the extension field is following right after.
Nevertheless, this is not clean C and the merging of both fields
actually simplified the code in a few places.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 0847e4c
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Nov 27 21:29:49 2015 +0100
Free allocated strings after use
There are multiple calls to cnv_unicode() in lfn.c which returns an
allocated string. Most had the appropriate free() calls after printing
the strings. Add the missing two calls where memory was leaked.
Found by Coverity.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 1b7d91e
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Nov 27 03:34:51 2015 +0100
Add test for and include linux/hdreg.h in blkdev.c
Before, blkdev did not include it and depended on its own fallback
definition of the ioctl and struct hd_geometry.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 5024372
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Nov 27 03:28:14 2015 +0100
Add FDGETPRM attempt to blkdev_get_geometry()
If HDIO_GETGEO isn't available or has failed, try FDGETPRM. This should
get the geometry from floppy drivers where HDIO_GETGEO isn't supported.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 4a146d7
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Nov 27 03:25:55 2015 +0100
Add blkdev_get_start() for getting partition start offset
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 254f8ab
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Nov 26 23:33:02 2015 +0100
Remove use of libblkid again
It appears libblkid is not as widely available as presumed, since some
platforms only have the original libblkid included in e2fsprogs which
lacks the needed functionality. This commit removes the requirement and
use of libblkid.
As a replacement, blkdev.c from util-linux is included, which offers the
required basic functionality in a portable way.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit c9fb33c
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Oct 21 21:32:30 2015 +0200
Use just device size not major number in Atari mode
In Atari mode, read_boot() in boot.c used the device major number to
determine whether to use FAT12. It would always use FAT12 for a floppy,
otherwise only if it is a RAM disk or loopback device and has a size
corresponding to standard floppy formats.
Since this check was already broken for a long time (another place that
assumed 8 bit major numbers) and there is no real point to make the
distinction based on device, this commit reduces the check to just
compare against standard floppy sizes.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 64486ad
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Oct 21 00:18:22 2015 +0200
Remove loff_t and llseek()
There appear to have been multiple conversions to 64 bit file offsets on
32 bit architectures in dosfstools over the years, but today with the
proper setup off_t is 64 bits and simple lseek() can be used. The
AC_SYS_LARGEFILE macro in configure.ac does what is required to make
that happen.
Given this, convert all uses of loff_t to off_t, remove llseek()
definitions and change llseek() calls to plain lseek().
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit e03a5f4
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Oct 16 21:47:04 2015 +0200
Remove DJGPP support
These macros have been added back when dosfstools was around version 2.
It is difficult to say whether these are still working correctly or
whether they are in use at all. FreeDOS appears to still show version
2.11 of dosfstools in their software directory.
Supporting actual MS-DOS or compatible may need more work in the
current state of things and this DJGPP support can be removed until
then.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 5b9a88d
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Oct 8 16:17:22 2015 +0200
mkfs.fat: Complete overhaul of device probing
The device probing in mkfs.fat is used to get device parameters where
needed and also to decide whether to refuse overwriting a device due to
possible user error. This code has suffered severe bitrot and is highly
Linux specific. Highlights include using hardcoded major/minor device
numbers to classify a device, and using 8 bits major/minor numbers that
have become obsolete a long time ago and thus often misidentifying a
device.
The overhauled implementation is now in src/device_info.c and makes use
of libudev (optional, recommended) and libblkid (required) to probe the
device and where Linux ioctls are required it provides fallbacks and
does not attempt to call these on non-Linux systems. The FAT parameter
selection has been unified and simplified in the process.
A new executable testdevinfo has been added that gets built but not
automatically installed. It takes one file name, uses the same probing
as mkfs.fat would with verbose messages enabled and displays the
results.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 53eddfc
Author: Andreas Bombe <aeb@debian.org>
Date: Sat Sep 12 02:54:33 2015 +0200
Die on out of range cluster values in set_fat()/get_fat()
To prevent bugs caused by FAT corruption inside fsck to go unnoticed,
add a check against out of range requested cluster values in get_fat()
and against out of range cluster to change and new cluster value in
set_fat().
When an invalid cluster value is detected, these functions now die()
with an "internal error" message.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 456767b
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Sep 14 00:33:49 2015 +0200
configure.ac: Use AS_HELP_STRING to format option help
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 3cfb479
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Sep 14 00:30:40 2015 +0200
version.h: Use @configure_input@ autoconf variable in boilerplate
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 41ef834
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Sep 14 00:29:27 2015 +0200
.gitignore: Add TAGS in addition to tags
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit bdc3d2a
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Sep 11 20:28:12 2015 +0200
Rename clusters field in DOS_FS struct
Rename it to data_clusters to prevent mistaking the clusters field of
the DOS_FS struct as the total number of FAT entries instead of the
number of data clusters (two less than the number of entries).
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 0790812
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Sep 11 19:47:29 2015 +0200
set_fat(): Fix off-by-2 error leading to corruption in FAT12
In FAT12 two 12 bit entries are combined to a 24 bit value (three
bytes). Therefore, when an even numbered FAT entry is set in FAT12, it
must be be combined with the following entry. To prevent accessing
beyond the end of the FAT array, it must be checked that the cluster is
not the last one.
Previously, the check tested that the requested cluster was equal to
fs->clusters - 1. However, fs->clusters is the number of data clusters
not including the two reserved FAT entries at the start so the test
triggered two clusters early.
If the third to last entry was written on a FAT12 filesystem with an
odd number of clusters, the second to last entry would be corrupted.
This corruption may also lead to invalid memory accesses when the
corrupted entry becomes out of bounds and is used later.
Change the test to fs->clusters + 1 to fix.
Reported-by: Hanno Böck
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 39ce90f
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Sep 11 19:34:10 2015 +0200
set_fat(): Move FAT12 next cluster check up
In FAT12 two 12 bit entries are combined to a 24 bit value (three
bytes). Therefore, when an even numbered FAT entry is set in FAT12, it
must be be combined with the following entry. To prevent accessing
beyond the end of the FAT array, it must be checked that the cluster is
not the last one.
This check was broken in ff1b24e9 (first included in 3.0.3) as the
lookup was done unconditionally and the check influenced only using the
looked up value.
Move the check up to fix.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 2aad1c8
Author: Andreas Bombe <aeb@debian.org>
Date: Tue Sep 8 03:58:29 2015 +0200
Prevent out of bound array read in date_dos2unix()
The function date_dos2unix() is called during fsck while showing
information about duplicate file names. In case the date field of a
directory entry contains the invalid value 0 for the month,
date_dos2unix would read index -1 of the day_n array.
Add a check to prevent that and also make the day_n array const on this
occasion.
Reported-by: Hanno Böck
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 3b95786
Author: Yann E. MORIN <yann.morin.1998@free.fr>
Date: Sun Aug 16 15:55:43 2015 +0200
mkfs.fat: fix incorrect int type
u_int32_t is not a stanard type, while uint32_t is. This fixes builds
with the musl C library, which only defines so-called "clean" headers;
build failures are like (back-quotes and elision manually added for
readability):
http://autobuild.buildroot.org/results/a09/a0923d7f6d4dbae02eba4c5024bbdae3a52aa85a/build-end.log
/home/peko/autobuild/instance-1/output/host/usr/bin/x86_64-linux-gcc -D_LARGEFILE_SOURCE \
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -D_GNU_SOURCE -D_LARGEFILE_SOURCE \
-D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -c -o mkfs.fat.o src/mkfs.fat.c
src/mkfs.fat.c: In function 'main':
src/mkfs.fat.c:1415:18: error: 'u_int32_t' undeclared (first use in this function)
volume_id = (u_int32_t) ((create_timeval.tv_sec << 20) | create_timeval.tv_usec); [...]
^
src/mkfs.fat.c:1415:18: note: each undeclared identifier is reported only once for each
function it appears in
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 2b1c4d1
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Jun 3 03:33:10 2015 +0200
Add README.md, remove Markdown formatting from README
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit b720acc
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Jun 3 03:27:24 2015 +0200
Add simple README in Markdown format
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 2b255e6
Author: Andreas Bombe <aeb@debian.org>
Date: Tue Jun 2 18:25:06 2015 +0200
Configure option for legacy names symlinks
The symlinks from the old names (mkdosfs, dosfsck, etc.) are now only
created on "make install" when the --enable-compat-symlinks option was
given to configure.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 0643db7
Author: Andreas Bombe <aeb@debian.org>
Date: Sun May 31 02:40:19 2015 +0200
Convert build system to autoconf/automake
In preparation for fixing the horribly outdated and broken device
checking - which will likely involve using additional libraries like
libblkid - as well as making this package portable to other operating
systems, the build system is now the tried and true autoconf/automake
combination which should make both goals a little more straightforward.
The release version number and date are now in configure.ac and
substituted by configure where they are needed. Now it is no longer
necessary to change the number in multiple places for a release and the
man pages get the number substituted directly into them, making the
update-version.sh script and the VERSION file obsolete.
The English man pages are moved back up one directory to mark their
status as the master copy for all translations. At the moment the po4a
translation infrastructure is defunct since it isn't integrated into
the automake environment yet. So far it hasn't been used, so that is
not an actual regression.
The date in the man pages is not automatically updated anymore. This is
as it should be, since the date is supposed to signify the time of the
last nontrivial change and not the release date of the software.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 85022fe (tag: v3.0.28)
Author: Andreas Bombe <aeb@debian.org>
Date: Sat May 16 02:56:17 2015 +0200
Releasing version 3.0.28.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit ad1342e
Author: Andreas Bombe <aeb@debian.org>
Date: Sat May 16 02:10:18 2015 +0200
manpages: Mark MT and ME tags as untranslated for po4a
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 3ed9ec2
Author: Andreas Bombe <aeb@debian.org>
Date: Sun May 10 19:59:02 2015 +0200
mkfs: Small changes to FAT32 cluster size selection
Put the cluster size selection back in line with the table used in
Microsoft's fatgen103.pdf and fix the comment. This only involved
changing some comparison operators, all values stayed the same.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 9984552
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Apr 20 23:41:34 2015 +0200
fsck: Mention -r is default in usage message
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 3eaca68
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Apr 20 23:30:56 2015 +0200
manpages: Remove obsolete information about Linux FAT support
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit a5e34de
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Apr 16 23:16:08 2015 +0200
manpages: Convert the rest of argument placeholders to upper case
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 2303765
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Apr 16 22:51:20 2015 +0200
manpages: Fix formatting
Make the manpages conform to the rules for groff sources. First,
eliminate empty lines because these create vertical spaces where it
isn't desired. Man page sources should not contain empty lines. Second,
put a line break between sentences in a paragraph. A period is
recognized and formatted as a full stop period only when a line break
comes right after it.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit d3969b8
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Apr 10 20:32:50 2015 +0200
fsck: Verify first cluster of a file is not 1
Previously the FAT was checked for any out of bounds entries which were
cleared. However the first cluster of a file, as specified in its
directory entry, was not verified to not be 1.
In addition to missing this filesystem error, code that correctly
assumes the FAT contained no bad entries anymore could still look up
invalid table indices depending on the value stored in entry 1. With
the right values and FAT size this can lead to a segfault by accessing
unallocated memory.
Now test_file() will ignore files where the first cluster equals 1 and
an additional check in check_file() will truncate them.
This bug was reported in http://bugs.debian.org/773885 by Jakub Wilk.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 2a56575
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Apr 2 23:35:00 2015 +0200
Simplify synopses of man pages
Since there is only one mode of invocation for the tools, it is
somewhat pointless to list every possible option in the synopsis.
Fix a few style inconsistencies in addition, specifically that
placeholders for option arguments are in capital letters and should be
shown where the option is described.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 40f1436
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Apr 1 20:55:58 2015 +0200
Update homepage and maintainer sections of man pages
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 0169db8
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Apr 1 20:05:01 2015 +0200
mkfs: Show a clearer message that file already exists with -C
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 2967e27
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Mar 30 21:12:51 2015 +0200
mkfs: Remove O_TRUNC from file creation call
open() is called with O_EXCL | O_CREAT, so it will definitely create a
new, empty file or error out. O_TRUNC is superfluous and may be harmless
in practice but its effect under these circumstances is unspecified.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 90612df
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Mar 30 21:09:51 2015 +0200
mkfs: Use ftruncate() for expanding created file
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 58e8e09
Author: Andreas Bombe <aeb@debian.org>
Date: Tue Mar 24 21:32:40 2015 +0100
mkfs: Add --invariant option
The --invariant option is designed to prevent random or time based
differences to end up in generated filesystems so that multiple runs
generate on the same file or device create completely identical results.
This is intended for debugging or regression testing of mkfs.fat.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 354feaf
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Mar 19 21:35:21 2015 +0100
mkfs: Add long option parsing
Add long option parsing with getopt_long() to mkfs and define --help as
the first long option. The usage() function now takes an exit code
parameter so that the --help option handling can exit the program with
a success exit code.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit b611549
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Mar 16 21:08:35 2015 +0100
Do not expect EOF as return value of getopt()
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit a41fc32
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Mar 11 21:45:04 2015 +0100
fsck.fat: Fix read beyond end of array on FAT12
When a FAT12 filesystem contains an odd number of clusters, setting the
last cluster with set_fat() will trigger a read of the next entry,
which does not exist in the fat array allocated for this.
Round up the allocation to an even number of FAT entries for FAT12 so
that this is fixed without introducing special casing in get_fat().
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit e18d72f
Author: Álvaro Fernández Rojas <noltari@gmail.com>
Date: Sat Mar 7 13:23:23 2015 +0100
Remove linux/msdos_fs.h includes
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 245d0cc
Author: Álvaro Fernández Rojas <noltari@gmail.com>
Date: Thu Feb 26 19:22:54 2015 +0100
Remove non standard int types
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 628b3ec
Author: Álvaro Fernández Rojas <noltari@gmail.com>
Date: Thu Feb 26 19:41:19 2015 +0100
Improve .gitignore
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 02b5a6d
Author: Álvaro Fernández Rojas <noltari@gmail.com>
Date: Thu Feb 26 12:51:23 2015 +0100
Makefile: avoid using install -D
OS X and FreeBSD are not compatible with this option
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit fb6aea6
Author: Álvaro Fernández Rojas <noltari@gmail.com>
Date: Thu Feb 26 12:50:57 2015 +0100
Makefile: fix typo in uninstall-man
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 357ab07
Author: Andreas Bombe <aeb@debian.org>
Date: Thu Feb 19 21:22:54 2015 +0100
fsck.fat: Make -r option default
Default mode is now to interactively repair with the option to write
the changes back at the end (like the -r option) instead of the previous
default mode of interactively correcting but never writing back the
changes.
The -r option continues to be recognized by fsck.fat.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 266a5fc
Author: Andreas Bombe <aeb@debian.org>
Date: Fri Feb 20 03:19:28 2015 +0100
mkfs.fat: Allow 0xF0 to be specified as media byte
Let the -M option accept 0xF0, which should be the proper descriptor
byte for 3.5" 1.44 MB and 2.88 MB floppies.
Also split the error reporting for -M between badly formatted and
invalid numbers.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 16e97e9
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Jan 28 15:07:18 2015 +0100
Make all char* that may take literals const
Every char* variable or function argument that may be given a literal
string is now made const. Additionally add -Wwrite-strings to CFLAGS to
enable a warning where const would be missing.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 8b8948c
Author: Andreas Bombe <aeb@debian.org>
Date: Mon Dec 29 18:24:54 2014 +0100
mkfs.fat.c: Use unsigned char for binary data
Simple char technically works for the dummy_boot_jump variables, but
some compiler warning settings would give a warning over a signed char
overflowing with the values given as initializers.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 45aeed0
Author: Andreas Bombe <aeb@debian.org>
Date: Sun Nov 16 19:49:22 2014 +0100
Fix indentation of "fix power loss damage" commit
I fixed the (sometimes misleading) indentation of the code introduced in
commit 6893c45 to be in line with the reset of the code and also removed
the /* PATCH ED+DL */ comments which are quite meaningless to the wider
world.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 75c5446
Author: Andreas Bombe <aeb@debian.org>
Date: Sat Nov 15 16:48:48 2014 +0100
Add tags and editor backup files to .gitignore
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit cb98ae2 (tag: v3.0.27)
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Nov 12 01:10:23 2014 +0100
Releasing version 3.0.27.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit e2c8f06
Author: Andreas Bombe <aeb@debian.org>
Date: Wed Nov 12 00:22:17 2014 +0100
fsck.fat: Don't print version string every time -v is encountered
Remove the printing of the version string every time -v is seen during
command line parsing in fsck.fat. The version string is printed anyway
before opening the filesystem device/image.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 82076b6
Author: Andreas Bombe <aeb@debian.org>
Date: Tue Nov 11 23:25:30 2014 +0100
Fix attempt to rename root dir in fsck due to uninitialized fields
When add_file() is called with offset 0, it will construct a DIR_ENT for
the root directory instead of reading the contents from the filesystem.
It did not initialize the whole DIR_ENT on the stack, just select
values.
In particular, the lcase field was left with an undefined value. If
that value happened to include the FAT_NO_83NAME bit, the "neither long
nor short file name" check in bad_name() added in 3.0.26 would trigger
and cause an attempt to rename the entry (which is not possible).
Example run:
$ /sbin/fsck.fat -y bad.img
fsck.fat 3.0.26 (2014-03-07)
/
Bad short file name ().
Auto-renaming it.
Renamed to
bad.img: 14 files, 19388/403266 clusters
This commit changes the initialization zeroize the whole struct before
setting individual fields. Thanks to AlexisM, who found the cause and
posted a patch on the Debian bug http://bugs.debian.org/764992 .
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit c24ecb6
Author: Andreas Bombe <aeb@debian.org>
Date: Tue Nov 11 22:49:50 2014 +0100
Support long file names in volume labeling code
The code to find the volume label directory entry in find_volume_de()
did not consider long file names so far. Directory entries that make up
long file names have four attribute bits set, including the "volume"
bit.
This caused the code to mistake a directory entry that is part of a
long file name as the volume name entry. If such an entry is found
first, fatlabel would print garbage when asked to display the label and
mangle the long file name when asked to set it. The latter would lead
to the loss of the long file name and require a fsck to clean up.
Change so that the set of attributes equal that of LFN entries will no
langer match as a volume label.
Signed-off-by: Andreas Bombe <aeb@debian.org>
commit 1646f6e (tag: v3.0.26)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Mar 7 18:40:13 2014 +0100
Releasing version 3.0.26.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 6893c45
Author: Dir Lotter <dirk.lotter@siemens.com>
Date: Fri Mar 7 18:25:39 2014 +0100
Fix "odd" files created by frequent power-loss.
After running many power losses the filesystem can degrate, containing "odd"
files making the filesystem corrupt that could not be solved by fsck:
* file was not visible in a ls -l
* ls -i reported a "invalid file name" on the console
* a test program with diropen/dirread showed the file, a stat on this file
failed
* file was not accessible and could not be deleted
After digging into the code we found why fsck didn't repair the file system:
One thing was we don't have short filenames. Another issue was that the LFN
pointer was set to NULL and so it looked like we didn't have short and long
filenames.
Our patch of check.c includes:
* returns 1 from function bad_name() in case no short and no long filename
exist
* auto_rename() and rename_file() got a special handling for the case no short
file name exist:
- it enables the short file name (we think here was a weakness of the old
code: it changed the short filename but didn't enabled it in the
file->dir_ent.lcase entry)
- it reset all attributes except ATTR_DIR and ATTR_VOLUME
This solved our problem pretty well.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 621e11f
Author: Natanael Copa <ncopa@alpinelinux.org>
Date: Sat Feb 8 18:53:30 2014 +0100
Build fixes for musl libc.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 52588b7 (tag: v3.0.25)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Jan 17 07:11:11 2014 +0100
Releasing version 3.0.25.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit acf64ae
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Jan 17 07:09:54 2014 +0100
Updating copyright headers for 2014.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 21fe921
Author: Andrew Tridgell <tridge@samba.org>
Date: Tue Jan 14 09:37:51 2014 +1100
Fixed remaining 64 bit build warnings.
Some of these may be real bugs.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 9e3a2b1
Author: Andrew Tridgell <tridge@samba.org>
Date: Tue Jan 14 09:25:28 2014 +1100
Prevent corruption of FAT during fsck on 64 bit platforms.
unsigned long is 64 bit on x86-64, which means set_fat was writing two
entries, which corrupts the next entry. This can cause loss of data in
another file.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 0d2c9bc (tag: v3.0.24)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sat Nov 23 10:36:55 2013 +0100
Releasing version 3.0.24.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 55bd7b7
Author: Jaroslav Skarvada <jskarvad@redhat.com>
Date: Sat Nov 23 10:34:48 2013 +0100
Fixed dosfsck on big endian platforms (Resolves: rhbz#1029695).
It seems there is problem in the double conversion on big endians.
The first conversion is done by the explicit conversion to __u16
in the GET_UNALIGNED_W macro, so the secondary conversion by le16toh
seems to be redundant (and wrong).
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 6debb4a (tag: v3.0.23)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Tue Oct 15 08:05:46 2013 +0200
Releasing version 3.0.23.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 07d85ff
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Tue Oct 15 08:04:11 2013 +0200
Reformating mkfs.fat manpage.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 137552f
Author: Michael Shigorin <mike@altlinux.org>
Date: Tue Oct 15 01:29:33 2013 +0400
Fixing "Fixing default sectors per cluster for FAT32" for UEFI.
FAT32 "EFI System Partition" is basically required for UEFI boot;
commit ge048a8d broke that for me with both virtualbox-4.2 and
real hardware (ASUS C60M1-I to be exact) given ~250Mb filesystem.
This commit amends that one by reverting its effects for these
small sizes by restoring 512b cluster size for <= 260Mb FAT32.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 2000696
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Aug 9 09:38:13 2013 +0200
Also allowing lowercase labels in mkfs (with warning message) consistent with the recent fsck change, thanks to Michael Baum <mbaum@devonit.com>.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 9b04807
Author: Tim Harder <radhermit@gentoo.org>
Date: Fri Jul 19 18:15:21 2013 +0200
Add install-man dependency to install-symlinks Makefile target.
This fixes a race condition during parallel installs where man page
symlinks won't be installed because install-man hasn't been run yet.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 651f91c (tag: v3.0.22)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Jul 19 07:01:19 2013 +0200
Releasing version 3.0.22.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 3dc5560
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Jul 19 06:55:24 2013 +0200
Addding install-symlinks target to phony targets in Makefile.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit c6c0581
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Jul 19 06:55:00 2013 +0200
Adding uninstall-symlinks target in Makefile.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 465dd8c
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Jul 19 06:45:40 2013 +0200
Allowing fatlabel to write labels in all lowercase but give a warning about DOS/Windows (Closes: #714971).
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 3621b30
Author: John S Gruber <JohnSGruber@gmail.com>
Date: Fri Jul 19 06:40:21 2013 +0200
Add options and make dos boot sector more compatible with reference system (Closes: #552673).
Unless overridden by the user sets the DOS boot sector's
hidden-sectors field to match the start of a hard disk's
partition.
Initialize DOS boot sector drive_number according to FAT media type
Addresses LP: #398241 and Debian #552673
Adds options to override the DOS boot sector device_number and
the FAT media type.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit be1eed5
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Wed Jul 17 12:52:20 2013 +0200
Correcting wrong check preventing installation of fatlabel legacy manpage symlink.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit d0065d3 (tag: v3.0.21)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Tue Jul 16 08:34:28 2013 +0200
Releasing version 3.0.21.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit a74c12c
Author: Jaroslav Skarvada <jskarvad@redhat.com>
Date: Tue Jun 25 14:53:14 2013 +0200
Adding the missing -p option to the fsck manpage (to be consistent with the output of the tool).
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 25e03c9
Author: Patrick J. Volkerding <volkerdi@slackware.com>
Date: Mon Jun 24 14:23:00 2013 +0200
Using $MANDIR instead of hardcoded ${PREFIX}/share/man in the Makefile.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 7fd9cf7
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Jun 14 18:50:31 2013 +0200
Making install-symlinks Makefile target depend on install-bin to not break when using make in parallel, thanks to David Walser <luigiwalser@yahoo.com>.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit a76bbcd
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Wed Jun 12 13:00:10 2013 +0200
Using US digit date format in version date, rather than name abbrev.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit a64195f (tag: v3.0.20)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Wed Jun 12 12:25:32 2013 +0200
Releasing version 3.0.20.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 1a5d99f
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Wed Jun 12 12:07:58 2013 +0200
Softening message about different boot sectors a bit (Closes: #704198).
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 4727286
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Wed Jun 12 11:42:52 2013 +0200
Harmonizing program name output.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 17c956c
Author: Martin Wilck <mwilck@arcor.de>
Date: Wed Jun 12 11:38:00 2013 +0200
Don't align FAT to cluster size.
See previous patch for explanation.
With this patch and the previous two, the
mkdosfs generated FAT32 file systems work well in my extremely
picky TechniSat device. Of course, they're also detected cleanly
by Linux and Windows.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit d63e0d6
Author: Martin Wilck <mwilck@arcor.de>
Date: Wed Jun 12 11:36:08 2013 +0200
Don't align FAT32 reserved sectors to cluster size.
For certain file system sizes (in particular, exact GB sizes -
don't ask me why) a Technisat HD S2 Plus DVB receiver will still
choke on mkdosfs generated file systems, even if the sectors per
cluster problem is fixed.
By comparing the properties of generated FAT32 FS with results
of the Windows tool "h2format" (www.heise.de/download/h2format.html),
I found that the remaining problems were caused by rounding of the
reserved sectors and FAT space to cluster size (the h2format tool
doesn't do this).
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit e048a8d
Author: Martin Wilck <mwilck@arcor.de>
Date: Wed Jun 12 11:33:33 2013 +0200
Fixing default sectors per cluster for FAT32 (Closes: #690062).
The default sectors per cluster calculated by mkdosfs are outdated,
see http://technet.microsoft.com/en-us/library/cc938438.aspx.
The deviations may cause some 3rd party devices (e.g. TechniSat DVB
receivers) to hang when reading mkdosfs generated file systems.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 86509aa
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Tue Jun 11 20:19:09 2013 +0200
Splitting out legacy symlink creation in toplevel Makefile to own target.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit da37dd1
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Wed Jun 12 11:29:12 2013 +0200
Correcting wrong toolname in fsck.fat.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit b29a722
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Tue Jun 11 19:51:47 2013 +0200
Consistently spelling filesystem as filesystem, and not file system.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 977d7aa
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Tue Jun 11 19:30:19 2013 +0200
Removing Debian reference in GPL license headers.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 5505cc2 (tag: v3.0.19)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Tue Jun 11 18:46:03 2013 +0200
Releasing version 3.0.19.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 2c88f35
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Tue Jun 11 18:44:50 2013 +0200
Running indent on source files.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit d495d43
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Tue Jun 11 18:41:41 2013 +0200
Using memcpy instead of strcpy to fix segfault with fortify, thanks to Dave Reisner <falconindy@jabber.org>.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 9fb4ffc
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sun Jun 9 13:17:16 2013 +0200
Correcting fsck.fat spelling error in manpages, thanks to E.J.M. Hartman <E.J.M.Hartman@tudelft.nl>.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 2d8ef9b (tag: v3.0.18)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Thu Jun 6 09:49:00 2013 +0200
Releasing version 3.0.18.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit d4e1180
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Thu Jun 6 09:38:45 2013 +0200
Adding initial i18n support for manpages with po4a.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit ea8f712
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Thu Jun 6 09:17:13 2013 +0200
Renaming tools to sane namespace and keeping legacy symlinks in place.
dosfslabel becomes fatlabel,
dosfsck becomes fsck.fat,
and mkdosfs becomes mkfs.fat.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit a42b127
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Wed Jun 5 07:12:03 2013 +0200
Correcting wrong spelling of Debian in mkdosfs manpage.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 2749084
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Wed Jun 5 07:10:50 2013 +0200
Correcting spelling typo in boot.c.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 6461c83
Author: Martin Pitt <martinpitt@gnome.org>
Date: Fri May 24 09:35:44 2013 +0200
dosfslabel: Do not read beyond string length (Closes: #709587).
When checking whether the label contains any lower-case characters, do not read
beyond the end of the string.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 4203a90 (tag: v3.0.17)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Wed May 29 10:14:09 2013 +0200
Releasing version 3.0.17.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 3aa88ed
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Wed May 29 09:48:24 2013 +0200
Updating maximal lenght of a label in manpage to talk about bytes instead of characters, thanks to Francois Wendling <frwendling@gmail.com> (Closes: #655953).
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 0916f8a
Author: Jaroslav Skarvada <jskarvad@redhat.com>
Date: Wed May 29 09:56:08 2013 +0200
Fixing segfault in dosfslabel.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 4a265c6
Author: James Byrne <jbyrne@aminocom.com>
Date: Mon Apr 22 12:29:51 2013 +0100
Allow operation on SH4 CPUs and remove compiler warnings.
Simplify the GET_UNALIGNED_W macro and use it in all cases instead of making it
conditional on CPU types. This missed some CPUs that needed it (e.g. SH4), and
in any case the implementation caused "dereferencing type-punned pointer will
break strict-aliasing rules" warnings.
Enable extra warnings, but disable signed comparison and missing field
initializer warnings as these are not helpful.
Update write_boot_label() so that the boot_sector_16 and boot_sector cases are
handled separately instead of using an aliased pointer, as that causes
"dereferencing type-punned pointer will break strict-aliasing rules" warnings.
Make date_dos2unix(), usage() and cdiv() static functions as they are only used
in the files in which they are declared.
Update bad_name() and lfn_get() so that the extension is processed separately
instead of by indexing past the end of the name field as that causes "array
subscript is above array bounds" warnings.
Update the dosfsck() main function to avoid a warning that free_clusters may
be used uninitialized. Do not print the final count of files and clusters when
dosfsck is run with the "-b" option because the used files and clusters have
not been counted in this case.
Alter the setup_tables() function so that it does not cause an "array subscript
is below array bounds" warning.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit eb68a14
Author: James Byrne <jbyrne@aminocom.com>
Date: Mon Apr 22 13:32:01 2013 +0100
Add a .gitignore file.
Add a .gitignore file so that the results of compilation do not appear as
changes.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 336e8f1
Author: James Byrne <jbyrne@aminocom.com>
Date: Mon Apr 22 12:38:52 2013 +0100
Finish cleanup of byteswap code.
Commit 9ba8992 left three references to the old CT_LE_W macro.
Remove these since no conversion was needed as the value being
converted was zero.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 64b6227
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Thu Apr 4 08:08:00 2013 +0200
Shortening links to upstream homepage.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 76304be
Author: Cristian Rodríguez <crrodriguez@opensuse.org>
Date: Fri Mar 1 08:23:34 2013 +0100
Fix offsetof definition.
* include stddef.h to get the correct offsetof definition.
* remove local offsetof definition, systems not having it on stddef.h
are in violation of C89, C99, POSIX.1-2001.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 9ba8992
Author: Cristian Rodríguez <crrodriguez@opensuse.org>
Date: Fri Mar 1 08:58:36 2013 +0100
Cleanup byteswap code.
Remove all duplicate macro definitions for byteswapping routines
and replace them for proper usage of userspace endian(3).
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 8733e12 (tag: v3.0.16)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Wed May 29 10:06:01 2013 +0200
Releasing version 3.0.16.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit a9fa87e
Author: Petr Gajdos <pgajdos@suse.cz>
Date: Fri Mar 1 08:34:12 2013 +0100
Create rootdir entry volume label with mkdosfs, create it when
it doesn't exist with dosfslabel.
See https://bugzilla.novell.com/show_bug.cgi?id=657011#c4
for more information.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 92057f1
Author: Petr Gajdos <pgajdos@suse.cz>
Date: Fri Mar 1 08:33:18 2013 +0100
Forbid lowercase letters in label.
See https://bugzilla.novell.com/show_bug.cgi?id=657011#c4 and
http://support.microsoft.com/kb/71715/en-us for more information.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 5e265c4
Author: Petr Gajdos <pgajdos@suse.cz>
Date: Fri Mar 1 08:32:02 2013 +0100
Read label also from rootdir entry.
See https://bugzilla.novell.com/show_bug.cgi?id=657011#c4
for more information.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 5cec53c
Author: Petr Gajdos <pgajdos@suse.cz>
Date: Fri Mar 1 08:30:21 2013 +0100
alloc_rootdir_entry() is intended to be called with pattern == "FSCK%04dREC",
the old code (probably c&p from auto_rename()) doesn't reflect this.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 63938f0
Author: Petr Gajdos <pgajdos@suse.cz>
Date: Fri Mar 1 08:29:00 2013 +0100
Instead of eleven blanks, fill in "NO NAME " as specification tells.
See https://bugzilla.novell.com/show_bug.cgi?id=657011#c4 and
http://www.win.tue.nl/~aeb/linux/fs/fat/fat-1.html for more information.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 10c1c41
Author: Petr Gajdos <pgajdos@suse.cz>
Date: Fri Mar 1 08:58:15 2013 +0100
Write uppercase letters in label.
See https://bugzilla.novell.com/show_bug.cgi?id=657011#c4 and
http://support.microsoft.com/kb/71715/en-us for more information.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit a75fb1c (tag: v3.0.15)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Thu Feb 21 15:06:52 2013 +0100
Releasing version 3.0.15.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit c8f84fd
Author: Alexander Korolkov <alexander.korolkov@gmail.com>
Date: Mon Feb 4 00:22:34 2013 +0400
Using wcstombs() to convert LFN unicode characters to printable text.
This closes Debian bug #596336.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 1546545
Author: Alexander Korolkov <alexander.korolkov@gmail.com>
Date: Sun Sep 5 18:59:47 2010 +0400
Recode short filenames from DOS codepage (default 437).
Recode short filenames from DOS codepage (default 437) to the current
character encoding. This makes messages of dosfsck more readable.
Partially closes Debian bug #596336.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit ad76cae
Author: Jaroslav Skarvada <jskarvad@redhat.com>
Date: Thu Feb 21 14:40:52 2013 +0100
Fixing root directory allocation.
See https://bugzilla.redhat.com/show_bug.cgi?id=674095 for more information.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit b8201b3
Author: Jaroslav Skarvada <jskarvad@redhat.com>
Date: Thu Feb 21 14:40:25 2013 +0100
Fixing device detection.
See https://bugzilla.redhat.com/show_bug.cgi?id=710480 for more information.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 7a75638 (tag: v3.0.14)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Wed Jan 23 13:22:01 2013 +0100
Releasing version 3.0.14.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 5bdd7ef
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Wed Jan 23 13:16:20 2013 +0100
Documenting dosfsck -b in its manpage.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit a307be2
Author: Oleksij Rempel <bug-track@fisher-privat.net>
Date: Wed Jan 23 12:36:56 2013 +0100
Adding option for bootsector read-only check.
Most boot sectors may contains marker for filesystem state. We can this
bit on every mount and warn user if some thing wrong, without checking
complete filesystem.
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit ce2f8dc
Author: Oleksij Rempel <bug-track@fisher-privat.net>
Date: Wed Jan 23 12:35:13 2013 +0100
Checking boot sector for dirty bit.
Some OSos use reseved byte of boot sector to set state of the file
system. If first bit set, then filesystem is proably damaged - write
operation was not finished/cache not snycted/...
Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net>
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit f33ee8c
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Wed Jan 23 12:25:59 2013 +0100
Completing and updating all copyright headers for 2013.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit bfe6d25
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Wed Jan 23 12:17:20 2013 +0100
Updating my email address.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 13cdb4d (tag: v3.0.13)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sat Jun 30 19:10:44 2012 +0200
Releasing version 3.0.13.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit d039482
Author: Jaroslav Škarvada <jskarvad@redhat.com>
Date: Sat Jun 30 19:09:11 2012 +0200
Fix 'dosfslabel throws "Seek to 114116076544:Invalid argument" error when labeling'.
See https://bugzilla.redhat.com/show_bug.cgi?id=693662 for more information.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit e243612 (tag: v3.0.12)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sat Oct 29 08:40:53 2011 +0200
Releasing version 3.0.12.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 025b4f0
Author: Michael Casadevall <mcasadevall@ubuntu.com>
Date: Tue Jun 7 19:19:30 2011 +0200
Correcting miscalculation of sector number in some cases.
mkdosfs will incorrectly calculate the number of sectors of a
given FAT partition if the number sectors are odd due to
count_blocks incorrectly handling the remainder of a division
operation. This miscalculation causes the OMAP4 bootloader to
fail to boot.
This bug can be observed by comparing the total sector size in
fdisk expert more to fsck.msdos; this discrepancy only shows up
when the number of sectors are odd.
See https://bugs.launchpad.net/ubuntu/+source/dosfstools/+bug/794043
for more information.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 91a1fb9
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sat Jan 8 23:38:59 2011 +0100
Re-running Nindent.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 0390c4c
Author: Sergey Gusarov <laborer2008@gmail.com>
Date: Sat Jan 8 23:36:11 2011 +0100
Fixing compiler warnings related to the mismatch of types "char *" / "unsigned
char *".
These warnings appear when you compile the project with the option "-Wall", what
is done with the current default Makefile.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 4a8f8a6
Author: Jaroslav Skarvada <jskarvad@redhat.com>
Date: Thu Jan 6 22:35:00 2011 +0100
Fixing overflow bug in reclaim_file function, see
https://bugzilla.redhat.com/show_bug.cgi?id=660154 for more information.
The problem is that alloc_rootdir_entry counts with 10000 files at max, but the
filename buffer is only 8 chars long. Due to pattern mask used it results to
only 10 files at max (FSCK0-9REC). If there is more than 10 files, it overflows
and hangs.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit e0366da
Author: Sergey Gusarov <laborer2008@gmail.com>
Date: Thu Jan 6 22:31:39 2011 +0100
Fixing conversion specifiers in accordance with the type of expressions.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 2d8be9c
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sun Jan 2 15:41:44 2011 +0100
Indenting source files.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 697af85
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sun Jan 2 15:39:03 2011 +0100
Adding Nindent script from syslinux.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 66d55cd (tag: v3.0.11)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Dec 24 17:58:29 2010 +0100
Releasing version 3.0.11.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit d579802
Author: Michael Stapelberg <michael@stapelberg.de>
Date: Fri Nov 19 14:09:36 2010 +0100
Add better error message when the device cannot be opened.
This is helpful for SD cards or other removable media which have an enabled
write lock -- without the "Permission denied" message, the user has to strace
mkdosfs to find out what's going on.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit bb6000f
Author: Jaroslav Skarvada <jskarvad@redhat.com>
Date: Fri Oct 8 13:38:16 2010 +0200
Unalign on s390x, see http://bugzilla.redhat.com/show_bug.cgi?id=624596 for
more information.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 5ef7f1f (tag: v3.0.10)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sun Sep 12 09:35:47 2010 +0200
Releasing version 3.0.10.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit ea41797
Author: Alexander Korolkov <alexander.korolkov@gmail.com>
Date: Sun Sep 12 09:29:12 2010 +0200
Modify LFN direntries when file is renamed or deleted, see
Debian bug #596329.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit e56ff72
Author: Alexander Korolkov <alexander.korolkov@gmail.com>
Date: Sun Sep 12 09:27:07 2010 +0200
If the test of short filename fails, dosfsck could complain about
bad long filename, see Debian bug #596327.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit f0a42d0
Author: Alexander Korolkov <alexander.korolkov@gmail.com>
Date: Sun Sep 12 09:24:47 2010 +0200
dosfsck: don't complain about bad filenames when short filename
contains 7 or more characters with codes 128-255, see Debian
bug #596327.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 0113c5b
Author: Mitch Rybczynski <mrybczynski@miovision.com>
Date: Mon Jul 5 14:45:54 2010 +0200
Adding __arm__ define check for some crosscompile toolchains.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 88cb84f
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sun Mar 14 16:42:32 2010 +0100
Modernizing dosfslabel manpage.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 5aa7ec4
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sun Mar 14 16:33:47 2010 +0100
Modernizing dosfsck manpage.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 807ed80
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sun Mar 14 16:05:32 2010 +0100
Fixing spelling error in boot.c.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 5b6849d (tag: v3.0.9)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sun Jan 31 08:31:32 2010 +0100
Releasing version 3.0.9.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 33bca7d
Author: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Date: Sun Jan 31 00:11:41 2010 -0500
Be sure to store the updated reserved_sector count in the boot sector,
see Debian bug #567337.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 2a3bef8 (tag: v3.0.8)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sat Jan 23 10:16:18 2010 +0100
Releasing version 3.0.8.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 726c02d
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sat Jan 23 10:15:01 2010 +0100
Removing some cruft in end-comments.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit a5961d7
Author: Steven J. Magnani <steve@digidescorp.com>
Date: Thu Jan 21 16:58:11 2010 +0100
When compiling a 32-bit version of dosfstools on an x86_64 machine,
the resulting applications report strange errors on "large" (> 2 GiB)
partitions:
Seek to -2118967808:Invalid argument
Warning: Filesystem is FAT32 according to fat_length and fat32_length fields,
but has only 8613 clusters, less than the required minimum of 65525.
This may lead to problems on some systems.
This appears to be due to compilation with a 32-bit off_t and lseek() library
function.
Use lseek64 for positioning, and change some suspect uses of off_t to loff_t.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit bbb25bf
Author: Steven J. Magnani <steve@digidescorp.com>
Date: Thu Jan 21 16:56:26 2010 +0100
If dosfsck is run in read-only mode (-n), exit with code 0
if the only issue found is an uninitialized free cluster summary.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 1cae726
Author: Steven J. Magnani <steve@digidescorp.com>
Date: Thu Jan 21 16:55:30 2010 +0100
On x86_64, dosfsck incorrectly claims that a free_cluster summary of
0xFFFFFFFF, defined by Microsoft to be "uninitialized," is wrong.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 62f806a
Author: H. Peter Anvin <hpa@zytor.com>
Date: Fri Jan 8 09:16:38 2010 +0100
mkdosfs: correct alignment of the root directory.
Correct the code to align the root directory; it was broken before
since bs.dir_entries had already been set at the point of alignment.
This patch removes the dual use of bs.dir_entries and root_dir_entries
to carry the same information: the information is carried in
root_dir_entires exclusively, and then bs.dir_entries is set inside
setup_tables() at a late point.
The code to align the root directory is also wrapped in
if (align_structures); this avoids rounding the number of root
directory entries up to a whole sector when used with -a
(i.e. preserves the previous behavior.)
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 8825bda
Author: H. Peter Anvin <hpa@zytor.com>
Date: Wed Jan 6 20:55:36 2010 +0100
mkdosfs: improve wording in the man page for the -a option.
Improve the English language used in the man page for the -a (no
align) option to mkdosfs.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 21d3f81
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Wed Jan 6 11:27:25 2010 +0100
Adding reference to dosfslable in mkdosfs manpage.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 247ba06
Author: H. Peter Anvin <hpa@zytor.com>
Date: Wed Jan 6 11:18:55 2010 +0100
mkdosfs: by default align all structures to cluster boundaries
Align all data structures (reserved sectors, FATs, root directory for
FAT12/16) to an even multiple of the cluster size. This means that if
the partition is aligned, so will all clusters be. This adds
significant performance for anything where the physical sector size is
larger than the logical sector size, e.g. flash media or large-sector
hard disks.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 171bc07 (tag: v3.0.7)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Thu Dec 24 10:53:36 2009 +0100
Releasing version 3.0.7.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 28708fc
Author: Ben Hutchings <ben@decadent.org.uk>
Date: Thu Dec 24 09:55:52 2009 +0100
Fixing dosfslabel to set volume label in the right place,
see Debian bug #559985.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 2c405dd
Author: Lubomir Rintel <lkundrak@v3.sk>
Date: Thu Dec 24 09:39:39 2009 +0100
Fixing out-of bound writes.
Firstly, packed attribute is added to the structure so that extension
is guarranteed to immediately follow name for the cross-name-extension
reads to succeed.
Secondly, writes into dir_entry->name that span through the extension as
well are split into two, so that FORTIFY_SOURCE's bound checking does
not abort dosfsck. There also was an off-by-one error in auto_rename()'s
sprintf().
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit b8f3efe
Author: San Mehat <san@google.com>
Date: Thu Dec 24 09:31:41 2009 +0100
Adding custom exit code in dosfsck for the case where the FS is read only.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 0657e01 (tag: v3.0.6)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sun Oct 4 10:59:33 2009 +0200
Releasing version 3.0.6.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit bc84254
Author: Steven J. Magnani <steve@digidescorp.com>
Date: Sun Oct 4 10:58:43 2009 +0200
Attempt to improve clarity of the orphan cluster reclaim code.
Minor optimization - remove some unnecessary checking.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 8054b4a
Author: Steven J. Magnani <steve@digidescorp.com>
Date: Sun Oct 4 08:37:19 2009 +0200
Close hole that permitted clusters to link to (invalid) cluster 1.
If an orphan chain that linked to cluster 1 was reclaimed to a file,
deletion of the file would result in a filesystem panic.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit e51af88
Author: Steven J. Magnani <steve@digidescorp.com>
Date: Sun Oct 4 08:32:30 2009 +0200
Fix erroneous report of huge number of clusters in use on big-endian
systems when the FSINFO free cluster count is reset.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 16ba63f (tag: v3.0.5)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Mon Jul 27 14:26:11 2009 +0200
Releasing version 3.0.5.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 28ff9d9
Author: Piotr Kaczuba <pepe@attika.ath.cx>
Date: Sun Jul 26 22:21:25 2009 +0200
Signed/unsigned char mismatch in check.c causes false positives
in bad_name() and can result in data loss, see Debian bug #538758.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit d42a273
Author: Andrew Tridgell <tridge@samba.org>
Date: Sun Jul 26 22:12:06 2009 +0200
Update to new kernel patches that add FAT_NO_83NAME flag.
See http://lkml.org/lkml/2009/7/20/425 and
http://lkml.org/lkml/2009/7/20/424 for more information.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit dd0f0b5 (tag: v3.0.4)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Tue Jul 21 08:10:52 2009 +0200
Releasing version 3.0.4.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit b9f37a6
Author: Andrew Tridgell <tridge@samba.org>
Date: Tue Jul 21 07:59:22 2009 +0200
Modify dosfstools to support the dummy 8.3 short filename values
used by Linux systems with the VFAT_FS_DUALNAMES option disabled.
See http://lkml.org/lkml/2009/6/26/313 and
http://lkml.org/lkml/2009/6/26/314 for more information.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit ecd15e8
Author: Paul Rupe <prupe@nc.rr.com>
Date: Tue May 19 10:37:52 2009 +0200
Fixing "Too many files need repair" error during fsck.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 7c16098 (tag: v3.0.3)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Mon May 18 15:12:04 2009 +0200
Releasing version 3.0.3.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit b396dcf
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Mon May 18 15:10:55 2009 +0200
Also declaring arm as an unaligned architecture, see Debian bug #502961.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit ff1b24e
Author: Steven J. Magnani <steve@digidescorp.com>
Date: Mon May 18 15:01:49 2009 +0200
Adding support for limited-memory embedded systems.
This patch reorganizes heap memory usage by dosfsck and mkdosfs
to support limited-memory embedded systems - in particular, those
based on Xilinx's Microblaze processor. It also adds a few comments.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 89f0b72
Author: Mike Frysinger <vapier@gentoo.org>
Date: Thu Mar 5 07:03:36 2009 +0100
Declaring Blackfin as an unaligned architecture.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit b54a8a4 (tag: v3.0.2)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sat Feb 28 09:48:04 2009 +0100
Releasing version 3.0.2.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 9500529
Author: Hiroaki Ishizawa <hiroaki.ishizawa@gmail.com>
Date: Fri Feb 13 10:00:46 2009 +0100
dosfsck corrupts root directory when fs->nfats is 1.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 043f8a8
Author: Stepan Kasal <skasal@redhat.com>
Date: Fri Jan 30 14:56:33 2009 +0100
src/dosfslabel.c (main): After writing the label, exit code should be 0.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 017da27
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Jan 30 14:06:01 2009 +0100
Also installing ChangeLog in install-doc target of Makefile.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 1c76f0f
Author: Stepan Kasal <skasal@redhat.com>
Date: Fri Jan 30 14:05:12 2009 +0100
Makefile: Do not clobber time stamps of doc files.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit df2d2f1 (tag: v3.0.1)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sun Nov 23 22:45:45 2008 +0100
Releasing version 3.0.1.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 17b269b
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sun Nov 23 18:41:01 2008 +0100
Applying Fedoras dosfstools-vfat-timingfix.diff from Bill Nottingham
<notting@redhat.com> to fix vfat timing issue. See
https://bugzilla.redhat.com/show_bug.cgi?id=448247 for more information.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit e597caf
Author: Ulrich Mueller <ulm@gentoo.org>
Date: Tue Oct 7 07:55:37 2008 +0200
Patch to check for bad number of clusters in dosfsck:
* FAT16 filesystems with 65525 clusters or more will be rejected
(Before, this was not tested for. Up to 65535 clusters were accepted
as good).
* For FAT32 filesystems with less than 65525 a warning message will be
output.
Macro MSDOS_FAT12 is now replaced by FAT12_THRESHOLD to make it
consistent with the definition in mkdosfs and to remove the dependency
on the kernel version.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 90102bc
Author: Dann Frazier <dannf@hp.com>
Date: Tue Sep 30 07:25:19 2008 +0200
Changing some wording to make the indended meaning of "full-disk device"
more obvious.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 21e9ba0 (tag: v3.0.0)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sun Sep 28 11:43:19 2008 +0200
Releasing version 3.0.0.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit eaf145d
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sun Sep 28 11:29:01 2008 +0200
Adding GPL headers to all files.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 0826117
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sun Sep 28 10:51:55 2008 +0200
Adding new GPL license file.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit f8d6127
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 23:31:12 2008 +0200
Redoing Makefile from scratch.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit b4feb73
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Sat Sep 27 00:17:38 2008 +0200
Removing whitespaces in all files at EOL and EOF.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 1410138
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 23:48:56 2008 +0200
Adding Debians dosfslabel.8 manpage from Francois Wendling
<frwendling@free.fr>.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit f62e7f2
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 18:36:04 2008 +0200
Updating version.h includes to new location of version.h file.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 32e5952
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 18:19:36 2008 +0200
Removing old lsm file.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 25a433b
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 18:07:47 2008 +0200
Removing old cvsignore files.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit acac13f
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 18:18:39 2008 +0200
Removing old build file.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 3ecdd21
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 18:19:16 2008 +0200
Removing old GPL license files.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit f183d0e
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 18:21:57 2008 +0200
Unifying dosfsck and mkdosfs Makefiles in common src/Makefile.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 61e7466
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 18:04:02 2008 +0200
Unifying dosfsck and mkdosfs sources in common src directory.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 7552d57
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 18:05:27 2008 +0200
Unifying dosfsck and mkdosfs manpages in common man directory.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 124598b
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 18:12:29 2008 +0200
Unifying dosfsck and mkdosfs documents in common doc directory.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit fb9c46b
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 15:39:51 2008 +0200
Applying Gentoos dosfstools-2.11-preen.patch from Roy Marples
<uberlord@gentoo.org> to alias dosfsck -p to -a:
* Map -p to -a for baselayout-2, #177514.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit aaa40a9
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 15:49:43 2008 +0200
Applying Gentoos dosfstools-2.11-build.patch from Mike Frysinger
<vapier@gentoo.org> to improve Makefile:
* Respect user settings #157785/#157786 by Diego Petteno.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 251626d
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 15:37:34 2008 +0200
Applying Gentoos dosfstools-2.11-verify-double-count-fix.patch from
Robin H. Johnson <robbat2@gentoo.org> to fix double count of files
during verification:
* Don't double-count n_files during a verification pass.
Bugzilla: http://bugs.gentoo.org/show_bug.cgi?id=99845
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit e670ea8
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 15:33:36 2008 +0200
Applying Gentoos dosfstools-2.11-fat32size.patch from Mike Frysinger
<vapier@gentoo.org> to fix generation of filesystems on 256meg devices:
* Fix generation of FAT filesystems on devices that are 256meg in size
Patch by Ulrich Mueller and accepted upstream
http://bugs.gentoo.org/112504
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit a6dc6a4
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 15:22:06 2008 +0200
Applying Suses dosfstools-2.11-unsupported-sector-size.patch from Petr
Gajdos <pgajdos@suse.cz> to add sector size warning:
* added warning for creation msdos on filesystem with sector size
greater than 4096 [fate#303325]
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit f746956
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 15:18:35 2008 +0200
Applying Suses dosfstools-2.11-mkdosfs-geo0.diff from Ludwig Nussel
<lnussel@suse.de> to fix handling of zero heads and sectors:
* the HDIO_GETGEO ioctl works on device mapper devices but returns
zero heads and sectors. Therefore let's a) assume dummy values in
that case in mkdosfs and b) don't consider such fat file systems as
invalid in dosfsck. The Linux kernel accepts them anyways.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit cf243e4
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 15:15:40 2008 +0200
Applying Suses dosfstools-2.11-linuxfs.patch from Ruediger Oertel
<ro@suse.de> to not include linux/fs.h.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 2d4f184
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 15:11:50 2008 +0200
Applying Fedoras dosfstools-2.11-assumeKernel26.patch from Peter Vrabec
<pvrabec@redhat.com> to remove linux 2.6 conditionals:
* LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) does not work with
glibc-kernheaders-2.4-9.1.94
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 739a6fb
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 15:05:00 2008 +0200
Applying Debians 99-conglomeration.dpatch (no other information
available).
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 3b5ed8a
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 14:26:41 2008 +0200
Applying Debians 15-manpage-files.dpatch from Daniel Baumann
<daniel@debian.org> to improve dosfsck manpage:
* Lists fsckNNNN.rec files in FILES section (Closes: #444596).
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 3b6a863
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 14:34:42 2008 +0200
Applying Debians 13-getopt.dpatch from Adonikam Virgo
<adonikam@virgonet.org> to fix mkdosfs getopt:
* Fixes backup sector getopt (Closes: #232387, #479794).
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 1b2c8ca
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 14:34:17 2008 +0200
Applying Debians 12-zero-slot.dpatch by Karl Tomlinson
<karlt@karlt.net> to fix dosfsck zero slot crashes:
* Fixes crashes due to zero slot numbers causing a negative offset in
the call to copy_lfn_part in lfn_add_slot. On amd64 this results in
a SIGSEGV in copy_lfn_part. On x86 the result is heap corruption and
thus sometimes a SIGSEGV or double free abort later. (Closes:
#152550, #353198, #356377, #401798).
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit eec8585
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 14:33:54 2008 +0200
Applying Debians 11-memory-efficiency.dpatch from Eero Tamminen
<eero.tamminen@nokia.com> to improve dosfsck memory efficiency:
* Improves memory efficiency when checking filesystems.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 06bd669
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 14:33:28 2008 +0200
Applying Debians 10-manpage-synopsis.dpatch from Daniel Baumann
<daniel@debian.org> to fix manpage synopsis:
* List alternative binary names in manpage synopsis (Closes: #284983).
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 42d340d
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 14:32:46 2008 +0200
Applying Debians 09-manpage-fat32.dpatch from Daniel Baumann
<daniel@debian.org> to improve mkdosfs manpage:
* Don't claim that FAT32 is not choosed automatically (Closes:
#414183).
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 0f5ce0d
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 14:32:23 2008 +0200
Applying Debians 08-manpage-drop.dpatch from Daniel Baumann
<daniel@debian.org> to improve dosfsck manpage:
* Don't use confusing word 'drop' when 'delete' is meant (Closes:
#134100).
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 8ec54dd
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 14:31:50 2008 +0200
Applying Debians 07-manpage-spelling.dpatch from Justin Pryzby
<justinpryzby@users.sourceforge.net> to fix mkdosfs manpage typos.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 4371588
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 14:30:31 2008 +0200
Applying Suses dosfstools-2.11_determine-sector-size.patch from Petr
Gajdos <pgajdos@suse.cz> to determine mkdosfs sector size automatically:
* determine sector size of device automatically or if -S parameter
present, verify, that it's not under physical sector size
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit fc92e19
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 14:30:03 2008 +0200
Applying Suses dosfstools-2.11-o_excl.patch from Pavol Rusnak
<prusnak@suse.cz> to use O_EXCL in mkdosfs:
* mkdosfs now opens device with O_EXCL [#238687]
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 3084697
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 14:29:36 2008 +0200
Applying Debians 04-unaligned-memory.dpatch from Khalid Aziz
<khalid_aziz@hp.com> to fix dosfsck unaligned memory accesses:
* Fix unaligned memory accesses which cause warnings to appear
everytime the elilo bootloader script runs. This has led a number of
users to believe their install has failed (Closes: #258839).
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 6d5c091
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 13:47:40 2008 +0200
Applying Fedoras dosfstools-2.11-label.patch from Jeremy Katz
<katzj@redhat.com> to add dosfslabel (originally by Peter Jones).
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 07ef487
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 13:41:14 2008 +0200
Applying Fedoras dosfstools-2.11-fortify.patch from Jakub Jelinek
<jakub@redhat.com> to make it build with -D_FORTIFY_SOURCE=2:
* This violates -D_FORTIFY_SOURCE=2 (which is stricter than C
standard), but isn't actually any buffer overflow. But using memcpy
is more efficient anyway.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit 78f9dca
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Fri Sep 26 13:40:47 2008 +0200
Applying Fedoras dosfstools-2.7-argfix.patch (no other information
available).
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
commit ba6774a (tag: v2.11)
Author: Daniel Baumann <mail@daniel-baumann.ch>
Date: Thu Jun 26 12:45:36 2008 +0200
Adding version 2.11.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
|