shithub: gefs

Download patch

ref: 699de2dd014ad0925eb7b6f7862c21e0192bdac6
parent: 10751c463369951caaa071b1a3e1ea0d3b20f30a
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Apr 29 15:20:03 EDT 2023

fs: make permissive sufficiently permissive for setup

--- a/fs.c
+++ b/fs.c
@@ -811,6 +811,8 @@
 fsaccess(Fid *f, ulong fmode, int fuid, int fgid, int m)
 {
 	/* uid none gets only other permissions */
+	if(permissive)
+		return 0;
 	if(f->uid != 0) {
 		if(f->uid == fuid)
 			if((m & (fmode>>6)) == m)
@@ -1272,7 +1274,8 @@
 		}
 	}
 	if(op & Owgid){
-		if(!(f->uid == de->uid && ingroup(f->uid, n.gid))
+		if(!permissive
+		&& !(f->uid == de->uid && ingroup(f->uid, n.gid))
 		&& !(groupleader(f->uid, de->gid) && groupleader(f->uid, n.gid))){
 			rerror(m, Ewstatg);
 			goto Out;