Bug 578922
Summary: | modules prepend-path corrupts environment variables during load and unload by removing the empty path | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Edgar Hoch <edgar.hoch> |
Component: | environment-modules | Assignee: | Orion Poplawski <orion> |
Status: | CLOSED WONTFIX | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | low | ||
Version: | 12 | CC: | dakingun, orion |
Target Milestone: | --- | Keywords: | Reopened |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2010-12-03 16:28:14 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Edgar Hoch
2010-04-01 18:33:52 UTC
I want to remark that the described problem is only solved if the path modifying commands preserve the empty path in the environment variable if it was there before. That means that the variable should contain the empty path both after the module load and after the module unload command! Here is a more detailed description about the expected behaviour of "prepend-path". The appropriate behaviour should have "append-path" in the case where the empty path is at the end of value of the variable. Assume the following command in a modulesfile: prepend-path LD_LIBRARY_PATH /path/to/prepend/library prepend-path MANPATH /path/to/prepend/man Then the values should change by module load and module unload in this way: Start value -> value after module load -> value after module unload LD_LIBRARY_PATH (and other variables): "" (empty or unset variable) -> "/path/to/prepend/lib" -> "" "/my/lib:/other/lib" -> "/path/to/prepend/lib:/my/lib:/other/lib" -> "/my/lib:/other/lib" ":/my/lib:/other/lib:" -> "/path/to/prepend/lib::/my/lib:/other/lib:" -> ":/my/lib:/other/lib:" ":" -> "/path/to/prepend/lib:" -> ":" In the last case I am not sure if "/path/to/prepend/lib::" after module load would also be ok? MANPATH and any environment path variable where the empty path has a special meaning (like in TEXINPUTS for LaTeX for example) are special cases where an unset variable or an empty value means the same as an empty path (and will be replaced by a system or default path by the application). In this case an empty or unset variable should be considered as the variable contains the empty path already. "" (empty or unset variable) -> "/path/to/prepend/man:" -> "" "/my/man:/other/man" -> "/path/to/prepend/man:/my/man:/other/man" -> "/my/man:/other/man" ":/my/man:/other/man:" -> "/path/to/prepend/man::/my/man:/other/man:" -> ":/my/man:/other/man:" ":" -> "/path/to/prepend/man:" -> ":" In the last case I am not sure if "/path/to/prepend/man::" after module load would also be ok? I'm not sure if all environment variables can be handled like the MANPATH case? If this would be acceptable and if it doesn't matter if the variable value contains two empty paths consecutively, then the following rule may be possible: "prepend-path" may simply add the /path/to/prepend/man followed by a colon to the path when module load is called. To undo the operation when module unload is called simply remove the added path and one colon if there exists one after the removed path. The similar behaviour should have "append-path" for the empty path at the end of the value of the variable. Another possible solution may be to mark some environment variables whether to preserve empty paths and consider unset variables or empty values as empty paths or not. But this makes it necessary that environment-modules hast a big list of nearly any usually used environment variable, and the user can declare the type of his own variables. You may also create additional commands or add options to existing commands to control if empty paths should preserved and unset variables or empty values should considered as empty paths. I'm not sure which will be the best solution - what do you think? environment-modules-3.2.7b-7.fc12 currently in updates-testing already has a fix. If you want to test the update, you can install it with su -c 'yum --enablerepo=updates-testing update environment-modules' *** This bug has been marked as a duplicate of bug 569826 *** Deji - This is a different issue. I've forwarded to the environment modules mailing list. We'll see what that turns up. No response on the modules list unfortunately. Edgar - could you follow up on this upstream? There's nothing in the Fedora package in this area that would be different than the default behavior. This message is a reminder that Fedora 12 is nearing its end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 12. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '12'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 12's end of life. Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 12 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug to the applicable version. If you are unable to change the version, please add a comment here and someone will do it for you. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping Fedora 12 changed to end-of-life (EOL) status on 2010-12-02. Fedora 12 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. Thank you for reporting this bug and we are sorry it could not be fixed. |