- Notifications
You must be signed in to change notification settings - Fork5k
Commit3c4e26a
committed
In username-map substitution, cope with more than one \1.
If the system-name field of a pg_ident.conf line is a regexcontaining capturing parentheses, you can write \1 in theuser-name field to represent the captured part of the systemname. But what happens if you write \1 more than once?The only reasonable expectation IMO is that each \1 getsreplaced, but presently our code replaces only the first.Fix that.Also, improve the tests for this feature to exercise caseswhere a non-empty string needs to be substituted for \1.The previous testing didn't inspire much faith that itwas verifying correct operation of the substitution code.Given the lack of field complaints about this, I don'tfeel a need to back-patch.Reported-by: David G. Johnston <david.g.johnston@gmail.com>Author: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/CAKFQuwZu6kZ8ZPvJ3pWXig+6UX4nTVK-hdL_ZS3fSdps=RJQQQ@mail.gmail.com1 parent092f3c6 commit3c4e26a
2 files changed
+40
-16
lines changedLines changed: 28 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2873 | 2873 |
| |
2874 | 2874 |
| |
2875 | 2875 |
| |
| 2876 | + | |
| 2877 | + | |
| 2878 | + | |
2876 | 2879 |
| |
2877 |
| - | |
| 2880 | + | |
2878 | 2881 |
| |
2879 | 2882 |
| |
2880 | 2883 |
| |
| |||
2886 | 2889 |
| |
2887 | 2890 |
| |
2888 | 2891 |
| |
| 2892 | + | |
| 2893 | + | |
2889 | 2894 |
| |
2890 | 2895 |
| |
2891 |
| - | |
2892 |
| - | |
| 2896 | + | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
2893 | 2901 |
| |
2894 |
| - | |
2895 |
| - | |
2896 |
| - | |
2897 |
| - | |
2898 |
| - | |
2899 |
| - | |
2900 |
| - | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
2901 | 2919 |
| |
2902 | 2920 |
| |
2903 | 2921 |
| |
|
Lines changed: 12 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
171 | 171 |
| |
172 | 172 |
| |
173 | 173 |
| |
174 |
| - | |
| 174 | + | |
| 175 | + | |
175 | 176 |
| |
176 | 177 |
| |
177 | 178 |
| |
| |||
210 | 211 |
| |
211 | 212 |
| |
212 | 213 |
| |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
213 | 218 |
| |
214 | 219 |
| |
215 |
| - | |
| 220 | + | |
| 221 | + | |
216 | 222 |
| |
217 | 223 |
| |
218 |
| - | |
| 224 | + | |
219 | 225 |
| |
220 | 226 |
| |
221 | 227 |
| |
| |||
224 | 230 |
| |
225 | 231 |
| |
226 | 232 |
| |
227 |
| - | |
228 |
| - | |
| 233 | + | |
| 234 | + | |
229 | 235 |
| |
230 | 236 |
| |
231 |
| - | |
| 237 | + | |
232 | 238 |
| |
233 | 239 |
| |
234 | 240 |
| |
|
0 commit comments
Comments
(0)