Skip to content

Commit

Permalink
variables: Relax variable name validation
Browse files Browse the repository at this point in the history
Fixes #700
  • Loading branch information
tchx84 committed Jul 13, 2024
1 parent 92e675e commit ed6b940
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/models/variables.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const {GObject} = imports.gi;
const {FlatpakSharedModel} = imports.models.shared;
const {FlatsealOverrideStatus} = imports.models.overrideStatus;

var VAR_REGEXP = /^\w+=[\S ]+$/;
var VAR_REGEXP = /^[^;]+=[\S ]+$/;

var FlatpakVariablesModel = GObject.registerClass({
GTypeName: 'FlatpakVariablesModel',
Expand Down Expand Up @@ -75,7 +75,7 @@ var FlatpakVariablesModel = GObject.registerClass({

static deserialize(value) {
return value
.split(/(?=;[\w\s]+=)/)
.split(/(?=;[^;]+=)/)
.map(v => v.replace(/^;/, ''));
}

Expand Down
2 changes: 1 addition & 1 deletion tests/src/testModels.js
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ describe('Model', function() {

expect(permissionsDefault.variables).toEqual('TEST=yes');

permissionsDefault.set_property('variables', 'TEST=yes;TE ST=no');
permissionsDefault.set_property('variables', 'TEST=yes;TE;ST=no');

GLib.timeout_add(GLib.PRIORITY_HIGH, delay + 1, () => {
expect(GLib.access(_environmentOverride, 0)).toEqual(-1);
Expand Down

0 comments on commit ed6b940

Please sign in to comment.