[FIXED SECURITY-127]

CONFIGURE permission shouldn't allow the type of the job to be changed.
That's more of CREATE+DELETE.

In any case, the code doesn't correctly handling submitting config.xml
for a different type.
This commit is contained in:
Kohsuke Kawaguchi committed 2014-09-02 16:12:47 -07:00
1 parent 31df138d69
commit 54d44502bd
2 files changed
+44 -3

No files matched your search

@@ -603,7 +603,13 @@ public abstract class AbstractItem extends Actionable implements Item, HttpDelet
}
// try to reflect the changes by reloading
new XmlFile(Items.XSTREAM, out.getTemporaryFile()).unmarshal(this);
Object o = new XmlFile(Items.XSTREAM, out.getTemporaryFile()).unmarshal(this);
if (o!=this) {
// ensure that we've got the same job type. extending this code to support updating
// to different job type requires destroying & creating a new job type
throw new IOException("Expecting "+this.getClass()+" but got "+o.getClass()+" instead");
}
Items.updatingByXml.set(true);
try {
onLoad(getParent(), getRootDir().getName());