forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit47bd0b3
committed
Replace load of functions by direct calls for some WIN32
This commit changes the following code paths to do direct system callsto some WIN32 functions rather than loading them from an externallibrary, shaving some code in the process:- Creation of restricted tokens in pg_ctl.c, introduced bya25cd81.- QuerySecurityContextToken() in auth.c for SSPI authentication in thebackend, introduced in d602592.- CreateRestrictedToken() in src/common/. This change is similar to thecase of pg_ctl.c.Most of these functions were loaded rather than directly called because,as mentioned in the code comments, MinGW headers were not declaringthem. I have double-checked the recent MinGW code, and all thefunctions changed here are declared in its headers, so this changeshould be safe. Note that I do not have a MinGW environment at hand soI have not tested it directly, but that MSVC was fine with the change.The buildfarm will tell soon enough if this change is appropriate or notfor a much broader set of environments.A few code paths still use GetProcAddress() to load some functions:- LDAP authentication for ldap_start_tls_sA(), where I am not confidentthat this change would work.- win32env.c and win32ntdll.c where we have a per-MSVC versiondependency for the name of the library loaded.- crashdump.c for MiniDumpWriteDump() and EnumDirTree(), where directcalls were not able to work after testing.Reported-by: Thomas MunroReviewed-by: Justin PrysbyDiscussion:https://postgr.es/m/CA+hUKG+BMdcaCe=P-EjMoLTCr3zrrzqbcVE=8h5LyNsSVHKXZA@mail.gmail.com1 parentdf4a056 commit47bd0b3
File tree
3 files changed
+47
-158
lines changed- src
- backend/libpq
- bin/pg_ctl
- common
3 files changed
+47
-158
lines changedLines changed: 1 addition & 28 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1201 | 1201 |
| |
1202 | 1202 |
| |
1203 | 1203 |
| |
1204 |
| - | |
1205 | 1204 |
| |
1206 | 1205 |
| |
1207 |
| - | |
1208 |
| - | |
1209 | 1206 |
| |
1210 | 1207 |
| |
1211 | 1208 |
| |
| |||
1358 | 1355 |
| |
1359 | 1356 |
| |
1360 | 1357 |
| |
1361 |
| - | |
1362 |
| - | |
1363 |
| - | |
1364 | 1358 |
| |
1365 | 1359 |
| |
1366 |
| - | |
1367 |
| - | |
1368 |
| - | |
1369 |
| - | |
1370 |
| - | |
1371 |
| - | |
1372 |
| - | |
1373 |
| - | |
1374 |
| - | |
1375 |
| - | |
1376 |
| - | |
1377 |
| - | |
1378 |
| - | |
1379 |
| - | |
1380 |
| - | |
1381 |
| - | |
1382 |
| - | |
| 1360 | + | |
1383 | 1361 |
| |
1384 |
| - | |
1385 |
| - | |
1386 | 1362 |
| |
1387 | 1363 |
| |
1388 |
| - | |
1389 |
| - | |
1390 |
| - | |
1391 | 1364 |
| |
1392 | 1365 |
| |
1393 | 1366 |
| |
|
Lines changed: 39 additions & 98 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1724 | 1724 |
| |
1725 | 1725 |
| |
1726 | 1726 |
| |
1727 |
| - | |
1728 |
| - | |
1729 |
| - | |
1730 |
| - | |
1731 |
| - | |
1732 |
| - | |
1733 |
| - | |
1734 |
| - | |
1735 |
| - | |
1736 |
| - | |
1737 |
| - | |
1738 | 1727 |
| |
1739 | 1728 |
| |
1740 | 1729 |
| |
| |||
1777 | 1766 |
| |
1778 | 1767 |
| |
1779 | 1768 |
| |
| 1769 | + | |
1780 | 1770 |
| |
1781 | 1771 |
| |
1782 | 1772 |
| |
1783 | 1773 |
| |
1784 |
| - | |
1785 |
| - | |
1786 |
| - | |
1787 |
| - | |
1788 |
| - | |
1789 |
| - | |
1790 |
| - | |
1791 |
| - | |
1792 |
| - | |
1793 |
| - | |
1794 | 1774 |
| |
1795 | 1775 |
| |
1796 | 1776 |
| |
| |||
1802 | 1782 |
| |
1803 | 1783 |
| |
1804 | 1784 |
| |
1805 |
| - | |
1806 |
| - | |
1807 |
| - | |
1808 |
| - | |
1809 |
| - | |
1810 |
| - | |
1811 |
| - | |
1812 |
| - | |
1813 |
| - | |
1814 |
| - | |
1815 |
| - | |
1816 |
| - | |
1817 |
| - | |
1818 |
| - | |
1819 | 1785 |
| |
1820 | 1786 |
| |
1821 | 1787 |
| |
| |||
1848 | 1814 |
| |
1849 | 1815 |
| |
1850 | 1816 |
| |
1851 |
| - | |
1852 |
| - | |
1853 |
| - | |
1854 |
| - | |
1855 |
| - | |
1856 |
| - | |
1857 |
| - | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
1858 | 1824 |
| |
1859 | 1825 |
| |
1860 | 1826 |
| |
1861 | 1827 |
| |
1862 | 1828 |
| |
1863 |
| - | |
1864 | 1829 |
| |
1865 | 1830 |
| |
1866 | 1831 |
| |
| |||
1872 | 1837 |
| |
1873 | 1838 |
| |
1874 | 1839 |
| |
1875 |
| - | |
1876 |
| - | |
1877 |
| - | |
1878 |
| - | |
1879 |
| - | |
1880 |
| - | |
1881 |
| - | |
1882 |
| - | |
1883 |
| - | |
1884 |
| - | |
1885 |
| - | |
1886 |
| - | |
| 1840 | + | |
1887 | 1841 |
| |
1888 |
| - | |
1889 |
| - | |
1890 |
| - | |
1891 |
| - | |
1892 |
| - | |
1893 |
| - | |
1894 |
| - | |
1895 |
| - | |
| 1842 | + | |
1896 | 1843 |
| |
1897 |
| - | |
1898 |
| - | |
1899 |
| - | |
1900 |
| - | |
1901 |
| - | |
1902 |
| - | |
1903 |
| - | |
1904 |
| - | |
1905 |
| - | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
1906 | 1851 |
| |
1907 |
| - | |
1908 |
| - | |
| 1852 | + | |
| 1853 | + | |
1909 | 1854 |
| |
1910 |
| - | |
1911 |
| - | |
1912 |
| - | |
1913 |
| - | |
1914 |
| - | |
1915 |
| - | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
1916 | 1861 |
| |
1917 |
| - | |
1918 |
| - | |
1919 |
| - | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
1920 | 1865 |
| |
1921 |
| - | |
1922 |
| - | |
1923 |
| - | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
1924 | 1869 |
| |
1925 |
| - | |
1926 |
| - | |
1927 |
| - | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
1928 | 1873 |
| |
1929 |
| - | |
| 1874 | + | |
1930 | 1875 |
| |
1931 |
| - | |
1932 |
| - | |
1933 |
| - | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
1934 | 1879 |
| |
1935 |
| - | |
1936 |
| - | |
| 1880 | + | |
1937 | 1881 |
| |
1938 | 1882 |
| |
1939 | 1883 |
| |
1940 | 1884 |
| |
1941 |
| - | |
1942 | 1885 |
| |
1943 | 1886 |
| |
1944 | 1887 |
| |
1945 | 1888 |
| |
1946 |
| - | |
1947 |
| - | |
1948 | 1889 |
| |
1949 | 1890 |
| |
1950 | 1891 |
| |
|
Lines changed: 7 additions & 32 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
31 |
| - | |
32 |
| - | |
33 | 31 |
| |
34 | 32 |
| |
35 | 33 |
| |
| |||
52 | 50 |
| |
53 | 51 |
| |
54 | 52 |
| |
55 |
| - | |
56 |
| - | |
57 | 53 |
| |
58 | 54 |
| |
59 | 55 |
| |
60 | 56 |
| |
61 |
| - | |
62 |
| - | |
63 |
| - | |
64 |
| - | |
65 |
| - | |
66 |
| - | |
67 |
| - | |
68 |
| - | |
69 |
| - | |
70 |
| - | |
71 |
| - | |
72 |
| - | |
73 |
| - | |
74 |
| - | |
75 |
| - | |
76 |
| - | |
77 |
| - | |
78 |
| - | |
79 | 57 |
| |
80 | 58 |
| |
81 | 59 |
| |
82 | 60 |
| |
83 | 61 |
| |
84 |
| - | |
85 | 62 |
| |
86 | 63 |
| |
87 | 64 |
| |
| |||
97 | 74 |
| |
98 | 75 |
| |
99 | 76 |
| |
100 |
| - | |
101 | 77 |
| |
102 | 78 |
| |
103 | 79 |
| |
104 |
| - | |
105 |
| - | |
106 |
| - | |
107 |
| - | |
108 |
| - | |
109 |
| - | |
110 |
| - | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
111 | 87 |
| |
112 | 88 |
| |
113 | 89 |
| |
114 | 90 |
| |
115 |
| - | |
116 | 91 |
| |
117 | 92 |
| |
118 | 93 |
| |
|
0 commit comments
Comments
(0)