On Wed, Jun 13, 2007 at 10:23:36AM -0700, [EMAIL PROTECTED] wrote: > Should I briefly lock (flock) the file when running open/fstat/fchmod then > to avoid issues? This may become a problem as pkg_*/make becomes more > parallelized (another student's goals for his SoC project).
Looking does not change the issue. The problem here to protect against is that a process renames a file between the stat and the chmod. See the classic tmp file class of security vulnerabilities. > Needless to say, pkg_* is by no means threadsafe in its current form > though. It uses some global vars that are currently not mutex locked, and > this type of file access is another issue (I wonder if spinlocking or > sleeping waiting for flock to finish would be better in this case). I'm perfectly aware of the state of pkg_install. I also believe that it is a bad idea to parallelise it, but I don't want to argue with FreeBSD/Ports about that. Joerg _______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"