- Notifications
You must be signed in to change notification settings - Fork5
Commit843657b
committed
attached is take-2 of a patch which fixes a bug related
to the use of getpwuid when running in standalone mode.this patch allocates some persistent storage (usingstrdup) to store the username obtained with getpwuidin src/backend/main/main.c. this is necessary becauselater on, getpwuid is called again (in ValidateBinary).the man pages for getpwuid on SCO OpenServer, FreeBSD,and Darwin all have words to this effect (this is fromthe SCO OpenServer man page): Note ==== All information is contained in a static area, so it must be copied if it is to be saved. Otherwise, it may be overwritten on subsequent calls to these routines.in particular, on my platform, the storage used to holdthe pw_name from the first call is overwritten such thatit looks like an empty username. this causes a problemlater on in SetSessionUserIdFromUserName.i'd assume this isn't a problem on most platforms becausegetpwuid is called with the same UID both times, and thesame thing ends up happening to that static storage eachtime. however, that's not guaranteed, and is _not_ whathappens on my platform (at least :).this is for the version of 7.1 available via anon cvs asof Tue Jan 23 15:14:00 2001 PST: .../src/backend/main/main.c,v 1.37 2000/12/31 18:04:35 tgl Exp-michael thornburgh, zenomt@armory.com1 parentcb5427e commit843657b
1 file changed
+4
-2
lines changedLines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
13 | 13 |
| |
14 | 14 |
| |
15 | 15 |
| |
16 |
| - | |
| 16 | + | |
17 | 17 |
| |
18 | 18 |
| |
19 | 19 |
| |
| |||
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
| 56 | + | |
56 | 57 |
| |
57 | 58 |
| |
58 | 59 |
| |
| |||
158 | 159 |
| |
159 | 160 |
| |
160 | 161 |
| |
| 162 | + | |
161 | 163 |
| |
162 |
| - | |
| 164 | + | |
163 | 165 |
|
0 commit comments
Comments
(0)