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
|
2015-07-23 Miloslav Trmač <mitr@redhat.com>
* configure.ac: Release 0.62.
* NEWS: Update.
* po/*: Update.
* Makefile.am (lib_libuser_la_LDFLAGS): Update version info.
2015-06-26 Miloslav Trmač <mitr@redhat.com>
* modules/files.c (open_and_copy_file): Replace and heavily modify ...
(lu_files_create_backup): ... this.
(lock_file_handle_existing, lock_file_create, lock_file_remove)
(struct editing, editing_open, replace_file_or_symlink)
(editing_close): New functions.
(generic_lookup, generic_is_locked, lu_files_enumerate)
(lu_files_users_enumerate_by_group, lu_files_groups_enumerate_by_user)
(lu_files_enumerate_full): Remove locking on read-only operations.
(generic_add, generic_mod, generic_del, generic_lock)
(generic_setpass): Use struct editing instead of dealing with locking,
backups, SELinux individually.
* lib/user_private.h (lu_util_lock_obtain, lu_util_lock_free): Mark
as deprecated.
* lib/util.c (lu_util_field_write): Fail on an incomplete write().
2015-06-25 Miloslav Trmač <mitr@redhat.com>
* modules/files.c (format_generic, generic_setpass): Refuse to write
field values which contain \n.
* tests/files_test.py (Tests.testUserAdd9, Tests.testUserMod8)
(tests.testUserSetpass5, tests.testGroupAdd6, tests.testGroupMod7)
(tests.testGroupSetpass4): New tests.
* docs/reference/Makefile.am: Update from gtk-doc example.
(AUTOMAKE_OPTIONS): Remove no longer needed workaround.
(DOC_SOURCE_DIR): Follow upstream example.
* docs/reference/libuser-docs.sgml: Comment out unused reference.
* docs/reference/libuser-sections.txt: Add types newly recognized by
gtk-doc.
* lib/error.h (enum lu_status): Add docstring.
(struct lu_error): Document members. Remove gtk-doc workaround.
* lib/prompt.h (struct lu_prompt): Use a docstring. Remove gtk-doc
workaround.
* lib/user.h (enum lu_entity_type): Add docstring.
2015-06-25 Miloslav Trmač <mitr@redhat.com>
* lib/user.c (lu_dispatch)
* modules/ldap.c (lu_ldap_handle_lock)
* samples/homedir.c (main): Silence Eclipse warnings.
2015-03-24 Miloslav Trmač <mitr@redhat.com>
* configure.ac: Release 0.61.
* NEWS: Update.
* po/*: Update.
* Makefile.am (lib_libuser_la_LDFLAGS): Update version info.
2015-03-21 Miloslav Trmač <mitr@redhat.com>
* po/libuser.pot: Remove autogenerated file. Unlike Transifex, Zanata
does not need it.
2015-03-17 Miloslav Trmač <mitr@redhat.com>
* zanata.xml: Update for changed version name on the server.
2015-03-16 Miloslav Trmač <mitr@redhat.com>
* po/POTFILES.in: Remove reference to removed modules/krb5.c.
* .tx/config: Remove.
* zanata.xml: Add. To pull updated translations, run (zanata-cli pull).
2015-03-10 Miloslav Trmač <mitr@redhat.com>
* python/libusermodule.c (PyInit_libuser): Raise NotImplementedError
when running in a non-UTF-8 locale.
2015-02-24 Miloslav Trmač <mitr@redhat.com>
* tests/files_test.py
* tests/ldap_test.py: Replace deprecated assert_ with more specific
assert* methods.
* tests/files_test.py (Tests.testGroupMod4): Add a missing assertion.
* python/libusermodule.c (dict_add_stolen_object)
(dict_add_string): Remove.
(initialize_libuser_module): Use PyModule_Add* instead of home-grown
alternatives.
* python/common.h (struct libuser_prompt): Move ...
* python/misc.c (struct libuser_prompt): ... here.
* python/common.h (Py_ssize_t): Remove, we can no longer support Python
< 2.5.
* python/admin.c (AdminType)
* python/ent.c (EntityType)
* python/misc.c (PromptType): Use the right form for tp_name.
* python/common.h (PYSTRTYPE_FROMFORMAT): New macro.
* python/misc.c (libuser_prompt_print): Replace with ...
(libuser_prompt_str): ... this. PromptType updated.
* python/ent.c (libuser_entity_setattr): Rename to ...
(libuser_entity_setattro) ... this, updating the calling convention
and EntityType.
* python/admin.c (Admin_Check)
* python/ent.c (Entity_Check): Remove unused macros.
* python/ldap-script
* python/prompt-script
* python/test-script: Port from obsolete libuser API.
* python/test-script: Stop overwriting the list() function. Don't use
list(_.keys()) unnecessarily.
* python/gtk_prompt_callback.py (libuser_gtk_prompt_callback, harness)
* python/ldap-script
* python/prompt-script
* python/test-script
* tests/default_pw_test.py
* tests/files_test.py (Tests.testUsersEnumerate1)
(Tests.testUsersEnumerateByGroup1, Tests.testUsersEnumerateByGroupFull1)
(Tests.testUsersEnumerateByGroupFull2)
(Tests.testUsersEnumerateByGroupFull3, Tests.testUsersEnumerateFull1)
(Tests.testGroupAdd2, Tests.testGroupAdd4, Tests.testGroupMod2)
(Tests.testGroupMod4, Tests.testGroupsEnumerate1)
(Tests.testGroupsEnumerateByUser1, Tests.testGroupsEnumerateByUserFull1)
(Tests.testGroupsEnumerateByUserFull2)
(Tests.testGroupsEnumerateByUserFull3, Tests.testGroupsEnumerateFull1)
(Tests.testValidateIdValue)
* tests/fs_test.py (main)
* tests/ldap_test.py (Tests.testUserSetpass2, Tests.testUserSetpass3)
(Tests.testUserRemovepass2, Tests.testUserRemovepass3)
(Tests.testUsersEnumerate, Tests.testUsersEnumerateByGroup1)
(Tests.testUsersEnumerateFull, Tests.testUsersEnumerateByGroupFull1)
(Tests.testUsersEnumerateByGroupFull2)
(Tests.testUsersEnumerateByGroupFull3, Tests.testGroupAdd2)
(Tests.testGroupMod2, Tests.testGroupSetpass2, Tests.testGroupSetpass3)
(Tests.testGroupRemovepass2, Tests.testGroupRemovepass3)
(Tests.testGroupsEnumerate, Tests.testGroupsEnumerateByUser1)
(Tests.testGroupsEnumerateFull, Tests.testGroupsEnumerateByUserFull1)
(Tests.testGroupsEnumerateByUserFull2)
(Tests.testGroupsEnumerateByUserFull3)
* tests/pwhash.py: Update using (2to3-3.3 -w -f all -f buffer -f idioms
-f set_literal -f ws_comma), add a few line wraps.
* tests/files_test.py (Tests.testGroupAdd4, Tests.testGroupMod4): Revert
overzealous .has_key removal.
(Tests.testValidateIdValue): Test with 500L again on Python 2.
* tests/default_pw_test.py: Use sys.stderr.write instead of print() for
compatibility with Python 2.
* tests/fs_test.py (main): Consistently use spaces for indentation.
* tests/default_pw_test (valid_password): Make compatible with Python 3.
* python/common.h (AdminType, PromptType): New declarations.
* python/admin.c (libuser_admin_getattr, libuser_admin_setattr): Replace
by ...
(libuser_admin_get_prompt, libuser_admin_set_prompt)
(libuser_admin_get_prompt_args, libuser_admin_set_prompt_args)
(libuser_admin_getseters): ... use of PyGetSetDef.
(AdminType): Make public. Add tp_doc, use tp_methods instead of
tp_getattr.
(libuser_admin_methods, AdminType): Remove no longer necessary forward
declarations.
(libuser_admin_new): Stop using Py_FindMethod unavailable in Python 3.
* python/ent.c (libuser_entity_getattr): Remove.
(EntityType): Add tp_doc, use tp_methods instead of tp_getattr.
(libuser_entity_mapping_methods, libuser_entity_methods): Remove no
longer necessary forward declarations.
* python/misc.c (libuser_prompt_getattr, libuser_prompt_setattr):
Replace by ...
(libuser_prompt_get_key, libuser_prompt_set_key)
(libuser_prompt_get_prompt, libuser_prompt_set_prompt)
(libuser_prompt_get_domain, libuser_prompt_set_domain)
(libuser_prompt_get_visible, libuser_prompt_set_visible)
(libuser_prompt_get_default_value, libuser_prompt_set_default_value)
(libuser_prompt_get_value, libuser_prompt_set_value)
(libuser_prompt_getseters): ... use of PyGetSetDef.
(PromptType): Make public. Add tp_doc.
(PromptType): Remove no longer necessary forward declaration.
* python/libusermodule.c (initialize_libuser_module): Initialize types
as required to make tp_getseters and tp_methods work. Add a return
value. All users updated.
2015-02-20 Miloslav Trmač <mitr@redhat.com>
* python/libusermodule.c (libuser_module_doc): Move out of the Python 3
conditional.
(initlibuser): Use libuser_module_doc.
* python/libusermodule.c (initlibuser): Use PyMODINIT_FUNC as Python
documents.
* python/libusermodule.c (initialize_libuser_module): Split from
initlibuser().
(libuser_module_doc, libuser_module, PyInit_libuser): New definitions
to support loading as a Python 3 module.
* python/common.h (PYINTTYPE_FROMLONG): New macro to abstract away
returning integers in Python 2 and 3.
* python/admin.c (libuser_admin_do_wrap, libuser_admin_wrap_boolean)
(libuser_admin_setpass, libuser_admin_create_home)
(libuser_admin_remove_home, libuser_admin_remove_home_if_owned)
(libuser_admin_move_home, libuser_admin_create_remove_mail)
(libuser_admin_add_user, libuser_admin_delete_user)
* python/ent.c (libuser_entity_has_key)
* python/libusermodule (initlibuser)
* python/misc.c (libuser_prompt_getattr): Use PYINTTYPE_FROMLONG.
* python/common.h (PYSTRTYPE_FROMSTRING): New macro to abstract away
returning strings to Python 2 and 3.
* python/ent.c (convert_value_array_pylist): Document that it may now
return NULL.
* python/ent.c (convert_value_array_pylist, libuser_entity_getattrlist)
* python/libusermodule.c (libuser_get_user_shells, dict_add_string)
* python/misc.c (libuser_prompt_getattr): Use PYSTRTYPE_FROMSTRING.
* python/ent.c (libuser_convert_to_value): Remove two more direct uses
of PyString_AsString in debug output (converting one, fixing the other).
* python/ent.c (libuser_convert_to_value): Fix a type mismatch in debug
output.
* python/common.h (PYSTRTYPE_ASSTRING, PYSTRTYPE_CHECK): New macros
to abstract away accepting strings from Python 2 and 3.
* python/ent.c (libuser_convert_to_value, libuser_entity_setattr)
(libuser_entity_get_item, libuser_entity_set_item)
* python/misc.c (libuser_prompt_setattr): Use PYSTRTYPE_ASSTRING and
PYSTRTYPE_CHECK.
* Makefile.am (AM_TESTS_ENVIRONMENT): Define PYTHON in tests.
* tests/config_test.sh:
* tests/default_pw_test:
* tests/files_test:
* tests/fs_test:
* tests/ldap_test:
* tests/pwhash_test: Use $PYTHON to run tests.
* Makefile.am (pyexec_LTLIBRARIES): Rename from libusermodule.so to
libuser.so so that Python 3 can find it. Dependency data updated.
2015-02-18 Miloslav Trmač <mitr@redhat.com>
* configure.ac: Define PYINCLUDEDIR.
* Makefile.am (PYTHON_CPPFLAGS): Use PYINCLUDEDIR instead of hard-coding
the path. This is necessary for Python 3.
2014-01-23 Miloslav Trmač <mitr@redhat.com>
* python/admin.c (libuser_admin_user_methods)
(libuser_admin_group_methods)
* python/ent.c (libuser_methods): Remove unused definitions.
* Makefile.am (noinst_HEADERS): Move ...
(python_libusermodule_la_SOURCES): ... here, to use ordinary linking
instead of #including .c files.
* python/admin.c (libuser_admin_new)
* python/ent.c (convert_value_array_pylist, convert_ent_array_pylist)
(libuser_wrap_ent, EntityType)
* python/libusermodule.c (libuser_get_user_shells)
* python/misc.c (libuser_admin_python_prompter)
(libuser_admin_prompt_console, libuser_admin_prompt_console_quiet)
(libuser_prompt_new): Make non-static, module-internal.
* python/common.h: Use G_GNUC_INTERNAL declarations instead of static
declarations for all of the above symbols.
* python/common.h (AdminType, PromptType): Remove declarations that
would result in redundant static definitions.
* python/debug.h (indent, getindent): Replace by declarations.
* python/libusermodule.c (indent, getindent): Move the definitions here
to keep the indent a shared value.
* modules/krb5.c: Remove, there's no point distributing the non-working
code. It can always be resurrected from the VCS.
* configure.ac (KRB5): Remove hardcoded-false conditional.
* Makefile.am (pkglib_LTLIBRARIES): Remove support for the KRB5
conditional. Related configuration removed.
* docs/libuser.conf.5.in, docs/sgml/libuser.sgml, TODO: Remove
references to the krb5 module.
* docs/Makefile.am (sgml/libuser.txt, sgml/libuser.html): Fix build if
$(srcdir) is an absolute path.
2014-01-02 Miloslav Trmač <mitr@redhat.com>
* tests/default_pw_test.py: Remove an unused import.
* lib/util.c (lu_util_field_write): Remove redundant assignments.
* lib/util.c (lu_util_field_write): Fix a memory leak.
2013-11-21 Miloslav Trmač <mitr@redhat.com>
* tests/fs_test: New function filtered_ls. Use it in all tests, reformat
some of the expected results to match.
* tests/fs_test: Make files setuid after setting the owner, not before;
this doesn't matter with fakeroot but does matter without it.
* tests/fs_test: Make it possible to run tests as real root, without
fakeroot.
* tests/fs_test: Use a shell function instead of (cp -a) to prepare
source directories for tests, to avoid yet another fakeroot bug. Update
the expected test results.
2013-10-18 Miloslav Trmač <mitr@redhat.com>
* docs/Makefile.am (SGML_OUTPUTS): New variable.
(CLEANFILES): Use SGML_OUTPUTS.
(EXTRA_DIST): Add SGML_OUTPUTS so that sgml2txt is not required when
building from a release tarball.
2013-10-16 Miloslav Trmač <mitr@redhat.com>
* python/ent.c (libuser_entity_set_item): Fix a missing parameter in
debug output.
* modules/krb5.c (lu_krb5_user_setpass): Fix a missing initialization.
2013-10-12 Miloslav Trmač <mitr@redhat.com>
* configure.ac: Release 0.60.
* NEWS: Update.
* po/*: Update.
* Makefile.am (lib_libuser_la_LDFLAGS): Update version info.
* apps/luserdel.c (main)
* python/admin.c (libuser_admin_remove_home): Use
lu_homedir_remove_for_user() instead of looking up LU_HOMEDIRECTORY
manually.
* lib/error.h (lu_status): New value lu_error_homedir_not_owned.
* lib/error.c (lu_strerror, lu_error_is_error): Support
lu_error_homedir_not_owned.
* lib/fs.c (remove_subdirectory): New parameter required_toplevel_uid.
All users updated.
(homedir_remove_for_user, lu_homedir_remove_for_user)
(lu_homedir_remove_for_user_if_owned): New functions.
* lib/fs.h (lu_homedir_remove_for_user)
(lu_homedir_remove_for_user_if_owned): New declarations.
* docs/reference/libuser-sections.txt: Add lu_homedir_remove_for_user and
lu_homedir_remove_for_user_if_owned.
* python/admin.c (libuser_admin_remove_home_if_owned): New function.
(libuser_admin_methods): New entry for removeHomeIfOwned.
* tests/fs_test.py (main): New option --remove-if-owned.
* tests/fs_test: Test lu_homedir_remove_for_user_if_owned().
* python/modules.txt: Document createHome, moveHome, removeHome,
removeHomeIfOwned, createMail, removeMail.
Based on a smaller patch by Robin Hack <rhack@redhat.com>.
* lib/user.c (lu_default_int): Precompute the replacement strings
instead of computing it for each key. This is a little faster,
and more importantly, we can be sure that the %d replacement value
will be the same for all keys.
* lib/util.c (lu_util_shadow_current_date): Rename to...
* lib/util.c (lu_util_shadow_current_date_or_minus_1): ... this.
Return -1 if the time is not available, or if the time would result in
special-cased LU_SHADOW* values. All users updated.
2013-09-20 Miloslav Trmač <mitr@redhat.com>
* libuser.pc.in: Use Libs.private for @CRYPT_LIBS@, Requires.private for
gmodule-no-export-2.0. glib-2.0 and gobject-2.0 stay in Requires:
because applications usually need both of them, and there are known
cases of applications that don't ask pkg-config for them explicitly. (We
might consider removing gobject-2.0 if all users use the non-GValueArray
helpers; removing glib-2.0 is pointless.)
2013-07-08 Miloslav Trmač <mitr@redhat.com>
* docs/reference/Makefile.am (AUTOMAKE_OPTIONS): Workaround a bug in
automake-1.13-4.
* configure.ac: Update gettext version, which avoids autoconf warnings.
* configure.ac: Use AM_PROG_AR to shut up automake. This required moving
AC_USE_SYSTEM_EXTENSIONS up.
2013-06-28 Miloslav Trmač <mitr@redhat.com>
* tests/fs_test: Skip the test if fakeroot is not available.
* .tx/config: Update configuration for hosted Transifex changes.
2013-03-28 Miloslav Trmač <mitr@redhat.com>
* configure.ac: Release 0.59.
* NEWS: Update.
* po/*: Update.
* Makefile.am (lib_libuser_la_LDFLAGS): Update version info.
(EXTRA_DIST): Fix a typo that broke (make distcheck).
* lib/user_private.h (lu_util_fscreate_from_fd): Fix the non-SELinux
macro.
* tests/fs_test: Create temporary files only in a temporary directory.
2013-03-26 Miloslav Trmač <mitr@redhat.com>
* lib/fs.c (lu_homedir_populate): Fix typo in docstring. Noticed by
Viktor Hercinger <vhercing@redhat.com>.
2013-03-22 Miloslav Trmač <mitr@redhat.com>
* tests/fs_test: Set umask because it affects test output.
Patch by Viktor Hercinger <vhercing@redhat.com>.
2013-02-20 Miloslav Trmač <mitr@redhat.com>
* configure.ac: Enable large file support, in particular to enable
working with 64-bit inode numbers.
2013-02-09 Miloslav Trmač <mitr@redhat.com>
* lib/fs.c (struct copy_access_options): Remove member ignore_eexist.
(copy_symlink, copy_regular_file, lu_copy_dir_and_close): Remove the
possibility to ignore EEXIST, always fail on pre-existing contents.
(lu_homedir_populate): Incompatible change: Refuse to populate
pre-existing directories.
(lu_homedir_move): Stop setting access_options.ignore_eexist.
* tests/fs_test.py (main): Beautify output on createHome failure
to help checking the output.
* tests/fs_test: Fix mv2_output check. Test that attempts to
populate a pre-existing home directory are refused.
2013-02-08 Miloslav Trmač <mitr@redhat.com>
* lib/fs.c (copy_regular_file): Rename from...
(copy_regular_file_and_close): ... this, and stop closing src_fd; we
don't really need to use this irregular model here.
(copy_dir_entry): Update.
* lib/fs.c (lu_homedir_populate, lu_homedir_move)
(lu_nscd_flush_cache, lu_mail_spool_create)
(lu_mail_spool_remove): These functions are public API, add
g_return_*_if_fail() checks for input parameters.
* lib/fs.c (copy_symlink): Fix comments.
* lib/fs.c (copy_symlink, copy_regular_file_and_close)
(copy_dir_entry, lu_homedir_copy, lu_homedir_populate)
(mail_spool_path, lu_mail_spool_remove): Add LU_ERROR_CHECK calls.
* lib/fs.c (copy_symlink, copy_regular_file_and_close): Use simpler
parameter names.
* lib/fs.c (copy_dir_entry): Split from ...
(lu_copy_dir_and_close): ... to simplify handling of src_path_buf and
dest_path_buf.
* lib/fs.c (lu_copy_dir_and_close, lu_homedir_copy): Use GString
buffers to build paths, removing the PATH_MAX limit and reducing O(N^2)
memory use to O(N).
* lib/fs.c (remove_subdirectory, lu_homedir_remove): Use a single
GString to build all paths, removing the PATH_MAX limit and
reducing O(N^2) memory use to O(N).
* lib/fs.c (lu_copy_dir_and_close): Simplify the control flow a little.
* lib/fs.c (copy_symlink, copy_regular_file_and_close): Split from ...
(lu_copy_dir_and_close): ... this.
2013-02-04 Miloslav Trmač <mitr@redhat.com>
* configure.ac: Define GLIB_VERSION_MIN_REQUIRED to shut up warnings
about GValueArray being deprecated.
* lib/common.c: #include <config.h> first, to let the
GLIB_VERSION_MIN_REQUIRED take effect.
* configure.ac: Rename from ...
* configure.in: ... the obsolete name.
* configure.in: Enable system extensions, in particular the
secure_getenv() declaration. Check for secure_getenv() in
addition to __secure_getenv().
* lib/config.c: Use secure_getenv() if __secure_getenv() is not
available, abort build if neither is available.
Patch by Viktor Hercinger <vhercing@redhat.com>.
2012-12-20 Miloslav Trmač <mitr@redhat.com>
* apps/lnewusers.c (main)
* apps/luseradd.c (main): Only set the user's password after the
home directory is created.
* lib/fs.c (struct copy_access_options): New member ignore_eexist.
(lu_copy_dir_and_close): Use access_options->ignore_eexist.
(lu_homedir_populate, lu_homedir_move): Set
access_options.ignore_eexist.
* tests/fs_test.py (main): Don't output a full traceback if moveHome
fails.
* tests/fs_test: Test that moving onto an existing directory is
prohibited.
* lib/fs.c (lu_copy_dir_and_close): Only set the ownership and mode
of newly created files after the content is copied. This is better
because 1) write(3) is allowed to reset the S_ISUID and S_ISGID bits,
and 2) if write() didn't reset the bits, having a set-uid/set-gid
executable with partial content might be a security risk.
2012-12-13 Miloslav Trmač <mitr@redhat.com>
* tests/fs_test: Add tests for lu_homedir_populate() and
lu_homedir_move(). Make sure even inaccessible files are removed
on exit. Actually test code from the current build instead of the
system installation. Make the existing tests locale-independent.
* tests/fs_test.py: New modes --move and --populate.
* tests/fs_test: Check the final situation more thoroughly.
* tests/fs.conf.in
* tests/fs_test
* tests/fs_test.py: New files.
* Makefile.am (TESTS): Add tests/fs_test.
(EXTRA_DIST): Add tests/fs_test and dependencies.
2012-12-11 Miloslav Trmač <mitr@redhat.com>
* lib/fs.c (lu_copy_dir_and_close): Don't unnecessarily ftruncate() a
file we just created.
* lib/fs.c (lu_copy_dir_and_close): Only make the directory accessible
to the target user after all work in it is done. Still doesn't handle
pre-existing directories.
2012-12-08 Miloslav Trmač <mitr@redhat.com>
* lib/fs.c (lu_homedir_copy): Allow src_dir to be a symlink again.
This fixes an API incompatibility.
* lib/fs.c (lu_copy_dir_and_close): Rename again from...
(lu_homedir_copy_and_close): ... this.
(lu_homedir_copy): New helper function.
(lu_homedir_populate, lu_homedir_move): Simplify by using
the new lu_homedir_copy(). Better document security assumptios.
* lib/fs.c (copy_access_options): Rename member preserve_contexts
to preserve_source. Document that other fields apply only if
!preserve_source.
(uid_for_copy): Implement preserve_source. Fix a spectacular typo.
(gid_for_copy, mode_for_copy): Implement preserve_srouce.
(lu_homedir_copy_and_close, (lu_homedir_populate): Update for renamed
field preserve_source.
(lu_homedir_move): Update for renamed field preserve source. This
also means that while moving the directory we do not override the
original owner in the copy, fixing a security hole (the user could
have a had hardlink to a file they couldn't read, and we would
helpfully create a copy owned by them).
* lib/fs.c (copy_access_options): Fix description of member umask.
(mode_for_copy): New helper function.
(lu_homedir_copy_and_close): Use mode_for_copy().
* lib/fs.c (lu_homedir_copy_and_close): Rename from ...
(lu_homedir_copy) ... this. When scanning a directory, open() each
entry and then fstat() instead of fstatat() + possible openat(), which
is racy.
(lu_homedir_populate, lu_homedir_move): Update for
lu_homedir_copy_and_close().
* lib/user_private.h (lu_util_fscreate_from_fd)
(lu_util_fscreate_from_lfile): New declarations and fallback macros.
* lib/util.c (lu_util_fscreate_from_fd, lu_util_fscreate_from_lfile):
New functions.
* lib/fs.c (lu_homedir_copy): Set SELinux context immediately
before creating a new file, based on the file descriptor we will
be using, removing another path lookup race and avoiding the
top-level-directory special case. Use lu_util_fscreate_from_lfile()
for symbolic links, fixing a bug.
(lu_homedir_populate, lu_homedir_move): Stop setting SELinux contexts
manually.
* lib/fs.c (lu_homedir_copy): Modify file times through existing
descriptors if possible.
* lib/fs.c (lu_homedir_copy): When creating copies, start with
minimal permissions, set owner, then set the desired permissions.
Thus, start preserving S_IS[UG]ID flags on copied regular files, and
make sure they aren't even momentarily undesirably acessible.
* lib/fs.c (copy_access_options): Drop member is_toplevel again.
(gid_for_copy): Don't use options->is_toplevel.
(lu_homedir_populate): Don't make a special case for the top-level
directory: just use the mode of the source directory for the copy, and
the same rules for the group. All users updated.
(lu_homedir_populate): Manually set ownership and group to handle the
special case of a new home directory.
* lib/fs.c (copy_access_options): New members is_toplevel, uid and gid.
(uid_for_copy, gid_for_copy): New functions.
(lu_homedir_copy): Use access_options to pass around ownership
information. All users updated, no change in semantics.
* lib/fs.c (copy_access_options): New structure.
(lu_homedir_copy): Use struct copy_access_options for keep_contexts
and umask. All users updated, no change in semantics.
* lib/fs.c (lu_homedir_copy): Use a (parent FD, entry name) pair when
creating the existing directory to start avoiding symlink races. Start
preserving nanosecond timestamp in the process.
* lib/fs.c (lu_homedir_copy): Rename path to dest_ent_path for
consistency.
* lib/fs.c (lu_homedir_copy): Use a (parent FD, entry name) pair when
reading the existing directory to avoid symlink races.
* lib/fs.c (lu_homedir_copy): Rename srcpath to src_ent_path to avoid
confusion with names added in the future.
* lib/fs.c (remove_subdirectory): Split from lu_homedir_remove().
Use openat(), fstatat(), and unlinkat() to avoid symlink races.
2012-11-29 Miloslav Trmač <mitr@redhat.com>
* lib/util.c (fill_urandom): Don't use g_return_val_if_fail(), glib
can be configured so that it does nothing.
* lib/user.c (lu_dispatch): Add a comment about unreachable code.
2012-11-21 Miloslav Trmač <mitr@redhat.com>
* tests/default_pw_test:
* tests/ldap_test: Use 1024-bit RSA keys instead of 512-bit, to
run correctly in FIPS mode.
2012-11-08 Miloslav Trmač <mitr@redhat.com>
* lib/entity.h (LU_SHADOWLASTCHANGE, LU_SHADOWMIN, LU_SHADOWMAX)
(LU_SHADOWWARNING): Document that -1 should be treated the same
as a missing value.
* modules/files.c (format_shadow): Treat most missing fields as default
value "-1", and suppress it on output, to stop deviating from shadow(5).
* apps/lchage.c (read_ndays): Move lu_ent_get() call from the callers.
Handle missing value and value -1 equivalently. All callers updated.
(main): Always print all fields, even if the account attributes
are missing. Output missing minimum password age, and missing
passwod warning period, as 0. Output missing maximum password age
as "None". Output missing password inactivity period as "Never".
Output missing last password change and missing account expiration date
as "Never".
Consistently report "Must change password on next login" in all fields
affected by this setting, and "Never" if the respective password
expiration feature is disabled.
* apps/lchage.1 (--date): Document values 0 and -1.
(--inactive): Document value -1.
(--mindays): Document value -1, and interaction with --maxdays.
(--maxdays): Document value -1, don't recommend 99999 to disable
password expiration.
(--warndays): Document values 0 and -1.
(NOTES): New section.
* tests/files_test: Test also empty sp_lstchg.
* tests/files_test.py (Tests.testUserLookupName2)
(Tests.testUserMod4): Update expected values to follow lib/entity.h and
shadow(5), and for updated empty_user contents.
* tests/utils_test (lchage): Test handling of -d 0, and handling of
-1 for all fields.
* tests/utils_shadow: Verify that -1 values are correctly suppressed
on output.
* tests/utils_group
* tests/utils_gshadow
* tests/utils_passwd: Add user4_2 added by tests/utils_test.
* configure.in: Release 0.58.
* NEWS: Update.
* po/*: Update.
* Makefile.am (lib_libuser_la_LDFLAGS): Update version info.
2012-11-01 Miloslav Trmač <mitr@redhat.com>
* lib/entity.h (LU_USERPASSWORD, LU_GROUPPASSWORD, LU_SHADOWPASSWORD):
Document that users shouldn't modify these values directly.
2012-10-25 Miloslav Trmač <mitr@redhat.com>
* lib/user.c (lu_default_int): Simplify. We don't need to clear
previous values because the entity is completely wiped at the beginning
of the function.
* lib/entity.c (lu_ent_set_long_int, lu_ent_set_long)
(lu_ent_set_long_current): New functions.
* lib/entity.h (lu_ent_set_long, lu_ent_set_long_current): New
declarations.
* docs/reference/libuser-sections.txt: Add lu_ent_set_long and
and lu_ent_set_long_current.
* apps/lchage.c (main)
* lib/common.c (lu_common_suser_default)
* lib/util.c (lu_util_update_shadow_last_change): Use lu_ent_set_long().
* apps/lgroupmod.c (main): Drop unnecessary variable.
* modules/ldap.c (lu_ldap_lookup, lu_ldap_user_default): Use the new
interfaces instead of manipulating GValues manually.
* lib/entity.c (lu_ent_set_id_int, lu_ent_set_id)
(lu_ent_set_id_current): New functions.
* lib/entity.h (lu_ent_set_id, lu_ent_set_id_current): New declarations.
* docs/reference/libuser-sections.txt: Add lu_ent_set_id and
and lu_ent_set_id_current.
* apps/lgroupadd.c (main)
* apps/lgroupmod.c (main)
* apps/lnewusers.c (main)
* apps/luseradd.c (main)
* apps/lusermod.c (main)
* lib/user.c (lu_default_int): Use lu_ent_set_id().
* lib/entity.c (lu_ent_set_string_int, lu_ent_set_string)
(lu_ent_set_string_current): New functions.
* lib/entity.h (lu_ent_set_string, lu_ent_set_string_current): New
declarations.
* docs/reference/libuser-sections.txt: Add lu_ent_set_string and
and lu_ent_set_string_current.
* apps/lchfn.c (main)
* apps/lchsh.c (main)
* apps/lgroupmod.c (main)
* apps/lnewusers.c (main)
* apps/luseradd.c (main)
* apps/lusermod.c (main)
* lib/common.c (lu_common_user_default, lu_common_group_default)
(lu_common_suser_default)
* lib/user.c (lu_default_int)
* modules/files.c (lu_shadow_user_add_prep)
(lu_shadow_group_add_prep): Use lu_ent_set_string().
* lib/entity.c (lu_ent_set_prepare): Split from lu_ent_set_int().
* modules/files.c (module_filename): New function.
(generic_lookup, generic_add, generic_mod, generic_del)
(generic_lock, generic_is_locked, generic_setpass)
(lu_files_enumerate, lu_files_users_enumerate_by_group)
(lu_files_groups_enumerate_by_user, lu_files_enumerate_full)
(lu_files_uses_elevated_privileges)
(lu_shadow_uses_elevated_privileges): Use module_filename().
* modules/files.c (generic_lock, generic_is_locked)
(generic_setpass): Use `name' instead of `namestring' for better
readability.
* modules/ldap.c (lu_ldap_del, lu_ldap_handle_lock)
(lu_ldap_is_locked, lu_ldap_setpass): Use `name' instead of
`name_string' for better readability.
* lib/entity.c (lu_ent_get_first_value_strdup_int)
(lu_ent_get_first_value_strdup)
(lu_ent_get_first_value_strdup_current): New functions.
* lib/entity.h (lu_ent_get_first_value_strdup)
(lu_ent_get_first_value_strdup_current): New declarations.
* docs/reference/libuser-sections.txt: Add lu_ent_get_first_value_strdup
and lu_ent_get_first_value_strdup_current.
* apps/lchfn.c (main)
* apps/lchsh.c (main)
* apps/lusermod.c (main)
* lib/fs.c (mail_spool_path)
* lib/user.c (merge_ent_array_duplicates)
* modules/files.c (lu_shadow_user_lookup_id)
(lu_shadow_group_lookup_id, generic_mod, generic_del)
(generic_lock, generic_is_locked, generic_setpass)
* modules/ldap.c (get_ent_adds, lu_ldap_del)
(lu_ldap_handle_lock, lu_ldap_is_locked, lu_ldap_setpass)
* modules/sasldb.c (lu_sasldb_user_is_locked): Use
lu_ent_get_first_value_strdup() and
lu_ent_get_first_value_strdup_current().
* apps/luserdel.c (main): Don't use the same entity for groups and
users (potentially looking up LU_HOMEDIR_COPY in the group data).
* lib/entity.c (lu_ent_get_first_id)
(lu_ent_get_first_id_current): Fix value returned on invalid arguments.
* lib/entity.c (lu_ent_get_first_current_string): Rename to ...
(lu_ent_get_first_string_current): ... this. All references updated.
(lu_ent_get_first_current_id): Rename to ...
(lu_ent_get_first_id_current): ... this. All references updated.
2012-10-24 Miloslav Trmač <mitr@redhat.com>
* lib/entity.c (lu_ent_get_first_id_int, lu_ent_get_first_id)
(lu_ent_get_first_current_id): New functions. Fix some comments.
* lib/entity.h (lu_ent_get_first_id, lu_ent_get_first_current_id): New
declarations.
* docs/reference/libuser-sections.txt: Add lu_ent_get_first_id
and lu_ent_get_first_current_id.
* apps/lgroupmod.c (main)
* apps/lid.c (do_full)
* apps/lnewusers.c (main)
* apps/luseradd.c (main)
* apps/luserdel.c (main)
* lib/fs.c (lu_mail_spool_create)
* lib/user.c (extract_id)
* python/admin.c (libuser_admin_create_home): Use lu_ent_get_first_id().
* lib/entity.c (lu_ent_get_first_string_int)
(lu_ent_get_first_string, lu_ent_get_first_current_string): New
functions.
* lib/entity.h (lu_ent_get_first_string)
(lu_ent_get_first_current_string): New declarations.
* docs/reference/libuser-sections.txt: Add lu_ent_get_first_string
and lu_ent_get_first_current_string.
* apps/lid.c (do_full)
* apps/lnewusers.c (main)
* apps/luseradd.c (main)
* apps/luserdel.c (main)
* apps/lusermod.c (main)
* lib/user.c (extract_name, lu_dispatch, lu_user_add)
* python/admin.c (libuser_admin_create_home)
(libuser_admin_remove_home, libuser_admin_move_home): Use
lu_ent_get_first_string() and lu_ent_get_first_current_string().
* lib/fs.h (LU_NSCD_CACHE_PASSWD, LU_NSCD_CACHE_GROUP): New macros.
* docs/reference/libuser-sections.txt: Add LU_NSCD_CACHE_GROUP and
LU_NSCD_CACHE_PASSWD.
* apps/lchage.c (main)
* apps/lchfn.c (main)
* apps/lchsh.c (main)
* apps/lgroupadd.c (main)
* apps/lgroupdel.c (main)
* apps/lgroupmod.c (main)
* apps/lnewusers.c (main)
* apps/lpasswd.c (main)
* apps/luseradd.c (main)
* apps/luserdel.c (main)
* apps/lusermod.c (main): Use the LU_NSCD_CACHE_GROUP and
LU_NSCD_CACHE_PASSWD macros.
* apps/lusermod.c (main): Don't mark data to be freed as "const".
* apps/apputil.c (current_umask, lu_homedir_copy, lu_homedir_populate)
(lu_homedir_remove, lu_homedir_move, lu_nscd_flush_cache)
(mail_spool_path, lu_mail_spool_create, lu_mail_spool_remove): Move...
* lib/fs.c (current_umask, lu_homedir_copy, lu_homedir_populate)
(lu_homedir_remove, lu_homedir_move, lu_nscd_flush_cache)
(mail_spool_path, lu_mail_spool_create, lu_mail_spool_remove): ... into
this new file. Add documentation.
* apps/apputil.h (lu_homedir_populate, lu_homedir_move)
(lu_homedir_remove, lu_nscd_flush_cache, lu_mail_spool_create)
(lu_mail_spool_remove): Move declarations...
* lib/fs.h (lu_homedir_populate, lu_homedir_move, lu_homedir_remove)
(lu_nscd_flush_cache, lu_mail_spool_create, lu_mail_spool_remove): ...
into this new file.
* lib/user.h: Include lib/fs.h.
* Makefile.am (pkginclude_HEADERS): Add lib/fs.h.
(lib_libuser_la_SOURCES): Add lib/fs.c.
(apps_libapputil_la_CPPFLAGS): Move NSCD definition....
(lib_libuser_la_CPPFLAGS): ... here.
(apps_lchage_LDADD, apps_lgroupadd_LDADD, apps_lgroupdel_LDADD)
(apps_lgroupmod_LDADD, apps_lnewusers_LDADD)
(apps_luseradd_LDADD, apps_luserdel_LDADD, apps_lusermod_LDADD)
(python_libusermodule_la_LIBADD)
(samples_homedir_LDADD): Don't link to apps/libapputil.la any more.
* docs/reference/libuser-sections.txt: Add a section for lib/fs.c.
* docs/reference/libuser-docs.sgml: Include fs documentation.
* apps/apputil.c (mail_spool_path, lu_mail_spool_create)
(lu_mail_spool_remove): Add error reporting using struct lu_error.
All users updated.
* apps/apputil.h (lu_mail_spool_create, lu_mail_spool_remove): Update
declarations.
* apps/apputil.c (lu_mail_spool_create, lu_mail_spool_remove): Split...
(lu_mailspool_create_remove): ... this. All users updated.
* apps/apputil.h (lu_mail_spool_create, lu_mail_spool_remove): New
declarations.
(lu_mailspool_create_remove): Remove declaration.
* python/admin.c (libuser_admin_delete_user): Instead of creating a mail
spool, remove it.
* apps/apputil.c (mail_spool_path): Split from ...
(lu_mailspool_create_remove): ... here.
* tests/valgrind.supp: Add popt suppressions.
* apps/lnewusers.c (main)
* apps/lusermod.c (main): Fix some memory leaks.
* tests/valgrind.supp: Add popt suppressions.
* tests/utils_test: Refer to utilities using a full path to allow
libtool --mode=execute (and hence valgrind) to work.
* apps/lgroupmod.c (main)
* apps/lusermod.c (main): Fix a memory leak.
* apps/lchage.c (main):
* apps/lchfn.c (main):
* apps/lchsh.c (main):
* apps/lgroupadd.c (main):
* apps/lgroupdel.c (main):
* apps/lgroupmod.c (main):
* apps/lid.c (main):
* apps/lnewusers.c (main):
* apps/lpasswd.c (main):
* apps/luseradd.c (main):
* apps/luserdel.c (main):
* apps/lusermod.c (main):
* apps/luseradd.c (main): Free popt context after use.
* tests/valgrind.supp: One more glibc suppression.
* modules/ldap.c (get_ent_adds): Fix a memory leak.
* Makefile.am (VG_EXECUTION): Use a more practical valgrind
configuration.
* tests/valgrind.supp: Add generic NSS initialization suppression.
* tests/valgrind.supp: Also cover SHA-256 in glibc suppression.
* python/ent.c (libuser_entity_getattrlist)
(libuser_entity_length): Fix memory leaks.
* modules/files.c (lu_files_groups_enumerate_by_user): Fix two memory
leaks. Simplify error handling a little.
* python/libusermodule.c (dict_add_stolen_object)
(dict_add_string): New functions.
(initlibuser): Use dict_add_stolen_object() and dict_add_string() to
avoid leaking references.
* modules/ldap.c (lu_ldap_setpass): Fix a memory leak.
* tests/valgrind.supp: Add librpm and glibc suppressions.
* tests/config_test.c (start, verify_var, main): Fix memory leaks.
* tests/valgrind.supp: Simplify and generalize g_type_init suppression.
* tests/config_test.sh:
* tests/default_pw_test:
* tests/files_test:
* tests/ldap_test:
* tests/pwhash_test:
* tests/utils_test: Support $VALGRIND.
* Makefile.am (VG_EXECUTION, VG_ENVIRONMENT): New variables.
(EXTRA_DIST): Ship tests/valgrind.supp.
(valgrind): New target.
2012-10-23 Miloslav Trmač <mitr@redhat.com>
* apps/lid.c (do_nameonly, do_full): Specialize from do_id. Caller
updated.
(do_full): Use lu_*_enumerate_by_*_full().
* apps/lid.c (do_id): Remove entity existence verification. Removed
parameter lookup_name.
(main): Do entity existence verification here.
* apps/lgroupmod.c (main): Use lu_users_enumerate_by_group_full()
instead of looking up the full data manually.
* apps/lusermod.c (main): Use lu_groups_enumerate_by_user_full() instead
of looking up the full data manually.
* lib/user_private.h (LU_MODULE_VERSION): Increase.
(lu_module): Remove members users_enumerate_by_group_full and
groups_enumerate_by_user_full.
* lib/modules.c (load_one_module): Don't require members
users_enumerate_by_group_full and groups_enumerate_by_user_full.
* lib/user.c (lu_dispatch_id): Remove values
users_enumerate_by_group_full and groups_enumerate_by_user_full.
(run_single, run_list): Remove no longer used handling of
users_enumerate_by_group_full and groups_enumerate_by_user_full.
* modules/files.c (lu_files_users_enumerate_by_group_full)
(lu_files_groups_enumerate_by_user_full)
(lu_shadow_users_enumerate_by_group_full)
(lu_shadow_groups_enumerate_by_user_full): Remove placeholders.
(libuser_files_init, libuser_shadow_init): Don't initialize members
users_enumerate_by_group_full and groups_enumerate_by_user_full.
* modules/ldap.c (lu_ldap_users_enumerate_by_group_full)
(lu_ldap_groups_enumerate_by_user_full): Remove functions.
(libuser_ldap_init): Don't initialize members
users_enumerate_by_group_full and groups_enumerate_by_user_full.
* modules/sasldb.c (lu_sasldb_users_enumerate_by_group_full)
(lu_sasldb_groups_enumerate_by_user_full): Remove placeholders.
(libuser_sasldb_init): Don't initialize members
users_enumerate_by_group_full and groups_enumerate_by_user_full.
* tests/files_test.py (Tests.testUsersEnumerateByGroupFull1)
(Tests.testUsersEnumerateByGroupFull2)
(Tests.testUsersEnumerateByGroupFull3)
(Tests.testGroupsEnumerateByUserFull1)
(Tests.testGroupsEnumerateByUserFull2)
(Tests.testGroupsEnumerateByUserFull3): New tests.
* lib/user.c (lu_users_enumerate_by_group_full)
(lu_groups_enumerate_by_user_full): Instead of dispatching into the
modules to get full data, only gather names and look up by these names
in all modules.
2012-10-19 Miloslav Trmač <mitr@redhat.com>
* lib/user_private.h (lu_util_append_values): New declaration.
* lib/util.c (lu_util_append_values): New function.
* lib/entity.c (lu_ent_set_int)
* lib/user.c (merge_ent_array_duplicates, run_list)
* modules/ldap.c (lu_ldap_users_enumerate_by_group)
(lu_ldap_groups_enumerate_by_user): Use lu_util_append_values().
2012-10-18 Miloslav Trmač <mitr@redhat.com>
* modules/ldap.c (lu_ldap_users_enumerate_by_group)
(lu_ldap_groups_enumerate_by_user): Remove an unnecessary condition.
* modules/ldap.c (lu_ldap_users_enumerate_by_group_full): Silently
ignore errors when looking up group members, instead of returning a
non-error return value with error indication set.
* modules/ldap.c (lu_ldap_users_enumerate_by_group)
(lu_ldap_users_enumerate_by_group_full)
(lu_ldap_groups_enumerate_by_user): Use `ret' instead of `primaries'
as the variable name, it contains both primary and secondary values.
* modules/ldap.c (lu_ldap_groups_enumerate_by_user_full): Implement.
* tests/ldap_test.py (Tests.testGroupsEnumerateByUserFull1)
(Tests.testGroupsEnumerateByUserFull2)
(Tests.testGroupsEnumerateByUserFull3): New tests.
2012-10-08 Miloslav Trmač <mitr@redhat.com>
* docs/libuser.conf.5.in ([ldap]): Warn against storing a password
in the system-wide file.
2012-09-24 Miloslav Trmač <mitr@redhat.com>
* configure.in: Release 0.57.7.
* NEWS: Update.
* po/*: Update.
* Makefile.am (lib_libuser_la_LDFLAGS): Update version info.
* modules/ldap.c (lu_ldap_users_enumerate_by_group_full): Implement.
* tests/ldap_test.py (Tests.testUsersEnumerateByGroupFull1)
(Tests.testUsersEnumerateByGroupFull2)
(Tests.testUsersEnumerateByGroupFull3): New tests.
* python/common.h: Declare convert_ent_array_pylist.
* python/ent.c (convert_ent_array_pylist): New function.
* python/admin.c (libuser_admin_enumerate_users_full)
(libuser_admin_enumerate_groups_full)
(libuser_admin_enumerate_users_by_group_full)
(libuser_admin_enumerate_groups_by_user_full): Use
convert_ent_array_pylist (also fixes a crash on error).
(libuser_admin_enumerate_groups_by_user_full): Remove a duplicated line.
* lib/user.c (convert_user_name_to_id, convert_group_name_to_id): Set
*error if the entity was not found.
(lu_user_lookup_name, lu_group_lookup_name, lu_user_lookup_id)
(lu_group_lookup_id): Document that error is not set if the entity
was not found.
2012-09-04 Miloslav Trmač <mitr@redhat.com>
* apps/luseradd.c (main): Free groupEnt.
2012-07-30 Miloslav Trmač <mitr@redhat.com>
* lib/user.h (lu_users_enumerate_by_group_full)
(lu_groups_enumerate_by_user_full): New declarations.
* lib/user.c (lu_users_enumerate_by_group_full)
(lu_groups_enumerate_by_user_full): Uncomment functions.
Use a simple group or user name instead of a pattern. Add
documentation.
* docs/reference/libuser-sections.txt: Add
lu_users_enumerate_by_group_full and lu_groups_enumerate_by_user_full.
* python/admin.c (libuser_admin_enumerate_users_by_group_full)
(libuser_admin_enumerate_groups_by_user_full): Uncomment and fix
functions.
(libuser_admin_methods): Uncomment enumerateUsersByGroupFull and
enumerateGroupsByUserFull.
* python/modules.txt: Document enumerateUsersByGroupFull and
enumerateGroupsByUserFull.
2012-06-03 Miloslav Trmač <mitr@redhat.com>
* Makefile.am (AM_DISTCHECK_CONFIGURE_FLAGS): Rename from
DISTCHECK_CONFIGURE_FLAGS to follow automake-1.11.3.
2012-03-22 Miloslav Trmač <mitr@redhat.com>
* configure.in: Release 0.57.6.
* NEWS: Update.
* po/*: Update.
* po/libuser.pot: Update for Transifex.
* apps/lchage.c (main)
* apps/lgroupadd.c (main)
* apps/lgroupmod.c (main)
* apps/lnewusers.c (main)
* apps/lpasswd.c (main)
* apps/luseradd.c (main)
* apps/lusermod.c (main): Improve --help messages.
* apps/lchage.c (main)
* apps/lchfn.c (main)
* apps/lchsh.c (main)
* apps/lgroupadd.c (main)
* apps/lgroupdel.c (main)
* apps/lgroupmod.c (main)
* apps/lid.c (main)
* apps/lnewusers.c (main)
* apps/lpasswd.c (main)
* apps/luseradd.c (main)
* apps/luserdel.c (main)
* apps/lusermod.c (main): Mark --help messages for translation.
* modules/ldap.c (connect_server): Don't try to use STARTTLS for ldapi:
URLs. Based on a patch by <davide.principi@nethesis.it>.
* docs/libuser.conf.5.in: Document that TLS is never used for ldapi:.
* tests/ldap_test: Wait for slapd exit before returning from the test.
* tests/wait_for_slapd_exit.c
* tests/wait_for_slapd_start.c: New files.
* tests/default_pw_test
* tests/ldap_test: Use tests/wait_for_slapd_exit and
tests/wait_for_slapd_start, making the waiting both shorter and more
precise.
* tests/test_utils.sh: Remove.
* Makefile.am (check_PROGRAMS): Add tests/wait_for_slapd_exit and
tests/wait_for_slapd_start.
(tests_wait_for_slapd_exit_LDFLAGS)
(tests_wait_for_slapd_start_LDFLAGS): New definitions.
(EXTRA_DIST): Don't ship tests/test_utils.sh any more.
* Makefile.am (noinst_PROGRAMS): Move tests/alloc_port ...
(check_PROGRAMS): ... here. There's no benefit in building it when the
tests are not run.
2012-03-03 Miloslav Trmač <mitr@redhat.com>
* configure.in: Release 0.57.5.
* NEWS: Update.
* po/*: Update.
2012-02-10 Miloslav Trmač <mitr@redhat.com>
* Makefile.am (EXTRA_DIST): Add tests/test_utils.sh.
* configure.in: Release 0.57.4.
* NEWS: Update.
* po/*: Update.
* Makefile.am (lib_libuser_la_LDFLAGS): Update version info.
* po/libuser.pot: Update for Transifex.
2012-02-08 Miloslav Trmač <mitr@redhat.com>
* lib/util.c (lu_util_line_get_matchingx): Fix field search to not
continue into the following line.
* lib/util.c (lu_util_field_write): Cleanup field search.
* lib/util.c (lu_util_field_write): Report an error when the entry
is not found early to simplify the code.
* lib/util.c (lu_util_field_read): Cleanup field search.
* lib/util.c (lu_util_field_read): Simplify search for the matching
entry.
* lib/util.c (lu_util_field_read): Report an error when the entry is
not found.
* lib/util.c (lu_util_field_write): Fix a memory leak.
* lib/util.c (lu_util_field_read): Simplify testing for end of file.
* lib/util.c (lu_util_field_read): Simplify redundant error handling.
* lib/util.c (lu_util_line_get_matchingx): Cleanup transition between
lines.
* lib/util.c (lu_util_line_get_matchingx): Cleanup field search.
* lib/util.c (lu_util_line_get_matchingx): Cleanup return value
handling.
* lib/util.c (lu_util_line_get_matchingx): Simplify testing for end
of file.
* lib/util.c (lu_util_line_get_matchingx): Cleanup end of line handling.
* lib/util.c (lu_util_line_get_matchingx): Cleanup field testing.
* lib/util.c (lu_util_line_get_matchingx): Rename a confusing variable
`buf' to `line'.
* lib/util.c (lu_util_line_get_matchingx): Don't access memory after the
mmap()ed area.
* lib/util.c (lu_util_field_read): Don't access memory after the
mmap()ed area if the file doesn't end with a newline.
2012-02-06 Miloslav Trmač <mitr@redhat.com>
* python/admin.c (libuser_admin_wrap_boolean): Fix error handling.
* lib/user.c (run_single): Replace an unreachable return with a
g_assert_not_reached ().
* lib/error.c (lu_error_is_success, lu_error_is_warning)
(lu_error_is_error): Remove unreachable code.
* lib/config.c (process_line): Remove redundant code.
* lib/util.c (lu_util_lock_obtain): Don't corrupt errno before using it,
simplify.
* modules/files.c (lu_files_create_backup): Handle a fchmod () failure.
* lib/config.c (handle_default_useradd_key): Fix a check for invalid
GID number.
* apps/lpasswd.c (main): Handle strdup () allocation failure.
* python/misc.c (libuser_admin_python_prompter): Handle an allocation
failure.
* lib/util.c (lu_util_field_read): Simplify code.
* lib/util.c (lu_util_field_write): Simplify a condition.
* lib/util.c (lu_util_field_write): Add FIXME.
* modules/files.c (lu_files_create_backup): Drop some code with
unclear purpose (probably supposed to check for a symlink, but not
really), avoid using uinitiazed data.
* lib/util.c (lu_util_fscreate_save): Make sure *ctx is initialized
so that lu_util_fscreate_restore() callers don't handle an undefined
value.
* lib/getdate.y (LookupWord): Correctly cast an argument to tolower ().
2011-10-06 Miloslav Trmač <mitr@redhat.com>
* COPYING
* apps/apputil.c
* apps/apputil.h
* apps/lchage.1
* apps/lchage.c
* apps/lchfn.1
* apps/lchfn.c
* apps/lchsh.1
* apps/lchsh.c
* apps/lgroupadd.1
* apps/lgroupadd.c
* apps/lgroupdel.1
* apps/lgroupdel.c
* apps/lgroupmod.1
* apps/lgroupmod.c
* apps/lid.1
* apps/lid.c
* apps/lnewusers.1
* apps/lnewusers.c
* apps/lpasswd.1
* apps/lpasswd.c
* apps/luseradd.1
* apps/luseradd.c
* apps/luserdel.1
* apps/luserdel.c
* apps/lusermod.1
* apps/lusermod.c
* docs/libuser.conf.5.in
* lib/common.c
* lib/config.c
* lib/config.h
* lib/entity.c
* lib/entity.h
* lib/error.c
* lib/error.h
* lib/internal.h
* lib/misc.c
* lib/modules.c
* lib/prompt.c
* lib/prompt.h
* lib/scache.c
* lib/user.c
* lib/user.h
* lib/user_private.h
* lib/util.c
* modules/files.c
* modules/krb5.c
* modules/ldap.c
* modules/sasldb.c
* python/admin.c
* python/ent.c
* python/libusermodule.c
* python/misc.c
* samples/enum.c
* samples/field.c
* samples/homedir.c
* samples/lookup.c
* samples/prompt.c
* samples/testuser.c
* tests/alloc_port.c
* tests/config_test.c
* tests/config_test.sh
* tests/default_pw_test
* tests/files_test
* tests/ldap_test
* tests/pwhash_test
* tests/test_utils.sh
* tests/utils_test: Update FSF address.
2011-10-04 Miloslav Trmač <mitr@redhat.com>
* tests/test_utils.sh: New file.
* tests/default_pw_test
* tests/ldap_test: Use common wait_for_slapd, also increasing the
timeout to 30 seconds.
* po/*.po (many): Mark an invalid translation as fuzzy.
* configure.in: Release 0.57.3.
* NEWS: Update.
* po/*: Update.
* Makefile.am (lib_libuser_la_LDFLAGS): Update version info.
* apps/apputil.c (current_umask): New function.
(lu_homedir_copy): Preserve S_ISGID and other bits for
directories. New parameter umask_value. All users updated.
* python/admin.c (libuser_admin_get_first_unused_id_type): Read default
start value from configuration.
* tests/config_test.py: New file.
* tests/config_test.sh (workdir): Run tests/config_test.py.
* Makefile.am (EXTRA_DIST): Add tests/config_test.py
* apps/lgroupadd.1:
* apps/luseradd.1: Fix documentation of start of non-system ID values.
* libuser.conf: Comment hard-coded "500" values.
2011-08-26 Miloslav Trmač <mitr@redhat.com>
* docs/reference/tmpl/config.sgml
* docs/reference/tmpl/entity.sgml
* docs/reference/tmpl/error.sgml
* docs/reference/tmpl/libuser-unused.sgml
* docs/reference/tmpl/prompt.sgml
* docs/reference/tmpl/user.sgml
* docs/reference/tmpl/value.sgml: Remove, all information is now stored
in *.[ch].
* docs/reference/Makefile.am (setup-build-workaround.stamp, setup.stamp)
(dist-hook): Remove workarounds necessary for tmpl in $(srcdir).
* docs/reference/Makefile.am (HFILE_GLOB, CFILE_GLOB): Fill in.
* docs/reference/tmpl/user.sgml: Move contents...
* lib/misc.c: ... here and ...
* lib/user.c: ... here.
* docs/reference/tmpl/entity.sgml: Move contents...
* lib/entity.c: ... here and ...
* lib/entity.h: ... here.
* docs/reference/tmpl/error.sgml: Move contents...
* lib/error.c: ... here and ...
* lib/error.h: ... here.
* docs/reference/tmpl/value.sgml: Move contents...
* lib/misc.c: ... here and ...
* lib/user.h: ... here.
* docs/reference/tmpl/config.sgml: Move contents...
* lib/config.c: ... here, and update somewhat.
* lib/config.h: Drop redundant documentation.
* docs/reference/libuser-decl-list.txt
* docs/reference/libuser-decl.txt
* docs/reference/libuser.args
* docs/reference/libuser.hierarchy
* docs/reference/libuser.signals: Stop tracking generated files.
* docs/reference/tmpl/prompt.sgml: Move contents...
* lib/prompt.c: ... here.
* lib/entity.h (lu_ent_t)
* lib/error.h (lu_status_t, lu_error_t)
* lib/user.h (lu_context_t, lu_entity_type_t): Mark with #ifndef
LU_DISABLE_DEPRECATED.
* docs/reference/Makefile.am (SCAN_OPTIONS): Recognize
LU_DISABLE_DEPRECATED.
* docs/reference/Makefile.am (TESTS): Uncomment to enable gtk-doc tests.
* lib/user.h (struct lu_context): Document.
(lu_context_t): Document, mark as deprecated. All users changed.
* docs/reference/tmpl/user.sgml: Regenerate.
* docs/reference/libuser-sections.txt: Add lu_context and lu_context_t.
* lib/error.h (struct lu_error): Add a redundant declaration to let
gtk-doc recognize existence of the type.
* lib/error.h (lu_status_t): Split; should be marked as deprecated, but
gtk-doc can't handle an enum typedef. All users changed.
(struct lu_error): Add minimal documentation (fields not documented
because gtk-doc doesn't find them).
(lu_error_t): Document, mark as deprecated. All users changed.
* docs/reference/tmpl/error.sgml: Regenerate.
* docs/reference/libuser-sections.txt: Add lu_error and lu_error_t.
* docs/reference/tmpl/entity.sgml (SECTION Long_Description): Move
struct lu_ent documentation ...
* lib/entity.h (struct lu_ent): ... here.
(lu_ent_t): Document, mark as deprecated. All users changed.
* docs/reference/libuser-sections.txt: Add lu_ent and lu_ent_t.
* lib/prompt.h (lu_prompt): Workaround a gtk-doc parser bug, treating
free_value as an external symbol.
2011-08-25 Miloslav Trmač <mitr@redhat.com>
* docs/reference/libuser-docs.sgml: Regenerate with gtk-doc 1.17.
* docs/reference/Makefile.am: Update from gtk-doc 1.17.
* docs/reference/Makefile.am (setup-build-workaround.stamp)
(setup.stamp): Workaround incorrect gtk-doc handling of tmpl when
$(builddir) != $(srcdir).
(DOC_SOURCE_DIR): Workaround incorrect gtk-doc handling of sources when
$(builddir) != $(srcdir).
(dist-hook): Workaround references to $(build) instead of $(builddir).
2011-05-03 Miloslav Trmač <mitr@redhat.com>
* lib/user.c (run_list): Remove dead code.
* lib/user.c (run_list): Use a better assertion.
2011-03-31 Miloslav Trmač <mitr@redhat.com>
* configure.in: Release 0.57.2.
* NEWS: Update.
* po/*: Update.
* Makefile.am (lib_libuser_la_LDFLAGS): Update version info.
2011-03-19 Miloslav Trmač <mitr@redhat.com>
* tests/alloc_port.c: New file.
* Makefile.am (noinst_PROGRAMS): Add tests/alloc_port.
(tests_alloc_port_LDFLAGS): New definition.
* tests/default_pw_test:
* tests/default_pw.conf.in (ldap/server)
* tests/ldap_test:
* tests/ldap.conf.in (ldap/server): Use a dynamically allocated port for
the LDAP server.
* tests/default_pw_test:
* tests/ldap_test: Don't set up port 6360 for ldaps, it is not used.
2011-03-17 Miloslav Trmač <mitr@redhat.com>
* tests/config_test.c (verify_var): Call va_end().
* lib/config.c (process_line): Only search for '=' once.
* modules/files.c (lu_files_create_backup): Handle lseek() failure.
* lib/util.c (lu_util_line_get_matchingx): Handle lseek() failures.
Only restore file position if we have actually altered it.
* apps/lpasswd.c (main): Handle errors when reading the password from
a supplied file descriptor.
* apps/apputil.c (lu_homedir_copy): Don't leak a file descriptor on
error.
* modules/ldap.c (arrays_equal): Drop unnecessary checks.
* lib/util.c (lu_util_field_write): Simplify: unless we return
lu_error_search, we know line != NULL, and ret == TRUE a little below.
This could be simplified further - the current function both reject
lines which match but don't contain the specified field, and supports
adding the field.
* lib/user.c (lu_dispatch): Fix a pasto.
2011-03-04 Miloslav Trmač <mitr@redhat.com>
* .tx/config: New file.
* po/libuser.pot: Add to prepare for Transifex.
2011-02-04 Miloslav Trmač <mitr@redhat.com>
* modules/files.c (line_read): Remove an unused variable.
* modules/ldap.c (lu_ldap_fudge_objectclasses): Silence a warning.
2011-02-01 Miloslav Trmač <mitr@redhat.com>
* lib/misc.c (lu_value_get_id): Explicitly return
LU_VALUE_INVALID_ID for LU_VALUE_INVALID_ID :) (with a warning,
from now on).
(lu_value_init_set_attr_from_string): Reject LU_VALUE_INVALID_ID
as an id_t value.
* modules/ldap.c (lu_ldap_setpass): Don't use "!!" (password
missing) as an algorithm indicator to be preserved. Skip over '!'
(account locked) when looking for the algorithm indicator.
* tests/files_test.py (Tests.testUserSetpass1)
(Tests.testUserSetpass2, Tests.testUserSetpass3)
(Tests.testUserSetpass4, Tests.testGroupSetpass1)
(Tests.testGroupSetpass2, Tests.testGroupSetpass3)
(Tests.testGroupSetpass4): Verify that crypt_style is honored.
* tests/ldap_test.py (Tests.testUserSetpass1)
(Tests.testUserSetpass2, Tests.testGroupSetpass1)
(Tests.testGroupSetpass2): Verify that the existing algorithm is
preserved.
(Tests.testUserSetpass3, Tests.testGroupSetpass3): Verify that
crypt_style is honored.
(Tests.testUserSetpass4, Tests.testUserSetpass5)
(Tests.testGroupSetpass4, Tests.testGroupSetpass5): New tests.
* tests/files_test.py (Tests.testUserSetpass4, Tests.testGroupSetpass4):
Verify that the encrypted password value does not contain ':'.
2011-01-20 Miloslav Trmač <mitr@redhat.com>
* modules/ldap.c (get_ent_adds): Don't use empty gecos as a commonName
value.
* tests/ldap_test.py (Tests.testUserAdd7): New test.
2011-01-14 Miloslav Trmač <mitr@redhat.com>
* configure.in: Release 0.57.1.
* NEWS: Update.
* Makefile.am (lib_libuser_la_LDFLAGS): Update version info.
* lib/modules.c (lu_modules_load): Fix handling of modules that report
non-fatal errors.
2011-01-10 Miloslav Trmač <mitr@redhat.com>
* configure.in: Release 0.57.
* NEWS: Update.
* po/LINGUAS: Update.
* Makefile.am (lib_libuser_la_LDFLAGS): Update version info.
2011-01-03 Miloslav Trmač <mitr@redhat.com>
* tests/default_pw_test
* tests/default_pw_test.py
* tests/default_pw.conf.in: New test.
* Makefile.am (TESTS)
(EXTRA_DIST): Add tests/default_pw.conf.in, tests/default_pw_test and
tests/default_pw_test.py.
* tests/ldap_test.py (Tests.testUserAdd1, Tests.testGroupAdd1):
Verify default password value of newly created entries.
* modules/ldap.c (lu_ldap_user_default): Use an LDAP-specific
default for LU_USERPASSWORD.
(lu_ldap_group_default): Comment absence of default password.
* lib/user_private.h (struct lu_module): New member
valid_module_combination.
* lib/error.h (lu_status_t): Add lu_error_invalid_module_combination.
* lib/error.c (lu_strerror, lu_error_is_error): Handle
lu_error_invalid_module_combination.
* lib/modules.c (load_one_module): Verify `valid_module_combination'
is provided.
(lu_modules_load): After loading modules, let each one verify the
module combination.
* modules/files.c (lu_files_shadow_valid_module_combination): New
function.
(libuser_files_init, libuser_shadow_init): Provide
`valid_module_combination'.
* modules/ldap.c (lu_ldap_valid_module_combination): New function.
(libuser_ldap_init): Provide `valid_module_combination'.
* modules/sasldb.c (lu_sasldb_valid_module_combination): New function.
(libuser_sasldb_init): Provide `valid_module_combination'.
* lib/user_private.h (LU_MODULE_NAME_FILES, LU_MODULE_NAME_LDAP)
(LU_MODULE_NAME_SHADOW): New definitions.
* modules/files.c (SHADOW_MODULE_NAME): Remove, replaced by
LU_MODULE_NAME_SHADOW. All users updated.
(libuser_files_init): Use LU_MODULE_NAME_FILES.
* modules/ldap.c (libuser_ldap_init): Use LU_MODULE_NAME_LDAP.
* lib/user_private.h (LU_MODULE_VERSION): Increase.
* lib/error.c (lu_strerror, lu_error_is_error): Handle
lu_error_invalid_attribute_value.
2010-12-14 Miloslav Trmač <mitr@redhat.com>
* tests/ldap_test: Don't run (openssl req) in batch mode so that we
can specify a host name. Use "127.0.0.1" as host name to fix CN
mismatches, "localhost" when connecting is apparently replaced by the
actual host name.
* Makefile.am (tests_config_test_LDADD): Fix a typo.
2010-09-29 Miloslav Trmač <mitr@redhat.com>
* lib/util.c (lu_util_fscreate_for_path): Don't pass NULL to %s.
* lib/util.c (lu_util_fscreate_for_path): Handle cases when a path is
not in the matchpathcon database.
2010-09-07 Miloslav Trmač <mitr@redhat.com>
* apps/apputil.c (lu_authenticate_unprivileged): New parameter ctx. All
users changed. Don't authenticate the user if the application is not
set*id and elevated privileges are not necessary.
* apps/apputil.h (lu_authenticate_unprivileged): Update prototype.
* lib/misc.c (lu_value_get_id): Don't abort the program if the value
is not a valid ID.
* modules/ldap.c (lu_ldap_groups_enumerate_by_user)
* apps/lid.c (do_id): Handle invalid ID values, for completeness.
2010-09-01 Miloslav Trmač <mitr@redhat.com>
* libuser.conf (crypt_style): Change default to sha512.
2010-09-14 Miloslav Trmač <mitr@redhat.com>
* configure.in: Release 0.56.18.
* NEWS: Update.
2010-08-26 Miloslav Trmač <mitr@redhat.com>
* configure.in: Release 0.56.17.
* NEWS: Update.
* autogen.sh: Fix running autogen on an old checkout.
* tests/slapd.conf.in: Make the tests run with current openldap again.
2010-07-07 Miloslav Trmač <mitr@redhat.com>
* tests/files_test.py (Tests.testValidateIdValue): Fix comment.
2010-07-02 Miloslav Trmač <mitr@redhat.com>
* python/libusermodule.c (libuser_validate_id_value): New function.
(libuser_methods): Add validateIdValue.
* python/modules.txt (libuser): Document validateIdValue.
* tests/files_test.py (Tests.testValidateIdValue): New test.
* python/libusermodule.c (initlibuser): Provide VALUE_INVALID_ID.
* python/modules.txt (libuser): Document VALUE_INVALID_ID.
2010-06-14 Miloslav Trmač <mitr@redhat.com>
* modules/ldap.c (lu_ldap_needed_objectclasses, get_ent_adds)
(get_ent_mods, libuser_ldap_init)
* python/misc.c (libuser_admin_prompt): Use g_malloc*_n ().
2010-06-12 Miloslav Trmač <mitr@redhat.com>
* configure.in: Define PACKAGE_BUGREPORT and PACKAGE_URL.
* autogen.sh: Run aclocal with -Wall.
2010-03-25 Miloslav Trmač <mitr@redhat.com>
* configure.in: Release 0.56.16.
* NEWS: Update.
2010-03-04 Miloslav Trmač <mitr@redhat.com>
* configure.in: Release 0.56.15.
* NEWS: Update.
* po/LINGUAS: Sort.
* Makefile.am (archive)
* configure.in: Use xz for compressing the distribution tarball.
2010-02-08 Miloslav Trmač <mitr@redhat.com>
* configure.in: Release 0.56.14.
* NEWS: Update.
* Makefile.am (lib_libuser_la_LDFLAGS): Update version info.
* docs/libuser.conf.5.in ([ldap]): Document the "password" option.
2010-02-08 Rob Myers <rob.myers@gtri.gatech.edu>
* modules/ldap.c (libuser_ldap_init): Allow specifying the LDAP password
in a config file.
2010-02-08 Miloslav Trmač <mitr@redhat.com>
* lib/prompt.c (lu_prompt_console): Don't try to modify TTY attributes
if stdin is not a TTY.
2010-02-03 Thierry Vignaud <tvignaud@mandriva.com>
* po/fr.po: Update.
2010-02-03 Miloslav Trmač <mitr@redhat.com>
* lib/user_private.h (_): Use dcgettext (). Based on patch by
Thierry Vignaud <tvignaud@mandriva.com>.
2010-01-26 Miloslav Trmač <mitr@redhat.com>
* tests/ldap.conf.in (ldap/password): Remove, the value is not used.
2009-12-11 Miloslav Trmač <mitr@redhat.com>
* configure.in: Release version 0.56.13.
* NEWS: Update.
* Makefile.am (lib_libuser_la_LDFLAGS): Update version info.
2009-12-11 Miloslav Trmač <mitr@redhat.com>
* apps/luseradd.c (main): New arguments --commonname, --givenname,
--surname, --roomnumber, --telephonenumber, --homephone.
* apps/luseradd.1: Document new arguments.
* apps/lusermod.c (main): New arguments --commonname, --givenname,
--surname, --roomnumber, --telephonenumber, --homephone.
* apps/lusermod.1: Document new arguments.
* modules/ldap.c (interact, lu_ldap_needed_objectclasses)
(lu_ldap_is_locked): Fix debug print parameters.
2009-12-08 Miloslav Trmač <mitr@redhat.com>
* modules/files.c (entry_name_conflicts): Split from generic_add ().
(generic_mod): Refuse to rename to an existing name.
* tests/files_test.py (Tests.testUserAdd8, Tests.testUserMod7)
(Tests.testGroupAdd5, Tests.testGroupMod6)
* tests/ldap_test.py (Tests.testUserAdd6, Tests.testUserMod5)
(Tests.testGroupAdd4, Tests.testGroupMod4): New test cases.
* apps/lnewusers.c (main): Refuse using dubious home directories unless
specified explicitly.
* tests/utils_test: Test handling of dubious default home directories in
lnewusers.
* lib/internal.h (LU_DUBIOUS_HOMEDIRECTORY): New definition.
* lib/user.c (lu_user_add): Refuse to create an user with a dubious home
directory unless specified explicitly.
(replace_all): New parameter "key". Recognize dubious home directory
value created by the substitution. Caller updated.
* lib/user_private.h (lu_common_user_add_check): Remove declaration.
* lib/common.c (LU_INVALID_HOMEDIRECTORY): Remove.
(lu_common_user_default): Set LU_DUBIOUS_HOMEDIRECTORY instead of
LU_INVALID_HOMEDIRECTORY, and only if LU_DUBIOUS_HOMEDIRECTORY is not
already set.
(lu_common_user_add_check): Remove.
* modules/files.c (lu_files_user_add)
* modules/ldap.c (lu_ldap_user_add): Remove call to
lu_common_user_add_check ().
2009-12-07 Miloslav Trmač <mitr@redhat.com>
* lib/common.c (lu_common_user_add_check): Capitalize error message.
* lib/user_private.h (lu_common_user_add_check): New declaration.
* lib/common.c (LU_INVALID_HOMEDIRECTORY): New definition.
(lu_common_user_default): Don't set home directory to /home/. or
/home/.. by default.
(lu_common_user_add_check): New function.
* modules/files.c (lu_files_user_add)
* modules/ldap.c (lu_ldap_user_add): Call lu_common_user_add_check ().
* po/POTFILES.in: Add lib/common.c.
* tests/files_test.py (Tests.testUserAdd7)
* tests/ldap_test.py (Tests.testUserAdd5): New tests.
2009-10-26 Miloslav Trmač <mitr@redhat.com>
* apps/lid.c (do_id): Report error when the name does not exist (as
opposed to the case when a group exists but does not have any members).
Caller updated.
2009-10-02 Miloslav Trmač <mitr@redhat.com>
* configure.in: Release version 0.56.12.
* NEWS: Update.
2009-09-14 Miloslav Trmač <mitr@redhat.com>
* configure.in: Release version 0.56.11.
* NEWS: Update.
* po/LINGUAS: Update.
* Makefile.am (lib_libuser_la_LDFLAGS): Update version info.
* autogen.sh: Fix (make archive).
* apps/luserdel.c (main): Fix comment.
2009-06-23 Miloslav Trmač <mitr@redhat.com>
* apps/lgroupmod.c (main): Remove unnecessary nscd refreshes. Refresh
the "passwd" nscd cache only once after modifying all affected users.
* apps/lnewusers.c (main): Refresh the "group" nscd cache after adding
a group. Refresh the "passwd" nscd cache only after changing the user's
password.
* apps/lpasswd.c (main): Refresh the relevant nscd cache after changing
the password.
* apps/luseradd.c (main): Refresh the "passwd" nscd cache only after
changing the user's password.
* apps/luserdel.c (main): Only refresh the "group" cache if a group was
deleted.
* Makefile.am (apps_libapputil_la_CPPFLAGS): New variable.
* apps/apputil.c (lu_nscd_flush_cache): New function.
(lu_signal_nscd, lu_hup_nscd): Remove.
* apps/apputil.h: Update prototypes.
* apps/lchage.c (main)
* apps/lchfn.c (main)
* apps/lchsh.c (main)
* apps/lgroupadd.c (main)
* apps/lgroupdel.c (main)
* apps/lgroupmod.c (main):
* apps/lnewusers.c (main):
* apps/luseradd.c (main)
* apps/luserdel.c (main): Use lu_nscd_flush_cache () instead of
lu_hup_nscd ().
Based on a patch by Masahiro Matsuya <mmatsuya@redhat.com>.
2009-06-14 Miloslav Trmač <mitr@redhat.com>
* configure.in: Add AC_CONFIG_MACRO_DIR. Drop AC_ISC_POSIX. Update for
libtool 2.
* lib/getdate.y: Update for bison 2.4.
* configure.in: Update gettext version to 0.17.
2009-05-22 Miloslav Trmač <mitr@redhat.com>
* apps/luserdel.c (main): Remove user's mail spool as well.
* apps/luserdel.1: Update.
* lib/user.c (run_single): Prohibit renaming entities to an invalid
name.
* tests/files_test.py (Tests.testUserMod6, Tests.testGroupMod5): New
tests.
* modules/files.c (generic_add): Remove unnecessary "line != NULL"
conditions.
* apps/lnewusers.c (main)
* apps/luseradd.c (main)
* apps/lusermod.c (main): Refuse GID and UID (id_t)-1.
* apps/lgroupadd.c (main)
* apps/lgroupmod.c (main): Refuse GID (gid_t)-1.
* lib/user.c (extract_name, extract_id): Only check pending values,
nothing else falls back on current values like these functions did.
(lu_default_int): Don't default LU_GIDNUMBER to -1 if the "users" group
does not exist. Don't set ID to 0 or -1 if a new ID can't be allocated.
Don't replace %u in default values by 0 or -1 if a new ID can't be
allocated.
* python/admin.c (libuser_admin_create_home): Dont populate home
directory if UID or GID is (id_t)-1.
* python/ent.c (libuser_convert_to_value): Try to refuse GID and UID
(id_t)-1.
2009-04-14 Miloslav Trmač <mitr@redhat.com>
* configure.in: Version 0.56.10.
* NEWS: Update.
* po/LINGUAS: Update.
2009-03-12 Miloslav Trmač <mitr@redhat.com>
* tests/ldap_test.py (Tests.testUserLock3)
(Tests.testUserUnlock4, Tests.testUserUnlockNonempty4)
(Tests.testGroupLock3, Tests.testGroupUnlock4)
(Tests.testGroupUnlockNonempty4): Test handling of unsupported
encryption schemes when locking or unlocking passwords.
* modules/ldap.c (userPassword_has_scheme): New function.
(lu_ldap_handle_lock): Don't re-encrypt (corrupt) passwords that use
a different encryption scheme than {crypt}.
2009-02-19 Miloslav Trmač <mitr@redhat.com>
* tests/utils_test
* tests/utils_group
* tests/utils_gshadow
* tests/utils_passwd
* tests/utils_shadow: Test useradd with a numerical user name.
* apps/luseradd.c (main): When the user name is used as a group name,
never interpret it as a number.
2008-10-13 Miloslav Trmač <mitr@redhat.com>
* po/POTFILES.skip: New file (used by transifex at
translate.fedora.redhat.com).
2008-07-19 Miloslav Trmač <mitr@redhat.com>
* tests/files_test.py (Tests.testUserAdd6, Tests.testUserMod5)
(Tests.testUserSetpass4, Tests.testGroupAdd4)
(Tests.testGroupMod4, Tests.testGroupSetpass4): New tests.
* modules/files.c (format_generic): New parameter error. Reject fields
contaning a ':' that would be interpreted as a field separator.
(format_fn): Remove.
(generic_add): New parameters formats, format_count instead of
formatter. All users changed. Format the new line first, and refuse
to use it if it is invalid.
(lu_files_format_user, lu_files_format_group, lu_shadow_format_user)
(lu_shadow_format_group): Fold into generic_add callers.
(generic_mod): Format the new line first, and refuse to use it if it is
invalid. Modify the file one line at a time instead of one field at a
time.
(generic_setpass): Refuse to use the new password if it contains a
literal ':'.
2008-07-18 Miloslav Trmač <mitr@redhat.com>
* tests/config_test.sh (workdir):
* tests/pwhash_test (workdir):
* tests/utils_test (workdir): Use a work directory distinct from
tests/files_test.
* tests/slapd.conf.in: Use the "bdb" database backend, ldbm was removed
in openldap-2.4.
2008-07-13 Miloslav Trmač <mitr@redhat.com>
* apps/lnewusers.1: Fix .IP argument quoting. Use sentence
capitalization for field names. Fix a typo.
2008-04-09 Miloslav Trmač <mitr@redhat.com>
* configure.in: Version 0.56.9.
* NEWS: Update.
* po/LINGUAS: Add as.
2008-03-25 Miloslav Trmač <mitr@redhat.com>
* apps/lpasswd.1 (DESCRIPTION): Fix another pasto.
2008-02-27 Miloslav Trmač <mitr@redhat.com>
* apps/lusermod.c (main): Warn if the new GID does not refer to an
existing group.
* apps/lusermod.1: Document that --gid may output a warning if the group
does not exist. Resolves libuser #1.
* tests/utils_group
* tests/utils_gshadow
* tests/utils_passwd
* tests/utils_shadow
* tests/utils_test: Test usermod -g outputs a warning if the specified
group does not exist.
2008-02-26 Miloslav Trmač <mitr@redhat.com>
* apps/lpasswd.1 (SYNOPSIS): Fix a pasto.
* apps/luseradd.1 (NAME): Fix.
Bugs reported by Miloš Malík <mmalik@redhat.com>.
2008-02-23 Miloslav Trmač <mitr@redhat.com>
* configure.in: Version 0.56.8.
* NEWS: Update.
* Makefile.am (EXTRA_DIST): Add tests/config_import2.conf.in,
tests/config_login2.defs, tests/pwhash.conf.in, tests/pwhash.py and
tests/pwhash_test.
* All relevant source files: Use <> for #including config.h, in
particular do not use "../config.h", which can refer to a file outside
the build directory. Remove #ifdef HAVE_CONFIG_H, we know that is true.
* Makefile.am (HGTAG): Replace CVSTAG.
(force-tag, tag, archive): Update to use Mercurial.
* all files: Remove CVS keywords.
* README: Point to the home page hosted at fedoraproject.org.
2008-02-16 Miloslav Trmač <mitr@redhat.com>
* po/POTFILES.in: Add missing lib/misc.c.
* docs/libuser.conf.5.in: Fix a typo.
2008-01-11 Miloslav Trmač <mitr@redhat.com>
* tests/pwhash_test: Fix description.
2008-01-09 Miloslav Trmač <mitr@redhat.com>
* configure.in: Version 0.56.7.
* NEWS: Update.
* Makefile.am (lib_libuser_la_LDFLAGS): Update version info.
* lib/common.c: New file, moving most code from modules/default.-c.
(lu_common_user_default, lu_common_group_default)
(lu_common_suser_default, lu_common_sgroup_default): Make public.
* lib/user_private.h (LU_COMMON_DEFAULT_PASSWORD)
(LU_COMMON_DEFAULT_SHADOW_PASSWORD, LU_COMMON_DEFAULT_SHELL): New
definitions, moved from modules/default.-c.
(lu_common_user_default, lu_common_group_default)
(lu_common_suser_default, lu_common_sgroup_default)
(lu_util_default_salt_specifier): New declarations.
* lib/util.c (HASH_ROUNDS_MIN, HASH_ROUNDS_MAX)
(parse_hash_rounds, select_hash_rounds): Move from modules/default.-c.
(lu_util_default_salt_specifier): Move from modules/default.-c. Use
a lu_context * instead of lu_module *. All users changed.
(lu_make_crypted): Use HASH_ROUNDS_MAX.
* modules/default.-c: Remove. All users changed.
* Makefile.am (pkginclude_HEADERS): Remove modules/default.-c.
(lib_libuser_la_SOURCES): Add lib/common.c.
(modules_libuser_files_la_CPPFLAGS)
(modules_libuser_shadow_la_CPPFLAGS)
(modules_libuser_krb5_la_CPPFLAGS)
(modules_libuser_ldap_la_CPPFLAGS)
(modules_libuser_sasldb_la_CPPFLAGS): Remove.
2008-01-08 Miloslav Trmač <mitr@redhat.com>
* po/sr@latin.po: Rename from po/sr@Latn.po
* po/LINGUAS: Update.
* docs/libuser.conf.5.in: Document SHA support.
* tests/pwhash.conf.in
* tests/pwhash.py: New files
* tests/pwhash_test: New test.
* Makefile.am (TESTS): Add tests/pwhash_test.
* tests/config_import2.conf.in
* tests/config_login2.defs: New files.
* tests/config_login.defs: Add SHA_CRYPT_MIN_ROUNDS and
SHA_CRYPT_MAX_ROUNDS.
* tests/config_override.conf.in: Add hash_rounds_min and
hash_rounds_max.
* tests/config_test.sh: Create libuser_import2.conf.
* tests/config_test.c (main): Add tests for hash_rounds_min and
hash_rounds_max. Test ENCRYPT_METHOD and MD5_CRYPT_ENAB interaction.
* lib/config.c (struct handle_login_defs_key_data): New definition.
(handle_login_defs_key): Expect struct handle_login_defs_key_data *
instead of struct config_config *. Handle ENCRYPT_METHOD,
SHA_CRYPT_MIN_ROUNDS, SHA_CRYPT_MAX_ROUNDS. Only use MD5_CRYPT_ENAB
if ENCRYPT_METHOD is not defined.
(import_login_defs): Pass struct handle_login_defs_key_data * to
handle_login_defs_key().
* lib/util.c (salt_type_info): New member sha_rounds. Add SHA256 and
SHA512 entries.
(lu_make_crypted): Add support for SHA rounds specification.
* modules/default.-c (HASH_ROUNDS_MIN, HASH_ROUNDS_MAX): New macros.
(lu_common_parse_hash_rounds, lu_common_select_hash_rounds): New
functions.
(lu_common_default_salt_specifier): Add support for sha256 and sha512.
Add support for configurable number of hashing rounds. Return a newly
allocated string. All callers changed.
2008-01-07 Miloslav Trmač <mitr@redhat.com>
* tests/files_test.py (Tests.testUserSetpass1)
(Tests.testUserSetpass2, Tests.testUserSetpass3)
(Tests.testGroupSetpass1, Tests.testGroupSetpass2)
(Tests.testGroupSetpass3): Don't assume the password salt is 11
characters long.
2007-12-06 Miloslav Trmač <mitr@redhat.com>
* apps/lid.1: Fix grammar.
2007-11-14 Miloslav Trmač <mitr@redhat.com>
* lib/util.c (lu_util_lock_obtain): Fix setting l_type.
2007-10-30 Miloslav Trmač <mitr@redhat.com>
* lib/util.c (lu_util_fscreate_restore) [WITH_SELINUX]: Fix use of
uninitialized data when SELinux is disabled.
2007-10-25 Miloslav Trmač <mitr@redhat.com>
* configure.in: Version 0.56.6.
* NEWS: Update.
* Makefile.am (lib_libuser_la_LDFLAGS): Update revision.
* docs/Makefile.am (CLEANFILES): Add sgml/libuser-1.html and
sgml/libuser-2.html.
* Makefile.am (modules_libuser_files_la_LDFLAGS)
(modules_libuser_shadow_la_LDFLAGS)
(modules_libuser_krb5_la_LDFLAGS)
(modules_libuser_ldap_la_LDFLAGS)
(modules_libuser_sasldb_la_LDFLAGS)
(python_libusermodule_la_LDFLAGS): Don't use -export-dynamic, that
option is defined only for executables.
* apps/apputil.c (lu_homedir_copy, lu_homedir_populate)
(lu_homedir_move): Set up / preserve SELinux file contexts when
creating / copying home directories.
* lib/user_private.h (lu_security_context_t, lu_util_fscreate_save)
(lu_util_fscreate_restore, lu_util_fscreate_from_file)
(lu_util_fscreate_for_path): New declarations.
* lib/util.c (lu_util_fscreate_save, lu_util_fscreate_restore)
(lu_util_fscreate_from_file, lu_util_fscreate_for_path): New functions.
* modules/files.c (set_default_context, reset_default_context): Remove.
(generic_add, generic_mod, generic_del, generic_lock)
(generic_setpass): Use lu_util_fscreate_save(),
lu_util_fscreate_from_file() and lu_util_fscreate_restore() instead of
set_default_context() and reset_default_context(). (This fixes a
possible leak of prev_context).
* apps/apputil.c (setup_default_context): Remove.
(lu_authenticate_unprivileged): Use lu_util_fscreate_from_file() instead
of setup_default_context().
* Makefile.am (lib_libuser_la_LDFLAGS): Link to SELINUX_LIBS.
(modules_libuser_files_la_LDFLAGS)
(modules_libuser_shadow_la_LDFLAGS): Don't link to SELINUX_LIBS
directly.
* docs/Makefile.am (CLEANFILES): Add sgml/libuser.html and
sgml/libuser.txt.
(clean-local): Remove.
2007-10-11 Miloslav Trmač <mitr@redhat.com>
* configure.in: Version 0.56.5.
* NEWS: Update.
* po/LINGUAS: Add kn, ro, te.
* tests/files_test.py (workdir): New variable.
(Tests.testUserAdd4, Tests.testUserAdd5): New tests.
* tests/files_test: Pass workdir to files_test.py.
* apps/apputil.c (lu_homedir_copy): Report an error if the destination
(home directory) is a relative path.
* python/admin.c (libuser_admin_add_user): Don't ignore a raised
exception before creating a mail spool. Create an exception object
if creating a mail spool fails. Beautify.
(libuser_admin_delete_user): Create an exception object if removing
a mail spool fails. Beautify.
2007-09-25 Miloslav Trmač <mitr@redhat.com>
* tests/ldap_test.py (Tests.testUserMod4): Test empty modifications.
* modules/ldap.c (dump_mods): Handle NULL mods.
(lu_ldap_set): Do not call ldap_modify_ext_s() when no attributes need
to be modified, to avoid spurious errors on Fedora Directory Server.
Beautify.
2007-09-10 Miloslav Trmač <mitr@redhat.com>
* lib/modules.c (load_one_module): Use G_MODULE_BIND_LOCAL.
2007-06-15 Miloslav Trmač <mitr@redhat.com>
* configure.in: Version 0.56.4.
* NEWS: Update.
* Makefile.am (lib_libuser_la_LDFLAGS): Update revision.
* tests/files_test.py (Tests.testUserSetpass1)
(Tests.testUserRemovepass)
* tests/ldap_test.py (Tests.testUserSetpass1)
(Tests.testUserRemovepass1): Test LU_SHADOWLASTCHANGE is updated.
* modules/files.c (lu_shadow_user_setpass)
(lu_shadow_group_setpass, lu_shadow_user_removepass)
(lu_shadow_group_removepass): Remove redundant
lu_util_update_shadow_last_change() calls.
* lib/user.c (lu_user_setpass, lu_user_removepass): Save the modified
LU_SHADOWLASTCHANGE value.
(lu_group_setpass, lu_group_removepass): Don't update
LU_SHADOWLASTCHANGE, the field is valid only for user entities.
2007-06-09 Miloslav Trmač <mitr@redhat.com>
* configure.in: Version 0.56.3.
* NEWS: Update.
* modules/ldap.c (struct lu_ldap_context): New member sasl_mechanism.
(interact): Return "" to SASL_CB_GETREALM. Shorten variable names for
better formating, simplify a bit.
(bind_server): Use context->sasl_mechanism. Replace contradictory
LDAP_SASL_INTERACTIVE | LDAP_SASL_QUIET by LDAP_SASL_AUTOMATIC.
(lu_ldap_close_module): Free sasl_mechanism.
(libuser_ldap_init): Default ldap/user to "". Allow specifying SASL
bind mechanism as "sasl/MECHANISM".
* docs/libuser.conf.5.in: Update bindtype documentation.
Original patch by Simo Sorce <ssorce@redhat.com>.
2007-04-28 Miloslav Trmač <mitr@volny.cz>
* configure.in
* Makefile.am: Use features available in autoconf 2.61.
2007-04-19 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.56.2.
* NEWS: Update.
* po/LINGUAS: Add bs. Remove languages with no translated strings.
2007-03-16 Miloslav Trmac <mitr@redhat.com>
* libuser.conf: Remove all krb5 module references to avoid the
slightest possibility of giving an impression that the krb5 module might
work.
2007-03-02 Miloslav Trmac <mitr@redhat.com>
* po/no.po: Remove, obsoleted by nb.po.
* po/LINGUAS: Remove no.
2007-02-23 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.56.1.
* NEWS: Update.
* tests/files_test.py (Tests.testUserSetpass3)
(Tests.testGroupLookupName2, Tests.testGroupSetpass3): Simplify the
lambda expression.
* modules/files.c (suffix_passwd, suffix_shadow, suffix_group)
(suffix_gshadow): New variables.
(generic_lookup, generic_add, generic_mod, generic_del, generic_lock)
(generic_is_locked, generic_setpass, lu_files_enumerate)
(lu_files_users_enumerate_by_group, lu_files_groups_enumerate_by_user)
(lu_files_enumerate_full, lu_files_uses_elevated_privileges)
(lu_shadow_uses_elevated_privileges, libuser_shadow_init): Use suffix_*
instead of separate "/" and copy&pasted basenames. All users changed.
* modules/files.c (lu_files_uses_elevated_privileges)
(lu_shadow_uses_elevated_privileges): Fix incorrect conversion from
g_strdup_printf ().
* modules/files.c (SHADOW_MODULE_NAME): New macro.
(ent_has_shadow): New function.
(generic_setpass): Only silently ignore known shadow markers,
and replace invalid shadow markers by "x"; both only if a shadow
entry exists.
(libuser_shadow_init): Use SHADOW_MODULE_NAME.
* tests/files_test.py (Tests.testUserSetpass1): Rename from
testUserSetpass.
(Tests.testGroupSetpass1): Rename from testGroupSetpass.
(Tests.testUserSetpass2, tests.testUserSetpass3)
(Tests.testGroupSetpass2, tests.testGroupSetpass3): New tests.
* tests/files_test: Update file contents.
2007-02-17 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.56.
* Makefile.am (lib_libuser_la_LDFLAGS): Update revision.
* NEWS: Update.
* configure.in (AM_INIT_AUTOMAKE): Use dist-bzip2.
* Makefile (archive): Use the bzip2 tarball.
* tests/files_test.py (Tests.testUserLookupName3)
(Tests.testUserDefault, Tests.testGroupLookupName3)
(Tests.testGroupDefault): New tests.
* tests/files_test: Update file contents.
* apps/apputil.c (lu_mailspool_create_remove)
* apps/lnewusers.c (main)
* lib/user.c (lu_default_int)
* modules/files.c (lu_files_user_lookup_id)
(lu_shadow_user_lookup_id, lu_files_group_lookup_id)
(lu_shadow_group_lookup_id, generic_del)
* modules/ldap.c (lu_ldap_base, lu_ldap_user_lookup_id)
(lu_ldap_group_lookup_id, lu_ldap_handle_lock)
(lu_ldap_users_enumerate_by_group): Don't use g_strdup_printf ()
when a simpler alternative can be used.
* lib/error.c (lu_error_new): Don't use lu_strerror () result as a
format string. Beautify.
* apps/lchage.c (read_ndays): Assume the value is a G_TYPE_LONG.
Return a g_type_long. All callers updated.
(date_to_string): Use glong for n_days.
* lib/user.c (lu_default_int)
* modules/ldap.c (lu_ldap_lookup): Use
lu_value_init_set_attr_from_string (). Report invalid values.
* tests/ldap_test.py (Tests.testUserAdd2): Use correct value types.
* docs/reference/tmpl/entity.sgml: Document the value types used for
entities.
* lib/config.c (handle_default_useradd_key): Try harder to eliminate
the possibility of date overflow.
2007-02-16 Miloslav Trmac <mitr@redhat.com>
* apps/lid.c (do_id): Avoid an unnecessary lu_value_strdup ().
* lib/util.c (salt_type_info): Use char[] instead of char * and reorder
fields within the structure to eliminate run-time relocations and save
some space.
* docs/reference/tmpl/error.sgml: Add missing parameter documentation.
* lib/user.c (lu_user_setpass, lu_user_removepass)
(lu_group_setpass, lu_group_removepass, lu_default_int): Use
lu_util_update_shadow_last_change ().
* lib/util.c (lu_util_shadow_current_date): Return the number of days
as an integer. Clean up.
(lu_util_update_shadow_last_change): Move from ...
* modules/files.c (set_shadow_last_change): ... here. All callers
updated.
* lib/internal.h (lu_util_shadow_current_date): Update prototype. Move
declaration from...
* lib/user_private.h (lu_util_shadow_current_date): ... here.
(lu_util_update_shadow_last_change): New declaration.
(LU_MODULE_VERSION): Bump.
* lib/user.c (replace_all): New function, based on a part of
lu_default_int ().
(lu_default_int): Perform substitutions one by one instead of
precomputing a list of them.
2007-02-15 Miloslav Trmac <mitr@redhat.com>
* lib/user.c (run_list): Avoid unnecessary g_value_dup_string ().
* lib/entity.c (lu_ent_dump): Remove output of value types that are
not expected to appear.
(lu_ent_add_module): Only copy the module name if it is not already
present in ent->modules.
* modules/files.c (line_read): Simplify and clean up.
(generic_del): Use memmove for copying strings that overlap. Clean up
the code a bit.
* apps/lnewusers.c (main)
* lib/prompt.c (lu_prompt_console): Eliminate duplicate strchr ()
calls.
* lib/entity.c (lu_ent_del_int): Use lu_values_equal () instead of
g_strdup_value_contents (), which is intended for human-readable
debugging dumps.
* lib/entity.c (lu_ent_dump_attributes): Split from
lu_ent_dump_attributes (). Show something for unsupported value types.
2007-01-06 Jeremy Katz <katzj@redhat.com>
* python/misc.c (libuser_prompt_destroy): Use PyObject_DEL since
we allocated with PyObject_NEW (#220679)
* python/ent.c (libuser_entity_destroy): Likewise.
* python/admin.c (libuser_admin_destroy): Likewise.
2006-12-14 Miloslav Trmac <mitr@redhat.com>
* python/admin.c (AdminType)
* python/ent.c (libuser_entity_mapping_methods, EntityType)
* python/misc.c (PromptType):
Remove casts, use comments to indicate struct members.
* python/admin.c (libuser_admin_setattr)
(libuser_admin_get_first_unused_id, libuser_admin_get_first_unused_gid)
(libuser_admin_new): Add manual casts to conform to
PyCFunctionWithKeywords.
(libuser_admin_get_first_unused_id_type): Remove unnecessary variable.
(libuser_admin_methods) [getUserShells]: Use METH_NOARGS.
* python/common.h (lenfunc): Remove definition.
(libuser_admin_new, libuser_prompt_new, libuser_get_user_shells):
Update prototypes.
* python/ent.c (libuser_entity_destroy, libuser_entity_getattr)
(libuser_entity_setattr, libuser_entity_length)
(libuser_entity_get_item, libuser_entity_set_item): Add manual casts to
conform to method types.
(libuser_entity_getattrlist, libuser_entity_module)
(libuser_entity_clear_all, libuser_entity_revert): Use METH_NOARGS.
(libuser_entity_get, libuser_entity_add, libuser_entity_set)
(libuser_entity_clear)
(libuser_entity_has_key): Add manual casts to conform to PyCFunction.
(libuser_entity_methods) [getattrlist, keys, clear_all, revert]
[modules]: Use METH_NOARGS.
[has_key, get, clear, set, add]: Remove casts.
* python/libusermodule.c (libuser_get_user_shells): Use METH_NOARGS.
(libuser_methods) [prompt, get_user_shells, PROMPT, getUserShells]: Use
METH_NOARGS.
* python/misc.c (libuser_prompt_destroy, libuser_prompt_getattr)
(libuser_prompt_setattr, libuser_prompt_print): Add manual casts to
conform to method types.
(libuser_prompt_new): Use METH_NOARGS.
* python/admin.c (libuser_admin_new)
* python/misc.c (libuser_prompt_new): Remove redundant declarations.
2006-12-10 Miloslav Trmac <mitr@redhat.com>
* configure.in (AM_GNU_GETTEXT_VERSION): Use gettext-0.14.6.
* configure.in: Version 0.55.
* NEWS: Update.
* autogen.sh
* Makefile.am (EXTRA_MANS, pkginclude_HEADERS, dist_noinst_SCRIPTS)
[QUOTA] (noinst_PROGRAMS, lib_LTLIBRARIES, pyexec_LTLIBRARIES)
* configure.in
* docs/reference/libuser-docs.sgml
* docs/reference/libuser-sections.txt
* python/modules.txt: Remove the quota library and Python module.
* docs/reference/tmpl/quota.sgml
* lib/userquota.3
* lib/userquota.c
* lib/userquota.h
* python/quota-script
* python/quotamodule.c
* samples/quotaq.c: Removed files.
* python/admin.c (libuser_admin_setattr)
(libuser_admin_lookup_user_name, libuser_admin_lookup_user_id)
(libuser_admin_lookup_group_name, libuser_admin_lookup_group_id)
(libuser_admin_do_wrap, libuser_admin_wrap_boolean)
(libuser_admin_setpass, libuser_admin_create_home)
(libuser_admin_remove_home, libuser_admin_move_home)
(libuser_admin_create_remove_mail, libuser_admin_add_user)
(libuser_admin_delete_user)
(libuser_admin_get_first_unused_id_type, libuser_admin_new)
* python/ent.c (libuser_entity_add, libuser_entity_set)
(libuser_entity_clear, libuser_entity_clear_all)
(libuser_entity_revert, libuser_entity_has_key)
* python/misc.c (libuser_admin_prompt, libuser_prompt_getattr):
* python/quotamodule.c (quotamodule_set, quotamodule_on)
(quotamodule_off):
Replace all trivial uses of Py_BuildValue ().
* python/misc.c (libuser_admin_prompt, libuser_prompt_setattr): Remove
an unnecessary use of typeof.
* apps/apputil.c (lu_converse): Use calloc () instead of malloc () and
memset ().
* python/common.h (Py_ssize_t, lenfunc): New definitions.
* python/ent.c (libuser_entity_setattr, libuser_entity_set)
(libuser_entity_length, libuser_entity_set_item): Use Py_ssize_t.
(libuser_entity_mapping_methods): Use lenfunc.
* python/misc.c (libuser_admin_python_prompter, libuser_admin_prompt):
Use Py_ssize_t.
* python/quotamodule.c (Py_ssize_t): New definition.
(quotamodule_set): Use Py_ssize_t.
2006-11-02 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.54.8.
* Makefile.am (lib_libuser_la_LDFLAGS): Update revision.
* NEWS: Update.
* lib/config.c (handle_default_useradd_key): Import HOME.
* docs/libuser.conf.5.in: Document HOME is imported from
default/useradd.
* tests/config_default_useradd
* tests/config_override.conf.in
* tests/config_test.c (main): Test import of HOME.
2006-09-25 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.54.7.
* NEWS: Update.
* po/LINGUAS: Add el, ml and or.
2006-05-01 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.54.6.
* Makefile.am (lib_libuser_la_LDFLAGS): Update revision.
* NEWS: Update.
* apps/lchsh.c (main): Provide a more verbose error message.
* apps/apputil.c (lu_homedir_copy): Split from lu_homedir_populate.
Reformat a bit.
(lu_homedir_populate): New parameter ctx. Default skeleton to
defaults/skeleton. All users updated to pass NULL instead of reading
the config value.
* apps/apputil.h (lu_homedir_populate): Update prototype.
* python/admin.c (libuser_admin_add_user): New keyword parameter
"skeleton".
* python/modules.txt: Document new addUser parameter.
2006-03-12 Miloslav Trmac <mitr@redhat.com>
* modules/ldap.c (get_ent_mods): Remove unused parameter module.
* lib/getdate.y: Quiesce some warnings.
* lib/config.c (read_file): Make type conversion explicit, assuming
sizeof (off_t) >= sizeof (size_t).
2006-03-06 Miloslav Trmac <mitr@redhat.com>
* python/admin.c (libuser_admin_enumerate_users)
(libuser_admin_enumerate_groups)
(libuser_admin_enumerate_users_by_group)
(libuser_admin_enumerate_groups_by_user): Don't attempt to
g_value_array_free(NULL).
* lib/user.c (extract_id, extract_name): Don't warn if the attribute
has no value, leave it to the caller.
(lu_refresh_int): Don't unnecessarily call extract_id(). Don't attempt
to refresh an entity without name.
(convert_user_name_to_id, convert_group_name_to_id): Report errors
when the entity can't be found or has no ID.
(ent_has_name_and_id): New function.
(lu_dispatch): Report more detailed errors on insufficiently filled
entities, also fixing a memory leak. Use constants for unused sdata,
ldata parameters.
* lib/user.c (lu_dispatch): Use g_assert_not_reached().
* apps/lid.c (do_id): Report lookup error. Exit with status 1 on
error.
* apps/lchsh.c (main): Report error on prompting. Exit with status 1
on error.
* apps/lchfn.c (main): Exit with status 1 on error.
* apps/apputil.c (lu_mailspool_create_remove): Fix memory leak.
2006-03-05 Miloslav Trmac <mitr@redhat.com>
* modules/files.c (parse_generic): Fix crash if the last field is
empty.
(lu_files_enumerate_full): Don't return empty data if the input line is
invalid. Match only the user name against the supplied pattern.
* tests/files_test.py (Tests.testUsersEnumerateFull3)
(Tests.testGroupsEnumerateFull3): New tests.
2006-02-21 Miloslav Trmac <mitr@redhat.com>
* lib/getdate.y: Add missing #include. Define YYENABLE_NLS to avoid
-Wundef.
* configure.in: Version 0.54.5.
* NEWS: Update.
* configure.in: Use newer gettext.
* docs/libuser.conf.5.in: Remove @pkglibdir@ references to avoid
multilib conflicts.
* docs/Makefile.am (libuser.conf.5): Stop replacing @pkglibdir@.
* modules/sasldb.c (lu_sasldb_close_module): Fix invalid aliasing.
2006-02-13 Miloslav Trmac <mitr@redhat.com>
* po/LINGUAS: Add my.
* configure.in: Version 0.54.4.
* NEWS: Update.
* Makefile.am (lib_libuser_la_LDFLAGS): Update revision.
2006-01-31 Miloslav Trmac <mitr@redhat.com>
* configure.in (WITH_PYTHON): New conditional.
* Makefile.am (pyexec_LTLIBRARIES, pyexec_LTLIBRARIES): Only use if
WITH_PYTHON.
Based on a patch by Dan Yefimov <dan@ns15.lightwave.net.ru>.
* lib/scache.c (get_keys): Fix C99-ism, patch by Dan Yefimov
<dan@ns15.lightwave.net.ru>.
2005-12-20 Miloslav Trmac <mitr@redhat.com>
* po/LINGUAS: Add hy, sr and sr@Latn.
2005-12-02 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.54.3.
* NEWS: Update.
* apps/lpasswd.c (main): Determine user name before attempting to
autenticate a NULL user.
2005-11-12 Miloslav Trmac <mitr@redhat.com>
* modules/krb5.c (lu_krb5_user_add)
* modules/ldap.c (lu_ldap_handle_lock, lu_ldap_setpass): Use
g_str_has_prefix () where appropriate.
2005-11-11 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.54.2.
* NEWS: Update.
* Makefile.am (lib_libuser_la_LDFLAGS): Update revision.
* modules/ldap.c (close_server, connect_server, bind_server)
(lu_ldap_ent_to_dn, lu_ldap_lookup, lu_ldap_fudge_objectclasses)
(lu_ldap_is_locked, lu_ldap_setpass, lu_ldap_user_enumerate): Avoid
functions deprecated by openldap.
(objectclass_present, lu_ldap_needed_objectclasses): Use BerValue's
instead of strings. All callers updated.
(free_needed_objectclasses): New function.
* configure.in: Remove checks for no longer used deprecated openldap
functions.
(lu_ldap_close_module): Use close_server ().
(lu_ldap_set, lu_ldap_del, lu_ldap_handle_lock, lu_ldap_is_locked)
(lu_ldap_setpass, connect_server, bind_server): Replace empty LDAP
control vectors by NULL.
2005-10-11 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.54.1.
* Makefile.am (lib_libuser_la_LDFLAGS): Update revision.
* libuser.pc.in (Requires)
* configure.in: Use gmodule-no-export-2.0.
* libuser.conf: Rename from libuser.conf.in, hardcode @sysconfdir@ to
/etc.
* Makefile.am: Ship libuser.conf instead of libuser.conf.in.
* libuser.conf.in: Update to import values from shadow where possible.
* NEWS: Update.
2005-10-10 Miloslav Trmac <mitr@redhat.com>
* tests/config_default_useradd, testes/config_import.conf.in,
tests/config_login.defs, tests/config_override.conf.in: New files.
* tests/config_test.sh: Generate three config files, pass $workdir
to config_test instead of setting LIBUSER_CONF.
* tests/config_test.c (start): Split from main (). Set LIBUSER_CONF.
(verify_var): Abstract from main ().
(main): Test configuration import from shadow.
* Makefile.am (EXTRA_DIST): Distribute the new test components.
* lib/config.c (handle_login_defs_key): Fix pasto. Don't use the first
member of conv[] over and over.
2005-10-09 Miloslav Trmac <mitr@redhat.com>
* Most functions: Move variables to inntermost scope, remove
unnecessary initializers.
* modules/ldap.c (struct lu_ldap_context): New members user_branch,
group_branch.
(libuser_ldap_init): Initialize user_branch, group_branch.
(lu_ldap_base, lu_ldap_ent_to_dn, lu_ldap_lookup, lu_ldap_set)
(lu_ldap_del, lu_ldap_handle_lock, lu_ldap_is_locked, lu_ldap_setpass)
(lu_ldap_enumerate): Replace the configKey and def parameters by
branch. All callers changed to use struct lu_ldap_context members.
(lu_ldap_ent_to_dn): Rename variable branch to base.
(lu_ldap_base): Don't access module before asserting it is non-NULL.
Fix checking of empty branch.
(lu_ldap_ent_to_dn): Remove unused variable base. Map namingAttr to
LDAP only once.
(libuser_ldap_init): Fix memory leak.
* modules/ldap.c (LU_LDAP_USER, LU_LDAP_GROUP, LU_LDAP_SHADOW): Remove.
(ldap_attribute_map): Replace applicability by type.
(lu_ldap_lookup): Replace applicability by type. All
callers changed.
* modules/ldap.c (lu_ldap_base, lu_ldap_lookup, lu_ldap_set)
(lu_ldap_del, lu_ldap_handle_lock, lu_ldap_is_locked, lu_ldap_setpass):
Remove handling of NULL which can't ever trigger.
* modules/ldap.c (lu_ldap_user_lookup_name, lu_ldap_user_lookup_id)
(lu_ldap_group_lookup_name, lu_ldap_group_looup_id, getn_ent_adds)
(lu_ldap_is_locked, lu_ldap_setpass, lu_ldap_users_enumerate)
(lu_ldap_users_enumerate_full, lu_ldap_groups_enumerate)
(lu_ldap_groups_enumerate_full, lu_ldap_users_enumerate_by_group)
(lu_ldap_gropus_enumerate_by_user): Hardcode constant results
of map_to_ldap ().
* docs/libuser.conf.5.in: New file.
* docs/Makefile.am: Ship and install libuser.conf.5.
2005-10-07 Miloslav Trmac <mitr@redhat.com>
* lib/config.c (destroy_section): Split from lu_cfg_done().
(gather_values): Removed function.
(lu_cfg_done): Don't build a temporary list of sections to free.
(lu_cfg_read_single): Don't unnecessarily cache the default value.
* config.c (key_add_cached): Split from lu_cfg_init ().
(key_defined, key_add, handle_login_defs_key, import_login_defs)
(handle_default_useradd_key, import_default_useradd): New functions.
(lu_cfg_init): Handle import/login_defs and import/default_useradd.
* configure.in (YACC): New check.
* Makefile.am (lib_libuser_la_SOURCES): Add lib/getdate.y.
* lib/getdate.y: New file, copied from shadow and made reentrant.
* lib/internal.h: Declare lu_get_date (). Remove dependencies on other
headers.
* lib/modules.c (load_one_module): Split from lu_modules_load.
Fix leaks.
(lu_modules_load): Keep the *modules unchanged on failure.
(lu_module_unload): Simplify.
* lib/user.c (lu_start): Allocate ctx->scache before lu_cfg_init ().
Fix leaks.
(lu_end): Remove unnecessary NULL checks.
* tests/ldap_test: Allow more time for slapd initialization.
2005-10-01 Miloslav Trmac <mitr@redhat.com>
* lib/config.c (process_line): Cast arguments of isspace () to unsigned
char.
* apps/apputil.c: Remove unnecessary #include <ctype.h>.
* lib/config.c (process_line): Split from lu_cfg_init ().
Handle very large files and EINTR from read (). Fix FD leak on
fstat () failure. Don't prezero the buffer.
* lib/config.c (process_line): Fix accesses before the allocated
array. Add some microoptimizations.
2005-09-30 Miloslav Trmac <mitr@redhat.com>
* modules/default.-c (salt_initializer_des, salt_initializer_md5)
(salt_initializer_blowfish): Remove unnecessary variables, fold values
in lu_common_default_salt_specifier ().
2005-09-29 Miloslav Trmac <mitr@redhat.com>
* modules/files.c (libuser_shadow_init): Avoid useless runtime
computation.
* modules/files.c (lu_files_uses_elevated_privileges): Hardcode "/etc"
as default, like other functions.
* Makefile.am (modules_libuser_files_la_CPPFLAGS)
(modules_libuser_shadow_la_CPPFLAGS): Don't define SYSCONFDIR.
(modules_libuser_files_la_CPPFLAGS): Define SYSCONFDIR directly.
(SYSCONFDIR): Remove definition.
2005-09-14 Miloslav Trmac <mitr@redhat.com>
* apps/apputil.c (lu_authenticate_unprivileged): Correctly handle
pam_get_item () failures.
2005-09-13 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.54.
* Makefile.am (lib_libuser_la_LDFLAGS): Update revision.
* NEWS: Update.
* apps/apputil.h
* lib/internal.h: Add G_GNUC_INTERNAL to all declarations.
* lib/util.c (lu_strv_len): Remove.
* lib/user_private.h (lu_strv_len): Remove declaration.
* lib/user.c (lu_default_int): Replace lu_str_case_equal () with its
contents.
* lib/util.c (lu_str_case_equal, lu_str_equal)
(lu_account_name_is_valid): Remove unused functions (not exported in
public header files).
* lib/internal.h (lu-str_case_equal, lu_str_equal)
(lu_account_name_is_valid: Remove
declarations.
* apps/apputil.c (lu_strconcat): Comment out like its only user.
* apps/apputil.h (lu_strconcat): Remove declaration.
* lib/internal.h: Merge lib/modules.h and lib/util.h.
* lib/user_private.h: Move internal interfaces to internal.h.
* Makefile.am (lib_libuser_la_SOURCES)
* docs/reference/Makefile.am (IGNORE_HFILES)
* lib/config.c
* lib/entity.c
* lib/misc.c
* lib/modules.c
* lib/scache.c
* lib/user.c
* modules/krb5.c: Update.
2005-09-12 Miloslav Trmac <mitr@redhat.com>
* apps/apputil.c (lu_converse)
* apps/lnewusers.c (main)
* lib/error.c (lu_error_free)
* python/misc.c (libuser_prompt_setattr): Remove conditionals around
g_free () or g_strfreev ().
* apps/lchfn.c (main)
* apps/lnewusers.c (main)
* lib/util.c (lu_strv_len)
* modules/files.c (parse_generic): Use g_strv_length ().
* lib/user_private.h (lu_strv_len): Mark as deprecated.
* apps/apputil.c (lu_converse): Actually use the "pending" messages.
* lib/entity.c (quark_from_attribute): Use g_ascii_strdown ().
* modules/files.c (struct format_specifier): Remove member position,
assume position == index + 1.
(format_passwd, format_group, format_shadow, format_gshadow)
(parse_generic, format_generic, generic_mod): Update.
* lib/entity.c (lu_ent_add_int)
* modules.files.c (format_generic, generic_mod): Beautify.
* modules/files.c (generic_mod): Simplify name extraction.
* modules/files.c (format_field): New function.
(format_generic, generic_mod): Use format_field ().
* lib/entity.c (quark_from_attribute): New function.
(lu_ent_get_int, lu_ent_clear_int, lu_ent_set_int, lu_ent_add_int):
Use quark_from_attribute ().
* modules/files.c (generic_mod): Fix crash when attribute is missing.
* tests/files_test.py (Tests.testUserMod4): New test.
* modules/files.c (parse_generic): Use size_t for field index.
* apps/lchage.c (read_ndays): Assume array != NULL
&& array->n_values > 0. Beautify.
* lib/user.c (merge_ent_array_duplicates)
* modules/files.c (generic_is_locked)
* modules/ldap.c (lu_ldap_lookup, get_ent_adds): Beautify.
* apps/lchage.c (main)
* apps/lchsh.c (main)
* apps/luserdel.c (main)
* lib/user.c (lu_dispatch)
* modules/files.c (lu_shadow_user_lookup_id, lu_shadow_group_lookup_id)
(format_generic): Simplify conditions based on the guarantee
below.
* docs/reference/tmpl/entity.sgml: Document that attribute values have
always at least one value.
* lib/entity.c (lu_ent_set_int, lu_ent_del_int): Remove the attribute
if there are no values.
2005-06-08 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.53.8.
* NEWS: Update.
* tests/ldap_test: Remove temporary debugging modification.
* lib/user.c (lu_name_allowed, INVALID_NAME_CHARS): Permit "portable"
user and group names as defined by SUSv3, plus trailing $.
* tests/files_test.py (Tests.testUserAddPrep): New test.
* lib/error.h: Use G_GNUC_PRINTF.
* python/debug.h (FIXME): Remove unused definition.
2005-06-04 Miloslav Trmac <mitr@redhat.com>
* autogen.sh: Don't set CFLAGS, we don't run configure any more.
* configure.in: Use gettext 0.14.3.
* tests/ldap_test: Really use tests/ldaprc.
2005-05-20 Miloslav Trmac <mitr@redhat.com>
* autogen.sh: Document the full set of testing flags. Remove hardcoded
paths (used to be necessary to workaround parsing paths in configure).
* configure.in, Makefile.am: Don't attempt to parse paths in configure,
let (make) expand the variables.
* libuser.conf.in: Don't use both @scdir@ and @sysconfdir@.
* tests/config_test.sh: New file.
* tests/config.conf: Rename from tests/config.conf.in. Define
defaults/moduledir to point to the build directory.
* tests/config_test.c: Don't define LIBUSER_CONF, it is defined by the
wrapper script now.
* configure.in: Remove many unnecessary tests, simplify others. Fix
checking for __secure_getenv().
* Makefile.am: Hardcode variables with only a single possible value
* configure.in: Disable building of static libraries.
* Makefile.am: Don't remove *.{a,la} of plugins.
2005-04-30 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.53.7.
* NEWS: Update.
* configure.in: Remove unused GETTEXT_PACKAGE definition.
* po/LINGUAS: New file, moved from ALL_LINGUAS in configure.in.
Add missing languages (bn_IN, en_GB, et, fi, gu, he, id, ka, ku, lo,
mr, si, sq, ur).
2005-04-24 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.53.6.
* NEWS: Update.
* Makefile.am: Don't ship test/config_test in distribution tarball.
* autogen.sh: Don't automatically run configure.
* Makefile.am: Update.
* tests/config_test.c, tests/config.conf: New files.
* Makefile.am: Add tests/config_test.c and tests/config.conf.
* lib/config.c (lu_cfg_init): Don't ignore keys with empty values.
* lib/config.c (struct config_config): Store the configuration
in parsed form, not only the text of the config file.
(lu_cfg_init): Parse the configuration only at initialization time.
(lu_cfg_done): Update.
(lu_cfg_read, lu_cfg_read_keys): Use the paresd configuration.
(compare_section_names, compare_key_string, gather_values): New
functions.
2005-04-15 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.53.5.
* NEWS: Update.
* tests/files_test.py (Tests.testUserEnumerate1): Rename from
testUserEnumerate.
(Tests.testGroupsEnumerate1): Rename from testGroupsEnumerate.
(Tests.testUsersEnumerateFull1): Rename from testUsersEnumerateFull.
Simplify.
(Tests.testGroupsEnumerateFull1): Rename from testGroupsEnumerateFull.
Simplify.
(Tests.testUsersEnumerateByGroup3): Simplify.
(Tests.testUserEnumerate2, Tests.testUsersEnumerateByGroup4)
(Tests.testUsersEnumerateFull2, Tests.testGroupsEnumerate2)
(Tests.testGroupsEnumerateByUser4, Tests.testGroupsEnumerateFull2):
New tests.
* modules/files.c (lu_files_enumerate)
(lu_files_users_enumerate_by_group)
(lu_files_groups_enumerate_by_user, lu_files_enumerate_full): Skip
nss_compat lines (starting with '+' or '-').
* tests/files_test: Update initial file contents.
* apps/apputil.c: Remove unnecessary include.
* configure.in: Use AM_PATH_PYTHON instead of --with-python-version.
* Makefile.am (pythonexecdir): Replace by pyexecdir.
(DISTCHECK_CONFIGURE_FLAGS): Remove
--with-python-version.
(PYTHON_CPPFLAGS): New definition.
2005-04-06 Miloslav Trmac <mitr@volny.cz>
* configure.in: Version 0.53.4.
* NEWS: Update.
2005-04-06 Miloslav Trmac <mitr@redhat.com>
* modules/ldap.c (ldap_attribute_map): Fix "cn" objectclass.
(lu_ldap_needed_objectclasses): Don't add "account" objectclass if it
is already present.
(lu_ldap_fudge_objectclasses): Add debugging output.
2005-03-05 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.53.3.
* NEWS: Update.
2005-03-04 Miloslav Trmac <mitr@redhat.com>
* apps/apputil.c (lu_homedir_populate, lu_signal_nscd)
(lu_mailspool_create_remove)
* modules/files.c (lu_files_create_backup, generic_add, generic_del):
Add more error checking.
* modules/ldap.c: Include Cyrus SASL v2 header file.
* modules/krb5.c (lu_krb5_user_add, lu_krb5_user_mod)
(lu_krb5_user_del, lu_krb5_user_do_lock, lu_krb5_user_islocked)
(lu_krb5_user_setpass): Fix checking of lu_ent magic.
* docs/reference/libuser-sections.txt: Add lu_values_equal.
* docs/reference/tmpl/value.sgml: Document lu_values_equal ().
2005-01-17 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.53.2.
* NEWS: Update.
* tests/utils_test
* tests/utils.conf.in
* tests/utils_group
* tests/utils_gshadow
* tests/utils_passwd
* tests/utils_shadow: New files.
* Makefile.am: Add tests/utils_test.
* apps/lgroupmod.c (main): Fix ignoring of other changes when one
of -p, -P, -L, -U is used. Fix group ID changes (look up group
members in the original group, and only after applying other
member list modifications; don't change primary group ID for users
that have a different primary group).
* apps/lgroupmod.1: Fix typo.
* apps/lnewusers.c (main): Don't use "users" if the input
specifies a nonexistent group name. Use the specified user ID.
* apps/lnewusers.1: Update.
* apps/luseradd.c (main): Actually implement -p and -P.
* apps/lusermod.c (main): Fix ignoring of other changes when one
of -p, -P, -L, -U is used.
2005-01-15 Miloslav Trmac <mitr@redhat.com>
* apps/lchage.1
* apps/lgroupadd.1
* apps/lgroupdel.1
* apps/lgroupmod.1
* apps/lid.1
* apps/lnewusers.1
* apps/lpasswd.1
* apps/luseradd.1
* apps/luserdel.1
* apps/lusermod.1: New files.
* Makefile.am: Add new man pages.
* apps/lchage.c (main): Fix cut-and-paste error in -E and -W.
* apps/lpasswd.c (main): Make sure the password is always
'\0'-terminated.
* apps/luseradd.c (main): Exit if a new group can't be created.
2004-12-13 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.53.1.
* NEWS: Update.
* python/libusermodule.c (initlibuser): Export UT_NAMESIZE from
<utmp.h>.
* pythone/modules.txt: Document UT_NAMESIZE.
2004-11-14 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.53.
* NEWS: Update.
* docs/reference/libuser-sections.txt
* docs/reference/tmpl/user.sgml: Document lu_user_unlock_nonempty ()
and lu_group_unlock_nonempty ().
* tests/files_test.py (Tests.testUserUnlockNonempty1)
(Tests.testUserUnlockNonempty2, Tests.testUserUnlockNonempty3)
(Tests.testGroupUnlockNonempty1, Tests.testGroupUnlockNonempty2)
(Tests.testGroupUnlockNonempty3)
* tests/ldap_test.py (Tests.testUserUnlockNonempty1)
(Tests.testUserUnlockNonempty2, Tests.testUserUnlockNonempty3)
(Tests.testGroupUnlockNonempty1, Tests.testGroupUnlockNonempty2)
(Tests.testGroupUnlockNonempty3): Add tests for
lu_user_unlock_nonempty ()
* modules/files.c (reset_default_context): Don't report error in
restoring default context, there is no way to handle them anyway.
* python/admin.c (libuser_admin_unlock_user)
(libuser_admin_unlock_group): Allow calling lu_user_unlock_nonempty ()
and lu_group_unlock_nonempty ().
* python/modules.txt: Document unlockUser nad unlockGroup changes.
* tests/files_test.py (Tests.testUserUnlock3)
(Tests.testGroupUnlock3)
* tests/ldap_test.py (Tests.testUserUnlock3)
(Tests.testGroupUnlock2): Test that empty password fields can be
unlocked.
* modules/ldap.c (enum lock_op): New definition.
(lu_ldap_handle_lock): Use enum lock_op. All callers changed.
(lu_ldap_user_unlock_nonempty, lu_ldap_group_unlock_nonempty)
(libuser_ldap_init): Handle user_unlock_nonempty and
group_unlock_nonempty.
* modules/files.c (enum lock_op): New definition.
(lock_process): Use enum lock_op, return error status.
(generic_lock): Use enum lock_op. All callers changed.
(lu_files_user_unlock_nonempty, lu_files_group_unlock_nonempty)
(lu_shadow_user_unlock_nonempty, lu_shadow_group_unlock_nonempty)
(libuser_files_init, libuser_shadow_init): Handle user_unlock_nonempty
and group_unlock_nonempty.
* modules/sasldb.c (lu_sasldb_user_unlock_nonempty)
(lu_sasldb_group_unlock_nonempty, libuser_sasldb_init): Define
user_unlock_nonempty and group_unlock_nonempty stubs.
* lib/error.h (lu_error_unlock_empty): New definition.
* lib/error.c (lu_strerror, lu_error_is_error): Handle
lu_error_unlock_empty.
* lib/user_private.h (LU_MODULE_VERSION): Bump.
(struct lu_module): New members user_unlock_nonempty,
group_unlock_nonempty.
* lib/modules.c (lu_modules_load): Handle new struct lu_module members.
* lib/user.c (lu_user_unlock_nonempty, lu_group_unlock_nonempty): New
functions.
(lu_dispatch_id): New values user_unlock_nonempty,
group_unlock_nonempty.
(run_single, run_list, lu_dispatch): Handle new lu_dispatch_id values.
* lib/user.h: Add declarations.
* NEWS: Update.
* tests/files_test.py (Tests.testUserLock1, Tests.testUserLock2)
(Tests.testUserUnlock1, Tests.testUserUnlock2)
(Tests.testUserIslocked1, Tests.testUserIslocked2)
(Tests.testUserSetpass, Tests.testUserRemovepass)
(Tests.testGroupLock1, Tests.testGroupLock2)
(Tests.testGroupUnlock1, Tests.testGroupUnlock2)
(Tests.testGroupIsLocked1, Tests.testGroupIsLocked2)
(Tests.testGroupSetpass, Tests.testGroupRemovepass): Test the functions
don't change the non-shadow password fields.
* modules/files.c (generic_setpass): Allow setting a shadow password
even if the current shadow password is invalid. All callers updated.
* apps/luseradd.c (main): Don't attempt to create a user group
if --gid specifies a numerical ID of a non-existing group.
* apps/lnewusers.c (main): Fix handling of empty home directory field.
* apps/lusermod.c (main): Make copies of entity values that get
destroyed by lu_user_modify (). Get a list of groups an user is in
before renaming the user. Don't reuse 'ent' for group entitites.
* NEWS: Update.
2004-11-13 Miloslav Trmac <mitr@redhat.com>
* modules/files.c (struct format specifier): New member def_if_empty.
(format_passwd, format_group, format_shadow, format_gshadow): Update.
(parse_generic): Check for def_if_empty.
* apps/lgroupadd.c (main)
* apps/lgroupmod.c (main)
* apps/lchage.c (read_ndays)
* apps/lnewusers.c (main)
* apps/luseradd.c (main)
* apps/lusermod.c (main)
* lib/misc.c (lu_value_get_id)
* lib/user.c (lu_default_int)
* modules/files.c (parse_field)
* modules/ldap.c (lu_ldap_lookup)
* samples/lookup.c (main): Check strto* () for error yet more properly.
* tests/files.conf.in, tests/files_test, tests/files_test.py: New
files.
* Makefile.am: Add tests/files_test.
(EXTRA_DIST): Don't change values depending on whether LDAP is used.
* modules/files.c (libuser_files_init, libuser_shadow_init): Allow
using the modules as non-root if explicitly requested.
2004-11-09 Miloslav Trmac <mitr@redhat.com>
* tests/ldap_test.py (Tests.testUserLookupId)
(Tests.testGroupLookupId): Test large ID values.
(Tests.testUserAdd4, Tests.testUserMod3, Tests.testGroupAdd3)
(Tests.testGroupMod3): New tests.
* apps/lusermod.c (main): Fix user renaming in groups where the
user is a member or administrator.
* python/ent.c (libuser_convert_to_value): Handle whole id_t
range.
* python/ent.c (libuser_convert_to_value): Report Python exception
instead of aborting. Return success/failure status.
(libuser_entity_setattr, libuser_entity_add, libuser_entity_set)
(libuser_entity_set_item): Handle errors reported by
libuser_convert_to_value().
* python/ent.c (convert_value_array_pylist): Handle G_TYPE_INT64.
* python/admin.c (lubser_admin_lookup_user_id)
(libuser_admin_lookup_group_id, libuser_admin_create_home)
(libuser_admin_get_first_unused_id_type): Handle whole uid_t/gid_t
range.
2004-11-08 Miloslav Trmac <mitr@redhat.com>
* lib/user.c (lu_default_int): Use id_t.
* lib/user.c (lu_get_first_unused_id): Change the interface to use
id_t. Don't allow (id_t)-1.
* lib/user_private.h: Update prototype.
* modules/files.c (format_passwd, format_group): Use
G_TYPE_INVALID for id_t.
(parse_field): Handle G_TYPE_INVALID.
* modules/files.c (parse_field): New function, split from
parse_generic (). Don't interpret input as octal or hexadecimal
numbers.
(parse_generic): Use parse_field ().
* modules/ldap.c (lu_ldap_lookup): Convert id_t values to numbers,
not strings. Don't interpret input as octal or hexadecimal
numbers.
* samples/lookup.c (main): Handle whole id_t range.
* lib/user.c (lu_default_int): Convert id_t values to numbers, not
strings. Don't interpret input as octal or hexadecimal numbers.
* lub/user.c (lu_default_int): Handle whole range of uid_t/gid_t in
'%u' substitution.
* lib/user.c (lu_default_int): Remove copy-and-pasted usage of
idkeystring as a generic fallback.
* lib/user.c (lu_default_int): Handle whole ID range.
* lib/user.c (compare_strings): Replace compare_ints ().
(merge_ent_array_duplicates): Use lu_value_strdup () instead of
poking in GValues.
* modules/ldap.c (value_compare): Removed function.
* lib/entity.c (lu_ent_add_int)
* lib/user.c (remove_duplicate_values)
* modules/ldap.c (arrays_equal, get_ent_mods): Use lu_values_equal ().
* lib/misc.c (lu_values_equal): New function.
* lib/user.h: Add declaration.
* apps/lgroupmod.c (main)
* apps/lgroupadd.c (main)
* apps/luseradd.c (main)
* apps/lusermod.c (main): Handle whole gid_t/uid_t range for
'--gid' and '--uid', respectively.
2004-11-07 Miloslav Trmac <mitr@redhat.com>
* apps/apputil.h (INVALID): Removed definition.
* apps/apputil.c (lu_mailspool_create_remove)
* apps/lgroupadd.c (main)
* apps/lgroupmod.c (main)
* apps/lnewusers.c (main)
* apps/luseradd.c (main)
* apps/lusermod.c (main): Use LU_VALUE_INVALID_ID to indicate unknown
value.
* lib/user.c (INVALID): Removed definition.
(extract_id, convert_user_name_to_id, convert_group_name_to_id):
Return LU_VALUE_INVALID_ID on failure. All callers changed.
(lu_dispatch): Use LU_VALUE_INVALID_ID to indicate unknown value.
All callers changed.
* samples/testuser.c (dump_attribute): Handle G_TYPE_INT64.
* modules/ldap.c (lu_ldap_user_lookup_id): Handle whole uid_t range.
(lu_ldap_group_lookup_id, lu_ldap_users_enumerate_by_group): Handle
whole gid_t range.
* modules/files.c (lu_files_user_lookup_id)
(lu_shadow_user_lookup_id): Handle whole uid_t range.
(lu_files_group_lookup_id, lu_shadow_group_lookup_id)
(lu_files_users_enumerate_by_group): Handle whole gid_t range.
* lib/user.c (run_single, run_list): Use id_t for ldata. All callers
changed.
(convert_user_name_to_id): Return uid_t.
(convert_group_name_to_id): Return gid_t.
* lib/entity.c (lu_ent_dump): Handle G_TYPE_INT64.
* apps/luserdel.c (main): Handle whole gid_t range.
* apps/luseradd.c (main): Handle whole gid_t range.
* apps/lnewusers.c (main): Handle whole uid_t/gid_t range, don't ignore
invalid values.
* apps/lchage.c (read_ndays): Handle G_TYPE_INT64.
* apps/apputil.c (lu_mailspool_create_remove)
* apps/lgroupmod.c (main)
* apps/lnewusers.c (main)
* apps/luseradd.c (main)
* apps/luserdel.c (main)
* modules/ldap.c (lu_ldap_groups_enumerate_by_user): Use
lu_value_get_id ().
* docs/reference/tmpl/value.sgml: New file.
* lib/misc.c (lu_value_get_id): New function.
* lib/user.h: Add declaration.
(LU_VALUE_INVALID_ID): New macro.
* apps/lgroupadd.c (main)
* apps/lgroupmod.c (main)
* apps/lnewusers.c (main)
* apps/luseradd.c (main)
* apps/lusermod.c (main)
* lib/user.c (lu_default_int): Use lu_value_init_set_id ().
* lib/misc.c (lu_value_init_set_id): New function.
* lib/user.h: Add declaration.
* lib/misc.c (lu_value_strdup): Handle G_TYPE_INT64.
* lib/misc.c (lu_strdup_value): Rename to lu_value_strdup (). All
callers changed.
* lib/user.h: Rename declaration.
* apps/lchage.c (read_ndays)
* apps/lnewusers.c (main)
* apps/luseradd.c (main)
* lib/user.c (lu_default_int)
* modules/files.c (parse_generic)
* modules/ldap.c (lu_ldap_lookup)
(lu_ldap_groups_enumerate_by_user): Properly check strtol () for error.
2004-11-05 Miloslav Trmac <mitr@redhat.com>
* modules/files.c (generic_lock, generic_is_locked, generic_setpass)
* apps/lchfn.c (main): Use lu_strdup_value ().
* modules/files.c (generic_is_locked): Fix memory leak.
2004-11-04 Miloslav Trmac <mitr@redhat.com>
* modules/ldap.c (get_ent_adds, get_ent_mods, lu_ldap_set)
(lu_ldap_del, lu_ldap_handle_lock, lu_ldap_is_locked)
(lu_ldap_setpass): Use lu_strdup_value () instead of
value_as_string ().
(value_as_string): Removed function.
* modules/sasldb.c (lu_sasldb_user_munge, lu_sasldb_user_is_locked):
Use lu_strdup_value ().
2004-11-03 Miloslav Trmac <mitr@redhat.com>
* apps/apputil.c (lu_mailspool_create_remove)
* apps/lchfn.c (main)
* apps/lchsh.c (main)
* apps/lid.c (main)
* modules/files.c (lu_shadow_user_lookup_id, lu_shadow_group_lookup_id)
(format_generic, generic_mod, generic_del): Use lu_strdup_value ().
* lib/misc.c (lu_strdup_value): New function.
* lib/user.h: Add declaration.
* docs/reference/tmpl/entity.sgml
* docs/reference/libuser-sections.txt: Document lu_strdup_value ().
2004-11-02 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.52.6.
* NEWS: Update.
2004-11-01 Miloslav Trmac <mitr@redhat.com>
* modules/sasldb.c (lu_sasldb_user_lookup_name, lu_sasldb_user_munge)
(lu_sasldb_user_is_locked): Remove assertions on possible error codes,
undocumented codes happen too.
* modules/sasldb.c (libuser_sasldb_init): Fix self-describing module
name.
* modules/sasldb.c (lu_sasldb_user_removepass)
(lu_sasldb_group_removepass): New functions
(libuser_sasldb_init): Set the user_removepass and group_removepass
handlers.
* lib/modules.c (lu_modules_load): Don't close a NULL handle.
* modules/sasldb.c (lu_sasldb_user_add): Return TRUE on success.
* configure.in
* modules/sasldb.c (lu_sasldb_user_lookup_name, lu_sasldb_user_munge)
(libuser_sasldb_init): Use Cyrus SASL v2.
* modules/ldap.c (bind_server): Don't attempt to bind using NULL bind
DN.
* modules/ldap.c (bind_server): Report at least the first encountered
bind error.
2004-10-30 Miloslav Trmac <mitr@redhat.com>
* apps/lchfn.c (main)
* apps/lchsh.c (main)
* apps/lnewusers.c (main)
* samples/enum.c (main)
* samples/testuser.c (main): Output error messages on stderr.
* apps/lchfn.c (main): Exit if specified user does not exist.
* apps/lnewusers.c (main): Don't attempt to act on improperly formatted
lines.
* po/POTFILES.in: Add missing files.
* modules/ldap.c (lu_ldap_set, lu_ldap_del): Remove superfluous '\n'
and '.\n' at message ends.
* apps/lgroupadd.c (main)
* apps/lgroupdel.c (main)
* apps/lgroupmod.c (main)
* apps/lchage.c (main)
* apps/lchfn.c (main)
* apps/lchsh.c (main)
* apps/lid.c (main)
* apps/lnewusers.c (main)
* apps/luseradd.c (main)
* apps/luserdel.c (main)
* apps/lusermod.c (main)
* python/admin.c (libuser_admin_do_wrap, libuser_admin_setpass):
* samples/enum.c (main):
* samples/homedir.c (main):
* samples/lookup.c (main):
* samples/testuser.c (main): Use lu_strerror () instead of
(error ? error->string : _("unknown error")). Report error cause in
more error messages.
* apps/lchsh.c (main): Report error if shell was not changed.
* modules/ldap.c (lu_ldap_set, lu_ldap_handle_lock)
(lu_ldap_setpass)
* modules/files.c (set_default_context, reset_default_context)
(generic_setpass)
* lib/config.c (lu_cfg_init)
* apps/apputil.c (lu_authenticate_unprivileged): Mark strings for
translation.
* lib/util.c (lu_util_line_get_matchingx): Fix memory leak.
2004-10-14 Miloslav Trmac <mitr@redhat.com>
* lib/error.h (LU_ERROR_CHECK): Add missing '\n'.
2004-10-11 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.52.5.
* NEWS: Update.
* python/admin.c (libuser_admin_add_user)
(libuser_admin_modify_user)
(libuser_admin_delete_user): Fix memory leak.
* python/admin.c (libuser_admin_add_user)
(libuser_admin_delete_user): Fix reference counting.
* python/modules.txt: Fix modifyUser documentation about not creating
home directory by default.
* python/admin.c (libuser_admin_modify_user): Pass original entity
to libuser_admin_move_home().
2004-10-10 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.52.4.
* NEWS: Update.
* python/misc.c (libuser_prompt_destroy): Fix memory leak.
(libuser_admin_python_prompter): Properly copy struct libuser_prompt
to avoid double free().
* python/admin.c (libuser_admin_enumerate_users)
(libuser_admin_enumerate_groups)
(libuser_admin_enumerate_users_by_group)
(libuser_admin_enumerate_groups_by_user): Fix memory leaks.
* python/admin.c (libuser_admin_enumerate_users_full)
(libuser_admin_enumerate_groups_full)
(libuser_admin_enumerate_users_by_group_full)
(libuser_admin_enumerate_groups_by_user_full)
* python/ent.c (convert_value_array_pylist)
(libuser_entity_getattrlist):
* python/libusermodule.c (libuser_get_user_shells):
* python/misc.c (libuser_admin_python_prompter): Fix memory leaks.
2004-10-09 Miloslav Trmac <mitr@redhat.com>
* lib/entity.c (lu_ent_free): Fix memory leak.
* modules/files.c (generic_add): Fix memory leak.
* lib/user.c (merge_ent_array_duplicates): Remove fflush (from
debugging?).
* modules/files.c (lu_files_enumerate_full): Fix memory leak.
2004-09-29 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.52.3.
* NEWS: Update.
* Makefile.am: Readd -D_LIBUSER_MODULE for modules.
2004-09-28 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.52.2.
* NEWS: Update.
* modules/ldap.c (lu_ldap_set): Beautify debug messages.
* modules/ldap.c (connect_server): Allow ldap URIs, don't require TLS
for servers specified by URIs.
* docs/sgml/libuser.sgml: Document URI support.
2004-09-27 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.52.1.
* NEWS: Update.
* modules/files.c (set_default_context): Make sure *prev_context is
always initialized.
2004-09-27 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.52.
* autogen.sh: Create the `admin' subdirectory if needed.
* Makefile.am (CVSTAG): Fix definition.
* Makefile.am (archive): Ship with formatted documentation.
* configure.in: Define AC_CONFIG_AUX_DIR.
* configure.in: Remove various unneeded parts.
* configure.in, Makefile.am: Use automake conditionals instead of
MODULES.
* Makefile.am (TESTS): Define only if LDAP.
* Makefile.am: Use AM_CPPFLAGS to eliminate the most redundant lines.
* Makefile.am (uninstall-local): Fix typo.
* Makefile.am: Link exactly with needed libraries.
* docs/sgml/Makefile.am: Merge with docs/Makefile.am.
* Makefile.am (CVSTAG): Define portably.
* configure.in: Use new-style AC_INIT and AM_INIT_AUTOMAKE.
Set automake options `subdir-objects' and `-Wall'.
* modules/ldap.c (lu_ldap_lookup): Silence gcc warning.
* apps/Makefile.am, lib/Makefile.am, modules/Makefile.am,
samples/Makefile.am: Merge with top-level Makefile.am.
* apps/lchage.c, apps/lchfn.c, apps/lgroupadd.c, apps/lgroupdel.c,
apps/lgroupmod.c, apps/lid.c, apps/lnewusers.c, apps/lpasswd.c,
apps/luseradd.c, apps/luserdel.c, apps/lusermod.c, samples/enum.c,
python/admin.c, python/ent.c, python/misc.c, python/libusermodule.c,
python/quotamodule.c, samples/field.c, samples/homedir.c,
samples/lookup.c, samples/quotaq.c, samples/prompt.c,
samples/testuser.c: Change path of config.h.
* NEWS: Update.
* tests/ldap_test.py (Tests.testUserDel, Tests.testUserLock1)
(Tests.testUserLock2, Tests.testUserUnlock1)
(Tests.testUserUnlock2, Tests.testUserIslocked1)
(Tests.testUserIslocked2, Tests.testUserSetpass1)
(Tests.testUserSetpass2, Tests.testUserSetpass3)
(Tests.testUserRemovepass1, Tests.testUserRemovepass2)
(Tests.testUserRemovepass3, Tests.testUsersEnumerate)
(Tests.testUsersEnumerateByGroup1)
(Tests.testUsersEnumerateByGroup2)
(Tests.testUsersEnumerateByGroup3, Tests.testUsersEnumerateFull)
(Tests.testGroupLookupName, Tests.testGroupLookupId)
(Tests.testGroupAdd1, Tests.testGroupAdd2, Tests.testGroupMod1)
(Tests.testGroupMod2, Tests.testGroupDel, Tests.testGroupLock1)
(Tests.testGroupLock2, Tests.testGroupUnlock1)
(Tests.testGroupUnlock2, Tests.testGroupIsLocked1)
(Tests.testGroupIsLocked2, Tests.testGroupSetpass1)
(Tests.testGroupSetpass2, Tests.testGroupSetpass3)
(Tests.testGroupRemovepass1, Tests.testGroupRemovepass2)
(Tests.testGroupRemovepass3, Tests.testGroupsEnumerate)
(Tests.testGroupsEnumerateByUser1)
(Tests.testGroupsEnumerateByUser2)
(Tests.testGroupsEnumerateByUser3, Tests.testGroupsEnumerateFull):
New tests.
* tests/ldap_test.py (Tests.testUserAdd2, Tests.testUserMod2): Update
for final password entity model.
* modules/ldap.c (lu_ldap_is_locked): Remove unneeded parameter `type'.
All callers changed.
* tests/ldap_test: Clean up after running the tests.
* tests/ldap_test.py: Workaround openssl's inability to handle
repeated library loading and unloading.
* modules/ldap.c (lu_ldap_groups_enumerate_by_user): Don't consider
all string representations of numbers invalid.
(lu_ldap_groups_enumerate_by_user): Don't free data owned by the
entity.
* lib/user.c (run_single): Don't run user_removepass when
group_removepass is wanted.
* modules/ldap.c (lu_ldap_group_removepass): Implement.
* modules/ldap.c (lu_ldap_is_locked): Use LU_GROUPPASSWORD and
POSIXGROUP for groups.
* modules/ldap.c (lu_ldap_setpass): Don't attempt to remove the
attribute if it does not exist.
(lu_ldap_setpass): Use LU_GROUPPASSWORD for groups.
* modules/ldap.c (lu_ldap_handle_lock): Use LU_GROUPPASSWORD for
groups.
* modules/ldap.c (ldap_attribute_map): Remove LU_SHADOWPASSWORD.
(get_ent_adds): Skip LU_SHADOWPASSWORD. It should be completely
ignored now.
* python/libusermodule.c (initlibuser): Fix libuser.GROUPPASSWORD.
2004-09-26 Miloslav Trmac <mitr@redhat.com>
* lib/user.c (lu_end): Fix memory leak.
* modules/ldap.c (lu_ldap_ent_to_dn): Remove parameter `applicability'.
All callers changed.
* modules/ldap.c (lu_ldap_fudge_objectclasses): Use the mod_values
macro.
(ldap_attribute_map): Make members point to constant strings.
Casts added to users where needed.
(lu_ldap_user_attributes, lu_ldap_group_attributes): Make it a constant
array of constant strings.
(libuser_ldap_init): Store converted pointers to data that will be
eventually freed as part of the context.
(lu_ldap_lookup): Use mapped_user_attributes, mapped_group_attributes.
(map_from_ldap): Remove.
(lu_ldap_close_module): Free mapped_user_attributes,
mapped_group_attributes.
2004-09-25 Miloslav Trmac <mitr@redhat.com>
* modules/ldap.c (lu_ldap_needed_objectclasses): s/User/Entity/g
(lu_ldap_needed_objectclasses): Fix debugging printout.
(lu_ldap_needed_objectclasses): Ignore attributes not applicable to
given entity type.
* modules/ldap.c (ldap_attribute_map): Remove mapping for
LU_ADMINISTRATORNAME.
(SHADOWGROUP): Remove.
* python/admin.c (libuser_admin_removepass_user)
(libuser_admin_removepass_group): Throw exception on error.
* modules/ldap.c (lu_ldap_user_removepass): Implement.
* modules/ldap.c (lu_ldap_is_locked): Fix memory leak.
(lu_ldap_is_locked): Map libuser attribute names to LDAP names.
* modules/ldap.c (lu_ldap_setpass): Initialize addvalues[0] and
rmvalues[0] even if the original password is already encrypted.
(lu_ldap_setpass): Map libuser attribute names to LDAP names.
(lu_ldap_setpass): Remove (maybe all) values before adding new values.
(lu_ldap_setpass): Fix memory leak.
* modules/ldap.c (lu_ldap_handle_lock): Don't skip LU_CRYPTED twice.
(lu_ldap_handle_lock): Fix memory leaks.
(lu_ldap_handle_lock): Don't remove and add the same value.
(lu_ldap_handle_lock): Avoid unnecessary g_malloc0()/g_free() pair.
(lu_ldap_handle_lock): Don't drop LU_CRYPTED when unlocking unlocked
account.
(lu_ldap_handle_lock): Don't lock locked accounts again.
* modules/ldap.c (lu_ldap_user_attributes): Drop LU_SHADOWPASSWORD.
(get_ent_adds): Drop LU_SHADOWPASSWORD, not LU_USERPASSWORD.
* modules/ldap.c (lu_ldap_set): Remove parameter `attributes'. All
callers changed.
2004-09-24 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.51.12.
* Makefile.am: Remove the spec file and "release" tagging from CVS,
rework the spec file a bit.
* configure.in: Don't create libuser.spec.
* NEWS: Move data from libuser.spec.in.
* libuser.spec.in: Remove.
* tests/ldap.conf.in, tests/ldaprc, tests/ldap_skel.ldif,
tests/ldap_test.py, tests/slapd.conf.in: New files
* Makefile.am (TESTS, EXTRA_DIST): Use and distribute tests.
* python/ent.c (libuser_entity_set): Don't both return success and
indicate error at the same time.
* python/ent.c (libuser_entity_set_item): Don't clear the entity
if the new value has invalid type.
* modules/files.c (generic_lookup): Fix memory leak.
* python/ent.c (libuser_convert_to_value): Fix memory leak.
* modules/ldap.c (get_ent_mods, lu_ldap_set): Special-case entry
renaming.
(lu_ldap_set): Fix desired RDN computation in rename.
* modules/ldap.c (lu_ldap_set): Use the original name when
looking up the DN of an entry that is being renamed.
2004-09-23 Miloslav Trmac <mitr@redhat.com>
* configure.in: Version 0.51.11.
* libuser.conf.in: Avoid mentioning /usr/lib* in config file.
2004-09-21 Miloslav Trmac <mitr@redhat.com>
* modules/ldap.c (lu_ldap_set): New parameter `add'. All callers
changed.
* modules/ldap.c (get_ent_mods): Simplify somewhat.
* modules/ldap.c (objectclass_present, lu_ldap_needed_objectclasses)
(get_ent_adds): Split and customize/fix from
lu_ldap_fudge_objectclasses ().
(lu_ldap_fudge_objectclasses): Use lu_ldap_needed_objectclasses ().
* modules/ldap.c (ACCOUNT): New macro.
(SHADOWACCOUNT): Define as "shadowAccount" again.
* modules/ldap.c (ldap_attribute_map): Remove unused member
`ldap_attribute_key'.
* modules/ldap.c (lu_ldap_user_lookup_name, lu_ldap_user_lookup_id):
Add LU_LDAP_SHADOW to `applicability' argument.
* python/libusermodule.c (initlibuser): Add missing attribute names.
2004-09-19 Miloslav Trmac <mitr@redhat.com>
* python/admin.c (libuser_admin_setattr): Fix reference counting.
2004-09-18 Miloslav Trmac <mitr@redhat.com>
* python/misc.c (libuser_admin_python_prompter, libuser_admin_prompt):
Fix reference counting.
* modules/ldap.c (libuser_ldap_init): Don't set error when it was
already set.
2004-09-17 Miloslav Trmac <mitr@redhat.com>
* modules/ldap.c (value_compare): Make sense of comparison same for
longs and strings.
* modules/ldap.c (lu_ldap_ent_to_dn, libuser_ldap_init):
Fix memory leaks.
* modules/ldap.c (libuser_ldap_init, bind_server): Respect bind_simple
and bind_sasl.
2004-09-20 Miloslav Trmac <mitr@redhat.com>
* apps/lchfn.1, apps/lchsh.1: New files.
* apps/Makefile.am (dist_man_MANS): Distribute new man pages.
|