diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2013-04-11 15:43:25 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2013-05-06 16:22:24 +0200 |
commit | 4ae3372682f6c172ae64455bdf42ea145d4e9111 (patch) | |
tree | 5c067fda51d5095d9dfc634b5378103f9aa54257 /install/ui/src/freeipa | |
parent | dc6995ed7b66044e78e001dd9afd416c576934bc (diff) | |
download | freeipa-4ae3372682f6c172ae64455bdf42ea145d4e9111.tar.gz freeipa-4ae3372682f6c172ae64455bdf42ea145d4e9111.tar.xz freeipa-4ae3372682f6c172ae64455bdf42ea145d4e9111.zip |
Builder: fix infinite loop when using spec with circular dependency
https://fedorahosted.org/freeipa/ticket/3235
Diffstat (limited to 'install/ui/src/freeipa')
-rw-r--r-- | install/ui/src/freeipa/_base/Builder.js | 5 | ||||
-rw-r--r-- | install/ui/src/freeipa/_base/construct.js | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/install/ui/src/freeipa/_base/Builder.js b/install/ui/src/freeipa/_base/Builder.js index 063261f37..0eb76c4a7 100644 --- a/install/ui/src/freeipa/_base/Builder.js +++ b/install/ui/src/freeipa/_base/Builder.js @@ -149,7 +149,7 @@ define(['dojo/_base/declare', pre = spec.$pre_ops, post = spec.$post_ops; - var s = lang.clone(spec); + var s = lang.mixin({},spec); delete s.$ctor; delete s.$factory; delete s.$mixim_spec; @@ -214,6 +214,9 @@ define(['dojo/_base/declare', var cs = construction_spec, obj = null; + // here we should clone cs.spec to prevent modification of original + // by pre_ops + cs.spec = this._run_preops(this.pre_ops, cs.spec, context); if (cs.pre_ops) { cs.spec = this._run_preops(cs.pre_ops, cs.spec, context); diff --git a/install/ui/src/freeipa/_base/construct.js b/install/ui/src/freeipa/_base/construct.js index 19829bd84..bc017ad66 100644 --- a/install/ui/src/freeipa/_base/construct.js +++ b/install/ui/src/freeipa/_base/construct.js @@ -45,8 +45,8 @@ define(['dojo/_base/declare', * It makes sure that pre_ops, post_ops and spec are new Arrays/Object */ copy_cs: function(org_cs) { - var cs = lang.clone(org_cs); - if (cs.spec) cs.spec = lang.clone(cs.spec); + var cs = lang.mixin({}, org_cs); + if (cs.spec) cs.spec = lang.mixin({}, cs.spec); cs.pre_ops = cs.pre_ops.slice(0); cs.post_ops = cs.pre_ops.slice(0); return cs; |