shithub: gefs

Download patch

ref: 6a2f4b2d138dab8a06813ae6ac6ce2077153bd60
parent: 5e18d9b27f3c0c025afe06adc7f3bc2fb8a193c9
author: Michael Forney <mforney@mforney.org>
date: Wed Mar 2 03:48:16 EST 2022

fs: adjust initial mode by directory on create

--- a/fs.c
+++ b/fs.c
@@ -1124,6 +1124,10 @@
 	d.qid.path = inc64(&fs->nextqid, 1);
 	d.qid.vers = 0;
 	d.mode = m->perm;
+	if(m->perm & DMDIR)
+		d.mode &= ~0777 | de->mode & 0777;
+	else
+		d.mode &= ~0666 | de->mode & 0666;
 	d.name = m->name;
 	d.atime = nsec();
 	d.mtime = d.atime;