forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit13c00ae
committed
Fix portability bugs in use of credentials control messages for peer auth.
Even though our existing code for handling credentials control messages hasbeen basically unchanged since 2001, it was fundamentally wrong: it did notensure proper alignment of the supplied buffer, and it was calculatingbuffer sizes and message sizes incorrectly. This led to failures onplatforms where alignment padding is relevant, for instance FreeBSD on64-bit platforms, as seen in a recent Debian bug report passed on byMartin Pitt (http://bugs.debian.org//cgi-bin/bugreport.cgi?bug=612888).Rewrite to do the message-whacking using the macros specified in RFC 2292,following a suggestion from Theo de Raadt in that thread. Tested by meon Debian/kFreeBSD-amd64; since OpenBSD and NetBSD document the identicalCMSG API, it should work there too.Back-patch to all supported branches.1 parentb4b6923 commit13c00ae
2 files changed
+47
-35
lines changedLines changed: 35 additions & 25 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1788 | 1788 |
| |
1789 | 1789 |
| |
1790 | 1790 |
| |
1791 |
| - | |
| 1791 | + | |
1792 | 1792 |
| |
1793 | 1793 |
| |
1794 | 1794 |
| |
| |||
1843 | 1843 |
| |
1844 | 1844 |
| |
1845 | 1845 |
| |
1846 |
| - | |
| 1846 | + | |
1847 | 1847 |
| |
1848 | 1848 |
| |
1849 | 1849 |
| |
| |||
1878 | 1878 |
| |
1879 | 1879 |
| |
1880 | 1880 |
| |
1881 |
| - | |
1882 |
| - | |
1883 |
| - | |
| 1881 | + | |
1884 | 1882 |
| |
1885 | 1883 |
| |
1886 | 1884 |
| |
| |||
1894 | 1892 |
| |
1895 | 1893 |
| |
1896 | 1894 |
| |
1897 |
| - | |
1898 |
| - | |
1899 |
| - | |
1900 |
| - | |
1901 |
| - | |
1902 |
| - | |
1903 |
| - | |
1904 | 1895 |
| |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
1905 | 1903 |
| |
1906 | 1904 |
| |
| 1905 | + | |
1907 | 1906 |
| |
1908 | 1907 |
| |
1909 |
| - | |
1910 |
| - | |
1911 |
| - | |
1912 |
| - | |
1913 |
| - | |
1914 |
| - | |
1915 |
| - | |
1916 | 1908 |
| |
1917 |
| - | |
1918 |
| - | |
1919 |
| - | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
1920 | 1912 |
| |
1921 | 1913 |
| |
1922 | 1914 |
| |
1923 | 1915 |
| |
1924 |
| - | |
1925 |
| - | |
1926 |
| - | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
1927 | 1924 |
| |
1928 | 1925 |
| |
1929 | 1926 |
| |
1930 | 1927 |
| |
1931 | 1928 |
| |
1932 | 1929 |
| |
1933 | 1930 |
| |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
1934 | 1944 |
| |
1935 | 1945 |
| |
1936 | 1946 |
| |
|
Lines changed: 12 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
693 | 693 |
| |
694 | 694 |
| |
695 | 695 |
| |
696 |
| - | |
697 |
| - | |
698 |
| - | |
699 |
| - | |
700 |
| - | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
701 | 702 |
| |
702 | 703 |
| |
703 | 704 |
| |
| |||
713 | 714 |
| |
714 | 715 |
| |
715 | 716 |
| |
716 |
| - | |
717 |
| - | |
718 |
| - | |
719 |
| - | |
720 |
| - | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
721 | 723 |
| |
722 | 724 |
| |
723 | 725 |
| |
|
0 commit comments
Comments
(0)