Bug 1549664 - Error messages when starting bash or less in directory containing file parentheses in its name
Summary: Error messages when starting bash or less in directory containing file parent...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: environment-modules
Version: 28
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jan Synacek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-02-27 15:32 UTC by Sebastian Keller
Modified: 2018-03-06 10:53 UTC (History)
4 users (show)

Fixed In Version: environment-modules-4.1.1-2.fc28
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-06 10:53:34 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Proposed patch against v4.1.1 (3.46 KB, patch)
2018-03-03 10:32 UTC, Xavier Delaruelle
no flags Details | Diff

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


Note You need to log in before you can comment on or make changes to this bug.