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

Bug 563984

Summary: portage does not consistently validate names (section "3.1 Restrictions upon Names" in PMS)
Product: Portage Development Reporter: Julian Ospald <hasufell>
Component: CoreAssignee: Portage team <dev-portage>
Status: CONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=435934
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 563798    

Description Julian Ospald 2015-10-24 15:48:51 UTC
It accepts junk input like the following for categories:

> öäü/

Repoman is happy and when you put a package inside that directory and want to actually emerge it, portage may fail with an exception:

=====
  File "/usr/lib/python-exec/python2.7/emerge", line 50, in <module>
    retval = emerge_main()
  File "/usr/lib64/python2.7/site-packages/_emerge/main.py", line 1154, in emerge_main
    return run_action(emerge_config)
  File "/usr/lib64/python2.7/site-packages/_emerge/actions.py", line 3191, in run_action
    emerge_config.args, spinner)
  File "/usr/lib64/python2.7/site-packages/_emerge/actions.py", line 498, in action_build
    retval = mergetask.merge()
  File "/usr/lib64/python2.7/site-packages/_emerge/Scheduler.py", line 947, in merge
    self._save_resume_list()
  File "/usr/lib64/python2.7/site-packages/_emerge/Scheduler.py", line 1825, in _save_resume_list
    mtimedb["resume"]["favorites"] = [str(x) for x in self._favorites]
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 2: ordinal not in range(128)
=====

Other input might be affected as well, I did not test all of it. Some of it causes other exceptions, sometimes earlier, sometimes unrelated.


https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-180003.1.1
Comment 1 Julian Ospald 2015-10-24 19:51:50 UTC
package names are similarly affected

it seems the biggest problems are non-ascii chars
Comment 2 Julian Ospald 2015-10-24 20:20:48 UTC
for SLOTs, umlauts [öäü] are accepted and package emerges successfully
Comment 3 Julian Ospald 2015-10-24 20:27:14 UTC
for USE flag names in IUSE, it accepts something like

> IUSE="+öoü +~foo +=doo +%ii +2##"

and repoman is happy and portage emerges this successfully
Comment 4 Arfrever Frehtes Taifersar Arahesis 2015-10-24 20:39:24 UTC

*** This bug has been marked as a duplicate of bug 435934 ***
Comment 5 Julian Ospald 2015-10-24 21:07:06 UTC
This is not the duplicate, see comment #3 especially, which contains ascii characters which are invalid as per PMS.