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
|
2008-12-31 Christopher Faylor <me+cygwin@cgf.cx>
* include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 191.
2008-12-31 Christopher Faylor <me+cygwin@cgf.cx>
* glob_pattern_p.cc: New file.
* Makefile.in (DLL_OFILES): Add glob_pattern_p.o.
* glob.h: Add declaration for glob_pattern_p.
* pinfo.cc (pinfo::thisproc): Remove __stdcall attribute.
2008-12-30 Christopher Faylor <me+cygwin@cgf.cx>
* include/bits/wordsize.h: New linux-compatibility header.
2008-12-30 Christopher Faylor <me+cygwin@cgf.cx>
* exceptions.cc (try_to_debug): Avoid creating a huge buffer on the
stack.
2008-12-25 Christopher Faylor <me+cygwin@cgf.cx>
* mount.cc: Change comment.
(smb_extended_info): Move here from path.cc.
(fs_info::update): Ditto.
(mount_info::create_root_entry): Delay conversion to slashes and use
passed in buffer to figure out fs type.
* path.cc (smb_extended_info): Move.
(fs_info::update): Ditto.
* mount.h: New file. Move mount information here.
* path.h: (fs_info::update): Move.
* shared_info.h (mount_item): Ditto.
2008-12-24 Christopher Faylor <me+cygwin@cgf.cx>
* path.cc (symlink_info::check_shortcut): Ensure that symlink handle is
closed on successful return.
2008-12-23 Christopher Faylor <me+cygwin@cgf.cx>
* fhandler.h (fhandler_base_setup_overlapped): Add new argument.
(fhandler_base::get_overlapped_buffer): Declare new function.
(fhandler_base::set_overlapped): Ditto.
(fhandler_pipe::overlapped): New variable.
(fhandler_pipe::get_overlapped): Rework to return contents of
overlapped variable.
(fhandler_pipe::set_overlapped): Set overlapped variable based on
argument.
(fhandler_fifo::get_overlapped_buffer): Return pointer to io_status.
* fhandler.cc (handler_base::setup_overlapped): Set to overlapped
pointer to NULL if new doit parameter is false. Otherwise set up
overlapped event as usual.
(fhandler_base::wait_overlapped): Return inres if this isn't an
overlapped operation.
(fhandler_base::read_overlapped): Remove inappropriate asserts.
* pipe.cc (fhandler_pipe::fhandler_pipe): Zero overlapped element.
(struct pipesync): Delete.
(getov_result): Ditto.
(pipe_handler): Ditto.
(pipesync::pipesync): Ditto.
(fhandler_pipe::init): Don't set up pipesync thread. Just pass
opened_properly flag along to overlapped setup.
2008-12-22 Christopher Faylor <me+cygwin@cgf.cx>
* pipe.cc (getov_result): Minor cleanup.
2008-12-20 Christopher Faylor <me+cygwin@cgf.cx>
* pipe.cc (getov_result): Add parameters to facilitate better EOF
checking.
(pipe_handler): Pass extra arguments to getov_result.
2008-12-20 Christopher Faylor <me+cygwin@cgf.cx>
* fhandler.cc (fhandler_base::wait_overlapped): Reorganize to eliminate
gotos and to hopefully eliminate one race when a signal is detected or
there is a WFMO error.
2008-12-20 Christopher Faylor <me+cygwin@cgf.cx>
* pinfo.h (pinfo::thisproc): Declare. Rename from set_myself.
* pinfo.cc (pinfo::thisproc): Define. Rename from set_myself. Set
procinfo to NULL to avoid confusing subsequent init.
(pinfo_init): Accommodate set_myself -> pinfo::thisproc rename.
* dcrt0.cc (child_info_fork::handle_fork): Ditto.
(child_info_spawn::handle_spawn): Ditto.
2008-12-20 Corinna Vinschen <corinna@vinschen.de>
* pwdgrp.h (pwdgrp::refresh): Fix indentation.
* uinfo.cc (pwdgrp::load): Open file synchronized to avoid truncated
read. Drop local variable off.
2008-12-19 Christopher Faylor <me+cygwin@cgf.cx>
* pinfo.cc (pinfo_basic): New class.
(pinfo_basic::pinfo_basic): Define constructor for new class.
(myself): Initialize from myself_initial.
(set_myself): Set pid and progname from already myself_initial.
* strace.cc (strace::strace): Split apart strace::hello. Send
notification to strace as early as possible.
(strace::hello): Just send clause which describes the current process.
This can now be preceded by early initialization strace output.
* include/sys/strace.h (strace::strace): Declare new constructor.
2008-12-19 Christian Franke <franke@computer.org>
* fhandler_registry.cc (perf_data_files): New table.
(PERF_DATA_FILE_COUNT): New constant.
(fhandler_registry::exists): Add check for HKEY_PERFORMANCE_DATA
value names.
(fhandler_registry::fstat): For HKEY_PERFORMANCE_DATA, return
default values only.
(fhandler_registry::readdir): For HKEY_PERFORMANCE_DATA, list
names from perf_data_files only.
(fhandler_registry::fill_filebuf): Use larger buffer to speed up
access to HKEY_PERFORMANCE_DATA values. Remove check for possible
subkey. Add RegCloseKey ().
(open_key): Replace goto by break, remove label. Do not try to
open subkey of HKEY_PERFORMANCE_DATA. Add missing RegCloseKey ()
after open subkey error.
2008-12-19 Corinna Vinschen <corinna@vinschen.de>
* path.cc (path_conv::check): Handle incoming DOS paths non-POSIXy,
always case-insensitive, always ignoring ACLs.
2008-12-18 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc: Set 4th parameter of NtQueryDirectoryFile to
NULL throughout.
(fhandler_disk_file::facl): Fix a condition so that fstat_by_handle
is actually used.
(fhandler_disk_file::readdir): Don't print debug message on a simple
STATUS_NO_MORE_FILES status code.
2008-12-18 Corinna Vinschen <corinna@vinschen.de>
* path.cc (symlin_info::check): Set 4th parameter of
NtQueryDirectoryFile to NULL instead of 0 since it's a pointer.
Simplify label and break from loop handling in symlink evaluation
conditional expression. Drop a now useless break statement. Fix
behaviour when searching for `foo' and then finding a `foo.lnk'
which is no shortcut.
2008-12-16 Christian Franke <franke@computer.org>
* fhandler_registry.cc (DEFAULT_VALUE_NAME): Remove constant.
(encode_regname): Encode empty (default) name to "@".
Encode "@" to "%40". Change error return to -1.
(decode_regname): Decode "@" to empty name. Decode "%40" to "@".
(fhandler_registry::exists): Skip check for keys if name is empty.
Remove check for DEFAULT_VALUE_NAME, now handled by decode_regname ().
(fhandler_registry::readdir): Remove check for empty name, now
handled by encode_regname ().
(fhandler_registry::open): Remove check for DEFAULT_VALUE_NAME.
(fhandler_registry::open_key): Fail with ENOENT if key name is empty.
2008-12-15 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (gen_full_path_at): Use isabspath instead of isdirsep
to recognize absolute path.
2008-12-15 Corinna Vinschen <corinna@vinschen.de>
* sec_auth.cc (open_local_policy): Set lsa handle to
INVALID_HANDLE_VALUE when LsaOpenPolicy fails. Explain why.
2008-12-15 Corinna Vinschen <corinna@vinschen.de>
* setlsapwd.cc (setlsapwd): Simplify code. Only try to call cygserver
if opening local policy fails. Don't treat removing non-existant
private data as error.
2008-12-15 Corinna Vinschen <corinna@vinschen.de>
* setlsapwd.cc (setlsapwd): Explicitely erase password buffer content
after usage.
2008-12-15 Corinna Vinschen <corinna@vinschen.de>
* fhandler_registry.cc (fhandler_registry::exists): Handle EACCES.
(fhandler_registry::open): Ditto.
2008-12-15 Corinna Vinschen <corinna@vinschen.de>
* cygwin.din: Export fgetwc, fgetws, fputwc, fputws, fwide, getwc,
getwchar, putwc, putwchar, ungetwc.
* posix.sgml: Move above functions (add missing) into "implemented
SUSv3" section.
* include/cygwin/version.h: Bump api minor number.
2008-12-15 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (class fhandler_registry): Declare dup method.
* fhandler_registry.cc (fhandler_registry::exists): Fix missing
parenthesis.
(fhandler_registry::dup): New method.
2008-12-14 Christopher Faylor <me+cygwin@cgf.cx>
* fhandler_disk_file.cc (readdir_get_ino): Don't complain about MS-DOS
paths since the function could be fed one by an internal call.
2008-12-13 Christopher Faylor <me+cygwin@cgf.cx>
* cygheap.cc (cygheap_user::~cygheap_user): Remove unneeded if 0'ed
code.
* fhandler_registry.cc (fhandler_registry::exists): Recode goto as
if/else to avoid a gcc4 compiler warning.
(fhandler_registry::open): Ditto. Use one goto rather than two.
* gentls_offsets: Fix compiler warning in generated output.
* tlsoffsets.h: Regenerate.
* mount.cc (fillout_mntent): slashify native paths returned via
getmntent.
2008-12-08 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* resolv.h: #include <netinet/in.h> for sockaddr_in typedef.
2008-12-07 Christian Franke <franke@computer.org>
* fhandler_registry.cc (encode_regname): Add Parameter add_val.
Append "%val" if add_val is set.
(decode_regname): Remove trailing "%val". Change returncode accordingly.
(__DIR_hash): New class.
(d_hash): New macro.
(key_exists): New function.
(fhandler_registry::exists): Remove encode of registry name before path
compare, decode file part of path instead. Skip checks for keys if
trailing "%val" detected.
(fhandler_registry::fstat): Change check of return value of
decode_regname ().
(fhandler_registry::readdir): Allocate __DIR_hash. Record key names in
hash table. Append "%val" if key with same name exists. Fix error
handling of encode_regname (). Set dirent.d_type.
(fhandler_registry::closedir): Delete __DIR_hash.
(fhandler_registry::open): Don't open key if trailing "%val" detected
by decode_regname ().
(open_key): Ditto.
2008-12-03 Pierre A. Humblet <Pierre.Humblet@ieee.org>
* libc/minires.c (open_sock): Set non blocking and close on exec.
(res_ninit): Set id pseudo-randomly.
(res_nsend): Do not set close on exec. Initialize server from id.
Flush socket. Tighten rules for answer acceptance.
(res_nmkquery): Update id using current data.
2008-12-02 Corinna Vinschen <corinna@vinschen.de>
* fhandler_registry.cc (must_encode): Fix condition changed for testing.
2008-12-01 Christian Franke <franke@computer.org>
* fhandler_registry.cc (must_encode): New function.
(encode_regname): Ditto.
(decode_regname): Ditto.
(fhandler_registry::exists): Encode name before path compare.
(fhandler_registry::fstat): Pass decoded name to win32 registry call.
(fhandler_registry::readdir): Return encoded name to user.
(fhandler_registry::open): Store decoded name into value_name.
(open_key): Pass decoded name to win32 registry call
2008-11-28 Christopher Faylor <me+cygwin@cgf.cx>
* exceptions.c (sigpacket::process): Set tls on return since it is
assumed to be set to a valid value by the caller.
2008-11-28 Christopher Faylor <me+cygwin@cgf.cx>
* include/cygwin/version.h: Bump api minor number to 189 to flag the
implementation of dirent.d_type.
2008-11-28 Christopher Faylor <me+cygwin@cgf.cx>
* exceptions.cc (sigpacket::process): Rework previous change. tls
could still become NULL.
2008-11-28 Christian Franke <franke@computer.org>
* dir.cc (readdir_worker): Initialize dirent.d_type and __d_unused1.
* fhandler_disk_file.cc (fhandler_disk_file::readdir_helper):
Set dirent.d_type based on FILE_ATTRIBUTE_*.
* include/sys/dirent.h: Define _DIRENT_HAVE_D_TYPE (enables DT_*
declarations).
(struct dirent): Add d_type. Adjust __d_unused1 size to preserve layout.
2008-11-27 Christopher Faylor <me+cygwin@cgf.cx>
* exceptions.cc (sigpacket::process): Make sure that 'tls' is never
NULL when used.
2008-11-26 Christopher Faylor <me+cygwin@cgf.cx>
Remove unneeded whitespace throughout.
* fhandler_fifo.cc (fhandler_fifo::open): Rework to cause errno to be
set to ENXIO when opening a fifo write/nonblocking.
* environ.cc (ucreqenv): Rename to ucenv. Move code from old ucenv
here and conditionalize it on create_upcaseenv.
(ucenv): Delete.
(environ_init): Fix compiler warning by moving create_upcaseenv test to
ucenv. Don't bother checking for child_proc_info when calling ucenv
since it is assumed to be NULL at the point where the function is
called.
* path.cc (symlink_worker): Turn off MS-DOS path warnings when dealing
with devices since the device handler passes in a translated MS-DOS
path.
* sec_auth.cc (lsaprivkeyauth): Avoid variable initialization which
causes a compiler error.
* fhandler_netdrive.cc: Update copyright.
2008-11-26 Corinna Vinschen <corinna@vinschen.de>
* Makefile.in (DLL_OFILES): Add setlsapwd.o.
* cygserver.h (CYGWIN_SERVER_VERSION_API): Bump.
(request_code_t): Define CYGSERVER_REQUEST_SETPWD request type.
* cygserver_msg.h (client_request_msg::retval): Use default value of -1
for retval if msglen is 0.
* cygserver_sem.h (client_request_sem::retval): Ditto.
* cygserver_shm.h (client_request_shm::retval): Ditto.
* cygserver_setpwd.h: New file.
* external.cc (cygwin_internal): Implement new CW_SET_PRIV_KEY type.
* sec_auth.cc (open_local_policy): Make externally available.
Get ACCESS_MASK as argument.
(create_token): Accommodate change to open_local_policy.
(lsaauth): Ditto.
(lsaprivkeyauth): New function fetching token by retrieving
password stored in Cygwin or Interix LSA private data area and
calling LogonUser with it.
* security.h (lsaprivkeyauth): Declare.
(open_local_policy): Declare.
* setlsapwd.cc: New file implementing setting LSA private data password
using LsaStorePrivateData or by calling cygserver if available.
* syscalls.cc (seteuid32): Add workaround to get the original token
when switching back to the original privileged user, even if
setgroups group list is still active. Add long comment to explain why.
Call lsaprivkeyauth first, only if that fails call lsaauth or
create_token.
* include/cygwin/version.h: Bump API minor number.
* include/sys/cygwin.h (cygwin_getinfo_types): Add CW_SET_PRIV_KEY.
2008-11-21 Corinna Vinschen <corinna@vinschen.de>
* fhandler_floppy.cc (fhandler_dev_floppy::raw_read): Drop
initialization of bytes_to_read. Set bytes_to_read to len in
non-buffered case. Call read_bytes correctly with bytes_to_read
instead of len.
2008-11-21 Corinna Vinschen <corinna@vinschen.de>
* mmap.cc (MapView): Add NT status to debug output.
2008-11-11 Corinna Vinschen <corinna@vinschen.de>
* autoload.cc (GetSystemDEPPolicy): Define.
(GetProcessDEPPolicy): Ditto.
(SetProcessDEPPolicy): Ditto.
* dcrt0.cc (disable_dep): New static function.
(dll_crt0_0): Call disable_dep on platforms requiring it. Add longish
comment to explain the circumstances.
* wincap.h (wincaps::ts_has_dep_problem): New element.
* wincap.cc: Implement above element throughout.
(wincapc::init): Set ts_has_dep_problem to true on 2008 Terminal
Servers.
* winsup.h (WINVER): Set to 0x0601.
2008-11-11 Corinna Vinschen <corinna@vinschen.de>
* mount.cc (mount_info::cygdrive_win32_path): Always upper case
DOS drive letter to accommodate case sensitivity.
(cygdrive_getmntent): Ditto.
* path.cc (path_conv::check): Invalidate wide_path after making path
relative.
2008-11-11 Corinna Vinschen <corinna@vinschen.de>
* environ.cc (create_upcaseenv): New static variable.
(renv_arr): New static array to keep track of environment variables
which have to be always uppercased.
(idx_arr): Ditto.
(start_at): Ditto.
(ucreqenv): New function to uppercase only the environment variables
from renv_arr.
(parse_thing): Add "upcaseenv" setting.
(environ_init): Parse $CYGWIN before doing anything else. Call
ucreqenv instead of ucenv if CYGWIN=noupcaseenv is set.
2008-11-10 Christopher Faylor <me+cygwin@cgf.cx>
* path.cc (normalize_win32_path): Don't add a trailing '\' if the cwd
returns a path with a trailing '\'.
2008-11-07 Christopher Faylor <me+cygwin@cgf.cx>
* pthread.cc (pthread_mutex::_unlock): Avoid unlocking a mutex if the
recursion_counter is already 0.
(pthread_mutex::_destroy): Don't consider a mutex busy if its
recursion_counter == 0.
(pthread_mutex::_fixup_after_fork): Set recursion_counter to 0 to flag
that we've just forked. Don't reset the owner of this mutex since the
forkee may think it still owns the mutex. Reinstate initialization of
win32_obj_id.
* fhandler_floppy.cc (fhandler_dev_floppy::raw_read): Initialize a
variable to bypass a C++ warning.
2008-11-05 Corinna Vinschen <corinna@vinschen.de>
* environ.cc (environ_init): Avoid evaluating $CYGWIN twice.
2008-10-23 Corinna Vinschen <corinna@vinschen.de>
* wincap.cc (all wincaps): Store in .cygwin_dll_common section same as
wincap. Add comment to explain why.
2008-10-22 Corinna Vinschen <corinna@vinschen.de>
* autoload.cc (GetSystemWindowsDirectoryW): Define.
* kernel32.cc (GetWindowsDirectoryW): Implement to abstract from
running under Terminal Services or not.
(GetWindowsDirectoryA): Ditto.
2008-10-21 Corinna Vinschen <corinna@vinschen.de>
* passwd.cc (pwdgrp::read_passwd): Check if we're called within
user_shared initialization and ignore myself, if so. Reformat
conditional expression.
2008-10-20 Corinna Vinschen <corinna@vinschen.de>
* ntdll.h (NtSetAttributesFile): New inline function.
* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Use
NtSetAttributesFile.
* path.cc (symlink_worker): Ditto.
* syscalls.cc (unlink_nt): Ditto.
(rename): Omit FILE_SHARE_DELETE when opening files on Samba. Add
comment to explain why.
2008-10-17 Corinna Vinschen <corinna@vinschen.de>
* dtable.cc (dtable::get_debugger_info): Call SetStdHandle
for the newly opened handle. Explain why.
(dtable::stdio_init): Don't duplicate standard error handle
when stderr has already been created under debugger control.
2008-10-13 Corinna Vinschen <corinna@vinschen.de>
* sec_acl.cc (setacl): Align standard owner and group permissions
with alloc_sd. Strip FILE_READ_ATTRIBUTES fromn setting
FILE_GENERIC_EXECUTE permissions same as in alloc_sd.
* security.cc (alloc_sd): Reformat expression. Strip EA permission
bits from owner_deny and group_deny computation.
2008-10-09 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_base::fstat_helper): Check
for executable suffixes here in case we're on a file system
not supporting permission.
* path.cc (path_conv::check): Drop check for executable suffixes.
2008-10-09 Corinna Vinschen <corinna@vinschen.de>
* fhandler_floppy.cc (fhandler_dev_floppy::raw_read): Keep track of
current position in non-buffered case, too.
2008-10-09 Corinna Vinschen <corinna@vinschen.de>
* grp.cc (pwdgrp::read_group): Generate more speaking group name
if passwd gid exists under different gid in /etc/group.
2008-10-09 Corinna Vinschen <corinna@vinschen.de>
* path.cc (path_conv::is_binary): Always check for GetBinaryType.
* syscalls.cc (rename): Fix test for just changing case of name on
case insensitive filesystems.
2008-10-09 Corinna Vinschen <corinna@vinschen.de>
* path.cc (symlink_info::check_shortcut): Don't check for executability
here.
(symlink_info::check_sysfile): Ditto.
2008-10-08 Corinna Vinschen <corinna@vinschen.de>
* path.cc (path_conv::check): Only assume executability by suffix
on file systems not supporting permissions.
2008-10-07 Christopher Faylor <me+cygwin@cgf.cx>
* pthread.cc (pthread_create): Very minor formatting change.
* timer.cc (timer_thread): Ensure that any created thread defaults to
detached state.
2008-10-06 Christopher Faylor <me+cygwin@cgf.cx>
* cygtls.h (_cygtls::initialized): Remove bogus stack check which would
crash when checking the current thread from the current thread.
* tlsoffsets.h: Regenerate.
2008-10-05 Christopher Faylor <me+cygwin@cgf.cx>
* dcrt0.cc (dll_crt0_0): Don't initialize signals early when
dynamically loaded.
(dll_crt0_1): Wait until this phase to initialize signals when
dynamically loaded.
2008-09-29 Christopher Faylor <me+cygwin@cgf.cx>
* thread.cc (pthread_mutex::_fixup_after_fork): Reinstate DEBUGGING
conditional.
2008-09-29 Christopher Faylor <me+cygwin@cgf.cx>
* thread.cc (pthread_mutex::_fixup_after_fork): Just reset lock to
pristine state after fork. Don't recreate a mutex since it may not
actually be needed.
2008-09-29 Corinna Vinschen <corinna@vinschen.de>
* flock.cc (inode_t::get_all_locks_list): Fix typo.
* posix.sgml: Add cfmakeraw to list of implemented BSD functions.
2008-09-19 Eric Blake <ebb9@byu.net>
* errno.cc (_sys_errlist): Add ECANCELED, ENOTRECOVERABLE,
EOWNERDEAD.
2008-09-15 Christopher Faylor <me+cygwin@cgf.cx>
* cygtls.h (unionent): Move from net.cc.
(unionent::struct_type): Move enum here.
(_local_storage::hostent_buf): Define as unionent.
(_local_storage::protoent_buf): Ditto.
(_local_storage::servent_buf): Ditto.
* net.cc (unionent): Move to cygtls.h.
(struct_type): Ditto.
(dup_ent): Define one function per {host,proto,serv}ent type.
(cygwin_getprotobyname): Simplify dup_ent call. Removed now-unneeded
return type coercion.
(cygwin_getprotobynumber): Ditto.
(cygwin_getservbyname): Ditto.
(cygwin_getservbyport): Ditto.
(cygwin_gethostbyname): Ditto.
(cygwin_gethostbyaddr): Ditto.
tlsoffsets.h: Regenerate.
2008-09-12 Christopher Faylor <me+cygwin@cgf.cx>
* Makefile.in: Add -c option which is now removed from COMPILE_C*.
* cygwin.din (cfmakeraw): Export.
* termios.cc (cfmakeraw): Implement.
* include/sys/termios.h (cfmakeraw): Declare.
* include/cygwin/version.h (CYGWIN_VERSION_API_MINOR): Bump.
2008-09-11 Christopher Faylor <me+cygwin@cgf.cx>
* cygwin.din (sys_sigabbrev): Add this here.
* dcrt0.cc (__argc,__argv,_check_for_executable): Remove dllexport
decoration since it is already handled in cygwin.din.
* errno.cc (_sys_errlist): Ditto.
* strsig.cc (sys_sigabbrev): Ditto.
* include/cygwin/signal.h: Protect use of dllimport when
__INSIDE_CYGWIN__.
* libc/getopt.c: Revert previous changes. Define __INSIDE_CYGWIN__.
2008-09-11 Christopher Faylor <me+cygwin@cgf.cx>
* localtime.cc (increment_overflow): Mark as non-inline to prevent
compiler from complaining about the very thing we're trying to test.
* ntea.cc (read_ea): Reorganize to avoid a new compiler warning/error.
* sched.cc (sched_rr_get_interval): Ditto.
* select.cc (peek_serial): Ditto.
* libc/rexec.cc (ruserpass): Ditto.
* posix_ipc.cc (ipc_names): Make static to avoid a compiler warning
(and it's the right thing to do anyway).
2008-09-11 Christopher Faylor <me+cygwin@cgf.cx>
* net.cc (in6addr_any, in6addr_loopback): Add appropriate number of
braces around initializer.
(dup_ent): Try harder to coerce the first argument to deal with more
stringent compiler.
(get_2k_ifs): Remove extraneous typedef.
(get_2k_ifs): Reorganize expression to avoid a compiler warning.
(get_xp_ifs): Ditto.
(get_nt_ifs): Ditto.
2008-09-11 Christopher Faylor <me+cygwin@cgf.cx>
* fhandler.h (fhandler_pipe::raw_read): Remove __stdcall decoration.
* pipe.cc (fhandler_pipe::raw_read): Ditto.
2008-09-11 Christopher Faylor <me+cygwin@cgf.cx>
* cygheap.cc (creturn): Reorganize to avoid a new compiler
warning/error.
* dtable.cc (handle_to_fn): Ditto.
* fhandler_console.cc (fhandler_console::read): Ditto.
(fhandler_console::scroll_screen): Ditto.
(dev_console::set_color): Ditto.
* fhandler_dsp.cc (fhandler_dev_dsp::write): Ditto.
(fhandler_dev_dsp::read): Ditto.
* fhandler_tape.cc (mtinfo_drive::get_status): Ditto.
* hookapi.cc (find_first_notloaded_dll): Ditto.
* mmap.cc (msync): Ditto.
* pipe.cc (pipesync::pipesync): Ditto.
* sec_acl.cc (getace): Ditto.
* sec_auth.cc (create_token): Ditto.
(lsaauth): Ditto.
* select.cc (peek_pipe): Ditto.
* spawn.cc (av::fixup): Ditto.
* syscalls.cc (popen): Ditto.
* tty.cc (tty::init_session): Ditto.
* uinfo.cc (pwdgrp::load): Ditto.
* fhandler.cc (fhandler_base::setup_overlapped): Ditto.
(fhandler_base::wait_overlapped): Rename second use of res variable to
wres or errors are not returned correctly.
* dcrt0.cc: Remove obsolete variable.
* dll_init.cc (release_upto): Fix typo involving incorrect use of '|'.
* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Avoid a
compiler warning regarding coercing type-punned variables.
(fhandler_base::fstat_by_name): Ditto.
* fhandler_fifo.cc (fhandler_fifo::open_nonserver): Fix = vs. == typo.
(fhandler_fifo::wait): Add all conditions to switch statement to avoid
a compiler warning.
* fhandler_process.cc: Avoid unneeded initialization of variables to
zero.
* fhandler_socket.cc (fhandler_socket::listen): Add braces around
initializer.
* flock.cc (inode_t::get_all_locks_list): Reorganize to avoid a
compiler warning. Fix problem with EWOULDBLOCK error return.
* path.cc (GUID_shortcut): Use braces around struct initializer.
(cygwin_conv_path): Reorganize to avoid a compiler warning.
* random.cc (dummy): Mark variable as volatile to avoid a "used
uninitialized" warning.
* libc/getopt.c: Mark some variables as dllexport although gcc doesn't
seem to do the right thing with them.
* libc/minires-os-if.c (get_registry_dns_items): Coerce some function
arguments to avoid a compiler warning.
2008-08-27 Christopher Faylor <me+cygwin@cgf.cx>
* fhandler_tty.cc (close_maybe): Check for both types of invalid handle
before attempting CloseHandle.
(fhandler_pty_master::setup): Only set inheritance on pty handles, not
tty handles.
2008-08-26 Christopher Faylor <me+cygwin@cgf.cx>
* shared_info.h (shared_info::create_root_entry): Remove extraneous
mount_info:: from declaration.
2008-08-26 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (class fhandler_pipe): Rename read and write
declarations to raw_read and raw_write.
* pipe.cc (fhandler_pipe::raw_read): Rename from read.
(fhandler_pipe::raw_write): Rename from write.
2008-08-21 Christopher Faylor <me+cygwin@cgf.cx>
* fhandler.cc (fhandler_base::wait_overlapped): Reorganize again to
accommodate what appears to be an MSDN hint about not resetting the
overlapped event prior to calling GetOverlappedResult.
2008-08-20 Corinna Vinschen <corinna@vinschen.de>
* path.cc (symlink_info::check_shortcut): If file can't be opened,
treat it as non-symlink rather than generating an EIO error.
(symlink_info::check_sysfile): Ditto.
2008-08-19 Christopher Faylor <me+cygwin@cgf.cx>
* fhandler.cc (fhandler_base::wait_overlapped): Always assume that
bytes will be non-NULL. Distinguish input result from result derived
from WFMO and GetOverlappedResult or res can never be -1. Only raise
SIGPIPE when writing.
* fhandler.h (fhandler_base::wait_overlapped): Pass first argument by
value.
* fhandler_fifo.cc (fhandler_fifo::wait): Pass in dummy byte count to
wait_overlapped.
* pipe.cc (DEFAULT_PIPEBUFSIZE): Define to 65536 explicitly.
2008-08-19 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_disk_file::mkdir): Drop fattr variable
and use FILE_ATTRIBUTE_DIRECTORY directly in call to NtCreateFile.
* posix_ipc.cc (ipc_mutex_init): Fix format string when creating IPC
object name.
(ipc_cond_init): Ditto.
* security.cc (alloc_sd): Add parentheses to fix setting initial
owner_allow value.
2008-08-18 Christopher Faylor <me+cygwin@cgf.cx>
* fhandler.cc (fhandler_base::wait_overlapped): Don't treat
ERROR_BROKEN_PIPE as a non-error. Do raise SIGPIPE when it is
detected.
2008-08-15 Corinna Vinschen <corinna@vinschen.de>
* mount.cc (mount_info::get_mounts_here): Don't subtract 2 from
Length if it's 0 anyway.
2008-08-15 Corinna Vinschen <corinna@vinschen.de>
* mount.cc (mount_info::create_root_entry): Create default cygdrive
prefix with MOUNT_NOPOSIX flag.
2008-08-15 Corinna Vinschen <corinna@vinschen.de>
* path.cc (symlink_info::check): Don't use eabuf when trying to open
file a second time. Call NtOpenFile instead of NtCreateFile in this
case.
2008-08-14 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_disk_file::link): Fix linking
against symlinks.
2008-08-14 Corinna Vinschen <corinna@vinschen.de>
* external.cc (cygwin_internal): Call set_security_attribute with
additional path_conv argument.
* fhandler.cc (fhandler_base::open): Ditto.
* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Never set DOS
R/O attribute when using ACLs.
(fhandler_disk_file::mkdir): Ditto. Set
security descriptor on remote dirs after creating the dir, same as in
fhandler_base::open.
* fhandler_socket.cc (fhandler_socket::bind): Ditto for remote AF_LOCAL
socket files.
* path.cc (symlink_worker): Ditto. for remote symlinks.
* security.cc (alloc_sd): Take additional path_conv argument.
Accommodate throughout. Drop setting FILE_WRITE_EA/FILE_READ_EA
flags unconditionally (was only necessary for "ntea"). Don't set
FILE_READ_ATTRIBUTES and FILE_WRITE_ATTRIBUTES unconditionally on
Samba. Add comment to explain. Drop useless setting of
STANDARD_RIGHTS_WRITE, it's in FILE_GENERIC_WRITE anyway.
Remove FILE_READ_ATTRIBUTES bit from FILE_GENERIC_EXECUTE so as not
to enforce read permissions on Samba.
(set_security_attribute): Take additional path_conv argument.
* security.h (set_security_attribute): Change prototype accordingly.
2008-08-13 Corinna Vinschen <corinna@vinschen.de>
* mount.cc (fillout_mntent): Always print noumount option last.
2008-08-13 Corinna Vinschen <corinna@vinschen.de>
* mount.cc (fillout_mntent): Print options as taken in fstab and mount.
2008-08-13 Corinna Vinschen <corinna@vinschen.de>
* dll_init.cc: Throughout convert to use long pathnames.
* dll_init.h (struct dll): Change name to WCHAR, change operator [] to
take PWCHAR argument.
2008-08-11 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (rename): If newpath doesn't exist, check if .exe suffix
in oldpath has been omitted before appending .exe to newpath.
2008-08-09 Corinna Vinschen <corinna@vinschen.de>
* fhandler_floppy.cc (fhandler_dev_floppy::raw_read): Don't set
eom_detected when EOF is detected, thus returning 0 instead of
setting errno to ENOSPC.
2008-08-07 Corinna Vinschen <corinna@vinschen.de>
* fhandler.cc (fhandler_base::open): Use Samba workaround generally
for all remote filesystems supporting ACLs. Change comment and
explain why. Refer to the discussion which led to this.
2008-08-05 Brian Dessent <brian@dessent.net>
* config/i386/profile.h (mcount): Mark asms volatile.
2008-08-05 Christopher Faylor <me+cygwin@cgf.cx>
* dll_init.cc (dll_global_dtors): Add an additional test to avoid
walking the linked list if it is empty.
(dll_list::detach): Don't set dll_global_dtors_recorded if we aren't
actually going to record any dlls.
2008-08-04 Christopher Faylor <me+cygwin@cgf.cx>
Changes suggested by Dave Korn.
* dcrt0.cc (cygwin_exit): Remove (hopefully) extraneous call to
dll_global_dtors.
* dll_init.cc (dll_global_dtors): Run destructors in reverse
dependency/load order.
* dll_init.h (dll_list): Add dll_global_dtors as a friend.
2008-08-01 Christopher Faylor <me+cygwin@cgf.cx>
* dcrt0.cc (dll_crt0_1): Add a symbol denoting return from call to
main().
* exceptions.cc (stack_info::walk): Stop walking the stack when we
hit _cygwin_exit_return rather than just blindly stopping when PC
becomes zero.
2008-07-31 Corinna Vinschen <corinna@vinschen.de>
* path.cc (symlink_info::check): Handle (and explain) a special case
when accessing files matching DOS device names on SMB shares.
2008-07-31 Corinna Vinschen <corinna@vinschen.de>
* spawn.cc (spawn_guts): Check constructed short pathname for being
a DOS device name and fall back to long path name, if so.
2008-07-30 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_base::fstat_by_name): Check for
file systems incapable of handling FileIdBothDirectoryInformation
correctly.
(fhandler_disk_file::opendir): Ditto.
* path.cc (fs_info::update): Always clear at the start.
Rearrange to make certain tests only on non-Samba, non-NFS remote
drives.
Add test for file systems known to be incapable of handling
FileIdBothDirectoryInformation correctly. Right now that's just
"UNIXFS".
* path.h (struct fs_info): Add has_buggy_fileid_dirinfo flag and
accessor methods.
(class path_conv): Add has_buggy_fileid_dirinfo method.
2008-07-30 Corinna Vinschen <corinna@vinschen.de>
* sec_auth.cc (extract_nt_dom_user): Return domain and user name as
WCHAR.
(cygwin_logon_user): Accommodate above change. Convert password to
WCHAR and call LogonUserW.
* external.cc (cygwin_internal): Accommodate above change.
* security.h (extract_nt_dom_user): Change prototype accordingly.
2008-07-30 Christopher Faylor <me+cygwin@cgf.cx>
* cygwin.din (_getutline): Remove.
* lib/bsdlib.cc (login): Make argument const as per linux.
(logout): Ditto.
* syscalls.cc (getutid): Ditto.
(getutline): Ditto.
(pututline): Ditto.
(getutxent): Add comment mentioning non-thread-safety.
(getutxid): Ditto.
(getutxline): Ditto.
(pututxline): Ditto.
* sys/utmp.h: Declare arguments to various functions as const as per
linux. Remove bogus _getutline definition.
2008-07-29 Christopher Faylor <me+cygwin@cgf.cx>
* include/cygwin/version.h: Add comment indicating that current API number
bump also has another consequence.
2008-07-29 Corinna Vinschen <corinna@vinschen.de>
* Makefile.in (DLL_OFILES): Remove v8 regexp files.
(OBSOLETE_FUNCTIONS): Remove v8 regexp functions.
(NEW_FUNCTIONS): Remove POSIX regex functions.
* cygwin.din: Export POSIX regex functions with their correct symbol
name. Export with posix_ prefix for backward compatibility.
* syscalls.cc (regfree): Remove ancient fake function.
* regex/regex.h: Remove renaming regex functions within Cygwin.
* regexp/*: Remove.
* include/cygwin/version.h: Bump API minor number.
2008-07-27 Corinna Vinschen <corinna@vinschen.de>
Christopher Faylor <me+cygwin@cgf.cx>
* dcrt0.cc (dll_crt0_0): Remove calling malloc_init and
user_shared_initialize_1 from here.
(dll_crt0_1): Remove dynamically_loaded check. Just call malloc_init
and user_shared_initialize unconditionally.
* shared.cc (user_shared_create): Rename from user_shared_initialize.
(user_shared_initialize): Rename from user_shared_initialize_1. Move
complete user_shared content initialization code here from
user_shared_create.
* syscalls.cc (seteuid32): Remove call to user_shared_initialize_1.
That is implied by the "true" argument to user_shared_create().
2008-07-27 Christopher Faylor <me+cygwin@cgf.cx>
* mount.cc (mount_info::init): Add location where we're looking for
fstab to temporary message.
* lib/cygwin_crt0.c (cygwin_crt0): Simplify by eliminating
accommodations for ancient cygwin DLLs.
* lib/crt0.h: Include <windows.h> directly since it is needed.
2008-07-27 Christopher Faylor <me+cygwin@cgf.cx>
* shared_info.h (shared_destroy): Declare.
* shared.cc (shared_destroy): Define new function to destroy shared
memory regions.
* init.cc (dll_entry): Call shared_destroy when dll detaches from the
process.
2008-07-27 Corinna Vinschen <corinna@vinschen.de>
* fhandler_socket.cc (fhandler_socket::send_internal): Send never more
then 64K bytes at once. For blocking sockets, loop until entire data
has been sent or an error occurs.
(fhandler_socket::sendto): Drop code which sends on 64K bytes.
(fhandler_socket::sendmsg): Ditto.
2008-07-26 Christopher Faylor <me+cygwin@cgf.cx>
* fhandler_tty.cc (fhandler_pty_master::setup): Reorganize so that all
operations for each end of the pipe are grouped together.
2008-07-25 Corinna Vinschen <corinna@vinschen.de>
* dcrt0.cc (dll_crt0_1): Call malloc_init and user_shared_initialize_1
only in non-dynamically loaded case.
2008-07-25 Corinna Vinschen <corinna@vinschen.de>
* dcrt0.cc (dll_crt0_0): Call malloc_init and user_shared_initialize_1
here in case we're dynamically loaded. Explain why.
(dll_crt0_1): Call user_shared_initialize_1 from here.
* mount.cc (is_native_path): New inline function testing for native
and long Win32 path prefix.
(is_unc_share): Remove long WIn32 path prefix test.
(mount_info::create_root_entry): Use PATH_MAX buffer.
(mount_info::init): Ditto.
(mount_info::add_item): Test for is_native_path as well.
* path.cc (normalize_win32_path): Simplify native path prefix code.
* shared.cc (user_shared_initialize_1): New function taking user
shared initialization code relying on malloc and cygtls.
(user_shared_initialize): Move mountinfo initialization to
user_shared_initialize_1.
* shared_info.h (user_shared_initialize_1): Declare.
* syscalls.cc (seteuid32): Call user_shared_initialize_1 after user
changed.
2008-07-24 Corinna Vinschen <corinna@vinschen.de>
* mount.cc (mount_info::from_fstab): Change system_printf to
debug_printf on NtOpenFile failure.
2008-07-24 Corinna Vinschen <corinna@vinschen.de>
* shared.cc (user_shared_initialize): Fetch potentially changed Cygwin
username from /etc/passwd before loading mount table.
(shared_info::init_installation_root): New function fetching Cygwin's
installation root dir and storing as native NT path in global shared
memory.
(shared_info::initialize): Call init_installation_root exactly once at
first startup.
* shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info.
(CURR_SHARED_MAGIC): Ditto.
(class shared_info): Add installation_root member.
(shared_info::init_installation_root): Declare.
* grp.cc (pwdgrp::read_group): Call pwdgrp::load with native WCHAR path.
* passwd.cc (pwdgrp::read_passwd): Ditto. Avoid recursion.
(etc::init): Take POBJECT_ATTRIBUTES instead of path_conv.
* path.h (etc::init): Change prototype accordingly.
* pwdgrp.h (class pwdgrp): Store path as UNICODE_STRING/PWCHAR instead
of as path_conv.
(pwdgrp::load): Accommodate prototype.
* uinfo.cc (pwdgrp::load): Change argument type from char to wchar_t.
Create native NT path here instead of calling path_conv.
* mount.cc (find_root_from_cygwin_dll): Drop in favor of global
initializaion in shared_info.
(mount_info::init): Fetch native NT root dir from cygwin_shared.
(mount_info::from_fstab): Expect native NT path and use native NT
functions to access file. Convert username part in user fstab path
according to special char transformation rules.
* path.cc (tfx_chars): Convert slash to backslash.
(transform_chars): Implement for path given as PWCHAR.
(transform_chars): PUNICODE_STRING version calls PWCHAR version.
Remove useless commented code.
2008-07-22 Corinna Vinschen <corinna@vinschen.de>
* spawn.cc (spawn_guts): Fix previous patch for UNC paths.
2008-07-22 Corinna Vinschen <corinna@vinschen.de>
* spawn.cc (spawn_guts): Remove long path prefix from win32 path
before calling CreateProcess if path length is < MAX_PATH.
2008-07-22 Corinna Vinschen <corinna@vinschen.de>
* include/ctype.h: Declare __ctype_ptr__ to keep newlib build happy.
2008-07-19 Corinna Vinschen <corinna@vinschen.de>
* autoload.cc (WNetGetProviderNameA): Define.
(WNetGetResourceParentA): Remove.
* fhandler_netdrive.cc (struct net_hdls): New structure to keep
WNet handles. Stored in dir->__handle throughout.
(thread_netdrive): Rewrite to enumerate all servers in all accessible
domains and workgroups.
(fhandler_netdrive::readdir): Simplify toplevel code. Lowercase all
server names in toplevel.
(fhandler_netdrive::rewinddir): Close all WNet handles and free
net_hdls structure.
2008-07-18 Corinna Vinschen <corinna@vinschen.de>
* fhandler.cc (fhandler_base::open): Rename x to fh. On Samba, always
create file with NULL security descriptor and set the permissions
afterwards. Explain why.
2008-07-18 Corinna Vinschen <corinna@vinschen.de>
* environ.cc (known): Remove "binmode" option.
* fhandler.cc (binmode): Remove.
(fhandler_base::set_flags): Accommodate binmode removal.
* path.h (path_conv::set_binary): Remove.
* pipe.cc (pipe): Create pipes always as binary pipes.
* winsup.h (binmode): Remove declaration.
2008-07-17 Corinna Vinschen <corinna@vinschen.de>
* mount.cc (mount_info::from_fstab_line): Default to binary mount.
2008-07-16 Corinna Vinschen <corinna@vinschen.de>
* path.cc (allow_winsymlinks): Revert default to create system bit
symlinks for speed.
2008-07-16 Corinna Vinschen <corinna@vinschen.de>
Add case-sensitivity.
Unconditionally handle mount points case-sensitive.
Unconditionally handle virtual paths case-sensitive.
Unconditionally handle registry paths case-insensitive.
Otherwise, accommodate case-sensitivity of given path throughout.
* cygheap.cc (cygheap_root::set): Get additional caseinsensitive
parameter and store it.
* cygheap.h (struct cygheap_root_mount_info): Add member
caseinsensitive.
* dlfcn.cc (get_full_path_of_dll): Drop PC_NOFULL parameter from call
to path_conv::check.
* environ.cc (pcheck_case): Remove.
(check_case_init): Remove.
(known): Drop "check_case" option.
* exceptions.cc (open_stackdumpfile): Add comment.
* fhandler.cc (fhandler_base::get_default_fmode): Call pathmatch
instead of strcasematch.
* fhandler_disk_file.cc: Accommodate case-sensitivity of given path
throughout.
(__DIR_mounts::check_mount): Unconditionally check virtual paths
case-sensitive.
(fhandler_disk_file::link): Drop case clash handling.
(fhandler_disk_file::open): Ditto.
(fhandler_disk_file::readdir_helper): Drop managed mount code.
* mount.cc: Remove managed mount code and datastructures.
(struct opt): Remove "managed" option. Add "posix=0" and "posix=1"
options.
(fillout_mntent): Remove "managed" output. Add "posix" output.
* path.cc (struct symlink_info): Remove case_clash member and
case_check method.
(pcheck_case): Remove.
(path_prefix_p): Take additional bool parameter "caseinsensitive".
(pathnmatch): Ditto.
(pathmatch): Ditto.
(mkrelpath): Ditto.
(fs_info::update): Set caseinsensitive flag according to file system
name and FILE_CASE_SENSITIVE_SEARCH flag. Add comment.
(tfx_chars_managed): Remove.
(transform_chars): Drop "managed" parameter. Always use tfx_chars.
(get_nt_native_path): Drop "managed" parameter. Make sure drive letters
are always upper case.
(getfileattr): Change second parameter to denote caseinsensitivity.
(path_conv::check): Initialize caseinsensitive to OBJ_CASE_INSENSITIVE.
Set caseinsensitive according to global obcaseinsensitive flag, file
system case sensitivity and MOUNT_NOPOSIX mount flag.
Drop case_clash and all the related code.
(symlink_worker): Drop case clash handling.
(symlink_info::set): Drop setting case_clash.
(symlink_info::case_check): Remove.
(cwdstuff::set): Add comment.
(etc::init): Take path_conv instead of PUNICODE_STRING as parameter to
allow case sensitivity.
* path.h (enum pathconv_arg): Drop PC_SYM_IGNORE.
(enum case_checking): Remove.
(enum path_types): Drop PATH_ENC, add PATH_NOPOSIX flag.
(struct fs_info): Add caseinsensitive flag and accessor methods.
(class path_conv): Add caseinsensitive member and define
objcaseinsensitive method. Drop case_clash member and isencoded method.
(pathmatch): Change prototype according to above change.
(pathnmatch): Ditto.
(path_prefix_p): Ditto.
(get_nt_native_path): Ditto.
(class etc): Ditto.
(fnunmunge): Remove prototype.
* shared.cc (shared_info::init_obcaseinsensitive): Initialize
obcaseinsensitive flag from obcaseinsensitive registry value.
(shared_info::initialize): Call init_obcaseinsensitive here by the
first process creating the shared memory.
* shared_info.h (mount_item::fnmunge): Remove.
(shared_info::obcaseinsensitive): Rename from obcaseinsensitivity.
(shared_info::init_obcaseinsensitive): Declare.
* syscalls.cc (try_to_bin): Add comment.
* include/sys/mount.h (MOUNT_ENC): Remove flag.
(MOUNT_NOPOSIX): Add flag.
2008-07-15 Corinna Vinschen <corinna@vinschen.de>
* fhandler_tape.cc (mtinfo::initialize): Remove synchronization stuff.
Just initialize drive data.
* mtinfo.h (MTINFO_MAGIC): Remove.
(MTINFO_VERSION): Remove.
(class mtinfo): Remove magic and version members.
* shared.cc (shared_info::initialize): Move call to
get_session_parent_dir so that the dir creation is only called once.
Move call to mt.initialize so that it's called only by the first
process creating the shared memory.
* shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info.
(CURR_SHARED_MAGIC): Ditto.
(class shared_info): Add obcaseinsensitivity member.
2008-07-14 Corinna Vinschen <corinna@vinschen.de>
* fhandler.cc (fhandler_base::fpathconf): On _PC_POSIX_PERMISSIONS
and _PC_POSIX_SECURITY, return true for NFS, too.
2008-07-14 Corinna Vinschen <corinna@vinschen.de>
Throughout drop allow_ntsec and allow_smbntsec handling.
* environ.cc (set_ntsec): Remove.
(set_smbntsec): Remove.
(known): Remove ntsec and smbntsec options.
* external.cc (check_ntsec): Return true if no filename is given.
* mount.cc (oopts): Add "acl" and "noacl" options. Set MOUNT_NOACL
flag accordingly.
(fillout_mntent): Handle MOUNT_NOACL flag.
* path.h (enum path_types): Add PATH_NOACL.
* security.cc (allow_ntsec): Remove.
(allow_smbntsec): Remove.
* security.h (allow_ntsec): Drop declaration.
(allow_smbntsec): Drop declaration.
* include/sys/mount.h (MOUNT_NOACL): Define.
2008-07-14 Corinna Vinschen <corinna@vinschen.de>
* miscfuncs.cc (cygwin_strncasecmp): Fix bug which results in
prematurely truncated strings. Simplify target length argument to
sys_mbstowcs.
2008-07-14 Corinna Vinschen <corinna@vinschen.de>
* autoload.cc (GetExtendedTcpTable): Define.
* fhandler_socket.cc (address_in_use): Take const struct sockaddr
pointer as argument. Implement additional AF_INET6 table check.
(fhandler_socket::bind): Drop AF_INET test before calling
address_in_use.
* net.cc (ipv4_getnameinfo): Return EAI_FAMILY instead of 1 if
called with unsupported af_family.
2008-07-12 Eric Blake <ebb9@byu.net>
Fix usage of recently fixed Interlocked* functions.
* winbase.h (ilockincr, ilockdecr, ilockexch, ilockcmpexch): Add
volatile qualifier, to match Interlocked* functions.
2008-07-11 Corinna Vinschen <corinna@vinschen.de>
* select.cc (peek_pipe): Temporarily revert patch from 2008-05-30.
2008-07-11 Corinna Vinschen <corinna@vinschen.de>
Change length for domain buffers from INTERNET_MAX_HOST_NAME_LENGTH to
MAX_DOMAIN_NAME_LEN throughout.
* cyglsa.h (CYG_LSA_MAGIC): New value.
(cyglsa_t): Define username and domain as WCHAR arrays.
* errno.cc (errmap): Add mapping for ERROR_NONE_MAPPED.
* sec_auth.cc: Drop 'w' prefix from WCHAR string variable names where
appropriate.
(extract_nt_dom_user): Prefer resolving by SID before resolving by
domain\name pair.
(cygwin_logon_user): Don't print cleartext password in debug output.
Change comment.
(get_user_groups): Revert calls to LookupAccountNameW to use NULL
server instead of explicit server name, according to MSDN.
(get_user_local_groups): Ditto.
(get_server_groups): Fetch domain and user name from usersid per
LookupAccountSidW instead of calling extract_nt_dom_user.
(lsaauth): Fetch domain and user name from usersid per LookupAccountSidW
instead of calling extract_nt_dom_user.
* sec_helper.cc (cygpriv): Convert to wchar_t pointer array.
(privilege_luid): Convert first parameter to PWCHAR.
(privilege_name): Return wchar_t pointer.
(set_privileges): Accommodate debug output.
* security.h (privilege_luid): Change prototype accordingly.
2008-07-10 Corinna Vinschen <corinna@vinschen.de>
* cyglsa.h (SECURITY_STRING): Define.
(enum _SECPKG_NAME_TYPE): Define.
(struct _SECPKG_CALL_INFO): Define.
(struct _LSA_SECPKG_FUNCS): Extend to full size. Define unused
functions lazily.
(cygprf_t): Define.
* sec_auth.cc (lsaauth): Use actual primary group if no admins group.
Add (disabled) code to fetch token from profil data.
2008-07-09 Corinna Vinschen <corinna@vinschen.de>
* sec_auth.cc (verify_token): Allow builtin groups missing in a token
and it's still valid. Explain why.
2008-07-09 Corinna Vinschen <corinna@vinschen.de>
* autoload.cc (DsGetDcNameW): Replace DsGetDcNameA.
* dcrt0.cc (child_info_spawn::handle_spawn): Drop artificial
supplementary group list from calling setgroups in parent.
* grp.cc (internal_getgroups): Drop 9x-only code. Reformat.
* sec_auth.cc (get_logon_server): Do everything in WCHAR only.
(get_user_groups): Ditto. Use wlogonserver in LookupAccountNameW
calls, too.
(is_group_member): Get logon server as first argument and use in call
to NetLocalGroupGetMembers.
(get_user_local_groups): Get logon server as first argument and use in
calls to NetLocalGroupEnum and LookupAccountNameW. Revamp to work
more correctly in domain environments.
(get_server_groups): Accommodate aforementioned changed function calls.
* security.h (get_logon_server): Change prototype accordingly.
* uinfo.cc (cygheap_user::env_logsrv): Accommodate changed
get_logon_server call.
2008-07-09 Corinna Vinschen <corinna@vinschen.de>
* grp.cc (internal_getgroups): Also add integrity-enabled groups.
2008-07-09 Corinna Vinschen <corinna@vinschen.de>
* sec_auth.cc (verify_token): Disable code which returns false if
the token contains additional groups not requested by setgroups.
Explain why.
2008-07-08 Corinna Vinschen <corinna@vinschen.de>
* fhandler_socket.cc (fhandler_socket::bind): Don't run explicit
local socket test in SO_REUSEADDR case on systems supporting
enhanced socket security. Explain why. Only call address_in_use
for AF_INET sockets.
* net.cc (cygwin_setsockopt): Don't call setsockopt to set SO_REUSEADDR
on systems supporting enhanced socket security. Add comment.
* wincap.h (wincaps::has_enhanced_socket_security): New element.
* wincap.cc: Implement above element throughout.
2008-07-08 Corinna Vinschen <corinna@vinschen.de>
* net.cc (ipv6_inited): Make NO_COPY.
2008-07-02 Corinna Vinschen <corinna@vinschen.de>
* path.cc (path_conv::is_binary): Fix test. Add comment.
2008-06-24 Corinna Vinschen <corinna@vinschen.de>
* net.cc (cygwin_bindresvport_sa): Fix usage of last_used_bindresvport.
2008-06-21 Corinna Vinschen <corinna@vinschen.de>
* include/limits.h (PATH_MAX): Add comment.
* include/cygwin/config.h (__FILENAME_MAX__): Define as 4096. Add
comment.
2008-06-19 Corinna Vinschen <corinna@vinschen.de>
* fhandler_tty.cc (fhandler_pty_master::setup): Fix pipe inheritance.
2008-06-18 Christopher Faylor <me+cygwin@cgf.cx>
* strsig.cc (strsignal): Return non-const buffer to allow building with
recent newlib change.
2008-06-17 Corinna Vinschen <corinna@vinschen.de>
* sec_auth.cc (DsGetDcNameA): Drop declaration.
(DS_FORCE_REDISCOVERY): Drop definition.
2008-06-17 Christopher Faylor <me+cygwin@cgf.cx>
* spawn.cc (spawn_guts): Reinstate call to
fhandler_console::need_invisible since it is required to prevent
console flashing.
2008-06-17 Corinna Vinschen <corinna@vinschen.de>
* include/resolv.h (_getshort): Drop declaration.
(_getlong): Ditto.
2008-06-12 Corinna Vinschen <corinna@vinschen.de>
* mount.cc (mount_info::get_cygdrive_info): Fix usage of user and
system arguments. Strip trailing slash from path for backward
compatibility.
2008-06-12 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (set_console_state_for_spawn): Drop declaration.
* fhandler_console.cc (set_console_state_for_spawn): Remove.
(fhandler_console::open): Set console state last. Don't set
ENABLE_PROCESSED_INPUT flag.
* spawn.cc (spawn_guts): Drop call to set_console_state_for_spawn.
2008-06-11 Corinna Vinschen <corinna@vinschen.de>
* path.cc (get_nt_native_path): Drop considerations for DOS devices.
Keep relative paths relative.
(cygwin_conv_path): Don't try to skip native NT prefixes on relative
paths.
2008-06-11 Corinna Vinschen <corinna@vinschen.de>
* include/cygwin/version.h (CYGWIN_VERSION_MOUNT_REGISTRY): Bump.
(CYGWIN_INFO_CYGWIN_MOUNT_REGISTRY_NAME): Remove.
(CYGWIN_INFO_CYGDRIVE_FLAGS): Remove.
(CYGWIN_INFO_CYGDRIVE_PREFIX): Remove.
(CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX): Add comment to differ from the
registry related defines.
2008-06-11 Corinna Vinschen <corinna@vinschen.de>
* fhandler_procnet.cc (dad_to_flags): Fix comment.
2008-06-10 Corinna Vinschen <corinna@vinschen.de>
* fhandler_procnet.cc (get_scope): New static function to evaluate
scope.
(dad_to_flags): New static array to convert Windows DAD state to
Linux values.
(format_procnet_ifinet6): Drop asking for IfIndex, just use Ipv6IfIndex.
Use get_scope and dad_to_flags to generate more accurate linux-like
output.
2008-06-10 Corinna Vinschen <corinna@vinschen.de>
* net.cc (if_nametoindex): Fix typo in call to get_adapters_addresses.
(if_indextoname): Prefer IPv6 loopback device name over IPv4 loopback
device name on pre-Vista systems.
(if_nameindex): Ditto.
2008-06-10 Corinna Vinschen <corinna@vinschen.de>
* fhandler_procnet.cc (format_procnet_ifinet6): Use sprintf rather than
__small_sprintf.
* net.cc (if_nametoindex): Prefer IPv6IfIndex over IfIndex for
consistency with /proc/net/if_inet6.
(if_indextoname): Ditto.
(if_nameindex): Ditto.
2008-06-10 Corinna Vinschen <corinna@vinschen.de>
* mount.cc (mount_info::from_fstab): Read sizeof (buf) - 2 bytes.
Add code to handle overly long lines.
2008-06-10 Corinna Vinschen <corinna@vinschen.de>
* sec_auth.cc (lsaauth): Make returned token inheritable.
2008-06-10 Corinna Vinschen <corinna@vinschen.de>
* devices.cc: Regenerate.
2008-06-09 Christopher Faylor <me+cygwin@cgf.cx>
* devices.in: Remove "Global" from tty device.
2008-06-09 Eric Blake <ebb9@byu.net>
* signal.cc (abort): Only flush streams after signal handler.
2008-06-02 Christopher Faylor <me+cygwin@cgf.cx>
* cygwin.sc: Remove unrequired and erroneous definition.
2008-05-30 Christopher Faylor <me+cygwin@cgf.cx>
* select.cc (peek_pipe): Semi-reinstate pipe NT-special write
detection.
2008-05-29 Christopher Faylor <me+cygwin@cgf.cx>
* devices.in: Change mapping for /dev/ttyS* and /dev/com*.
* devices.cc: Regenerate.
2008-05-25 Christopher Faylor <me+cygwin@cgf.cx>
* mount.cc (mount_info::from_fstab): Use proper buffer size.
2008-05-24 Christopher Faylor <me+cygwin@cgf.cx>
* mount.cc (mount_info::init): Revert previous change.
(mount_info::from_fstab): Change system_printf to debug_printf. Just
use a local NT_MAX_PATH sized temporary buffer.
2008-05-24 Corinna Vinschen <corinna@vinschen.de>
* mount.cc (mount_info::init): Recreate path when trying to read the
user fstab file.
2008-05-24 Corinna Vinschen <corinna@vinschen.de>
* path.cc (symlink_info::check): Reorder test for nfs symlinks.
2008-05-23 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_disk_file::opendir): Don't try to
use FileIdBothDirectoryInformation on NFS shares. Fix comment to
explain why.
* path.cc (symlink_info::check): Reinstantiate no_ea. Use in
erroneously changed condition.
2008-05-23 Christopher Faylor <me+cygwin@cgf.cx>
* mount.cc (find_root_from_cygwin_dll): New function factored from
from_fstab. Avoid use of tls since it isn't necessarily initialized
when cygwin1.dll is dynamically loaded.
(mount_info::create_root_entry): Ditto.
(mount_info::init): Calculate cygwin root once. Use create_root_entry
to record it. Pass fstab location to from_fstab.
(mount_info::from_fstab): Move root calculation stuff elsewhere, as per
above.
* shared_info.h (mount_info::from_fstab_line): Make private.
(mount_info::fstab): Ditto. Accommodate new arguments.
2008-05-23 Christopher Faylor <me+cygwin@cgf.cx>
* mount.cc (mount_info::from_fstab): Use cygwin_hmodule rather than
trying to find handle based on cygwin1.dll.
* path.cc (symlink_info::check): Remove unused variable.
2008-05-23 Corinna Vinschen <corinna@vinschen.de>
* shared.cc (open_shared): Fix comments. Fix a condition which has
been overlooked to revert to its old state in change from 2008-04-18.
2008-05-22 Corinna Vinschen <corinna@vinschen.de>
* path.cc (symlink_info::check): Define eabuf and easize outside of
loop. Set to NULL on first STATUS_EAS_NOT_SUPPORTED. Align comments.
Fix formatting.
2008-05-23 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_disk_file::readdir): Eliminate
compiler warning.
2008-05-23 Christopher Faylor <me+cygwin@cgf.cx>
* path.cc (symlink_info::check): Don't pass EaBuffer to NtCreateFile if
it has indicated that it isn't appropriate.
* ntdll.h (STATUS_EAS_NOT_SUPPORTED): Define.
* winsup.h: Remove __builtin* defines.
2008-05-22 Corinna Vinschen <corinna@vinschen.de>
* grp.cc (internal_getgroups): Fix thinko. Only add enabled groups to
the group list.
2008-05-22 Corinna Vinschen <corinna@vinschen.de>
* grp.cc (internal_getgroups): Don't add deny-only groups to the group
list.
2008-05-22 Corinna Vinschen <corinna@vinschen.de>
* cygtls.h (struct san): Add two int values to store the current
tls_pathbuf counters.
(return_from_fault): Restore tls_pathbuf counters.
(setup_fault): Save tls_pathbuf counters.
* tlsoffset.h: Regenerate.
2008-05-22 Corinna Vinschen <corinna@vinschen.de>
* sec_acl.cc (setacl): Set errno to EINVAL if user or group don't exist.
2008-05-22 Corinna Vinschen <corinna@vinschen.de>
* path.cc (cygwin_conv_path): Define tp before setting up faul handler.
* syscalls.cc: Ditto, throughout.
(gen_full_path_at): Add bool parameter to allow NULL pathname.
(futimesat): Allow NULL pathname as GLIBC.
2008-05-21 Christopher Faylor <me+cygwin@cgf.cx>
* string.h (strchr): Eliminate.
* syscalls.cc (rename): Work around inexplicable C++ warning.
2008-05-21 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (get_ino_by_handle): Rename pfai to fai.
(fhandler_base::fstat_by_handle): Drop fai_size and pfai in favor of
static struct fai_buf. Restructure.
(fhandler_base::fstat_by_name): Drop fvi_size and pfvi. Drop fdi_size
and pfdi in favor of static struct fdi_buf. Drop redundant test for
existance. Use FileDirectoryInformation class instead of
FileBothDirectoryInformation. Drop call to NtQueryVolumeInformationFile
in favor of using pc.fs_serial_number (). Fix FileId information given
to fstat_helper.
(fhandler_disk_file::fstatvfs): Drop fvi_size, pfvi, fai_size and pfai.
Drop getting FileFsVolumeInformation and FileFsAttributeInformation in
favor of using the related path_conv info.
(fhandler_disk_file::opendir): Fix comment.
(fhandler_disk_file::readdir): Ditto. Use FileDirectoryInformation
class instead of FileBothDirectoryInformation.
* path.cc (fs_info::update): Store MaximumComponentNameLength in new
member name_len.
* path.h (struct fs_info): Use ULONG rather than DWORD. Add member
name_len to store MaximumComponentNameLength. Add accessor methods.
(path_conv::fs_name_len): New method.
2008-05-21 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (dirent_states): Add dirent_nfs_d_ino state and add it to
dirent_info_mask.
* fhandler_disk_file.cc (fhandler_disk_file::opendir): Set
dirent_nfs_d_ino flag for NFS shares. Explain why.
(fhandler_disk_file::readdir): Use FileNamesInformation instead of
FileBothDirectoryInformation info class on NFS clients not supporting
the FileIdBothDirectoryInformation info class. Use local pointers to
accommodate different offsets.
* path.cc (symlink_info::check): Don't test directories for symlinks
on NFS shares. Enhance comment.
2008-05-21 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (FILTERED_MODE): Define valid chmod mode mask.
(chmod): Call fh->fchmod with filtered mode.
(fchmod): Ditto.
2008-05-20 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Fix test for
S_IFSOCK in mode bits.
2008-05-20 Corinna Vinschen <corinna@vinschen.de>
* path.cc (symlink_worker): Fix EA buffer size info given to
NtCreateFile.
(symlink_info::check_nfs_symlink): Get 64K buffer for EA buffer.
Change EA buffer size info given to NtQueryEaFile accordingly.
2008-05-20 Corinna Vinschen <corinna@vinschen.de>
* path.cc (symlink_info::check_shortcut): Minimize requested file
access flags.
(symlink_info::check_sysfile): Ditto. Add missing `else'.
(symlink_info::check): Only retry to open file if first try failed
with access denied.
2008-05-20 Corinna Vinschen <corinna@vinschen.de>
* path.cc (fs_info::update): Re-add opening the unsplitted path
for fillout_mntent's sake.
2008-05-20 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_disk_file::mkdir): Create directories
on NFS shares with correct mode bits.
2008-05-20 Corinna Vinschen <corinna@vinschen.de>
* winsup.h (cygwin_inet_addr): Fix type of declaration.
2008-05-20 Corinna Vinschen <corinna@vinschen.de>
* Makefile.in (DLL_OFILES): Add nfs.o.
* fhandler.cc (fhandler_base::open): Open files on NFS shares with
correct access flags and EAs.
* fhandler.h (fhandler_base::fstat_by_nfs_ea): Declare.
* fhandler_disk_file.cc (fhandler_base::fstat_by_nfs_ea): New method.
(fhandler_base::fstat_by_handle): Call fstat_by_nfs_ea for files on
NFS shares.
(fhandler_disk_file::fchmod): Use NFS specific method to set mode for
files on NFS shares. Don't overrule errno from call to
set_file_attribute with errno from NtSetInformationFile call.
(fhandler_disk_file::fchown): Add comment.
* mount.cc (fillout_mntent): Accommodate change in second parameter
to fs_info::update.
* nfs.cc: New file.
* nfs.h: New file.
* path.cc (fs_info::update): Take handle instead of bool as second
parameter. Use that handle if it's not NULL. Only close handle if
it has been opened here. Use static defined buffers instead of
alloca'd buffers.
(path_conv::check): Call symlink_info::check with reference to fs.
Don't call fs.update here if file exists.
(conv_path_list): Prefer tmp_pathbuf buffer over using alloca.
(symlink_worker): Use NFS specific method to create symlinks on NFS
shares. Prefer tmp_pathbuf buffer over using alloca.
(symlink_info::check_shortcut): Reopen file from incoming handle
with necessary FILE_GENERIC_READ flag. Prefer tmp_pathbuf buffer over
using alloca.
(symlink_info::check_sysfile): Ditto.
(symlink_info::check_reparse_point): Use tmp_pathbuf buffer to
allocate REPARSE_DATA_BUFFER.
(symlink_info::check_nfs_symlink): New method.
(enum symlink_t): Remove.
(symlink_info::check): Don't use NtQueryAttributesFile. Rather, open
file with necessary access flags and call NtQueryInformationFile. Fix
error handling in case file can't be opened. For existing files, call
fs_info::update here. Restructure symlink checking to accommodate the
fact that the file is already open. Add case for NFS symlinks.
* path.h (fs_info::update): Take handle instead of bool as second
parameter.
2008-05-20 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (rename): Fix condition when to start a transaction.
2008-05-20 Corinna Vinschen <corinna@vinschen.de>
* path.cc (path_conv::check): Free wide_path and normalized_path if
necessary.
* path.h (path_conv::path_conv): Set wide_path, normalized_path and
normalized_path_size to 0 in all constructors.
2008-05-19 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (rename): Allocate temporary path buffers using
tmp_pathbuf. Don't try to unset R/O attribute on dstpc if a
removepc exists. dstpc is a non-existant file in that case.
2008-05-17 Christopher Faylor <me+cygwin@cgf.cx>
* include/stdint.h: Use int rather than long for {u,}int32_t.
2008-05-16 Corinna Vinschen <corinna@vinschen.de>
* CYGWIN_LICENSE: Remove duplicate file here.
2008-05-15 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (rename): ONly start transaction if FS supports them.
2008-05-15 Corinna Vinschen <corinna@vinschen.de>
* autoload.cc (LoadDLLfuncNt): Re-invent.
(NtCreateTransaction): Define.
(NtCommitTransaction): Define.
(NtRollbackTransaction): Define.
(RtlGetCurrentTransaction): Define.
(RtlSetCurrentTransaction): Define.
* ntdll.h (TRANSACTION_ALL_ACCESS): Define.
(NtCreateTransaction): Declare.
(NtCommitTransaction): Declare.
(NtRollbackTransaction): Declare.
(RtlGetCurrentTransaction): Declare.
(RtlSetCurrentTransaction): Declare.
* syscalls.cc (start_transaction): New static function to start TxF
transaction.
(stop_transaction): New static function to end TxF transaction.
(rename): Call start_transaction and stop_transaction where appropriate
on systems supporting transactions.
* wincap.h (wincaps::has_transactions): New element.
* wincap.cc: Implement above element throughout.
2008-05-14 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Drop
explicit transformation of special DOS chars.
* strfuncs.cc (sys_wcstombs): Always transform UNICODE private use area
back to ASCII.
2008-05-13 Corinna Vinschen <corinna@vinschen.de>
* include/cygwin/stdlib.h (initstate): Declare.
(setstate): Declare.
2008-05-13 Corinna Vinschen <corinna@vinschen.de>
* path.cc (path_conv::set_normalized_path): Drop strip_tail argument.
Never strip trailing dots and spaces.
* (path_conv::check): Accomodate above change.
* path.h (path_conv::operator=): Ditto
* dtable.cc (build_fh_dev): Ditto.
* fhandler.h (fhandler_base::set_name): Ditto.
* path.cc (transform_chars): Disable converting trailing dots and
spaces.
* path.cc (path_conv::check): Remove two disabled code snippets.
2008-05-13 Corinna Vinschen <corinna@vinschen.de>
* random.cc (initstate): Align to POSIX definition.
(setstate): Ditto.
2008-05-10 Corinna Vinschen <corinna@vinschen.de>
* Makefile.in (DLL_OFILES): Remove _def_time.o.
* libc/_def_time.c: Remove. Move definitions of _DefaultTimeLocale
and _CurrentTimeLocale ...
* libc/strptime.cc: ... here.
2008-05-08 Corinna Vinschen <corinna@vinschen.de>
* include/sys/localedef.h: Remove.
* libc/strptime.cc: Define _TimeLocale and declare _CurrentTimeLocale
as well as _DefaultTimeLocale locally for Cygwin.
2008-05-08 Corinna Vinschen <corinna@vinschen.de>
* Makefile.in (DLL_OFILES): Add _def_time.o. Remove timelocal.o.
* include/sys/localedef.h: New file from NetBSD.
* libc/_def_time.c: Ditto.
* libc/getopt.c: Update to latest OpenBSD version 1.23.
* libc/strptime.cc: Replace FreeBSD version 1.35 with latest NetBSD
version 1.28.
* libc/timelocal.cc: Remove.
* libc/timelocal.h: Remove.
2008-04-30 Corinna Vinschen <corinna@vinschen.de>
* dtable.cc (dtable::release): Drop fixup_before handling.
(dtable::fixup_before_fork): Remove.
(dtable::fixup_before_exec): Remove.
* dtable.h (class dtable): Remove cnt_need_fixup_before member.
(dtable::dtable): Accommodate above change.
(dtable::dec_need_fixup_before): Remove.
(dtable::inc_need_fixup_before): Remove.
(dtable::need_fixup_before): Remove.
(dtable::fixup_before_exec): Remove declaration.
(dtable::fixup_before_fork): Ditto.
* fhandler.h (fhandler_base::fixup_before_fork_exec): Remove.
(fhandler_base::need_fixup_before): Remove.
* fork.cc (frok::parent): Drop fixup_before handling.
* spawn.cc (spawn_guts): Ditto.
2008-04-30 Corinna Vinschen <corinna@vinschen.de>
* mount.cc (is_unc_share): Allow \\?\ prefix as well. Enhance comment.
(mount_info::from_fstab): Remove patch from 2008-04-29.
* mount.cc (mount_info::conv_to_posix_path): Simplify test for native
UNC path.
* path.cc (normalize_win32_path): Ditto.
(symlink_worker): Ditto.
(symlink_info::posixify): Ditto.
(cygwin_conv_path): Ditto.
2008-04-29 Corinna Vinschen <corinna@vinschen.de>
* mount.cc (mount_info::from_fstab): Skip native path prefix in
module path.
2008-04-29 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (rename): Use volume serial numbers stored in path_conv
rather than fetching them here for the "same file" test. Change
comment to reflect this.
2008-04-28 Corinna Vinschen <corinna@vinschen.de>
* path.cc (symlink_info::check): Avoid special handling for
STATUS_BUFFER_OVERFLOW when calling NtQueryDirectoryFile.
* strace.cc (strace::vprntf): Use bigger buffer.
2008-04-28 Corinna Vinschen <corinna@vinschen.de>
* kernel32.cc (CreateFileMappingW): Remove stray small_printf.
2008-04-28 Corinna Vinschen <corinna@vinschen.de>
* autoload.cc (IsWow64Process): Remove.
(Wow64DisableWow64FsRedirection): Remove.
(Wow64RevertWow64FsRedirection): Remove.
* ntdll.h (enum _PROCESSINFOCLASS): Define ProcessWow64Information.
* init.cc (respawn_wow64_process): Use NtQueryInformationProcess to
get WOW64 state.
* wincap.cc (wincapc::init): Ditto.
* wincap.h (wincapc::wow64): Change type to ULONG.
2008-04-27 Corinna Vinschen <corinna@vinschen.de>
* wincap.h (wincapc::wow64): Change type to BOOL.
* wincap.cc: Remove explicit use of this pointer in wincapc methods.
(wincapc::init): Fix bug in IsWow64Process handling.
2008-04-26 Corinna Vinschen <corinna@vinschen.de>
* dcrt0.cc (dll_crt0_0): Set SEM_NOGPFAULTERRORBOX error mode, too,
to accommodate Vista/Longhorn.
* spawn.cc (spawn_guts): Move check for CREATE_SUSPENDED condition
after the call to ch.set() since it depends on it.
2008-04-25 Corinna Vinschen <corinna@vinschen.de>
* Makefile.in (install): Drop install rules for postinstall script.
2008-04-25 Corinna Vinschen <corinna@vinschen.de>
* postinstall: Remove (Moved to base-cygwin package).
2008-04-25 Corinna Vinschen <corinna@vinschen.de>
* fhandler.cc (fhandler_base::open): Move handling FILE_ATTRIBUTE_NORMAL
back to its old place. Or it to file_attributes instead of setting it.
2008-04-25 Corinna Vinschen <corinna@vinschen.de>
* fhandler.cc (fhandler_base::open): *Only* handle SYSTEM and HIDDEN
attributes in FILE_OVERWRITE case.
2008-04-25 Corinna Vinschen <corinna@vinschen.de>
* fhandler.cc (fhandler_base::open): Handle SYSTEM and HIDDEN attributes
in FILE_OVERWRITE case as well.
2008-04-24 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_base::fstat_helper): Disable calling
pc.ndisk_links. Just use nNumberOfLinks instead.
2008-04-24 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_base::utimens_fs): Fix typo in
input range check.
2008-04-24 Corinna Vinschen <corinna@vinschen.de>
* cygwin.din (futimens): Export.
(utimensat): Export.
* fhandler.cc (fhandler_base::utimens): Replace fhandler_base::utimes.
Call utimens_fs.
* fhandler.h (class fhandler_base): Declare utimens_fs instead of
utimes_fs, utimens instead of utimes.
(class fhandler_disk_file): Declare utimens instead of utimes.
* fhandler_disk_file.cc (fhandler_disk_file::utimens): Replace
fhandler_disk_file::utimes.
(fhandler_base::utimens_fs): Replace fhandler_base::utimes_fs.
Implement tv_nsec handling according to SUSv4.
* syscalls.cc (utimensat): New function.
* times.cc (timespec_to_filetime): New function.
(timeval_to_timespec): New function.
(utimens_worker): Replace utimes_worker.
(utimes): Convert timeval to timespec and call utimens_worker.
(lutimes): Ditto.
(futimens): Take over implementation from futimes.
(futimes): Convert timeval to timespec and call futimens.
* winsup.h (timespec_to_filetime): Declare.
* include/cygwin/version.h: Bump API minor number.
* posix.sgml: Add SUSv4 section. Add futimens and utimensat to it.
2008-04-24 Yaakov (Cygwin Ports) <yselkowitz@users.sourceforge.net>
* include/wait.h: New file.
2008-04-23 Corinna Vinschen <corinna@vinschen.de>
* posix.sgml: Add openat, faccessat, fchmodat, fchownat, fstatat,
futimesat, linkat, mkdirat, mkfifoat, mknodat, readlinkat, renameat,
symlinkat, unlinkat to list of implemented Solaris functions.
2008-04-23 Corinna Vinschen <corinna@vinschen.de>
* cygwin.din: Sort.
(faccessat): Export.
(fchmodat): Export.
(fchownat): Export.
(fstatat): Export.
(futimesat): Export.
(linkat): Export.
(mkdirat): Export.
(mkfifoat): Export.
(mknodat): Export.
(openat): Export.
(readlinkat): Export.
(renameat): Export.
(symlinkat): Export.
(unlinkat): Export.
* path.cc (readlink): Align definition to POSIX.
* syscalls.cc (gen_full_path_at): New static function.
(faccessat): Implement.
(fchmodat): Implement.
(fchownat): Implement.
(fstatat): Implement.
(futimesat): Implement.
(linkat): Implement.
(mkdirat): Implement.
(mkfifoat): Implement.
(mknodat): Implement.
(openat): Implement.
(readlinkat): Implement.
(renameat): Implement.
(symlinkat): Implement.
(unlinkat): Implement.
* include/cygwin/version.h: Bump API minor number.
2008-04-22 Corinna Vinschen <corinna@vinschen.de>
* dcrt0.cc (dll_crt0_0): Move CWD initialization from here...
(dll_crt0_1): ...to here.
2008-04-22 Corinna Vinschen <corinna@vinschen.de>
* cygwin.din (fmemopen): Export.
(open_memstream): Export.
* include/cygwin/version.h: Bump API minor number.
2008-04-22 Corinna Vinschen <corinna@vinschen.de>
* sec_auth.cc (create_token): Add integrity level SID to token on
systems supporting that. Remove useless check for dynamically loading
NtCreateToken function.
* sec_helper.cc (mandatory_medium_integrity_sid): Define.
(mandatory_high_integrity_sid): Define.
(mandatory_system_integrity_sid): Define.
* sec_helper.h (mandatory_medium_integrity_sid): Declare.
(mandatory_high_integrity_sid): Declare.
(mandatory_system_integrity_sid): Declare.
2008-04-21 Corinna Vinschen <corinna@vinschen.de>
* mount.cc (mount_info::init): Remove call to from_registry. Print
message that fstab is missing.
(mount_info::from_fstab): Use CYGWIN_INFO_CYGDRIVE_DEFAULT_PREFIX
instead of constant string.
(mount_info::read_mounts): Remove.
(mount_info::from_registry): Remove.
(mount_info::read_cygdrive_info_from_registry): Remove.
* postinstall: Enable code to create fstab entries from old registry
entries.
* registry.cc (reg_key::reg_key): Drop CYGWIN_INFO_CYGNUS_REGISTRY_NAME
from registry key.
* shared_info.h (mount_info::read_mounts): Remove declaration.
(mount_info::from_registry): Ditto.
(mount_info::to_registry): Ditto.
(mount_info::read_cygdrive_info_from_registry): Ditto.
* winver.rc (CYGWIN_REGISTRY_KEY): Remove.
(LegalCopyright): Fix to include 2008.
(RegistryKey): Set to CYGWIN_INFO_CYGWIN_REGISTRY_NAME.
* include/cygwin/version.h (CYGWIN_INFO_CYGNUS_REGISTRY_NAME): Remove.
2008-04-21 Corinna Vinschen <corinna@vinschen.de>
* kernel32.cc (CreateFileMappingW): Fix bug in reserve/commit handling.
2008-04-21 Corinna Vinschen <corinna@vinschen.de>
* Makefile.in (DLL_OFILES): Add kernel32.o.
* autoload.cc (WSACloseEvent): Remove.
(WSACreateEvent): Remove.
* cygheap.cc (cygheap_init): Drop initializing shared_prefix.
* cygheap.h (struct init_cygheap): Drop shared_prefix and
shared_prefix_buf members.
* fhandler_socket.cc (sock_shared_name): New static function.
(search_wsa_event_slot): Convert name buffers to WCHAR. Call
NtCreateMutant/NtOpenMutant to create mutexes in session local
namespace.
(fhandler_socket::init_events): Ditto. Fix debug output.
(fhandler_socket::release_events): Close mutexes using NtClose.
(fhandler_socket::dup): Ditto.
* kernel32.cc: New file, implementing Win32 calls in a Cygwin-specific
way.
* mmap.cc (MapView): Make static.
* ntdll.h: Fix status code sorting.
(STATUS_OBJECT_NAME_EXISTS): Define.
(SEMAPHORE_QUERY_STATE): Define.
(CYG_SHARED_DIR_ACCESS): Define.
(CYG_MUTANT_ACCESS): Define.
(CYG_EVENT_ACCESS): Define.
(CYG_SEMAPHORE_ACCESS): Define.
(enum _PROCESSINFOCLASS): Define ProcessSessionInformation.
(struct _PROCESS_SESSION_INFORMATION): Define.
(NtCreateSemaphore): Declare.
(NtOpenSemaphore): Declare.
* flock.cc: Use CYG_xxx_ACCESS access masks where appropriate.
* posix_ipc.cc (ipc_mutex_init): Use native functions to create mutex.
Create in cygwin-shared subdir.
(ipc_cond_init): Ditto for event.
(ipc_mutex_close): Use NtClose.
(ipc_cond_close): Ditto.
(mq_open): Drop "cyg" prefix from mqh_uname.
* shared.cc (CYG_SHARED_DIR_ACCESS): Drop definition here.
(_cygwin_testing): Declare extern on file level.
(get_shared_parent_dir): Change name of shared directory. Add name
to api_fatal output.
(get_session_parent_dir): New function.
(shared_name): Simplify.
(shared_info::initialize): Call get_session_parent_dir.
* shared_info.h (get_session_parent_dir): Declare.
* smallprint.cc (__small_vswprintf): Fix bug in multibyte string
conversion.
* thread.cc (semaphore::semaphore): Align semaphore name to object
names in posix IPC functions.
* include/cygwin/version.h (CYGWIN_VERSION_SHARED_DATA): Bump.
2008-04-18 Corinna Vinschen <corinna@vinschen.de>
Revert thinko in previous patch.
* fhandler.h (struct wsa_event): Move back from wsa_event.h to here.
* fhandler_socket.cc (NUM_SOCKS): Ditto.
(wsa_events): Move back from cygwin_shared to here. Accommodate
throughout.
(socket_serial_number): Ditto.
* shared_info.h: Accommodate above changes.
* wsa_event.h: Remove.
2008-04-18 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (struct wsa_event): Move to wsa_event.h. Include
wsa_event.h instead.
* fhandler_socket.cc (NUM_SOCKS): Move to wsa_event.h.
(wsa_events): Move from DLL shared area to cygwin_shared shared
memory. Accommodate throughout.
(socket_serial_number): Ditto.
* fhandler_tape.cc (mt): Ditto.
(mtinfo_init): Remove.
(mt): Define as cygwin_shared->mt.
* flock.cc (FLOCK_PARENT_DIR_ACCESS): Remove.
(FLOCK_INODE_DIR_ACCESS): Move up in file.
(FLOCK_MUTANT_ACCESS): Ditto.
(FLOCK_EVENT_ACCESS): Ditto.
(get_lock_parent_dir): Remove.
(inode_t::inode_t): Call get_shared_parent_dir to get parent dir handle.
Add a "flock-" prefix to file's lock directory name for clarity.
* mtinfo.h (mtinfo_init): Drop declaration.
* net.cc (last_used_bindresvport): Move from DLL shared area to
cygwin_shared shared memory.
(cygwin_bindresvport_sa): Accommodate above change.
* sec_helper.cc (_everyone_sd): Move here from flock.cc.
* security.h (SD_MIN_SIZE): Ditto.
(everyone_sd): Ditto.
* shared.cc (cygwin_shared_area): Remove.
(cygwin_shared_h): New handle.
(get_shared_parent_dir): New static function.
(shared_name): Drop session_local argument. Call get_shared_parent_dir
here. Add cygwin-shared subdir to object name.
(offsets): Reinstantiate SH_CYGWIN_SHARED member.
(open_shared): Revert change from 2007-03-29 for systems supporting
SeCreateGlobalPrivilege.
(shared_info::initialize): Call mtinfo's initialize here.
(memory_init): Drop call to mtinfo_init.
* shared_info.h (SHARED_INFO_CB): Accommodate change to shared_info.
(CURR_SHARED_MAGIC): Ditto.
(class shared_info): Add members for global socket and tape info
sharing.
(enum shared_locations): Reinstantiate SH_CYGWIN_SHARED.
(get_shared_parent_dir): Declare.
(shared_name): Drop session_local argument from declaration.
* wsa_event.h: New file. Move definitions of NUM_SOCKS and
struct wsa_event here.
2008-04-18 Christopher Faylor <me+cygwin@cgf.cx>
* autoload.cc (noload): Make sure this and succeeding functions are
located in the text segment.
2008-04-16 Corinna Vinschen <corinna@vinschen.de>
* fhandler_socket.cc (fhandler_socket::close): Disable enforced
lingering since the original problem can no longer be reproduced.
2008-04-16 Corinna Vinschen <corinna@vinschen.de>
* grp.cc (internal_getgroups): Drop local buf. Allocate groups
directly using alloca.
2008-04-14 Corinna Vinschen <corinna@vinschen.de>
* postinstall: Fix copy/paste bug.
2008-04-14 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Fix
thinko in UNC path handling.
* path.cc (symlink_worker): Fix typo in comment. Fix UNC path handling.
2008-04-13 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Simplify
code which checks for symlinks. Fix problem with UNC paths.
* environ.cc (struct parse_thing): Remove transparent_exe option.
* syscalls.cc (transparent_exe): Remove.
(unlink): Always add stat_suffixes, drop transparent_exe check.
(open): Ditto.
(link): Ditto.
(pathconf): Ditto.
* fhandler_disk_file.cc (fhandler_disk_file::link): Ditto.
* fhandler_process.cc (fhandler_process::fill_filebuf): Always remove
.exe suffix.
* path.cc (realpath): Never attach known_suffix.
2008-04-10 Corinna Vinschen <corinna@vinschen.de>
* cygwin.din (wprintf): Remove.
(_wprintf): Ditto.
* syscalls.cc (wprintf): Ditto.
* include/cygwin/version.h: Add FIXME comment.
2008-04-08 Corinna Vinschen <corinna@vinschen.de>
* mount.cc (mount_info::from_fstab): Read user fstab files from
/etc/fstab.d/$USER to avoid user write access to /etc.
* postinstall: Use variables for filenames. Create /etc/fstab.d dir
with 01777 permissions.
2008-04-08 Corinna Vinschen <corinna@vinschen.de>
* postinstall: Disable adding registry mounts to /etc/fstab for now.
2008-04-07 Christopher Faylor <me+cygwin@cgf.cx>
Remove unneeded header files from source files throughout.
2008-04-07 Corinna Vinschen <corinna@vinschen.de>
* postinstall: Add function print_flags and call where appropriate.
Omit system and cygdrive flag when testing cygdrive flags.
2008-04-07 Christopher Faylor <me+cygwin@cgf.cx>
Add miscfuncs.h to files as needed throughout.
* mount.cc: New file.
* path.cc: Move mount-specific stuff into mount.cc. Move common stuff
into miscfuncs.cc. Remove unneeded includes.
* miscfuncs.cc: Move some common path functions here.
* miscfuncs.h: New file.
* winsup.h: Move miscelleneous functions to miscfuncs.h.
* dcrt0.cc: Remove unneeded includes.
* Makefile.in (DLL_OFILES): Add mount.o.
* include/cygwin/config.h: Fix a minor typo.
2008-04-07 Corinna Vinschen <corinna@vinschen.de>
* postinstall: Set IFS to LF only. Change while loop in subshell to
for loop in parent shell. Add code to read system mount points and
system cygdrive prefix from registry and append them to /etc/fstab.
2008-04-06 Corinna Vinschen <corinna@vinschen.de>
* path.cc (struct opt): Rename "system" to "nouser".
* postinsatll: Ditto.
2008-04-05 Corinna Vinschen <corinna@vinschen.de>
* postinstall: New script.
* Makefile.in (sysconfdir): Define.
(install): Create $(sysconfdir)/postinstall dir. Install postinstall
script into it.
* path.cc: Add temorary comments to note later function removal.
(conv_fstab_spaces): New inline function to handle \040 to space
conversion.
(struct opt): Add "system" and "user" mount options.
(mount_info::from_fstab_line): Only allow # to start a comment at
the beginning of the line. Call conv_fstab_spaces on native_path and
posix_path fields. Don't enforce system mounts in /etc/fstab.
Drop last argument in call to add_item.
(mount_info::from_fstab): Create a default cygdrive entry. Load
user mount points from fstab.<username> instead of fstab.<sid>.
(mount_info::read_mounts): Drop last argument in call to add_item.
(mount_info::add_reg_mount): Remove.
(mount_info::del_reg_mount): Remove.
(mount_info::write_cygdrive_info): Rename from
mount_info::write_cygdrive_info_to_registry. Don't write to registry.
Disallow to overwrite a system cygdrive prefix.
(mount_info::remove_cygdrive_info_from_registry): Remove.
(mount_info::get_cygdrive_info): Just fetch current cygdrive prefix and
flags.
(mount_info::add_item): Drop last argument. Don't write to registry.
Disallow to overwrite a system mount point.
(mount_info::del_item): Drop last argument. Don't write to registry.
Disallow to remove a system mount point.
(mount): Enforce user mount.
(cygwin_umount): Ditto.
* shared_info.h (mount_info::add_item): Drop last argument.
(mount_info::del_item): Ditto.
(mount_info::add_reg_mount): Remove.
(mount_info::del_reg_mount): Remove.
(mount_info::write_cygdrive_info): Rename from
mount_info::write_cygdrive_info_to_registry.
(mount_info::remove_cygdrive_info_from_registry): Remove.
2008-04-03 Corinna Vinschen <corinna@vinschen.de>
* path.cc (mount_info::from_fstab_line): Simplify. Recognize special
"cygdrive" entry from FS type field.
(mount_info::from_fstab): Create a default root dir.
2008-04-03 Corinna Vinschen <corinna@vinschen.de>
* dcrt0.cc (insert_file): Fix potential buffer overflow.
2008-04-03 Corinna Vinschen <corinna@vinschen.de>
* path.cc (mount_info::from_fstab): Get module path name of the Cygwin
DLL, not the path of the application.
2008-04-03 Corinna Vinschen <corinna@vinschen.de>
Cleanup.
* exceptions.cc (windows_system_directory): Make static. Convert to
WCHAR.
(_cygtls::inside_kernel): Accommodate above change. Check module
path name for leading \\?\ and skip, if so.
(try_to_debug): Call GetEnvironmentStringsW and convert evaluation to
WCHAR to avoid truncated environment problem.
(has_visible_window_station): Call GetUserObjectInformationW.
(events_init): Accommodate above conversion of windows_system_directory.
* init.cc (respawn_wow64_process): Use WCHAR functions to start new
process.
* net.cc (__dup_ent): Drop Windows 9x consideration.
(load_ipv6_funcs): Use WCHAR functions to load IPv6 libs.
* syscalls.cc (syscalls.cc): Remove call to GetDiskFreeSpace.
2008-04-02 Corinna Vinschen <corinna@vinschen.de>
* path.cc (mount_info::init): First try to fetch mount points from
fstab files. Fallback to registry if none exists.
(skip_ws): New inline function.
(find_ws): Ditto.
(struct opt): New structure for mount options.
(read_flags): New static function to convert a mount flags string into
a flag value.
(mount_info::from_fstab_line): New method to create a mount table
entry from a fstab line.
(mount_info::from_fstab): New method to read fstab file.
* shared_info.h (mount_info::from_fstab_line): Declare.
(mount_info::from_fstab): Declare.
2008-04-02 Corinna Vinschen <corinna@vinschen.de>
* path.cc (enum symlink_t): Rename from shortcut_t.
2008-04-02 Corinna Vinschen <corinna@vinschen.de>
* path.cc (symlink_info::check_reparse_point): Use NtFsControlFile
to read reparse points.
(enum shortcut_t): New type.
(symlink_info::check): Convert sym_check to shortcut_t. Use shortcut_t
enum values throughout. Check reparse point before checking for
sysfile shortcut. Open reparse points with READ_CONTROL only to
accommodate special Vista reparse points. Add comments.
2008-04-02 Corinna Vinschen <corinna@vinschen.de>
* flock.cc (get_lock_parent_dir): Drop call to NtOpenDirectoryObject
and utilize OBJ_OPENIF flag in call to NtCreateDirectoryObject.
(inode_t::inode_t): Ditto. Same for NtOpenMutant/NtCreateMutant.
2008-04-02 Corinna Vinschen <corinna@vinschen.de>
* posix.sgml: Change lockf to being implemented.
2008-04-02 Corinna Vinschen <corinna@vinschen.de>
* dcrt0.cc (insert_file): Convert filename to WCHAR and call
CreateFileW to allow UTF-8 filenames.
2008-04-01 Corinna Vinschen <corinna@vinschen.de>
* Fix copyright dates.
2008-04-01 Corinna Vinschen <corinna@vinschen.de>
Throughout, call fcntl64 instead of fcntl or fcntl_worker.
* fcntl.cc (fcntl_worker): Remove.
(fcntl64): Add fault handler. Move fcntl_worker stuff here. Add case
for locking and call fhandler's lock method directly. Make sure that
F_FLOCK flag isn't set in lock call.
(_fcntl): Add fault handler.
* fhandler.cc (fhandler_base::fcntl): Drop lock cases.
* flock.cc (flock): Add fault handler. Simplify code. Call fhandlers
lock method directly instead of fcntl_worker. Add debug output.
(lockf): Add fault handler. Call fhandlers lock method directly
instead of fcntl_worker. Add debug output.
* winsup.h (fcntl_worker): Drop declaration.
(fcntl64): Declare.
2008-03-31 Corinna Vinschen <corinna@vinschen.de>
* smallprint.cc (__small_vswprintf): Fix uninitialized usage of `w'.
Revamp advisory file locking to avoid cross reference pointers as well
as to allow BSD flock semantics. More agressively delete unused nodes
and sync objects.
* fhandler.h (fhandler_base::ino): Rename from namehash. Fix comment.
(fhandler_base::node): Remove.
(fhandler_base::unique_id): Add.
(fhandler_base::del_my_locks): New method.
(get_ino): Rename from get_namehash. Change usage throughout Cygwin.
(get_unique_id): New method.
* fhandler.cc (fhandler_base::close): Call own del_my_locks method.
Fix comment.
(fhandler_base::fhandler_base): Accommodate new and changed members.
(fhandler_base::fixup_after_fork): Call del_my_locks.
(fhandler_base::fixup_after_exec): Ditto for files with close-on-exec
flag set.
* fhandler_disk_file.cc (get_ino_by_handle): Rename from
readdir_get_ino_by_handle. Accommodate throughout.
(fhandler_base::open_fs): Fill ino with inode number if FS has good
inodes. Allocate a LUID and store in unique_id to recognize file
descriptors referencing the same file object.
* flock.cc: Drop flock TODO comments. Use explicit types __dev32_t
and __ino64_t instead of dev_t and ino_t.
(LOCK_OBJ_NAME_LEN): Change to reflect longer lf_id length.
(get_obj_handle_count): New method.
(lockf_t::lf_id): Change type to long long.
(inode_t::get_lock_obj_handle_count): Drop in favor of static function
get_obj_handle_count.
(inode_t::del_locks): Remove.
(inode_t::get): Add create_if_missing flag argument.
(inode_t::del_my_locks): Reimplement to handle POSIX and BSD flock
locks. Return if node can be deleted or not.
(inode_t::~inode_t): Ditto. Close handles to i_dir and i_mtx.
(fixup_lockf_after_fork): Remove.
(fhandler_base::del_my_locks): New method.
(fixup_lockf_after_exec): Check if node can be deleted.
(inode_t::get): Only create node if create_if_missing is set. Lock
the returned node here before unlocking the node list.
(inode_t::get_all_locks_list): Accommodate new lf_id length.
(inode_t::create_lock_obj): Ditto.
(lockf_t::open_lock_obj): Ditto. Change return type to bool. De-const.
Set lf_obj instead of returning a handle.
(lockf_t::del_lock_obj): Call SetEvent only if new incoming parameters
allow it. Explain how it's supposed to work.
(fhandler_disk_file::lock): Only fetch file length in SEEK_END case.
Use NtQueryInformationFile(FileStandardInformation) instead of
calling fstat_by_handle. Always unlock node before returning.
Use fhandler's unique id to create lf_id for BSD flock locks.
Rely on node lock from inode_t::get. Call del_lock_obj on removed
locks here to allow explicit unlocking. Delete node if no lock exists
on the file anymore.
(lf_setlock): Get file handle as additional parameter. Handle the fact
that lf_getblock now always opens the attached event object. Reactivate
erroneously applied patch which deactivates setting thread priority.
Additionally handle blocking on BSD flock locks.
(lf_clearlock): Get file handle as additional parameter.
(lf_getlock): Close event handle opened by lf_getblock.
(lf_getblock): Open potentially blocking event object here and check
its signal state if it's a BSD flock lock.
(lf_wakelock): Get file handle as additional parameter.
* fork.cc (frok::child): Drop call to fixup_lockf_after_fork.
* ntdll.h (struct _EVENT_BASIC_INFORMATION): Define.
(enum _EVENT_INFORMATION_CLASS): Define.
(NtQueryEvent): Declare.
* fhandler.h (fhandler_base::fs_flags): Remove.
(fhandler_base::set_fs_flags): Remove.
(fhandler_base::get_fs_flags): Remove.
* fhandler.cc (fhandler_base::write): Check for sparse file using
pc.fs_flags().
* fhandler_disk_file.cc (fhandler_disk_file::ftruncate): Ditto.
The return of the volume serial number in fs_info.
* fhandler.h (get_dev): New method.
* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Drop call to
NtQueryVolumeInformationFile(FileFsVolumeInformation). Just use
get_dev() method.
* fhandler_fifo.cc (fhandler_fifo::open) Use device ID and inode number
to generate fifo name.
* path.h (fs_info::sernum): New member.
(fs_info::serial_number): New method.
(path_conv::fs_serial_number): New method.
* path.cc (fs_info::update): Fetch volume serial number and store in
sernum.
2008-03-28 Corinna Vinschen <corinna@vinschen.de>
* flock.cc (lockf_t::operator new): Add operator taking a pointer. Call
cmalloc instead of ccalloc in the default operator. Add comments.
(inode_t::operator new): Call cmalloc instead of ccalloc.
(inode_t::get_all_locks_list): Return lockf_t pointer.
(inode_t::del_all_locks_list): Delete. Remove calls throughout.
(inode_t::get): Handle failing new gracefully.
(MAX_LOCKF_CNT): Define.
(inode_t::get_all_locks_list): Use pre-allocated buffer in i_all_lf
instead of allocating every lock. Return pointer to start of linked
list of locks.
(lockf_t::open_lock_obj): Create event object non-inheritable.
(fhandler_disk_file::lock): Handle failing new gracefully.
(lf_setlock): Allocate temporary buffer for node->i_all_lf from TLS.
Remove erroneous NtClose call.
(lf_getlock): Allocate temporary buffer for node->i_all_lf from TLS.
(lf_getblock): Set lf to return value of get_all_locks_list.
2008-03-27 Corinna Vinschen <corinna@vinschen.de>
* flock.cc (FLOCK_PARENT_DIR_ACCESS): Define.
(FLOCK_INODE_DIR_ACCESS): Define.
(FLOCK_MUTANT_ACCESS): Define.
(FLOCK_EVENT_ACCESS): Define.
(SD_MIN_SIZE): Define.
(everyone_sd): Define to simplify calling _everyone_sd.
(_everyone_sd): Replace everyone_sync_sd. Take SECURITY_DESCRIPTOR as
argument and allow to specify access mask.
(get_lock_parent_dir): Open/Create parent dir with
FLOCK_PARENT_DIR_ACCESS. Add text to api_fatal message.
(inode_t::inode_t): Open/Create dir with FLOCK_INODE_DIR_ACCESS.
Open/Create mutant with FLOCK_MUTANT_ACCESS. Add text to api_fatal
message.
(lockf_t::create_lock_obj): Create event with FLOCK_EVENT_ACCESS.
Add text to api_fatal message.
(lockf_t::open_lock_obj): Open event with FLOCK_EVENT_ACCESS.
On failure, just return NULL pointer instead of calling api_fatal.
(lockf_t::get_lock_obj_handle_count): Replace call to small_printf
with call to debug_printf.
(lf_setlock): Handle a failure to open the lock event object as
EDEADLK. Call system_printf if opening sync objects fail.
* ntdll.h (DIRECTORY_TRAVERSE): Define.
(DIRECTORY_CREATE_OBJECT): Define.
(DIRECTORY_CREATE_SUBDIRECTORY): Define.
(EVENT_QUERY_STATE): Define.
2008-03-27 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (rename): Fix setting errno in case of trailing "/."
2008-03-27 Corinna Vinschen <corinna@vinschen.de>
* fhandler_socket.cc: Create shared objects session local throughout.
* shared.cc (shared_name): Add argument to allow opening session
local shared memory.
* shared_info.h (shared_name): Change declaration accordingly.
2008-03-26 Christopher Faylor <me+cygwin@cgf.cx>
Implement method of detecting a missing dll as suggested by Brian
Dessent.
* hookapi.cc (find_first_notloaded_dll): New function.
* pinfo.cc (status_exit): New function. Issue message when dll not
found. Use find_first_notloaded_dll to find a nonexistent dll.
(pinfo::maybe_set_exit_code_from_windows): Call status_exit when exit
code >= 0xc0000000UL.
* sigproc.cc (child_info::proc_retry): Return exit code when
STATUS_DLL_NOT_FOUND.
* spawn.cc (spawn_guts): Minor cleanup.
* syscalls.cc (close_all_files): Don't actually close stderr
filehandle. Just make it noninheritable.
* winsup.h (find_first_notloaded_dll): Declare new function.
2008-03-26 Brian Dessent <brian@dessent.net>
* ntdll.h: Add several missing NTSTATUS defines.
2008-03-24 Corinna Vinschen <corinna@vinschen.de>
* flock.cc (inode_t::get_all_locks_list): Don't allow F_WAIT flag
in lock event object name.
(lockf_t::create_lock_obj): Ditto.
(lockf_t::open_lock_obj): Ditto.
(lf_setlock): Only check POSIX locks for deadlock condition.
(lf_findoverlap): Don't let POSIX and flock locks interact.
2008-03-24 Corinna Vinschen <corinna@vinschen.de>
* flock.cc: Clarify a couple of comments.
(lf_setlock): Treat not being able to sync on a process as a potential
deadlock situation. Close process handle using CloseHandle.
2008-03-24 Corinna Vinschen <corinna@vinschen.de>
* flock.cc: Fix typo in comment.
2008-03-24 Corinna Vinschen <corinna@vinschen.de>
* fhandler.cc (fhandler_base::dup): Drop setting flags in the parent.
Implement advisory file locking.
* cygheap.h (struct init_cygheap): Add inode_list member.
* cygwin.din (lockf): Export.
* dcrt0.cc (child_info_spawn::handle_spawn): Call
fixup_lockf_after_exec.
* dtable.h (class dtable): Add fhandler_disk_file as friend class.
* fhandler.cc (fhandler_base::close): Call del_my_locks if node is set.
(fhandler_base::fhandler_base): Initialize node to NULL.
(fhandler_base::fixup_after_fork): Ditto.
* fhandler.h (class fhandler_base): Add member node.
* fhandler_disk_file.cc (fhandler_disk_file::lock): Delete.
* flock.cc: Implement all advisory file locking here.
(fhandler_disk_file::lock): Implement here.
(flock): Call fcntl with F_FLOCK bit set. Remove test main function.
(lockf): New function.
* fork.cc (frok::child): Call fixup_lockf_after_fork.
* ntdll.h (DIRECTORY_ALL_ACCESS): Define.
(struct _OBJECT_BASIC_INFORMATION): Define.
(enum _EVENT_TYPE): Define.
(NtCreateDirectoryObject): Declare.
(NtCreateEvent): Declare.
(NtCreateMutant): Declare.
(NtOpenEvent): Declare.
(NtOpenMutant): Declare.
* include/cygwin/version.h: Bump API minor number.
2008-03-22 Christopher Faylor <me+cygwin@cgf.cx>
* dtable.cc (handle_to_fn): Modify to return true if handle represents
a cygwin tty.
(dtable::init_std_file_from_handle): Detect when we've seen a cygwin
pipe and use it in overlapped mode by default.
(decode_tty): Make static.
2008-03-22 Christopher Faylor <me+cygwin@cgf.cx>
* dtable.cc: Define various device-related string constants as wide
character constants.
(dtable::init_std_file_from_handle): Reorganize pipe handling to try to
catch special tty case.
(build_fh_name_worker): Declare for common use.
(build_fh_name): Define char version.
(build_fh_name): Define (currently unused) UNICODE_STRING version.
(decode_tty): Detect if pipe is actually a cygwin tty, returning the
tty name in the buffer.
(handle_to_fn): Reorganize to use wide characters.
* dtable.h (build_fh_name): Declare (currently unused) UNICODE_STRING
version.
* fhandler_tty.cc (fhandler_pty_master::setup): Use
fhandler_pipe::create_selectable to create a pipe with a given name.
* pipe.cc (pipe_handler): Make returned handle inheritable.
(fhandler_pipe::create_selectable): Take an optional name. Use a
standard cygwin introducer for the name.
* path.cc (path_conv::check): Make first argument const.
* path.h (path_conv::check): Ditto for declaration.
(path_conv::path_conv): Ditto for UNICODE_STRING version.
2008-03-18 Corinna Vinschen <corinna@vinschen.de>
* include/sys/cygwin.h: Revert erroneous move of `#ifdef WINVER' to
another location.
2008-03-14 Corinna Vinschen <corinna@vinschen.de>
* fcntl.cc (fcntl_worker): Protect with a 'myfault'.
* path.cc (normalize_posix_path): Treat X:/ as Win32 path, too.
* smallprint.cc (__wrn): New static function.
(__small_vswprintf): New function to generate WCHAR strings.
(__small_swprintf): Ditto.
* winsup.h (__small_swprintf): Declare.
(__small_vswprintf): Declare.
2008-03-13 Corinna Vinschen <corinna@vinschen.de>
* path.sgml: Remove documentation for old path API. Add documentation
for new path API.
* security.sgml: New file to document cygwin_set_impersonation_token
and cygwin_logon_user with only eight years of delay.
* shared.sgml: Remove file.
* include/sys/cygwin.h (cygwin32_attach_handle_to_fd): Move declaration
into fully deprecated function block.
(cygwin_logon_user): Move declaration down to declaration of
cygwin_set_impersonation_token.
2008-03-12 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (rename): Just return with 0 if filenames are identical,
per POSIX. Drop comment added in previous patch.
2008-03-12 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (rename): Handle a special case of trying to rename a
mount point.
2008-03-12 Corinna Vinschen <corinna@vinschen.de>
* environ.h: Fix comment.
* winsup.h: Ditto. Reflect the fact that CYG_MAX_PATH is deprecated.
2008-03-12 Corinna Vinschen <corinna@vinschen.de>
* pipe.cc (fhandler_pipe::create_selectable): Use MAX_PATH instead of
CYG_MAX_PATH.
* tty.cc (tty_list::init_session): Ditto.
(tty::alive): Ditto.
(tty::open_mutex): Ditto.
(tty::create_inuse): Ditto.
(tty::get_event): Ditto.
2008-03-12 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Disable
munging. Convert all chars in the 0xf0xx area to it's ascii equivalent.
* path.cc (normalize_posix_path): Don't treat "X:foo" as windows path,
only "X:\foo".
(tfx_chars): New transformation table for special DOS chars.
(tfx_chars_managed): Ditto, plus transformation of uppercase ASCII
chars.
(transform_chars): New function.
(get_nt_native_path): Make static. Call transform_chars for all valid
FS paths. Get additional flag if file is managed or not. Accommodate
throughout.
(getfileattr): Get additional flag if file is managed or not.
Accommodate throughout.
(path_conv::check): Disable special handling for trailing dots and
spaces.
(mount_item::build_win32): Disable code for managed paths.
(mount_info::conv_to_posix_path): Ditto.
* path.h (get_nt_native_path): Remove declaration.
2008-03-12 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Don't
copy filename twice in the non-managed case.
2008-03-12 Corinna Vinschen <corinna@vinschen.de>
* winsup.h (NT_MAX_PATH): Revert ill-advised change to 32767.
Accommodate change throughout.
* cygwin.din (cygwin_conv_path): Export.
(cygwin_conv_path_list): Export.
(cygwin_create_path): Export.
* dcrt0.cc (dll_crt0_1): Use cygwin_conv_path.
* dtable.cc (handle_to_fn): Ditto. Don't expect UNICODE_STRING being
0-terminated.
* environ.cc (env_plist_to_posix): New helper function.
(env_plist_to_win32): Ditto.
(env_path_to_posix): Ditto.
(env_path_to_win32): Ditto.
(return_MAX_PATH): Remove.
(conv_envvars): Use new helper functions. Drop removed members.
(win_env::operator =): Accommodate removal of path length functions.
(win_env::add_cache): Accommodate new env helper function API.
(posify): Ditto.
* environ.h (struct win_env): Ditto. Remove path length function
pointers since they are unused.
* path.cc (warn_msdos): Use cygwin_conv_path.
(getfileattr): Use new tmp_pathbuf::u_get method.
(fillout_mntent): Ditto.
(symlink_info::check): Ditto.
(path_conv::check): Use sizeof (WCHAR) instead of constant 2.
(symlink_info::check_reparse_point): Ditto.
(conv_path_list): Get max size of target string as argument. Call
cygwin_conv_path as helper function.
(cygwin_conv_path): New function.
(cygwin_create_path): New function.
(cygwin_conv_to_win32_path): Just call cygwin_conv_path with size set
to MAX_PATH.
(cygwin_conv_to_full_win32_path): Ditto.
(cygwin_conv_to_posix_path): Ditto.
(cygwin_conv_to_full_posix_path): Ditto.
(conv_path_list_buf_size): Add FIXME comment.
(env_PATH_to_posix): Rename from env_win32_to_posix_path_list.
Add size argument as required for env helper functions.
(cygwin_win32_to_posix_path_list): Call conv_path_list with size set to
MAX_PATH.
(cygwin_posix_to_win32_path_list): Ditto.
(cygwin_conv_path_list): New function.
(cwdstuff::get): Fix length argument in call to sys_wcstombs.
* spawn.cc (find_exec): Use cygwin_conv_path_list.
* tls_pbuf.h (tmp_pathbuf::u_get: New method.
* uinfo.cc (cygheap_user::ontherange): Allocate temporary path buffers
using tmp_pathbuf. Use cygwin_conv_path.
* winf.cc (av::unshift): Use cygwin_conv_path.
* include/cygwin/version.h: Bump API minor number.
* include/sys/cygwin.h: Comment out old cygwin32_XXX API.
Mark old path handling API as deprecated.
(cygwin_conv_path_t): Typedef. Define values.
(cygwin_conv_path): Declare.
(cygwin_create_path): Declare.
(cygwin_conv_path_list): Declare.
2008-03-11 Corinna Vinschen <corinna@vinschen.de>
* dlfcn.cc (get_full_path_of_dll): Allow paths up to PATH_MAX.
(dlopen): Call get_full_path_of_dll with path buffer allocate by
tmp_pathbuf.
2008-03-11 Corinna Vinschen <corinna@vinschen.de>
* spawn.cc (find_exec): Use tmp_pathbuf to allocate path buffer.
2008-03-11 Corinna Vinschen <corinna@vinschen.de>
* dtable.cc (dtable::init_std_file_from_handle): Use tmp_pathbuf to
allocate path buffer.
(handle_to_fn): Ditto. Allocate fnbuf big enough to get long path
names.
2008-03-11 Corinna Vinschen <corinna@vinschen.de>
* path.cc (cwdstuff::set): Make sure drive_length is 0 for virtual
paths. Add comments.
* spawn.cc (spawn_guts): Don't allow to start a native Win32 application
from a long path or a virtual path. Print an error message to stderr.
2008-03-11 Corinna Vinschen <corinna@vinschen.de>
* environ.cc (parse_options): Use tmp_pathbuf to allocate buffer.
(regopt): Take tmp buffer as additional argument.
(environ_init): Alllcate tmpbuf earlier. Use as temporary buffer in
call to regopt.
* tls_pbuf.cc (tmp_pathbuf::c_get): Allocate one additional char.
(tmp_pathbuf::w_get): Allocate one additional WCHAR.
* winf.cc (av::unshift): Use tmp_pathbuf to allocate buffer.
2008-03-11 Corinna Vinschen <corinna@vinschen.de>
* syscalls.cc (sync): Use MAX_PATH rather than CYG_MAX_PATH.
2008-03-10 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (class fhandler_console): Add write_buf as pointer to
temporary buffer space.
* fhandler_console.cc (CONVERT_LIMIT): Define as NT_MAX_PATH. Add
comment.
(fhandler_console::write_normal): Use write_buf throughout.
(fhandler_console::write): Use tmp_pathbuf to allocate write_buf.
2008-03-10 Corinna Vinschen <corinna@vinschen.de>
* fhandler_console.cc (fhandler_console::write_normal): Don't print
chars marked as ERR chars.
2008-03-10 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (dev_console::con_to_str): Declare returning DWORD.
* fhandler_console.cc (dev_console::con_to_str): Return number of
multibyte char bytes.
(fhandler_console::read): Set nread to number of multibyte char bytes
returned from con_to_str.
(fhandler_console::write_normal): Reorder trunc buffer preocessing.
Return after writing valid multibyte sequence out of trunc buffer.
Change comments slightly.
2008-03-08 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (DIR_BUF_SIZE): Define required space for file
name in terms of sizeof(WCHAR).
(fhandler_disk_file::readdir_helper): Convert *all* of fname.
* path.cc (fillout_mntent): Use tmp_pathbuf for path buffer.
(symlink_worker): Ditto.
(SCAN_JUSTCHECKTHIS): New state for suffix_scan to define
that only the actual name gets cheked and a suffix is never attached.
(suffix_scan::has): If filename + suffix would be > NAME_MAX, start
in SCAN_JUSTCHECKTHIS state.
(suffix_scan::next): Add case for SCAN_JUSTCHECKTHIS.
(symlink_info::check): Use tmp_pathbuf for path buffer. Goto
file_not_symlink in case of invalid file name.
(realpath): Use tmp_pathbuf for path buffer.
2008-03-07 Brian Dessent <brian@dessent.net>
* dtable.cc (handle_to_fn): Null-terminate posix_fn in the case
of justslash = true.
2008-03-07 Brian Dessent <brian@dessent.net>
* fhandler.cc (fhandler_base::open): Use %S for PUNICODE_STRING.
* syscalls.cc (setmode): Ditto.
2008-03-07 Corinna Vinschen <corinna@vinschen.de>
* fhandler_socket.cc (fhandler_socket::sendto): Never send more than
64K. Add comment to explain why.
(fhandler_socket::sendmsg): Ditto.
2008-03-07 Corinna Vinschen <corinna@vinschen.de>
* Makefile.in (DLL_OFILES): Add tls_pbuf.o.
* autoload.cc (CreateDesktopW): Replace CreateDesktopA.
(CreateWindowStationW): Replace CreateWindowStationA.
(GetUserObjectInformationW): Replace GetUserObjectInformationA.
* cygheap.h (cwdstuff::get): Assume default buffer size NT_MAX_PATH.
* cygtls.cc (_cygtls::remove): Free temporary TLS path buffers.
* cygtls.h (TP_NUM_C_BUFS): Define.
(TP_NUM_W_BUFS): Define.
(class tls_pathbuf): New class to store pointers to thread local
temporary path buffers.
(_local_storage::pathbufs): New member.
* environ.cc (win_env::add_cache): Use temporary TLS path buffer instead
of stack based buffer.
(posify): Get temporary outenv buffer from calling function.
(environ_init): Create temporary TLS path buffer for posify.
(build_env): Create Windows environment block as WCHAR buffer.
* environ.h (build_env): Change declaration accordingly.
* external.cc (sync_winenv): Accommodate build_env change.
* fhandler_console.cc (fhandler_console::need_invisible): Use
GetUserObjectInformationW and CreateWindowStationW.
* fhandler_process.cc (format_process_maps): Use temporary TLS path
buffer instead of stack based buffer.
* fork.cc (frok::parent): Convert to use CreateProcessW.
* path.cc: Throughout use temporary TLS path buffers instead of stack
based buffer. Replace checks for CYG_MAX_PATH by checks for
NT_MAX_PATH.
(getfileattr): New function to replace GetFileAttributesA.
(normalize_win32_path): Remove Win32 and NT long path prefixes.
(getwd): Assume PATH_MAX + 1 buffer per SUSv3.
* path.h (class path_conv): Set path buffer to size NT_MAX_PATH.
(iswdrive): Define.
* pinfo.cc (commune_process): Use temporary TLS path buffer instead of
stack based buffer.
* registry.cc (get_registry_hive_path): Ditto.
(load_registry_hive): Ditto.
* spawn.cc (spawn_guts): Convert to use CreateProcessW and
CreateProcessAsUserW.
(av::fixup): Open/close file using NtOpenFile/NtClose.
* syscalls.cc (mknod_worker): Allow PATH_MAX file name.
(mknod32): Ditto.
(getusershell): Ditto.
* tls_pbuf.cc: New file implementing tls_pathbuf and tmp_pathbuf
methods.
* tls_pbuf.h: New header for files using tmp_pathbuf.
* tlsoffsets.h: Regenerate.
* winsup.h (NT_MAX_PATH): Define as 32767 to avoid USHORT overflow.
2008-03-06 Corinna Vinschen <corinna@vinschen.de>
* child_info.h (CURR_CHILD_INFO_MAGIC): Reset.
2008-03-06 Corinna Vinschen <corinna@vinschen.de>
* fhandler.cc (fhandler_base::open_): Add missing test for O_CREAT.
Fix comment.
2008-03-05 Corinna Vinschen <corinna@vinschen.de>
* child_info.h (~child_info_spawn): Check moreinfo->myself_pinfo for
NULL before closing.
* spawn.cc (spawn_guts): Don't close moreinfo->myself_pinfo explicitely
in case of failing CloseProcess.
* fhandler.cc (fhandler_base::open_): Return EISDIR when trying to
create a directory.
* path.cc (path_conv::check): If input path had a trailing dir
separator, tack it on to the native path if directory doesn't exist.
2008-03-02 Christopher Faylor <me+cygwin@cgf.cx>
* cygtls.cc (_cygtls::init_exception_handler): Semi-revert to making
only ourselves the exception handler and nothing else.
* exceptions.cc (open_stackdumpfile): Use correct format specifiers for
unicode when printing the name of the stackdump file.
(stack_info::walk): Stop walking if ebp points into cygwin itself.
(_cygtls::handle_exceptions): Detect when signal is masked and treat as
if it was not caught. Reinitialize exception handler to known state to
avoid subsequent attempts to call Windows exception handlers if an
exception occurs in a signal handler. Revert to a 'return 0' rather
than using a goto.
* strfuncs.cc (sys_wcstombs_alloc): Minor formatting tweak.
* winsup.h: Fix comment typo.
2008-03-02 Christopher Faylor <me+cygwin@cgf.cx>
* smallprint.cc (__small_vsprintf): Free allocated buffer rather than
pointer into the buffer.
2008-03-01 Christopher Faylor <me+cygwin@cgf.cx>
* cygtls.h (_cygtls::handle_threadlist_exception): Eliminate.
(_cygtls::init_threadlist_exceptions): Ditto.
* cygtls.cc (_cygtls::handle_threadlist_exception): Eliminate.
(_cygtls::init_threadlist_exceptions): Ditto.
(_cygtls::find_tls): Use myfault handling to deal with errors caused by
nonexistent threads.
* sigproc.cc (wait_sig): Eliminate call to init_threadlist_exceptions.
2008-03-01 Christopher Faylor <me+cygwin@cgf.cx>
* cygtls.cc (_cygtls::init_exception_handler): Just return.
2008-03-01 Corinna Vinschen <corinna@vinschen.de>
* exceptions.cc (_cygtls::handle_exceptions): Only call rtl_unwind when
exiting. Just return, don't set thread context.
* gendef (_setjmp): Store %fs:0 in jmp_buf.
(_sjfault): Ditto.
(_ljfault): Restore %fs:0 from jmp_buf.
(_longjmp): Ditto.
2008-02-29 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Call close_fs
instead of close to avoid calling close from wrong class when changing
a file system based device node.
(fhandler_disk_file::fchown): Ditto.
(fhandler_disk_file::facl): Ditto.
2008-02-28 Corinna Vinschen <corinna@vinschen.de>
* exceptions.cc (_cygtls::handle_exceptions): When being debugged,
leave through SetThreadContext, too, to keep exception handler stack
intact.
2008-02-28 Corinna Vinschen <corinna@vinschen.de>
* exceptions.cc (open_stackdumpfile): Add comments.
2008-02-28 Corinna Vinschen <corinna@vinschen.de>
* exceptions.cc (open_stackdumpfile): Use NtCreateFile to create
stackdump file.
2008-02-27 Corinna Vinschen <corinna@vinschen.de>
* exceptions.cc (stack_info::walk): Fix typo.
2008-02-27 Corinna Vinschen <corinna@vinschen.de>
* cygtls.cc (_cygtls::init_exception_handler): Fix comment.
2008-02-27 Corinna Vinschen <corinna@vinschen.de>
* (struct __DIR_cache): Switch order of members so that the buffer
given to NtQueryDirectoryFile is 8 byte aligned.
2008-02-27 Christopher Faylor <me+cygwin@cgf.cx>
* cygtls.cc (_cygtls::handle_threadlist_exception): Make it clear that
the function never actually returns.
* exceptions.cc (_cygtls::handle_exceptions): Jump out of function
rather than returning to avoid meddling by previously installed
exception handlers.
2008-02-25 Corinna Vinschen <corinna@vinschen.de>
* dcrt0.cc (initial_env): Only use local buffer "buf" if DEBUGGING is
enabled. Replace calls to GetEnvironmentVariable by calls to
GetEnvironmentVariableA for clarity. Call GetEnvironmentVariableA
with NULL buffer.
(cygbench): Ditto, drop local buffer.
* environ.cc (getearly): Call GetEnvironmentVariableA.
(environ_init): Retrieve unicode environment and convert to current
codepage locally.
(getwinenveq): Ditto.
* exceptions.cc (try_to_debug): Accommodate new sys_mbstowcs calling
convention.
* fhandler_clipboard.cc (set_clipboard): Call sys_mbstowcs to retrieve
required buffer length.
* fork.cc (frok::child): Call GetEnvironmentVariableA.
* miscfuncs.cc: Accommodate changed arguments in calls to sys_mbstowcs.
* sec_auth.cc: Ditto.
* strfuncs.cc (sys_wcstombs_alloc): Fix formatting.
(sys_mbstowcs): Change arguments to allow specifying a source string
length.
(sys_mbstowcs_alloc): Ditto.
* uinfo.cc (cygheap_user::ontherange): Accommodate changed arguments in
calls to sys_mbstowcs.
* winsup.h (sys_mbstowcs): Adjust declaration.
(sys_mbstowcs_alloc): Ditto.
2008-02-20 Corinna Vinschen <corinna@vinschen.de>
* path.cc (cwdstuff::set): Revert error handling change in case
DuplicateHandle fails, because it breaks Vista/Longhorn workaround.
2008-02-19 Christopher Faylor <me+cygwin@cgf.cx>
* sigproc.cc (sig_send): Use sigmask of target thread if it is
specified otherwise default to main sigmask.
2008-02-16 Corinna Vinschen <corinna@vinschen.de>
* fhandler.cc (fhandler_base::fpathconf): Fix _PC_NAME_MAX and
_PC_PATH_MAX cases.
2008-02-15 Corinna Vinschen <corinna@vinschen.de>
* include/sys/cygwin.h (__INT_MAX_PATH): Remove.
(external_pinfo): Convert program_long to pointer.
* external.cc (fillout_pinfo): Add buffer for program_long value.
2008-02-15 Corinna Vinschen <corinna@vinschen.de>
* include/sys/cygwin.h (__INT_MAX_PATH): Define to 32K.
(external_pinfo): Set size of program_long to __INT_MAX_PATH.
2008-02-15 Christopher Faylor <me+cygwin@cgf.cx>
* include/sys/cygwin.h (external_pinfo): Define program_long size using
external buffer size rather than cygwin-internal buffer size.
2008-02-15 Christopher Faylor <me+cygwin@cgf.cx>
Perform whitespace cleanup throughout.
* dcrt0.cc (signal_shift_subtract): Eliminate ancient backwards
compatibility.
(check_sanity_and_sync): Ditto.
* winsup.h (SIGTOMASK): Ditto. Just use constant in signal
calculation.
* include/cygwin/version: Remove backwards signal mask compatibility
define.
* path.cc (symlink_info::check_sysfile): Cosmetic change.
* registry.cc (get_registry_hive_path): Remove unneeded variable.
* exceptions.cc (handle_sigsuspend): Eliminate thread signal mask and
use either main sigmask or current thread sigmask.
(set_process_mask): Ditto.
(sighold): Ditto.
(sigrelse): Ditto.
(sigset): Ditto.
(set_process_mask_delta): Ditto.
(_cygtls::call_signal_handler): Ditto.
* fhandler_process.cc (format_process_status): Ditto.
* fhandler_termios.cc (fhandler_termios::bg_check): Ditto.
* pinfo.h (class pinfo): Ditto.
* select.cc (pselect): Ditto.
* signal.cc (sigprocmask): Ditto.
(abort): Ditto.
(sigpause): Ditto.
(sigsend): Ditto.
(wait_sig): Ditto.
* thread.h (pthread::parent_tls): New member.
* thread.cc (pthread::pthread): Record parent_tls here.
(pthread::thread_init_wrapper): Initialize sigmask from parent thread.
2008-02-14 Corinna Vinschen <corinna@vinschen.de>
* cygheap.cc (cwcsdup): New function.
(cwcsdup1): New function.
* cygheap.h (cygheap_user::get_windows_id): New method returning PWCHAR.
(cwcsdup): Declare.
(cwcsdup1): Declare.
* registry.cc (get_registry_hive_path): Use WCHAR instead of char
throughout.
(load_registry_hive): Ditto.
* registry.h (get_registry_hive_path): Change declaration accordingly.
(load_registry_hive): Ditto.
* sec_helper.cc (cygpsid::string): New method returning PWCHAR.
* security.h (cygpsid::string): Declare.
* syscalls.cc (seteuid32): Convert local name var to WCHAR.
* uinfo.cc (cygheap_user::env_userprofile): Convert local name buffers
to WCHAR. Call sys_wcstombs_alloc to generate puserprof buffer.
* winsup.h: Fix comment.
(NT_MAX_PATH): New definition for maximum internal path length.
Use throughout where appropriate.
* include/limits.h (PATH_MAX): Set to 4096 as on Linux.
2008-02-13 Christopher Faylor <me+cygwin@cgf.cx>
* configure.in: Remove non-working options.
* configure: Regenerate.
2008-02-13 Christopher Faylor <me+cygwin@cgf.cx>
* syscalls.cc (_isatty): Define as an alias to isatty to override
newlib version.
* thread.cc (pthread_kill): Deal with signal 0 as per POSIX and also
avoid manipulating an invalid thread.
2008-02-13 Corinna Vinschen <corinna@vinschen.de>
* posix.sgml: Move llrint, llrintf, llrintl, lrintl, rintl, wcstol,
wcstoll, wcstoul, wcstoull, wcsxfrm from unimplemented to implemented
POSIX interfaces.
Change headline of "GNU extensions" to "GNU and Linux extensions".
Add fgetxattr, flistxattr, fremovexattr, fsetxattr, getxattr, lgetxattr,
listxattr, llistxattr, lremovexattr, lsetxattr, removexattr, setxattr,
wcpcpy and wcpncpy to list of implemented GNU functions.
2008-02-13 Corinna Vinschen <corinna@vinschen.de>
* cygtls.cc (_cygtls::init_exception_handler): Revert patch
from 2005-12-02.
* exceptions.cc (stack_info::walk): Add workaround for NT 5.2
64 bit OSes.
* wincap.h (wincaps::has_restricted_stack_args): New element.
* wincap.cc: Implement above element throughout.
(wincapc::init): Reset has_restricted_stack_args if not running
under WOW64.
2008-02-11 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_disk_file::fgetxattr): Remove unused
attr.
(fhandler_disk_file::fsetxattr): Ditto.
* include/attr/xattr.h: New file.
2008-02-11 Corinna Vinschen <corinna@vinschen.de>
* dcrt0.cc (dll_crt0_1): Fix typo in call to sys_wcstombs.
* miscfuncs.cc (next_char): Initialize ret to keep gcc happy.
2008-02-10 Corinna Vinschen <corinna@vinschen.de>
* Makefile.in (DLL_OFILES): Add ntea.o.
* cygwin.din (getxattr, listxattr, removexattr, setxattr, lgetxattr,
llistxattr, lremovexattr, lsetxattr, fgetxattr, flistxattr,
fremovexattr, fsetxattr): Export Linux extended attribute functions.
Sort.
* errno.cc (errmap): Add mappings for ERROR_EAS_DIDNT_FIT,
ERROR_EAS_NOT_SUPPORTED, ERROR_EA_LIST_INCONSISTENT,
ERROR_EA_TABLE_FULL, ERROR_FILE_CORRUPT, ERROR_INVALID_EA_NAME.
* fhandler.h (class fhandler_base): Declare new fgetxattr and
fsetxattr methods.
(class fhandler_disk_file): Ditto.
* fhandler.cc (fhandler_base::fgetxattr): New method.
(fhandler_base::fsetxattr): New method.
* fhandler_disk_file.cc (fhandler_disk_file::fgetxattr): New method.
(fhandler_disk_file::fsetxattr): New method.
* ntdll.h (STATUS_EA_TOO_LARGE): Define.
(STATUS_NONEXISTENT_EA_ENTRY): Define.
(STATUS_NO_EAS_ON_FILE): Define.
* ntea.cc (read_ea): Rewrite for long pathnames and for using with
Linux extended attribute functions.
(write_ea): Ditto.
(getxattr_worker): New static function.
(getxattr): New function.
(lgetxattr): New function.
(fgetxattr): New function.
(listxattr): New function.
(llistxattr): New function.
(flistxattr): New function.
(setxattr_worker): New static function.
(setxattr): New function.
(lsetxattr): New function.
(fsetxattr): New function.
(removexattr): New function.
(lsetxattr): New function.
(fsetxattr): New function.
* security.h (read_ea): Change declaration according to above changes.
(write_ea): Ditto.
* include/cygwin/version.h: Bump API minor version.
2008-02-10 Corinna Vinschen <corinna@vinschen.de>
* libc/ftw.cc (ftw): Allow nfds <= 0 for glibc compatibility.
* libc/nftw.c (nftw): Ditto.
2008-02-07 Corinna Vinschen <corinna@vinschen.de>
* dtable.cc (dtable::init_std_file_from_handle): Set access to
read/write if handle is connected to a tty or console.
* fhandler_dsp.cc (fhandler_dev_dsp::dup): Set open flags correctly
after duplicating from archetype.
* fhandler_tty.cc (fhandler_tty_slave::dup): Ditto.
(fhandler_pty_master::dup): Ditto.
2008-02-06 Corinna Vinschen <corinna@vinschen.de>
* miscfuncs.cc (next_char): Fix typos in comment.
* strfuncs.cc: Remove cygserver guards.
2008-02-06 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h (fhandler_console::trunc_buf): Add to use as cache for
truncated multibyte characters on input.
(fhandler_console::write_replacement_char): Declare new method.
* fhandler_console.cc (CONVERT_LIMIT): Raise to 64K.
(fhandler_console::fhandler_console): Initialize trunc_buf.
(ERR): Define as independent value again.
(fhandler_console::write_replacement_char): New method to print
replacement chars.
(fhandler_console::write_normal): Add handling for truncated multibyte
sequences. Call next_char instead of pathetic CharNextExA function.
Don't change src, rather just work with found later on.
* miscfuncs.cc (is_cp_multibyte): Move here from strfuncs.cc.
Don't call Windows function, restrict to well-known ANSI/OEM codepages
and UTF-8.
(next_char): Call CharNextExA only for doublebyte codepages.
Implement for UTF-8 here.
* strfuncs.cc (is_cp_multibyte): Move to miscfuncs.cc.
* winsup.h (next_char): Declare.
* include/limits.h (MB_LEN_MAX): Set to maximum value of MB_CUR_MAX
as defined by newlib for now.
2008-02-05 Corinna Vinschen <corinna@vinschen.de>
* autoload.cc (CharToOemA): Remove.
(CharNextExA): Define.
* environ.cc (codepage_init): Un-static. Set active_codepage to
active codepage. Default to ansi regardless of buf pointer.
* fhandler.h (dev_console::get_console_cp): New method.
(dev_console::con_to_str): Change declaration according to new
implementation.
(dev_console::str_to_con): Ditto.
* fhandler_console.cc (cp_convert): Remove.
(dev_console::con_to_str): Redefine to take WCHAR as incoming console
char.
(dev_console::get_console_cp): Return correct codepage according to
alternate_charset_active setting.
(dev_console::str_to_con): Redefine to create WCHAR buffer for console
output.
(fhandler_console::read): Read console input as WCHARs.
(base_chars): Fix typo in comment.
(fhandler_console::char_command): Save and restore console output
buffer using UNICODE functions.
(fhandler_console::write_normal): Convert to write output in UNICODE.
Use CharNextExA to recognize multibyte characters in input. Workaround
problem with UTF-8 and MultiByteToWideChar. Simplify the loop for
printing "normal" characters.
* strfuncs.cc (active_codepage): New variable to store active codepage.
(get_cp): Call codepage_init() if active_codepage is uninitialized.
Just return active_codepage.
(is_cp_multibyte): New function.
* winsup.h (active_codepage): Declare.
(codepage_init): Declare.
(is_cp_multibyte): Declare.
2008-02-03 Brian Dessent <brian@dessent.net>
* smallprint.cc (__small_vsprintf): Use HEAP_NOTHEAP for type.
* strfuncs.cc (sys_wcstombs_alloc): Guard use of ccalloc
to !__OUTSIDE_CYGWIN__ for use in cygserver.
(sys_mbstowcs_alloc): Ditto.
2008-02-01 Corinna Vinschen <corinna@vinschen.de>
* miscfuncs.cc (cygwin_wcsncasecmp): Never access more than n
characters.
(cygwin_strncasecmp): Ditto. Fix for strings longer than n.
2008-02-01 Corinna Vinschen <corinna@vinschen.de>
* string.h: Re-enable inline strcasematch and strncasematch
implementations and rename to ascii_strcasematch/ascii_strncasematch.
* dcrt0.cc: Replace str[n]casematch with ascii_str[n]casematch where
applicable.
* environ.cc: Ditto.
* fhandler_process.cc: Ditto.
* hookapi.cc: Ditto.
* path.cc: Ditto.
* spawn.cc: Ditto.
* strace.cc: Ditto.
* syscalls.cc: Ditto.
* uinfo.cc: Ditto.
* winf.cc: Ditto.
2008-01-31 Corinna Vinschen <corinna@vinschen.de>
* dcrt0.cc (dll_crt0_1): Use GetCommandLineW and convert to current
codepage.
* environ.cc (set_file_api_mode): Always set file api to ANSI if not
using the OEM codepage.
(codepage_init): Allow "utf8" codepage.
* fhandler_clipboard.cc (set_clipboard): Convert clipbuf to void and
cast as needed. Always convert input to wide char and write
CF_UNICODETEXT to clipboard.
(fhandler_dev_clipboard::read): Read CF_UNICODETEXT from clipboard and
convert to current codepage if CYGWIN_NATIVE format is not available.
* fhandler_console.cc: Drop redundant undef.
* smallprint.cc (__small_vsprintf): Convert PWCHAR and UNICODE_STRING
to current codepage for printing.
* strfuncs.cc: Use PWCHAR throughout.
(get_cp): Return CP_UTF8 for utf8_cp codepage setting.
(sys_wcstombs): Allow NULL target buffer.
(sys_wcstombs_alloc): New function.
(sys_mbstowcs_alloc): Ditto.
* winsup.h (codepage_type): Add utf8_cp.
(HEAP_NOTHEAP): Define.
(sys_wcstombs_alloc): Declare.
(sys_mbstowcs_alloc): Declare.
2008-01-31 Corinna Vinschen <corinna@vinschen.de>
* cygheap.h (struct cwdstuff): Add dir member to store cwd handle.
(cwdstuff::get_handle): New method.
* path.cc (cwdstuff::set): When doit is true, always try to get
directory handle. Fail if duplicating handle fails. Store handle
in dir. Fix potential SEGV when setting drive_length.
2008-01-28 Corinna Vinschen <corinna@vinschen.de>
* path.cc: Fix Samba version in comment.
2008-01-24 Corinna Vinschen <corinna@vinschen.de>
* path.cc (fs_info::update): Fix old-style Samba test to support
recent as well as upcoming Samba releases.
2008-01-22 Corinna Vinschen <corinna@vinschen.de>
* ntdll.h (struct _FILE_FS_OBJECTID_INFORMATION): Define.
* path.cc (struct smb_extended_info): Define.
(fs_info::update): Request object id info to get Samba information.
Set flags according to new implementation.
* path.h (struct fs_info): Add samba_version to status_flags.
Implement flags() and samba_version() using IMPLEMENT_STATUS_FLAG.
2008-01-21 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_disk_file::link): Open file with
READ_CONTROL for Vista/Longhorn's sake.
2008-01-15 Corinna Vinschen <corinna@vinschen.de>
* Makefile.in (install-libs): Overwrite newlib's libg.a with symlink
to libcygwin.a.
2008-01-15 Corinna Vinschen <corinna@vinschen.de>
* Makefile.in (DLL_OFILES): Remove memmem.o.
* memmem.cc: Remove in favor of newlib implementation.
2008-01-07 Corinna Vinschen <corinna@vinschen.de>
* fhandler.h: Update copyright.
* include/limits.h: Ditto.
2008-01-06 Christopher Faylor <me+cygwin@cgf.cx>
* fhandler.h (fhandler_base::is_tty): Make bool.
(fhandler_serial::is_tty): Ditto.
(fhandler_termios::is_tty): Ditto.
(fhandler_base::is_slow): Return bool value.
(fhandler_socket::is_slow): Ditto.
(fhandler_serial::is_slow): Ditto.
(fhandler_console::is_slow): Ditto.
(fhandler_tty_common::is_slow): Ditto.
(fhandler_tty_master::is_slow): Ditto.
(fhandler_dev_null::is_slow): Ditto.
2008-01-06 Christopher Faylor <me+cygwin@cgf.cx>
* include/limits.h (TTY_NAME_MAX): Increase size to same as linux to
allow for (at least) null terminating byte for "/dev/console".
2008-01-01 Christopher Faylor <me+cygwin@cgf.cx>
* tty.cc: Update copyright.
* pipe.cc: Ditto.
2008-01-01 Christopher Faylor <me+cygwin@cgf.cx>
* newsym: First stab at understanding data as well as functions.
* pipe.cc (fhandler_pipe::init): Move more intelligence here.
(fhandler_pipe::create): Simplify based on above change.
* tty.cc (tty_list::allocate): Remove non-NT code.
|