debugedit prints: canonicalization unexpectedly shrank by one character
Bug #638633 reported by
Jeff Johnson
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
RPM |
Won't Fix
|
Medium
|
Jeff Johnson | ||
CentOS |
Fix Released
|
Medium
|
|||
Fedora |
Fix Released
|
Medium
|
|||
Mandriva |
Unknown
|
High
|
Bug Description
tracker
tags: | added: debugedit fedora |
Changed in mandriva: | |
importance: | Unknown → High |
Changed in rpm: | |
status: | Confirmed → Won't Fix |
assignee: | nobody → Jeff Johnson (n3npq) |
Changed in fedora: | |
importance: | Unknown → Medium |
status: | Unknown → Fix Released |
Changed in centos: | |
importance: | Unknown → Medium |
status: | Unknown → Fix Released |
To post a comment you must log in.
Looks like the new rpm 4.4.2.3-9.el5 package brings this bug to RHEL 5.3. This is proving to be quite serious.
+++ This bug was initially created as a clone of Bug #304121 +++
Description of problem:
When a the source directory for a file ends with a '/', debugedit can spit out a
"canonicalization unexpectedly shrank by one character" error and fail. That's
not really enough for most people to figure out what's gone wrong or how to fix it.
Version-Release number of selected component (if applicable): 4.4.2.2- 0.5.rc2
rpm-build-
How reproducible:
Always
Steps to Reproduce: rpm/debugedit -b `pwd` -d / foo
1. mkdir src
2. cat > src/foo.c <<- EOF
int
main(int argc, char **argv)
{
return 0;
}
EOF
3. cd src
4. gcc -g3 -o foo ../src//foo.c
5. /usr/lib/
Actual results: rpm/debugedit: canonicalization unexpectedly shrank by one character
/usr/lib/
Expected results:
Either not fail, or indicate that a directory name in the table ended with a
'/', which it probably shouldn't have contained.
Additional info:
I actually ran into this with openafs 1.4.4, but I'm including a smaller
reproducer which I think triggers the same bug.
--- Additional comment from <email address hidden> on 2007-09-27 04:49:46 EDT ---
Hmm, it's not the trailing '/' that troubles debugedit per se but the fact that
the canonicalized path is exactly one character shorter than the original which
is a case that it can't (and can't be made to AFAICT) handle. Roland, care to
comment?
The error message could certainly be clearer on what sort of problem to look for
(basically single extra '/' somewhere in the path).
--- Additional comment from <email address hidden> on 2007-09-27 19:26:18 EDT ---
Indeed, the format makes it impossible to do rewriting in place unless the table
shrinks by at least 2 or not at all (it's beyond the scope of debugedit to
resize things). For cases in the directory table you could do an ugly kludge by
repeating the leading / or adding a trailing one to preserve the size. But
there is no trick like that to do in the file table, where any leading or
trailing slash would change the final file name so it doesn't work (not just is
wrongly ugly). The !=-1 size restriction is for the whole table cumulatively,
so with extra slashes removed by canonicalization, it is only a problem when
there is only one such file name. It could do a kludge of adding a trailing
slash to some dir table entry when this arises, which would work and only uglify
some of the names to /foo//bar. Still, I suspect packagers will be OK with it
being an error they have to fix or work around, if they can tell what to do.
The error message you get now is certainly pretty arcane. The other error of
the same ilk has a better message.
Looking at canonicalize_path, I think it is true that a doubled / is the only
way it could shrink by exactly one. But I could use a second set of eyes to
verify there really is no obscure innocent case that could do that. If that's
true, then we can simply change the error message to identify this problem.
--- Additional comment from <email address hidden> on 2007-11-14 05:53:44 EDT ---
FYI, the instance that triggers this bug has apparently ...