Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 730432 - sys-apps/gentoo-functions-0.13: einfo* & co. fail horribly if messages contain percent sign
Summary: sys-apps/gentoo-functions-0.13: einfo* & co. fail horribly if messages contai...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: William Hubbs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-02 06:39 UTC by Michał Górny
Modified: 2020-07-06 12:32 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Refactor printf calls (0001-functions.sh-refactor-printf-calls.patch,3.72 KB, patch)
2020-07-04 16:15 UTC, Mike Gilbert
Details | Diff
Refactor printf calls v2 (0001-functions.sh-refactor-printf-calls.patch,3.73 KB, patch)
2020-07-04 16:23 UTC, Mike Gilbert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-07-02 06:39:53 UTC
$ . /lib/gentoo/functions.sh 
$ einfo "test%test"
 * test0,000000e+00st
$ einfo "test%PYTHON_USEDEP%"
bash: printf: `P': invalid format character
 * test
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2020-07-03 11:49:23 UTC
FTFY
Comment 2 Mike Gilbert gentoo-dev 2020-07-04 16:15:45 UTC
Created attachment 647584 [details, diff]
Refactor printf calls
Comment 3 Mike Gilbert gentoo-dev 2020-07-04 16:23:36 UTC
Created attachment 647586 [details, diff]
Refactor printf calls v2
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-07-04 16:35:10 UTC
You probably want %b, as it's  supposed to handle escapes.
Comment 5 Mike Gilbert gentoo-dev 2020-07-04 23:49:50 UTC
(In reply to Michał Górny from comment #4)
> You probably want %b, as it's  supposed to handle escapes.

Yeah, that makes sense. This might also be a good opportunity to make the behavior more closely match Portage's implementation.