shithub: riscv

Download patch

ref: 0803fab7c33f0ea21405ae1ff8b11f62bba73bca
parent: 39bf5b987e8ab53a74adec5a15b30f4eda85b357
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri May 19 19:44:49 EDT 2023

libip: open temporary file-descriptors with OCEXEC flag

--- a/sys/src/libip/myetheraddr.c
+++ b/sys/src/libip/myetheraddr.c
@@ -13,7 +13,7 @@
 	else
 		snprint(buf, sizeof buf, "/net/%s/addr", dev);
 
-	fd = open(buf, OREAD);
+	fd = open(buf, OREAD|OCEXEC);
 	if(fd < 0)
 		return -1;
 
--- a/sys/src/libip/readipifc.c
+++ b/sys/src/libip/readipifc.c
@@ -63,7 +63,7 @@
 	Iplifc *lifc, **ll;
 
 	/* read the file */
-	fd = open(file, OREAD);
+	fd = open(file, OREAD|OCEXEC);
 	if(fd < 0)
 		return l;
 	n = 0;
@@ -177,7 +177,7 @@
 		snprint(buf, sizeof(buf), "%s/%d/status", directory, index);
 		_readipifc(buf, l, index);
 	} else {
-		fd = open(directory, OREAD);
+		fd = open(directory, OREAD|OCEXEC);
 		if(fd < 0)
 			return nil;
 		n = dirreadall(fd, &dir);