Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

FS#8975 - Pacman error in output string formating

Attached to Project: Pacman
Opened by Damjan Georgievski (damjan) - Wednesday, 19 December 2007, 21:56 GMT
Last edited by Dan McGee (toofishes) - Friday, 11 January 2008, 13:06 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To Dan McGee (toofishes)
Architecture All
Severity Low
Priority Normal
Reported Version 3.0.6
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Package: pacman 3.0.6-2

I discovered this by accident.. when I run:

$ pacman -Qo '/opt/gnome/etc/gconf/gconf.xml.defaults/%gconf-tree.xml'
error: No package owns /opt/gnome/etc/gconf/gconf.xml.defaults/-4,12928e-79conf-tree.xml

It seems that when outputing %gconf, the %g was changed to -4,12928e-79.
I've not checked the source, but I guess it finds the number from some random memory address, which could potentionally be dangerous.
This task depends upon

Closed by  Dan McGee (toofishes)
Friday, 11 January 2008, 13:06 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed in 3.1.0

This is a format string type issue, and we must have fixed it at some time. About ten minutes of looking at the code and I can't find where.
Comment by Jens Adam (byte) - Friday, 21 December 2007, 00:22 GMT
This belongs into the "Pacman" project, not "Arch Linux".
Comment by Roman Kyrylych (Romashka) - Friday, 11 January 2008, 12:31 GMT
OK, so pacman cannot find the owner of /opt/gnome/etc/gconf/gconf.xml.defaults/%gconf-tree.xml
and prints the filename with printf, but %g has a special meaning for printf-like functions.
So pacman should replace % with %% in paths before printf-ing them.
Comment by Roman Kyrylych (Romashka) - Friday, 11 January 2008, 12:34 GMT
And here it is in query.c:
122 if(!found) {
123 fprintf(stderr, _("error: No package owns %s\n"), filename);
124 ret++;
125 }
There should be something like escape_special_chars(filename) here.
Comment by Roman Kyrylych (Romashka) - Friday, 11 January 2008, 12:42 GMT
Ehm, in fact, there shouldn't be a bug here. %)
Shouldn't printf("%s", "%gconf") output "%gconf" instead of "-4,12928e-79conf" anyway?
Comment by Roman Kyrylych (Romashka) - Friday, 11 January 2008, 12:52 GMT
Damn, me, trying to find 3.0.6 bug in 3.1 :D
Comment by Roman Kyrylych (Romashka) - Friday, 11 January 2008, 12:53 GMT
@Damjan: this seems to be fixed in 3.1 (3.0.6 used some funky ERR macros instead), please confirm.

@Dan: sorry for bugspamming. :-(

Loading...