Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Sanitize inputs for Oolite-manifests.plist

An area for discussing new ideas and additions to Oolite.

Moderators: another_commander, winston

Post Reply
User avatar
Ramen
Deadly
Deadly
Posts: 138
Joined: Sat Apr 18, 2015 5:36 pm
Location: Mountain View, CA, USA
Contact:

Sanitize inputs for Oolite-manifests.plist

Post by Ramen »

So we had an issue today where someone accidentally forgot to escape a quote properly and the entire plist became invalid. I think it would be a good idea to make sure that doesn't happen again.
That is not my desk.
I find this lack of milk... disturbing.
User avatar
hiran
Theorethicist
Posts: 2090
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Sanitize inputs for Oolite-manifests.plist

Post by hiran »

Ramen wrote: Wed Sep 01, 2021 3:07 am
So we had an issue today where someone accidentally forgot to escape a quote properly and the entire plist became invalid. I think it would be a good idea to make sure that doesn't happen again.
Well, that's what syntax errors are about. They can come at runtime.
I think a better aproach would be to harden Oolite so it can handle the situation and guide the user.

What was the outcome BTW? How does Oolite behave is "the entire plist is invalid"?
Sunshine - Moonlight - Good Times - Oolite
User avatar
Ramen
Deadly
Deadly
Posts: 138
Joined: Sat Apr 18, 2015 5:36 pm
Location: Mountain View, CA, USA
Contact:

Re: Sanitize inputs for Oolite-manifests.plist

Post by Ramen »

hiran wrote: Wed Sep 01, 2021 3:40 pm
What was the outcome BTW? How does Oolite behave is "the entire plist is invalid"?
It rejects the entire OXP list and defaults to the old one. As for hardening, yeah that's kind of what I meant, maybe I didn't say that clearly enough.
That is not my desk.
I find this lack of milk... disturbing.
User avatar
Cmdr James
Commodore
Commodore
Posts: 1357
Joined: Tue Jun 05, 2007 10:43 pm
Location: Berlin

Re: Sanitize inputs for Oolite-manifests.plist

Post by Cmdr James »

Maybe Im a bit OCD about this, but we shouldnt try to work around things like unmatched or wrongly escaped quotes, this is a recipe for flaky half working code which mysteriously stops working from time to time.

We should simply log the error clearly or better provide an easy to use OXP validation tool which supports development by clearly identifying issues.
User avatar
hiran
Theorethicist
Posts: 2090
Joined: Fri Mar 26, 2021 1:39 pm
Location: a parallel world I created for myself. Some call it a singularity...

Re: Sanitize inputs for Oolite-manifests.plist

Post by hiran »

Ramen wrote: Wed Sep 01, 2021 7:51 pm
hiran wrote: Wed Sep 01, 2021 3:40 pm
What was the outcome BTW? How does Oolite behave is "the entire plist is invalid"?
It rejects the entire OXP list and defaults to the old one. As for hardening, yeah that's kind of what I meant, maybe I didn't say that clearly enough.
Then I had understood you wrongly. Since you mentioned "ensure this does not happen again" I thought we ensure there are no more OXPs with syntactically wrong plist files. Which is something we should strive for but it is different from hardening Oolite to handle the situation.
Sunshine - Moonlight - Good Times - Oolite
Post Reply