Bug 1549664

Summary: Error messages when starting bash or less in directory containing file parentheses in its name
Product: [Fedora] Fedora Reporter: Sebastian Keller <sebastian-keller>
Component: environment-modulesAssignee: Jan Synacek <jsynacek>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 28CC: jsynacek, orion, praiskup, xavier.delaruelle
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: environment-modules-4.1.1-2.fc28 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-06 10:53:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Proposed patch against v4.1.1 none

Description Sebastian Keller 2018-02-27 15:32:10 UTC
There are error messages when starting bash or less in a directory that contains a file with parentheses in its name:
$ touch "something (test)"
$ bash
bash: eval: line 43: syntax error near unexpected token `('
bash: eval: line 43: ` something (test) _mlshdbg='' ;;'
bash: export: _moduleraw: not a function

This only seems to happen if there is something preceding the parentheses:
$ touch "(test)"
$ bash
-> No error messages

The error message seems to depend on the name of the file and whatever case it would take in the switch statement in line 5 of /usr/share/Modules/init/bash:
$ touch "vx(test)"
$ bash
bash: eval: line 40: syntax error near unexpected token `('
bash: eval: line 40: ` vx(test) set +vx; _mlshdbg='vx' ;;'
bash: export: _moduleraw: not a function

$ rpm -qa environment-modules
environment-modules-4.1.1-1.fc28.x86_64

Comment 1 Xavier Delaruelle 2018-03-03 10:32:44 UTC
Created attachment 1403369 [details]
Proposed patch against v4.1.1

I have made a fix for this issue: content passed to "eval" on SH-kind shells should be quoted. This fix will be part of next bugfix release (v4.1.2) which will be released in 2/3 weeks.

I attach here a patch against v4.1.1 that can be used by package maintainers to release a fixed version of the v4.1.1 rpm.

Regards,
Xavier