-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
forcefully add .txt to all safe IO files #675
base: main
Are you sure you want to change the base?
forcefully add .txt to all safe IO files #675
Conversation
What's the reason for imposing the |
To stop people from writing executable scripts like .bat files |
@ASpoonPlaysGames build fails |
Add Safe I/O supports JSON and there is prractically no reason for Additionally, people who already use |
And, if we're talking making executable scripts, isn't much easier to just... open a link which downloads an .exe and tell the user to open it? The user has to MANUALLY open their titanfall 2 dir and go to R2Northstar/save_files/MOD.NAME/... Shouldnt we look into that as well? |
I don't think it matters what extension the file has at the end, as long as it can't result in code execution by PEBKAC. I do take issue with |
Not really. Before #674 The same cannot happen with We patched |
Literally how, safe IO works in strings from squirrel, so writing a binary format is just not gonna go well |
I think its still a problem that a mod can easily can do |
Probably but at least that requires an interaction from the user. The other one was zero-click. Nevertheless best to make an issue for this IMO so that we can keep track of it as it's unrelated to this PR at this point ^^ |
The data, necessarily, has to be plaintext. |
despite that its not uncommon to use a string as a container for binary data. |
strings in squirrel are null terminated, so good luck making a decent binary format with that. There is also not really any need for binary formats, just encode things as json and parse once on load, you arent gonna be doing things like texture streaming through this come on now |
Fun fact: They are not null terminated. Despite that, you cannot store binary data through safe i/o since we restrict data to only consist of ASCII characters. |
yes but almost every function interacting with them expects them to be and the last byte of the string is set to 0 in the contstructor |
Do we? |
This is a breaking change, all existing safe IO files wont be able to be read anymore since they wont have the .txt extension. I guess just get people to add it manually or something idk.
There is a absolutely a better solution than this, but yeah