Bug 198670

Summary: bogus chars show up in custom scripts for kickstarts
Product: Red Hat Satellite 5 Reporter: Matthew Davis <mdavis>
Component: ProvisioningAssignee: Mike McCune <mmccune>
Status: CLOSED CURRENTRELEASE QA Contact: Beth Nackashi <bnackash>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: rhn-bugs
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: rhn410 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-07-19 20:19:12 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:    
Bug Blocks: 174413    

Description Matthew Davis 2006-07-12 17:09:16 UTC
Description of problem:
In custom %pre/%post scripts bogus chars will show up at the end of the line,
which will cause bash to get confused and not konw what to do.  If you 'wget'
the kickstart and pull the kickstart in vi, you'll see something like this:

%post
(^M
echo "What is my shell?"^M
echo $SHELL^M
echo "running ls /etc/sysconfig/rhn"^M
ls /etc/sysconfig/rhn^M
echo "About to run perl"^M
perl -npe 's/useGPG=1/useGPG=0/g' -i /etc/sysconfig/rhn/up2date^M
echo "running grep"^M
grep -i gpg /etc/sysconfig/rhn/up2date^M
echo "about to run up2date"^M
up2date osad rhncfg-actions^M


Note the ^M's cause bash to fail. 

Version-Release number of selected component (if applicable):
rhn-satellite-4.1.0-136-redhat-linux-as-i386-4-embedded-oracle.iso

How reproducible:
Everytime

Steps to Reproduce:
1. Create a kickstart profile
2. Create custom %post or %pre
3. Add commands to it, make sure there are carriage returns
4. wget http://<host>/kickstart/ks/label/<profile>
5. vi <profile>
6. Scroll down to the %pre or %post section.

Actual results:
^M ending all added lines

Expected results:
Clean text

Comment 1 Mike McCune 2006-07-12 19:41:29 UTC
available if you upgrade your java rpms to:

4.1.0-778



Comment 2 Matthew Davis 2006-07-12 21:12:56 UTC
Works like a charm!  I don't want to konw how, but it works :)

Comment 3 Beth Nackashi 2006-07-19 20:19:12 UTC
moving to closed - currentrelease