From: Alan Cox Date: Wed, 8 Nov 2017 15:52:47 +0000 (+0000) Subject: syscall_fs: stop pipe() working with a r/o fs backing it X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=de6977375692d00b12fdbf3960101e240279f967;p=FUZIX.git syscall_fs: stop pipe() working with a r/o fs backing it --- diff --git a/Kernel/syscall_fs.c b/Kernel/syscall_fs.c index b4e07214..c4b1605a 100644 --- a/Kernel/syscall_fs.c +++ b/Kernel/syscall_fs.c @@ -324,6 +324,11 @@ arg_t _pipe(void) goto nogood2; } + if (ino->c_flags & CRDONLY) { + udata.u_error = EROFS; + goto nogood3; + } + udata.u_files[u2] = oft2; of_tab[oft1].o_ptr = 0; @@ -345,6 +350,8 @@ arg_t _pipe(void) uputw(u2, fildes + 1); return (0); + nogood3: + i_deref(ino); nogood2: oft_deref(oft1); udata.u_files[u1] = NO_FILE;