vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| > > Indeed, that's definitly a bug. Quick patch attached. It > does appear > > to work, but there may be a better way? > > This patch introduces a security hole because an attacker > could create, say, a suitable symlink between the time the > name is generated and the file is opened. Good point. I guess what I need to do is use open() specifying O_CREATE, and then fdopen() that file. Question: Is the use of O_TEMPORARY to open() portable? (my win32 docs say it will make the file automatically deleted when the last descriptor is closed, which I didn't know before. That would make the patch much simpler, but might require #ifdefs?) //Magnus ---------------------------(end of broadcast)--------------------------- TIP 5: don't forget to increase your free space map settings |
| ||||
| Am Donnerstag, 20. April 2006 13:03 schrieb Magnus Hagander: > Question: Is the use of O_TEMPORARY to open() portable? (my win32 docs > say it will make the file automatically deleted when the last descriptor > is closed, which I didn't know before. That would make the patch much > simpler, but might require #ifdefs?) I think it would be more elegant if you wrote a replacement implementation of tmpfile() for pgport and did not change pg_dump at all. And/or write a bug to Microsoft about a buggy C library. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match |