Skip to content

chunked: fix escape of space#1895

Merged
openshift-merge-bot[bot] merged 1 commit intocontainers:mainfrom
giuseppe:fix-escaping-of-paths-with-spaces-composefs
Apr 20, 2024
Merged

chunked: fix escape of space#1895
openshift-merge-bot[bot] merged 1 commit intocontainers:mainfrom
giuseppe:fix-escaping-of-paths-with-spaces-composefs

Conversation

@giuseppe
Copy link
Copy Markdown
Member

the code was copied from the composefs C version:

if (noescape_space)
	hex_escape = !isprint(c);
else
	hex_escape = !isgraph(c);

but unicode.IsGraphic() seems to behave differently and includes the space:

isgraph(' ') -> 0
unicode.IsGraphic(' ') -> true

the code was copied from the composefs C version:

	if (noescape_space)
		hex_escape = !isprint(c);
	else
		hex_escape = !isgraph(c);

but unicode.IsGraphic() seems to behave differently and includes the
space:

isgraph(' ') -> 0
unicode.IsGraphic(' ') -> true

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
@giuseppe
Copy link
Copy Markdown
Member Author

@rhatdan this is the fix for the mkcomposefs: Invalid integer 628 error we have seen

@giuseppe giuseppe marked this pull request as ready for review April 19, 2024 20:20
Copy link
Copy Markdown
Contributor

@kolyshkin kolyshkin left a comment

Choose a reason for hiding this comment

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

Indeed, `isgraph(3) says (emphasis is mine):

   isgraph()
         checks for any printable character **except space**.

and unicode.IsGraphic says:

IsGraphic reports whether the rune is defined as a Graphic by Unicode. Such characters include letters, marks, numbers, punctuation, symbols, and spaces, from categories L, M, N, P, S, Zs.

Somewhat ironic that the test case was obv. wrong.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 20, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe, kolyshkin

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

The pull request process is described here

Details 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

@kolyshkin
Copy link
Copy Markdown
Contributor

/ljtm

@rhatdan
Copy link
Copy Markdown
Member

rhatdan commented Apr 20, 2024

/lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants