"Paul B. Henson" <[email protected]> wrote: > On Fri, Oct 13, 2017 at 06:46:52PM -0700, Alan Coopersmith wrote: > > > You can always read the blog entries written by the engineer who > > implemented the getcwd() changes for Solaris: > > Thanks for the pointers; although other than the vague bullet point > "Don't fail with EACCES so quickly" I don't really see anything specific > about getcwd no longer failing in directory trees in which a user > doesn't have read access to a component or what considerations were > taken in the implementation of that.
In former times, getcwd() was implemented the usual way using readdir(), stat() and by comparing st_ino and st_dev. This will result in frequent EACCES situations. Later, getcwd() was implemented as a syscall in order to permit the Linux emulator as getcwd() is a syscall on Linux. The kernel can always return the best result, but it may be a security risk. I assume that the current implementation intentionally fails in security relevant situations. If you are able to proove that a specific error situation is not caused by something that uis a security problem, this may be changed. Jörg -- EMail:[email protected] (home) Jörg Schilling D-13353 Berlin [email protected] (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.org/private/ http://sf.net/projects/schilytools/files/' ------------------------------------------ illumos-discuss Archives: https://illumos.topicbox.com/groups/discuss/discussions/T1bf578bf66b8b8b0-Medd59d27fa245a8ee42b20fc Powered by Topicbox: https://topicbox.com
