-
-
Notifications
You must be signed in to change notification settings - Fork 102
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
Allow qube (template) sending basic OS metadata #578
Conversation
qubes/ext/core_features.py
Outdated
safe_set = string.digits + ".-" | ||
untrusted_version = untrusted_features["os-version"] | ||
if all(c in safe_set for c in untrusted_version): | ||
vm.features["os-version"] = untrusted_version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be required to start with a digit?
qubes/ext/core_features.py
Outdated
if "os-eol" in untrusted_features: | ||
untrusted_eol = untrusted_features["os-eol"] | ||
valid = False | ||
if re.match(r"\d{4}-\d{2}-\d{2}", untrusted_eol): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if re.match(r"\d{4}-\d{2}-\d{2}", untrusted_eol): | |
if re.match(r"\A\d{4}-\d{2}-\d{2}\Z", untrusted_eol): |
don’t allow trailing junk
f699bb4
to
ec6108d
Compare
qubes/ext/core_features.py
Outdated
@@ -34,6 +36,32 @@ async def qubes_features_request(self, vm, event, untrusted_features): | |||
'Ignoring qubes.NotifyTools for template-based VM') | |||
return | |||
|
|||
if "os-distribution" in untrusted_features: | |||
# entry point already validats values for safe characters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# entry point already validats values for safe characters | |
# entry point already validates values for safe characters |
1cbdec2
to
fa415a8
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #578 +/- ##
==========================================
+ Coverage 68.39% 68.45% +0.06%
==========================================
Files 56 56
Lines 11159 11181 +22
==========================================
+ Hits 7632 7654 +22
Misses 3527 3527
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Save distribution, version and EOL date in features. Fixes QubesOS/qubes-issues#8725
fa415a8
to
8fbb02b
Compare
Save distribution, version and EOL date in features.
Fixes QubesOS/qubes-issues#8725