Fix root -w case according to manpage (-x & -r cases already accords)

Pointed by Bruce.
This commit is contained in:
Andrey A. Chernov 1994-11-05 20:24:49 +00:00
parent 692a99c012
commit 20662469d5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=4170

View File

@ -33,7 +33,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: test.c,v 1.6 1994/11/05 17:28:03 ache Exp $
* $Id: test.c,v 1.7 1994/11/05 17:31:23 ache Exp $
*/
#ifndef lint
@ -347,9 +347,12 @@ expr_operator(op, sp, fs)
i = S_IROTH;
goto permission;
case ISWRITE:
if (geteuid() == 0)
goto exist;
i = S_IWOTH;
if (geteuid() != 0)
i = S_IWOTH;
else {
i = S_IWOTH|S_IWGRP|S_IWUSR;
goto filebit;
}
goto permission;
case ISEXEC:
if (geteuid() != 0) {