[JIRA] (JENKINS-58571) It's possible to use renameTo for AbstractItem that has name NOT editable.

0 views
Skip to first unread message

ajard@cloudbees.com (JIRA)

unread,
Jul 19, 2019, 8:18:02 AM7/19/19
to jenkinsc...@googlegroups.com
A. Jard created an issue
 
Jenkins / Bug JENKINS-58571
It's possible to use renameTo for AbstractItem that has name NOT editable.
Issue Type: Bug Bug
Assignee: Unassigned
Components: core
Created: 2019-07-19 12:17
Priority: Major Major
Reporter: A. Jard

The “isNameEditable” value is not checked before doing the real rename action on the renameTo method:

https://github.com/jenkinsci/jenkins/blob/38e94d197e65af66da67afdc5ebb5d8c0fcf3377/core/src/main/java/hudson/model/AbstractItem.java#L353

The rename method can lead to very bad issues if it’s used with item that must not be renamed, the “isNameEditable” must be check before doing any rename action.

I am doing a PR with a unit test and a code change, I will update this JIRA just after.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

ajard@cloudbees.com (JIRA)

unread,
Jul 19, 2019, 8:34:02 AM7/19/19
to jenkinsc...@googlegroups.com
A. Jard updated an issue
Change By: A. Jard
The “isNameEditable” value is not checked before doing the real rename action on the renameTo method:

[ https://github.com/jenkinsci/jenkins/blob/38e94d197e65af66da67afdc5ebb5d8c0fcf3377/core/src/main/java/hudson/model/AbstractItem.java#L353 ]

The rename method can lead to very bad issues if it’s used with item that must not be renamed, the “isNameEditable” must be check before doing any rename action.

I am doing did a PR with a unit test and a code change, I will update this JIRA just after changes and unit tests:  https://github . com/jenkinsci/jenkins/pull/4122

dbeck@cloudbees.com (JIRA)

unread,
Aug 20, 2019, 12:27:04 PM8/20/19
to jenkinsc...@googlegroups.com
Daniel Beck resolved as Fixed
Change By: Daniel Beck
Status: Open Resolved
Resolution: Fixed
Released As: 2.190

dbeck@cloudbees.com (JIRA)

unread,
Aug 20, 2019, 12:27:04 PM8/20/19
to jenkinsc...@googlegroups.com
Daniel Beck commented on Bug JENKINS-58571
 
Re: It's possible to use renameTo for AbstractItem that has name NOT editable.

Needs followup Javadoc fix as I commented in the PR.

Reply all
Reply to author
Forward
0 new messages