Subject: more on PR 6009 (islinktodir)
To: None <jbernard@ox.mines.edu>
From: Hubert Feyrer <feyrer@rfhs8012.fh-regensburg.de>
List: tech-pkg
Date: 08/25/1998 03:59:20
I was thinking more about the suggested islinktodir() function, and i keep
seeing new problems with it:

The function does much more than just check if something is a link to a
dir. This may bite people HARD in absolutely mysterious ways. Just imagine
some pkg not running as root or the user running pkg_add, e.g.  some pkg
that has it's own owner (like postgres) and that still wants to add some
symlink somewhere. You can't use this function there, although the name
indicated no expectable problems. Another example where this fails is if
someone has his /usr/pkg mode g+w, which I have on some machines.

The "security check" is a nice idea, but one needs to know first, what 
"security" actually *is*. 

For now, I'll replace the places where isdir() is called (and where it
makes sense!) with "isdir() || islinktodir()" with a simpler
implementation of the named function, and if needs arise, we can still
enhance the enforced security.


 - Hubert

--
Hubert Feyrer <hubert.feyrer@rz.uni-regensburg.de>