Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unescaping octal escape sequence in values of Quadlet unit files #25011

Conversation

AhmedMoalla
Copy link
Contributor

Currently the unit file parser can unescape any escape sequences present in values looked up using the following lookup functions in the UnitFile struct: LookupAllArgs, LookupAllKeyVal and LookupLastArgs.

This operation is done though the utility function cUnescapeOne . This function was incorrectly ported from the systemd code base in this file: escape.c.

This PR aims to fix the implementation of cUnescapeOne we have in Podman as it does not work properly when unescaping octal escape sequences.

Example:

'\110ello \127orld' gets unescaped to "\x0010ello \x0027orld" but should be "Hello World"

Does this PR introduce a user-facing change?

Fixed a bug where values in Quadlet unit files containing octal escape sequences were incorrectly unescaped

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 15, 2025
@rhatdan
Copy link
Member

rhatdan commented Jan 15, 2025

Thanks @AhmedMoalla
/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 15, 2025
Copy link
Contributor

openshift-ci bot commented Jan 15, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: AhmedMoalla, giuseppe, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 04e6488 into containers:main Jan 15, 2025
79 of 80 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. release-note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants