commit c2e7337

Michael Forney  ·  2019-08-13 19:55:17 +0000 UTC
parent e1c2f8b
launch: Restrict flags when opening devices
1 files changed,  +4, -0
+4, -0
 1@@ -201,6 +201,10 @@ handle_socket_data(int socket)
 2 			fprintf(stderr, "path is not NULL terminated\n");
 3 			goto fail;
 4 		}
 5+		if (request.flags & (O_ACCMODE|O_NONBLOCK|O_CLOEXEC) != request.flags) {
 6+			fprintf(stderr, "invalid open flags\n");
 7+			goto fail;
 8+		}
 9 
10 		fd = open(path, request.flags);
11 		if (fd == -1) {