Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 384597

Summary: portage mishandles \r within filenames
Product: Portage Development Reporter: Joe Pelkey <pelkeyj>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED FIXED    
Severity: normal Keywords: InVCS
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 381649    
Attachments: app-arch/filename-test/filename-test-1.0.ebuild
app-arch/filename-test/filename-test-1.0-r1.ebuild
filename-test-1.0 build log
filename-test-1.0-r1 build log
/var/db/pkg/app-arch/filename-test-1.0-r1/CONTENTS

Description Joe Pelkey 2011-09-27 04:18:10 UTC
Portage correctly handles \n within a filename by dying if a filename to be installed contains a \n.  However, it does not check for \r which leads to a CONTENTS file parsing error.


Reproducible: Always

Steps to Reproduce:
1. emerge filename-test-1.0 to see \n in a filename fail
2. emerge filename-test-1.0-r1 to see \r succeed yet cause parsing errors

Actual Results:  
for 1:
 * This package installs one or more files containing a newline (\n) character:
 *
 *      /usr/share/doc/filename-test-1.0/LF_\n
 *
 * package app-arch/filename-test-1.0 NOT merged
 *

for 2:
!!! Parse error in '/var/db/pkg/app-arch/filename-test-1.0-r1/CONTENTS'
!!!   line 13: Unrecognized CONTENTS entry
!!!   line 14: Unrecognized CONTENTS entry
>>> app-arch/filename-test-1.0-r1 merged.


Expected Results:  
for 2:
 * This package installs one or more files containing a newline (\n or \r) character:
 *
 *      /usr/share/doc/filename-test-1.0/CR_\r
 *
 * package app-arch/filename-test-1.0 NOT merged
 *
Comment 1 Joe Pelkey 2011-09-27 04:20:31 UTC
Created attachment 287869 [details]
app-arch/filename-test/filename-test-1.0.ebuild
Comment 2 Joe Pelkey 2011-09-27 04:21:03 UTC
Created attachment 287871 [details]
app-arch/filename-test/filename-test-1.0-r1.ebuild
Comment 3 Joe Pelkey 2011-09-27 04:25:14 UTC
Created attachment 287875 [details]
filename-test-1.0 build log
Comment 4 Joe Pelkey 2011-09-27 04:27:33 UTC
Created attachment 287877 [details]
filename-test-1.0-r1 build log
Comment 5 Joe Pelkey 2011-09-27 04:28:36 UTC
Created attachment 287879 [details]
/var/db/pkg/app-arch/filename-test-1.0-r1/CONTENTS
Comment 7 Zac Medico gentoo-dev 2011-09-29 18:49:09 UTC
This is fixed in 2.1.10.20 and 2.2.0_alpha60.