shithub: clone

Download patch

ref: 7026f4a83d50b8f61a05bba3b93e1b26d3e5b645
parent: cd8c54c512155e589f46bffde65dadd7653f42eb
author: kvik <[email protected]>
date: Tue Oct 30 11:57:54 EDT 2018

only dirs get forced write permission

--- a/clone.c
+++ b/clone.c
@@ -135,7 +135,7 @@
 	Dir d;
 
 	nulldir(&d);
-	d.mode = mode | 0200;
+	d.mode = mode;
 	if(dirwstat(name, &d) < 0)
 		error("can't wstat");
 }
@@ -240,7 +240,7 @@
 			mkdir(dn, d, 0);
 			clonedir(sn, dn);
 			if(keepmode)
-				chmod(dn, d->mode);
+				chmod(dn, d->mode | 0200);
 		}else{
 			f = filenew(sn, dn, d);
 			sendp(filechan, f);