<html><head><meta http-equiv="content-type" content="text/html; charset=us-ascii"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">What about implementing a fake filesystem instead of allowing s7 to access the real one? In this way it will be effectively sandboxed. This is the approach used by emscripten to have ports work in webasm.<div><br></div><div>Max</div><div><br><div><br><blockquote type="cite"><div>On 3 Feb 2023, at 13:43, David St-Hilaire &lt;sthilaire.david@gmail.com&gt; wrote:</div><br class="Apple-interchange-newline"><div><meta charset="UTF-8"><div dir="ltr" style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">I think it's mostly writing to files that is dangerous but disabling reading would be important too, if not only for forbidding "breaking" the fantasy console barriers. I looked at doing some changes but I was really not sure how to do it properly. If you would be generous enough to do the&nbsp;needed changes, it would be really amazing!<div><br></div><div>Thank you so much for your help!</div></div><br style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div class="gmail_quote" style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div dir="ltr" class="gmail_attr">On Fri, Feb 3, 2023 at 8:32 AM &lt;<a href="mailto:bil@ccrma.stanford.edu">bil@ccrma.stanford.edu</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;">Do you need to disallow reading a file?&nbsp; If it's just<br>creating or altering a file that needs to be blocked,<br>you could redirect fopen and fwrite (in s7.c) to<br>functions that raise an error.&nbsp; I don't think s7 uses<br>creat, open (except with O_RDONLY), or write.&nbsp; Also<br>build it with WITH_C_LOADER=0 (to disallow dynamic<br>loading of C object code), and maybe WITH_SYSTEM_EXTRAS=0.<br>Hmmm... as I type this, this seems interesting --<br>maybe I'll tackle it later today.&nbsp; It might be<br>equally easy to disallow reading a file -- fread etc.<br>Oh, and for fopen, check the mode doesn't have "w" or "x"<br>or whatever else might change a file.&nbsp; I'm probably<br>forgetting something obvious.<br><br>(There's also the sandbox procedure in stuff.scm, but<br>it's been years since I looked at it).<br><br><br></blockquote></div><br clear="all" style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><br></div><span style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">--<span class="Apple-converted-space">&nbsp;</span></span><br style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><div dir="ltr" class="gmail_signature" style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;">David</div><span style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">_______________________________________________</span><br style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><span style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none; float: none; display: inline !important;">Cmdist mailing list</span><br style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><a href="mailto:Cmdist@ccrma.stanford.edu" style="font-family: HelveticaNeue; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">Cmdist@ccrma.stanford.edu</a><br style="caret-color: rgb(0, 0, 0); font-family: HelveticaNeue; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: none;"><a href="https://cm-mail.stanford.edu/mailman/listinfo/cmdist" style="font-family: HelveticaNeue; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">https://cm-mail.stanford.edu/mailman/listinfo/cmdist</a></div></blockquote></div><br></div></body></html>