Is SVR2 /bin/sh backwards compatible to v7?

Guy Harris guy at auspex.UUCP
Tue Feb 7 05:26:31 AEST 1989


>>In the Sys V Rel 3 shell, test(1) uses stat(2) rather than access(2) to
>>determine accessibility of the mentioned file (not just for directories).
>
>Yup. Which is why directories in which you have permission to create new files
>return "writable" under SVR3 test(1) (seems obvious, doesn't it?), but direc-
>tories always return non-writable under BSD test(1).

Well, actually, the BSD "test" uses "open" for the "-r" and "-w" tests,
which is why it says that no directories are writable.  Had it used
"access", it would have reported that they're writable if the effective
UID had write permission, as per the 4.3BSD ACCESS(2) (and probably as
per other systems' ACCESS(2) as well):

	Notice that only access bits are checked.  A directory may be
	indicated as writable by "access", but an attempt to open it
	for writing will fail (although files may be created there)....

>Proper suid behavior is nice, too,

Actually, since the BSD one uses "open", it gives proper SUID behavior
as well.



More information about the Comp.sys.pyramid mailing list