Bug 2121877

Summary: sshkey entries aren't properly escaped when they contain quotes in anaconda-ks.cfg
Product: Red Hat Enterprise Linux 9 Reporter: Brian Lane <bcl>
Component: pykickstartAssignee: Brian Lane <bcl>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: low Docs Contact:
Priority: unspecified    
Version: 9.2CC: anaconda-maint-list, bcl, extras-qa, jikortus, jkonecny, jonathan, jstodola, kellin, mkolman, mvanwinkle, rvykydal, vanmeeuwen+fedora, vponcova, w
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: pykickstart-3.32.9-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2117734 Environment:
Last Closed: 2023-05-09 07:43:30 UTC Type: Bug
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: 2117734    
Bug Blocks: 2149362    

Description Brian Lane 2022-08-26 22:48:18 UTC
+++ This bug was initially created as a clone of Bug #2117734 +++

Description of problem:

I'm unsure if this is still a problem with the current version, and I'm building on Springdale Linux 9, buuut:

In my kickstart file I have:

```
sshkey --username=root "from=\"192.168.1.1\" ssh-rsa ...
```
And in anaconda-ks.cfg, you get:

```
sshkey --username=root "from=192.168.1.1" ssh-rsa 

```

If you notice, the slashes escaping the quotes are missing.


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


How reproducible:

Any build with an sshkey entry that has from="..." in it.


Steps to Reproduce:
1.  Build a machine with an sshkey that has a "from" entry with quotes.
2.  Quotes aren't properly escaped in resulting ~root/anaconda-ks.cfg
3.

Actual results:


Expected results:

Quotes properly escaped.

Additional info:

Sorry if this still isn't a bug, I'm putting this together in a rush.

--- Additional comment from Brian Lane on 2022-08-15 11:08:08 PDT ---

This is a bug in pykickstart, thanks for reporting it.

--- Additional comment from Brian Lane on 2022-08-26 15:47:22 PDT ---

https://github.com/pykickstart/pykickstart/pull/422

Comment 10 Jan Stodola 2022-12-05 12:04:10 UTC
Checked that pykickstart-3.32.9-1.el9 is in nightly compose RHEL-9.2.0-20221204.0

Moving to VERIFIED

Comment 12 errata-xmlrpc 2023-05-09 07:43:30 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (pykickstart bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2290