fix other half of the text file busy problem:

don't allow user to exec a file if it's open for writing
This commit is contained in:
cgd 1993-04-29 10:12:42 +00:00
parent 8f65320eb1
commit a823bc627d
1 changed files with 7 additions and 0 deletions

View File

@ -174,6 +174,13 @@ again: /* 05 Aug 92*/
if (rv)
goto exec_fail;
if (exdata.ex_hdr.a_text != 0 && (ndp->ni_vp->v_flag & VTEXT) == 0 &&
ndp->ni_vp->v_writecount != 0) {
rv = ETXTBSY;
goto exec_fail;
}
/* ... that we recognize? */
rv = ENOEXEC;
magic = exdata.ex_hdr.a_magic;