Bug 810871

Summary: Not acceptable languages to write cobbler snippets
Product: [Community] Spacewalk Reporter: Stephen Herr <sherr>
Component: WebUIAssignee: Stephen Herr <sherr>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: high    
Version: 1.8CC: bmr, cperry, taw, vsira, xdmoon
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 690588 Environment:
Last Closed: 2012-11-01 16:19:29 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 690588, 825383    
Bug Blocks: 871344    

Description Stephen Herr 2012-04-09 13:42:49 UTC
+++ This bug was initially created as a clone of Bug #690588 +++

Description of problem:

When you click in the drop down option you see a list of impossible languages, including languages such as:

Basic
Brainfuck
cpp
VisualBasic

And others.

Version-Release number of selected component (if applicable):

5.4

How reproducible:

Always.

Steps to Reproduce:

1. Navigate to the Systems tab and click Kickstart then Kickstart Snippets 
2. Select "Create Snippet"
3. Click on the drop down for language type in the Content box 
  
Actual results:

Languages such as the listed above.


Expected results:

Only valid languages

Additional info:

--- Additional comment from cperry on 2011-03-24 14:02:10 EDT ---

Think this is the 'editarea' we ship to allow folks a text editor UI within Satellite. Used in a few areas of product. 

Grabbing src rpm

[cperry@cperry editarea]$ grep -irl brain * 
editarea_0_8_2/edit_area/edit_area_loader.js
editarea_0_8_2/edit_area/edit_area_full.js
editarea_0_8_2/edit_area/reg_syntax/brainfuck.js
editarea_0_8_2/exemples/exemple_full.html
editarea_0_8_2/docs/credits.html
editarea_0_8_2/docs/about.html
editarea_0_8_2/change_log.txt
editarea_0_8_2-bash.patch
editarea_0_8_2.zip
[cperry@cperry editarea]$ 


Within spacewalk code, we use edit area for:

[cperry@cperry java]$ grep -ir editarea *
code/webapp/WEB-INF/pages/common/fragments/editarea.jspf:<script language="javascript" type="text/javascript" src="/editarea/edit_area_full.js"></script>
code/webapp/WEB-INF/pages/common/fragments/editarea.jspf:editAreaLoader.init({
code/webapp/WEB-INF/pages/common/fragments/configuration/files/contents.jspf:<%@ include file="/WEB-INF/pages/common/fragments/editarea.jspf" %>
code/webapp/WEB-INF/pages/common/fragments/configuration/channel/create.jspf:<%@ include file="/WEB-INF/pages/common/fragments/editarea.jspf" %>
code/webapp/WEB-INF/pages/common/fragments/kickstart/advanced/details.jspf:<%@ include file="/WEB-INF/pages/common/fragments/editarea.jspf" %>
code/webapp/WEB-INF/pages/admin/catalina.jsp:<script language="javascript" type="text/javascript" src="/editarea/edit_area_full.js"></script>
code/webapp/WEB-INF/pages/admin/catalina.jsp:editAreaLoader.init({
code/webapp/WEB-INF/pages/kickstart/cobbler/snippetview.jsp:<%@ include file="/WEB-INF/pages/common/fragments/editarea.jspf" %>
code/webapp/WEB-INF/pages/kickstart/cobbler/snippetdetails.jsp:<%@ include file="/WEB-INF/pages/common/fragments/editarea.jspf" %>
code/webapp/WEB-INF/pages/kickstart/scriptcreate.jsp:<%@ include file="/WEB-INF/pages/common/fragments/editarea.jspf" %>
code/webapp/WEB-INF/pages/kickstart/scriptedit.jsp:<%@ include file="/WEB-INF/pages/common/fragments/editarea.jspf" %>
spacewalk-java.spec:- making the editarea not highlight by default (jsherril)
spacewalk-java.spec:- fixed syntax highliging in editarea textareas
spacewalk-java.spec:- Make spacewalk use the editarea RPM and remove supplied editarea files (colin.coe)
[cperry@cperry java]$ 


So, configuration, kickstart scripts and cobbler snippets. 

We can likely modify editarea src.rpm with patch to remove a bunch of these languages which do not make sense in anaconda and Linux config stuff in general. 

Cliff

--- Additional comment from sherr on 2012-04-04 11:29:56 EDT ---

Note to developer, whereas technically you can have anything at all in in kickstart snippet, the desire here is to limit the syntax highlighting options in the editor to common useful languages. I'm going to define those languages as:

bash, perl, php, python, ruby, xml

Note in addition that if you change the languages available in the editarea jar, you will be affecting every place we use an editarea, so including (but not limited to)

1) config file editing
2) kickstart snippets
3) kickstart pre/post sections

Comment 1 Stephen Herr 2012-04-09 13:52:14 UTC
Committed to Spacewalk master: 91e2cc74c8a6e81c7b3faee7866c609c04463449

Comment 3 Jan Pazdziora 2012-10-30 19:24:12 UTC
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/

Comment 4 Jan Pazdziora 2012-11-01 16:19:29 UTC
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18